t20-common-lib 0.12.18 → 0.12.19
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
|
@@ -91,6 +91,8 @@ export default {
|
|
|
91
91
|
branchBankList: [],
|
|
92
92
|
// 本地标志:用于抑制由本组件触发的 bankCode 变更导致的 reset
|
|
93
93
|
_suppressBankCodeReset: false,
|
|
94
|
+
// 初始化阶段标志:首次拿到有效 bankCode 前,不清空回显值
|
|
95
|
+
_bankCodeInitialized: false,
|
|
94
96
|
page: {
|
|
95
97
|
current: 1,
|
|
96
98
|
size: 20,
|
|
@@ -116,14 +118,12 @@ export default {
|
|
|
116
118
|
// 只有在值实际变化时才重置(避免无意义的重新加载)
|
|
117
119
|
if (newVal === oldVal) return;
|
|
118
120
|
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
this.page.hasMore = true;
|
|
126
|
-
this.fetchBranchData(true);
|
|
121
|
+
// 初始化阶段(包括先空后有值的两次触发)只重拉列表,不清空回显值
|
|
122
|
+
if (!this._bankCodeInitialized) {
|
|
123
|
+
this.reloadListOnly();
|
|
124
|
+
if (this.hasValidBankCode(newVal)) {
|
|
125
|
+
this._bankCodeInitialized = true;
|
|
126
|
+
}
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -205,14 +205,21 @@ export default {
|
|
|
205
205
|
this.page.hasMore = true;
|
|
206
206
|
this.fetchBranchData(true);
|
|
207
207
|
},
|
|
208
|
-
|
|
208
|
+
hasValidBankCode(val) {
|
|
209
|
+
if (Array.isArray(val)) return val.length > 0;
|
|
210
|
+
return val !== undefined && val !== null && val !== "";
|
|
211
|
+
},
|
|
212
|
+
reloadListOnly() {
|
|
209
213
|
this.branchBankList = [];
|
|
210
214
|
this.page.current = 1;
|
|
211
215
|
this.page.key = "";
|
|
212
216
|
this.page.hasMore = true;
|
|
213
|
-
this.branchBankNo = this.multiple ? [] : "";
|
|
214
217
|
this.fetchBranchData(true);
|
|
215
218
|
},
|
|
219
|
+
resetAndFetch() {
|
|
220
|
+
this.reloadListOnly();
|
|
221
|
+
this.branchBankNo = this.multiple ? [] : "";
|
|
222
|
+
},
|
|
216
223
|
handleBranchChange(val) {
|
|
217
224
|
// 保持 v-model 行为
|
|
218
225
|
// 在 emit 之前设置抑制标志,防止父组件基于此事件同步修改 `bankCode` 导致我们被动地重置
|