t20-common-lib 0.12.18 → 0.12.20
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
|
@@ -16,7 +16,16 @@
|
|
|
16
16
|
:key="`display-${displayOption[valueKey]}`"
|
|
17
17
|
:label="displayOption.branchBankName"
|
|
18
18
|
:value="displayOption[valueKey]"
|
|
19
|
-
|
|
19
|
+
>
|
|
20
|
+
<slot name="option" :item="displayOption">
|
|
21
|
+
<div class="flex-column flex-c" style="height: 100%">
|
|
22
|
+
<div style="line-height: 20px; font-weight: bold">
|
|
23
|
+
{{ displayOption.branchBankName }}
|
|
24
|
+
</div>
|
|
25
|
+
<div style="line-height: 20px">{{ displayOption.cnapsNo || displayOption[valueKey] }}</div>
|
|
26
|
+
</div>
|
|
27
|
+
</slot>
|
|
28
|
+
</el-option>
|
|
20
29
|
<el-option
|
|
21
30
|
v-for="item in branchBankList"
|
|
22
31
|
:key="item.cnapsNo"
|
|
@@ -91,6 +100,8 @@ export default {
|
|
|
91
100
|
branchBankList: [],
|
|
92
101
|
// 本地标志:用于抑制由本组件触发的 bankCode 变更导致的 reset
|
|
93
102
|
_suppressBankCodeReset: false,
|
|
103
|
+
// 初始化阶段标志:首次拿到有效 bankCode 前,不清空回显值
|
|
104
|
+
_bankCodeInitialized: false,
|
|
94
105
|
page: {
|
|
95
106
|
current: 1,
|
|
96
107
|
size: 20,
|
|
@@ -116,14 +127,12 @@ export default {
|
|
|
116
127
|
// 只有在值实际变化时才重置(避免无意义的重新加载)
|
|
117
128
|
if (newVal === oldVal) return;
|
|
118
129
|
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
this.page.hasMore = true;
|
|
126
|
-
this.fetchBranchData(true);
|
|
130
|
+
// 初始化阶段(包括先空后有值的两次触发)只重拉列表,不清空回显值
|
|
131
|
+
if (!this._bankCodeInitialized) {
|
|
132
|
+
this.reloadListOnly();
|
|
133
|
+
if (this.hasValidBankCode(newVal)) {
|
|
134
|
+
this._bankCodeInitialized = true;
|
|
135
|
+
}
|
|
127
136
|
return;
|
|
128
137
|
}
|
|
129
138
|
|
|
@@ -205,14 +214,21 @@ export default {
|
|
|
205
214
|
this.page.hasMore = true;
|
|
206
215
|
this.fetchBranchData(true);
|
|
207
216
|
},
|
|
208
|
-
|
|
217
|
+
hasValidBankCode(val) {
|
|
218
|
+
if (Array.isArray(val)) return val.length > 0;
|
|
219
|
+
return val !== undefined && val !== null && val !== "";
|
|
220
|
+
},
|
|
221
|
+
reloadListOnly() {
|
|
209
222
|
this.branchBankList = [];
|
|
210
223
|
this.page.current = 1;
|
|
211
224
|
this.page.key = "";
|
|
212
225
|
this.page.hasMore = true;
|
|
213
|
-
this.branchBankNo = this.multiple ? [] : "";
|
|
214
226
|
this.fetchBranchData(true);
|
|
215
227
|
},
|
|
228
|
+
resetAndFetch() {
|
|
229
|
+
this.reloadListOnly();
|
|
230
|
+
this.branchBankNo = this.multiple ? [] : "";
|
|
231
|
+
},
|
|
216
232
|
handleBranchChange(val) {
|
|
217
233
|
// 保持 v-model 行为
|
|
218
234
|
// 在 emit 之前设置抑制标志,防止父组件基于此事件同步修改 `bankCode` 导致我们被动地重置
|