810718ac by lxs

Merge branch 'develop' of http://117.78.60.236:8000/csbr-daop/fe-data-asset-management into develop

2 parents 9372295c ce9f82c7
......@@ -46,24 +46,24 @@ watch(
}
}
// isExist.length == 0 && list.push(newRouter);
list.map(item => {
if (combPath == 'app-scenes') {
item.visible = item.fullPath == '/'
} else {
if (item.fullPath.split('/')?.[1] != combPath) {
item.visible = false
} else {
item.visible = true
}
}
})
// list.map(item => {
// if (combPath == 'app-scenes') {
// item.visible = item.fullPath == '/'
// } else {
// if (item.fullPath.split('/')?.[1] != combPath) {
// item.visible = false
// } else {
// item.visible = true
// }
// }
// })
tabbarList.value = list;
tabbarActive.value = newRouter.fullPath;
userStore.setTabbar(tabbarList.value);
userStore.setActiveTabbar(combPath, newRouter.fullPath);
nextTick(() => {
setTabVisible()
})
// nextTick(() => {
// setTabVisible()
// })
},
{ immediate: true }
);
......@@ -78,7 +78,9 @@ const changeTab = (pane: any, ev: any) => {
userStore.setActiveTabbar(combPath, paneData.fullPath);
};
const removeTab = (targetName) => {
const tabs = tabbarList.value.filter(item => item.visible ?? true);
// const tabs = tabbarList.value.filter(item => item.visible ?? true);
const tabs = tabbarList.value;
let activeName = tabbarActive.value, nextTab: any = {};
const setTabs = (activeTab) => {
tabbarActive.value = activeName;
tabbarList.value = tabbarList.value.filter((tab) => tab.fullPath !== targetName);
......@@ -94,12 +96,12 @@ const removeTab = (targetName) => {
}
nextTick(() => {
nextTab.name && router.push({ name: nextTab.name, query: nextTab.query });
setTabVisible()
// setTabVisible()
});
}
let activeName = tabbarActive.value;
let nextTab: any = {};
// let activeName = tabbarActive.value;
// let nextTab: any = {};
if (tabbarActive.value === targetName) {
tabs.forEach((tab, index) => {
if (tab.fullPath === targetName) {
......@@ -112,7 +114,7 @@ const removeTab = (targetName) => {
}
let activeTab: any = tabs.find(t => t.fullPath === targetName);
if (activeTab.meta.editPage) {
if (activeTab && activeTab.meta.editPage) {
ElMessageBox.confirm(
"当前页面尚未保存,确定关闭吗?",
"提示",
......@@ -140,13 +142,14 @@ const setTabVisible = () => {
const tabpanes: any = document.querySelectorAll('.tabbar-container .el-tabs__item')
let list: any = []
tabpanes.forEach((tab, i) => {
const visible = tabbarList.value[i].visible ?? true
if (!visible) {
tab.style.display = 'none'
} else {
tab.style.display = 'inherit'
// const visible = tabbarList.value[i].visible ?? true
// if (!visible) {
// tab.style.display = 'none'
// } else {
// tab.style.display = 'inherit'
// list.push(tabbarList.value[i].fullPath)
// }
list.push(tabbarList.value[i].fullPath)
}
})
visibleTabs.value = list
}
......@@ -159,7 +162,7 @@ onMounted(() => {
<div class="tabbar-container">
<el-tabs v-model="tabbarActive" type="card" @tab-click="changeTab" @tab-remove="removeTab">
<el-tab-pane v-for="(item, index) in tabbarList" :key="item.fullPath + '_' + index" :name="item.fullPath"
:closable="visibleTabs.length > 1">
:closable="tabbarList.length > 1">
<template #label v-if="item.isHomePage">
<span class="custom-tabs-label">
<el-icon>
......
......@@ -181,7 +181,7 @@ const formInfo = ref<any>({
field: 'damCode',
default: '',
disabled: true,
required: true,
required: false,
visible: true
},
{
......@@ -532,9 +532,9 @@ const formInfo = ref<any>({
damType: [
{ required: true, message: "请选择资产类型", trigger: "change", },
],
damCode: [
{ required: true, message: "请填写证书编号", trigger: "blur", },
],
// damCode: [
// { required: true, message: "请填写证书编号", trigger: "blur", },
// ],
dateRange: [
{ required: true, message: "请选择数据时间范围", trigger: "change", },
],
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!