Browse Source

改打包名称,请求路由接口

master
mk 1 year ago
parent
commit
726e765d9b
  1. 3
      .gitignore
  2. 20
      src/views/datapre/dataset/index.vue
  3. 21
      src/views/dataservice/list/dataserviceList.vue
  4. 2
      vue.config.js

3
.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

20
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 {返回值类型} 返回值说明

21
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',

2
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,

Loading…
Cancel
Save