wui-components-v2 1.1.66 → 1.1.67
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.
|
@@ -61,19 +61,22 @@ function edit() {
|
|
|
61
61
|
const sourceData = props.item.classEditConfigs.find((item: ClassEditConfigs) => {
|
|
62
62
|
return item.preposes[0].transDefaultValue.includes(props.data.fieldMap[item.preposes[0].sourceId])
|
|
63
63
|
})
|
|
64
|
-
router.push(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
router.push(
|
|
65
|
+
`/pages/edit-page/index?sourceId=${sourceData?.id || props.sourceId}&id=${props.code}&title=${props.item.title}&pageType=${props.pageType}&addEvent=${props.addEvent}`
|
|
66
|
+
)
|
|
67
|
+
} else {
|
|
68
|
+
router.push(
|
|
69
|
+
`/pages/edit-page/index?sourceId=${props.sourceId}&id=${props.code}&title=${props.item.title}&pageType=${props.pageType}&addEvent=${props.addEvent}`
|
|
70
|
+
)
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
const actionItem = ref<Groups>()
|
|
72
|
-
const actionItemShow = ref(false)// rowActions输入弹框开关
|
|
73
|
-
const showMoreButn = ref(false)// 更多按钮开关
|
|
75
|
+
const actionItemShow = ref(false) // rowActions输入弹框开关
|
|
76
|
+
const showMoreButn = ref(false) // 更多按钮开关
|
|
74
77
|
// 打开rowActions弹框
|
|
75
78
|
async function action(subitem: rowActions) {
|
|
76
|
-
console.log(subitem)
|
|
79
|
+
console.log(subitem, 2222222222222222)
|
|
77
80
|
if (subitem.writes.length) {
|
|
78
81
|
actionItem.value = {
|
|
79
82
|
...props.item,
|
|
@@ -81,14 +84,12 @@ async function action(subitem: rowActions) {
|
|
|
81
84
|
id: subitem.id,
|
|
82
85
|
}
|
|
83
86
|
actionItemShow.value = true
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
87
|
+
} else {
|
|
86
88
|
try {
|
|
87
89
|
await actionDataSave(subitem.id, props.code, {})
|
|
88
90
|
props.zpaging.reload()
|
|
89
91
|
toast.success({ msg: '操作成功!' })
|
|
90
|
-
}
|
|
91
|
-
catch (error: any) {
|
|
92
|
+
} catch (error: any) {
|
|
92
93
|
toast.error(error)
|
|
93
94
|
console.log(error)
|
|
94
95
|
}
|
|
@@ -97,7 +98,9 @@ async function action(subitem: rowActions) {
|
|
|
97
98
|
|
|
98
99
|
// 跳转raction页面
|
|
99
100
|
function raction(subitem: rowActions) {
|
|
100
|
-
router.push(
|
|
101
|
+
router.push(
|
|
102
|
+
`/pages/list/index?sourceId=${subitem.id}&mainCode=${props.code}&title=${subitem.title}&pageType=${props.pageType}`
|
|
103
|
+
)
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
// 跳转详情页面
|
|
@@ -121,7 +124,10 @@ function isShowAction(item: rowActions) {
|
|
|
121
124
|
}
|
|
122
125
|
|
|
123
126
|
function isControlType(item: Columns): string {
|
|
124
|
-
return ControlTypeSupportor.getControlType(
|
|
127
|
+
return ControlTypeSupportor.getControlType(
|
|
128
|
+
{ ...item, hidden: false, disabled: false, defaultValue: '', transDefaultValue: '', required: false },
|
|
129
|
+
props.data.fieldMap[item.sourceId]
|
|
130
|
+
)
|
|
125
131
|
}
|
|
126
132
|
|
|
127
133
|
// 删除
|
|
@@ -137,15 +143,12 @@ function del() {
|
|
|
137
143
|
toast.success({ msg: '删除成功!' })
|
|
138
144
|
}
|
|
139
145
|
message.close()
|
|
140
|
-
}
|
|
141
|
-
catch (error) {
|
|
146
|
+
} catch (error) {
|
|
142
147
|
console.log(error)
|
|
143
|
-
}
|
|
144
|
-
finally {
|
|
148
|
+
} finally {
|
|
145
149
|
resolve(true)
|
|
146
150
|
}
|
|
147
151
|
},
|
|
148
|
-
|
|
149
152
|
})
|
|
150
153
|
}
|
|
151
154
|
|
|
@@ -157,7 +160,7 @@ interface Morebutns extends Omit<rowActions, ''> {
|
|
|
157
160
|
const morebutns = computed(() => {
|
|
158
161
|
let buts: Morebutns[] = []
|
|
159
162
|
if (props.rowActions) {
|
|
160
|
-
buts = anctions.value.map(
|
|
163
|
+
buts = anctions.value.map(item => {
|
|
161
164
|
return {
|
|
162
165
|
actionType: 'rowActions',
|
|
163
166
|
name: item.title,
|
|
@@ -167,26 +170,24 @@ const morebutns = computed(() => {
|
|
|
167
170
|
}
|
|
168
171
|
if (props.ractions) {
|
|
169
172
|
buts = buts.concat(
|
|
170
|
-
ractions.value.map(
|
|
173
|
+
ractions.value.map(item => {
|
|
171
174
|
return {
|
|
172
175
|
actionType: 'ractions',
|
|
173
176
|
name: item.title,
|
|
174
177
|
...item,
|
|
175
178
|
}
|
|
176
|
-
})
|
|
177
|
-
|
|
179
|
+
})
|
|
178
180
|
)
|
|
179
181
|
}
|
|
180
182
|
if (props.actions) {
|
|
181
183
|
buts = buts.concat(
|
|
182
|
-
actions.value.map(
|
|
184
|
+
actions.value.map(item => {
|
|
183
185
|
return {
|
|
184
186
|
actionType: 'rowActions',
|
|
185
187
|
name: item.title,
|
|
186
188
|
...item,
|
|
187
189
|
}
|
|
188
|
-
})
|
|
189
|
-
|
|
190
|
+
})
|
|
190
191
|
)
|
|
191
192
|
}
|
|
192
193
|
return buts
|
|
@@ -199,6 +200,9 @@ function closeMoreButn() {
|
|
|
199
200
|
|
|
200
201
|
// 点击更多按钮
|
|
201
202
|
function select({ item }: { item: any }) {
|
|
203
|
+
if (item.title.includes('评价') && item.actionType === 'rowActions') {
|
|
204
|
+
return action(item)
|
|
205
|
+
}
|
|
202
206
|
message.confirm({
|
|
203
207
|
msg: `确定${item.title}操作吗?`,
|
|
204
208
|
title: '提示',
|
|
@@ -212,6 +216,7 @@ function select({ item }: { item: any }) {
|
|
|
212
216
|
},
|
|
213
217
|
})
|
|
214
218
|
}
|
|
219
|
+
console.log(props, '3333333333333')
|
|
215
220
|
</script>
|
|
216
221
|
|
|
217
222
|
<template>
|
|
@@ -227,28 +232,46 @@ function select({ item }: { item: any }) {
|
|
|
227
232
|
</wd-button>
|
|
228
233
|
</view> -->
|
|
229
234
|
<view>
|
|
230
|
-
<wd-button
|
|
235
|
+
<wd-button
|
|
236
|
+
v-if="morebutns.length > 3"
|
|
237
|
+
size="small"
|
|
238
|
+
type="info"
|
|
239
|
+
@click="
|
|
240
|
+
() => {
|
|
241
|
+
showMoreButn = true
|
|
242
|
+
}
|
|
243
|
+
"
|
|
244
|
+
>
|
|
231
245
|
更多
|
|
232
246
|
</wd-button>
|
|
233
247
|
<view v-else class="flex gap-2 flex-wrap">
|
|
234
|
-
<wd-button
|
|
248
|
+
<wd-button
|
|
249
|
+
v-for="subitem in morebutns"
|
|
250
|
+
:key="subitem.id"
|
|
251
|
+
plain
|
|
252
|
+
size="small"
|
|
253
|
+
@click="
|
|
254
|
+
() => {
|
|
255
|
+
select({ item: subitem })
|
|
256
|
+
}
|
|
257
|
+
"
|
|
258
|
+
>
|
|
235
259
|
{{ subitem.title }}
|
|
236
260
|
</wd-button>
|
|
237
261
|
</view>
|
|
238
262
|
</view>
|
|
239
263
|
|
|
240
|
-
<wd-button v-if="props.item.buttons.includes('dtmplEdit')" size="small" @click="edit()">
|
|
241
|
-
|
|
242
|
-
</wd-button>
|
|
243
|
-
<wd-button v-if="props.item.buttons.includes('detail')" size="small" type="info" @click="detail()">
|
|
244
|
-
详情
|
|
245
|
-
</wd-button>
|
|
264
|
+
<wd-button v-if="props.item.buttons.includes('dtmplEdit')" size="small" @click="edit()">编辑</wd-button>
|
|
265
|
+
<wd-button v-if="props.item.buttons.includes('detail')" size="small" type="info" @click="detail()">详情</wd-button>
|
|
246
266
|
<wd-button v-if="props.item.buttons.includes('singleDelete')" size="small" type="danger" @click="del()">
|
|
247
267
|
删除
|
|
248
268
|
</wd-button>
|
|
249
269
|
<ActionPopup
|
|
250
|
-
v-model:show="actionItemShow"
|
|
251
|
-
:
|
|
270
|
+
v-model:show="actionItemShow"
|
|
271
|
+
:enum-column="props.enumColumn"
|
|
272
|
+
:zpaging="props.zpaging"
|
|
273
|
+
:field-group="actionItem"
|
|
274
|
+
:code="props.code"
|
|
252
275
|
/>
|
|
253
276
|
<!-- 更多按钮 -->
|
|
254
277
|
<wd-action-sheet v-model="showMoreButn" :actions="morebutns" @close="closeMoreButn" @select="select" />
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import { onLoad } from '@dcloudio/uni-app'
|
|
4
|
+
import { detailPageConfig, detailPageData, pageConfig as OperationPageConfig, actionDataSave } from '../../api/page'
|
|
5
|
+
import type { Entities, Groups, dtmplConfig, rowActions } from '../../type'
|
|
6
|
+
import LabelValue from '../label-value/label-value.vue'
|
|
7
|
+
import ActionPopup from '../action-popup/action-popup.vue'
|
|
8
|
+
import { useGlobalToast } from '../../composables/useGlobalToast'
|
|
9
|
+
|
|
10
|
+
defineOptions({
|
|
11
|
+
name: 'EvaluationPage',
|
|
12
|
+
})
|
|
13
|
+
const toast = useGlobalToast()
|
|
14
|
+
const sourceId = ref('')
|
|
15
|
+
const id = ref('')
|
|
16
|
+
const title = ref('')
|
|
17
|
+
const pageConfig = ref<dtmplConfig>({
|
|
18
|
+
id: '',
|
|
19
|
+
title: '',
|
|
20
|
+
groups: [],
|
|
21
|
+
entity: {} as any,
|
|
22
|
+
buttons: [],
|
|
23
|
+
})
|
|
24
|
+
const data = ref<Entities>({
|
|
25
|
+
code: '',
|
|
26
|
+
fieldMap: {},
|
|
27
|
+
arrayMap: {},
|
|
28
|
+
})
|
|
29
|
+
const groups = ref<Groups>({
|
|
30
|
+
id: '',
|
|
31
|
+
buttons: ['detail'],
|
|
32
|
+
fields: [],
|
|
33
|
+
title: '',
|
|
34
|
+
type: '',
|
|
35
|
+
pointSourceId: '',
|
|
36
|
+
mstrucId: '',
|
|
37
|
+
relationNames: [],
|
|
38
|
+
readOnly: false,
|
|
39
|
+
displayConfig: [],
|
|
40
|
+
})
|
|
41
|
+
const loading = ref(false)
|
|
42
|
+
// 折叠面板
|
|
43
|
+
const collapses = ref()
|
|
44
|
+
// 评价操作配置
|
|
45
|
+
const evaluationActions = ref<rowActions[]>([])
|
|
46
|
+
onLoad((option: any) => {
|
|
47
|
+
sourceId.value = option.sourceId
|
|
48
|
+
id.value = option.id
|
|
49
|
+
// #ifdef MP-WEIXIN
|
|
50
|
+
const q = decodeURIComponent(option.q) // 获取到二维码原始链接内容
|
|
51
|
+
const sc: any = getQueryParams(q)
|
|
52
|
+
sourceId.value = sc.sourceId || option.sourceId
|
|
53
|
+
id.value = sc.id || option.id
|
|
54
|
+
// #endif
|
|
55
|
+
title.value = option.title
|
|
56
|
+
uni.setNavigationBarTitle({
|
|
57
|
+
title: `${option.title}`,
|
|
58
|
+
})
|
|
59
|
+
getPageConfig()
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
// 将 URL 中问号后面的参数转换为对象
|
|
63
|
+
function getQueryParams(url: string) {
|
|
64
|
+
// 获取问号后面的部分
|
|
65
|
+
const queryString = url.split('?')[1]
|
|
66
|
+
|
|
67
|
+
if (!queryString) {
|
|
68
|
+
return {}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// 将参数字符串分割成键值对数组
|
|
72
|
+
const pairs = queryString.split('&')
|
|
73
|
+
|
|
74
|
+
// 创建结果对象
|
|
75
|
+
const result: { [key: string]: string } = {}
|
|
76
|
+
|
|
77
|
+
// 遍历键值对
|
|
78
|
+
pairs.forEach(pair => {
|
|
79
|
+
const [key, value] = pair.split('=')
|
|
80
|
+
// 解码URI组件并添加到结果对象
|
|
81
|
+
result[decodeURIComponent(key)] = decodeURIComponent(value || '')
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
return result
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// 获取页面配置
|
|
88
|
+
async function getPageConfig() {
|
|
89
|
+
try {
|
|
90
|
+
loading.value = true
|
|
91
|
+
const res = await detailPageConfig(sourceId.value)
|
|
92
|
+
// 初始化折叠面板
|
|
93
|
+
if (res.dtmplConfig) {
|
|
94
|
+
uni.setNavigationBarTitle({
|
|
95
|
+
title: `${res.dtmplConfig.title}`,
|
|
96
|
+
})
|
|
97
|
+
pageConfig.value = res.dtmplConfig
|
|
98
|
+
collapses.value = pageConfig.value.groups.map((item: Groups) => {
|
|
99
|
+
return item.id
|
|
100
|
+
})
|
|
101
|
+
getDetailData()
|
|
102
|
+
getOperationPageConfig()
|
|
103
|
+
}
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.log(error)
|
|
106
|
+
loading.value = false
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// 获取详情数据
|
|
111
|
+
async function getDetailData() {
|
|
112
|
+
try {
|
|
113
|
+
const res = await detailPageData(sourceId.value, id.value)
|
|
114
|
+
data.value = res.entity
|
|
115
|
+
loading.value = false
|
|
116
|
+
} catch (error) {
|
|
117
|
+
loading.value = false
|
|
118
|
+
console.log(error)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async function getOperationPageConfig() {
|
|
122
|
+
try {
|
|
123
|
+
const res: any = await OperationPageConfig(sourceId.value)
|
|
124
|
+
// 筛选出评价相关的操作
|
|
125
|
+
if (res.ltmplConfig?.rowActions) {
|
|
126
|
+
evaluationActions.value = res.ltmplConfig.rowActions.filter((item: rowActions) => item.title.includes('评价'))
|
|
127
|
+
}
|
|
128
|
+
console.log(res, '222222222')
|
|
129
|
+
} catch (error) {
|
|
130
|
+
console.log(error)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const actionItemShow = ref(false)
|
|
135
|
+
const actionItem = ref<Groups>()
|
|
136
|
+
const code = ref('')
|
|
137
|
+
const enumColumn = ref()
|
|
138
|
+
// 模拟 zpaging 对象,用于 ActionPopup 刷新
|
|
139
|
+
const mockZpaging = {
|
|
140
|
+
reload: () => getDetailData(),
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// 评价按钮点击事件 - 迁移自 card-botom-buttons 的 select action 功能
|
|
144
|
+
async function handleEvaluationClick() {
|
|
145
|
+
if (evaluationActions.value.length === 0) {
|
|
146
|
+
toast.error({ msg: '未找到评价操作配置' })
|
|
147
|
+
return
|
|
148
|
+
}
|
|
149
|
+
// 取第一个评价操作
|
|
150
|
+
const subitem = evaluationActions.value[0]
|
|
151
|
+
if (subitem.writes.length) {
|
|
152
|
+
actionItem.value = {
|
|
153
|
+
...groups.value,
|
|
154
|
+
fields: subitem.writes,
|
|
155
|
+
id: subitem.id,
|
|
156
|
+
}
|
|
157
|
+
code.value = id.value
|
|
158
|
+
actionItemShow.value = true
|
|
159
|
+
} else {
|
|
160
|
+
try {
|
|
161
|
+
await actionDataSave(subitem.id, id.value, {})
|
|
162
|
+
toast.success({ msg: '评价成功!' })
|
|
163
|
+
} catch (error: any) {
|
|
164
|
+
toast.error(error)
|
|
165
|
+
console.log(error)
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
</script>
|
|
170
|
+
|
|
171
|
+
<template>
|
|
172
|
+
<view class="p-4">
|
|
173
|
+
<view v-if="loading" class="flex justify-center p-3">
|
|
174
|
+
<wd-loading />
|
|
175
|
+
</view>
|
|
176
|
+
<view v-else>
|
|
177
|
+
<view v-for="(group, index) in pageConfig.groups" :key="group.id" :title="group.title" :name="group.id">
|
|
178
|
+
<view class="text-sm space-y-3">
|
|
179
|
+
<LabelValue :index="index" :exhibit-data="group.fields" :data="data" />
|
|
180
|
+
</view>
|
|
181
|
+
</view>
|
|
182
|
+
</view>
|
|
183
|
+
<wd-button type="primary" class="mt-4 w-full" @click="handleEvaluationClick">评价</wd-button>
|
|
184
|
+
<ActionPopup
|
|
185
|
+
v-model:show="actionItemShow"
|
|
186
|
+
:enum-column="enumColumn"
|
|
187
|
+
:zpaging="mockZpaging"
|
|
188
|
+
:field-group="actionItem"
|
|
189
|
+
:code="code"
|
|
190
|
+
/>
|
|
191
|
+
</view>
|
|
192
|
+
</template>
|
|
@@ -69,16 +69,26 @@ function initFormData() {
|
|
|
69
69
|
const models: { [key: string]: any } = {}
|
|
70
70
|
props.fieldGroup?.fields.forEach((item: Fields) => {
|
|
71
71
|
// 树、多选
|
|
72
|
-
if (
|
|
73
|
-
|
|
72
|
+
if (
|
|
73
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'tree-entity-select' ||
|
|
74
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'multiselect'
|
|
75
|
+
) {
|
|
76
|
+
return (models[item.sourceId] =
|
|
77
|
+
(props.entity && props.entity[item.sourceId]?.split(',')) || item.transDefaultValue || [])
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
if (ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relselect') {
|
|
77
|
-
return (models[item.sourceId] =
|
|
81
|
+
return (models[item.sourceId] =
|
|
82
|
+
(props.entity && props.entity[item.sourceId]?.split('@,@')) ||
|
|
83
|
+
(item.transDefaultValue && item.transDefaultValue?.split('@,@')) ||
|
|
84
|
+
[])
|
|
78
85
|
}
|
|
79
86
|
|
|
80
87
|
// 文件
|
|
81
|
-
if (
|
|
88
|
+
if (
|
|
89
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'file' ||
|
|
90
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relfile'
|
|
91
|
+
) {
|
|
82
92
|
if (props.entity && typeof props.entity[item.sourceId] === 'object') {
|
|
83
93
|
return (models[item.sourceId] = [props.entity[item.sourceId]])
|
|
84
94
|
}
|
|
@@ -99,8 +109,14 @@ function initFormData() {
|
|
|
99
109
|
}
|
|
100
110
|
|
|
101
111
|
// 时间
|
|
102
|
-
if (
|
|
103
|
-
|
|
112
|
+
if (
|
|
113
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'datetime' ||
|
|
114
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'date'
|
|
115
|
+
) {
|
|
116
|
+
return (models[item.sourceId] =
|
|
117
|
+
(props.entity && dayjs(props.entity[item.sourceId]).valueOf()) ||
|
|
118
|
+
(item.transDefaultValue && dayjs(item.transDefaultValue).valueOf()) ||
|
|
119
|
+
null)
|
|
104
120
|
}
|
|
105
121
|
|
|
106
122
|
// 评分
|
|
@@ -241,7 +257,10 @@ function submit() {
|
|
|
241
257
|
if (item.sourceId === key) {
|
|
242
258
|
if (ControlTypeSupportor.getControlType(item) === 'file') {
|
|
243
259
|
data[key] = toRaw(model.value[key][0])
|
|
244
|
-
} else if (
|
|
260
|
+
} else if (
|
|
261
|
+
ControlTypeSupportor.getControlType(item) === 'relselect' ||
|
|
262
|
+
ControlTypeSupportor.getControlType(item) === 'tree-entity-select'
|
|
263
|
+
) {
|
|
245
264
|
if (Array.isArray(model.value[key])) {
|
|
246
265
|
data[key] = model.value[key].join('@,@')
|
|
247
266
|
} else {
|
|
@@ -278,47 +297,185 @@ defineExpose({
|
|
|
278
297
|
<addAddressPage v-if="props?.smartPaste" v-model="model" :group="props.fieldGroup" />
|
|
279
298
|
<view v-for="item in fields" :key="item.sourceId">
|
|
280
299
|
<view v-show="!item.title?.includes('y') && !item.hidden">
|
|
281
|
-
<wd-form-item
|
|
282
|
-
|
|
300
|
+
<wd-form-item
|
|
301
|
+
v-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'text'"
|
|
302
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
303
|
+
:prop="item.sourceId"
|
|
304
|
+
:title="item.title"
|
|
305
|
+
>
|
|
306
|
+
<wd-input
|
|
307
|
+
v-model="model[item.sourceId]"
|
|
308
|
+
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
309
|
+
:clearable="!item.disabled"
|
|
310
|
+
:placeholder="`请输入${item.title}`"
|
|
311
|
+
:class="{ 'disabled-input': item.disabled || item.rowEditType === 'readonly' }"
|
|
312
|
+
/>
|
|
283
313
|
</wd-form-item>
|
|
284
|
-
<wd-form-item
|
|
285
|
-
|
|
314
|
+
<wd-form-item
|
|
315
|
+
v-else-if="
|
|
316
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'decimal'
|
|
317
|
+
"
|
|
318
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
319
|
+
:prop="item.sourceId"
|
|
320
|
+
:title="item.title"
|
|
321
|
+
>
|
|
322
|
+
<wd-input
|
|
323
|
+
v-model="model[item.sourceId]"
|
|
324
|
+
type="number"
|
|
325
|
+
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
326
|
+
:clearable="!item.disabled"
|
|
327
|
+
:placeholder="`请输入${item.title}`"
|
|
328
|
+
/>
|
|
286
329
|
</wd-form-item>
|
|
287
|
-
<wd-form-item
|
|
288
|
-
|
|
330
|
+
<wd-form-item
|
|
331
|
+
v-else-if="
|
|
332
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'password'
|
|
333
|
+
"
|
|
334
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
335
|
+
:prop="item.sourceId"
|
|
336
|
+
:title="item.title"
|
|
337
|
+
>
|
|
338
|
+
<wd-input
|
|
339
|
+
v-model="model[item.sourceId]"
|
|
340
|
+
show-password
|
|
341
|
+
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
342
|
+
:clearable="!item.disabled"
|
|
343
|
+
:placeholder="`请输入${item.title}`"
|
|
344
|
+
/>
|
|
289
345
|
</wd-form-item>
|
|
290
|
-
<wd-form-item
|
|
291
|
-
|
|
346
|
+
<wd-form-item
|
|
347
|
+
v-else-if="
|
|
348
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'textarea'
|
|
349
|
+
"
|
|
350
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
351
|
+
:prop="item.sourceId"
|
|
352
|
+
:title="item.title"
|
|
353
|
+
>
|
|
354
|
+
<wd-textarea
|
|
355
|
+
v-model="model[item.sourceId]"
|
|
356
|
+
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
357
|
+
:clearable="!item.disabled"
|
|
358
|
+
:placeholder="`请输入${item.title}`"
|
|
359
|
+
auto-height
|
|
360
|
+
/>
|
|
292
361
|
</wd-form-item>
|
|
293
|
-
<wd-form-item
|
|
294
|
-
|
|
362
|
+
<wd-form-item
|
|
363
|
+
v-else-if="
|
|
364
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'select'
|
|
365
|
+
"
|
|
366
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
367
|
+
:prop="item.sourceId"
|
|
368
|
+
:title="item.title"
|
|
369
|
+
:style="{ display: item.title?.includes('y') ? 'none' : null }"
|
|
370
|
+
>
|
|
371
|
+
<customSelectPicker
|
|
372
|
+
v-model="model[item.sourceId]"
|
|
373
|
+
:placeholder="`请选择${item.title}`"
|
|
374
|
+
:columns="enumColumn && formatSelectColumns(enumColumn[item.mstrucId])"
|
|
375
|
+
type="radio"
|
|
376
|
+
/>
|
|
295
377
|
</wd-form-item>
|
|
296
378
|
<wd-form-item
|
|
297
|
-
v-else-if="
|
|
379
|
+
v-else-if="
|
|
380
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) ===
|
|
381
|
+
'relselect-extdis'
|
|
382
|
+
"
|
|
298
383
|
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
299
384
|
:prop="item.sourceId"
|
|
300
385
|
:title="item.title"
|
|
301
386
|
:style="{ display: item.title?.includes('y') ? 'none' : null }"
|
|
302
387
|
>
|
|
303
|
-
<userChoose
|
|
388
|
+
<userChoose
|
|
389
|
+
v-model="model[item.sourceId]"
|
|
390
|
+
:placeholder="`请选择${item.title}`"
|
|
391
|
+
:source-id="item.sourceId"
|
|
392
|
+
:title="item.title"
|
|
393
|
+
:add-event="addEvent"
|
|
394
|
+
:ext-control-type="item.extControlType"
|
|
395
|
+
/>
|
|
304
396
|
</wd-form-item>
|
|
305
|
-
<wd-form-item
|
|
306
|
-
|
|
397
|
+
<wd-form-item
|
|
398
|
+
v-else-if="
|
|
399
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'multiselect'
|
|
400
|
+
"
|
|
401
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
402
|
+
:prop="item.sourceId"
|
|
403
|
+
:title="item.title"
|
|
404
|
+
>
|
|
405
|
+
<customSelectPicker
|
|
406
|
+
v-model="model[item.sourceId]"
|
|
407
|
+
:placeholder="`请选择${item.title}`"
|
|
408
|
+
:columns="enumColumn && formatSelectColumns(enumColumn[item.mstrucId])"
|
|
409
|
+
type="checkbox"
|
|
410
|
+
/>
|
|
307
411
|
</wd-form-item>
|
|
308
|
-
<wd-form-item
|
|
309
|
-
|
|
412
|
+
<wd-form-item
|
|
413
|
+
v-else-if="
|
|
414
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'date'
|
|
415
|
+
"
|
|
416
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
417
|
+
:prop="item.sourceId"
|
|
418
|
+
:title="item.title"
|
|
419
|
+
>
|
|
420
|
+
<customDatePicker
|
|
421
|
+
v-model="model[item.sourceId]"
|
|
422
|
+
type="date"
|
|
423
|
+
:clearable="!item.disabled"
|
|
424
|
+
:placeholder="`请选择${item.title}`"
|
|
425
|
+
/>
|
|
310
426
|
</wd-form-item>
|
|
311
|
-
<wd-form-item
|
|
312
|
-
|
|
427
|
+
<wd-form-item
|
|
428
|
+
v-else-if="
|
|
429
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'datetime'
|
|
430
|
+
"
|
|
431
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
432
|
+
:prop="item.sourceId"
|
|
433
|
+
:title="item.title"
|
|
434
|
+
>
|
|
435
|
+
<customDatePicker
|
|
436
|
+
v-model="model[item.sourceId]"
|
|
437
|
+
type="datetime"
|
|
438
|
+
:clearable="!item.disabled"
|
|
439
|
+
:placeholder="`请选择${item.title}`"
|
|
440
|
+
/>
|
|
313
441
|
</wd-form-item>
|
|
314
|
-
<wd-form-item
|
|
315
|
-
|
|
442
|
+
<wd-form-item
|
|
443
|
+
v-else-if="
|
|
444
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'time'
|
|
445
|
+
"
|
|
446
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
447
|
+
:prop="item.sourceId"
|
|
448
|
+
:title="item.title"
|
|
449
|
+
>
|
|
450
|
+
<customDatePicker
|
|
451
|
+
v-model="model[item.sourceId]"
|
|
452
|
+
type="time"
|
|
453
|
+
use-second
|
|
454
|
+
:clearable="!item.disabled"
|
|
455
|
+
:placeholder="`请选择${item.title}`"
|
|
456
|
+
/>
|
|
316
457
|
</wd-form-item>
|
|
317
|
-
<wd-form-item
|
|
318
|
-
|
|
458
|
+
<wd-form-item
|
|
459
|
+
v-else-if="
|
|
460
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'date-YY'
|
|
461
|
+
"
|
|
462
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
463
|
+
:prop="item.sourceId"
|
|
464
|
+
:title="item.title"
|
|
465
|
+
>
|
|
466
|
+
<customDatePicker
|
|
467
|
+
v-model="model[item.sourceId]"
|
|
468
|
+
type="year"
|
|
469
|
+
use-second
|
|
470
|
+
:clearable="!item.disabled"
|
|
471
|
+
:placeholder="`请选择${item.title}`"
|
|
472
|
+
/>
|
|
319
473
|
</wd-form-item>
|
|
320
474
|
<wd-form-item
|
|
321
|
-
v-else-if="
|
|
475
|
+
v-else-if="
|
|
476
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'file' ||
|
|
477
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relfile'
|
|
478
|
+
"
|
|
322
479
|
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
323
480
|
:prop="item.sourceId"
|
|
324
481
|
:title="item.title"
|
|
@@ -346,41 +503,122 @@ defineExpose({
|
|
|
346
503
|
/>
|
|
347
504
|
</wd-form-item>
|
|
348
505
|
<wd-form-item
|
|
349
|
-
v-else-if="
|
|
506
|
+
v-else-if="
|
|
507
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relselect'
|
|
508
|
+
"
|
|
350
509
|
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
351
510
|
:prop="item.sourceId"
|
|
352
511
|
:title="item.title"
|
|
353
512
|
:style="{ display: item.title?.includes('y') ? 'none' : null }"
|
|
354
513
|
>
|
|
355
|
-
<WuiSelectPopup
|
|
514
|
+
<WuiSelectPopup
|
|
515
|
+
v-model="model[item.sourceId]"
|
|
516
|
+
:source-id="item.sourceId"
|
|
517
|
+
:title="item.title"
|
|
518
|
+
:ext-control-type="Number(item.max) === 1 ? 'relselect' : 'ss'"
|
|
519
|
+
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
520
|
+
:clearable="!item.disabled"
|
|
521
|
+
:default-select-first="!!item.defaultSelectFirst"
|
|
522
|
+
/>
|
|
356
523
|
</wd-form-item>
|
|
357
|
-
<wd-form-item
|
|
358
|
-
|
|
524
|
+
<wd-form-item
|
|
525
|
+
v-else-if="
|
|
526
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) ===
|
|
527
|
+
'relselectvalue'
|
|
528
|
+
"
|
|
529
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
530
|
+
:prop="item.sourceId"
|
|
531
|
+
:title="item.title"
|
|
532
|
+
>
|
|
533
|
+
<WuiSelectPopup
|
|
534
|
+
v-model="model[item.sourceId]"
|
|
535
|
+
:source-id="item.sourceId"
|
|
536
|
+
:title="item.title"
|
|
537
|
+
:ext-control-type="item.extControlType"
|
|
538
|
+
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
539
|
+
:clearable="!item.disabled"
|
|
540
|
+
:default-select-first="!!item.defaultSelectFirst"
|
|
541
|
+
/>
|
|
359
542
|
</wd-form-item>
|
|
360
543
|
<wd-form-item
|
|
361
|
-
v-else-if="
|
|
544
|
+
v-else-if="
|
|
545
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) ===
|
|
546
|
+
'tree-entity-select' ||
|
|
547
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) ===
|
|
548
|
+
'table-entity-select'
|
|
549
|
+
"
|
|
362
550
|
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
363
551
|
:prop="item.sourceId"
|
|
364
552
|
:title="item.title"
|
|
365
553
|
>
|
|
366
|
-
<WuiSelectPopup
|
|
554
|
+
<WuiSelectPopup
|
|
555
|
+
v-model="model[item.sourceId]"
|
|
556
|
+
:source-id="item.sourceId"
|
|
557
|
+
:title="item.title"
|
|
558
|
+
:ext-control-type="Number(item.max) === 1 ? 'relselect' : 'ss'"
|
|
559
|
+
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
560
|
+
:clearable="!item.disabled"
|
|
561
|
+
:default-select-first="!!item.defaultSelectFirst"
|
|
562
|
+
fold-card-model="complex"
|
|
563
|
+
/>
|
|
367
564
|
</wd-form-item>
|
|
368
565
|
<!-- done -->
|
|
369
|
-
<wd-form-item
|
|
566
|
+
<wd-form-item
|
|
567
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'int'"
|
|
568
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
569
|
+
:prop="item.sourceId"
|
|
570
|
+
:title="item.title"
|
|
571
|
+
>
|
|
370
572
|
<view style="text-align: left">
|
|
371
|
-
<wd-input-number
|
|
573
|
+
<wd-input-number
|
|
574
|
+
v-model="model[item.sourceId]"
|
|
575
|
+
:disabled="item.disabled || item.rowEditType === 'readonly'"
|
|
576
|
+
:min="Number(item.min || 0)"
|
|
577
|
+
:max="Number(item.max || Infinity)"
|
|
578
|
+
/>
|
|
372
579
|
</view>
|
|
373
580
|
</wd-form-item>
|
|
374
|
-
<wd-form-item
|
|
581
|
+
<wd-form-item
|
|
582
|
+
v-else-if="
|
|
583
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'QRCode'
|
|
584
|
+
"
|
|
585
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
586
|
+
:prop="item.sourceId"
|
|
587
|
+
:title="item.title"
|
|
588
|
+
>
|
|
375
589
|
<scanInput v-model="model[item.sourceId]" :disabled="item.disabled || item.rowEditType === 'readonly'" />
|
|
376
590
|
</wd-form-item>
|
|
377
|
-
<wd-form-item
|
|
378
|
-
|
|
591
|
+
<wd-form-item
|
|
592
|
+
v-else-if="
|
|
593
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'progress'
|
|
594
|
+
"
|
|
595
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
596
|
+
:prop="item.sourceId"
|
|
597
|
+
:title="item.title"
|
|
598
|
+
>
|
|
599
|
+
<wd-rate
|
|
600
|
+
allow-half
|
|
601
|
+
v-model="model[item.sourceId]"
|
|
602
|
+
:disabled="item.disabled || item.rowEditType === 'readonly'"
|
|
603
|
+
/>
|
|
379
604
|
</wd-form-item>
|
|
380
605
|
<!-- done -->
|
|
381
|
-
<wd-form-item
|
|
606
|
+
<wd-form-item
|
|
607
|
+
v-else-if="
|
|
608
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'yes-no-switch'
|
|
609
|
+
"
|
|
610
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
611
|
+
:prop="item.sourceId"
|
|
612
|
+
:title="item.title"
|
|
613
|
+
>
|
|
382
614
|
<view style="text-align: left">
|
|
383
|
-
<wd-switch
|
|
615
|
+
<wd-switch
|
|
616
|
+
v-model="model[item.sourceId]"
|
|
617
|
+
size="16"
|
|
618
|
+
:disabled="item.disabled || item.rowEditType === 'readonly'"
|
|
619
|
+
active-value="是"
|
|
620
|
+
inactive-value="否"
|
|
621
|
+
/>
|
|
384
622
|
</view>
|
|
385
623
|
</wd-form-item>
|
|
386
624
|
</view>
|
|
@@ -30,7 +30,7 @@ function openVideo(uitem: any) {
|
|
|
30
30
|
function isControlType(item: Columns): string {
|
|
31
31
|
return ControlTypeSupportor.getControlType(
|
|
32
32
|
{ ...item, hidden: false, disabled: false, defaultValue: '', transDefaultValue: '', required: false },
|
|
33
|
-
props.data.fieldMap[item.sourceId]
|
|
33
|
+
props.data.fieldMap?.[item.sourceId] || ''
|
|
34
34
|
)
|
|
35
35
|
}
|
|
36
36
|
</script>
|