task
This commit is contained in:
@ -1,8 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="task-item" @click="handleTask(task, record)">
|
<a-trigger trigger="click" position="br">
|
||||||
<div class="w-4px h-18px rounded-2px" :style="{ background: getTaskColor() }"></div>
|
<div class="task-item" @click="handleTask(task, record)">
|
||||||
<div>{{ task?.name || '-' }}</div>
|
<div class="w-4px h-18px rounded-2px" :style="{ background: getTaskColor() }"></div>
|
||||||
</div>
|
<div>{{ task?.name || '-' }}</div>
|
||||||
|
</div>
|
||||||
|
<template #content>
|
||||||
|
<div
|
||||||
|
class="flex flex-col items-start"
|
||||||
|
style="background-color: #fff; padding: 12px; box-shadow: #00000010 0px 2px 8px; border-radius: 4px"
|
||||||
|
></div>
|
||||||
|
</template>
|
||||||
|
</a-trigger>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -11,11 +19,17 @@ const props = defineProps({
|
|||||||
task: Object,
|
task: Object,
|
||||||
record: Object,
|
record: Object,
|
||||||
});
|
});
|
||||||
|
// 时间戳转时间格式 (HH:MM)
|
||||||
|
const timestampToTime = (timestamp: number): string => {
|
||||||
|
const date = new Date(timestamp * 1000); // 假设时间戳是秒级
|
||||||
|
// 获取小时和分钟
|
||||||
|
const hours = date.getHours().toString().padStart(2, '0');
|
||||||
|
const minutes = date.getMinutes().toString().padStart(2, '0');
|
||||||
|
|
||||||
const emit = defineEmits(['filter-change', 'handle-task']);
|
return `${hours}:${minutes}`;
|
||||||
const handleTask = (task, record) => {
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
const emit = defineEmits(['filter-change', 'handle-task']);
|
||||||
|
const handleTask = (task, record) => {};
|
||||||
// 根据任务类型获取颜色
|
// 根据任务类型获取颜色
|
||||||
const getTaskColor = () => {
|
const getTaskColor = () => {
|
||||||
if (!props.task) return '#000';
|
if (!props.task) return '#000';
|
||||||
|
|||||||
Reference in New Issue
Block a user