diff --git a/PC/InterFace.Dash/src/mixins/TableMixins.js b/PC/InterFace.Dash/src/mixins/TableMixins.js index c3d2d08..5633eda 100644 --- a/PC/InterFace.Dash/src/mixins/TableMixins.js +++ b/PC/InterFace.Dash/src/mixins/TableMixins.js @@ -56,14 +56,16 @@ export const tableMixins = { }, mounted() { // 用于api表头的字段设置监听同步 + // todo:切换页面空白bug,apiColumns_Table拿出去是否有效 window.addEventListener('setItemEvent', (item) => { - if (item.key.indexOf('tableColumns') > -1) { - if(JSON.parse(item.newValue).length <= 0){ - this.apiColumns_Table = this.apiColumns_Table_copy[this.$route.name] - }else{ - this.apiColumns_Table = JSON.parse(item.newValue) - } + if (item.key.indexOf('tableColumns_') >= 0) { + console.log(item.newValue) + if(JSON.parse(item.newValue).length <= 0){ + this.apiColumns_Table = this.apiColumns_Table_copy[this.$route.name] + }else{ + this.apiColumns_Table = JSON.parse(item.newValue) } + } }) }, methods: { diff --git a/PC/InterFace.Dash/src/permission.js b/PC/InterFace.Dash/src/permission.js index b91ee98..a27b774 100644 --- a/PC/InterFace.Dash/src/permission.js +++ b/PC/InterFace.Dash/src/permission.js @@ -84,8 +84,8 @@ router.beforeEach(async (to, from, next) => { } }else{ // 重新获取api接口表头 - // const _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames") - // if( !_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){ + const _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames") + if( !_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){ getInterfaceBoard().then(result => { // todo-new:columnsApiNamesZh配置的地址补全(evel) localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.resources[_zh].texts)); @@ -93,9 +93,9 @@ router.beforeEach(async (to, from, next) => { next() },0) }) - // }else{ - // next() - // } + }else{ + next() + } }