diff --git a/src/components/GuipTable.vue b/src/components/GuipTable.vue index 351f02d..ba85bb2 100644 --- a/src/components/GuipTable.vue +++ b/src/components/GuipTable.vue @@ -39,7 +39,7 @@ -
+
无数据

暂无数据

diff --git a/src/components/SetLeftMenu.vue b/src/components/SetLeftMenu.vue index 0598ce7..a9e8b13 100644 --- a/src/components/SetLeftMenu.vue +++ b/src/components/SetLeftMenu.vue @@ -58,8 +58,14 @@ export default { } }, mounted() { - this.activeFloor = this.menuList[this.curIndex]?.list?.[0]?.desc || this.menuList[this.curIndex]?.list?.[0]?.path; - this.componentsName = this.menuList[this.curIndex]?.list?.[0]?.componentsName; + let curItem = this.menuList[this.curIndex]; + // 增加单项初始值判断 + if(!curItem.list || !curItem.list.length){ + this.activeFloor = curItem.path + }else{ + this.activeFloor = curItem?.list?.[0]?.desc || curItem?.list?.[0]?.path; + } + this.componentsName = curItem?.list?.[0]?.componentsName; this.$nextTick(() => { // 更可靠的获取滚动容器方式 this.scrollContainer = document.querySelector('.main-content') || @@ -160,7 +166,7 @@ export default { // } gotoPath(item) { let path = item.path; - this.activeFloor = null + this.activeFloor = path if (!path) { this.curIndex = 0; return; @@ -185,7 +191,7 @@ export default { setActiveCur(item1, item,index) { this.curIndex = index; - let componentsName = item1.componentsName; + let componentsName = item1?.componentsName; // 如果采用的是 组件切换显示的办法 if(componentsName){ this.activeFloor = componentsName; diff --git a/src/main.js b/src/main.js index 7e8af37..90e30ce 100755 --- a/src/main.js +++ b/src/main.js @@ -19,8 +19,36 @@ import clipboard from '@/utils/dirClipBoard'; import { modernCopyToClipboard } from '@/utils/clipboard'; //登陆 import { autoLoginByToken } from '@/utils/login' + +function filterByPermission(data, targetPermission) { + return data.filter(item => { + // 检查主项权限 + const hasMainPermission = item.permission?.includes(targetPermission); + + // 检查子项权限(如果存在list) + const hasChildPermission = item.list?.some( + child => child.permission?.includes(targetPermission) + ); + + return hasMainPermission || hasChildPermission; + }).map(item => { + // 深拷贝避免污染原数据 + const newItem = JSON.parse(JSON.stringify(item)); + + // 过滤子项 + if (newItem.list) { + newItem.list = newItem.list.filter( + child => child.permission?.includes(targetPermission) + ); + } + + return newItem; + }); +} + // 复制 Vue.prototype.$copy = modernCopyToClipboard; +Vue.prototype.$filterByPermission = filterByPermission; Vue.prototype.$loadingFn = LoadingService; Vue.config.productionTip = false; // 请求 diff --git a/src/style/theme/common.scss b/src/style/theme/common.scss index 6fe95f2..fe743ba 100644 --- a/src/style/theme/common.scss +++ b/src/style/theme/common.scss @@ -213,6 +213,10 @@ body { .el-table__body-wrapper::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; + transition: all .3s; + &:hover{ + background: #6B7280; + } } @keyframes fadeInOut { diff --git a/src/views/agent/payCertSetting.vue b/src/views/agent/payCertSetting.vue index 430fa6f..d2f45ba 100644 --- a/src/views/agent/payCertSetting.vue +++ b/src/views/agent/payCertSetting.vue @@ -320,11 +320,13 @@ export default { } }, computed: { - ...mapState(['pageTitle']) // 从Vuex映射showSidebar状态到组件的计算属性中 + ...mapState(['pageTitle','paySettingData']) // 从Vuex映射showSidebar状态到组件的计算属性中 }, created() { + const {payType} = this.$route.query store.commit('SET_CUSTOMIZE', true); - store.commit('SET_SLIDER_MENU', 'paySettingData'); + const data = this.$filterByPermission(this.paySettingData,Number(payType)) + store.commit('SET_SLIDER_MENU', data); }, mounted() { store.commit('SET_PAGETITLE', '支付授权'); diff --git a/src/views/agent/payInfoSetting.vue b/src/views/agent/payInfoSetting.vue index 9bd365a..29e5fe0 100644 --- a/src/views/agent/payInfoSetting.vue +++ b/src/views/agent/payInfoSetting.vue @@ -219,11 +219,13 @@ export default { } }, computed: { - ...mapState(['pageTitle']) // 从Vuex映射showSidebar状态到组件的计算属性中 + ...mapState(['pageTitle','paySettingData']) // 从Vuex映射showSidebar状态到组件的计算属性中 }, created() { + const {payType} = this.$route.query store.commit('SET_CUSTOMIZE', true); - store.commit('SET_SLIDER_MENU', 'paySettingData'); + const data = this.$filterByPermission(this.paySettingData,Number(payType)) + store.commit('SET_SLIDER_MENU', data); }, mounted() { store.commit('SET_PAGETITLE', '支付授权'); diff --git a/src/views/agent/payList.vue b/src/views/agent/payList.vue index 7678ca2..0512570 100644 --- a/src/views/agent/payList.vue +++ b/src/views/agent/payList.vue @@ -54,7 +54,7 @@ @@ -109,7 +109,7 @@ @@ -161,7 +161,7 @@ @@ -214,7 +214,7 @@ @@ -266,7 +266,7 @@ @@ -699,8 +699,8 @@ export default { handleClick(tab, event) { console.log(tab, event); }, - paySetting(row) { - window.open('/agent/payInfoSetting?payid='+row.payid, '_blank'); + paySetting(row,payType) { + window.open('/agent/payInfoSetting?payid='+row.payid + '&payType=' + payType, '_blank'); } }, diff --git a/src/views/agent/paySetting.vue b/src/views/agent/paySetting.vue index 958ff3e..09a82fd 100644 --- a/src/views/agent/paySetting.vue +++ b/src/views/agent/paySetting.vue @@ -92,11 +92,13 @@ export default { } }, computed: { - ...mapState(['pageTitle']) // 从Vuex映射showSidebar状态到组件的计算属性中 + ...mapState(['pageTitle','paySettingData']) // 从Vuex映射showSidebar状态到组件的计算属性中 }, created() { + const {payType} = this.$route.query store.commit('SET_CUSTOMIZE', true); - store.commit('SET_SLIDER_MENU', 'paySettingData'); + const data = this.$filterByPermission(this.paySettingData,Number(payType)) + store.commit('SET_SLIDER_MENU', data); }, mounted() { store.commit('SET_PAGETITLE', '支付授权');