wui-components-v2 1.1.87 → 1.1.89
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.
|
@@ -71,19 +71,27 @@ export default {
|
|
|
71
71
|
:active-color="currentThemeColor.primary"
|
|
72
72
|
@change="handleTabbarChange"
|
|
73
73
|
>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
</
|
|
86
|
-
|
|
74
|
+
<!-- 有激活/未激活两张图时用图片图标(声明 #icon 插槽) -->
|
|
75
|
+
<template v-for="(item, index) in tabbarList" :key="index">
|
|
76
|
+
<wd-tabbar-item
|
|
77
|
+
v-if="item.activeIcon && item.inactiveIcon"
|
|
78
|
+
:name="item.name"
|
|
79
|
+
:value="getTabbarItemValue(item.name)"
|
|
80
|
+
:title="item.title"
|
|
81
|
+
>
|
|
82
|
+
<template #icon="{ active }">
|
|
83
|
+
<image :src="active ? item.activeIcon : item.inactiveIcon" class="custom-icon" />
|
|
84
|
+
</template>
|
|
85
|
+
</wd-tabbar-item>
|
|
86
|
+
<!-- 反之不声明 #icon 插槽,交给 wd-tabbar-item 内部渲染 wd-icon 字体图标 -->
|
|
87
|
+
<wd-tabbar-item
|
|
88
|
+
v-else
|
|
89
|
+
:name="item.name"
|
|
90
|
+
:value="getTabbarItemValue(item.name)"
|
|
91
|
+
:title="item.title"
|
|
92
|
+
:icon="item.icon"
|
|
93
|
+
/>
|
|
94
|
+
</template>
|
|
87
95
|
</wd-tabbar>
|
|
88
96
|
<!-- #ifdef MP-WEIXIN -->
|
|
89
97
|
<privacy-popup />
|
|
@@ -51,7 +51,11 @@ export function useCompanyFieldFilter(
|
|
|
51
51
|
// 评估单条可用规则(usableRuleCriteria)的就绪/命中状态
|
|
52
52
|
// criterion 通过 mstrucId 关联同一分组内的其它字段,再拿该字段在 model 中的实时值与 transDefaultValue 比对
|
|
53
53
|
// 返回值:'empty'(依赖字段无数据)| 'match'(命中)| 'unmatch'(未命中)
|
|
54
|
-
const evaluateCriterion = (
|
|
54
|
+
const evaluateCriterion = (
|
|
55
|
+
criterion: any,
|
|
56
|
+
fieldsMap: Map<string, any>,
|
|
57
|
+
modelValue: any
|
|
58
|
+
): 'empty' | 'match' | 'unmatch' => {
|
|
55
59
|
const target = criterion?.mstrucId ? fieldsMap.get(criterion.mstrucId) : null
|
|
56
60
|
// 找不到被关联字段时 fail-open,视为命中,避免误隐藏
|
|
57
61
|
if (!target) return 'match'
|
|
@@ -81,7 +85,7 @@ export function useCompanyFieldFilter(
|
|
|
81
85
|
const baseHidden = item?.unusableMode === 'hidden'
|
|
82
86
|
if (!isEnabled) return baseHidden
|
|
83
87
|
const criteria = item?.usableRuleCriteria
|
|
84
|
-
if (!criteria || criteria.length === 0) return
|
|
88
|
+
if (!criteria || criteria.length === 0) return false
|
|
85
89
|
// 任一依赖字段无数据 -> 隐藏
|
|
86
90
|
if (criteria.some((c: any) => evaluateCriterion(c, fieldsMap, modelValue) === 'empty')) return true
|
|
87
91
|
// 依赖就绪后:所有规则命中才显示
|