创建任务

This commit is contained in:
lq
2025-09-24 16:27:52 +08:00
parent 20fb29f3af
commit 7bb1984b3b
4 changed files with 16 additions and 6 deletions

View File

@ -393,6 +393,7 @@ const handleProductDrawerVisibleChange = (visible: boolean) => {
// 处理筛选条件变化 // 处理筛选条件变化
const handleChange = (field, value) => { const handleChange = (field, value) => {
localQuery.value[field] = value; localQuery.value[field] = value;
localQuery.value.ids = [value];
emit('filter-change', { emit('filter-change', {
accounts: localQuery.value.accounts, accounts: localQuery.value.accounts,
}); });

View File

@ -244,6 +244,7 @@ const onAfterVisibleChange = (visible: boolean) => {
// 抽屉关闭事件处理 // 抽屉关闭事件处理
const handleClose = () => { const handleClose = () => {
emit('update:visible', false); emit('update:visible', false);
emit('cancel');
}; };
// 取消按钮处理 // 取消按钮处理

View File

@ -265,6 +265,7 @@ const onAfterVisibleChange = (visible: boolean) => {
// 抽屉关闭事件处理 // 抽屉关闭事件处理
const handleClose = () => { const handleClose = () => {
emit('update:visible', false); emit('update:visible', false);
emit('cancel');
}; };
// 取消按钮处理 // 取消按钮处理

View File

@ -76,9 +76,9 @@
修改发布时间 修改发布时间
</button> --> </button> -->
<a-date-picker <a-date-picker
v-model="datePickerValue" v-model:value="datePickerValue"
placeholder="修改发布时间" placeholder="修改发布时间"
show-time :show-time="{ format: 'HH:mm' }"
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
value-format="YYYY-MM-DD HH:mm" value-format="YYYY-MM-DD HH:mm"
@change="onChange" @change="onChange"
@ -149,11 +149,14 @@ const getTaskDetail = async () => {
const onChange = (date, dateString) => { const onChange = (date, dateString) => {
console.log('Selected Date: ', date, dateString); console.log('Selected Date: ', date, dateString);
if (date) {
emit('handle-task', 'edit-time', props.task, dateString);
}
}; };
const onOk = (value) => { const onOk = (value) => {
console.log('DatePicker OK: ', value);
if (value) { if (value) {
console.log('DatePicker OK: ', value);
emit('handle-task', 'edit-time', props.task, value); emit('handle-task', 'edit-time', props.task, value);
} }
}; };
@ -171,7 +174,11 @@ const gotoDetail = () => {
console.log('跳转详情'); console.log('跳转详情');
emit('handle-task', 'goto-detail', props.task, props.record); 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 = () => { const handleAICreate = () => {
emit('handle-task', 'ai-create', props.task, props.record); emit('handle-task', 'ai-create', props.task, props.record);
}; };
@ -193,7 +200,7 @@ const timestampToTime1 = (timestamp: number): string => {
if (!timestamp) { if (!timestamp) {
timestamp = Date.now() / 1000; // 使用秒级时间戳保持一致性 timestamp = Date.now() / 1000; // 使用秒级时间戳保持一致性
} }
const date = new Date(timestamp * 1000); const date = new Date(timestamp * 1000);
const year = date.getFullYear(); const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 补零 const month = String(date.getMonth() + 1).padStart(2, '0'); // 补零
@ -205,7 +212,7 @@ const timestampToTime1 = (timestamp: number): string => {
const emit = defineEmits(['filter-change', 'handle-task']); const emit = defineEmits(['filter-change', 'handle-task']);
// 日期选择器的值 // 日期选择器的值
const datePickerValue = ref('2025-09-25 16:18'); const datePickerValue = ref(null);
// 平台配置 // 平台配置
const platformConfig = { const platformConfig = {