From 00a99b65121d168d7232a161e142aab18be504cd Mon Sep 17 00:00:00 2001 From: lq <121091329@qq.com> Date: Thu, 25 Sep 2025 14:31:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/draw-popup.vue | 38 ++++------ .../components/task-item.vue | 70 +++++++++---------- .../assignment-management/index.vue | 12 +++- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/views/property-marketing/assignment-management/components/draw-popup.vue b/src/views/property-marketing/assignment-management/components/draw-popup.vue index 5ac260f..6c00f83 100644 --- a/src/views/property-marketing/assignment-management/components/draw-popup.vue +++ b/src/views/property-marketing/assignment-management/components/draw-popup.vue @@ -1,11 +1,8 @@ + + + + + + 取消 + 创建任务 + + + @@ -415,21 +422,6 @@ const handleDateChange = (date) => { // 日期处理逻辑 }; -// 抽屉显示状态变化 -const showDriwerChange = (visible: boolean) => { - console.log('Main Drawer visible: ', visible); -}; - -// 原料库抽屉显示状态变化 -const handleMaterialDrawerVisibleChange = (visible: boolean) => { - console.log('Raw Material Drawer visible: ', visible); -}; - -// 成品库抽屉显示状态变化 -const handleProductDrawerVisibleChange = (visible: boolean) => { - console.log('Finished Product Drawer visible: ', visible); -}; - // 处理筛选条件变化 const handleChange = (field, value) => { localQuery.value[field] = value; @@ -439,6 +431,10 @@ const handleChange = (field, value) => { }); }; +const handleCancel = () => { + showDriwer.value = false; +}; + // 点击创建任务按钮时触发 const handleCreateTask = () => { // 验证表单 @@ -452,11 +448,6 @@ const handleCreateTask = () => { message.error('请选择发布内容'); return; } - if (isActive.value === 'ai' && selectedMaterials.value.keys.length === 0) { - // 可以添加错误提示:请选择发布内容 - message.error('请选择发布内容'); - return; - } console.log('有问题已返回'); // 准备提交的数据 const taskData = { @@ -472,7 +463,6 @@ const handleCreateTask = () => { }; // 发射创建任务事件 emit('create-task', taskData); - // 关闭抽屉 showDriwer.value = false; }; diff --git a/src/views/property-marketing/assignment-management/components/task-item.vue b/src/views/property-marketing/assignment-management/components/task-item.vue index 4786bd4..af6c223 100644 --- a/src/views/property-marketing/assignment-management/components/task-item.vue +++ b/src/views/property-marketing/assignment-management/components/task-item.vue @@ -1,5 +1,5 @@ - + {{ timestampToTime(task.execution_time) }} @@ -31,17 +31,15 @@ {{ timestampToTime1(task.execution_time) }} - {{ task.name || 'AI生成内容' }} - + 内容生成中... 完成后将自动展示,您可先返回其他操作 - - + - - - - - - - - - AI立即生成 - + + + + + + + + 修改任务 + + AI立即生成 + + @@ -120,10 +117,8 @@ const choseTextArray = ref([]); const choseVideoArray = ref([]); const getTaskDetail = async () => { if (!props.task || !props.task.id) return; - try { const res = await getTaskSchedulesDetail(props.task.id); - if (res && res.data) { datePickerValue.value = dayjs(res.data.execution_time * 1000); console.log('任务详情:', datePickerValue.value); @@ -156,6 +151,7 @@ const onOk = (value) => { }; const onPopupVisibleChange = (visible) => { + popupVisible.value = visible; if (visible) { getTaskDetail(); } @@ -168,21 +164,22 @@ const gotoDetail = () => { console.log('跳转详情'); emit('handle-task', 'goto-detail', props.task, props.record); }; -const handleTimeChange = (time: string) => { - // if (time) { - // emit('handle-task', 'edit-time', props.task, timestampToTime1() + ' ' + time + ':00'); - // } -}; + const handleAICreate = () => { emit('handle-task', 'ai-create', props.task, props.record); }; + +const handleEditTask = () => { + // 关闭当前弹窗 + popupVisible.value = false; + emit('handle-task', 'edit-task', props.task, props.record); +}; + const timestampToTime = (timestamp: number): string => { // 如果没有传入时间戳,则返回空字符串 if (!timestamp) return ''; - // 将时间戳转换为毫秒(如果时间戳是秒单位的话) const date = new Date(timestamp * 1000); - // 格式化为 HH:mm 格式 const hours = String(date.getHours()).padStart(2, '0'); const minutes = String(date.getMinutes()).padStart(2, '0'); @@ -205,6 +202,9 @@ const timestampToTime1 = (timestamp: number): string => { const emit = defineEmits(['filter-change', 'handle-task']); +// 添加控制弹窗显示的响应式变量 +const popupVisible = ref(false); + // 日期选择器的值 const datePickerValue = ref(null); diff --git a/src/views/property-marketing/assignment-management/index.vue b/src/views/property-marketing/assignment-management/index.vue index 7238362..e72b7a8 100644 --- a/src/views/property-marketing/assignment-management/index.vue +++ b/src/views/property-marketing/assignment-management/index.vue @@ -248,7 +248,6 @@ const processTableData = (apiData: any[]) => { // 创建任务 const handleAddTask = () => { - console.log('handleAddTask'); drawerPopupRef.value?.showDrawer(); }; @@ -505,6 +504,17 @@ const handleTaskAction = async (action: string, task: any, ...args: any[]) => { message.success(res.message); } break; + case 'edit-task': + console.log('edit-task', args[0], typeof args[0]); + const accountInfo = { + id: args[0].id, + name: args[0].name, + platform: args[0].platform, + }; + const selectedDate = task.execution_time; + const date = new Date(selectedDate); + drawerPopupRef.value.showDrawer(accountInfo, date); + break; } };