创建时间

This commit is contained in:
lq
2025-09-20 11:25:34 +08:00
parent c70b44022b
commit 15492d6d33
3 changed files with 85 additions and 68 deletions

View File

@ -1,33 +1,28 @@
<template>
<a-trigger trigger="click" position="bl">
<a-trigger trigger="click" position="br" @click.stop>
<div class="task-item">
<div class="w-4px h-18px rounded-2px" :style="{ background: getTaskColor() }"></div>
<div>{{ task?.name || '-' }}</div>
<div class="color-indicator" :style="{ background: getTaskColor() }"></div>
<div class="task-name" :title="task?.name || '-'">{{ task?.name || '-' }}</div>
</div>
<template #content>
<div
class="flex flex-col items-start"
style="background-color: #fff; box-shadow: #e6e6e8 0px 2px 8px; border-radius: 4px"
@click="gotoDetail"
>
<div class="flex flex-col items-start popup-content" @click="gotoDetail">
<div class="flex flex-col items-start p-16px w-full" @click="gotoDetail">
<div class="flex justify-between w-full items-center">
<div class="flex items-center">
<div class="flex items-center title-container">
<img
:src="getPlatformIcon(record.platform)"
style="border-radius: 8px; width: 16px; height: 16px; margin-right: 8px; font-size: 14px"
/>
<div style="font-size: 16px; font-style: medium; font-weight: 500">{{ record.name || '-' }}</div>
<div class="task-title" :title="record.name || '-'">{{ record.name || '-' }}</div>
</div>
<div
class="status-tag"
:style="{
color: getTaskColor(),
backgroundColor: getTaskColor() + '50',
padding: '2px 8px',
borderRadius: '4px',
}"
>
{{ getTaskStatusText(record.status) }}
{{ getTaskStatusText(task.status) }}
</div>
</div>
@ -36,13 +31,13 @@
</div>
</div>
<div class="font-size-14px color-#211F24 color-#211F24 p-12px" style="margin-top: -10px">
<div class="font-size-14px color-#211F24 color-#211F24 p-12px task-description" :title="task.name || '未命名'">
{{ task.name || '未命名' }}
</div>
<div class="flex items-center mt-12px w-full h-1px bg-#E6E6E8"></div>
<div class="flex items-center mt-12px mb-16px">
<div class="flex items-center mt-12px mb-16px action-buttons">
<div class="flex items-center mr-12px" @click.stop="handleDelete">
<icon-delete style="font-size: 20px; margin: 0px 22px" />
<icon-delete style="font-size: 20px; margin-left: 16px" />
</div>
<button class="opt-btn" @click.stop="handleTimeChange">修改发布时间</button>
<button class="opt-btn ml-12px opt-right mr-16px" @click.stop="handleAICreate">AI立即生成</button>
@ -70,6 +65,10 @@ const props = defineProps({
record: Object,
});
onMounted(() => {
console.log('props.task', props.task, props.record);
});
const isPanelVisible = ref(false);
const toggleTimePanel = () => {
isPanelVisible.value = !isPanelVisible.value;
@ -141,6 +140,7 @@ const getTaskColor = () => {
};
const getTaskStatusText = (status) => {
console.log('任务状态:', status);
switch (status) {
case 0:
return '待生成';
@ -164,12 +164,68 @@ const getTaskStatusText = (status) => {
display: flex;
align-items: center;
gap: 4px;
min-width: 0;
&:last-child {
margin-bottom: 0;
}
}
.color-indicator {
width: 4px;
height: 18px;
border-radius: 2px;
flex-shrink: 0;
}
.task-name {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
min-width: 0;
width: 0;
}
.popup-content {
width: 388px;
background-color: #fff;
box-shadow: #e6e6e8 0px 2px 8px;
border-radius: 4px;
}
.title-container {
flex: 1;
min-width: 0;
}
.task-title {
font-size: 16px;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
min-width: 0;
line-height: 1.2;
}
.task-description {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 1.2;
flex: 1;
min-width: 0;
width: 365px;
}
.status-tag {
padding: 2px 8px;
border-radius: 4px;
flex-shrink: 0;
}
.opt-btn {
width: 154px;
height: 32px;