wui-components-v2 1.1.41 → 1.1.43
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/api/feishu.ts +20 -0
- package/api/menu.ts +1 -1
- package/api/page.ts +1 -1
- package/api/sys.ts +1 -1
- package/components/add-address-list/add-address-list.vue +187 -0
- package/components/add-address-page/add-address-page.vue +76 -0
- package/components/add-address-page/config.ts +297 -0
- package/components/audio-play/audio-play.vue +3 -3
- package/components/card-botom-buttons/card-botom-buttons.vue +4 -3
- package/components/custom-date-picker/custom-date-picker.vue +114 -0
- package/components/custom-select-picker/custom-select-picker.vue +103 -0
- package/components/fold-card/fold-card.vue +16 -9
- package/components/form-control/form-control.vue +224 -143
- package/components/global-loading/global-loading.vue +1 -1
- package/components/global-message/global-message.vue +14 -10
- package/components/global-toast/global-toast.vue +1 -1
- package/components/list-top-buttons/list-top-buttons.vue +2 -2
- package/components/mulselect-picker/mulselect-picker.vue +2 -2
- package/components/privacy-popup/privacy-popup.vue +1 -1
- package/components/product-card/product-card.vue +2 -2
- package/components/search/search.vue +11 -6
- package/components/tab-search/tab-search.vue +7 -7
- package/components/user-choose/user-choose.vue +132 -0
- package/components/wui-default/wui-default.vue +1 -2
- package/components/wui-edit-page/wui-edit-page.vue +76 -53
- package/components/wui-enume-select-control/wui-enume-select-control.vue +35 -33
- package/components/wui-list/wui-list.vue +12 -8
- package/components/wui-login1/wui-login.vue +1 -1
- package/components/wui-menus1/components/banner-carousel.vue +8 -8
- package/components/wui-menus1/components/quick-panel.vue +1 -1
- package/components/wui-menus1/components/search-bar.vue +1 -1
- package/components/wui-menus1/components/section-menus.vue +1 -1
- package/components/wui-menus1/wui-menus.vue +6 -3
- package/components/wui-notify-info/notify-handle.vue +1 -1
- package/components/wui-notify-info/wui-notify-info.vue +7 -7
- package/components/wui-search-history-babbar/wui-search-history-babbar.vue +10 -10
- package/components/wui-select-list/wui-select-list.vue +48 -39
- package/components/wui-tabbar/wui-tabbar.vue +2 -2
- package/components/wui-tree-page/wui-tree-page.vue +9 -10
- package/components/wui-user/wui-user.vue +5 -5
- package/composables/types/theme.ts +1 -1
- package/composables/useCompanyFieldFilter.ts +59 -0
- package/composables/useEnumes.ts +36 -35
- package/composables/useGlobalLoading.ts +2 -2
- package/composables/useGlobalMessage.ts +7 -8
- package/composables/useGlobalToast.ts +2 -2
- package/composables/useLocale.ts +5 -5
- package/composables/useMenus.ts +1 -0
- package/composables/useTabbar.ts +2 -3
- package/index.d.ts +1 -1
- package/index.ts +2 -2
- package/package.json +1 -1
- package/store/language.ts +8 -11
- package/store/manualThemeStore.ts +2 -0
- package/store/persist.ts +1 -1
- package/type.ts +1 -0
- package/utils/control-type-supportor.ts +4 -0
- package/utils/index.ts +22 -0
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed,
|
|
3
|
-
import type {
|
|
2
|
+
import { computed, onBeforeMount, ref, toRaw } from 'vue'
|
|
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
6
|
import mulselectPicker from '../mulselect-picker/mulselect-picker.vue'
|
|
7
7
|
import ControlTypeSupportor from '../../utils/control-type-supportor'
|
|
8
|
-
|
|
8
|
+
import { useCompanyFieldFilter } from '../../composables/useCompanyFieldFilter'
|
|
9
|
+
import customSelectPicker from '../custom-select-picker/custom-select-picker.vue'
|
|
10
|
+
import CustomDatePicker from '../custom-date-picker/custom-date-picker.vue'
|
|
11
|
+
import addAddressPage from '../add-address-page/add-address-page.vue'
|
|
12
|
+
import userChoose from '../user-choose/user-choose.vue'
|
|
13
|
+
import { generateHighResolutionID } from '../../utils/index'
|
|
9
14
|
// import { enums } from '../../api/page'
|
|
10
15
|
defineOptions({
|
|
11
16
|
name: 'FormControl',
|
|
@@ -14,6 +19,9 @@ const props = defineProps<{
|
|
|
14
19
|
fieldGroup?: Groups
|
|
15
20
|
entity?: { [key: string]: string }
|
|
16
21
|
enumColumn?: Enums
|
|
22
|
+
companyFilter?: boolean
|
|
23
|
+
companyFieldSourceId?: string
|
|
24
|
+
smartPaste?: boolean
|
|
17
25
|
}>()
|
|
18
26
|
const fileTypes = [
|
|
19
27
|
{
|
|
@@ -35,12 +43,13 @@ const hydrocarbonProgramToken = ref<string>('')
|
|
|
35
43
|
const token = ref<string>('')
|
|
36
44
|
const form = ref<any>(null)
|
|
37
45
|
const model = ref<any>({})
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
const addEvent = generateHighResolutionID()// 全局事件名称
|
|
47
|
+
const { filteredFields: fields } = useCompanyFieldFilter(
|
|
48
|
+
() => props.fieldGroup,
|
|
49
|
+
model,
|
|
50
|
+
props.companyFilter, // 是否自适应显示快递公司填充框
|
|
51
|
+
props.companyFieldSourceId, // 快递公司对应字段
|
|
52
|
+
)
|
|
44
53
|
// 初始化表单数据
|
|
45
54
|
function initFormData() {
|
|
46
55
|
const models: { [key: string]: any } = {}
|
|
@@ -81,30 +90,36 @@ onBeforeMount(() => {
|
|
|
81
90
|
token.value = uni.getStorageSync('TOKEN')
|
|
82
91
|
initFormData()
|
|
83
92
|
})
|
|
93
|
+
function formatSelectColumns(columns: any) {
|
|
94
|
+
return columns.map((item: any) => {
|
|
95
|
+
return {
|
|
96
|
+
...item,
|
|
97
|
+
label: item.title,
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
}
|
|
84
101
|
|
|
85
|
-
const
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
102
|
+
const schema = computed((): FormSchema => {
|
|
103
|
+
return {
|
|
104
|
+
validate(_model: Record<string, any>): FormSchemaIssue[] {
|
|
105
|
+
const issues: FormSchemaIssue[] = []
|
|
106
|
+
props.fieldGroup?.fields.forEach((item: Fields) => {
|
|
107
|
+
if (item.required) {
|
|
108
|
+
const value = _model[item.sourceId]
|
|
92
109
|
if (Array.isArray(value) && value.length < 1) {
|
|
93
|
-
|
|
110
|
+
issues.push({ path: [item.sourceId], message: `请填写${item.title}` })
|
|
94
111
|
}
|
|
95
|
-
else {
|
|
96
|
-
|
|
97
|
-
return Promise.resolve()
|
|
98
|
-
}
|
|
99
|
-
return Promise.reject(new Error(`请填写${item.title}`))
|
|
112
|
+
else if (!value) {
|
|
113
|
+
issues.push({ path: [item.sourceId], message: `请填写${item.title}` })
|
|
100
114
|
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
return issues
|
|
118
|
+
},
|
|
119
|
+
isRequired(path: string) {
|
|
120
|
+
return props.fieldGroup?.fields.some(f => f.sourceId === path && f.required) ?? false
|
|
121
|
+
},
|
|
122
|
+
}
|
|
108
123
|
})
|
|
109
124
|
|
|
110
125
|
// 监听文件上传成功
|
|
@@ -161,175 +176,241 @@ defineExpose({
|
|
|
161
176
|
|
|
162
177
|
<template>
|
|
163
178
|
<view>
|
|
164
|
-
<wd-form ref="form" :model="model" :
|
|
165
|
-
<
|
|
166
|
-
|
|
167
|
-
|
|
179
|
+
<wd-form ref="form" :model="model" :schema="schema" error-type="toast" :label-width="120" class="custom-from-style">
|
|
180
|
+
<addAddressPage v-if="props.smartPaste" v-model="model" :group="props.fieldGroup" />
|
|
181
|
+
<view v-for="item in fields" :key="item.sourceId">
|
|
182
|
+
<view v-show="!item.title?.includes('y') && !item.hidden">
|
|
183
|
+
<wd-form-item
|
|
184
|
+
v-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'text'"
|
|
185
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
186
|
+
:prop="item.sourceId"
|
|
187
|
+
:title="item.title"
|
|
188
|
+
>
|
|
168
189
|
<wd-input
|
|
169
|
-
v-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'text'"
|
|
170
190
|
v-model="model[item.sourceId]"
|
|
171
|
-
:label="item.title"
|
|
172
|
-
label-width="100px"
|
|
173
|
-
:prop="item.sourceId"
|
|
174
191
|
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
175
192
|
:clearable="!item.disabled"
|
|
176
193
|
:placeholder="`请输入${item.title}`"
|
|
177
194
|
/>
|
|
195
|
+
</wd-form-item>
|
|
196
|
+
<wd-form-item
|
|
197
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'decimal'"
|
|
198
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
199
|
+
:prop="item.sourceId"
|
|
200
|
+
:title="item.title"
|
|
201
|
+
>
|
|
178
202
|
<wd-input
|
|
179
|
-
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'decimal'"
|
|
180
203
|
v-model="model[item.sourceId]"
|
|
181
204
|
type="number"
|
|
182
|
-
:label="item.title"
|
|
183
|
-
label-width="100px"
|
|
184
|
-
:prop="item.sourceId"
|
|
185
205
|
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
186
206
|
:clearable="!item.disabled"
|
|
187
207
|
:placeholder="`请输入${item.title}`"
|
|
188
208
|
/>
|
|
209
|
+
</wd-form-item>
|
|
210
|
+
<wd-form-item
|
|
211
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'password'"
|
|
212
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
213
|
+
:prop="item.sourceId"
|
|
214
|
+
:title="item.title"
|
|
215
|
+
>
|
|
189
216
|
<wd-input
|
|
190
|
-
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'password'"
|
|
191
217
|
v-model="model[item.sourceId]"
|
|
192
218
|
show-password
|
|
193
|
-
:label="item.title"
|
|
194
|
-
label-width="100px"
|
|
195
|
-
:prop="item.sourceId"
|
|
196
219
|
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
197
220
|
:clearable="!item.disabled"
|
|
198
221
|
:placeholder="`请输入${item.title}`"
|
|
199
222
|
/>
|
|
223
|
+
</wd-form-item>
|
|
224
|
+
<wd-form-item
|
|
225
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'textarea'"
|
|
226
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
227
|
+
:prop="item.sourceId"
|
|
228
|
+
:title="item.title"
|
|
229
|
+
>
|
|
200
230
|
<wd-textarea
|
|
201
|
-
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'textarea'"
|
|
202
231
|
v-model="model[item.sourceId]"
|
|
203
|
-
:label="item.title"
|
|
204
|
-
label-width="100px"
|
|
205
|
-
:prop="item.sourceId"
|
|
206
232
|
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
207
233
|
:clearable="!item.disabled"
|
|
208
234
|
:placeholder="`请输入${item.title}`"
|
|
209
235
|
auto-height
|
|
210
236
|
/>
|
|
211
|
-
|
|
212
|
-
|
|
237
|
+
</wd-form-item>
|
|
238
|
+
<wd-form-item
|
|
239
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'select'"
|
|
240
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
241
|
+
:prop="item.sourceId"
|
|
242
|
+
:title="item.title"
|
|
243
|
+
:style="{ display: item.title?.includes('y') ? 'none' : null }"
|
|
244
|
+
>
|
|
245
|
+
<customSelectPicker
|
|
213
246
|
v-model="model[item.sourceId]"
|
|
214
|
-
:
|
|
247
|
+
:placeholder="`请选择${item.title}`"
|
|
248
|
+
:columns="(enumColumn && formatSelectColumns(enumColumn[item.mstrucId]))"
|
|
215
249
|
type="radio"
|
|
216
|
-
:columns="(enumColumn && enumColumn[item.mstrucId])"
|
|
217
|
-
:label="item.title"
|
|
218
|
-
label-width="100px"
|
|
219
|
-
:prop="item.sourceId"
|
|
220
|
-
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
221
|
-
:clearable="!item.disabled"
|
|
222
|
-
:placeholder="`请输入${item.title}`"
|
|
223
|
-
label-key="title"
|
|
224
|
-
filterable
|
|
225
250
|
/>
|
|
226
|
-
|
|
227
|
-
|
|
251
|
+
</wd-form-item>
|
|
252
|
+
<wd-form-item
|
|
253
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relselect-extdis'"
|
|
254
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
255
|
+
:prop="item.sourceId"
|
|
256
|
+
:title="item.title"
|
|
257
|
+
:style="{ display: item.title?.includes('y') ? 'none' : null }"
|
|
258
|
+
>
|
|
259
|
+
<userChoose
|
|
228
260
|
v-model="model[item.sourceId]"
|
|
261
|
+
:placeholder="`请选择${item.title}`"
|
|
262
|
+
:source-id="item.sourceId"
|
|
263
|
+
:title="item.title"
|
|
264
|
+
:add-event="addEvent"
|
|
265
|
+
:ext-control-type="item.extControlType"
|
|
266
|
+
/>
|
|
267
|
+
</wd-form-item>
|
|
268
|
+
<wd-form-item
|
|
269
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'multiselect'"
|
|
270
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
271
|
+
:prop="item.sourceId"
|
|
272
|
+
:title="item.title"
|
|
273
|
+
>
|
|
274
|
+
<customSelectPicker
|
|
275
|
+
v-model="model[item.sourceId]"
|
|
276
|
+
:placeholder="`请选择${item.title}`"
|
|
277
|
+
:columns="(enumColumn && formatSelectColumns(enumColumn[item.mstrucId]))"
|
|
229
278
|
type="checkbox"
|
|
230
|
-
:columns="(enumColumn && enumColumn[item.mstrucId])"
|
|
231
|
-
:label="item.title"
|
|
232
|
-
label-width="100px"
|
|
233
|
-
:prop="item.sourceId"
|
|
234
|
-
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
235
|
-
:clearable="!item.disabled"
|
|
236
|
-
:placeholder="`请输入${item.title}`"
|
|
237
|
-
label-key="title"
|
|
238
|
-
filterable
|
|
239
279
|
/>
|
|
240
|
-
|
|
241
|
-
|
|
280
|
+
</wd-form-item>
|
|
281
|
+
<wd-form-item
|
|
282
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'date'"
|
|
283
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
284
|
+
:prop="item.sourceId"
|
|
285
|
+
:title="item.title"
|
|
286
|
+
>
|
|
287
|
+
<customDatePicker
|
|
242
288
|
v-model="model[item.sourceId]"
|
|
243
289
|
type="date"
|
|
244
|
-
:label="item.title"
|
|
245
|
-
label-width="100px"
|
|
246
|
-
:prop="item.sourceId"
|
|
247
|
-
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
248
290
|
:clearable="!item.disabled"
|
|
249
|
-
:placeholder="
|
|
291
|
+
:placeholder="`请选择${item.title}`"
|
|
250
292
|
/>
|
|
251
|
-
|
|
252
|
-
|
|
293
|
+
</wd-form-item>
|
|
294
|
+
<wd-form-item
|
|
295
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'datetime'"
|
|
296
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
297
|
+
:prop="item.sourceId"
|
|
298
|
+
:title="item.title"
|
|
299
|
+
>
|
|
300
|
+
<customDatePicker
|
|
253
301
|
v-model="model[item.sourceId]"
|
|
254
302
|
type="datetime"
|
|
255
|
-
:label="item.title"
|
|
256
|
-
label-width="100px"
|
|
257
|
-
:prop="item.sourceId"
|
|
258
|
-
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
259
303
|
:clearable="!item.disabled"
|
|
260
|
-
:placeholder="
|
|
304
|
+
:placeholder="`请选择${item.title}`"
|
|
261
305
|
/>
|
|
262
|
-
|
|
263
|
-
|
|
306
|
+
</wd-form-item>
|
|
307
|
+
<wd-form-item
|
|
308
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'time'"
|
|
309
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
310
|
+
:prop="item.sourceId"
|
|
311
|
+
:title="item.title"
|
|
312
|
+
>
|
|
313
|
+
<customDatePicker
|
|
264
314
|
v-model="model[item.sourceId]"
|
|
265
315
|
type="time"
|
|
266
316
|
use-second
|
|
267
|
-
:label="item.title"
|
|
268
|
-
label-width="100px"
|
|
269
|
-
:prop="item.sourceId"
|
|
270
|
-
:readonly="item.disabled || item.rowEditType === 'readonly'"
|
|
271
317
|
:clearable="!item.disabled"
|
|
272
|
-
:placeholder="
|
|
318
|
+
:placeholder="`请选择${item.title}`"
|
|
273
319
|
/>
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
</wd-radio>
|
|
279
|
-
</wd-radio-group>
|
|
280
|
-
<wd-upload
|
|
281
|
-
:accept="fileType"
|
|
282
|
-
:disabled="item.disabled || item.rowEditType === 'readonly'"
|
|
283
|
-
:limit="1"
|
|
284
|
-
:header="{ 'hydrocarbon-program-token': hydrocarbonProgramToken, 'hydrocarbon-token': token }"
|
|
285
|
-
:file-list="model[item.sourceId]"
|
|
286
|
-
:action="`${action}/v3/upload`"
|
|
287
|
-
@success="(e) => { handleFileChange(e, item) }"
|
|
288
|
-
/>
|
|
289
|
-
</wd-cell>
|
|
290
|
-
<wd-cell v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relselect'" :style="{ display: item.title?.includes('y') ? 'none' : null }" :prop="item.sourceId" :title="item.title" title-width="100px">
|
|
291
|
-
<mulselectPicker 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" />
|
|
292
|
-
</wd-cell>
|
|
293
|
-
<wd-cell v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relselectvalue'" :prop="item.sourceId" :title="item.title" title-width="100px">
|
|
294
|
-
<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" />
|
|
295
|
-
</wd-cell>
|
|
296
|
-
<wd-cell 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'" :prop="item.sourceId" :title="item.title" title-width="100px">
|
|
297
|
-
<mulselectPicker 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" fold-card-model="complex" />
|
|
298
|
-
</wd-cell>
|
|
299
|
-
<!-- <wd-cell v-if="item.extControlType === 'tree-entity-select'" :prop="item.sourceId" :title="item.title" title-width="100px">
|
|
300
|
-
<TreeSelectControl v-model="model[item.sourceId]" :source-id="item.sourceId" :title="item.title" :ext-control-type="item.extControlType " :readonly="item.disabled" :clearable="!item.disabled" />
|
|
301
|
-
</wd-cell> -->
|
|
302
|
-
<wd-cell v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'int' " :title="item.title" title-width="100px" :prop="item.sourceId">
|
|
303
|
-
<view style="text-align: left">
|
|
304
|
-
<wd-input-number v-model="model[item.sourceId]" :disabled="item.disabled || item.rowEditType === 'readonly'" :min="Number(item.min || 0)" :max="Number(item.max || Infinity)" />
|
|
305
|
-
</view>
|
|
306
|
-
</wd-cell>
|
|
307
|
-
<wd-cell v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'yes-no-switch' " :title="item.title" title-width="100px" :prop="item.sourceId">
|
|
308
|
-
<view style="text-align: left">
|
|
309
|
-
<wd-switch v-model="model[item.sourceId]" size="16" :disabled="item.disabled || item.rowEditType === 'readonly'" active-value="是" inactive-value="否" />
|
|
310
|
-
</view>
|
|
311
|
-
</wd-cell>
|
|
312
|
-
<!-- <SelectColPicker
|
|
313
|
-
v-if="item.extControlType === 'tree-entity-select' "
|
|
314
|
-
v-model="model[item.sourceId]"
|
|
315
|
-
:source-id="item.sourceId"
|
|
316
|
-
:label="item.title"
|
|
317
|
-
label-width="100px"
|
|
320
|
+
</wd-form-item>
|
|
321
|
+
<wd-form-item
|
|
322
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'file' || ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relfile'"
|
|
323
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
318
324
|
:prop="item.sourceId"
|
|
319
|
-
:
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
325
|
+
:title="item.title"
|
|
326
|
+
>
|
|
327
|
+
<wd-radio-group v-if="!item.disabled" v-model="fileType" inline shape="dot" custom-class="custom-radio">
|
|
328
|
+
<wd-radio v-for="(titem, index) in fileTypes" :key="index" :value="titem.value">
|
|
329
|
+
{{ titem.label }}
|
|
330
|
+
</wd-radio>
|
|
331
|
+
</wd-radio-group>
|
|
332
|
+
<wd-upload
|
|
333
|
+
:accept="fileType"
|
|
334
|
+
:disabled="item.disabled || item.rowEditType === 'readonly'"
|
|
335
|
+
:limit="1"
|
|
336
|
+
:header="{ 'hydrocarbon-program-token': hydrocarbonProgramToken, 'hydrocarbon-token': token }"
|
|
337
|
+
:file-list="model[item.sourceId]"
|
|
338
|
+
:action="`${action}/v3/upload`"
|
|
339
|
+
@success="(e) => { handleFileChange(e, item) }"
|
|
340
|
+
/>
|
|
341
|
+
</wd-form-item>
|
|
342
|
+
<wd-form-item
|
|
343
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relselect'"
|
|
344
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
345
|
+
:prop="item.sourceId"
|
|
346
|
+
:title="item.title"
|
|
347
|
+
:style="{ display: item.title?.includes('y') ? 'none' : null }"
|
|
348
|
+
>
|
|
349
|
+
<mulselectPicker 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" />
|
|
350
|
+
</wd-form-item>
|
|
351
|
+
<wd-form-item
|
|
352
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relselectvalue'"
|
|
353
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
354
|
+
:prop="item.sourceId"
|
|
355
|
+
:title="item.title"
|
|
356
|
+
>
|
|
357
|
+
<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" />
|
|
358
|
+
</wd-form-item>
|
|
359
|
+
<wd-form-item
|
|
360
|
+
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'"
|
|
361
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
362
|
+
:prop="item.sourceId"
|
|
363
|
+
:title="item.title"
|
|
364
|
+
>
|
|
365
|
+
<mulselectPicker 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" fold-card-model="complex" />
|
|
366
|
+
</wd-form-item>
|
|
367
|
+
<!-- done -->
|
|
368
|
+
<wd-form-item
|
|
369
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'int'"
|
|
370
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
371
|
+
:prop="item.sourceId"
|
|
372
|
+
:title="item.title"
|
|
373
|
+
>
|
|
374
|
+
<view style="text-align: left">
|
|
375
|
+
<wd-input-number v-model="model[item.sourceId]" :disabled="item.disabled || item.rowEditType === 'readonly'" :min="Number(item.min || 0)" :max="Number(item.max || Infinity)" />
|
|
376
|
+
</view>
|
|
377
|
+
</wd-form-item>
|
|
378
|
+
<!-- done -->
|
|
379
|
+
<wd-form-item
|
|
380
|
+
v-else-if="ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'yes-no-switch'"
|
|
381
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
382
|
+
:prop="item.sourceId"
|
|
383
|
+
:title="item.title"
|
|
384
|
+
>
|
|
385
|
+
<view style="text-align: left">
|
|
386
|
+
<wd-switch v-model="model[item.sourceId]" size="16" :disabled="item.disabled || item.rowEditType === 'readonly'" active-value="是" inactive-value="否" />
|
|
387
|
+
</view>
|
|
388
|
+
</wd-form-item>
|
|
324
389
|
</view>
|
|
325
|
-
</
|
|
390
|
+
</view>
|
|
326
391
|
</wd-form>
|
|
327
392
|
</view>
|
|
328
393
|
</template>
|
|
329
394
|
|
|
330
395
|
<style scoped>
|
|
396
|
+
.custom-from-style {
|
|
397
|
+
|
|
331
398
|
:deep(.custom-radio){
|
|
332
399
|
display: flex;
|
|
333
400
|
padding: 4px;
|
|
334
401
|
}
|
|
402
|
+
|
|
403
|
+
:deep(.wd-form-item .wd-cell__wrapper){
|
|
404
|
+
gap: 12px;
|
|
405
|
+
}
|
|
406
|
+
:deep(.wd-form-item){
|
|
407
|
+
border-top: 0.6px solid #e8e8e8;
|
|
408
|
+
padding: 12px 6px;
|
|
409
|
+
margin: auto 6px;
|
|
410
|
+
width:calc(100% - 12px);
|
|
411
|
+
}
|
|
412
|
+
:deep(.no-border-top){
|
|
413
|
+
border-top: none;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
335
416
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { storeToRefs } from 'pinia'
|
|
3
|
-
import { useToast } from 'wot-
|
|
3
|
+
import { useToast } from '@wot-ui/ui'
|
|
4
4
|
import { defineOptions, nextTick, ref, watch } from 'vue'
|
|
5
5
|
import { useGlobalLoading } from '../../composables/useGlobalLoading'
|
|
6
6
|
import { getCurrentPath } from '../../utils/index'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
2
|
+
import { CommonUtil, useDialog } from '@wot-ui/ui'
|
|
3
3
|
import { storeToRefs } from 'pinia'
|
|
4
|
-
import { useMessage } from 'wot-design-uni'
|
|
5
4
|
import { defineOptions, nextTick, ref, watch } from 'vue'
|
|
6
5
|
import { useGlobalMessage } from '../../composables/useGlobalMessage'
|
|
7
6
|
import { getCurrentPath } from '../../utils/index'
|
|
@@ -12,7 +11,7 @@ defineOptions({
|
|
|
12
11
|
|
|
13
12
|
const { messageOptions, currentPage } = storeToRefs(useGlobalMessage())
|
|
14
13
|
|
|
15
|
-
const
|
|
14
|
+
const dialog = useDialog()
|
|
16
15
|
const currentPath = getCurrentPath()
|
|
17
16
|
|
|
18
17
|
// #ifdef MP-ALIPAY
|
|
@@ -26,20 +25,25 @@ nextTick(() => {
|
|
|
26
25
|
watch(() => messageOptions.value, (newVal) => {
|
|
27
26
|
if (newVal) {
|
|
28
27
|
if (currentPage.value === currentPath) {
|
|
29
|
-
const option = deepClone(newVal)
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const option = CommonUtil.deepClone(newVal)
|
|
29
|
+
const method = option.type === 'confirm'
|
|
30
|
+
? 'confirm'
|
|
31
|
+
: option.type === 'prompt'
|
|
32
|
+
? 'prompt'
|
|
33
|
+
: 'alert'
|
|
34
|
+
dialog[method](option).then((res) => {
|
|
35
|
+
if (CommonUtil.isFunction(option.success)) {
|
|
32
36
|
option.success(res)
|
|
33
37
|
}
|
|
34
38
|
}).catch((err) => {
|
|
35
|
-
if (isFunction(option.fail)) {
|
|
39
|
+
if (CommonUtil.isFunction(option.fail)) {
|
|
36
40
|
option.fail(err)
|
|
37
41
|
}
|
|
38
42
|
})
|
|
39
43
|
}
|
|
40
44
|
}
|
|
41
45
|
else {
|
|
42
|
-
|
|
46
|
+
dialog.close()
|
|
43
47
|
}
|
|
44
48
|
})
|
|
45
49
|
</script>
|
|
@@ -56,9 +60,9 @@ export default {
|
|
|
56
60
|
|
|
57
61
|
<template>
|
|
58
62
|
<!-- #ifdef MP-ALIPAY -->
|
|
59
|
-
<wd-
|
|
63
|
+
<wd-dialog v-if="hackAlipayVisible" />
|
|
60
64
|
<!-- #endif -->
|
|
61
65
|
<!-- #ifndef MP-ALIPAY -->
|
|
62
|
-
<wd-
|
|
66
|
+
<wd-dialog />
|
|
63
67
|
<!-- #endif -->
|
|
64
68
|
</template>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { storeToRefs } from 'pinia'
|
|
3
|
-
import { useToast } from 'wot-
|
|
3
|
+
import { useToast } from '@wot-ui/ui'
|
|
4
4
|
import { defineOptions, nextTick, ref, watch } from 'vue'
|
|
5
5
|
import { useGlobalToast } from '../../composables/useGlobalToast'
|
|
6
6
|
import { getCurrentPath } from '../../utils/index'
|
|
@@ -14,7 +14,7 @@ function gotoAddPage() {
|
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<template>
|
|
17
|
-
<view class="flex justify-end gap-1 .light:bg-white">
|
|
18
|
-
<wd-
|
|
17
|
+
<view class="flex justify-end gap-1 py-2 pr-2 .light:bg-white">
|
|
18
|
+
<wd-icon v-if="buttons.includes('dtmplAdd')" name="plus" size="24px" class="text-[#6b7280]" @click="gotoAddPage" />
|
|
19
19
|
</view>
|
|
20
20
|
</template>
|
|
@@ -75,8 +75,8 @@ function clearSelect() {
|
|
|
75
75
|
<view class="h-3px w-17px" />
|
|
76
76
|
</view>
|
|
77
77
|
<view v-if="clearable" class="absolute bottom-0 right-0 top-0">
|
|
78
|
-
<wd-icon v-if="selectformatData" name="
|
|
79
|
-
<wd-icon v-else name="
|
|
78
|
+
<wd-icon v-if="selectformatData" name="close-circle" size="17px" @click.stop="clearSelect" />
|
|
79
|
+
<wd-icon v-else name="right" size="17px" />
|
|
80
80
|
</view>
|
|
81
81
|
</view>
|
|
82
82
|
</template>
|
|
@@ -128,7 +128,7 @@ export default {
|
|
|
128
128
|
</template>
|
|
129
129
|
|
|
130
130
|
<style lang="scss" scoped>
|
|
131
|
-
@import 'wot-
|
|
131
|
+
@import '@wot-ui/ui/components/wd-button/index.scss';
|
|
132
132
|
:deep(.wd-privacy-popup) {
|
|
133
133
|
width: 600rpx;
|
|
134
134
|
padding: 0 24rpx;
|
|
@@ -53,7 +53,7 @@ function isControlType(item: Columns): string {
|
|
|
53
53
|
:src="props.mainPicture ? formatItemData(props.data.fieldMap[props.mainPicture.sourceId], (isControlType(props.mainPicture) && isControlType(props.mainPicture)[0]))?.url ? formatItemData(props.data.fieldMap[props.mainPicture.sourceId], (isControlType(props.mainPicture) && isControlType(props.mainPicture)[0]))?.url : 'https://' : 'https://'"
|
|
54
54
|
>
|
|
55
55
|
<template #error>
|
|
56
|
-
<wd-
|
|
56
|
+
<wd-empty>
|
|
57
57
|
<template #image>
|
|
58
58
|
<view class="h-100px w-160px">
|
|
59
59
|
<!-- 图片占位 -->
|
|
@@ -64,7 +64,7 @@ function isControlType(item: Columns): string {
|
|
|
64
64
|
<!-- <svg t="1770269817485" class="icon w-full h-full" viewBox="0 0 1574 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10847" width="200" height="200"><path d="M994.927445 125.981073h-613.753943c-48.454259 0-87.217666 38.763407-87.217666 87.217665v613.753943c0 48.454259 38.763407 87.217666 87.217666 87.217666h613.753943c48.454259 0 87.217666-38.763407 87.217665-87.217666v-613.753943c0-48.454259-38.763407-87.217666-87.217665-87.217665z m-468.391167 206.73817c38.763407 0 71.066246 32.302839 71.066246 71.066246 0 38.763407-32.302839 71.066246-71.066246 71.066246-38.763407 0-71.066246-32.302839-71.066246-71.066246 0-38.763407 32.302839-71.066246 71.066246-71.066246z m-145.362776 449.009464l155.053627-197.047319 109.829653 132.44164 155.053628-197.047318 197.047319 261.652997H381.173502z" fill="#C3DEFA" p-id="10848"></path><path d="M1169.362776 235.810726h-613.753943c-48.454259 0-87.217666 38.763407-87.217666 87.217665v613.753943c0 48.454259 38.763407 87.217666 87.217666 87.217666h613.753943c48.454259 0 87.217666-38.763407 87.217666-87.217666V323.028391c0-48.454259-38.763407-87.217666-87.217666-87.217665z m-468.391167 206.73817c38.763407 0 71.066246 32.302839 71.066246 71.066246s-32.302839 71.066246-71.066246 71.066246c-38.763407 0-71.066246-32.302839-71.066246-71.066246s32.302839-71.066246 71.066246-71.066246z m-145.362776 449.009464l155.053628-197.047319 109.829653 132.44164 155.053627-197.047318 197.047319 261.652997H555.608833z m0 0" fill="#3A95F2" p-id="10849"></path><path d="M177.665615 784.958991H122.750789v-54.914827c0-12.921136-9.690852-22.611987-22.611988-22.611987-12.921136 0-22.611987 9.690852-22.611987 22.611987v54.914827H22.611987c-12.921136 0-22.611987 9.690852-22.611987 22.611987 0 12.921136 9.690852 22.611987 22.611987 22.611987h54.914827v54.914827c0 12.921136 9.690852 22.611987 22.611987 22.611987 12.921136 0 22.611987-9.690852 22.611988-22.611987v-54.914827h54.914826c12.921136 0 22.611987-9.690852 22.611988-22.611987 0-12.921136-9.690852-22.611987-22.611988-22.611987z m0 0M100.138801 432.858044h122.750789v122.750789H100.138801zM1288.883281 93.678233c0 35.533123 29.072555 61.375394 61.375394 61.375395 35.533123 0 61.375394-29.072555 61.375394-61.375395 0-35.533123-29.072555-61.375394-61.375394-61.375394-35.533123 0-61.375394 25.842271-61.375394 61.375394z m0 0" fill="#C3DEFA" p-id="10850"></path><path d="M1569.917981 794.649842l-93.678233-93.678233c-6.460568-6.460568-16.15142-6.460568-22.611988 0l-96.908517 93.678233c-6.460568 6.460568-6.460568 16.15142 0 22.611988l93.678233 93.678233c6.460568 6.460568 16.15142 6.460568 22.611988 0l93.678233-93.678233c9.690852-6.460568 9.690852-16.15142 3.230284-22.611988z m-106.599369 80.757098L1392.252366 807.570978l71.066246-71.066246 71.066246 71.066246-71.066246 67.835962zM303.646688 12.921136C297.18612 6.460568 290.725552 0 281.0347 0H45.223975C35.533123 0 29.072555 6.460568 22.611987 12.921136c-3.230284 9.690852 0 19.381703 6.460568 25.842271l119.520505 119.520505c3.230284 3.230284 9.690852 6.460568 16.151419 6.460567s9.690852-3.230284 12.921136-9.690851l119.520505-119.520505c6.460568-3.230284 6.460568-12.921136 6.460568-22.611987z m-138.902209 96.908517l-64.605678-64.605678h132.441641l-67.835963 64.605678z" fill="#3A95F2" p-id="10851"></path></svg> -->
|
|
65
65
|
</view>
|
|
66
66
|
</template>
|
|
67
|
-
</wd-
|
|
67
|
+
</wd-empty>
|
|
68
68
|
</template>
|
|
69
69
|
<template #loading>
|
|
70
70
|
<view class="h-full flex items-center justify-center">
|