|
@ -248,6 +248,7 @@ |
|
|
import { mapGetters } from 'vuex' |
|
|
import { mapGetters } from 'vuex' |
|
|
import { handleEncryptParams } from '@/utils/aesCrypto' |
|
|
import { handleEncryptParams } from '@/utils/aesCrypto' |
|
|
import Cookies from 'js-cookie' |
|
|
import Cookies from 'js-cookie' |
|
|
|
|
|
import cloneDeep from 'lodash/cloneDeep' |
|
|
export default { |
|
|
export default { |
|
|
name: 'datasourceMain', |
|
|
name: 'datasourceMain', |
|
|
data() { |
|
|
data() { |
|
@ -321,9 +322,11 @@ export default { |
|
|
$route: { |
|
|
$route: { |
|
|
handler: function (newVal, oldVal) { |
|
|
handler: function (newVal, oldVal) { |
|
|
if(newVal.query.sessionId){ |
|
|
if(newVal.query.sessionId){ |
|
|
console.log('监听到的sessionId',newVal.query.sessionId); |
|
|
|
|
|
Cookies.set('sessionId',newVal.query.sessionId) |
|
|
Cookies.set('sessionId',newVal.query.sessionId) |
|
|
} |
|
|
} |
|
|
|
|
|
if(!window.localStorage.getItem('modules')){ |
|
|
|
|
|
this.fetchModulesList() |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
deep: true, |
|
|
deep: true, |
|
|
immediate: true, |
|
|
immediate: true, |
|
@ -331,6 +334,22 @@ export default { |
|
|
}, |
|
|
}, |
|
|
mounted() {}, |
|
|
mounted() {}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
async fetchModulesList() { |
|
|
|
|
|
let fullPath = this.$route.fullPath |
|
|
|
|
|
fullPath = decodeURIComponent(fullPath) |
|
|
|
|
|
const res = await this.$store.dispatch('bi/commonAPI', { |
|
|
|
|
|
apiCode: 'modules/list', |
|
|
|
|
|
dispatcherSystem: 'system', |
|
|
|
|
|
param: { |
|
|
|
|
|
app_code:'demo_app' |
|
|
|
|
|
}, |
|
|
|
|
|
}) |
|
|
|
|
|
if (res.code === 0) { |
|
|
|
|
|
const newModules = cloneDeep(res.data) |
|
|
|
|
|
this.$store.commit('global/SET_MODULES', newModules) |
|
|
|
|
|
window.localStorage.setItem('modules', JSON.stringify(newModules)) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
async applicationList() { |
|
|
async applicationList() { |
|
|
const params = { |
|
|
const params = { |
|
|
apiCode: '/application/list', |
|
|
apiCode: '/application/list', |
|
|