创建时间
This commit is contained in:
@ -203,32 +203,10 @@ const platformOptions = ref(platformConfig.options);
|
||||
const getPlatformIcon = (platform: number) => platformConfig.icons[platform] || iconWarn;
|
||||
const getPlatformName = (platform: number) => platformConfig.names[platform] || '未知平台';
|
||||
|
||||
const getTaskColor = (taskType: number, executionTime: number) => {
|
||||
const isExpired = executionTime * 1000 < Date.now();
|
||||
return isExpired ? (taskType === 0 ? '#A794FE' : '#FFCF66') : taskType === 0 ? '#6d4cfe' : '#ffae00';
|
||||
};
|
||||
|
||||
// const formatTaskName = (name: string) => {
|
||||
// if (!name) return '未命名';
|
||||
// return name.length > 8 ? name.substring(0, 8) + '...' : name;
|
||||
// };
|
||||
|
||||
const timestampToDayNumber = (timestamp: number) => {
|
||||
return new Date(timestamp * 1000).getDate();
|
||||
};
|
||||
|
||||
// // 获取任务列表
|
||||
// const handleSearch = async () => {
|
||||
// const { data: accountData } = await fetchAccountOperators();
|
||||
// const { data: mediaAccountData } = await getMediaAccountList();
|
||||
// operators.value = accountData;
|
||||
// accountList.value = mediaAccountData;
|
||||
// };
|
||||
// const timestampToTime = (timestamp: number): string => {
|
||||
// const date = new Date(timestamp * 1000);
|
||||
// return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
|
||||
// };
|
||||
|
||||
// 处理表格数据
|
||||
const processTableData = (apiData: any[]) => {
|
||||
const processedData: any[] = [];
|
||||
@ -251,12 +229,7 @@ const processTableData = (apiData: any[]) => {
|
||||
account.task_schedules.forEach((task: any) => {
|
||||
const taskDay = timestampToDayNumber(task.execution_time);
|
||||
if (dateHeaders.includes(taskDay)) {
|
||||
rowData[taskDay].push({
|
||||
id: task.id,
|
||||
name: task.name,
|
||||
type: task.type,
|
||||
execution_time: task.execution_time,
|
||||
});
|
||||
rowData[taskDay].push(task);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -479,22 +452,6 @@ const handleRowClick = (record: any, index: number, event: Event) => {
|
||||
drawerPopupRef.value.showDrawer(accountInfo);
|
||||
};
|
||||
|
||||
// 处理表格行双击事件
|
||||
const handleRowDblClick = (record: any, index: number, event: Event) => {
|
||||
console.log('双击行:', record);
|
||||
console.log('行索引:', index);
|
||||
console.log('事件对象:', event);
|
||||
// 双击行时打开创建任务弹窗并传递账号信息
|
||||
if (drawerPopupRef.value) {
|
||||
const accountInfo = {
|
||||
id: record.id,
|
||||
name: record.name,
|
||||
platform: record.platform
|
||||
};
|
||||
drawerPopupRef.value.showDrawer(accountInfo);
|
||||
}
|
||||
};
|
||||
|
||||
// 任务操作处理
|
||||
const handleTaskAction = (action: string, task: any, ...args: any[]) => {
|
||||
switch (action) {
|
||||
|
||||
Reference in New Issue
Block a user