wui-components-v2 1.2.25 → 1.2.27
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.
|
@@ -140,7 +140,7 @@ function toggleCollapse(contentId: string) {
|
|
|
140
140
|
<view class="min-w-0 flex-1">
|
|
141
141
|
<view class="flex min-w-0 flex-1 items-center gap-1">
|
|
142
142
|
<wd-tag
|
|
143
|
-
style="font-size:
|
|
143
|
+
style="font-size: 16px; padding: 2px 5px"
|
|
144
144
|
:bg-color="labelTag?.color"
|
|
145
145
|
v-if="showLabel && labelTag?.title"
|
|
146
146
|
>
|
|
@@ -427,7 +427,14 @@ watch(
|
|
|
427
427
|
const relChanged = item.relValueField && oldSnap.relValueField !== newSnap.relValueField
|
|
428
428
|
const rel3Changed = item.relValueField3 && oldSnap.relValueField3 !== newSnap.relValueField3
|
|
429
429
|
if (relChanged || rel3Changed) {
|
|
430
|
-
|
|
430
|
+
// 如果联动字段是从空/undefined 变为有值(初始化回显场景),不清空当前字段的值
|
|
431
|
+
// 只有当联动字段在用户交互中从一个非空值变为另一个非空值时才清空
|
|
432
|
+
const relWasEmpty =
|
|
433
|
+
(!item.relValueField || oldSnap.relValueField === undefined || oldSnap.relValueField === '') &&
|
|
434
|
+
(!item.relValueField3 || oldSnap.relValueField3 === undefined || oldSnap.relValueField3 === '')
|
|
435
|
+
if (!relWasEmpty) {
|
|
436
|
+
model.value[item.id] = ''
|
|
437
|
+
}
|
|
431
438
|
}
|
|
432
439
|
})
|
|
433
440
|
}
|
|
@@ -7,6 +7,7 @@ import foldCard2 from '../fold-card2/fold-card2.vue'
|
|
|
7
7
|
import type { Config, Entities, Enums, FoldCardModel } from '../../type'
|
|
8
8
|
import { useGlobalToast } from '../../composables/useGlobalToast'
|
|
9
9
|
import Search from '../search/search.vue'
|
|
10
|
+
import foldCard from '../fold-card/fold-card.vue'
|
|
10
11
|
|
|
11
12
|
defineOptions({
|
|
12
13
|
name: 'WuiSelectList',
|
|
@@ -215,7 +216,11 @@ function confirm() {
|
|
|
215
216
|
send()
|
|
216
217
|
}
|
|
217
218
|
onUnmounted(() => {
|
|
218
|
-
uni.$off(selectEvent.value)
|
|
219
|
+
// 注意:不要在这里 uni.$off(selectEvent.value),
|
|
220
|
+
// 因为 selectEvent 是 user-choose 组件注册的监听器,用于接收选择结果。
|
|
221
|
+
// 如果在 select-list 卸载时 off 掉,会导致 user-choose 的监听被错误移除,
|
|
222
|
+
// 第二次进入选择页后确认就无法触发回调了。
|
|
223
|
+
// user-choose 会在自己的 onUnmounted 中清理。
|
|
219
224
|
})
|
|
220
225
|
|
|
221
226
|
function submitSearch(data: any) {
|
|
@@ -251,7 +256,7 @@ onUnmounted(() => {
|
|
|
251
256
|
<slot name="top" />
|
|
252
257
|
</template>
|
|
253
258
|
|
|
254
|
-
<
|
|
259
|
+
<foldCard
|
|
255
260
|
v-for="(item, index) in datas"
|
|
256
261
|
:key="item.code"
|
|
257
262
|
:index="index"
|
|
@@ -286,7 +291,7 @@ onUnmounted(() => {
|
|
|
286
291
|
<!-- <template #buttons>
|
|
287
292
|
<CardBotomButtons :data="item" :groups="config" :source-id="sourceId" :item="config" :code="item.code" />
|
|
288
293
|
</template> -->
|
|
289
|
-
</
|
|
294
|
+
</foldCard>
|
|
290
295
|
|
|
291
296
|
<template #bottom>
|
|
292
297
|
<slot name="bottom">
|