n20-common-lib 2.8.32 → 2.8.33

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": "n20-common-lib",
3
- "version": "2.8.32",
3
+ "version": "2.8.33",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -14,7 +14,7 @@
14
14
  <script>
15
15
  import axios from '../../utils/axios'
16
16
  window._china_area_tree_ = undefined
17
-
17
+ import cloneDeep from 'lodash/cloneDeep'
18
18
  export default {
19
19
  name: 'CascaderArea',
20
20
  props: {
@@ -98,15 +98,19 @@ export default {
98
98
  { loading: false, noMsg: true }
99
99
  )
100
100
  .then(({ data }) => {
101
- window[this.urbanKey] = isUrbanFn(JSON.parse(JSON.stringify(data)))
102
- window[this.streetKey] = treeFn(JSON.parse(JSON.stringify(data)))
103
- window[this.areaKey] = treeFn(JSON.parse(JSON.stringify(data)))
104
-
105
- this.areaTree = this.isUrban
106
- ? window[this.urbanKey]
107
- : this.isStreet
108
- ? window[this.streetKey]
109
- : window[this.areaKey]
101
+ if (data) {
102
+ let result = cloneDeep(data)
103
+ if (this.isUrban) {
104
+ window[this.urbanKey] = isUrbanFn(result)
105
+ this.areaTree = window[this.urbanKey]
106
+ } else if (this.isStreet) {
107
+ window[this.streetKey] = treeFn(result)
108
+ this.areaTree = window[this.streetKey]
109
+ } else {
110
+ window[this.areaKey] = treeFn(result)
111
+ this.areaTree = window[this.areaKey]
112
+ }
113
+ }
110
114
  })
111
115
  },
112
116
  updateArea() {