wui-components-v2 1.1.72 → 1.1.74
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.
|
@@ -8,13 +8,11 @@ defineOptions({
|
|
|
8
8
|
const props = defineProps({
|
|
9
9
|
modelValue: String,
|
|
10
10
|
placeholder: String,
|
|
11
|
-
columns: {
|
|
12
|
-
type: Array as PropType<SelectOption[]>,
|
|
13
|
-
default: () => [],
|
|
14
|
-
},
|
|
15
11
|
labelKey: { type: String, default: 'label' },
|
|
16
12
|
valueKey: { type: String, default: 'value' },
|
|
17
13
|
type: { type: String, default: 'date' },
|
|
14
|
+
min: String,
|
|
15
|
+
max: String,
|
|
18
16
|
})
|
|
19
17
|
|
|
20
18
|
const emit = defineEmits<{
|
|
@@ -40,7 +38,7 @@ watch(
|
|
|
40
38
|
)
|
|
41
39
|
|
|
42
40
|
watch(currentValue, val => {
|
|
43
|
-
const newVal = props.type
|
|
41
|
+
const newVal = ['year', 'month'].includes(props.type) ? dayjs(val).format('YYYY-MM') : val
|
|
44
42
|
emit('update:modelValue', newVal)
|
|
45
43
|
})
|
|
46
44
|
|
|
@@ -61,6 +59,7 @@ const labelText = computed(() => {
|
|
|
61
59
|
return currentValue.value || ''
|
|
62
60
|
}
|
|
63
61
|
})
|
|
62
|
+
console.log('labelText', props)
|
|
64
63
|
</script>
|
|
65
64
|
|
|
66
65
|
<template>
|
|
@@ -71,13 +70,14 @@ const labelText = computed(() => {
|
|
|
71
70
|
</div>
|
|
72
71
|
|
|
73
72
|
<wd-calendar
|
|
74
|
-
v-if="['date', 'datetime'].includes(type)"
|
|
73
|
+
v-if="['date', 'datetime', 'month'].includes(type)"
|
|
75
74
|
v-model="currentValue"
|
|
76
75
|
v-model:visible="open"
|
|
77
76
|
label-key="label"
|
|
78
77
|
value-key="value"
|
|
79
78
|
class="custom-date-picker"
|
|
80
79
|
:type="type as any"
|
|
80
|
+
:min-date="props.min === '$$current' ? dayjs().startOf('day').valueOf() : undefined"
|
|
81
81
|
/>
|
|
82
82
|
<wd-datetime-picker
|
|
83
83
|
v-else
|
|
@@ -291,7 +291,7 @@ defineExpose({
|
|
|
291
291
|
})
|
|
292
292
|
const clearValueMap = fields.value.reduce(
|
|
293
293
|
(acc, field) => {
|
|
294
|
-
acc[field.id] = field.clearValueOnHidden ? '' : field.defaultValue ?? null
|
|
294
|
+
acc[field.id] = field.clearValueOnHidden ? '' : (field.defaultValue ?? null)
|
|
295
295
|
return acc
|
|
296
296
|
},
|
|
297
297
|
{} as Record<string, any>
|
|
@@ -441,6 +441,7 @@ console.log('clearValueMap', clearValueMap)
|
|
|
441
441
|
:title="item.title"
|
|
442
442
|
>
|
|
443
443
|
<customDatePicker
|
|
444
|
+
:min="item.min"
|
|
444
445
|
v-model="model[item.sourceId]"
|
|
445
446
|
type="datetime"
|
|
446
447
|
:clearable="!item.disabled"
|
|
@@ -479,6 +480,22 @@ console.log('clearValueMap', clearValueMap)
|
|
|
479
480
|
:placeholder="`请选择${item.title}`"
|
|
480
481
|
/>
|
|
481
482
|
</wd-form-item>
|
|
483
|
+
<wd-form-item
|
|
484
|
+
v-else-if="
|
|
485
|
+
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'date-M1'
|
|
486
|
+
"
|
|
487
|
+
:class="{ 'no-border-top': fields.indexOf(item) === 0 }"
|
|
488
|
+
:prop="item.sourceId"
|
|
489
|
+
:title="item.title"
|
|
490
|
+
>
|
|
491
|
+
<customDatePicker
|
|
492
|
+
v-model="model[item.sourceId]"
|
|
493
|
+
type="month"
|
|
494
|
+
use-second
|
|
495
|
+
:clearable="!item.disabled"
|
|
496
|
+
:placeholder="`请选择${item.title}`"
|
|
497
|
+
/>
|
|
498
|
+
</wd-form-item>
|
|
482
499
|
<wd-form-item
|
|
483
500
|
v-else-if="
|
|
484
501
|
ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'file' ||
|
|
@@ -51,7 +51,8 @@ const EVENT_NAME = `userChooseSelected_${generateHighResolutionID()}`
|
|
|
51
51
|
const addUser = () => {
|
|
52
52
|
const addEvent = generateHighResolutionID()
|
|
53
53
|
// 当前已有数据时,跳转到编辑页面
|
|
54
|
-
if (currentValue.value) {
|
|
54
|
+
if (currentValue.value && typeof currentValue.value === 'string') {
|
|
55
|
+
console.log('currentValue.value', currentValue.value)
|
|
55
56
|
// 和 fetchDataById 中的 requestId 逻辑保持一致
|
|
56
57
|
const entityId = currentValue.value.split('@R@')[0]
|
|
57
58
|
router.push(
|