fix(任务中心): 支持消息通知跳转任务执行详情

This commit is contained in:
baiqi 2025-01-02 13:59:02 +08:00 committed by Craftsman
parent f4f4210a77
commit 9f3b1078ce
4 changed files with 30 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@ -96,8 +96,6 @@
:id="activeRecord.id"
v-model:visible="caseExecuteResultDrawerVisible"
:user-name="activeRecord.userName"
:status="activeRecord.status"
:result="activeRecord.result"
:resource-name="activeRecord.resourceName"
/>
<scenarioExecuteResultDrawer
@ -105,12 +103,11 @@
:id="activeRecord.id"
v-model:visible="scenarioExecuteResultDrawerVisible"
:user-name="activeRecord.userName"
:status="activeRecord.status"
:result="activeRecord.result"
/>
</template>
<script setup lang="ts">
import { useRoute } from 'vue-router';
import { CascaderOption, Message } from '@arco-design/web-vue';
import dayjs from 'dayjs';
@ -171,6 +168,7 @@
id?: string;
}>();
const route = useRoute();
const { t } = useI18n();
const { openModal } = useModal();
const appStore = useAppStore();
@ -692,6 +690,10 @@
setLoadListParams({ keyword: props.id });
}
initResourcePools();
if (route.query.task && route.query.id) {
const { id, userName, resourceType } = route.query;
checkExecuteResult({ id, userName, resourceType: [resourceType] } as unknown as TaskCenterTaskDetailItem);
}
await loadList();
initCurrentPageResourcePoolsStatus();
initCurrentPageQueue();

View File

@ -116,6 +116,7 @@
</template>
<script setup lang="ts">
import { useRoute } from 'vue-router';
import { Message } from '@arco-design/web-vue';
import dayjs from 'dayjs';
@ -175,7 +176,7 @@
import { ReportEnum } from '@/enums/reportEnum';
import { TableKeyEnum } from '@/enums/tableEnum';
import { FilterSlotNameEnum } from '@/enums/tableFilterEnum';
import { ExecuteResultEnum, ExecuteStatusEnum, ExecuteTaskType } from '@/enums/taskCenter';
import { ExecuteResultEnum, ExecuteStatusEnum, ExecuteTaskType, TaskCenterEnum } from '@/enums/taskCenter';
import { executeMethodMap, executeResultMap, executeStatusMap } from './config';
@ -187,6 +188,7 @@
(e: 'init'): void;
}>();
const route = useRoute();
const { t } = useI18n();
const { openModal } = useModal();
const tableStore = useTableStore();
@ -734,6 +736,15 @@
searchTask();
getTime();
emit('init');
if (route.query.task && route.query.type === TaskCenterEnum.CASE && route.query.id) {
const { id, taskType, integrated, reportId } = route.query;
checkReport({
id: id as string,
taskType: taskType as ExecuteTaskType,
integrated,
reportId,
} as unknown as TaskCenterTaskItem);
}
});
watch(

View File

@ -20,7 +20,7 @@
</template>
<script setup lang="ts">
import { useRoute } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import caseTaskDetailTable from './component/caseTaskDetailTable.vue';
import caseTaskTable from './component/caseTaskTable.vue';
@ -41,6 +41,7 @@
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
const globalStore = useGlobalStore();
const { getItem, setItem } = useLocalForage();
@ -86,6 +87,9 @@
function handleTabChange(key: string | number) {
setItem('taskCenterActiveTab', key);
if (route.query.task) {
router.replace({ query: {} });
}
}
watch(
@ -99,11 +103,13 @@
);
onBeforeMount(async () => {
const localTab = await getItem('taskCenterActiveTab');
if (tabList.value.some((e) => e.value === localTab)) {
activeTab.value = (localTab as TaskCenterEnum) || TaskCenterEnum.CASE;
} else {
activeTab.value = tabList.value[0].value;
if (!route.query.type) {
const localTab = await getItem('taskCenterActiveTab');
if (tabList.value.some((e) => e.value === localTab)) {
activeTab.value = (localTab as TaskCenterEnum) || TaskCenterEnum.CASE;
} else {
activeTab.value = tabList.value[0].value;
}
}
});
</script>