@fecp/mobile 1.0.61 → 1.0.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/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/picker-group/PickerGroup.mjs +4 -3
- package/es/packages/mobile/index.mjs +2 -0
- package/es/packages/mobile/src/components/all.mjs +2 -0
- package/es/packages/mobile/src/components/form/fieldDateTimePicker/FieldDateTimePicker.vue.mjs +188 -0
- package/es/packages/mobile/src/components/form/fieldDateTimePicker/index.mjs +10 -0
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/picker-group/PickerGroup.js +3 -2
- package/lib/packages/mobile/index.js +54 -52
- package/lib/packages/mobile/src/components/all.js +54 -52
- package/lib/packages/mobile/src/components/form/fieldDateTimePicker/FieldDateTimePicker.vue.js +188 -0
- package/lib/packages/mobile/src/components/form/fieldDateTimePicker/index.js +10 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { useChildren } from "../../../../../@vant_use@1.6.0_vue@3.5.13_typescrip
|
|
|
3
3
|
import { useSyncPropRef } from "../composables/use-sync-prop-ref.mjs";
|
|
4
4
|
import { Tab } from "../tab/index.mjs";
|
|
5
5
|
import { Tabs } from "../tabs/index.mjs";
|
|
6
|
-
import stdin_default, {
|
|
6
|
+
import stdin_default$1, { pickerToolbarSlots, pickerToolbarProps } from "../picker/PickerToolbar.mjs";
|
|
7
7
|
import { extend, flat, pick } from "../utils/basic.mjs";
|
|
8
8
|
import { createNamespace } from "../utils/create.mjs";
|
|
9
9
|
import { truthProp, makeNumericProp, makeArrayProp } from "../utils/props.mjs";
|
|
@@ -15,7 +15,7 @@ const pickerGroupProps = extend({
|
|
|
15
15
|
nextStepText: String,
|
|
16
16
|
showToolbar: truthProp
|
|
17
17
|
}, pickerToolbarProps);
|
|
18
|
-
defineComponent({
|
|
18
|
+
var stdin_default = defineComponent({
|
|
19
19
|
name,
|
|
20
20
|
props: pickerGroupProps,
|
|
21
21
|
emits: ["confirm", "cancel", "update:activeTab"],
|
|
@@ -52,7 +52,7 @@ defineComponent({
|
|
|
52
52
|
const confirmButtonText = showNextButton() ? props.nextStepText : props.confirmButtonText;
|
|
53
53
|
return createVNode("div", {
|
|
54
54
|
"class": bem()
|
|
55
|
-
}, [props.showToolbar ? createVNode(stdin_default, {
|
|
55
|
+
}, [props.showToolbar ? createVNode(stdin_default$1, {
|
|
56
56
|
"title": props.title,
|
|
57
57
|
"cancelButtonText": props.cancelButtonText,
|
|
58
58
|
"confirmButtonText": confirmButtonText,
|
|
@@ -78,5 +78,6 @@ defineComponent({
|
|
|
78
78
|
});
|
|
79
79
|
export {
|
|
80
80
|
PICKER_GROUP_KEY,
|
|
81
|
+
stdin_default as default,
|
|
81
82
|
pickerGroupProps
|
|
82
83
|
};
|
|
@@ -34,6 +34,7 @@ import { MobileFieldPicker } from "./src/components/form/fieldPicker/index.mjs";
|
|
|
34
34
|
import { MobileFieldCalendarPicker } from "./src/components/form/fieldCalendarPicker/index.mjs";
|
|
35
35
|
import { MobileFieldDatePicker } from "./src/components/form/fieldDatePicker/index.mjs";
|
|
36
36
|
import { MobileFieldTimePicker } from "./src/components/form/fieldTimePicker/index.mjs";
|
|
37
|
+
import { MobileFieldDateTimePicker } from "./src/components/form/fieldDateTimePicker/index.mjs";
|
|
37
38
|
import { MobileFieldCascaderPicker } from "./src/components/form/fieldCascaderPicker/index.mjs";
|
|
38
39
|
import { MobileFieldCheckbox } from "./src/components/form/fieldCheckbox/index.mjs";
|
|
39
40
|
import { MobileFieldRadio } from "./src/components/form/fieldRadio/index.mjs";
|
|
@@ -92,6 +93,7 @@ export {
|
|
|
92
93
|
MobileFieldCascaderPicker,
|
|
93
94
|
MobileFieldCheckbox,
|
|
94
95
|
MobileFieldDatePicker,
|
|
96
|
+
MobileFieldDateTimePicker,
|
|
95
97
|
MobileFieldPicker,
|
|
96
98
|
MobileFieldRadio,
|
|
97
99
|
MobileFieldTimePicker,
|
|
@@ -31,6 +31,7 @@ import { MobileFieldPicker } from "./form/fieldPicker/index.mjs";
|
|
|
31
31
|
import { MobileFieldCalendarPicker } from "./form/fieldCalendarPicker/index.mjs";
|
|
32
32
|
import { MobileFieldDatePicker } from "./form/fieldDatePicker/index.mjs";
|
|
33
33
|
import { MobileFieldTimePicker } from "./form/fieldTimePicker/index.mjs";
|
|
34
|
+
import { MobileFieldDateTimePicker } from "./form/fieldDateTimePicker/index.mjs";
|
|
34
35
|
import { MobileFieldCascaderPicker } from "./form/fieldCascaderPicker/index.mjs";
|
|
35
36
|
import { MobileFieldCheckbox } from "./form/fieldCheckbox/index.mjs";
|
|
36
37
|
import { MobileFieldRadio } from "./form/fieldRadio/index.mjs";
|
|
@@ -78,6 +79,7 @@ export {
|
|
|
78
79
|
MobileFieldCascaderPicker,
|
|
79
80
|
MobileFieldCheckbox,
|
|
80
81
|
MobileFieldDatePicker,
|
|
82
|
+
MobileFieldDateTimePicker,
|
|
81
83
|
MobileFieldPicker,
|
|
82
84
|
MobileFieldRadio,
|
|
83
85
|
MobileFieldTimePicker,
|
package/es/packages/mobile/src/components/form/fieldDateTimePicker/FieldDateTimePicker.vue.mjs
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
/* empty css */
|
|
5
|
+
/* empty css */
|
|
6
|
+
/* empty css */
|
|
7
|
+
/* empty css */
|
|
8
|
+
/* empty css */
|
|
9
|
+
/* empty css */
|
|
10
|
+
/* empty css */
|
|
11
|
+
/* empty css */
|
|
12
|
+
/* empty css */
|
|
13
|
+
/* empty css */
|
|
14
|
+
import { ref, computed, watch, createBlock, openBlock, unref, mergeProps, isRef, createSlots, withCtx, createVNode, withModifiers } from "vue";
|
|
15
|
+
import { MobileField } from "../field/index.mjs";
|
|
16
|
+
import hooks from "../../../../../../node_modules/.pnpm/moment@2.30.1/node_modules/moment/dist/moment.mjs";
|
|
17
|
+
import { parseDateFormatter } from "../../../utils/dateUtil.mjs";
|
|
18
|
+
import { PickerGroup } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/picker-group/index.mjs";
|
|
19
|
+
import { Popup } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/popup/index.mjs";
|
|
20
|
+
import { DatePicker } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/date-picker/index.mjs";
|
|
21
|
+
import { TimePicker } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/time-picker/index.mjs";
|
|
22
|
+
import { Icon } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/icon/index.mjs";
|
|
23
|
+
const dateColumnsType = "year,month,day,hour,minute";
|
|
24
|
+
const _sfc_main = {
|
|
25
|
+
__name: "FieldDateTimePicker",
|
|
26
|
+
props: {
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
},
|
|
31
|
+
dateTextFormat: {
|
|
32
|
+
//0:YYYYMMDD;1: YYYY-MM-DD;2:YYYY/MM/DD;3:YYYY年MM月DD日
|
|
33
|
+
type: String,
|
|
34
|
+
default: "1"
|
|
35
|
+
},
|
|
36
|
+
title: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: ""
|
|
39
|
+
},
|
|
40
|
+
disabled: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
readonly: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
"is-link": false
|
|
49
|
+
},
|
|
50
|
+
emits: ["update:modelValue"],
|
|
51
|
+
setup(__props, { emit: __emit }) {
|
|
52
|
+
const props = __props;
|
|
53
|
+
const fieldTextValue = ref("");
|
|
54
|
+
const showPicker = ref(false);
|
|
55
|
+
const emit = __emit;
|
|
56
|
+
let textFormat = parseDateFormatter(props.dateTextFormat, dateColumnsType);
|
|
57
|
+
let valueFormat = parseDateFormatter("0", dateColumnsType);
|
|
58
|
+
const currentDateTime = computed(() => {
|
|
59
|
+
let date;
|
|
60
|
+
if (!props.modelValue) {
|
|
61
|
+
date = hooks();
|
|
62
|
+
} else {
|
|
63
|
+
date = hooks(props.modelValue, valueFormat);
|
|
64
|
+
}
|
|
65
|
+
const year = date.year();
|
|
66
|
+
const month = date.month() + 1;
|
|
67
|
+
const day = date.date();
|
|
68
|
+
const hours = date.hours();
|
|
69
|
+
const minutes = date.minutes();
|
|
70
|
+
date.seconds();
|
|
71
|
+
const dateValue = [year, month, day];
|
|
72
|
+
const timeValue = [hours, minutes];
|
|
73
|
+
return { dateValue, timeValue };
|
|
74
|
+
});
|
|
75
|
+
const dateFormatter = (type, option) => {
|
|
76
|
+
if (type === "year") {
|
|
77
|
+
option.text += "年";
|
|
78
|
+
} else if (type === "month") {
|
|
79
|
+
option.text += "月";
|
|
80
|
+
} else if (type === "day") {
|
|
81
|
+
option.text += "日";
|
|
82
|
+
}
|
|
83
|
+
return option;
|
|
84
|
+
};
|
|
85
|
+
const timeFormatter = (type, option) => {
|
|
86
|
+
if (type === "hour") {
|
|
87
|
+
option.text += "时";
|
|
88
|
+
} else if (type === "minute") {
|
|
89
|
+
option.text += "分";
|
|
90
|
+
} else if (type === "second") {
|
|
91
|
+
option.text += "秒";
|
|
92
|
+
}
|
|
93
|
+
return option;
|
|
94
|
+
};
|
|
95
|
+
watch(
|
|
96
|
+
() => props.modelValue,
|
|
97
|
+
(value) => {
|
|
98
|
+
if (!value) {
|
|
99
|
+
fieldTextValue.value = "";
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
fieldTextValue.value = hooks(value, valueFormat).format(textFormat);
|
|
103
|
+
},
|
|
104
|
+
{ immediate: true }
|
|
105
|
+
);
|
|
106
|
+
const onConfirm = () => {
|
|
107
|
+
const date = currentDateTime.value.dateValue;
|
|
108
|
+
const time = currentDateTime.value.timeValue;
|
|
109
|
+
const val = hooks(
|
|
110
|
+
`${date[0]}${date[1]}${date[2]} ${time[0]}:${time[1]}`,
|
|
111
|
+
"YYYYMMDD HH:mm"
|
|
112
|
+
).format(valueFormat);
|
|
113
|
+
emit("update:modelValue", val);
|
|
114
|
+
showPicker.value = false;
|
|
115
|
+
};
|
|
116
|
+
return (_ctx, _cache) => {
|
|
117
|
+
const _component_van_icon = Icon;
|
|
118
|
+
const _component_van_date_picker = DatePicker;
|
|
119
|
+
const _component_van_time_picker = TimePicker;
|
|
120
|
+
const _component_van_picker_group = PickerGroup;
|
|
121
|
+
const _component_van_popup = Popup;
|
|
122
|
+
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
123
|
+
modelValue: unref(fieldTextValue),
|
|
124
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
125
|
+
isLink: __props.readonly ? false : true,
|
|
126
|
+
readonly: "",
|
|
127
|
+
disabled: __props.disabled,
|
|
128
|
+
onClick: _cache[6] || (_cache[6] = () => {
|
|
129
|
+
if (!__props.readonly) {
|
|
130
|
+
showPicker.value = true;
|
|
131
|
+
}
|
|
132
|
+
})
|
|
133
|
+
}), createSlots({
|
|
134
|
+
default: withCtx(() => [
|
|
135
|
+
createVNode(_component_van_popup, {
|
|
136
|
+
show: unref(showPicker),
|
|
137
|
+
"onUpdate:show": _cache[4] || (_cache[4] = ($event) => isRef(showPicker) ? showPicker.value = $event : null),
|
|
138
|
+
"destroy-on-close": "",
|
|
139
|
+
position: "bottom"
|
|
140
|
+
}, {
|
|
141
|
+
default: withCtx(() => [
|
|
142
|
+
createVNode(_component_van_picker_group, {
|
|
143
|
+
title: __props.title,
|
|
144
|
+
tabs: ["选择日期", "选择时间"],
|
|
145
|
+
"next-step-text": "下一步",
|
|
146
|
+
onConfirm,
|
|
147
|
+
onCancel: _cache[3] || (_cache[3] = ($event) => showPicker.value = false)
|
|
148
|
+
}, {
|
|
149
|
+
default: withCtx(() => [
|
|
150
|
+
createVNode(_component_van_date_picker, {
|
|
151
|
+
modelValue: unref(currentDateTime).dateValue,
|
|
152
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(currentDateTime).dateValue = $event),
|
|
153
|
+
formatter: dateFormatter,
|
|
154
|
+
readonly: false
|
|
155
|
+
}, null, 8, ["modelValue"]),
|
|
156
|
+
createVNode(_component_van_time_picker, {
|
|
157
|
+
modelValue: unref(currentDateTime).timeValue,
|
|
158
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(currentDateTime).timeValue = $event),
|
|
159
|
+
readonly: false,
|
|
160
|
+
formatter: timeFormatter
|
|
161
|
+
}, null, 8, ["modelValue"])
|
|
162
|
+
]),
|
|
163
|
+
_: 1
|
|
164
|
+
}, 8, ["title"])
|
|
165
|
+
]),
|
|
166
|
+
_: 1
|
|
167
|
+
}, 8, ["show"])
|
|
168
|
+
]),
|
|
169
|
+
_: 2
|
|
170
|
+
}, [
|
|
171
|
+
!__props.readonly && !__props.disabled && unref(fieldTextValue) ? {
|
|
172
|
+
name: "right-icon",
|
|
173
|
+
fn: withCtx(() => [
|
|
174
|
+
createVNode(_component_van_icon, {
|
|
175
|
+
name: "clear",
|
|
176
|
+
class: "custom-close-icon",
|
|
177
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("update:modelValue", null), ["stop"]))
|
|
178
|
+
})
|
|
179
|
+
]),
|
|
180
|
+
key: "0"
|
|
181
|
+
} : void 0
|
|
182
|
+
]), 1040, ["modelValue", "isLink", "disabled"]);
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
export {
|
|
187
|
+
_sfc_main as default
|
|
188
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _sfc_main from "./FieldDateTimePicker.vue.mjs";
|
|
2
|
+
import install from "../../../utils/install.mjs";
|
|
3
|
+
const MobileFieldDateTimePicker = install.withInstall(
|
|
4
|
+
"MobileFieldDateTimePicker",
|
|
5
|
+
_sfc_main
|
|
6
|
+
);
|
|
7
|
+
export {
|
|
8
|
+
MobileFieldDateTimePicker,
|
|
9
|
+
MobileFieldDateTimePicker as default
|
|
10
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const index_esm = require("../../../../../@vant_use@1.6.0_vue@3.5.13_typescript@5.7.3_/node_modules/@vant/use/dist/index.esm.js");
|
|
5
5
|
const useSyncPropRef = require("../composables/use-sync-prop-ref.js");
|
|
@@ -17,7 +17,7 @@ const pickerGroupProps = basic.extend({
|
|
|
17
17
|
nextStepText: String,
|
|
18
18
|
showToolbar: props.truthProp
|
|
19
19
|
}, PickerToolbar.pickerToolbarProps);
|
|
20
|
-
vue.defineComponent({
|
|
20
|
+
var stdin_default = vue.defineComponent({
|
|
21
21
|
name,
|
|
22
22
|
props: pickerGroupProps,
|
|
23
23
|
emits: ["confirm", "cancel", "update:activeTab"],
|
|
@@ -79,4 +79,5 @@ vue.defineComponent({
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
exports.PICKER_GROUP_KEY = PICKER_GROUP_KEY;
|
|
82
|
+
exports.default = stdin_default;
|
|
82
83
|
exports.pickerGroupProps = pickerGroupProps;
|
|
@@ -36,32 +36,33 @@ const index$u = require("./src/components/form/fieldPicker/index.js");
|
|
|
36
36
|
const index$v = require("./src/components/form/fieldCalendarPicker/index.js");
|
|
37
37
|
const index$w = require("./src/components/form/fieldDatePicker/index.js");
|
|
38
38
|
const index$x = require("./src/components/form/fieldTimePicker/index.js");
|
|
39
|
-
const index$y = require("./src/components/form/
|
|
40
|
-
const index$z = require("./src/components/form/
|
|
41
|
-
const index$A = require("./src/components/form/
|
|
42
|
-
const index$B = require("./src/components/form/
|
|
43
|
-
const index$C = require("./src/components/form/
|
|
44
|
-
const index$D = require("./src/components/form/
|
|
45
|
-
const index$E = require("./src/components/form/
|
|
46
|
-
const index$F = require("./src/components/form/
|
|
47
|
-
const index$G = require("./src/components/form/
|
|
48
|
-
const index$H = require("./src/components/form/
|
|
49
|
-
const index$I = require("./src/components/form/
|
|
50
|
-
const index$J = require("./src/components/
|
|
51
|
-
const index$K = require("./src/components/navigation/
|
|
52
|
-
const index$L = require("./src/components/navigation/
|
|
53
|
-
const index$M = require("./src/components/navigation/
|
|
54
|
-
const index$N = require("./src/components/navigation/
|
|
55
|
-
const index$O = require("./src/components/navigation/
|
|
56
|
-
const index$P = require("./src/components/navigation/
|
|
57
|
-
const index$Q = require("./src/components/navigation/
|
|
58
|
-
const index$R = require("./src/components/navigation/
|
|
59
|
-
const index$S = require("./src/components/navigation/
|
|
60
|
-
const index$T = require("./src/components/navigation/
|
|
61
|
-
const index$U = require("./src/components/navigation/
|
|
62
|
-
const index$V = require("./src/components/navigation/
|
|
63
|
-
const index$W = require("./src/components/navigation/
|
|
64
|
-
const index$X = require("./src/components/navigation/
|
|
39
|
+
const index$y = require("./src/components/form/fieldDateTimePicker/index.js");
|
|
40
|
+
const index$z = require("./src/components/form/fieldCascaderPicker/index.js");
|
|
41
|
+
const index$A = require("./src/components/form/fieldCheckbox/index.js");
|
|
42
|
+
const index$B = require("./src/components/form/fieldRadio/index.js");
|
|
43
|
+
const index$C = require("./src/components/form/fieldArea/index.js");
|
|
44
|
+
const index$D = require("./src/components/form/form/index.js");
|
|
45
|
+
const index$E = require("./src/components/form/formItem/index.js");
|
|
46
|
+
const index$F = require("./src/components/form/radioGroup/index.js");
|
|
47
|
+
const index$G = require("./src/components/form/search/index.js");
|
|
48
|
+
const index$H = require("./src/components/form/uploader/index.js");
|
|
49
|
+
const index$I = require("./src/components/form/fieldUploader/index.js");
|
|
50
|
+
const index$J = require("./src/components/form/submitButton/index.js");
|
|
51
|
+
const index$K = require("./src/components/navigation/actionBar/index.js");
|
|
52
|
+
const index$L = require("./src/components/navigation/backTop/index.js");
|
|
53
|
+
const index$M = require("./src/components/navigation/grid/index.js");
|
|
54
|
+
const index$N = require("./src/components/navigation/gridItem/index.js");
|
|
55
|
+
const index$O = require("./src/components/navigation/indexBar/index.js");
|
|
56
|
+
const index$P = require("./src/components/navigation/indexAnchor/index.js");
|
|
57
|
+
const index$Q = require("./src/components/navigation/navBar/index.js");
|
|
58
|
+
const index$R = require("./src/components/navigation/pagination/index.js");
|
|
59
|
+
const index$S = require("./src/components/navigation/sidebar/index.js");
|
|
60
|
+
const index$T = require("./src/components/navigation/sidebarItem/index.js");
|
|
61
|
+
const index$U = require("./src/components/navigation/tab/index.js");
|
|
62
|
+
const index$V = require("./src/components/navigation/tabs/index.js");
|
|
63
|
+
const index$W = require("./src/components/navigation/tabbar/index.js");
|
|
64
|
+
const index$X = require("./src/components/navigation/tabbarItem/index.js");
|
|
65
|
+
const index$Y = require("./src/components/navigation/treeSelect/index.js");
|
|
65
66
|
const functionCall = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/function-call.js");
|
|
66
67
|
const functionCall$1 = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/image-preview/function-call.js");
|
|
67
68
|
const functionCall$2 = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/notify/function-call.js");
|
|
@@ -106,32 +107,33 @@ exports.MobileFieldPicker = index$u.MobileFieldPicker;
|
|
|
106
107
|
exports.MobileFieldCalendarPicker = index$v.MobileFieldCalendarPicker;
|
|
107
108
|
exports.MobileFieldDatePicker = index$w.MobileFieldDatePicker;
|
|
108
109
|
exports.MobileFieldTimePicker = index$x.MobileFieldTimePicker;
|
|
109
|
-
exports.
|
|
110
|
-
exports.
|
|
111
|
-
exports.
|
|
112
|
-
exports.
|
|
113
|
-
exports.
|
|
114
|
-
exports.
|
|
115
|
-
exports.
|
|
116
|
-
exports.
|
|
117
|
-
exports.
|
|
118
|
-
exports.
|
|
119
|
-
exports.
|
|
120
|
-
exports.
|
|
121
|
-
exports.
|
|
122
|
-
exports.
|
|
123
|
-
exports.
|
|
124
|
-
exports.
|
|
125
|
-
exports.
|
|
126
|
-
exports.
|
|
127
|
-
exports.
|
|
128
|
-
exports.
|
|
129
|
-
exports.
|
|
130
|
-
exports.
|
|
131
|
-
exports.
|
|
132
|
-
exports.
|
|
133
|
-
exports.
|
|
134
|
-
exports.
|
|
110
|
+
exports.MobileFieldDateTimePicker = index$y.MobileFieldDateTimePicker;
|
|
111
|
+
exports.MobileFieldCascaderPicker = index$z.MobileFieldCascaderPicker;
|
|
112
|
+
exports.MobileFieldCheckbox = index$A.MobileFieldCheckbox;
|
|
113
|
+
exports.MobileFieldRadio = index$B.MobileFieldRadio;
|
|
114
|
+
exports.MobileFieldArea = index$C.MobileFieldArea;
|
|
115
|
+
exports.MobileForm = index$D.MobileForm;
|
|
116
|
+
exports.MobileFormItem = index$E.MobileFormItem;
|
|
117
|
+
exports.MobileRadioGroup = index$F.MobileRadioGroup;
|
|
118
|
+
exports.MobileSearch = index$G.MobileSearch;
|
|
119
|
+
exports.MobileUploader = index$H.MobileUploader;
|
|
120
|
+
exports.MobileFieldUploader = index$I.MobileFieldUploader;
|
|
121
|
+
exports.MobileSubmitButton = index$J.MobileSubmitButton;
|
|
122
|
+
exports.MobileActionBar = index$K.MobileActionBar;
|
|
123
|
+
exports.MobileBackTop = index$L.MobileBackTop;
|
|
124
|
+
exports.MobileGrid = index$M.MobileGrid;
|
|
125
|
+
exports.MobileGridItem = index$N.MobileGridItem;
|
|
126
|
+
exports.MobileIndexBar = index$O.MobileIndexBar;
|
|
127
|
+
exports.MobileIndexAnchor = index$P.MobileIndexAnchor;
|
|
128
|
+
exports.MobileNavBar = index$Q.MobileNavBar;
|
|
129
|
+
exports.MobilePagination = index$R.MobilePagination;
|
|
130
|
+
exports.MobileSidebar = index$S.MobileSidebar;
|
|
131
|
+
exports.MobileSidebarItem = index$T.MobileSidebarItem;
|
|
132
|
+
exports.MobileTab = index$U.MobileTab;
|
|
133
|
+
exports.MobileTabs = index$V.MobileTabs;
|
|
134
|
+
exports.MobileTabbar = index$W.MobileTabbar;
|
|
135
|
+
exports.MobileTabbarItem = index$X.MobileTabbarItem;
|
|
136
|
+
exports.MobileTreeSelect = index$Y.MobileTreeSelect;
|
|
135
137
|
exports.closeDialog = functionCall.closeDialog;
|
|
136
138
|
exports.showConfirmDialog = functionCall.showConfirmDialog;
|
|
137
139
|
exports.showDialog = functionCall.showDialog;
|
|
@@ -33,32 +33,33 @@ const index$t = require("./form/fieldPicker/index.js");
|
|
|
33
33
|
const index$u = require("./form/fieldCalendarPicker/index.js");
|
|
34
34
|
const index$v = require("./form/fieldDatePicker/index.js");
|
|
35
35
|
const index$w = require("./form/fieldTimePicker/index.js");
|
|
36
|
-
const index$x = require("./form/
|
|
37
|
-
const index$y = require("./form/
|
|
38
|
-
const index$z = require("./form/
|
|
39
|
-
const index$A = require("./form/
|
|
40
|
-
const index$B = require("./form/
|
|
41
|
-
const index$C = require("./form/
|
|
42
|
-
const index$D = require("./form/
|
|
43
|
-
const index$E = require("./form/
|
|
44
|
-
const index$F = require("./form/
|
|
45
|
-
const index$G = require("./form/
|
|
46
|
-
const index$H = require("./form/
|
|
47
|
-
const index$I = require("./
|
|
48
|
-
const index$J = require("./navigation/
|
|
49
|
-
const index$K = require("./navigation/
|
|
50
|
-
const index$L = require("./navigation/
|
|
51
|
-
const index$M = require("./navigation/
|
|
52
|
-
const index$N = require("./navigation/
|
|
53
|
-
const index$O = require("./navigation/
|
|
54
|
-
const index$P = require("./navigation/
|
|
55
|
-
const index$Q = require("./navigation/
|
|
56
|
-
const index$R = require("./navigation/
|
|
57
|
-
const index$S = require("./navigation/
|
|
58
|
-
const index$T = require("./navigation/
|
|
59
|
-
const index$U = require("./navigation/
|
|
60
|
-
const index$V = require("./navigation/
|
|
61
|
-
const index$W = require("./navigation/
|
|
36
|
+
const index$x = require("./form/fieldDateTimePicker/index.js");
|
|
37
|
+
const index$y = require("./form/fieldCascaderPicker/index.js");
|
|
38
|
+
const index$z = require("./form/fieldCheckbox/index.js");
|
|
39
|
+
const index$A = require("./form/fieldRadio/index.js");
|
|
40
|
+
const index$B = require("./form/fieldArea/index.js");
|
|
41
|
+
const index$C = require("./form/form/index.js");
|
|
42
|
+
const index$D = require("./form/formItem/index.js");
|
|
43
|
+
const index$E = require("./form/radioGroup/index.js");
|
|
44
|
+
const index$F = require("./form/search/index.js");
|
|
45
|
+
const index$G = require("./form/uploader/index.js");
|
|
46
|
+
const index$H = require("./form/fieldUploader/index.js");
|
|
47
|
+
const index$I = require("./form/submitButton/index.js");
|
|
48
|
+
const index$J = require("./navigation/actionBar/index.js");
|
|
49
|
+
const index$K = require("./navigation/backTop/index.js");
|
|
50
|
+
const index$L = require("./navigation/grid/index.js");
|
|
51
|
+
const index$M = require("./navigation/gridItem/index.js");
|
|
52
|
+
const index$N = require("./navigation/indexBar/index.js");
|
|
53
|
+
const index$O = require("./navigation/indexAnchor/index.js");
|
|
54
|
+
const index$P = require("./navigation/navBar/index.js");
|
|
55
|
+
const index$Q = require("./navigation/pagination/index.js");
|
|
56
|
+
const index$R = require("./navigation/sidebar/index.js");
|
|
57
|
+
const index$S = require("./navigation/sidebarItem/index.js");
|
|
58
|
+
const index$T = require("./navigation/tab/index.js");
|
|
59
|
+
const index$U = require("./navigation/tabs/index.js");
|
|
60
|
+
const index$V = require("./navigation/tabbar/index.js");
|
|
61
|
+
const index$W = require("./navigation/tabbarItem/index.js");
|
|
62
|
+
const index$X = require("./navigation/treeSelect/index.js");
|
|
62
63
|
exports.MobileButton = index.MobileButton;
|
|
63
64
|
exports.MobileCell = index$1.MobileCell;
|
|
64
65
|
exports.MobileCellGroup = index$2.MobileCellGroup;
|
|
@@ -92,29 +93,30 @@ exports.MobileFieldPicker = index$t.MobileFieldPicker;
|
|
|
92
93
|
exports.MobileFieldCalendarPicker = index$u.MobileFieldCalendarPicker;
|
|
93
94
|
exports.MobileFieldDatePicker = index$v.MobileFieldDatePicker;
|
|
94
95
|
exports.MobileFieldTimePicker = index$w.MobileFieldTimePicker;
|
|
95
|
-
exports.
|
|
96
|
-
exports.
|
|
97
|
-
exports.
|
|
98
|
-
exports.
|
|
99
|
-
exports.
|
|
100
|
-
exports.
|
|
101
|
-
exports.
|
|
102
|
-
exports.
|
|
103
|
-
exports.
|
|
104
|
-
exports.
|
|
105
|
-
exports.
|
|
106
|
-
exports.
|
|
107
|
-
exports.
|
|
108
|
-
exports.
|
|
109
|
-
exports.
|
|
110
|
-
exports.
|
|
111
|
-
exports.
|
|
112
|
-
exports.
|
|
113
|
-
exports.
|
|
114
|
-
exports.
|
|
115
|
-
exports.
|
|
116
|
-
exports.
|
|
117
|
-
exports.
|
|
118
|
-
exports.
|
|
119
|
-
exports.
|
|
120
|
-
exports.
|
|
96
|
+
exports.MobileFieldDateTimePicker = index$x.MobileFieldDateTimePicker;
|
|
97
|
+
exports.MobileFieldCascaderPicker = index$y.MobileFieldCascaderPicker;
|
|
98
|
+
exports.MobileFieldCheckbox = index$z.MobileFieldCheckbox;
|
|
99
|
+
exports.MobileFieldRadio = index$A.MobileFieldRadio;
|
|
100
|
+
exports.MobileFieldArea = index$B.MobileFieldArea;
|
|
101
|
+
exports.MobileForm = index$C.MobileForm;
|
|
102
|
+
exports.MobileFormItem = index$D.MobileFormItem;
|
|
103
|
+
exports.MobileRadioGroup = index$E.MobileRadioGroup;
|
|
104
|
+
exports.MobileSearch = index$F.MobileSearch;
|
|
105
|
+
exports.MobileUploader = index$G.MobileUploader;
|
|
106
|
+
exports.MobileFieldUploader = index$H.MobileFieldUploader;
|
|
107
|
+
exports.MobileSubmitButton = index$I.MobileSubmitButton;
|
|
108
|
+
exports.MobileActionBar = index$J.MobileActionBar;
|
|
109
|
+
exports.MobileBackTop = index$K.MobileBackTop;
|
|
110
|
+
exports.MobileGrid = index$L.MobileGrid;
|
|
111
|
+
exports.MobileGridItem = index$M.MobileGridItem;
|
|
112
|
+
exports.MobileIndexBar = index$N.MobileIndexBar;
|
|
113
|
+
exports.MobileIndexAnchor = index$O.MobileIndexAnchor;
|
|
114
|
+
exports.MobileNavBar = index$P.MobileNavBar;
|
|
115
|
+
exports.MobilePagination = index$Q.MobilePagination;
|
|
116
|
+
exports.MobileSidebar = index$R.MobileSidebar;
|
|
117
|
+
exports.MobileSidebarItem = index$S.MobileSidebarItem;
|
|
118
|
+
exports.MobileTab = index$T.MobileTab;
|
|
119
|
+
exports.MobileTabs = index$U.MobileTabs;
|
|
120
|
+
exports.MobileTabbar = index$V.MobileTabbar;
|
|
121
|
+
exports.MobileTabbarItem = index$W.MobileTabbarItem;
|
|
122
|
+
exports.MobileTreeSelect = index$X.MobileTreeSelect;
|
package/lib/packages/mobile/src/components/form/fieldDateTimePicker/FieldDateTimePicker.vue.js
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
;/* empty css */
|
|
4
|
+
;/* empty css */
|
|
5
|
+
;/* empty css */
|
|
6
|
+
;/* empty css */
|
|
7
|
+
;/* empty css */
|
|
8
|
+
;/* empty css */
|
|
9
|
+
;/* empty css */
|
|
10
|
+
;/* empty css */
|
|
11
|
+
;/* empty css */
|
|
12
|
+
;/* empty css */
|
|
13
|
+
;/* empty css */
|
|
14
|
+
;/* empty css */
|
|
15
|
+
;/* empty css */
|
|
16
|
+
const vue = require("vue");
|
|
17
|
+
const index = require("../field/index.js");
|
|
18
|
+
const moment = require("../../../../../../node_modules/.pnpm/moment@2.30.1/node_modules/moment/dist/moment.js");
|
|
19
|
+
const dateUtil = require("../../../utils/dateUtil.js");
|
|
20
|
+
const index$2 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/picker-group/index.js");
|
|
21
|
+
const index$1 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/popup/index.js");
|
|
22
|
+
const index$3 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/date-picker/index.js");
|
|
23
|
+
const index$4 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/time-picker/index.js");
|
|
24
|
+
const index$5 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/icon/index.js");
|
|
25
|
+
const dateColumnsType = "year,month,day,hour,minute";
|
|
26
|
+
const _sfc_main = {
|
|
27
|
+
__name: "FieldDateTimePicker",
|
|
28
|
+
props: {
|
|
29
|
+
modelValue: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ""
|
|
32
|
+
},
|
|
33
|
+
dateTextFormat: {
|
|
34
|
+
//0:YYYYMMDD;1: YYYY-MM-DD;2:YYYY/MM/DD;3:YYYY年MM月DD日
|
|
35
|
+
type: String,
|
|
36
|
+
default: "1"
|
|
37
|
+
},
|
|
38
|
+
title: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: ""
|
|
41
|
+
},
|
|
42
|
+
disabled: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
readonly: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
"is-link": false
|
|
51
|
+
},
|
|
52
|
+
emits: ["update:modelValue"],
|
|
53
|
+
setup(__props, { emit: __emit }) {
|
|
54
|
+
const props = __props;
|
|
55
|
+
const fieldTextValue = vue.ref("");
|
|
56
|
+
const showPicker = vue.ref(false);
|
|
57
|
+
const emit = __emit;
|
|
58
|
+
let textFormat = dateUtil.parseDateFormatter(props.dateTextFormat, dateColumnsType);
|
|
59
|
+
let valueFormat = dateUtil.parseDateFormatter("0", dateColumnsType);
|
|
60
|
+
const currentDateTime = vue.computed(() => {
|
|
61
|
+
let date;
|
|
62
|
+
if (!props.modelValue) {
|
|
63
|
+
date = moment.default();
|
|
64
|
+
} else {
|
|
65
|
+
date = moment.default(props.modelValue, valueFormat);
|
|
66
|
+
}
|
|
67
|
+
const year = date.year();
|
|
68
|
+
const month = date.month() + 1;
|
|
69
|
+
const day = date.date();
|
|
70
|
+
const hours = date.hours();
|
|
71
|
+
const minutes = date.minutes();
|
|
72
|
+
date.seconds();
|
|
73
|
+
const dateValue = [year, month, day];
|
|
74
|
+
const timeValue = [hours, minutes];
|
|
75
|
+
return { dateValue, timeValue };
|
|
76
|
+
});
|
|
77
|
+
const dateFormatter = (type, option) => {
|
|
78
|
+
if (type === "year") {
|
|
79
|
+
option.text += "年";
|
|
80
|
+
} else if (type === "month") {
|
|
81
|
+
option.text += "月";
|
|
82
|
+
} else if (type === "day") {
|
|
83
|
+
option.text += "日";
|
|
84
|
+
}
|
|
85
|
+
return option;
|
|
86
|
+
};
|
|
87
|
+
const timeFormatter = (type, option) => {
|
|
88
|
+
if (type === "hour") {
|
|
89
|
+
option.text += "时";
|
|
90
|
+
} else if (type === "minute") {
|
|
91
|
+
option.text += "分";
|
|
92
|
+
} else if (type === "second") {
|
|
93
|
+
option.text += "秒";
|
|
94
|
+
}
|
|
95
|
+
return option;
|
|
96
|
+
};
|
|
97
|
+
vue.watch(
|
|
98
|
+
() => props.modelValue,
|
|
99
|
+
(value) => {
|
|
100
|
+
if (!value) {
|
|
101
|
+
fieldTextValue.value = "";
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
fieldTextValue.value = moment.default(value, valueFormat).format(textFormat);
|
|
105
|
+
},
|
|
106
|
+
{ immediate: true }
|
|
107
|
+
);
|
|
108
|
+
const onConfirm = () => {
|
|
109
|
+
const date = currentDateTime.value.dateValue;
|
|
110
|
+
const time = currentDateTime.value.timeValue;
|
|
111
|
+
const val = moment.default(
|
|
112
|
+
`${date[0]}${date[1]}${date[2]} ${time[0]}:${time[1]}`,
|
|
113
|
+
"YYYYMMDD HH:mm"
|
|
114
|
+
).format(valueFormat);
|
|
115
|
+
emit("update:modelValue", val);
|
|
116
|
+
showPicker.value = false;
|
|
117
|
+
};
|
|
118
|
+
return (_ctx, _cache) => {
|
|
119
|
+
const _component_van_icon = index$5.Icon;
|
|
120
|
+
const _component_van_date_picker = index$3.DatePicker;
|
|
121
|
+
const _component_van_time_picker = index$4.TimePicker;
|
|
122
|
+
const _component_van_picker_group = index$2.PickerGroup;
|
|
123
|
+
const _component_van_popup = index$1.Popup;
|
|
124
|
+
return vue.openBlock(), vue.createBlock(vue.unref(index.MobileField), vue.mergeProps(_ctx.$attrs, {
|
|
125
|
+
modelValue: vue.unref(fieldTextValue),
|
|
126
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => vue.isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
127
|
+
isLink: __props.readonly ? false : true,
|
|
128
|
+
readonly: "",
|
|
129
|
+
disabled: __props.disabled,
|
|
130
|
+
onClick: _cache[6] || (_cache[6] = () => {
|
|
131
|
+
if (!__props.readonly) {
|
|
132
|
+
showPicker.value = true;
|
|
133
|
+
}
|
|
134
|
+
})
|
|
135
|
+
}), vue.createSlots({
|
|
136
|
+
default: vue.withCtx(() => [
|
|
137
|
+
vue.createVNode(_component_van_popup, {
|
|
138
|
+
show: vue.unref(showPicker),
|
|
139
|
+
"onUpdate:show": _cache[4] || (_cache[4] = ($event) => vue.isRef(showPicker) ? showPicker.value = $event : null),
|
|
140
|
+
"destroy-on-close": "",
|
|
141
|
+
position: "bottom"
|
|
142
|
+
}, {
|
|
143
|
+
default: vue.withCtx(() => [
|
|
144
|
+
vue.createVNode(_component_van_picker_group, {
|
|
145
|
+
title: __props.title,
|
|
146
|
+
tabs: ["选择日期", "选择时间"],
|
|
147
|
+
"next-step-text": "下一步",
|
|
148
|
+
onConfirm,
|
|
149
|
+
onCancel: _cache[3] || (_cache[3] = ($event) => showPicker.value = false)
|
|
150
|
+
}, {
|
|
151
|
+
default: vue.withCtx(() => [
|
|
152
|
+
vue.createVNode(_component_van_date_picker, {
|
|
153
|
+
modelValue: vue.unref(currentDateTime).dateValue,
|
|
154
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.unref(currentDateTime).dateValue = $event),
|
|
155
|
+
formatter: dateFormatter,
|
|
156
|
+
readonly: false
|
|
157
|
+
}, null, 8, ["modelValue"]),
|
|
158
|
+
vue.createVNode(_component_van_time_picker, {
|
|
159
|
+
modelValue: vue.unref(currentDateTime).timeValue,
|
|
160
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.unref(currentDateTime).timeValue = $event),
|
|
161
|
+
readonly: false,
|
|
162
|
+
formatter: timeFormatter
|
|
163
|
+
}, null, 8, ["modelValue"])
|
|
164
|
+
]),
|
|
165
|
+
_: 1
|
|
166
|
+
}, 8, ["title"])
|
|
167
|
+
]),
|
|
168
|
+
_: 1
|
|
169
|
+
}, 8, ["show"])
|
|
170
|
+
]),
|
|
171
|
+
_: 2
|
|
172
|
+
}, [
|
|
173
|
+
!__props.readonly && !__props.disabled && vue.unref(fieldTextValue) ? {
|
|
174
|
+
name: "right-icon",
|
|
175
|
+
fn: vue.withCtx(() => [
|
|
176
|
+
vue.createVNode(_component_van_icon, {
|
|
177
|
+
name: "clear",
|
|
178
|
+
class: "custom-close-icon",
|
|
179
|
+
onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => emit("update:modelValue", null), ["stop"]))
|
|
180
|
+
})
|
|
181
|
+
]),
|
|
182
|
+
key: "0"
|
|
183
|
+
} : void 0
|
|
184
|
+
]), 1040, ["modelValue", "isLink", "disabled"]);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const FieldDateTimePicker = require("./FieldDateTimePicker.vue.js");
|
|
4
|
+
const install = require("../../../utils/install.js");
|
|
5
|
+
const MobileFieldDateTimePicker = install.default.withInstall(
|
|
6
|
+
"MobileFieldDateTimePicker",
|
|
7
|
+
FieldDateTimePicker.default
|
|
8
|
+
);
|
|
9
|
+
exports.MobileFieldDateTimePicker = MobileFieldDateTimePicker;
|
|
10
|
+
exports.default = MobileFieldDateTimePicker;
|