cloud-web-corejs 1.0.271 → 1.0.272
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
|
@@ -25,11 +25,12 @@ import FormItemWrapper from './form-item-wrapper'
|
|
|
25
25
|
import emitter from '../../../../../components/xform/utils/emitter'
|
|
26
26
|
import i18n from "../../../../../components/xform/utils/i18n";
|
|
27
27
|
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
28
|
+
import dateLimitMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin";
|
|
28
29
|
|
|
29
30
|
export default {
|
|
30
31
|
name: "date-widget",
|
|
31
32
|
componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
|
32
|
-
mixins: [emitter, fieldMixin, i18n],
|
|
33
|
+
mixins: [emitter, fieldMixin, i18n, dateLimitMixin],
|
|
33
34
|
props: {
|
|
34
35
|
field: Object,
|
|
35
36
|
parentWidget: Object,
|
|
@@ -95,6 +96,9 @@ export default {
|
|
|
95
96
|
}
|
|
96
97
|
}]
|
|
97
98
|
}
|
|
99
|
+
|
|
100
|
+
//须在 handleOnCreated 之后:脚本里设的 field.options.minDate 不是响应式的,靠此处顺序读取
|
|
101
|
+
this.initDateLimitPickerOptions()
|
|
98
102
|
},
|
|
99
103
|
|
|
100
104
|
mounted() {
|
package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js
CHANGED
|
@@ -58,6 +58,12 @@ export default {
|
|
|
58
58
|
if (val === null || val === undefined || val === "") {
|
|
59
59
|
return null;
|
|
60
60
|
}
|
|
61
|
+
if (val instanceof Date) {
|
|
62
|
+
return isNaN(val.getTime()) ? null : val.getTime();
|
|
63
|
+
}
|
|
64
|
+
if (typeof val === "number") {
|
|
65
|
+
return isNaN(val) ? null : val;
|
|
66
|
+
}
|
|
61
67
|
const date = new Date(String(val).replace(/-/g, "/"));
|
|
62
68
|
return isNaN(date.getTime()) ? null : date.getTime();
|
|
63
69
|
},
|