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 } }); +}