vue2-client 1.5.19 → 1.5.20

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/CHANGELOG.md CHANGED
@@ -13,6 +13,7 @@
13
13
  - 修改查询配置
14
14
  - 修复清空查询缓存回调问题
15
15
  - 新增调用logic获取数据源可自定义追加参数
16
+ - 修改省市区数据获取
16
17
 
17
18
  **1.5.11 - 1.5.13 -2022-12-05 @江超**
18
19
  - 优化了查询配置生成界面的样式
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.5.19",
3
+ "version": "1.5.20",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -70,7 +70,7 @@ export default {
70
70
  return {
71
71
  open: false,
72
72
  tagData: {
73
- divisionsForTree: this.$appdata.getDivisionsOhChinaForTree(),
73
+ divisionsForTree: [],
74
74
  // 市
75
75
  cityData: [],
76
76
  // 区
@@ -99,7 +99,9 @@ export default {
99
99
  }
100
100
  },
101
101
  mounted () {
102
-
102
+ this.$appdata.getDivisionsOhChinaForTree().then(res => {
103
+ this.tagData.divisionsForTree = res
104
+ })
103
105
  },
104
106
  model: {
105
107
  prop: 'value',
@@ -30,13 +30,18 @@ const GetAppDataService = {
30
30
  localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
31
31
  localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
32
32
  })
33
- // 获取省市区数据
34
- localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify([]))
35
33
  },
36
34
  // 返回树形省市区
37
- getDivisionsOhChinaForTree () {
38
- const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
39
- return handleTree(JSON.parse(str), 'code', 'parentcode')
35
+ async getDivisionsOhChinaForTree () {
36
+ let list = this.getDivisionsOhChinaForList()
37
+ // 获取省市区数据
38
+ if (!list) {
39
+ await post(manageApi.getDivisionsOhChina, {}).then((res) => {
40
+ list = res
41
+ localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify(res))
42
+ })
43
+ }
44
+ return handleTree(list, 'code', 'parentcode')
40
45
  },
41
46
  // 返回列表省市区
42
47
  getDivisionsOhChinaForList () {