resolver-egretimp-plus 0.1.60 → 0.1.62
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/package.json
CHANGED
|
@@ -89,7 +89,16 @@ const value = computed(() => {
|
|
|
89
89
|
if (!modelValue.value) {
|
|
90
90
|
return ''
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
let val = ''
|
|
93
|
+
if (isNaN(Number(modelValue.value))) {
|
|
94
|
+
val = modelValue.value
|
|
95
|
+
} else {
|
|
96
|
+
if (props.config?.valueFormat === 'timestamp') {
|
|
97
|
+
val = Number(modelValue.value)
|
|
98
|
+
} else {
|
|
99
|
+
val = modelValue.value
|
|
100
|
+
}
|
|
101
|
+
}
|
|
93
102
|
return dayjs(val).format(props?.config?.format || 'YYYY-MM-DD')
|
|
94
103
|
}
|
|
95
104
|
if (props.showMoney == '1') {
|
|
@@ -11,6 +11,7 @@ import { useAttrs, computed, watch, nextTick, useSlots } from 'vue'
|
|
|
11
11
|
import { commonPropsType, formatDate, isDate, hasOwn } from '../../utils/index.js'
|
|
12
12
|
import { useFormItem } from 'element-plus'
|
|
13
13
|
import dateIcon from '../icons/date.vue'
|
|
14
|
+
import dayjs from 'dayjs'
|
|
14
15
|
|
|
15
16
|
const slots = useSlots()
|
|
16
17
|
const { formItem: elFormItem } = useFormItem()
|
|
@@ -70,21 +71,17 @@ watch(value, () => {
|
|
|
70
71
|
})
|
|
71
72
|
|
|
72
73
|
const disabledDate = (date) => {
|
|
73
|
-
|
|
74
|
-
const
|
|
74
|
+
const currentDateStr = dayjs(date).format('YYYY-MM-DD')
|
|
75
|
+
const currentDateUnix = dayjs(currentDateStr).unix()
|
|
75
76
|
if (props.min) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
if (typeof props.min === 'string' && new Date(props.min).getTime() > newDate.getTime()) {
|
|
77
|
+
const minUnix = dayjs(props.min).unix()
|
|
78
|
+
if (minUnix > currentDateUnix) {
|
|
80
79
|
return true
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
if (props.max) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
if (typeof props.max === 'string' && new Date(props.max).getTime() < newDate.getTime()) {
|
|
83
|
+
const maxUnix = dayjs(props.max).unix()
|
|
84
|
+
if (maxUnix < currentDateUnix) {
|
|
88
85
|
return true
|
|
89
86
|
}
|
|
90
87
|
}
|
package/src/utils/defaultVal.js
CHANGED
|
@@ -4,7 +4,11 @@ import { ARG_FLAGS, isHidden, VALUE_TYPES } from './const'
|
|
|
4
4
|
import { isArray, isNumber, isString } from './is'
|
|
5
5
|
|
|
6
6
|
export default function defaultVal(config) {
|
|
7
|
-
if (
|
|
7
|
+
if (
|
|
8
|
+
(config.defaultVal || config.defaultValue) &&
|
|
9
|
+
!config.bindValue && config.bindValue !== 0 &&
|
|
10
|
+
!(isArray(config.bindValue) && config.bindValue.length) // 数组等于空的数组的时候
|
|
11
|
+
) {
|
|
8
12
|
const configDefaultVal = config.defaultVal || config.defaultValue
|
|
9
13
|
let defaultVal = null
|
|
10
14
|
try {
|