doway-coms 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/utils/api.js +2 -4
- package/packages/utils/common.js +10 -10
- package/packages/utils/store.js +32 -18
package/package.json
CHANGED
package/packages/utils/api.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import request from './request'
|
|
2
2
|
import store from './store'
|
|
3
|
+
import axios from 'axios'
|
|
3
4
|
export function loadViewInfo(moduleCode) {
|
|
4
5
|
return request({
|
|
5
6
|
url: store.getters.umsUrl + '/v1/module/loadViewInfo',
|
|
@@ -10,10 +11,7 @@ export function loadViewInfo(moduleCode) {
|
|
|
10
11
|
})
|
|
11
12
|
}
|
|
12
13
|
export function loadLangInfo(moduleCode,moduleLangCacheHash) {
|
|
13
|
-
return
|
|
14
|
-
url: store.getters.moduleLangUrl + '/'+ moduleCode+'_zh_cn.json?cacheHash='+moduleLangCacheHash,
|
|
15
|
-
method: 'get'
|
|
16
|
-
})
|
|
14
|
+
return axios.get(store.getters.moduleLangUrl + '/'+ moduleCode+'_zh_cn.json?cacheHash='+moduleLangCacheHash)
|
|
17
15
|
}
|
|
18
16
|
|
|
19
17
|
export function saveUserModuleDataFieldApi(data) {
|
package/packages/utils/common.js
CHANGED
|
@@ -248,16 +248,16 @@ export function replaceParamString(
|
|
|
248
248
|
alert('防呆,子应用没有路由缓存键:'+JSON.stringify(to))
|
|
249
249
|
}
|
|
250
250
|
if (to.meta.moduleCode && !store.getters.moduleViewInfo[to.meta.moduleCode]) {
|
|
251
|
-
axios.all([store.dispatch('moduleLoadViewInfo', { moduleCode: to.meta.moduleCode }),
|
|
252
|
-
store.dispatch('moduleLoadLangInfo', { moduleCode: to.meta.moduleCode,moduleLangCacheHash:to.meta.moduleLangCacheHash })])
|
|
253
|
-
.then(axios.spread(function() {
|
|
254
|
-
|
|
255
|
-
}))
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
251
|
+
// axios.all([store.dispatch('moduleLoadViewInfo', { moduleCode: to.meta.moduleCode }),
|
|
252
|
+
// store.dispatch('moduleLoadLangInfo', { moduleCode: to.meta.moduleCode,moduleLangCacheHash:to.meta.moduleLangCacheHash })])
|
|
253
|
+
// .then(axios.spread(function() {
|
|
254
|
+
// next()
|
|
255
|
+
// }))
|
|
256
|
+
store
|
|
257
|
+
.dispatch('moduleLoadViewInfo', { moduleCode: to.meta.moduleCode })
|
|
258
|
+
.then(() => {
|
|
259
|
+
next()
|
|
260
|
+
})
|
|
261
261
|
.catch((err) => {
|
|
262
262
|
console.debug(err)
|
|
263
263
|
})
|
package/packages/utils/store.js
CHANGED
|
@@ -24,6 +24,7 @@ export default new Vuex.Store({
|
|
|
24
24
|
isGenerateMatCode:'false',//是否生成物料编码
|
|
25
25
|
webAppCode: '',
|
|
26
26
|
moduleViewInfo: {},
|
|
27
|
+
moduleLangInfo:{},
|
|
27
28
|
controlSize: 'small',
|
|
28
29
|
newId: 0,//明细新增id
|
|
29
30
|
userId: '',
|
|
@@ -52,6 +53,9 @@ export default new Vuex.Store({
|
|
|
52
53
|
SET_WEB_APP_CODE: (state, webAppCode) => {
|
|
53
54
|
state.webAppCode = webAppCode
|
|
54
55
|
},
|
|
56
|
+
SET_MODULE_LANG_INFO:(state,data)=>{
|
|
57
|
+
state.moduleLangInfo[data.moduleCode] = data.info
|
|
58
|
+
},
|
|
55
59
|
SET_MODULE_VIEW_INFO: (state, data) => {
|
|
56
60
|
let tempDataInfo = {}
|
|
57
61
|
XEUtils.arrayEach(data.info.datas,loopData=>{
|
|
@@ -221,30 +225,39 @@ export default new Vuex.Store({
|
|
|
221
225
|
moduleCode: dataInfo.moduleCode,
|
|
222
226
|
info: reponseData.content
|
|
223
227
|
})
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return new Promise((resolve, reject) => {
|
|
234
|
-
loadLangInfo(dataInfo.moduleCode)
|
|
235
|
-
.then(reponseData => {
|
|
236
|
-
commit('SET_MODULE_LANG_INFO', {
|
|
237
|
-
moduleCode: dataInfo.moduleCode,
|
|
238
|
-
info: reponseData.content
|
|
228
|
+
loadLangInfo(dataInfo.moduleCode,reponseData.content.moduleLangCacheHash)
|
|
229
|
+
.then(langData=>{
|
|
230
|
+
commit('SET_MODULE_LANG_INFO', {
|
|
231
|
+
moduleCode: dataInfo.moduleCode,
|
|
232
|
+
info: langData.data
|
|
233
|
+
})
|
|
234
|
+
resolve()
|
|
235
|
+
}).catch(()=>{
|
|
236
|
+
resolve()
|
|
239
237
|
})
|
|
240
|
-
resolve()
|
|
241
238
|
})
|
|
242
239
|
.catch(error => {
|
|
243
|
-
|
|
244
|
-
resolve()
|
|
240
|
+
reject(error)
|
|
245
241
|
})
|
|
246
242
|
})
|
|
247
243
|
},
|
|
244
|
+
// moduleLoadLangInfo({ commit, state }, dataInfo) {
|
|
245
|
+
// let vm = this
|
|
246
|
+
// return new Promise((resolve, reject) => {
|
|
247
|
+
// loadLangInfo(dataInfo.moduleCode)
|
|
248
|
+
// .then(reponseData => {
|
|
249
|
+
// commit('SET_MODULE_LANG_INFO', {
|
|
250
|
+
// moduleCode: dataInfo.moduleCode,
|
|
251
|
+
// info: reponseData.data
|
|
252
|
+
// })
|
|
253
|
+
// resolve()
|
|
254
|
+
// })
|
|
255
|
+
// .catch(error => {
|
|
256
|
+
// console.debug(error)
|
|
257
|
+
// resolve()
|
|
258
|
+
// })
|
|
259
|
+
// })
|
|
260
|
+
// },
|
|
248
261
|
// 固定返回工作台,并根据条件决定是否关闭其余标签
|
|
249
262
|
goWorkbench({ commit }, tabsAllClose) {
|
|
250
263
|
if(window.$wujie){
|
|
@@ -277,6 +290,7 @@ export default new Vuex.Store({
|
|
|
277
290
|
token: state => state.token,
|
|
278
291
|
webAppCode: state => state.webAppCode,
|
|
279
292
|
moduleViewInfo: state => state.moduleViewInfo,
|
|
293
|
+
moduleLangInfo: state => state.moduleLangInfo,
|
|
280
294
|
controlSize: state => state.controlSize,
|
|
281
295
|
newId: state => () => {
|
|
282
296
|
state.newId = state.newId + 1
|