Merge branch 'develop' of http://117.78.60.236:8000/csbr-daop/fe-data-asset-management into develop
Showing
3 changed files
with
33 additions
and
30 deletions
| ... | @@ -46,24 +46,24 @@ watch( | ... | @@ -46,24 +46,24 @@ watch( |
| 46 | } | 46 | } |
| 47 | } | 47 | } |
| 48 | // isExist.length == 0 && list.push(newRouter); | 48 | // isExist.length == 0 && list.push(newRouter); |
| 49 | list.map(item => { | 49 | // list.map(item => { |
| 50 | if (combPath == 'app-scenes') { | 50 | // if (combPath == 'app-scenes') { |
| 51 | item.visible = item.fullPath == '/' | 51 | // item.visible = item.fullPath == '/' |
| 52 | } else { | 52 | // } else { |
| 53 | if (item.fullPath.split('/')?.[1] != combPath) { | 53 | // if (item.fullPath.split('/')?.[1] != combPath) { |
| 54 | item.visible = false | 54 | // item.visible = false |
| 55 | } else { | 55 | // } else { |
| 56 | item.visible = true | 56 | // item.visible = true |
| 57 | } | 57 | // } |
| 58 | } | 58 | // } |
| 59 | }) | 59 | // }) |
| 60 | tabbarList.value = list; | 60 | tabbarList.value = list; |
| 61 | tabbarActive.value = newRouter.fullPath; | 61 | tabbarActive.value = newRouter.fullPath; |
| 62 | userStore.setTabbar(tabbarList.value); | 62 | userStore.setTabbar(tabbarList.value); |
| 63 | userStore.setActiveTabbar(combPath, newRouter.fullPath); | 63 | userStore.setActiveTabbar(combPath, newRouter.fullPath); |
| 64 | nextTick(() => { | 64 | // nextTick(() => { |
| 65 | setTabVisible() | 65 | // setTabVisible() |
| 66 | }) | 66 | // }) |
| 67 | }, | 67 | }, |
| 68 | { immediate: true } | 68 | { immediate: true } |
| 69 | ); | 69 | ); |
| ... | @@ -78,7 +78,9 @@ const changeTab = (pane: any, ev: any) => { | ... | @@ -78,7 +78,9 @@ const changeTab = (pane: any, ev: any) => { |
| 78 | userStore.setActiveTabbar(combPath, paneData.fullPath); | 78 | userStore.setActiveTabbar(combPath, paneData.fullPath); |
| 79 | }; | 79 | }; |
| 80 | const removeTab = (targetName) => { | 80 | const removeTab = (targetName) => { |
| 81 | const tabs = tabbarList.value.filter(item => item.visible ?? true); | 81 | // const tabs = tabbarList.value.filter(item => item.visible ?? true); |
| 82 | const tabs = tabbarList.value; | ||
| 83 | let activeName = tabbarActive.value, nextTab: any = {}; | ||
| 82 | const setTabs = (activeTab) => { | 84 | const setTabs = (activeTab) => { |
| 83 | tabbarActive.value = activeName; | 85 | tabbarActive.value = activeName; |
| 84 | tabbarList.value = tabbarList.value.filter((tab) => tab.fullPath !== targetName); | 86 | tabbarList.value = tabbarList.value.filter((tab) => tab.fullPath !== targetName); |
| ... | @@ -94,12 +96,12 @@ const removeTab = (targetName) => { | ... | @@ -94,12 +96,12 @@ const removeTab = (targetName) => { |
| 94 | } | 96 | } |
| 95 | nextTick(() => { | 97 | nextTick(() => { |
| 96 | nextTab.name && router.push({ name: nextTab.name, query: nextTab.query }); | 98 | nextTab.name && router.push({ name: nextTab.name, query: nextTab.query }); |
| 97 | setTabVisible() | 99 | // setTabVisible() |
| 98 | }); | 100 | }); |
| 99 | } | 101 | } |
| 100 | 102 | ||
| 101 | let activeName = tabbarActive.value; | 103 | // let activeName = tabbarActive.value; |
| 102 | let nextTab: any = {}; | 104 | // let nextTab: any = {}; |
| 103 | if (tabbarActive.value === targetName) { | 105 | if (tabbarActive.value === targetName) { |
| 104 | tabs.forEach((tab, index) => { | 106 | tabs.forEach((tab, index) => { |
| 105 | if (tab.fullPath === targetName) { | 107 | if (tab.fullPath === targetName) { |
| ... | @@ -112,7 +114,7 @@ const removeTab = (targetName) => { | ... | @@ -112,7 +114,7 @@ const removeTab = (targetName) => { |
| 112 | } | 114 | } |
| 113 | 115 | ||
| 114 | let activeTab: any = tabs.find(t => t.fullPath === targetName); | 116 | let activeTab: any = tabs.find(t => t.fullPath === targetName); |
| 115 | if (activeTab.meta.editPage) { | 117 | if (activeTab && activeTab.meta.editPage) { |
| 116 | ElMessageBox.confirm( | 118 | ElMessageBox.confirm( |
| 117 | "当前页面尚未保存,确定关闭吗?", | 119 | "当前页面尚未保存,确定关闭吗?", |
| 118 | "提示", | 120 | "提示", |
| ... | @@ -140,13 +142,14 @@ const setTabVisible = () => { | ... | @@ -140,13 +142,14 @@ const setTabVisible = () => { |
| 140 | const tabpanes: any = document.querySelectorAll('.tabbar-container .el-tabs__item') | 142 | const tabpanes: any = document.querySelectorAll('.tabbar-container .el-tabs__item') |
| 141 | let list: any = [] | 143 | let list: any = [] |
| 142 | tabpanes.forEach((tab, i) => { | 144 | tabpanes.forEach((tab, i) => { |
| 143 | const visible = tabbarList.value[i].visible ?? true | 145 | // const visible = tabbarList.value[i].visible ?? true |
| 144 | if (!visible) { | 146 | // if (!visible) { |
| 145 | tab.style.display = 'none' | 147 | // tab.style.display = 'none' |
| 146 | } else { | 148 | // } else { |
| 147 | tab.style.display = 'inherit' | 149 | // tab.style.display = 'inherit' |
| 150 | // list.push(tabbarList.value[i].fullPath) | ||
| 151 | // } | ||
| 148 | list.push(tabbarList.value[i].fullPath) | 152 | list.push(tabbarList.value[i].fullPath) |
| 149 | } | ||
| 150 | }) | 153 | }) |
| 151 | visibleTabs.value = list | 154 | visibleTabs.value = list |
| 152 | } | 155 | } |
| ... | @@ -159,7 +162,7 @@ onMounted(() => { | ... | @@ -159,7 +162,7 @@ onMounted(() => { |
| 159 | <div class="tabbar-container"> | 162 | <div class="tabbar-container"> |
| 160 | <el-tabs v-model="tabbarActive" type="card" @tab-click="changeTab" @tab-remove="removeTab"> | 163 | <el-tabs v-model="tabbarActive" type="card" @tab-click="changeTab" @tab-remove="removeTab"> |
| 161 | <el-tab-pane v-for="(item, index) in tabbarList" :key="item.fullPath + '_' + index" :name="item.fullPath" | 164 | <el-tab-pane v-for="(item, index) in tabbarList" :key="item.fullPath + '_' + index" :name="item.fullPath" |
| 162 | :closable="visibleTabs.length > 1"> | 165 | :closable="tabbarList.length > 1"> |
| 163 | <template #label v-if="item.isHomePage"> | 166 | <template #label v-if="item.isHomePage"> |
| 164 | <span class="custom-tabs-label"> | 167 | <span class="custom-tabs-label"> |
| 165 | <el-icon> | 168 | <el-icon> | ... | ... |
| ... | @@ -181,7 +181,7 @@ const formInfo = ref<any>({ | ... | @@ -181,7 +181,7 @@ const formInfo = ref<any>({ |
| 181 | field: 'damCode', | 181 | field: 'damCode', |
| 182 | default: '', | 182 | default: '', |
| 183 | disabled: true, | 183 | disabled: true, |
| 184 | required: true, | 184 | required: false, |
| 185 | visible: true | 185 | visible: true |
| 186 | }, | 186 | }, |
| 187 | { | 187 | { |
| ... | @@ -532,9 +532,9 @@ const formInfo = ref<any>({ | ... | @@ -532,9 +532,9 @@ const formInfo = ref<any>({ |
| 532 | damType: [ | 532 | damType: [ |
| 533 | { required: true, message: "请选择资产类型", trigger: "change", }, | 533 | { required: true, message: "请选择资产类型", trigger: "change", }, |
| 534 | ], | 534 | ], |
| 535 | damCode: [ | 535 | // damCode: [ |
| 536 | { required: true, message: "请填写证书编号", trigger: "blur", }, | 536 | // { required: true, message: "请填写证书编号", trigger: "blur", }, |
| 537 | ], | 537 | // ], |
| 538 | dateRange: [ | 538 | dateRange: [ |
| 539 | { required: true, message: "请选择数据时间范围", trigger: "change", }, | 539 | { required: true, message: "请选择数据时间范围", trigger: "change", }, |
| 540 | ], | 540 | ], | ... | ... |
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment