doway-coms 1.9.8 → 2.0.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doway-coms",
3
- "version": "1.9.8",
3
+ "version": "2.0.0",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -34,6 +34,7 @@
34
34
  :replaceFields="replaceFields"
35
35
  :dropdownMatchSelectWidth="dropdownMatchSelectWidth"
36
36
  :treeDefaultExpandAll="treeDefaultExpandAll"
37
+ :treeDefaultExpandedKeys="treeDefaultExpandedKeys"
37
38
  @change="changeData"
38
39
  :size="size"
39
40
  :allowClear="allowClear"
@@ -255,10 +256,11 @@ export default {
255
256
  return {
256
257
  treeData: [],
257
258
  currentValue: '',
259
+ treeDefaultExpandedKeys: [],
258
260
  }
259
261
  },
260
262
  mounted() {
261
- // this.searchData()
263
+ this.searchData()
262
264
  if (this.treeData.length) {
263
265
  this.currentValue = this.row[this.linkedField]
264
266
  } else {
@@ -269,11 +271,14 @@ export default {
269
271
  treeData(val) {
270
272
  if (this.treeData.length) {
271
273
  this.currentValue = this.row[this.linkedField]
274
+ this.treeDefaultExpandedKeys = []
275
+ this.treeDefaultExpandedKeys.push(this.currentValue)
272
276
  } else {
273
277
  this.currentValue = this.value
274
278
  }
275
279
  },
276
280
  edit(value) {
281
+ // debugger
277
282
  if (value) {
278
283
  if (this.treeData.length) {
279
284
  this.currentValue = this.row[this.linkedField]
@@ -9,6 +9,12 @@ export function loadViewInfo(moduleCode) {
9
9
  }
10
10
  })
11
11
  }
12
+ export function loadLangInfo(moduleCode,moduleLangCacheHash) {
13
+ return request({
14
+ url: store.getters.moduleLangUrl + '/'+ moduleCode+'_zh_cn.json?cacheHash='+moduleLangCacheHash,
15
+ method: 'get'
16
+ })
17
+ }
12
18
 
13
19
  export function saveUserModuleDataFieldApi(data) {
14
20
  return request({
@@ -1,6 +1,7 @@
1
1
  import {notification } from 'ant-design-vue'
2
2
  import store from './store'
3
3
  import XEUtils from 'xe-utils'
4
+ import axios from 'axios'
4
5
  /**
5
6
  * 替换掩码参数字符串
6
7
  * @param {参数字符串} paramString
@@ -247,11 +248,16 @@ export function replaceParamString(
247
248
  alert('防呆,子应用没有路由缓存键:'+JSON.stringify(to))
248
249
  }
249
250
  if (to.meta.moduleCode && !store.getters.moduleViewInfo[to.meta.moduleCode]) {
250
- store
251
- .dispatch('moduleLoadViewInfo', { moduleCode: to.meta.moduleCode })
252
- .then(() => {
253
- next()
254
- })
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
+ // })
255
261
  .catch((err) => {
256
262
  console.debug(err)
257
263
  })
@@ -1,5 +1,5 @@
1
1
 
2
- import {loadViewInfo} from './api'
2
+ import {loadViewInfo,loadLangInfo} from './api'
3
3
  import XEUtils from 'xe-utils'
4
4
  import Vue from 'vue'
5
5
  import Vuex from 'vuex'
@@ -9,6 +9,7 @@ Vue.use(Vuex)
9
9
 
10
10
  export default new Vuex.Store({
11
11
  state: {
12
+ moduleLangUrl:'',
12
13
  umsUrl:'',
13
14
  baseUrl:'',
14
15
  msgUrl:'',
@@ -143,6 +144,9 @@ export default new Vuex.Store({
143
144
  SET_UMS_URL:(state,url) => {
144
145
  state.umsUrl = url
145
146
  },
147
+ SET_MODULE_LANG_URL:(state,url) => {
148
+ state.moduleLangUrl = url
149
+ },
146
150
  SET_BASE_URL:(state,url) => {
147
151
  state.baseUrl = url
148
152
  },
@@ -224,6 +228,23 @@ export default new Vuex.Store({
224
228
  })
225
229
  })
226
230
  },
231
+ moduleLoadLangInfo({ commit, state }, dataInfo) {
232
+ let vm = this
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
239
+ })
240
+ resolve()
241
+ })
242
+ .catch(error => {
243
+ console.debug(error)
244
+ resolve()
245
+ })
246
+ })
247
+ },
227
248
  // 固定返回工作台,并根据条件决定是否关闭其余标签
228
249
  goWorkbench({ commit }, tabsAllClose) {
229
250
  if(window.$wujie){
@@ -249,6 +270,7 @@ export default new Vuex.Store({
249
270
  industryVersion:state=>state.industryVersion,
250
271
  isGenerateMatCode:state=>state.isGenerateMatCode,
251
272
  umsUrl:state=>state.umsUrl,
273
+ moduleLangUrl:state=>state.moduleLangUrl,
252
274
  baseUrl:state=>state.baseUrl,
253
275
  msgUrl:state=>state.msgUrl,
254
276
  identityUrl:state=>state.identityUrl,