wui-components-v2 1.1.57 → 1.1.59
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 +1 -1
- package/components/detail-popup/detail-popup.vue +28 -0
- package/components/fold-card/fold-card.vue +15 -27
- package/components/form-control/form-control.vue +131 -263
- package/components/label-value/label-value.vue +36 -0
- package/components/wui-edit-page/wui-edit-page.vue +3 -0
- package/components/wui-enume-select-control/wui-enume-select-control.vue +16 -4
- package/components/wui-select-list/wui-select-list.vue +59 -43
- package/components/wui-select-popup/wui-select-popup.vue +602 -0
- package/package.json +1 -1
- package/utils/control-type-supportor.ts +0 -1
|
@@ -3,7 +3,7 @@ import { computed, onBeforeMount, 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'
|
|
6
|
-
import
|
|
6
|
+
import WuiSelectPopup from '../wui-select-popup/wui-select-popup.vue'
|
|
7
7
|
import ControlTypeSupportor from '../../utils/control-type-supportor'
|
|
8
8
|
import { useCompanyFieldFilter } from '../../composables/useCompanyFieldFilter'
|
|
9
9
|
import customSelectPicker from '../custom-select-picker/custom-select-picker.vue'
|
|
@@ -44,16 +44,16 @@ const hydrocarbonProgramToken = ref<string>('')
|
|
|
44
44
|
const token = ref<string>('')
|
|
45
45
|
const form = ref<any>(null)
|
|
46
46
|
const model = ref<any>({})
|
|
47
|
-
|
|
47
|
+
const addEvent = generateHighResolutionID() // 全局事件名称
|
|
48
48
|
const { filteredFields: fields } = useCompanyFieldFilter(
|
|
49
49
|
() => props.fieldGroup,
|
|
50
50
|
model,
|
|
51
51
|
props.companyFilter, // 是否自适应显示快递公司填充框
|
|
52
|
-
props.companyFieldSourceId
|
|
52
|
+
props.companyFieldSourceId // 快递公司对应字段
|
|
53
53
|
)
|
|
54
|
-
const giveDefaultValue =(value:any)=>{
|
|
55
|
-
|
|
56
|
-
const rawDefaultValue=extInfo.fieldMap||{}
|
|
54
|
+
const giveDefaultValue = (value: any) => {
|
|
55
|
+
const { extInfo = {} } = uni.getStorageSync('userInfo') || {}
|
|
56
|
+
const rawDefaultValue = extInfo.fieldMap || {}
|
|
57
57
|
const defaultValue: Record<string, any> = {}
|
|
58
58
|
for (const key in rawDefaultValue) {
|
|
59
59
|
if (Object.prototype.hasOwnProperty.call(rawDefaultValue, key)) {
|
|
@@ -61,7 +61,7 @@ const giveDefaultValue =(value:any)=>{
|
|
|
61
61
|
defaultValue[key] = typeof val === 'string' && val.includes('@R@') ? val.split('@R@')[0] : val
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
return defaultValue[value]||{}
|
|
64
|
+
return defaultValue[value] || {}
|
|
65
65
|
}
|
|
66
66
|
giveDefaultValue({})
|
|
67
67
|
// 初始化表单数据
|
|
@@ -70,49 +70,60 @@ function initFormData() {
|
|
|
70
70
|
props.fieldGroup?.fields.forEach((item: Fields) => {
|
|
71
71
|
// 树、多选
|
|
72
72
|
if (ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'tree-entity-select' || ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'multiselect') {
|
|
73
|
-
return models[item.sourceId] = (props.entity && props.entity[item.sourceId]?.split(',')) || item.transDefaultValue || []
|
|
73
|
+
return (models[item.sourceId] = (props.entity && props.entity[item.sourceId]?.split(',')) || item.transDefaultValue || [])
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
if (ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relselect') {
|
|
77
|
-
return models[item.sourceId] = (props.entity && props.entity[item.sourceId]?.split('@,@')) || (item.transDefaultValue && item.transDefaultValue?.split('@,@')) || []
|
|
77
|
+
return (models[item.sourceId] = (props.entity && props.entity[item.sourceId]?.split('@,@')) || (item.transDefaultValue && item.transDefaultValue?.split('@,@')) || [])
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
// 文件
|
|
81
81
|
if (ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'file' || ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relfile') {
|
|
82
82
|
if (props.entity && typeof props.entity[item.sourceId] === 'object') {
|
|
83
|
-
return models[item.sourceId] = [props.entity[item.sourceId]]
|
|
83
|
+
return (models[item.sourceId] = [props.entity[item.sourceId]])
|
|
84
84
|
}
|
|
85
|
-
return models[item.sourceId] =
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
return (models[item.sourceId] =
|
|
86
|
+
(props.entity &&
|
|
87
|
+
props.entity[item.sourceId] && [
|
|
88
|
+
{
|
|
89
|
+
disabled: JSON.parse(props.entity[item.sourceId]).valid,
|
|
90
|
+
url: `${action.value}/v3/files${JSON.parse(props.entity[item.sourceId])?.base.path}?@token=${token.value}&@programToken=${hydrocarbonProgramToken.value}`,
|
|
91
|
+
name: `${JSON.parse(props.entity[item.sourceId])?.base.fileName}`,
|
|
92
|
+
response: JSON.stringify({
|
|
93
|
+
fileKey: `$blob:${JSON.parse(props.entity[item.sourceId])?.base.bytesInfoVO.code}`,
|
|
94
|
+
}),
|
|
95
|
+
},
|
|
96
|
+
]) ||
|
|
97
|
+
item.transDefaultValue ||
|
|
98
|
+
[])
|
|
88
99
|
}
|
|
89
100
|
|
|
90
101
|
// 时间
|
|
91
102
|
if (ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'datetime' || ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'date') {
|
|
92
|
-
return models[item.sourceId] = (props.entity && dayjs(props.entity[item.sourceId]).valueOf()) || (item.transDefaultValue && dayjs(item.transDefaultValue).valueOf()) || null
|
|
103
|
+
return (models[item.sourceId] = (props.entity && dayjs(props.entity[item.sourceId]).valueOf()) || (item.transDefaultValue && dayjs(item.transDefaultValue).valueOf()) || null)
|
|
93
104
|
}
|
|
94
105
|
|
|
95
106
|
// 评分
|
|
96
107
|
if (ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'progress') {
|
|
97
108
|
const val = props.entity?.[item.sourceId]
|
|
98
|
-
return models[item.sourceId] =
|
|
109
|
+
return (models[item.sourceId] = val !== undefined && val !== null && val !== '' ? Number(val) : 0)
|
|
99
110
|
}
|
|
100
111
|
|
|
101
|
-
return models[item.sourceId] = (props.entity && props.entity[item.sourceId]) || item.transDefaultValue || ''
|
|
112
|
+
return (models[item.sourceId] = (props.entity && props.entity[item.sourceId]) || item.transDefaultValue || '')
|
|
102
113
|
})
|
|
103
114
|
|
|
104
|
-
|
|
105
|
-
const processedModels: Record<string, any> = {}
|
|
106
|
-
for (const key in models) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
// 遍历 models,处理 $$user. 前缀
|
|
116
|
+
const processedModels: Record<string, any> = {}
|
|
117
|
+
for (const key in models) {
|
|
118
|
+
if (Object.prototype.hasOwnProperty.call(models, key)) {
|
|
119
|
+
const val = models[key]
|
|
120
|
+
if (typeof val === 'string' && val.includes('$$user.')) {
|
|
121
|
+
processedModels[key] = giveDefaultValue(val.split('$$user.')[1])
|
|
122
|
+
} else {
|
|
123
|
+
processedModels[key] = val
|
|
124
|
+
}
|
|
113
125
|
}
|
|
114
126
|
}
|
|
115
|
-
}
|
|
116
127
|
|
|
117
128
|
model.value = {
|
|
118
129
|
...processedModels,
|
|
@@ -120,13 +131,15 @@ for (const key in models) {
|
|
|
120
131
|
}
|
|
121
132
|
|
|
122
133
|
//-s
|
|
123
|
-
const shouldMonitor=computed(()=>{
|
|
124
|
-
const newList=fields.value
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
134
|
+
const shouldMonitor = computed(() => {
|
|
135
|
+
const newList = fields.value
|
|
136
|
+
.filter((item: any) => item.relValueField || item.relValueField3)
|
|
137
|
+
.map((innerItem: any) => ({
|
|
138
|
+
id: innerItem.sourceId,
|
|
139
|
+
title: innerItem.title,
|
|
140
|
+
relValueField: innerItem.relValueField.id,
|
|
141
|
+
relValueField3: innerItem.relValueField3.id,
|
|
142
|
+
}))
|
|
130
143
|
console.log('shouldMonitor:', newList)
|
|
131
144
|
return newList
|
|
132
145
|
})
|
|
@@ -141,14 +154,12 @@ watch(
|
|
|
141
154
|
() => {
|
|
142
155
|
const snapshot: Record<string, any> = {}
|
|
143
156
|
shouldMonitor.value?.forEach((item: any) => {
|
|
144
|
-
if (item.relValueField)
|
|
145
|
-
|
|
146
|
-
if (item.relValueField3)
|
|
147
|
-
snapshot.relValueField3 = model.value[item.relValueField3]
|
|
157
|
+
if (item.relValueField) snapshot.relValueField = model.value[item.relValueField]
|
|
158
|
+
if (item.relValueField3) snapshot.relValueField3 = model.value[item.relValueField3]
|
|
148
159
|
})
|
|
149
160
|
return snapshot
|
|
150
161
|
},
|
|
151
|
-
|
|
162
|
+
newVal => {
|
|
152
163
|
// 只存储与初始值不同的字段(表单变化的值)
|
|
153
164
|
const changed: Record<string, any> = {}
|
|
154
165
|
shouldMonitor.value?.forEach((item: any) => {
|
|
@@ -169,8 +180,9 @@ watch(
|
|
|
169
180
|
changedData: changedData.value,
|
|
170
181
|
rawData: shouldMonitor.value,
|
|
171
182
|
})
|
|
183
|
+
console.log('changedData:', changedData.value)
|
|
172
184
|
}
|
|
173
|
-
}
|
|
185
|
+
}
|
|
174
186
|
)
|
|
175
187
|
|
|
176
188
|
onBeforeMount(() => {
|
|
@@ -198,8 +210,7 @@ const schema = computed((): FormSchema => {
|
|
|
198
210
|
const value = _model[item.sourceId]
|
|
199
211
|
if (Array.isArray(value) && value.length < 1) {
|
|
200
212
|
issues.push({ path: [item.sourceId], message: `请填写${item.title}` })
|
|
201
|
-
}
|
|
202
|
-
else if (!value) {
|
|
213
|
+
} else if (!value) {
|
|
203
214
|
issues.push({ path: [item.sourceId], message: `请填写${item.title}` })
|
|
204
215
|
}
|
|
205
216
|
}
|
|
@@ -219,37 +230,35 @@ function handleFileChange(e: any, item: Fields) {
|
|
|
219
230
|
|
|
220
231
|
function submit() {
|
|
221
232
|
return new Promise((resolve, reject) => {
|
|
222
|
-
form.value
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
if (
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
233
|
+
form.value
|
|
234
|
+
.validate()
|
|
235
|
+
.then(({ valid }: any) => {
|
|
236
|
+
if (valid) {
|
|
237
|
+
const data: { [key: string]: any } = {}
|
|
238
|
+
for (const key in model.value) {
|
|
239
|
+
if (Object.prototype.hasOwnProperty.call(model.value, key)) {
|
|
240
|
+
fields.value?.forEach((item: Fields) => {
|
|
241
|
+
if (item.sourceId === key) {
|
|
242
|
+
if (ControlTypeSupportor.getControlType(item) === 'file') {
|
|
243
|
+
data[key] = toRaw(model.value[key][0])
|
|
244
|
+
} else if (ControlTypeSupportor.getControlType(item) === 'relselect' || ControlTypeSupportor.getControlType(item) === 'tree-entity-select') {
|
|
245
|
+
if (Array.isArray(model.value[key])) {
|
|
246
|
+
data[key] = model.value[key].join('@,@')
|
|
247
|
+
} else {
|
|
248
|
+
data[key] = model.value[key]
|
|
249
|
+
}
|
|
250
|
+
} else {
|
|
237
251
|
data[key] = model.value[key]
|
|
238
252
|
}
|
|
239
253
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
})
|
|
254
|
+
})
|
|
255
|
+
}
|
|
245
256
|
}
|
|
257
|
+
resolve(data)
|
|
258
|
+
} else {
|
|
259
|
+
reject(valid)
|
|
246
260
|
}
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
else {
|
|
250
|
-
reject(valid)
|
|
251
|
-
}
|
|
252
|
-
})
|
|
261
|
+
})
|
|
253
262
|
.catch((error: any) => {
|
|
254
263
|
console.log(error, 'error')
|
|
255
264
|
reject(error)
|
|
@@ -257,93 +266,32 @@ function submit() {
|
|
|
257
266
|
})
|
|
258
267
|
}
|
|
259
268
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
269
|
// 暴露方法/变量给父组件
|
|
265
270
|
defineExpose({
|
|
266
271
|
submit,
|
|
267
272
|
})
|
|
268
|
-
|
|
269
|
-
|
|
270
273
|
</script>
|
|
271
274
|
|
|
272
275
|
<template>
|
|
273
276
|
<view>
|
|
274
277
|
<wd-form ref="form" :model="model" :schema="schema" error-type="toast" :label-width="120" class="custom-from-style">
|
|
275
|
-
<addAddressPage
|
|
278
|
+
<addAddressPage v-if="props?.smartPaste" v-model="model" :group="props.fieldGroup" />
|
|
276
279
|
<view v-for="item in fields" :key="item.sourceId">
|
|
277
280
|
<view v-show="!item.title?.includes('y') && !item.hidden">
|
|
278
|
-
<wd-form-item
|
|
279
|
-
v-
|
|
280
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
281
|
-
:prop="item.sourceId"
|
|
282
|
-
:title="item.title"
|
|
283
|
-
>
|
|
284
|
-
<wd-input
|
|
285
|
-
v-model="model[item.sourceId]"
|
|
286
|
-
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
287
|
-
:clearable="!item.disabled"
|
|
288
|
-
:placeholder="`请输入${item.title}`"
|
|
289
|
-
:class="{ 'disabled-input': item.disabled || item.rowEditType === 'readonly'}"
|
|
290
|
-
/>
|
|
281
|
+
<wd-form-item v-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'text'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
282
|
+
<wd-input v-model="model[item.sourceId]" :readonly="item.disabled || item.rowEditType === 'readonly'" :clearable="!item.disabled" :placeholder="`请输入${item.title}`" :class="{ 'disabled-input': item.disabled || item.rowEditType === 'readonly' }" />
|
|
291
283
|
</wd-form-item>
|
|
292
|
-
<wd-form-item
|
|
293
|
-
v-
|
|
294
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
295
|
-
:prop="item.sourceId"
|
|
296
|
-
:title="item.title"
|
|
297
|
-
>
|
|
298
|
-
<wd-input
|
|
299
|
-
v-model="model[item.sourceId]"
|
|
300
|
-
type="number"
|
|
301
|
-
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
302
|
-
:clearable="!item.disabled"
|
|
303
|
-
:placeholder="`请输入${item.title}`"
|
|
304
|
-
/>
|
|
284
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'decimal'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
285
|
+
<wd-input v-model="model[item.sourceId]" type="number" :readonly="item.disabled || item.rowEditType === 'readonly'" :clearable="!item.disabled" :placeholder="`请输入${item.title}`" />
|
|
305
286
|
</wd-form-item>
|
|
306
|
-
<wd-form-item
|
|
307
|
-
v-
|
|
308
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
309
|
-
:prop="item.sourceId"
|
|
310
|
-
:title="item.title"
|
|
311
|
-
>
|
|
312
|
-
<wd-input
|
|
313
|
-
v-model="model[item.sourceId]"
|
|
314
|
-
show-password
|
|
315
|
-
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
316
|
-
:clearable="!item.disabled"
|
|
317
|
-
:placeholder="`请输入${item.title}`"
|
|
318
|
-
/>
|
|
287
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'password'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
288
|
+
<wd-input v-model="model[item.sourceId]" show-password :readonly="item.disabled || item.rowEditType === 'readonly'" :clearable="!item.disabled" :placeholder="`请输入${item.title}`" />
|
|
319
289
|
</wd-form-item>
|
|
320
|
-
<wd-form-item
|
|
321
|
-
v-
|
|
322
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
323
|
-
:prop="item.sourceId"
|
|
324
|
-
:title="item.title"
|
|
325
|
-
>
|
|
326
|
-
<wd-textarea
|
|
327
|
-
v-model="model[item.sourceId]"
|
|
328
|
-
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
329
|
-
:clearable="!item.disabled"
|
|
330
|
-
:placeholder="`请输入${item.title}`"
|
|
331
|
-
auto-height
|
|
332
|
-
/>
|
|
290
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'textarea'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
291
|
+
<wd-textarea v-model="model[item.sourceId]" :readonly="item.disabled || item.rowEditType === 'readonly'" :clearable="!item.disabled" :placeholder="`请输入${item.title}`" auto-height />
|
|
333
292
|
</wd-form-item>
|
|
334
|
-
<wd-form-item
|
|
335
|
-
v-
|
|
336
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
337
|
-
:prop="item.sourceId"
|
|
338
|
-
:title="item.title"
|
|
339
|
-
:style="{ display: item.title?.includes('y') ? 'none' : null }"
|
|
340
|
-
>
|
|
341
|
-
<customSelectPicker
|
|
342
|
-
v-model="model[item.sourceId]"
|
|
343
|
-
:placeholder="`请选择${item.title}`"
|
|
344
|
-
:columns="(enumColumn && formatSelectColumns(enumColumn[item.mstrucId]))"
|
|
345
|
-
type="radio"
|
|
346
|
-
/>
|
|
293
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'select'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title" :style="{ display: item.title?.includes('y') ? 'none' : null }">
|
|
294
|
+
<customSelectPicker v-model="model[item.sourceId]" :placeholder="`请选择${item.title}`" :columns="enumColumn && formatSelectColumns(enumColumn[item.mstrucId])" type="radio" />
|
|
347
295
|
</wd-form-item>
|
|
348
296
|
<wd-form-item
|
|
349
297
|
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relselect-extdis'"
|
|
@@ -352,83 +300,22 @@ defineExpose({
|
|
|
352
300
|
:title="item.title"
|
|
353
301
|
:style="{ display: item.title?.includes('y') ? 'none' : null }"
|
|
354
302
|
>
|
|
355
|
-
<userChoose
|
|
356
|
-
v-model="model[item.sourceId]"
|
|
357
|
-
:placeholder="`请选择${item.title}`"
|
|
358
|
-
:source-id="item.sourceId"
|
|
359
|
-
:title="item.title"
|
|
360
|
-
:add-event="addEvent"
|
|
361
|
-
:ext-control-type="item.extControlType"
|
|
362
|
-
/>
|
|
303
|
+
<userChoose v-model="model[item.sourceId]" :placeholder="`请选择${item.title}`" :source-id="item.sourceId" :title="item.title" :add-event="addEvent" :ext-control-type="item.extControlType" />
|
|
363
304
|
</wd-form-item>
|
|
364
|
-
<wd-form-item
|
|
365
|
-
v-
|
|
366
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
367
|
-
:prop="item.sourceId"
|
|
368
|
-
:title="item.title"
|
|
369
|
-
>
|
|
370
|
-
<customSelectPicker
|
|
371
|
-
v-model="model[item.sourceId]"
|
|
372
|
-
:placeholder="`请选择${item.title}`"
|
|
373
|
-
:columns="(enumColumn && formatSelectColumns(enumColumn[item.mstrucId]))"
|
|
374
|
-
type="checkbox"
|
|
375
|
-
/>
|
|
305
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'multiselect'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
306
|
+
<customSelectPicker v-model="model[item.sourceId]" :placeholder="`请选择${item.title}`" :columns="enumColumn && formatSelectColumns(enumColumn[item.mstrucId])" type="checkbox" />
|
|
376
307
|
</wd-form-item>
|
|
377
|
-
<wd-form-item
|
|
378
|
-
v-
|
|
379
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
380
|
-
:prop="item.sourceId"
|
|
381
|
-
:title="item.title"
|
|
382
|
-
>
|
|
383
|
-
<customDatePicker
|
|
384
|
-
v-model="model[item.sourceId]"
|
|
385
|
-
type="date"
|
|
386
|
-
:clearable="!item.disabled"
|
|
387
|
-
:placeholder="`请选择${item.title}`"
|
|
388
|
-
/>
|
|
308
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'date'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
309
|
+
<customDatePicker v-model="model[item.sourceId]" type="date" :clearable="!item.disabled" :placeholder="`请选择${item.title}`" />
|
|
389
310
|
</wd-form-item>
|
|
390
|
-
<wd-form-item
|
|
391
|
-
v-
|
|
392
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
393
|
-
:prop="item.sourceId"
|
|
394
|
-
:title="item.title"
|
|
395
|
-
>
|
|
396
|
-
<customDatePicker
|
|
397
|
-
v-model="model[item.sourceId]"
|
|
398
|
-
type="datetime"
|
|
399
|
-
:clearable="!item.disabled"
|
|
400
|
-
:placeholder="`请选择${item.title}`"
|
|
401
|
-
/>
|
|
311
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'datetime'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
312
|
+
<customDatePicker v-model="model[item.sourceId]" type="datetime" :clearable="!item.disabled" :placeholder="`请选择${item.title}`" />
|
|
402
313
|
</wd-form-item>
|
|
403
|
-
<wd-form-item
|
|
404
|
-
v-
|
|
405
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
406
|
-
:prop="item.sourceId"
|
|
407
|
-
:title="item.title"
|
|
408
|
-
>
|
|
409
|
-
<customDatePicker
|
|
410
|
-
v-model="model[item.sourceId]"
|
|
411
|
-
type="time"
|
|
412
|
-
use-second
|
|
413
|
-
:clearable="!item.disabled"
|
|
414
|
-
:placeholder="`请选择${item.title}`"
|
|
415
|
-
/>
|
|
416
|
-
|
|
314
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'time'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
315
|
+
<customDatePicker v-model="model[item.sourceId]" type="time" use-second :clearable="!item.disabled" :placeholder="`请选择${item.title}`" />
|
|
417
316
|
</wd-form-item>
|
|
418
|
-
|
|
419
|
-
v-
|
|
420
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
421
|
-
:prop="item.sourceId"
|
|
422
|
-
:title="item.title"
|
|
423
|
-
>
|
|
424
|
-
<customDatePicker
|
|
425
|
-
v-model="model[item.sourceId]"
|
|
426
|
-
type="year"
|
|
427
|
-
use-second
|
|
428
|
-
:clearable="!item.disabled"
|
|
429
|
-
:placeholder="`请选择${item.title}`"
|
|
430
|
-
/>
|
|
431
|
-
|
|
317
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'date-YY'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
318
|
+
<customDatePicker v-model="model[item.sourceId]" type="year" use-second :clearable="!item.disabled" :placeholder="`请选择${item.title}`" />
|
|
432
319
|
</wd-form-item>
|
|
433
320
|
<wd-form-item
|
|
434
321
|
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'file' || ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relfile'"
|
|
@@ -445,10 +332,17 @@ defineExpose({
|
|
|
445
332
|
:accept="fileType"
|
|
446
333
|
:disabled="item.disabled || item.rowEditType === 'readonly'"
|
|
447
334
|
:limit="1"
|
|
448
|
-
:header="{
|
|
335
|
+
:header="{
|
|
336
|
+
'hydrocarbon-program-token': hydrocarbonProgramToken,
|
|
337
|
+
'hydrocarbon-token': token,
|
|
338
|
+
}"
|
|
449
339
|
:file-list="model[item.sourceId]"
|
|
450
340
|
:action="`${action}/v3/upload`"
|
|
451
|
-
@success="
|
|
341
|
+
@success="
|
|
342
|
+
e => {
|
|
343
|
+
handleFileChange(e, item)
|
|
344
|
+
}
|
|
345
|
+
"
|
|
452
346
|
/>
|
|
453
347
|
</wd-form-item>
|
|
454
348
|
<wd-form-item
|
|
@@ -458,15 +352,10 @@ defineExpose({
|
|
|
458
352
|
:title="item.title"
|
|
459
353
|
:style="{ display: item.title?.includes('y') ? 'none' : null }"
|
|
460
354
|
>
|
|
461
|
-
<
|
|
355
|
+
<WuiSelectPopup v-model="model[item.sourceId]" :source-id="item.sourceId" :title="item.title" :ext-control-type="Number(item.max) === 1 ? 'relselect' : 'ss'" :readonly="item.disabled || item.rowEditType === 'readonly'" :clearable="!item.disabled" :default-select-first="!!item.defaultSelectFirst" />
|
|
462
356
|
</wd-form-item>
|
|
463
|
-
<wd-form-item
|
|
464
|
-
v-
|
|
465
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
466
|
-
:prop="item.sourceId"
|
|
467
|
-
:title="item.title"
|
|
468
|
-
>
|
|
469
|
-
<mulselectPicker v-model="model[item.sourceId]" :source-id="item.sourceId" :title="item.title" :ext-control-type="item.extControlType " :readonly="item.disabled || item.rowEditType === 'readonly'" :clearable="!item.disabled" />
|
|
357
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relselectvalue'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
358
|
+
<WuiSelectPopup v-model="model[item.sourceId]" :source-id="item.sourceId" :title="item.title" :ext-control-type="item.extControlType" :readonly="item.disabled || item.rowEditType === 'readonly'" :clearable="!item.disabled" :default-select-first="!!item.defaultSelectFirst" />
|
|
470
359
|
</wd-form-item>
|
|
471
360
|
<wd-form-item
|
|
472
361
|
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'tree-entity-select' || ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'table-entity-select'"
|
|
@@ -474,42 +363,22 @@ defineExpose({
|
|
|
474
363
|
:prop="item.sourceId"
|
|
475
364
|
:title="item.title"
|
|
476
365
|
>
|
|
477
|
-
<
|
|
366
|
+
<WuiSelectPopup v-model="model[item.sourceId]" :source-id="item.sourceId" :title="item.title" :ext-control-type="Number(item.max) === 1 ? 'relselect' : 'ss'" :readonly="item.disabled || item.rowEditType === 'readonly'" :clearable="!item.disabled" :default-select-first="!!item.defaultSelectFirst" fold-card-model="complex" />
|
|
478
367
|
</wd-form-item>
|
|
479
368
|
<!-- done -->
|
|
480
|
-
<wd-form-item
|
|
481
|
-
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'int'"
|
|
482
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
483
|
-
:prop="item.sourceId"
|
|
484
|
-
:title="item.title"
|
|
485
|
-
>
|
|
369
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'int'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
486
370
|
<view style="text-align: left">
|
|
487
371
|
<wd-input-number v-model="model[item.sourceId]" :disabled="item.disabled || item.rowEditType === 'readonly'" :min="Number(item.min || 0)" :max="Number(item.max || Infinity)" />
|
|
488
372
|
</view>
|
|
489
373
|
</wd-form-item>
|
|
490
|
-
<wd-form-item
|
|
491
|
-
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'QRCode'"
|
|
492
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
493
|
-
:prop="item.sourceId"
|
|
494
|
-
:title="item.title"
|
|
495
|
-
>
|
|
374
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'QRCode'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
496
375
|
<scanInput v-model="model[item.sourceId]" :disabled="item.disabled || item.rowEditType === 'readonly'" />
|
|
497
376
|
</wd-form-item>
|
|
498
|
-
|
|
499
|
-
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'progress'"
|
|
500
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
501
|
-
:prop="item.sourceId"
|
|
502
|
-
:title="item.title"
|
|
503
|
-
>
|
|
377
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'progress'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
504
378
|
<wd-rate v-model="model[item.sourceId]" :disabled="item.disabled || item.rowEditType === 'readonly'" />
|
|
505
379
|
</wd-form-item>
|
|
506
380
|
<!-- done -->
|
|
507
|
-
<wd-form-item
|
|
508
|
-
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'yes-no-switch'"
|
|
509
|
-
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
510
|
-
:prop="item.sourceId"
|
|
511
|
-
:title="item.title"
|
|
512
|
-
>
|
|
381
|
+
<wd-form-item v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'yes-no-switch'" :class="{ 'no-border-top': fields.indexOf(item) === 0 }" :prop="item.sourceId" :title="item.title">
|
|
513
382
|
<view style="text-align: left">
|
|
514
383
|
<wd-switch v-model="model[item.sourceId]" size="16" :disabled="item.disabled || item.rowEditType === 'readonly'" active-value="是" inactive-value="否" />
|
|
515
384
|
</view>
|
|
@@ -522,24 +391,23 @@ defineExpose({
|
|
|
522
391
|
|
|
523
392
|
<style scoped>
|
|
524
393
|
.custom-from-style {
|
|
394
|
+
:deep(.custom-radio) {
|
|
395
|
+
display: flex;
|
|
396
|
+
padding: 4px;
|
|
397
|
+
}
|
|
525
398
|
|
|
526
|
-
:deep(.
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
:
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
border-top
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
width:calc(100% - 12px);
|
|
539
|
-
}
|
|
540
|
-
:deep(.no-border-top){
|
|
541
|
-
border-top: none;
|
|
542
|
-
}
|
|
399
|
+
:deep(.wd-form-item .wd-cell__wrapper) {
|
|
400
|
+
gap: 12px;
|
|
401
|
+
}
|
|
402
|
+
:deep(.wd-form-item) {
|
|
403
|
+
border-top: 0.6px solid #e8e8e8;
|
|
404
|
+
padding: 12px 6px;
|
|
405
|
+
margin: auto 6px;
|
|
406
|
+
width: calc(100% - 12px);
|
|
407
|
+
}
|
|
408
|
+
:deep(.no-border-top) {
|
|
409
|
+
border-top: none;
|
|
410
|
+
}
|
|
543
411
|
}
|
|
544
412
|
:deep(.disabled-input) {
|
|
545
413
|
background-color: #e8e8e8 !important;
|
|
@@ -17,6 +17,7 @@ const props = defineProps<{
|
|
|
17
17
|
index: number
|
|
18
18
|
}>()
|
|
19
19
|
const { primary } = useManualTheme()
|
|
20
|
+
const showDetail=ref(false)
|
|
20
21
|
const clums = computed(() => {
|
|
21
22
|
return props.exhibitData.filter(item => !item.title?.includes('y'))
|
|
22
23
|
})
|
|
@@ -91,4 +92,39 @@ function isControlType(item: Columns): string {
|
|
|
91
92
|
<openValueMore v-else :text="formatItemData(data.fieldMap[item.sourceId], isControlType(item)) " />
|
|
92
93
|
</view>
|
|
93
94
|
<VideoPlay ref="videoPlayRef" />
|
|
95
|
+
<wd-popup v-model="showDetail" custom-style="border-radius: 32rpx;" >
|
|
96
|
+
<view class="custom-popup">
|
|
97
|
+
<view class="text-center mb-4">详情内容</view>
|
|
98
|
+
<view class="flex items-center gap-2 mb-4 text-[#6b7280]" v-for="(item, sindex) in exhibitData" :key="sindex">
|
|
99
|
+
<view class=" whitespace-nowrap">
|
|
100
|
+
{{ item.title }}:
|
|
101
|
+
</view>
|
|
102
|
+
<view class="text-[#1f2937]">
|
|
103
|
+
{{ formatItemData(data.fieldMap[item.sourceId], isControlType(item)) }}
|
|
104
|
+
</view>
|
|
105
|
+
|
|
106
|
+
</view>
|
|
107
|
+
<view class="footer flex justify-center items-center">
|
|
108
|
+
<wd-button class="flex-1" @click="showDetail = false">确定</wd-button>
|
|
109
|
+
</view>
|
|
110
|
+
</view>
|
|
111
|
+
</wd-popup>
|
|
94
112
|
</template>
|
|
113
|
+
|
|
114
|
+
<style scoped lang="scss">
|
|
115
|
+
.custom-popup {
|
|
116
|
+
color: black;
|
|
117
|
+
padding: 24rpx;
|
|
118
|
+
min-width: 400rpx;
|
|
119
|
+
min-height: 500rpx;
|
|
120
|
+
// height: 600rpx;
|
|
121
|
+
font-size: 40rpx;
|
|
122
|
+
border-radius: 32rpx;
|
|
123
|
+
position:relative;
|
|
124
|
+
.footer{
|
|
125
|
+
position: absolute;
|
|
126
|
+
bottom: 24rpx;
|
|
127
|
+
width: calc(100% - 48rpx);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
</style>
|
|
@@ -301,6 +301,9 @@ async function save() {
|
|
|
301
301
|
if (editEvent.value)
|
|
302
302
|
uni.$emit(editEvent.value, res.entityCode)
|
|
303
303
|
|
|
304
|
+
// ★ 通知 wui-select-popup 刷新列表数据
|
|
305
|
+
uni.$emit('selectPopup:refresh', sourceId.value)
|
|
306
|
+
|
|
304
307
|
subLoading.value = false
|
|
305
308
|
router.back()
|
|
306
309
|
}).catch((error: any) => {
|