wui-components-v2 1.1.92 → 1.1.94
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/components/card-botom-buttons/card-botom-buttons.vue +31 -47
- package/components/fold-card2/fold-card2.vue +204 -0
- package/components/form-control/form-control.vue +27 -1
- package/components/wui-details-page/wui-details-page.vue +3 -3
- package/components/wui-edit-page/wui-edit-page-copy.vue +3 -3
- package/components/wui-edit-page/wui-edit-page.vue +3 -3
- package/components/wui-list/wui-list.vue +6 -3
- package/components/wui-select-list/wui-select-list.vue +3 -3
- package/package.json +1 -1
|
@@ -30,6 +30,11 @@ const props = defineProps<{
|
|
|
30
30
|
detailButtonHandle?: (data: Entities) => void
|
|
31
31
|
buttonDeleteAction?: { [key: string]: any }
|
|
32
32
|
buttonEditAction?: { [key: string]: any }
|
|
33
|
+
/**
|
|
34
|
+
* 是否显示操作按钮区域(morebutns / 编辑 / 删除)。
|
|
35
|
+
* 不传或为 true 时显示;传 false 时整段隐藏。
|
|
36
|
+
*/
|
|
37
|
+
isShowAction?: boolean
|
|
33
38
|
}>()
|
|
34
39
|
const toast = useGlobalToast()
|
|
35
40
|
const message = useGlobalMessage()
|
|
@@ -43,20 +48,20 @@ const router = useRouter()
|
|
|
43
48
|
// rowActions按钮
|
|
44
49
|
const anctions = computed(() => {
|
|
45
50
|
const rowActions = props.rowActions || []
|
|
46
|
-
console.log([...rowActions.filter(
|
|
47
|
-
return [...rowActions.filter(
|
|
51
|
+
console.log([...rowActions.filter(isActionVisible)], 1111111111111111)
|
|
52
|
+
return [...rowActions.filter(isActionVisible)]
|
|
48
53
|
})
|
|
49
54
|
|
|
50
55
|
// raction按钮
|
|
51
56
|
const ractions = computed(() => {
|
|
52
57
|
const list = props.ractions || []
|
|
53
|
-
return list.filter(
|
|
58
|
+
return list.filter(isActionVisible)
|
|
54
59
|
})
|
|
55
60
|
|
|
56
61
|
// actions按钮
|
|
57
62
|
const actions = computed(() => {
|
|
58
63
|
const actions = props.actions || []
|
|
59
|
-
return [...actions.filter(
|
|
64
|
+
return [...actions.filter(isActionVisible)]
|
|
60
65
|
})
|
|
61
66
|
|
|
62
67
|
// 跳转编辑页面
|
|
@@ -77,7 +82,6 @@ function edit() {
|
|
|
77
82
|
|
|
78
83
|
const actionItem = ref<Groups>()
|
|
79
84
|
const actionItemShow = ref(false) // rowActions输入弹框开关
|
|
80
|
-
const showMoreButn = ref(false) // 更多按钮开关
|
|
81
85
|
// 打开rowActions弹框
|
|
82
86
|
async function action(subitem: rowActions) {
|
|
83
87
|
console.log(subitem, 2222222222222222)
|
|
@@ -116,7 +120,7 @@ function detail() {
|
|
|
116
120
|
}
|
|
117
121
|
|
|
118
122
|
// 判断按钮是否满足条件显示
|
|
119
|
-
function
|
|
123
|
+
function isActionVisible(item?: { preposes?: Fields[] }) {
|
|
120
124
|
if (item?.preposes?.length) {
|
|
121
125
|
return item.preposes.every((prepose: Fields) => {
|
|
122
126
|
// 判断字段值是否满足要求
|
|
@@ -196,12 +200,7 @@ const morebutns = computed(() => {
|
|
|
196
200
|
return buts
|
|
197
201
|
})
|
|
198
202
|
|
|
199
|
-
//
|
|
200
|
-
function closeMoreButn() {
|
|
201
|
-
showMoreButn.value = false
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// 点击更多按钮
|
|
203
|
+
// 点击操作按钮
|
|
205
204
|
async function select({ item }: { item: any }) {
|
|
206
205
|
// 复制操作:跳转新增页,仅复制基本信息(fieldMap),不带原 ID 和 relation 分组数据(如快递运单)
|
|
207
206
|
if (item.title.includes('复制')) {
|
|
@@ -246,7 +245,7 @@ console.log(props, '3333333333333')
|
|
|
246
245
|
</script>
|
|
247
246
|
|
|
248
247
|
<template>
|
|
249
|
-
<view class="flex items-center gap-1">
|
|
248
|
+
<view class="flex items-center gap-1 flex-wrap justify-end">
|
|
250
249
|
<!-- <view v-if="props.rowActions" class="flex gap-1">
|
|
251
250
|
<wd-button v-for="subitem in anctions" :key="subitem.id" plain size="small" @click="action(subitem)">
|
|
252
251
|
{{ subitem.title }}
|
|
@@ -257,39 +256,26 @@ console.log(props, '3333333333333')
|
|
|
257
256
|
{{ subitem.title }}
|
|
258
257
|
</wd-button>
|
|
259
258
|
</view> -->
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
plain
|
|
278
|
-
size="small"
|
|
279
|
-
@click="
|
|
280
|
-
() => {
|
|
281
|
-
select({ item: subitem })
|
|
282
|
-
}
|
|
283
|
-
"
|
|
284
|
-
>
|
|
285
|
-
{{ subitem.title }}
|
|
286
|
-
</wd-button>
|
|
287
|
-
</template>
|
|
288
|
-
</view>
|
|
289
|
-
</view>
|
|
259
|
+
|
|
260
|
+
<template v-if="isShowAction !== false">
|
|
261
|
+
<template v-for="subitem in morebutns" :key="subitem.id">
|
|
262
|
+
<wd-button
|
|
263
|
+
v-if="isActionVisible(subitem)"
|
|
264
|
+
plain
|
|
265
|
+
size="small"
|
|
266
|
+
@click="
|
|
267
|
+
() => {
|
|
268
|
+
select({ item: subitem })
|
|
269
|
+
}
|
|
270
|
+
"
|
|
271
|
+
>
|
|
272
|
+
{{ subitem.title }}
|
|
273
|
+
</wd-button>
|
|
274
|
+
</template>
|
|
275
|
+
</template>
|
|
290
276
|
|
|
291
277
|
<wd-button
|
|
292
|
-
v-if="props.item.buttons.includes('dtmplEdit') &&
|
|
278
|
+
v-if="isShowAction !== false && props.item.buttons.includes('dtmplEdit') && isActionVisible(props.buttonEditAction)"
|
|
293
279
|
size="small"
|
|
294
280
|
@click="edit()"
|
|
295
281
|
>
|
|
@@ -297,7 +283,7 @@ console.log(props, '3333333333333')
|
|
|
297
283
|
</wd-button>
|
|
298
284
|
<wd-button v-if="props.item.buttons.includes('detail')" size="small" type="info" @click="detail()">详情</wd-button>
|
|
299
285
|
<wd-button
|
|
300
|
-
v-if="props.item.buttons.includes('singleDelete') &&
|
|
286
|
+
v-if="isShowAction !== false && props.item.buttons.includes('singleDelete') && isActionVisible(props.buttonDeleteAction)"
|
|
301
287
|
size="small"
|
|
302
288
|
type="danger"
|
|
303
289
|
@click="del()"
|
|
@@ -311,7 +297,5 @@ console.log(props, '3333333333333')
|
|
|
311
297
|
:field-group="actionItem"
|
|
312
298
|
:code="props.code"
|
|
313
299
|
/>
|
|
314
|
-
<!-- 更多按钮 -->
|
|
315
|
-
<wd-action-sheet v-model="showMoreButn" :actions="morebutns" @close="closeMoreButn" @select="select" />
|
|
316
300
|
</view>
|
|
317
301
|
</template>
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed, defineEmits, defineOptions, defineProps, ref } from 'vue'
|
|
3
|
+
import type { Columns, Entities, Enums, FoldCardModel, Groups } from '../../type'
|
|
4
|
+
import { formatItemData } from '../../utils'
|
|
5
|
+
import LabelValue from '../label-value/label-value.vue'
|
|
6
|
+
import { useManualTheme } from '../../composables/useManualTheme'
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
9
|
+
name: 'FoldCard2',
|
|
10
|
+
// ★ 关闭属性透传,避免 H5 下根节点原生 onClick 与下面显式 emit('click') 重复触发
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
// ★ 显式 emit click,保证微信小程序下 @click 能正常触发(小程序自定义组件不会自动透传原生 tap)
|
|
15
|
+
const emit = defineEmits<{
|
|
16
|
+
(e: 'click'): void
|
|
17
|
+
}>()
|
|
18
|
+
|
|
19
|
+
const props = defineProps<{
|
|
20
|
+
columns: Columns[]
|
|
21
|
+
collapseNum?: number
|
|
22
|
+
primaryColumn?: Columns
|
|
23
|
+
secondColumn?: Columns
|
|
24
|
+
labelColumn?: Columns
|
|
25
|
+
data: Entities
|
|
26
|
+
model: FoldCardModel
|
|
27
|
+
sourceId: string
|
|
28
|
+
groups: Groups
|
|
29
|
+
enumColumn?: Enums
|
|
30
|
+
index: number
|
|
31
|
+
}>()
|
|
32
|
+
const { currentThemeColor } = useManualTheme()
|
|
33
|
+
// 展示内容
|
|
34
|
+
const exhibitData = computed(() => {
|
|
35
|
+
const { collapseNum } = props
|
|
36
|
+
// collapseNum 为 0 时,只显示标题,不展示任何字段数据
|
|
37
|
+
if (collapseNum === 0) return []
|
|
38
|
+
const num = collapseNum || 5
|
|
39
|
+
const columns = props.columns.length >= num ? props.columns.slice(0, num) : props.columns
|
|
40
|
+
return columns.filter(item => item.title !== '操作')
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
// 是否展示折叠按钮
|
|
44
|
+
const showCollapse = computed(() => {
|
|
45
|
+
const { collapseNum } = props
|
|
46
|
+
// collapseNum 为 0 时,默认收起全部字段,仍可点击展开
|
|
47
|
+
if (collapseNum === 0) return true
|
|
48
|
+
const num = collapseNum || 5
|
|
49
|
+
return props.columns.length > num
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
// 折叠内容
|
|
53
|
+
const collapseData = ref<Columns[]>([])
|
|
54
|
+
// 是否展开(用于驱动动画)
|
|
55
|
+
const expanded = ref(false)
|
|
56
|
+
|
|
57
|
+
// 标签字段
|
|
58
|
+
const labelColumns = computed(() => {
|
|
59
|
+
if (props.labelColumn && props.enumColumn) {
|
|
60
|
+
return props.enumColumn[props.labelColumn.mstrucId]
|
|
61
|
+
} else {
|
|
62
|
+
return []
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
// 折叠图标:未展开为 left,展开为 down
|
|
67
|
+
const collapseIcon = ref('left')
|
|
68
|
+
|
|
69
|
+
// 计算需要折叠展示的字段
|
|
70
|
+
function getCollapseColumns(): Columns[] {
|
|
71
|
+
const { collapseNum } = props
|
|
72
|
+
let columns: Columns[]
|
|
73
|
+
if (collapseNum === 0) {
|
|
74
|
+
// 默认不展示任何字段,展开时显示全部
|
|
75
|
+
columns = props.columns
|
|
76
|
+
} else {
|
|
77
|
+
const num = collapseNum || 5
|
|
78
|
+
columns = props.columns.length >= num ? props.columns.slice(num) : []
|
|
79
|
+
}
|
|
80
|
+
return columns.filter(item => item.title !== '操作')
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 切换折叠内容
|
|
84
|
+
function toggleCollapse(contentId: string) {
|
|
85
|
+
console.log(contentId)
|
|
86
|
+
if (!expanded.value) {
|
|
87
|
+
collapseData.value = getCollapseColumns()
|
|
88
|
+
expanded.value = true
|
|
89
|
+
collapseIcon.value = 'down'
|
|
90
|
+
} else {
|
|
91
|
+
expanded.value = false
|
|
92
|
+
collapseIcon.value = 'left'
|
|
93
|
+
// 等收起动画结束后再清空内容,保证退出动画可见
|
|
94
|
+
setTimeout(() => {
|
|
95
|
+
if (!expanded.value) collapseData.value = []
|
|
96
|
+
}, 300)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<template>
|
|
102
|
+
<!-- 订单卡片容器 -->
|
|
103
|
+
<view class="mx-auto max-w-md space-y-4">
|
|
104
|
+
<!-- 订单卡片2 -->
|
|
105
|
+
<view class="ma-2 overflow-hidden rounded-xl bg-white shadow-sm dark:bg-[var(--wot-dark-background2)]" @click="emit('click')">
|
|
106
|
+
<!-- 订单头部 -->
|
|
107
|
+
<view v-if="props.primaryColumn" class="flex items-center justify-between border-b border-gray-100 p-4">
|
|
108
|
+
<view class="flex min-w-0 flex-1 items-center gap-4 text-base text-gray-800 font-medium dark:text-white">
|
|
109
|
+
<view class="flex items-center gap-1">
|
|
110
|
+
<slot name="select" />
|
|
111
|
+
<view class="mr-1 h-4 w-1 rounded-2xl" :style="{ backgroundColor: currentThemeColor.primary }" />
|
|
112
|
+
</view>
|
|
113
|
+
<view class="min-w-0 flex-1">
|
|
114
|
+
<view class="flex min-w-0 flex-1 items-center gap-2">
|
|
115
|
+
<view class="min-w-0 flex-1 truncate font-700">
|
|
116
|
+
{{
|
|
117
|
+
formatItemData(
|
|
118
|
+
data.fieldMap[props.primaryColumn.sourceId],
|
|
119
|
+
props.primaryColumn.extControlType || props.primaryColumn.controlType
|
|
120
|
+
)
|
|
121
|
+
}}
|
|
122
|
+
</view>
|
|
123
|
+
<!-- 折叠按钮 -->
|
|
124
|
+
<wd-icon
|
|
125
|
+
v-if="showCollapse"
|
|
126
|
+
id="toggle-btn-2"
|
|
127
|
+
:name="collapseIcon"
|
|
128
|
+
size="24px"
|
|
129
|
+
class="ml-1 flex items-center text-sm text-[#6b7280]"
|
|
130
|
+
@click.stop="toggleCollapse(data.code)"
|
|
131
|
+
/>
|
|
132
|
+
<!-- <slot name="addressInfo" />s -->
|
|
133
|
+
</view>
|
|
134
|
+
<!-- <slot name="detailAddress" /> -->
|
|
135
|
+
</view>
|
|
136
|
+
</view>
|
|
137
|
+
<view
|
|
138
|
+
v-if="props.labelColumn"
|
|
139
|
+
class="whitespace-nowrap rounded px-1 py-1 text-sm text-white font-700"
|
|
140
|
+
:style="{
|
|
141
|
+
color: labelColumns?.find(
|
|
142
|
+
item => props.labelColumn && item.value === data.fieldMap[props.labelColumn.sourceId]
|
|
143
|
+
)?.css?.color,
|
|
144
|
+
}"
|
|
145
|
+
>
|
|
146
|
+
{{
|
|
147
|
+
formatItemData(
|
|
148
|
+
data.fieldMap[props.labelColumn.sourceId],
|
|
149
|
+
props.labelColumn.extControlType || props.labelColumn.controlType
|
|
150
|
+
)
|
|
151
|
+
}}
|
|
152
|
+
</view>
|
|
153
|
+
</view>
|
|
154
|
+
|
|
155
|
+
<!-- 订单内容 -->
|
|
156
|
+
<view v-if="props.model === 'complex'" class="p-4 pt-0">
|
|
157
|
+
<!-- 商品列表 -->
|
|
158
|
+
<view class="mb-3">
|
|
159
|
+
<!-- 订单信息 -->
|
|
160
|
+
<view class="text-sm space-y-3">
|
|
161
|
+
<LabelValue :exhibit-data="exhibitData" :data="data" :index="index" />
|
|
162
|
+
|
|
163
|
+
<!-- 可折叠内容 -->
|
|
164
|
+
<view class="fold-collapse" :class="expanded ? 'is-expanded' : 'is-collapsed'">
|
|
165
|
+
<view class="space-y-3">
|
|
166
|
+
<LabelValue :exhibit-data="collapseData" :data="data" :index="index" />
|
|
167
|
+
</view>
|
|
168
|
+
</view>
|
|
169
|
+
</view>
|
|
170
|
+
</view>
|
|
171
|
+
|
|
172
|
+
<!-- 订单底部 -->
|
|
173
|
+
<view class="flex items-center justify-end border-t border-gray-100">
|
|
174
|
+
<view class="flex items-center gap-1">
|
|
175
|
+
<slot name="buttons" />
|
|
176
|
+
</view>
|
|
177
|
+
</view>
|
|
178
|
+
</view>
|
|
179
|
+
</view>
|
|
180
|
+
</view>
|
|
181
|
+
</template>
|
|
182
|
+
|
|
183
|
+
<style>
|
|
184
|
+
.fold-collapse {
|
|
185
|
+
display: grid;
|
|
186
|
+
grid-template-rows: 0fr;
|
|
187
|
+
opacity: 0;
|
|
188
|
+
transition: grid-template-rows 0.3s ease, opacity 0.25s ease;
|
|
189
|
+
}
|
|
190
|
+
.fold-collapse > view {
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
min-height: 0;
|
|
193
|
+
}
|
|
194
|
+
.fold-collapse.is-expanded {
|
|
195
|
+
grid-template-rows: 1fr;
|
|
196
|
+
opacity: 1;
|
|
197
|
+
}
|
|
198
|
+
:deep(.wd-collapse-item__body) {
|
|
199
|
+
background-color: #f9f9f9 !important;
|
|
200
|
+
}
|
|
201
|
+
:deep(.wot-theme-dark .wd-collapse-item__body) {
|
|
202
|
+
background-color: #1b1b1e !important;
|
|
203
|
+
}
|
|
204
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, ref, toRaw, watch } from 'vue'
|
|
2
|
+
import { computed, onMounted, nextTick, ref, toRaw, watch } from 'vue'
|
|
3
3
|
import type { FormSchema, FormSchemaIssue } from '@wot-ui/ui/components/wd-form/types'
|
|
4
4
|
import dayjs from 'dayjs/esm/index'
|
|
5
5
|
import type { Enums, Fields, Groups } from '../../type'
|
|
@@ -126,6 +126,14 @@ function initFormData() {
|
|
|
126
126
|
return (models[item.sourceId] = val !== undefined && val !== null && val !== '' ? Number(val) : 0)
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
// 开关:归一化为 "是"/"否" 字符串,避免 wd-switch 在 onBeforeMount 校验时
|
|
130
|
+
// 因 modelValue 非 active/inactive 值(如 ''、布尔、数字)被强制重置为未选中
|
|
131
|
+
if (ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'yes-no-switch') {
|
|
132
|
+
const def = (props.entity && props.entity[item.sourceId]) ?? item.transDefaultValue
|
|
133
|
+
const isYes = def === '是' || def === true || def === 1 || def === 'true' || def === '1'
|
|
134
|
+
return (models[item.sourceId] = isYes ? '是' : '否')
|
|
135
|
+
}
|
|
136
|
+
|
|
129
137
|
return (models[item.sourceId] = (props.entity && props.entity[item.sourceId]) || item.transDefaultValue || '')
|
|
130
138
|
})
|
|
131
139
|
|
|
@@ -427,6 +435,24 @@ hydrocarbonProgramToken.value = uni.getStorageSync('HYDROCARBON_PROGRAM_TOKEN')
|
|
|
427
435
|
token.value = uni.getStorageSync('TOKEN')
|
|
428
436
|
initFormData()
|
|
429
437
|
initialModel.value = JSON.parse(JSON.stringify(model.value))
|
|
438
|
+
|
|
439
|
+
// 小程序端 setData 异步:wd-switch 在 popup 内延迟挂载时,onBeforeMount 可能读到
|
|
440
|
+
// 初始(未同步)的 modelValue,被组件校正逻辑强制重置为 inactiveValue("否")。
|
|
441
|
+
// 挂载完成后再兜底恢复一次正确的默认值,确保默认选中生效。
|
|
442
|
+
onMounted(() => {
|
|
443
|
+
nextTick(() => {
|
|
444
|
+
fields.value.forEach((item: any) => {
|
|
445
|
+
if (ControlTypeSupportor.getControlType(item) === 'yes-no-switch') {
|
|
446
|
+
const def = (props.entity && props.entity[item.sourceId]) ?? item.transDefaultValue
|
|
447
|
+
const isYes = def === '是' || def === true || def === 1 || def === 'true' || def === '1'
|
|
448
|
+
const expected = isYes ? '是' : '否'
|
|
449
|
+
if (model.value[item.sourceId] !== expected) {
|
|
450
|
+
model.value[item.sourceId] = expected
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
})
|
|
454
|
+
})
|
|
455
|
+
})
|
|
430
456
|
function formatSelectColumns(columns: any) {
|
|
431
457
|
return columns.map((item: any) => {
|
|
432
458
|
return {
|
|
@@ -4,7 +4,7 @@ import { onLoad } from '@dcloudio/uni-app'
|
|
|
4
4
|
import { detailPageConfig, detailPageData } from '../../api/page'
|
|
5
5
|
import type { Entities, Groups, dtmplConfig } from '../../type'
|
|
6
6
|
import CardBotomButtons from '../card-botom-buttons/card-botom-buttons.vue'
|
|
7
|
-
import
|
|
7
|
+
import foldCard2 from '../fold-card2/fold-card2.vue'
|
|
8
8
|
import LabelValue from '../label-value/label-value.vue'
|
|
9
9
|
|
|
10
10
|
defineOptions({
|
|
@@ -132,11 +132,11 @@ async function getDetailData() {
|
|
|
132
132
|
</view>
|
|
133
133
|
<view v-if="group.type === 'relation'">
|
|
134
134
|
<view v-for="(field, subindex) in data.arrayMap[group.id]" :key="field.code">
|
|
135
|
-
<
|
|
135
|
+
<foldCard2 :index="subindex" :enum-column="{}" :groups="group" :source-id="sourceId" :columns="group.fields" model="complex" :data="field">
|
|
136
136
|
<template #buttons>
|
|
137
137
|
<CardBotomButtons :primary-column="group.primaryColumn || { controlType: '', extControlType: '', sourceId: '', mstrucId: '' }" :source-id="group.id" :item="groups" :code="field.code" :data="data" />
|
|
138
138
|
</template>
|
|
139
|
-
</
|
|
139
|
+
</foldCard2>
|
|
140
140
|
</view>
|
|
141
141
|
</view>
|
|
142
142
|
</wd-collapse-item>
|
|
@@ -7,7 +7,7 @@ import FormControl from '../form-control/form-control.vue'
|
|
|
7
7
|
import { addPageConfig, editPageConfig, editPageDataSave, enums, selectDatas } from '../../api/page'
|
|
8
8
|
import type { Entities, Enums, Groups, dtmplConfig } from '../../type'
|
|
9
9
|
import { useGlobalToast } from '../../composables/useGlobalToast'
|
|
10
|
-
import
|
|
10
|
+
import foldCard2 from '../fold-card2/fold-card2.vue'
|
|
11
11
|
import { generateHighResolutionID } from '../../utils/index'
|
|
12
12
|
import TreeSelectControl from '../tree-select/index.vue'
|
|
13
13
|
import batchUploadFile from '../batch-upload-file/batch-upload-file.vue'
|
|
@@ -720,7 +720,7 @@ function handleFileChange(e: any, group: Groups) {
|
|
|
720
720
|
</wd-button>
|
|
721
721
|
</view>
|
|
722
722
|
<view v-for="(field, index) in pageConfig?.entity?.arrayMap[group.id]" :key="field.code">
|
|
723
|
-
<
|
|
723
|
+
<foldCard2
|
|
724
724
|
:index="index" :enum-column="{}" :groups="group" :source-id="sourceId" :columns="group.fields"
|
|
725
725
|
model="complex" :data="field"
|
|
726
726
|
>
|
|
@@ -738,7 +738,7 @@ function handleFileChange(e: any, group: Groups) {
|
|
|
738
738
|
删除
|
|
739
739
|
</wd-button>
|
|
740
740
|
</template>
|
|
741
|
-
</
|
|
741
|
+
</foldCard2>
|
|
742
742
|
</view>
|
|
743
743
|
</view>
|
|
744
744
|
</view>
|
|
@@ -7,7 +7,7 @@ import { addPageConfig, editPageConfig, editPageDataSave, enums, selectDatas, ac
|
|
|
7
7
|
import type { Entities, Enums, Groups, dtmplConfig, rowActions, Fields } from '../../type'
|
|
8
8
|
import { useGlobalToast } from '../../composables/useGlobalToast'
|
|
9
9
|
import { useGlobalMessage } from '../../composables/useGlobalMessage'
|
|
10
|
-
import
|
|
10
|
+
import foldCard2 from '../fold-card2/fold-card2.vue'
|
|
11
11
|
import ActionPopup from '../action-popup/action-popup.vue'
|
|
12
12
|
import { generateHighResolutionID, comparator } from '../../utils/index'
|
|
13
13
|
import TreeSelectControl from '../tree-select/index.vue'
|
|
@@ -937,7 +937,7 @@ console.log(pageConfig, 'props111')
|
|
|
937
937
|
</view>
|
|
938
938
|
<view v-else>
|
|
939
939
|
<view v-for="(field, index) in pageConfig?.entity?.arrayMap[group.id]" :key="field.code">
|
|
940
|
-
<
|
|
940
|
+
<foldCard2
|
|
941
941
|
:index="index"
|
|
942
942
|
:enum-column="{}"
|
|
943
943
|
:groups="group"
|
|
@@ -962,7 +962,7 @@ console.log(pageConfig, 'props111')
|
|
|
962
962
|
删除
|
|
963
963
|
</wd-button>
|
|
964
964
|
</template>
|
|
965
|
-
</
|
|
965
|
+
</foldCard2>
|
|
966
966
|
</view>
|
|
967
967
|
</view>
|
|
968
968
|
</view>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { defineOptions, defineProps, onMounted, onUnmounted, ref } from 'vue'
|
|
3
3
|
import { onLoad } from '@dcloudio/uni-app'
|
|
4
4
|
import { listData, pageConfig, pageKey } from '../../api/page'
|
|
5
|
-
import
|
|
5
|
+
import foldCard2 from '../fold-card2/fold-card2.vue'
|
|
6
6
|
import type { Config, Entities } from '../../type'
|
|
7
7
|
import Search from '../search/search.vue'
|
|
8
8
|
import ListTopButtons from '../list-top-buttons/list-top-buttons.vue'
|
|
@@ -16,6 +16,7 @@ defineOptions({
|
|
|
16
16
|
name: 'WuiList',
|
|
17
17
|
})
|
|
18
18
|
defineProps<{
|
|
19
|
+
isShowAction?: boolean
|
|
19
20
|
detailButtonHandle?: (data: Entities) => void
|
|
20
21
|
/**
|
|
21
22
|
* 折叠前展示的数据条数,透传给 foldCard。
|
|
@@ -241,12 +242,13 @@ function tabSearchClick(data: any) {
|
|
|
241
242
|
:code="item.code"
|
|
242
243
|
:page-type="pageType"
|
|
243
244
|
:data="item"
|
|
245
|
+
:is-show-action="isShowAction"
|
|
244
246
|
/>
|
|
245
247
|
</template>
|
|
246
248
|
</productCard>
|
|
247
249
|
</view>
|
|
248
250
|
<view v-else>
|
|
249
|
-
<
|
|
251
|
+
<foldCard2
|
|
250
252
|
v-for="(item, index) in datas"
|
|
251
253
|
:key="item.code"
|
|
252
254
|
:index="index"
|
|
@@ -279,9 +281,10 @@ function tabSearchClick(data: any) {
|
|
|
279
281
|
:data="item"
|
|
280
282
|
:button-delete-action="config.buttonDeleteAction"
|
|
281
283
|
:button-edit-action="config.buttonEditAction"
|
|
284
|
+
:is-show-action="isShowAction"
|
|
282
285
|
/>
|
|
283
286
|
</template>
|
|
284
|
-
</
|
|
287
|
+
</foldCard2>
|
|
285
288
|
</view>
|
|
286
289
|
|
|
287
290
|
<template #bottom>
|
|
@@ -3,7 +3,7 @@ import { computed, onMounted, onUnmounted, ref } from 'vue'
|
|
|
3
3
|
import { onLoad } from '@dcloudio/uni-app'
|
|
4
4
|
import { useRouter } from 'uni-mini-router'
|
|
5
5
|
import { enums, listData, pageConfig, pageKey } from '../../api/page'
|
|
6
|
-
import
|
|
6
|
+
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'
|
|
@@ -251,7 +251,7 @@ onUnmounted(() => {
|
|
|
251
251
|
<slot name="top" />
|
|
252
252
|
</template>
|
|
253
253
|
|
|
254
|
-
<
|
|
254
|
+
<foldCard2
|
|
255
255
|
v-for="(item, index) in datas"
|
|
256
256
|
:key="item.code"
|
|
257
257
|
:index="index"
|
|
@@ -286,7 +286,7 @@ onUnmounted(() => {
|
|
|
286
286
|
<!-- <template #buttons>
|
|
287
287
|
<CardBotomButtons :data="item" :groups="config" :source-id="sourceId" :item="config" :code="item.code" />
|
|
288
288
|
</template> -->
|
|
289
|
-
</
|
|
289
|
+
</foldCard2>
|
|
290
290
|
|
|
291
291
|
<template #bottom>
|
|
292
292
|
<slot name="bottom">
|