From 1c7b0732e4c069abf8d0e9ea159daceba55eef2f Mon Sep 17 00:00:00 2001 From: dhb52 Date: Mon, 17 Jun 2024 14:21:25 +0800 Subject: [PATCH] =?UTF-8?q?refactor(sj=5F1.1.0-beta1):=20=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/datetime-range.vue | 67 ------------------- src/typings/api.d.ts | 11 ++- src/views/home/modules/task-tab.vue | 26 +++---- src/views/job/batch/index.vue | 6 +- .../job/batch/modules/job-batch-search.vue | 16 ++++- src/views/retry/dead-letter/index.vue | 3 +- .../modules/dead-letter-search.vue | 16 ++++- src/views/retry/log/index.vue | 3 +- .../retry/log/modules/retry-log-search.vue | 16 ++++- src/views/workflow/batch/index.vue | 3 +- .../batch/modules/workflow-batch-search.vue | 16 ++++- 11 files changed, 76 insertions(+), 107 deletions(-) delete mode 100644 src/components/common/datetime-range.vue diff --git a/src/components/common/datetime-range.vue b/src/components/common/datetime-range.vue deleted file mode 100644 index 065e490..0000000 --- a/src/components/common/datetime-range.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - - diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 40ea80d..85b3786 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -272,8 +272,7 @@ declare namespace Api { groupName?: string; type: DashboardLineType; mode?: DashboardLineMode; - startTime?: string; - endTime?: string; + datetimeRange?: [string, string] | null; } & CommonSearchParams; /** @@ -703,7 +702,7 @@ declare namespace Api { Api.RetryDeadLetter.DeadLetter, 'id' | 'uniqueId' | 'groupName' | 'sceneName' | 'idempotentId' | 'bizNo' | 'taskType' | 'createDt' > & - CommonSearchParams & { beginDate: number; endDate: number } + CommonSearchParams & { datetimeRange?: [string, string] } >; /** DeadLetter list */ @@ -1080,7 +1079,7 @@ declare namespace Api { /** JobBatch search params */ type JobBatchSearchParams = CommonType.RecordNullable< Pick & - CommonSearchParams & { beginDate: number; endDate: number } + CommonSearchParams & { datetimeRange?: [string, string] } >; /** JobBatch list */ @@ -1116,7 +1115,7 @@ declare namespace Api { /** workflowBatch search params */ type WorkflowBatchSearchParams = CommonType.RecordNullable< Pick & - CommonSearchParams & { beginDate: number; endDate: number } + CommonSearchParams & { datetimeRange?: [string, string] } >; /** workflowBatch list */ @@ -1166,7 +1165,7 @@ declare namespace Api { /** retryLog search params */ type RetryLogSearchParams = CommonType.RecordNullable< Pick & - CommonSearchParams & { beginDate: number; endDate: number } + CommonSearchParams & { datetimeRange?: [string, string] } >; /** retryLog list */ diff --git a/src/views/home/modules/task-tab.vue b/src/views/home/modules/task-tab.vue index 6d9b37f..0f8d5cf 100644 --- a/src/views/home/modules/task-tab.vue +++ b/src/views/home/modules/task-tab.vue @@ -26,12 +26,9 @@ const tabParams = ref({ type: 'WEEK', page: 1, size: 6, - mode: 'JOB' + mode: 'JOB', + datetimeRange: null }); -const dateRange = ref<[number, number] | null>(); -const formattedValue = ref<[string, string] | null>( - tabParams.value.startTime && tabParams.value.endTime ? [tabParams.value.startTime, tabParams.value.endTime] : null -); const getData = async () => { const { data: lineData, error } = @@ -70,23 +67,16 @@ const onUpdateTab = (value: string) => { const onUpdateDate = (value: [string, string]) => { if (value) { tabParams.value.type = 'OTHERS'; - tabParams.value.startTime = value[0]; - tabParams.value.endTime = value[1]; } }; const onClearDate = () => { tabParams.value.type = 'WEEK'; - tabParams.value.startTime = undefined; - tabParams.value.endTime = undefined; }; const onUpdateType = (value: string) => { if (value !== 'OTHERS') { - dateRange.value = null; - formattedValue.value = null; - tabParams.value.startTime = undefined; - tabParams.value.endTime = undefined; + tabParams.value.datetimeRange = null; } }; @@ -214,12 +204,12 @@ getGroupNames(); diff --git a/src/views/job/batch/index.vue b/src/views/job/batch/index.vue index d618a1d..4ed9111 100644 --- a/src/views/job/batch/index.vue +++ b/src/views/job/batch/index.vue @@ -27,8 +27,10 @@ const { columnChecks, columns, data, getData, loading, mobilePagination, searchP groupName: null, jobName: null, taskBatchStatus: null, - beginDate: null, - endDate: null + datetimeRange: null + + // beginDate: null, + // endDate: null }, searchParams: { jobName, diff --git a/src/views/job/batch/modules/job-batch-search.vue b/src/views/job/batch/modules/job-batch-search.vue index d9e8fd7..7d10a61 100644 --- a/src/views/job/batch/modules/job-batch-search.vue +++ b/src/views/job/batch/modules/job-batch-search.vue @@ -36,8 +36,20 @@ function search() { - - + + diff --git a/src/views/retry/dead-letter/index.vue b/src/views/retry/dead-letter/index.vue index c0a80e3..c810836 100644 --- a/src/views/retry/dead-letter/index.vue +++ b/src/views/retry/dead-letter/index.vue @@ -31,8 +31,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP size: 10, groupName: null, sceneName: null, - beginDate: null, - endDate: null + datetimeRange: null // if you want to use the searchParams in Form, you need to define the following properties, and the value is null // the value can not be undefined, otherwise the property in Form will not be reactive }, diff --git a/src/views/retry/dead-letter/modules/dead-letter-search.vue b/src/views/retry/dead-letter/modules/dead-letter-search.vue index 65d3eb4..c4ba3ca 100644 --- a/src/views/retry/dead-letter/modules/dead-letter-search.vue +++ b/src/views/retry/dead-letter/modules/dead-letter-search.vue @@ -33,8 +33,20 @@ function search() { - - + + diff --git a/src/views/retry/log/index.vue b/src/views/retry/log/index.vue index b947e29..df49819 100644 --- a/src/views/retry/log/index.vue +++ b/src/views/retry/log/index.vue @@ -32,8 +32,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP idempotentId: null, bizNo: null, retryStatus: null, - beginDate: null, - endDate: null + datetimeRange: null }, searchParams: { retryStatus diff --git a/src/views/retry/log/modules/retry-log-search.vue b/src/views/retry/log/modules/retry-log-search.vue index c69fd69..469141b 100644 --- a/src/views/retry/log/modules/retry-log-search.vue +++ b/src/views/retry/log/modules/retry-log-search.vue @@ -52,8 +52,20 @@ function search() { clearable /> - - + + diff --git a/src/views/workflow/batch/index.vue b/src/views/workflow/batch/index.vue index c621287..54096c9 100644 --- a/src/views/workflow/batch/index.vue +++ b/src/views/workflow/batch/index.vue @@ -23,8 +23,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP workflowId: null, groupName: null, taskBatchStatus: null, - beginDate: null, - endDate: null + datetimeRange: null }, searchParams: { workflowId, diff --git a/src/views/workflow/batch/modules/workflow-batch-search.vue b/src/views/workflow/batch/modules/workflow-batch-search.vue index 1c5f2c1..0ce59d5 100644 --- a/src/views/workflow/batch/modules/workflow-batch-search.vue +++ b/src/views/workflow/batch/modules/workflow-batch-search.vue @@ -67,8 +67,20 @@ groupNameUpdate(''); > - - + +