From 53bcb7e5dffa071d2c6593f5db7f0b6e4e2f8dfe Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Wed, 18 Oct 2023 16:17:02 +0800
Subject: [PATCH] 隐藏重复定时和连续执行
---
src/components/task/TaskPanel.vue | 27 ++++++++++++++++++++-------
1 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/src/components/task/TaskPanel.vue b/src/components/task/TaskPanel.vue
index f432ac5..d3e4bc6 100644
--- a/src/components/task/TaskPanel.vue
+++ b/src/components/task/TaskPanel.vue
@@ -166,6 +166,7 @@
import { getErrorMessage } from '/@/utils/error-code/index'
import { commonColor } from '/@/utils/color'
import { ExclamationCircleOutlined, UploadOutlined } from '@ant-design/icons-vue'
+import { timestampToTime } from '/@/utils/time'
const store = useMyStore()
const workspaceId = localStorage.getItem(ELocalStorageKey.WorkspaceId)!
@@ -193,9 +194,17 @@
const searchQuery = reactive<TaskQueryParam>({
taskType: ''
})
+
+function getSearchTime (n:number) {
+ const nowStamp = new Date().getTime()
+ const timestamp = nowStamp + (n * 60 * 60 * 1000 * 24)
+ const time = timestampToTime(timestamp)
+ return time
+}
+
const statusArr = reactive([])
const timeRangeArr = reactive({
- data: [] as string[]
+ data: [getSearchTime(-3), getSearchTime(3)] as string[]
})
const body: IPage = {
@@ -222,13 +231,14 @@
{
title: '执行状态',
key: 'status',
- width: 150,
+ width: 80,
slots: { customRender: 'status' }
},
{
title: '计划名称',
dataIndex: 'job_name',
- width: 100,
+ ellipsis: true,
+ width: 170,
},
{
title: '设备名称',
@@ -343,6 +353,9 @@
}
function getPlans () {
+ searchQuery.startTime = timeRangeArr.data[0]
+ searchQuery.endTime = timeRangeArr.data[1]
+
console.log('计划查询请求参数', searchQuery)
tableLoading.value = true
getWaylineJobs(workspaceId, body, searchQuery).then(res => {
@@ -372,7 +385,7 @@
job_id: jobId
})
if (code === 0) {
- message.success('Deleted successfully')
+ message.success('删除成功')
getPlans()
}
}
@@ -384,7 +397,7 @@
status: UpdateTaskStatus.Suspend
})
if (code === 0) {
- message.success('Suspended successfully')
+ message.success('暂停成功')
getPlans()
}
}
@@ -396,7 +409,7 @@
status: UpdateTaskStatus.Resume
})
if (code === 0) {
- message.success('Resumed successfully')
+ message.success('恢复成功')
getPlans()
}
}
@@ -405,7 +418,7 @@
async function onUploadMediaFileNow (jobId: string) {
const { code } = await uploadMediaFileNow(workspaceId, jobId)
if (code === 0) {
- message.success('Upload Media File successfully')
+ message.success('上传媒体文件成功')
getPlans()
}
}
--
Gitblit v1.9.3