From 726e765d9bd7e881e8824f5cdefed5a4f195a9b6 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Wed, 26 Jun 2024 10:38:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E6=89=93=E5=8C=85=E5=90=8D=E7=A7=B0,?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=B7=AF=E7=94=B1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- src/views/datapre/dataset/index.vue | 20 ++++++++++++++++++ .../dataservice/list/dataserviceList.vue | 21 ++++++++++++++++++- vue.config.js | 2 +- 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index be2851a..cbf27f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ .DS_Store node_modules/ -dist +data-bi dist* npm-debug.log* yarn-debug.log* @@ -13,6 +13,7 @@ tests/**/coverage/ .history .vscode *.suo +*.zip *.ntvs* *.njsproj *.sln diff --git a/src/views/datapre/dataset/index.vue b/src/views/datapre/dataset/index.vue index 1c17d72..f275539 100644 --- a/src/views/datapre/dataset/index.vue +++ b/src/views/datapre/dataset/index.vue @@ -9,6 +9,7 @@ // import siderbar from './siderbar' import datapreMain from './datapreMain' import Cookies from 'js-cookie' +import cloneDeep from 'lodash/cloneDeep' export default { name: 'index', data() { @@ -39,6 +40,9 @@ export default { console.log('监听到的sessionId',newVal.query.sessionId); Cookies.set('sessionId',newVal.query.sessionId) } + if(!window.localStorage.getItem('modules')){ + this.fetchModulesList() + } }, deep: true, immediate: true, @@ -49,6 +53,22 @@ export default { console.log(tab, event) // this.activeName = tab; }, + 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)) + } + }, /** * 开启商品属性 * @return {返回值类型} 返回值说明 diff --git a/src/views/dataservice/list/dataserviceList.vue b/src/views/dataservice/list/dataserviceList.vue index 30869bb..ba6d1e3 100644 --- a/src/views/dataservice/list/dataserviceList.vue +++ b/src/views/dataservice/list/dataserviceList.vue @@ -248,6 +248,7 @@ import { mapGetters } from 'vuex' import { handleEncryptParams } from '@/utils/aesCrypto' import Cookies from 'js-cookie' +import cloneDeep from 'lodash/cloneDeep' export default { name: 'datasourceMain', data() { @@ -321,9 +322,11 @@ export default { $route: { handler: function (newVal, oldVal) { if(newVal.query.sessionId){ - console.log('监听到的sessionId',newVal.query.sessionId); Cookies.set('sessionId',newVal.query.sessionId) } + if(!window.localStorage.getItem('modules')){ + this.fetchModulesList() + } }, deep: true, immediate: true, @@ -331,6 +334,22 @@ export default { }, mounted() {}, 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() { const params = { apiCode: '/application/list', diff --git a/vue.config.js b/vue.config.js index d2fab1b..292fce1 100644 --- a/vue.config.js +++ b/vue.config.js @@ -25,7 +25,7 @@ module.exports = { * Detail: https://cli.vuejs.org/config/#publicpath */ publicPath: process.env.NODE_ENV === 'development' ? `` : `${process.env.VUE_APP_ST_DOMAIN}`, - outputDir: 'dist', + outputDir: 'data-bi', assetsDir: '', lintOnSave: process.env.NODE_ENV === 'development', productionSourceMap: false,