From 121ac94cff2587ed1c3623de9fecc5719bb4b0b8 Mon Sep 17 00:00:00 2001 From: opensnail <598092184@qq.com> Date: Sat, 22 Jun 2024 18:24:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(sj=5F1.1.0-beta1):=20=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E4=BB=8E=E4=BB=BB=E5=8A=A1=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=88=B0=E6=89=B9=E6=AC=A1=E9=A1=B5=E9=9D=A2=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=A1=AB=E5=85=85=E4=BB=BB=E5=8A=A1=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/typings/api.d.ts | 2 +- src/views/workflow/batch/index.vue | 3 +++ .../batch/modules/workflow-batch-search.vue | 2 +- src/views/workflow/task/index.vue | 14 ++++++++++---- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 148ae43..55c7ed5 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -1126,7 +1126,7 @@ declare namespace Api { /** workflowBatch search params */ type WorkflowBatchSearchParams = CommonType.RecordNullable< - Pick & + Pick & CommonSearchParams & { datetimeRange?: [string, string] } >; diff --git a/src/views/workflow/batch/index.vue b/src/views/workflow/batch/index.vue index c877943..c276ca5 100644 --- a/src/views/workflow/batch/index.vue +++ b/src/views/workflow/batch/index.vue @@ -13,6 +13,7 @@ const router = useRouter(); const appStore = useAppStore(); const workflowId = history.state.workflowId; +const workflowName = history.state.workflowName; const taskBatchStatus = history.state.taskBatchStatus; const { columns, columnChecks, data, getData, loading, mobilePagination, searchParams, resetSearchParams } = useTable({ @@ -23,12 +24,14 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP // 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 workflowId: null, + workflowName: null, groupName: null, taskBatchStatus: null, datetimeRange: monthRangeISO8601() }, searchParams: { workflowId, + workflowName, taskBatchStatus }, columns: () => [ diff --git a/src/views/workflow/batch/modules/workflow-batch-search.vue b/src/views/workflow/batch/modules/workflow-batch-search.vue index 71a3041..412fc54 100644 --- a/src/views/workflow/batch/modules/workflow-batch-search.vue +++ b/src/views/workflow/batch/modules/workflow-batch-search.vue @@ -15,7 +15,6 @@ interface Emits { (e: 'reset'): void; (e: 'search'): void; } -const keywords = ref(''); const noSearchFlag = ref(false); const emit = defineEmits(); @@ -23,6 +22,7 @@ const emit = defineEmits(); const workflowList = ref([]); const model = defineModel('model', { required: true }); +const keywords = ref(model.value.workflowName as any); function reset() { keywords.value = ''; diff --git a/src/views/workflow/task/index.vue b/src/views/workflow/task/index.vue index 8a75ecf..d879b2c 100644 --- a/src/views/workflow/task/index.vue +++ b/src/views/workflow/task/index.vue @@ -15,11 +15,13 @@ import StatusSwitch from '@/components/common/status-switch.vue'; import { tagColor } from '@/utils/common'; import { useAuth } from '@/hooks/business/auth'; import { downloadFetch } from '@/utils/download'; +import { useRouterPush } from '@/hooks/common/router'; import WorkflowSearch from './modules/workflow-search.vue'; const { hasAuth } = useAuth(); const router = useRouter(); const appStore = useAppStore(); +const { routerPushByKey } = useRouterPush(); const { columns, columnChecks, data, getData, loading, mobilePagination, searchParams, resetSearchParams } = useTable({ apiFn: fetchGetWorkflowPageList, @@ -152,7 +154,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP { label: $t('common.batchList'), key: 'batchList', - click: () => batch(row.id!) + click: () => goToBatch(row.id!) } ]; @@ -237,9 +239,9 @@ function copy(id: string) { router.push({ path: '/workflow/form/copy', query: { id } }); } -function batch(id: string) { - router.push({ path: '/workflow/batch', state: { workflowId: id } }); -} +// function batch(id: string) { +// router.push({ path: '/workflow/batch', state: { workflowId: id } }); +// } async function execute(id: string) { const { error } = await fetchTriggerWorkflow(id); @@ -261,6 +263,10 @@ function body(): Api.Workflow.ExportWorkflow { function handleExport() { downloadFetch('/workflow/export', body(), $t('page.workflow.title')); } +function goToBatch(workflowId: string) { + const findItem = data.value.find(item => item.id === workflowId)!; + routerPushByKey('workflow_batch', { state: { workflowId, workflowName: findItem.workflowName } }); +}