wui-components-v2 1.1.86 → 1.1.88
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.
|
@@ -27,7 +27,9 @@ const { currentThemeColor } = useManualTheme()
|
|
|
27
27
|
// 展示内容
|
|
28
28
|
const exhibitData = computed(() => {
|
|
29
29
|
const { collapseNum } = props
|
|
30
|
-
|
|
30
|
+
// collapseNum 为 0 时,只显示标题,不展示任何字段数据
|
|
31
|
+
if (collapseNum === 0) return []
|
|
32
|
+
const num = collapseNum || 5
|
|
31
33
|
const columns = props.columns.length >= num ? props.columns.slice(0, num) : props.columns
|
|
32
34
|
return columns.filter(item => item.title !== '操作')
|
|
33
35
|
})
|
|
@@ -35,7 +37,9 @@ const exhibitData = computed(() => {
|
|
|
35
37
|
// 是否展示折叠按钮
|
|
36
38
|
const showCollapse = computed(() => {
|
|
37
39
|
const { collapseNum } = props
|
|
38
|
-
|
|
40
|
+
// collapseNum 为 0 时,默认收起全部字段,仍可点击展开
|
|
41
|
+
if (collapseNum === 0) return true
|
|
42
|
+
const num = collapseNum || 5
|
|
39
43
|
return props.columns.length > num
|
|
40
44
|
})
|
|
41
45
|
|
|
@@ -58,8 +62,14 @@ function toggleCollapse(contentId: string) {
|
|
|
58
62
|
console.log(contentId)
|
|
59
63
|
if (collapseIcon.value === 'arrow-down') {
|
|
60
64
|
const { collapseNum } = props
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
let columns: Columns[]
|
|
66
|
+
if (collapseNum === 0) {
|
|
67
|
+
// 默认不展示任何字段,展开时显示全部
|
|
68
|
+
columns = props.columns
|
|
69
|
+
} else {
|
|
70
|
+
const num = collapseNum || 5
|
|
71
|
+
columns = props.columns.length >= num ? props.columns.slice(num) : []
|
|
72
|
+
}
|
|
63
73
|
collapseData.value = columns.filter(item => item.title !== '操作')
|
|
64
74
|
// 展开
|
|
65
75
|
// content.classList.remove('max-h-0')
|
|
@@ -17,6 +17,11 @@ defineOptions({
|
|
|
17
17
|
})
|
|
18
18
|
defineProps<{
|
|
19
19
|
detailButtonHandle?: (data: Entities) => void
|
|
20
|
+
/**
|
|
21
|
+
* 折叠前展示的数据条数,透传给 foldCard。
|
|
22
|
+
* 不传时默认 2;传 0 表示只显示标题、不展示任何字段数据。
|
|
23
|
+
*/
|
|
24
|
+
collapseNum?: number
|
|
20
25
|
}>()
|
|
21
26
|
|
|
22
27
|
const Zpaging = ref<any>(null)
|
|
@@ -246,7 +251,7 @@ function tabSearchClick(data: any) {
|
|
|
246
251
|
:key="item.code"
|
|
247
252
|
:index="index"
|
|
248
253
|
:enum-column="enumColumn"
|
|
249
|
-
:collapse-num="
|
|
254
|
+
:collapse-num="collapseNum"
|
|
250
255
|
:source-id="sourceId"
|
|
251
256
|
:groups="config"
|
|
252
257
|
:data="item"
|
|
@@ -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 />
|