n20-common-lib 2.6.13 → 2.6.14

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.6.13",
3
+ "version": "2.6.14",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -113,27 +113,12 @@ export default {
113
113
  watch: {
114
114
  visible: {
115
115
  handler(val) {
116
- val &&
117
- this.getFilterList().then(() => {
118
- for (const key in getOptionsMap()) {
119
- if (Object.hasOwnProperty.call(getOptionsMap(), key)) {
120
- const data = getOptionsMap()[key]
121
- this.setChoices(key, data)
122
- }
123
- }
124
- })
116
+ val && this.getFilterList()
125
117
  }
126
118
  }
127
119
  },
128
120
  created() {
129
- this.getFilterList().then(() => {
130
- for (const key in getOptionsMap()) {
131
- if (Object.hasOwnProperty.call(getOptionsMap(), key)) {
132
- const data = getOptionsMap()[key]
133
- this.setChoices(key, data)
134
- }
135
- }
136
- })
121
+ this.getFilterList()
137
122
  },
138
123
  methods: {
139
124
  getOnlyKey(data) {
@@ -217,14 +202,7 @@ export default {
217
202
  })
218
203
  this.saveFilter(data).then(({ code }) => {
219
204
  if (code === 200) {
220
- this.getFilterList().then(() => {
221
- for (const key in getOptionsMap()) {
222
- if (Object.hasOwnProperty.call(getOptionsMap(), key)) {
223
- const data = getOptionsMap()[key]
224
- this.setChoices(key, data)
225
- }
226
- }
227
- })
205
+ this.getFilterList()
228
206
  }
229
207
  })
230
208
  this.$emit('change', this.model)
@@ -249,14 +227,7 @@ export default {
249
227
  // 如果保存成功
250
228
  if (code === 200) {
251
229
  // 重新获取过滤条件列表
252
- this.getFilterList().then(() => {
253
- for (const key in getOptionsMap()) {
254
- if (Object.hasOwnProperty.call(getOptionsMap(), key)) {
255
- const data = getOptionsMap()[key]
256
- this.setChoices(key, data)
257
- }
258
- }
259
- })
230
+ this.getFilterList()
260
231
  }
261
232
  })
262
233
  this.$emit('check')
@@ -320,7 +291,14 @@ export default {
320
291
  }
321
292
  this.checkList = this.GroupData.map((res) => res.id)
322
293
  this.checkC = cloneDeep(this.checkList)
323
- return Promise.resolve()
294
+ })
295
+ .finally(() => {
296
+ for (const key in getOptionsMap()) {
297
+ if (Object.hasOwnProperty.call(getOptionsMap(), key)) {
298
+ const data = getOptionsMap()[key]
299
+ this.setChoices(key, data)
300
+ }
301
+ }
324
302
  })
325
303
  }
326
304
  }