gcs-ui-lib 1.2.38 → 1.2.39

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": "gcs-ui-lib",
3
- "version": "1.2.38",
3
+ "version": "1.2.39",
4
4
  "private": false,
5
5
  "main": "./lib/gcs-ui-lib.common.js",
6
6
  "scripts": {
@@ -68,6 +68,26 @@ export default {
68
68
  total: 100
69
69
  }
70
70
  },
71
+ watch: {
72
+ value: {
73
+ handler(val) {
74
+ if (!val || (Array.isArray(val) && val.length === 0)) return
75
+ const valArr = Array.isArray(val) ? val : [val]
76
+ const missing = valArr.filter(v => !this.bankList.find(item => item.bankNo === v))
77
+ if (missing.length > 0) {
78
+ this.getBanks(missing)
79
+ }
80
+ }
81
+ },
82
+ moreParams: {
83
+ handler() {
84
+ this.page.current = 1
85
+ this.searchKey = ''
86
+ this.getBanks()
87
+ },
88
+ deep: true
89
+ }
90
+ },
71
91
  async mounted() {
72
92
  if (this.value){
73
93
  await this.getBanks(this.value)
@@ -88,10 +108,11 @@ export default {
88
108
  },
89
109
  getBanks(originKey = '') {
90
110
  const isArray = Array.isArray(originKey);
111
+ const bankNoList = isArray ? originKey.join(',') : (originKey || '');
91
112
  const params = {
92
- 'page.current': this.page.current,
113
+ 'page.current': bankNoList ? 1 : this.page.current,
93
114
  'page.size': this.page.size,
94
- [isArray ? 'bankNoList': 'searchKey']: isArray ? originKey.join(','): originKey || this.searchKey,
115
+ ...(bankNoList ? { bankNoList } : { searchKey: this.searchKey }),
95
116
  isEnable: 1,
96
117
  ...this.moreParams,
97
118
  }