wui-components-v2 1.2.78 → 1.2.79
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.
|
@@ -67,7 +67,8 @@ const exhibitData = computed(() => {
|
|
|
67
67
|
if (collapseNum === 0) return []
|
|
68
68
|
const num = collapseNum || 5
|
|
69
69
|
const columns = props.columns.length >= num ? props.columns.slice(0, num) : props.columns
|
|
70
|
-
|
|
70
|
+
// 配置层 hidden:true 的字段不在卡片中展示(与表单区显隐语义保持一致)
|
|
71
|
+
return columns.filter((item: any) => item.title !== '操作' && item.hidden !== true)
|
|
71
72
|
})
|
|
72
73
|
|
|
73
74
|
// 是否展示折叠按钮
|
|
@@ -121,7 +122,7 @@ function getCollapseColumns(): Columns[] {
|
|
|
121
122
|
const num = collapseNum || 5
|
|
122
123
|
columns = props.columns.length >= num ? props.columns.slice(num) : []
|
|
123
124
|
}
|
|
124
|
-
return columns.filter(item => item.title !== '操作')
|
|
125
|
+
return columns.filter((item: any) => item.title !== '操作' && item.hidden !== true)
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
// 切换折叠内容
|
|
@@ -547,6 +547,8 @@ const schema = computed((): FormSchema => {
|
|
|
547
547
|
validate(_model: Record<string, any>): FormSchemaIssue[] {
|
|
548
548
|
const issues: FormSchemaIssue[] = []
|
|
549
549
|
props.fieldGroup?.fields.forEach((item: Fields) => {
|
|
550
|
+
// 配置层 hidden:true 的字段表单不渲染,跳过校验,避免出现无法修改的必填报错
|
|
551
|
+
if (item.hidden === true) return
|
|
550
552
|
const value = _model[item.sourceId]
|
|
551
553
|
// 必填校验
|
|
552
554
|
if (item.required) {
|
|
@@ -39,7 +39,8 @@ const props = withDefaults(
|
|
|
39
39
|
)
|
|
40
40
|
const { primary } = useManualTheme()
|
|
41
41
|
const clums = computed(() => {
|
|
42
|
-
|
|
42
|
+
// hidden:true 的字段不展示(与表单区显隐语义保持一致)
|
|
43
|
+
return props.exhibitData.filter((item: any) => !item.title?.includes('y') && item.hidden !== true)
|
|
43
44
|
})
|
|
44
45
|
|
|
45
46
|
const videoPlayRef = ref()
|
|
@@ -77,11 +77,14 @@ export function useCompanyFieldFilter(
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
// 计算字段是否隐藏:依据 usableRuleCriteria 关联其它字段实时值
|
|
80
|
+
// - 配置层显式 hidden:true:始终隐藏(优先级最高)
|
|
80
81
|
// - 无可用规则:保持字段自身 unusableMode 决定的显隐
|
|
81
82
|
// - 有可用规则:
|
|
82
83
|
// 1) 任一依赖字段无数据 -> 隐藏该项
|
|
83
84
|
// 2) 依赖均有数据后,所有规则命中才显示,否则隐藏
|
|
84
85
|
const computeHidden = (item: any, fieldsMap: Map<string, any>, modelValue: any, isEnabled: boolean) => {
|
|
86
|
+
// 后端配置显式指定 hidden:true 的字段始终隐藏,不能被后续规则计算结果覆盖
|
|
87
|
+
if (item?.hidden === true) return true
|
|
85
88
|
const baseHidden = item?.unusableMode === 'hidden'
|
|
86
89
|
if (!isEnabled) return baseHidden
|
|
87
90
|
const criteria = item?.usableRuleCriteria
|