w-ui-v1 1.1.19 → 1.1.21
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/package.json +1 -1
- package/utils/apis/pageConfig.ts +9 -0
- package/w-card/w-card.vue +494 -483
- package/w-detail/w-detail.vue +2 -0
- package/w-form-control/w-form-control.vue +33 -4
- package/w-menu/w-menu.vue +4 -3
- package/w-report-table/w-report-table.vue +182 -123
- package/w-search/w-search.vue +3 -5
package/w-card/w-card.vue
CHANGED
|
@@ -1,498 +1,509 @@
|
|
|
1
|
-
|
|
2
1
|
<script setup lang="ts">
|
|
3
|
-
import WFormMessageBox from '../w-form-message-box/w-form-message-box.vue'
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from 'vue'
|
|
10
|
-
import { hasY, getValue, downloadFile,getEnumColor } from './utils/utils'
|
|
11
|
-
import { deletePageData } from '../utils/apis/pageConfig'
|
|
12
|
-
import { useMessage, useToast } from 'wot-design-uni'
|
|
13
|
-
import WAudio from '../w-audio/w-audio.vue'
|
|
14
|
-
const emits = defineEmits(['refresh', 'delet', 'edit'])
|
|
15
|
-
const toast = useToast()
|
|
16
|
-
const message = useMessage()
|
|
17
|
-
const props = defineProps({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
})
|
|
60
|
-
console.log(props.enumMap)
|
|
61
|
-
//更多按钮
|
|
62
|
-
const moreBtns = computed(() => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
// 处理单项数据、配置
|
|
97
|
-
const items = computed(() => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
const wFormMessageBoxRef = ref()
|
|
121
|
-
const showMoreButns = ref(false)
|
|
122
|
-
const isExpanded = ref(false)
|
|
123
|
-
const defaultVisible =props.visible|| 4 // 默认显示行数量
|
|
124
|
-
|
|
125
|
-
const visibleItems = computed(() => {
|
|
126
|
-
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
const showMore = computed(() => {
|
|
130
|
-
|
|
131
|
-
})
|
|
132
|
-
|
|
133
|
-
function toggleExpand() {
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// 跳转页页面
|
|
138
|
-
function goto(type: string, item: any = {}, subItem: any = {}) {
|
|
139
|
-
|
|
140
|
-
switch (type) {
|
|
141
|
-
case 'detail':
|
|
142
|
-
uni.navigateTo({
|
|
143
|
-
url: `/pages/detail/detail?sourceId=${props.sourceId}&code=${props.itemData.code}`,
|
|
144
|
-
})
|
|
145
|
-
break
|
|
146
|
-
case 'link':
|
|
147
|
-
let code = subItem.value
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
uni.navigateTo({
|
|
151
|
-
url: `/pages/detail/detail?sourceId=${item.sourceId}&code=${code}`,
|
|
152
|
-
})
|
|
153
|
-
break
|
|
154
|
-
case 'edit':
|
|
155
|
-
|
|
156
|
-
if(props.editButtonConfig.clickAction){
|
|
157
|
-
props.editButtonConfig.clickAction(props.itemData)
|
|
158
|
-
return
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (props.actionType === 'relation') {
|
|
163
|
-
emits('edit')
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
if(props.page.classEditConfigs?.length>0){
|
|
167
|
-
let con= props.page.classEditConfigs[0].preposes.find((item:any)=>{
|
|
168
|
-
return item.defaultValue.includes(props.itemData.fieldMap[item.id])
|
|
169
|
-
})
|
|
170
|
-
if(con){
|
|
171
|
-
uni.navigateTo({
|
|
172
|
-
url: `/pages/edit/edit?sourceId=${props.page.classEditConfigs[0].id}&code=${props.itemData.code}`,
|
|
173
|
-
})
|
|
174
|
-
}else{
|
|
175
|
-
uni.navigateTo({
|
|
176
|
-
url: `/pages/edit/edit?sourceId=${props.sourceId}&code=${props.itemData.code}`,
|
|
177
|
-
})
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
}else{
|
|
181
|
-
uni.navigateTo({
|
|
182
|
-
url: `/pages/edit/edit?sourceId=${props.sourceId}&code=${props.itemData.code}`,
|
|
183
|
-
})
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
break
|
|
187
|
-
case 'openPage':
|
|
188
|
-
uni.navigateTo({
|
|
189
|
-
url: `/pages/table/table?sourceId=${item.id}&pageTitle=${item.title}&mainCode=${props.itemData.code}`,
|
|
190
|
-
})
|
|
191
|
-
break
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
//删除勾选项
|
|
197
|
-
const delerelation = () => {
|
|
198
|
-
if (props.actionType === 'relation') {
|
|
199
|
-
emits('delet')
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
//删除
|
|
204
|
-
const dele = () => {
|
|
205
|
-
message
|
|
206
|
-
.confirm({
|
|
207
|
-
msg: '确定删除吗?',
|
|
208
|
-
title: '删除'
|
|
209
|
-
})
|
|
210
|
-
.then(() => {
|
|
211
|
-
toast.loading('删除中...')
|
|
212
|
-
deletePageData(props.sourceId, props.itemData.code).then((res: any) => {
|
|
213
|
-
toast.success('删除成功')
|
|
214
|
-
emits('refresh')
|
|
215
|
-
})
|
|
216
|
-
})
|
|
217
|
-
.catch(() => {
|
|
218
|
-
toast.close()
|
|
219
|
-
console.log('点击了取消按钮')
|
|
220
|
-
})
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
//更多按钮点击事件
|
|
225
|
-
const moreBtnsSelect = (item: any) => {
|
|
226
|
-
|
|
227
|
-
switch (item.item.actionType) {
|
|
228
|
-
case 'submit':
|
|
229
|
-
actionBtn(item.item)
|
|
230
|
-
break
|
|
231
|
-
case 'openPage':
|
|
232
|
-
goto(item.item.actionType, item.item)
|
|
233
|
-
break
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// 更多按钮操作
|
|
238
|
-
const actionBtn = (item: any) => {
|
|
239
|
-
wFormMessageBoxRef.value.openFormMessageBox(item)
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
//格式化title
|
|
243
|
-
const getTitleValue = (value: any, title: string) => {
|
|
244
|
-
let data=getValue(value, title)?.content
|
|
245
|
-
if(!data) return ''
|
|
246
|
-
// 是否为数组
|
|
247
|
-
if(Array.isArray(data)){
|
|
248
|
-
return getValue(value, title).content.map((item:any)=>{
|
|
249
|
-
return item.label
|
|
250
|
-
}).join(',')
|
|
251
|
-
}
|
|
252
|
-
//是否为对象
|
|
253
|
-
if(typeof data === 'object'){
|
|
254
|
-
return data?.label?data.label:''
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
return data
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
//判断编辑按钮是否显示
|
|
261
|
-
function isShowEditButton(){
|
|
262
|
-
if(props.editButtonConfig.show){
|
|
263
|
-
return props.editButtonConfig.show({
|
|
264
|
-
data:items.value,
|
|
265
|
-
sourceId:props.sourceId
|
|
266
|
-
})
|
|
267
|
-
}else{
|
|
268
|
-
return props.page.buttons.includes('dtmplEdit')
|
|
2
|
+
import WFormMessageBox from '../w-form-message-box/w-form-message-box.vue'
|
|
3
|
+
import {
|
|
4
|
+
computed,
|
|
5
|
+
defineProps,
|
|
6
|
+
ref,
|
|
7
|
+
defineEmits,
|
|
8
|
+
} from 'vue'
|
|
9
|
+
import { hasY, getValue, downloadFile, getEnumColor } from './utils/utils'
|
|
10
|
+
import { deletePageData } from '../utils/apis/pageConfig'
|
|
11
|
+
import { useMessage, useToast } from 'wot-design-uni'
|
|
12
|
+
import WAudio from '../w-audio/w-audio.vue'
|
|
13
|
+
const emits = defineEmits(['refresh', 'delet', 'edit'])
|
|
14
|
+
const toast = useToast()
|
|
15
|
+
const message = useMessage()
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
page: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
itemData: {
|
|
22
|
+
type: Object,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
carIndex: {
|
|
26
|
+
type: Number,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
sourceId: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
applicationType: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: ''
|
|
36
|
+
},
|
|
37
|
+
actionType: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: ''
|
|
40
|
+
},
|
|
41
|
+
enumMap: {
|
|
42
|
+
type: Object,
|
|
43
|
+
default: {}
|
|
44
|
+
},
|
|
45
|
+
visible: {
|
|
46
|
+
type: Number,
|
|
47
|
+
default: null
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
editButtonConfig: {
|
|
51
|
+
type: Object,
|
|
52
|
+
default: {
|
|
53
|
+
label: null,
|
|
54
|
+
show: null,
|
|
55
|
+
clickAction: null
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
console.log(props.enumMap)
|
|
60
|
+
//更多按钮
|
|
61
|
+
const moreBtns = computed(() => {
|
|
62
|
+
let data = []
|
|
63
|
+
props.page.rowActions?.forEach((element : any) => {
|
|
64
|
+
if (element.preposes[0]) {
|
|
65
|
+
if (element.preposes[0].transDefaultValue.includes(props.itemData.fieldMap[element.preposes[0].id])) {
|
|
66
|
+
data.push({
|
|
67
|
+
actionType: "submit",
|
|
68
|
+
name: element.title,
|
|
69
|
+
color: '#4D81F1',
|
|
70
|
+
...element
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
data.push({
|
|
75
|
+
actionType: "submit",
|
|
76
|
+
name: element.title,
|
|
77
|
+
color: '#4D81F1',
|
|
78
|
+
...element
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
props.page.ractions?.forEach((item : any) => {
|
|
84
|
+
data.push({
|
|
85
|
+
actionType: "openPage",
|
|
86
|
+
name: item.title,
|
|
87
|
+
color: '#4D81F1',
|
|
88
|
+
...item
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
return data
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
// 处理单项数据、配置
|
|
96
|
+
const items = computed(() => {
|
|
97
|
+
return props.page.columns?.filter((item : any) => {
|
|
98
|
+
// 过滤掉操作列
|
|
99
|
+
return item.title !== '操作'
|
|
100
|
+
}).filter((item : any) => {
|
|
101
|
+
// 过滤掉title 中有 'y'字符的列
|
|
102
|
+
return !hasY(item.title)
|
|
103
|
+
}).map((item : any) => {
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
css: getEnumColor(props.enumMap[item.mstrucId], props.itemData?.fieldMap[item.id]),
|
|
107
|
+
title: item.title,
|
|
108
|
+
controlType: item.controlType,
|
|
109
|
+
content: getValue(props.itemData?.fieldMap[item.id], item.title),//格式化数据
|
|
110
|
+
data: props.itemData?.fieldMap[item.id],
|
|
111
|
+
id: item.id,
|
|
112
|
+
mstrucId: item.mstrucId,
|
|
113
|
+
sourceId: item.sourceId,
|
|
114
|
+
buttons: item.buttons || []
|
|
115
|
+
}
|
|
116
|
+
}) || []
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
const wFormMessageBoxRef = ref()
|
|
120
|
+
const showMoreButns = ref(false)
|
|
121
|
+
const isExpanded = ref(false)
|
|
122
|
+
const defaultVisible = props.visible || 4 // 默认显示行数量
|
|
123
|
+
|
|
124
|
+
const visibleItems = computed(() => {
|
|
125
|
+
return isExpanded.value ? items.value : items.value.slice(0, defaultVisible)
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
const showMore = computed(() => {
|
|
129
|
+
return items.value.length > defaultVisible
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
function toggleExpand() {
|
|
133
|
+
isExpanded.value = !isExpanded.value
|
|
269
134
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
135
|
+
|
|
136
|
+
// 跳转页页面
|
|
137
|
+
function goto(type : string, item : any = {}, subItem : any = {}) {
|
|
138
|
+
|
|
139
|
+
switch (type) {
|
|
140
|
+
case 'detail':
|
|
141
|
+
uni.navigateTo({
|
|
142
|
+
url: `/pages/detail/detail?sourceId=${props.sourceId}&code=${props.itemData.code}`,
|
|
143
|
+
})
|
|
144
|
+
break
|
|
145
|
+
case 'link':
|
|
146
|
+
let code = subItem.value
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
uni.navigateTo({
|
|
150
|
+
url: `/pages/detail/detail?sourceId=${item.sourceId}&code=${code}`,
|
|
151
|
+
})
|
|
152
|
+
break
|
|
153
|
+
case 'edit':
|
|
154
|
+
|
|
155
|
+
if (props.editButtonConfig.clickAction) {
|
|
156
|
+
props.editButtonConfig.clickAction(props.itemData)
|
|
157
|
+
return
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
if (props.actionType === 'relation') {
|
|
162
|
+
emits('edit')
|
|
163
|
+
|
|
164
|
+
}
|
|
165
|
+
if (props.page.classEditConfigs?.length > 0) {
|
|
166
|
+
let con = props.page.classEditConfigs[0].preposes.find((item : any) => {
|
|
167
|
+
return item.defaultValue.includes(props.itemData.fieldMap[item.id])
|
|
168
|
+
})
|
|
169
|
+
if (con) {
|
|
170
|
+
uni.navigateTo({
|
|
171
|
+
url: `/pages/edit/edit?sourceId=${props.page.classEditConfigs[0].id}&code=${props.itemData.code}`,
|
|
172
|
+
})
|
|
173
|
+
} else {
|
|
174
|
+
uni.navigateTo({
|
|
175
|
+
url: `/pages/edit/edit?sourceId=${props.sourceId}&code=${props.itemData.code}`,
|
|
176
|
+
})
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
} else {
|
|
180
|
+
uni.navigateTo({
|
|
181
|
+
url: `/pages/edit/edit?sourceId=${props.sourceId}&code=${props.itemData.code}`,
|
|
182
|
+
})
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
break
|
|
186
|
+
case 'openPage':
|
|
187
|
+
uni.navigateTo({
|
|
188
|
+
url: `/pages/table/table?sourceId=${item.id}&pageTitle=${item.title}&mainCode=${props.itemData.code}`,
|
|
189
|
+
})
|
|
190
|
+
break
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
//删除勾选项
|
|
196
|
+
const delerelation = () => {
|
|
197
|
+
if (props.actionType === 'relation') {
|
|
198
|
+
emits('delet')
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
//删除
|
|
203
|
+
const dele = () => {
|
|
204
|
+
message
|
|
205
|
+
.confirm({
|
|
206
|
+
msg: '确定删除吗?',
|
|
207
|
+
title: '删除'
|
|
208
|
+
})
|
|
209
|
+
.then(() => {
|
|
210
|
+
toast.loading('删除中...')
|
|
211
|
+
deletePageData(props.sourceId, props.itemData.code).then((res : any) => {
|
|
212
|
+
toast.success('删除成功')
|
|
213
|
+
emits('refresh')
|
|
214
|
+
})
|
|
215
|
+
})
|
|
216
|
+
.catch(() => {
|
|
217
|
+
toast.close()
|
|
218
|
+
console.log('点击了取消按钮')
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
//更多按钮点击事件
|
|
224
|
+
const moreBtnsSelect = (item : any) => {
|
|
225
|
+
|
|
226
|
+
switch (item.item.actionType) {
|
|
227
|
+
case 'submit':
|
|
228
|
+
actionBtn(item.item)
|
|
229
|
+
break
|
|
230
|
+
case 'openPage':
|
|
231
|
+
goto(item.item.actionType, item.item)
|
|
232
|
+
break
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// 更多按钮操作
|
|
237
|
+
const actionBtn = (item : any) => {
|
|
238
|
+
wFormMessageBoxRef.value.openFormMessageBox(item)
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
//格式化title
|
|
242
|
+
const getTitleValue = (value : any, title : string) => {
|
|
243
|
+
let data = getValue(value, title)?.content
|
|
244
|
+
if (!data) return ''
|
|
245
|
+
// 是否为数组
|
|
246
|
+
if (Array.isArray(data)) {
|
|
247
|
+
return getValue(value, title).content.map((item : any) => {
|
|
248
|
+
return item.label
|
|
249
|
+
}).join(',')
|
|
250
|
+
}
|
|
251
|
+
//是否为对象
|
|
252
|
+
if (typeof data === 'object') {
|
|
253
|
+
return data?.label ? data.label : ''
|
|
254
|
+
|
|
255
|
+
}
|
|
256
|
+
return data
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
//判断编辑按钮是否显示
|
|
260
|
+
function isShowEditButton() {
|
|
261
|
+
if (props.editButtonConfig.show) {
|
|
262
|
+
return props.editButtonConfig.show({
|
|
263
|
+
data: items.value,
|
|
264
|
+
sourceId: props.sourceId
|
|
265
|
+
})
|
|
266
|
+
} else {
|
|
267
|
+
return props.page.buttons.includes('dtmplEdit')
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
//编辑按钮文字
|
|
273
|
+
function EditButtonLabel() {
|
|
274
|
+
if (props.editButtonConfig.label) {
|
|
275
|
+
return props.editButtonConfig.label({
|
|
276
|
+
sourceId: props.sourceId
|
|
277
|
+
})
|
|
278
|
+
} else {
|
|
279
|
+
return "编辑"
|
|
280
|
+
}
|
|
281
|
+
|
|
281
282
|
}
|
|
282
|
-
|
|
283
|
-
}
|
|
284
283
|
</script>
|
|
285
284
|
|
|
286
285
|
<template>
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
286
|
+
<wd-card>
|
|
287
|
+
<template #title>
|
|
288
|
+
<view>
|
|
289
|
+
<view class="card-title-class">
|
|
290
|
+
<view class="title-icon"></view>
|
|
291
|
+
<view style="flex: 1; word-break:break-all">
|
|
292
|
+
{{getTitleValue(visibleItems.find((item) => item.id === page.primaryColumn?.id), page.primaryColumn?.title) ||getTitleValue(visibleItems[0], '')}}
|
|
293
|
+
</view>
|
|
294
|
+
<!-- <view class="status-icon">
|
|
296
295
|
已完成成成
|
|
297
296
|
</view> -->
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
297
|
+
<wd-tag style="font-size: 15px;padding:0 4px;"
|
|
298
|
+
:bg-color="getEnumColor(enumMap[page.labelColumn.mstrucId],itemData.fieldMap[page.labelColumn.id]).color"
|
|
299
|
+
v-if="page.labelColumn?.id">
|
|
300
|
+
{{
|
|
301
|
+
itemData.fieldMap[page.labelColumn.id]
|
|
302
|
+
}}
|
|
303
|
+
</wd-tag>
|
|
304
|
+
</view>
|
|
305
|
+
<view style="font-size: 12px;margin-top: 8px;color: #ffaa00;">
|
|
306
|
+
{{getTitleValue(visibleItems.find((item) => item.id === page.secondColumn?.id), page.secondColumn?.title)}}
|
|
307
|
+
</view>
|
|
306
308
|
</view>
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
{{
|
|
309
|
+
|
|
310
|
+
</template>
|
|
311
|
+
|
|
312
|
+
<view class="table_collapse">
|
|
313
|
+
<view v-for="(item, index) in visibleItems" :key="index" class="cloum">
|
|
314
|
+
|
|
315
|
+
<!-- // 标题 -->
|
|
316
|
+
<view class="lable">
|
|
317
|
+
<text class="lable">{{ item.title }}:</text>
|
|
318
|
+
</view>
|
|
319
|
+
|
|
320
|
+
<!-- // 图片 -->
|
|
321
|
+
<wd-img v-if="item.content?.type === '图片'" width="100rpx" height="100rpx" :src="item.content.url"
|
|
322
|
+
:enable-preview="true" />
|
|
323
|
+
<view v-else-if="item.title === '序号'">
|
|
324
|
+
{{
|
|
324
325
|
carIndex + 1
|
|
325
326
|
}}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
327
|
+
</view>
|
|
328
|
+
|
|
329
|
+
<!-- //文件 -->
|
|
330
|
+
<view v-else-if="item.content?.type === '文件'" class="value">
|
|
331
|
+
<wd-text type="primary" @click="downloadFile(item.content.url)" :text="item.content?.name" />
|
|
332
|
+
</view>
|
|
333
|
+
|
|
334
|
+
<!-- // 音频 -->
|
|
335
|
+
<WAudio v-else-if="item.content?.type === '音频'" :src="item.content?.url" />
|
|
336
|
+
<!-- // 链接 -->
|
|
337
|
+
<view v-else-if="item.buttons.includes('detail')" class="link">
|
|
338
|
+
<view v-if="Array.isArray(item.content)" @click="goto('link', item, subItem)"
|
|
339
|
+
v-for="(subItem, subIndex) in item.content" :key="subIndex">
|
|
340
|
+
<text> {{ subItem.label }}</text>
|
|
341
|
+
</view>
|
|
342
|
+
<view v-else @click="goto('link', item, item.content)">{{ item.content?.label ? item.content?.label :
|
|
342
343
|
item.content }}</view>
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
344
|
+
</view>
|
|
345
|
+
|
|
346
|
+
<!-- 数组 -->
|
|
347
|
+
<view v-else-if="Array.isArray(item.content)" class="value">
|
|
348
|
+
<text v-for="(subItem, subIndex) in item.content" :key="subIndex">
|
|
349
|
+
<text v-if="subIndex>0">,</text>
|
|
350
|
+
{{ subItem.label }}
|
|
351
|
+
</text>
|
|
352
|
+
</view>
|
|
353
|
+
|
|
354
|
+
<view v-else class="value" :style="item.css"
|
|
355
|
+
v-html="item.content?.label ? item.content?.label : item.content">
|
|
356
|
+
|
|
357
|
+
</view>
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
</view>
|
|
361
|
+
<view class="expand-btn-container">
|
|
362
|
+
<wd-button v-if="showMore" type="icon" :icon="isExpanded ? 'arrow-up' : 'arrow-down'" size="small"
|
|
363
|
+
@click="toggleExpand" />
|
|
364
|
+
</view>
|
|
365
|
+
|
|
366
|
+
</view>
|
|
367
|
+
<template #footer>
|
|
368
|
+
<view class="btns-box">
|
|
369
|
+
<wd-button :round="false" size="small" class="btn" v-if="props.page.buttons.includes('detail')"
|
|
370
|
+
@click="goto('detail')">
|
|
371
|
+
详情
|
|
372
|
+
</wd-button>
|
|
373
|
+
<!-- //编辑按钮 -->
|
|
374
|
+
<wd-button :round="false" type="warning" size="small" class="btn" v-if="isShowEditButton()"
|
|
375
|
+
@click="goto('edit')">
|
|
376
|
+
{{EditButtonLabel()}}
|
|
377
|
+
</wd-button>
|
|
378
|
+
<!-- //假删除按钮,在新增、编辑页面才会出现 -->
|
|
379
|
+
<wd-button :round="false" size="small" class="btn" type="error" @click="delerelation"
|
|
380
|
+
v-if="props.actionType === 'relation'&&props.page.buttons.includes('singleDelete')">
|
|
381
|
+
删除
|
|
382
|
+
</wd-button>
|
|
383
|
+
<wd-button :round="false" size="small" class="btn" type="error" @click="dele"
|
|
384
|
+
v-else-if="props.page.buttons.includes('singleDelete')">
|
|
385
|
+
删除
|
|
386
|
+
</wd-button>
|
|
387
|
+
<view :round="false" v-if="moreBtns.length > 0">
|
|
388
|
+
<wd-button :round="false" type='info' size="small" @click="showMoreButns = true">
|
|
389
|
+
更多
|
|
390
|
+
</wd-button>
|
|
391
|
+
</view>
|
|
392
|
+
</view>
|
|
393
|
+
</template>
|
|
394
|
+
</wd-card>
|
|
395
|
+
<wd-toast />
|
|
396
|
+
<wd-message-box />
|
|
397
|
+
<WFormMessageBox ref="wFormMessageBoxRef" :itemData="props.itemData" @refresh="emits('refresh')" />
|
|
398
|
+
<!-- 更多按钮 -->
|
|
399
|
+
<wd-action-sheet v-model="showMoreButns" :actions="moreBtns" @select="moreBtnsSelect" />
|
|
395
400
|
</template>
|
|
396
401
|
|
|
397
402
|
<style lang="scss" scoped>
|
|
398
|
-
.table_collapse {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
403
|
+
.table_collapse {
|
|
404
|
+
|
|
405
|
+
color: #000;
|
|
406
|
+
// background-color: #F8F8F8;
|
|
407
|
+
padding: 0 0 20rpx 0;
|
|
408
|
+
|
|
409
|
+
/* 添加过渡动画 */
|
|
410
|
+
.cloum {
|
|
411
|
+
// display: flex;
|
|
412
|
+
transition: all 0.3s ease;
|
|
413
|
+
overflow: hidden;
|
|
414
|
+
max-height: 100px;
|
|
415
|
+
color: #919191;
|
|
416
|
+
// border-bottom: 1px solid #e8e5e5;
|
|
417
|
+
padding: 8rpx 10rpx;
|
|
418
|
+
|
|
419
|
+
.lable {
|
|
420
|
+
min-width: 50px;
|
|
421
|
+
// white-space: nowrap !important;
|
|
422
|
+
// font-weight: 600;
|
|
423
|
+
text-align: left;
|
|
424
|
+
margin-right: 20rpx;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.value {
|
|
428
|
+
color: #000;
|
|
429
|
+
font-weight: 600;
|
|
430
|
+
// text-align: justify; /* 文字两端对齐 */
|
|
431
|
+
// word-break: break-all; /* 强制英文/数字换行时断词 */
|
|
432
|
+
word-break: break-all;
|
|
433
|
+
/* 所有字符(包括中文)强制换行 */
|
|
434
|
+
white-space: normal;
|
|
435
|
+
/* 确保不保留空白符 */
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
position: relative; // 添加定位上下文
|
|
441
|
+
padding-bottom: 20rpx; // 为按钮预留空间
|
|
442
|
+
|
|
443
|
+
.expand-btn-container {
|
|
444
|
+
/* 尺寸调整 */
|
|
445
|
+
padding: 8rpx 20rpx;
|
|
446
|
+
font-size: 24rpx;
|
|
447
|
+
line-height: 1.2;
|
|
448
|
+
|
|
449
|
+
/* 定位调整 */
|
|
450
|
+
position: absolute;
|
|
451
|
+
right: 50%;
|
|
452
|
+
transform: translateX(50%);
|
|
453
|
+
bottom: -23px;
|
|
454
|
+
width: auto !important;
|
|
455
|
+
margin-top: 0;
|
|
456
|
+
|
|
457
|
+
/* 视觉样式 */
|
|
458
|
+
// background: #ffffff;
|
|
459
|
+
// border: 1px solid #ebedf0;
|
|
460
|
+
// border-radius: 16rpx;
|
|
461
|
+
// box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.link {
|
|
465
|
+
color: #4d80f0;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.card-title-class {
|
|
472
|
+
display: flex;
|
|
473
|
+
align-items: center;
|
|
474
|
+
font-weight: 700;
|
|
475
|
+
gap: 4px;
|
|
476
|
+
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.title-icon {
|
|
480
|
+
width: 8px;
|
|
481
|
+
height: 8px;
|
|
482
|
+
border-radius: 100%;
|
|
483
|
+
background-color: #4d80f0;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.status-icon {
|
|
487
|
+
box-sizing: border-box;
|
|
488
|
+
padding: 4px 15px;
|
|
489
|
+
transform: rotate(45deg) translate(15px, -15px);
|
|
490
|
+
text-align: center;
|
|
491
|
+
color: #fff;
|
|
492
|
+
font-size: 12px;
|
|
493
|
+
// width: 85px;
|
|
494
|
+
// height: 15px;
|
|
495
|
+
background-color: #4d80f0;
|
|
496
|
+
clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.btn {
|
|
500
|
+
margin-left: 10rpx;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.btns-box {
|
|
504
|
+
display: flex;
|
|
505
|
+
justify-content: flex-end;
|
|
506
|
+
flex-wrap: wrap;
|
|
507
|
+
gap: 5px;
|
|
508
|
+
}
|
|
509
|
+
</style>
|