Browse Source

fix-打开首页项目报审界面,再次操作我的工作或警员中心等其他功能时,不关闭首页操作界面。

main
buaixuexideshitongxue 3 weeks ago
parent
commit
c92c6073d8
  1. 18
      src/permission.ts
  2. 29
      src/views/report/edit/controlPrice.vue

18
src/permission.ts

@ -19,15 +19,15 @@ NProgress.configure({ showSpinner: false })
const whiteList: string[] = [PageEnum.LOGIN, '/support', '/401', '/work/verifySubmit'] const whiteList: string[] = [PageEnum.LOGIN, '/support', '/401', '/work/verifySubmit']
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
const tabsStore = useTabsStore(); const tabsStore = useTabsStore();
const tabList = tabsStore.tabList; // const tabList = tabsStore.tabList;
if(tabList && delPathList.indexOf(from.path) >= 0){ // if(tabList && delPathList.indexOf(from.path) >= 0){
console.log('删除tag标签',from) // console.log('删除tag标签',from)
const index = tabList.findIndex((item) => item.path == from.path); // const index = tabList.findIndex((item) => item.path == from.path);
// 移除tab // // 移除tab
if (tabList.length > 1) { // if (tabList.length > 1) {
index !== -1 && tabList.splice(index, 1) // index !== -1 && tabList.splice(index, 1)
} // }
} // }
// 开始 Progress Bar // 开始 Progress Bar
NProgress.start() NProgress.start()
if (whiteList.includes(to.path)) { if (whiteList.includes(to.path)) {

29
src/views/report/edit/controlPrice.vue

@ -787,11 +787,34 @@ watch(()=>formData.value.project.applicantId,(val)=>{
},{deep:true,immediate:true}) },{deep:true,immediate:true})
//
const pageCache = ref({
isEnd: null,
isInitialized: false
});
onUnmounted(() => {
//
pageCache.value = {
isEnd: null,
isInitialized: false
};
});
// //
watch(() => route.query.isEnd, (val) => { watch(() => route.query.isEnd, (val) => {
if(val){ if (pageCache.value.isEnd !== null && !route.query.id) {
isEndData.value = val === 'true'; isEndData.value = pageCache.value.isEnd;
if (!formData.value.project.reportType) {
formData.value.project.reportType = isEndData.value ? '结算项目' : '项目控制价';
}
return;
}
//
if (val !== undefined && !pageCache.value.isInitialized) {
pageCache.value.isEnd = val === 'true';
pageCache.value.isInitialized = true;
isEndData.value = pageCache.value.isEnd;
if (isEndData.value) { if (isEndData.value) {
formData.value.project.reportType = '结算项目' formData.value.project.reportType = '结算项目'
} else { } else {
@ -799,7 +822,7 @@ watch(() => route.query.isEnd, (val) => {
} }
}else{ }else{
// //
useTabsStore().removeTab('/report/edit/controlPrice', router); // useTabsStore().removeTab('/report/edit/controlPrice', router);
} }
}, {deep: true, immediate: true}) }, {deep: true, immediate: true})

Loading…
Cancel
Save