t20-common-lib 0.9.0 → 0.9.2
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
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
v-model="branchBankNo"
|
|
4
4
|
v-select-lazy="lazyGet"
|
|
5
5
|
:multiple="multiple"
|
|
6
|
-
:loading="loading"
|
|
7
6
|
filterable
|
|
8
7
|
clearable
|
|
9
8
|
:filter-method="debouncedFilter"
|
|
@@ -80,7 +79,6 @@ export default {
|
|
|
80
79
|
return {
|
|
81
80
|
branchBankNo: this.value,
|
|
82
81
|
branchBankList: [],
|
|
83
|
-
loading: false,
|
|
84
82
|
page: {
|
|
85
83
|
current: 1,
|
|
86
84
|
size: 20,
|
|
@@ -114,12 +112,11 @@ export default {
|
|
|
114
112
|
}
|
|
115
113
|
},
|
|
116
114
|
async fetchBranchData(isInitial = false) {
|
|
117
|
-
if (
|
|
115
|
+
if (!this.page.hasMore) return;
|
|
118
116
|
if (typeof this.requestFn !== 'function') {
|
|
119
117
|
console.error("requestFn prop must be a function.");
|
|
120
118
|
return;
|
|
121
119
|
}
|
|
122
|
-
this.loading = true;
|
|
123
120
|
|
|
124
121
|
const params = {
|
|
125
122
|
"page.size": this.page.size,
|
|
@@ -135,18 +132,16 @@ export default {
|
|
|
135
132
|
}
|
|
136
133
|
|
|
137
134
|
try {
|
|
138
|
-
const {
|
|
135
|
+
const { data = [] } = await this.requestFn(params);
|
|
139
136
|
if (isInitial) {
|
|
140
|
-
this.branchBankList =
|
|
137
|
+
this.branchBankList = data;
|
|
141
138
|
} else {
|
|
142
|
-
this.branchBankList = this.branchBankList.concat(
|
|
139
|
+
this.branchBankList = this.branchBankList.concat(data);
|
|
143
140
|
}
|
|
144
|
-
this.page.hasMore =
|
|
141
|
+
this.page.hasMore = data.length === this.page.size;
|
|
145
142
|
} catch (error) {
|
|
146
143
|
console.error("Failed to fetch branch data:", error);
|
|
147
|
-
}
|
|
148
|
-
this.loading = false;
|
|
149
|
-
}
|
|
144
|
+
}
|
|
150
145
|
},
|
|
151
146
|
handleFilter(val) {
|
|
152
147
|
this.page.key = val;
|