删除任务
This commit is contained in:
@ -135,12 +135,7 @@
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<div class="w-70px">账号名称</div>
|
||||
<a-input
|
||||
v-model="query.name"
|
||||
class="!w-200px"
|
||||
placeholder="输入账号名称"
|
||||
@change="handleSearch"
|
||||
/>
|
||||
<a-input v-model="query.name" class="!w-200px" placeholder="输入账号名称" @change="handleSearch" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -187,25 +182,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<template #content>
|
||||
<div class="flex flex-col items-start cell-detail">
|
||||
<div class="flex items-center">
|
||||
<img
|
||||
:src="getPlatformIcon(record.platform)"
|
||||
style="border-radius: 8px; width: 16px; height: 16px; margin-right: 8px; font-size: 14px"
|
||||
/>
|
||||
{{ record.name || '-' }}
|
||||
</div>
|
||||
<div class="size-12px color-#939499 mt-2px">
|
||||
{{ timestampToTime1(record[column.dataIndex][0].execution_time) }}
|
||||
</div>
|
||||
<div class="size-14px color-#211F24 mt-12px">
|
||||
{{ record[column.dataIndex][0].name || '未命名' }}
|
||||
</div>
|
||||
<div class="flex items-center mt-12px">
|
||||
<div class="opt-btn">修改发布时间</div>
|
||||
<div class="opt-btn" style="margin-right: 0px">删除</div>
|
||||
</div>
|
||||
</div>
|
||||
<TaskDetail
|
||||
:task="record[column.dataIndex][0]"
|
||||
:record="record"
|
||||
:get-platform-icon="getPlatformIcon"
|
||||
@edit-time="handleModifyTime"
|
||||
@delete="handleDelete"
|
||||
@delete-task="handleDelete"
|
||||
/>
|
||||
</template>
|
||||
</a-trigger>
|
||||
</div>
|
||||
@ -229,29 +213,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<template #content>
|
||||
<div class="flex flex-col items-start cell-detail">
|
||||
<div class="flex items-center">
|
||||
<img
|
||||
:src="getPlatformIcon(record.platform)"
|
||||
style="
|
||||
border-radius: 8px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-right: 8px;
|
||||
font-size: 14px;
|
||||
"
|
||||
/>
|
||||
{{ record.name || '-' }}
|
||||
</div>
|
||||
<div class="size-12px color-#939499 mt-2px">
|
||||
{{ timestampToTime1(task.execution_time) }}
|
||||
</div>
|
||||
<div class="size-14px color-#211F24 mt-12px">{{ task.name || '未命名' }}</div>
|
||||
<div class="flex items-center mt-12px">
|
||||
<div class="opt-btn">修改发布时间</div>
|
||||
<div class="opt-btn" style="margin-right: 0px">删除</div>
|
||||
</div>
|
||||
</div>
|
||||
<TaskDetail
|
||||
:task="task"
|
||||
:record="record"
|
||||
:get-platform-icon="getPlatformIcon"
|
||||
@edit-time="handleModifyTime"
|
||||
@delete="handleDelete"
|
||||
@delete-task="handleDelete"
|
||||
/>
|
||||
</template>
|
||||
</a-trigger>
|
||||
</div>
|
||||
@ -273,23 +242,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<template #content>
|
||||
<div class="flex flex-col items-start cell-detail">
|
||||
<div class="flex items-center">
|
||||
<img
|
||||
:src="getPlatformIcon(record.platform)"
|
||||
style="border-radius: 8px; width: 16px; height: 16px; margin-right: 8px; font-size: 14px"
|
||||
/>
|
||||
{{ record.name || '-' }}
|
||||
</div>
|
||||
<div class="size-12px color-#939499 mt-2px">
|
||||
{{ timestampToTime1(task.execution_time) }}
|
||||
</div>
|
||||
<div class="size-14px color-#211F24 mt-12px">{{ task.name || '未命名' }}</div>
|
||||
<div class="flex items-center mt-12px">
|
||||
<div class="opt-btn">修改发布时间</div>
|
||||
<div class="opt-btn" style="margin-right: 0px">删除</div>
|
||||
</div>
|
||||
</div>
|
||||
<TaskDetail
|
||||
:task="task"
|
||||
:record="record"
|
||||
:get-platform-icon="getPlatformIcon"
|
||||
@edit-time="handleModifyTime"
|
||||
@delete="handleDelete"
|
||||
/>
|
||||
</template>
|
||||
</a-trigger>
|
||||
</div>
|
||||
@ -299,12 +258,18 @@
|
||||
</a-table>
|
||||
</div>
|
||||
</div>
|
||||
<a-modal v-model:visible="showModal" @ok="handleOk" @cancel="handleCancel" ok-text="确认删除">
|
||||
<template #title> {{ deleteTitle }} </template>
|
||||
<div>
|
||||
{{ deleteContent }}
|
||||
</div>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, onMounted, watch, computed, nextTick } from 'vue';
|
||||
import type { TableColumnData } from '@arco-design/web-vue';
|
||||
import { getTaskSchedules } from '@/api/all/assignment-management';
|
||||
import { getTaskSchedules, delTaskSchedules } from '@/api/all/assignment-management';
|
||||
import { fetchAccountOperators } from '@/api/all/propertyMarketing';
|
||||
|
||||
import icon1 from '@/assets/img/platform/icon-dy.png';
|
||||
@ -316,8 +281,12 @@ import icon6 from '@/assets/img/platform/icon-gzh.png';
|
||||
import icon7 from '@/assets/img/platform/icon-ks.png';
|
||||
import icon8 from '@/assets/img/platform/icon-bilibili.png';
|
||||
import DateUtils from '@/utils/DateUtils';
|
||||
|
||||
import TaskDetail from './components/TaskDetail.vue';
|
||||
const currentTask = ref();
|
||||
const visible = ref(false);
|
||||
const deleteTitle = ref('');
|
||||
const deleteContent = ref('');
|
||||
const showModal = ref(false);
|
||||
const modalVisible = ref(false);
|
||||
const selectedTask = ref<any>(null);
|
||||
|
||||
@ -357,21 +326,36 @@ const query = reactive({
|
||||
execution_time: [] as string[],
|
||||
});
|
||||
|
||||
// 显示所有的
|
||||
const handleMore = (record: any, column: any) => {
|
||||
console.log('record', record);
|
||||
console.log('column', column);
|
||||
console.log('data', record[column.dataIndex]);
|
||||
// 处理删除操作
|
||||
const handleDelete = (task: any) => {
|
||||
currentTask.value = task;
|
||||
if (task.type == 1) {
|
||||
deleteTitle.value = '删除内容稿件排期';
|
||||
} else {
|
||||
deleteTitle.value = '删除选题排期';
|
||||
}
|
||||
deleteContent.value = '确认删除“' + task.name + '”吗?';
|
||||
showModal.value = true;
|
||||
};
|
||||
|
||||
const handleCell = (record: any, column: any, task: any) => {
|
||||
selectedTask.value = {
|
||||
...task,
|
||||
platform: record.platform,
|
||||
accountName: record.name,
|
||||
};
|
||||
modalVisible.value = true;
|
||||
console.log('data', record[column.dataIndex]);
|
||||
const handleOk = () => {
|
||||
showModal.value = false;
|
||||
delTaskSchedules(currentTask.value.id).then(() => {
|
||||
handleSearch();
|
||||
});
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
showModal.value = false;
|
||||
};
|
||||
|
||||
const handleModifyTime = (task: any) => {
|
||||
console.log('修改时间', task);
|
||||
// modalVisible.value = false;
|
||||
// // 重新获取数据
|
||||
// getTaskSchedules(query).then((res) => {
|
||||
// data.value = res.data;
|
||||
// });
|
||||
};
|
||||
|
||||
// 计算当前日期范围内的所有日期,统一返回 number 数组
|
||||
@ -413,7 +397,6 @@ const getTaskColor = (taskType: number, executionTime: number) => {
|
||||
if (isExpired) {
|
||||
return taskType === 0 ? '#A794FE' : '#FFCF66';
|
||||
}
|
||||
|
||||
// 未过期,根据API文档,type: 0=选题,1=内容稿件
|
||||
return taskType === 0 ? '#6d4cfe' : '#ffae00';
|
||||
};
|
||||
@ -438,14 +421,12 @@ const timestampToTime1 = (timestamp: number): string => {
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const hours = date.getHours().toString().padStart(2, '0');
|
||||
const minutes = date.getMinutes().toString().padStart(2, '0');
|
||||
|
||||
return `${month}月${day} ${hours}:${minutes}`;
|
||||
};
|
||||
|
||||
// 时间戳转时间格式 (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');
|
||||
@ -456,7 +437,6 @@ const timestampToTime = (timestamp: number): string => {
|
||||
// 处理表格数据,使其与动态表头匹配
|
||||
const processTableData = (apiData: any[]) => {
|
||||
const processedData: any[] = [];
|
||||
|
||||
// 处理每条账号数据
|
||||
apiData.forEach((account) => {
|
||||
const rowData: any = {
|
||||
|
||||
Reference in New Issue
Block a user