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/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
- computed,
6
- defineProps,
7
- ref,
8
- defineEmits,
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
- page: {
19
- type: Object,
20
- required: true,
21
- },
22
- itemData: {
23
- type: Object,
24
- required: true,
25
- },
26
- carIndex: {
27
- type: Number,
28
- required: true,
29
- },
30
- sourceId: {
31
- type: String,
32
- required: true,
33
- },
34
- applicationType: {
35
- type: String,
36
- default: ''
37
- },
38
- actionType: {
39
- type: String,
40
- default: ''
41
- },
42
- enumMap:{
43
- type:Object,
44
- default:{}
45
- },
46
- visible:{
47
- type:Number,
48
- default:null
49
- },
50
-
51
- editButtonConfig:{
52
- type:Object,
53
- default:{
54
- label:null,
55
- show:null,
56
- clickAction:null
57
- }
58
- }
59
- })
60
- console.log(props.enumMap)
61
- //更多按钮
62
- const moreBtns = computed(() => {
63
- let data = []
64
- props.page.rowActions?.forEach((element: any) => {
65
- if (element.preposes[0]) {
66
- if (element.preposes[0].transDefaultValue.includes(props.itemData.fieldMap[element.preposes[0].id])) {
67
- data.push({
68
- actionType: "submit",
69
- name: element.title,
70
- color: '#4D81F1',
71
- ...element
72
- })
73
- }
74
- } else {
75
- data.push({
76
- actionType: "submit",
77
- name: element.title,
78
- color: '#4D81F1',
79
- ...element
80
- })
81
- }
82
- });
83
-
84
- props.page.ractions?.forEach((item: any) => {
85
- data.push({
86
- actionType: "openPage",
87
- name: item.title,
88
- color: '#4D81F1',
89
- ...item
90
- })
91
- })
92
-
93
- return data
94
- })
95
-
96
- // 处理单项数据、配置
97
- const items = computed(() => {
98
- return props.page.columns?.filter((item: any) => {
99
- // 过滤掉操作列
100
- return item.title !== '操作'
101
- }).filter((item: any) => {
102
- // 过滤掉title 中有 'y'字符的列
103
- return !hasY(item.title)
104
- }).map((item: any) => {
105
-
106
- return {
107
- css:getEnumColor(props.enumMap[item.mstrucId],props.itemData?.fieldMap[item.id]),
108
- title: item.title,
109
- controlType: item.controlType,
110
- content: getValue(props.itemData?.fieldMap[item.id], item.title),//格式化数据
111
- data: props.itemData?.fieldMap[item.id],
112
- id: item.id,
113
- mstrucId: item.mstrucId,
114
- sourceId: item.sourceId,
115
- buttons: item.buttons || []
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
- return isExpanded.value ? items.value : items.value.slice(0, defaultVisible)
127
- })
128
-
129
- const showMore = computed(() => {
130
- return items.value.length > defaultVisible
131
- })
132
-
133
- function toggleExpand() {
134
- isExpanded.value = !isExpanded.value
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
- function EditButtonLabel(){
275
- if(props.editButtonConfig.label){
276
- return props.editButtonConfig.label({
277
- sourceId:props.sourceId
278
- })
279
- }else{
280
- return "编辑"
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
- <wd-card >
288
- <template #title>
289
- <view >
290
- <view class="card-title-class">
291
- <view class="title-icon"></view>
292
- <view style="flex: 1; word-break:break-all">
293
- {{getTitleValue(visibleItems.find((item) => item.id === page.primaryColumn?.id), page.primaryColumn?.title) || ' '}}
294
- </view>
295
- <!-- <view class="status-icon">
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
- <wd-tag style="font-size: 15px;padding:0 4px;" :bg-color="getEnumColor(enumMap[page.labelColumn.mstrucId],itemData.fieldMap[page.labelColumn.id]).color" v-if="page.labelColumn?.id">
299
- {{
300
- itemData.fieldMap[page.labelColumn.id]
301
- }}
302
- </wd-tag>
303
- </view>
304
- <view style="font-size: 12px;margin-top: 8px;color: #ffaa00;">
305
- {{getTitleValue(visibleItems.find((item) => item.id === page.secondColumn?.id), page.secondColumn?.title)}}
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
- </view>
308
-
309
- </template>
310
-
311
- <view class="table_collapse">
312
- <view v-for="(item, index) in visibleItems" :key="index" class="cloum">
313
-
314
- <!-- // 标题 -->
315
- <view class="lable">
316
- <text class="lable">{{ item.title }}:</text>
317
- </view>
318
-
319
- <!-- // 图片 -->
320
- <wd-img v-if="item.content?.type === '图片'" width="100rpx" height="100rpx" :src="item.content.url"
321
- :enable-preview="true" />
322
- <view v-else-if="item.title === '序号'">
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
- </view>
327
-
328
- <!-- //文件 -->
329
- <view v-else-if="item.content?.type === '文件'" class="value">
330
- <wd-text type="primary" @click="downloadFile(item.content.url)" :text="item.content?.name" />
331
- </view>
332
-
333
- <!-- // 音频 -->
334
- <WAudio v-else-if="item.content?.type === '音频'" :src="item.content?.url" />
335
- <!-- // 链接 -->
336
- <view v-else-if="item.buttons.includes('detail')" class="link">
337
- <view v-if="Array.isArray(item.content)" @click="goto('link', item, subItem)"
338
- v-for="(subItem, subIndex) in item.content" :key="subIndex">
339
- <text> {{ subItem.label }}</text>
340
- </view>
341
- <view v-else @click="goto('link', item, item.content)">{{ item.content?.label ? item.content?.label :
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
- </view>
344
-
345
- <view v-else-if="Array.isArray(item.content)" class="value">
346
- <view v-for="(subItem, subIndex) in item.content" :key="subIndex">
347
- <text> {{ subItem.label }}</text>
348
- </view>
349
- </view>
350
-
351
- <view v-else class="value" :style="item.css" v-html="item.content?.label ? item.content?.label : item.content">
352
-
353
- </view>
354
-
355
-
356
- </view>
357
- <view class="expand-btn-container">
358
- <wd-button v-if="showMore" type="icon" :icon="isExpanded ? 'arrow-up' : 'arrow-down'" size="small"
359
- @click="toggleExpand" />
360
- </view>
361
-
362
- </view>
363
- <template #footer>
364
- <view class="btns-box">
365
- <wd-button :round="false" size="small" class="btn" v-if="props.page.buttons.includes('detail')" @click="goto('detail')">
366
- 详情
367
- </wd-button>
368
- <!-- //编辑按钮 -->
369
- <wd-button :round="false" type="warning" size="small" class="btn" v-if="isShowEditButton()"
370
- @click="goto('edit')">
371
- {{EditButtonLabel()}}
372
- </wd-button>
373
- <!-- //假删除按钮,在新增、编辑页面才会出现 -->
374
- <wd-button :round="false" size="small" class="btn" type="error" @click="delerelation"
375
- v-if="props.actionType === 'relation'&&props.page.buttons.includes('singleDelete')">
376
- 删除
377
- </wd-button>
378
- <wd-button :round="false" size="small" class="btn" type="error" @click="dele"
379
- v-else-if="props.page.buttons.includes('singleDelete')">
380
- 删除
381
- </wd-button>
382
- <view :round="false" v-if="moreBtns.length > 0">
383
- <wd-button :round="false" type='info' size="small" @click="showMoreButns = true">
384
- 更多
385
- </wd-button>
386
- </view>
387
- </view>
388
- </template>
389
- </wd-card>
390
- <wd-toast />
391
- <wd-message-box />
392
- <WFormMessageBox ref="wFormMessageBoxRef" :itemData="props.itemData" @refresh="emits('refresh')" />
393
- <!-- 更多按钮 -->
394
- <wd-action-sheet v-model="showMoreButns" :actions="moreBtns" @select="moreBtnsSelect" />
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
- color: #000;
401
- // background-color: #F8F8F8;
402
- padding:0 0 20rpx 0;
403
-
404
- /* 添加过渡动画 */
405
- .cloum {
406
- display: flex;
407
- transition: all 0.3s ease;
408
- overflow: hidden;
409
- max-height: 100px;
410
- color: #A6A6A6;
411
- // border-bottom: 1px solid #e8e5e5;
412
- padding: 8rpx 10rpx;
413
-
414
- .lable {
415
- white-space: nowrap !important;
416
- // font-weight: 600;
417
- text-align: left;
418
- margin-right: 20rpx;
419
- }
420
-
421
- .value {
422
- color: #000;
423
- // text-align: justify; /* 文字两端对齐 */
424
- // word-break: break-all; /* 强制英文/数字换行时断词 */
425
- word-break: break-all;
426
- /* 所有字符(包括中文)强制换行 */
427
- white-space: normal;
428
- /* 确保不保留空白符 */
429
- }
430
-
431
- }
432
-
433
- position: relative; // 添加定位上下文
434
- padding-bottom: 20rpx; // 为按钮预留空间
435
-
436
- .expand-btn-container {
437
- /* 尺寸调整 */
438
- padding: 8rpx 20rpx;
439
- font-size: 24rpx;
440
- line-height: 1.2;
441
-
442
- /* 定位调整 */
443
- position: absolute;
444
- right: 50%;
445
- transform: translateX(50%);
446
- bottom: -23px;
447
- width: auto !important;
448
- margin-top: 0;
449
-
450
- /* 视觉样式 */
451
- // background: #ffffff;
452
- // border: 1px solid #ebedf0;
453
- // border-radius: 16rpx;
454
- // box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
455
- }
456
-
457
- .link {
458
- color: #4d80f0;
459
- }
460
-
461
-
462
- }
463
- .card-title-class{
464
- display: flex;
465
- align-items: center;
466
- font-weight: 700 ;
467
- gap: 4px;
468
-
469
- }
470
- .title-icon{
471
- width: 8px;
472
- height: 8px;
473
- border-radius: 100%;
474
- background-color: #4d80f0;
475
- }
476
- .status-icon{
477
- box-sizing: border-box;
478
- padding: 4px 15px;
479
- transform: rotate(45deg) translate(15px,-15px);
480
- text-align: center;
481
- color: #fff;
482
- font-size: 12px;
483
- // width: 85px;
484
- // height: 15px;
485
- background-color: #4d80f0;
486
- clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
487
- }
488
- .btn {
489
- margin-left: 10rpx;
490
- }
491
-
492
- .btns-box {
493
- display: flex;
494
- justify-content: flex-end;
495
- flex-wrap: wrap;
496
- gap: 5px;
497
- }
498
- </style>
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>