diff --git a/src/router/modules/final.ts b/src/router/modules/final.ts index 98a65a2..bb5f16b 100644 --- a/src/router/modules/final.ts +++ b/src/router/modules/final.ts @@ -28,9 +28,10 @@ const routes: Array = [ children: [ { path: 'final', - name: 'final-main', + name: 'FinalMain', meta: { title: '任务终审', + keepAlive: true, }, component: () => import('@/views/final/index.vue'), }, diff --git a/src/store/modules/final.ts b/src/store/modules/final.ts index 909ff65..b9ffa2f 100644 --- a/src/store/modules/final.ts +++ b/src/store/modules/final.ts @@ -5,6 +5,7 @@ import { getFilter } from '@/api/home/filter' export interface ConfigState { customConfig: string[] | null asideValue: any + listKey: number } export const useFinalStore = defineStore({ @@ -12,6 +13,7 @@ export const useFinalStore = defineStore({ state: (): ConfigState => ({ customConfig: null, asideValue: null, + listKey: 0, }), getters: { getCustomConfig(): string[] | null { @@ -25,6 +27,9 @@ export const useFinalStore = defineStore({ setAsideValue(value) { this.asideValue = value }, + setListKey() { + this.listKey = new Date().getTime() + }, // 获取终审个性化配置 async fetchCustomConfig() { const res = await getFilter(1) diff --git a/src/views/final/content/Content.vue b/src/views/final/content/Content.vue index 2043375..2eb7a2c 100644 --- a/src/views/final/content/Content.vue +++ b/src/views/final/content/Content.vue @@ -824,6 +824,13 @@ watch( { deep: true }, ) +watch( + () => finalStore.listKey, + (newVal, oldVal) => { + refreshHandler() + }, +) + function reset() { pagination.page = 1 pagination.pageCount = 1 diff --git a/src/views/final/index.vue b/src/views/final/index.vue index b4a570f..102a011 100644 --- a/src/views/final/index.vue +++ b/src/views/final/index.vue @@ -4,25 +4,26 @@ import Aside from './aside/Aside.vue' import Content from './content/Content.vue' import ListContent from './content/ListContent.vue' -const showList = ref(false); -const contentRef:any = ref(null); -const inputChange = (keyword)=>{ +defineOptions({ + name: 'FinalMain', +}) +const showList = ref(false) +const contentRef: any = ref(null) +function inputChange(keyword) { contentRef.value.filterTableData(keyword) - } - diff --git a/src/views/task/content/Content.vue b/src/views/task/content/Content.vue index 83f86b7..fda27a6 100644 --- a/src/views/task/content/Content.vue +++ b/src/views/task/content/Content.vue @@ -11,6 +11,7 @@ import History from './History.vue' import NotPassed from '@/components/Approval/NotPassed.vue' import { getAllfieldList, getfieldList } from '@/api/home/filter' import { TASK_STATUS_OBJ } from '@/enums/index' +import { useFinal } from '@/store/modules/final' import { audit, @@ -41,6 +42,7 @@ const CustomSettingModalRef = ref(null) const taskTableData = ref([]) const route = useRoute() const isDetail = ref(false) // 是否是详情 +const finalStore = useFinal() const sortBy: any = { orderType: 'desc', orderName: 'similarityScore', @@ -366,7 +368,7 @@ function reloadList(param, text) { // 修改左侧状态 const id = currentTaskId() const hasCurrentId = param.flowTaskInfoList.find(item => item.formId === id) - + finalStore.setListKey() if (hasCurrentId) emit('setAsideItemName', text)