@fecp/mobile 1.0.5 → 1.0.7
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/moment@2.30.1/node_modules/moment/dist/moment.mjs +3997 -0
- package/es/packages/mobile/index.mjs +12 -0
- package/es/packages/mobile/src/components/all.mjs +10 -0
- package/es/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.mjs +156 -0
- package/es/packages/mobile/src/components/form/fieldCalendarPicker/index.mjs +10 -0
- package/es/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.mjs +142 -0
- package/es/packages/mobile/src/components/form/fieldCascaderPicker/index.mjs +10 -0
- package/es/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.mjs +110 -0
- package/es/packages/mobile/src/components/form/fieldDatePicker/index.mjs +10 -0
- package/es/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.mjs +114 -0
- package/es/packages/mobile/src/components/form/fieldPicker/index.mjs +10 -0
- package/es/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.mjs +110 -0
- package/es/packages/mobile/src/components/form/fieldTimePicker/index.mjs +10 -0
- package/lib/node_modules/.pnpm/moment@2.30.1/node_modules/moment/dist/moment.js +3997 -0
- package/lib/packages/mobile/index.js +68 -56
- package/lib/packages/mobile/src/components/all.js +56 -46
- package/lib/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.js +156 -0
- package/lib/packages/mobile/src/components/form/fieldCalendarPicker/index.js +10 -0
- package/lib/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.js +142 -0
- package/lib/packages/mobile/src/components/form/fieldCascaderPicker/index.js +10 -0
- package/lib/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.js +110 -0
- package/lib/packages/mobile/src/components/form/fieldDatePicker/index.js +10 -0
- package/lib/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.js +114 -0
- package/lib/packages/mobile/src/components/form/fieldPicker/index.js +10 -0
- package/lib/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.js +110 -0
- package/lib/packages/mobile/src/components/form/fieldTimePicker/index.js +10 -0
- package/package.json +1 -1
|
@@ -31,32 +31,38 @@ const index$r = require("./src/components/form/checkbox/index.js");
|
|
|
31
31
|
const index$s = require("./src/components/form/checkboxGroup/index.js");
|
|
32
32
|
const index$t = require("./src/components/form/datePicker/index.js");
|
|
33
33
|
const index$u = require("./src/components/form/field/index.js");
|
|
34
|
-
const index$v = require("./src/components/form/
|
|
35
|
-
const index$w = require("./src/components/form/
|
|
36
|
-
const index$x = require("./src/components/form/
|
|
37
|
-
const index$y = require("./src/components/form/
|
|
38
|
-
const index$z = require("./src/components/form/
|
|
39
|
-
const index$A = require("./src/components/form/
|
|
40
|
-
const index$B = require("./src/components/form/
|
|
41
|
-
const index$C = require("./src/components/form/
|
|
42
|
-
const index$D = require("./src/components/
|
|
43
|
-
const index$E = require("./src/components/
|
|
44
|
-
const index$F = require("./src/components/
|
|
45
|
-
const index$G = require("./src/components/
|
|
46
|
-
const index$H = require("./src/components/
|
|
47
|
-
const index$I = require("./src/components/navigation/
|
|
48
|
-
const index$J = require("./src/components/navigation/
|
|
49
|
-
const index$K = require("./src/components/navigation/
|
|
50
|
-
const index$L = require("./src/components/navigation/
|
|
51
|
-
const index$M = require("./src/components/navigation/
|
|
52
|
-
const index$N = require("./src/components/navigation/
|
|
53
|
-
const index$O = require("./src/components/navigation/
|
|
54
|
-
const index$P = require("./src/components/navigation/
|
|
55
|
-
const index$Q = require("./src/components/navigation/
|
|
56
|
-
const index$R = require("./src/components/navigation/
|
|
34
|
+
const index$v = require("./src/components/form/fieldPicker/index.js");
|
|
35
|
+
const index$w = require("./src/components/form/fieldCalendarPicker/index.js");
|
|
36
|
+
const index$x = require("./src/components/form/fieldDatePicker/index.js");
|
|
37
|
+
const index$y = require("./src/components/form/fieldTimePicker/index.js");
|
|
38
|
+
const index$z = require("./src/components/form/fieldCascaderPicker/index.js");
|
|
39
|
+
const index$A = require("./src/components/form/form/index.js");
|
|
40
|
+
const index$B = require("./src/components/form/picker/index.js");
|
|
41
|
+
const index$C = require("./src/components/form/pickerGroup/index.js");
|
|
42
|
+
const index$D = require("./src/components/form/radio/index.js");
|
|
43
|
+
const index$E = require("./src/components/form/radioGroup/index.js");
|
|
44
|
+
const index$F = require("./src/components/form/search/index.js");
|
|
45
|
+
const index$G = require("./src/components/form/timePicker/index.js");
|
|
46
|
+
const index$H = require("./src/components/form/uploader/index.js");
|
|
47
|
+
const index$I = require("./src/components/navigation/actionBar/index.js");
|
|
48
|
+
const index$J = require("./src/components/navigation/backTop/index.js");
|
|
49
|
+
const index$K = require("./src/components/navigation/grid/index.js");
|
|
50
|
+
const index$L = require("./src/components/navigation/gridItem/index.js");
|
|
51
|
+
const index$M = require("./src/components/navigation/indexBar/index.js");
|
|
52
|
+
const index$N = require("./src/components/navigation/indexAnchor/index.js");
|
|
53
|
+
const index$O = require("./src/components/navigation/navBar/index.js");
|
|
54
|
+
const index$P = require("./src/components/navigation/pagination/index.js");
|
|
55
|
+
const index$Q = require("./src/components/navigation/sidebar/index.js");
|
|
56
|
+
const index$R = require("./src/components/navigation/sidebarItem/index.js");
|
|
57
|
+
const index$S = require("./src/components/navigation/tab/index.js");
|
|
58
|
+
const index$T = require("./src/components/navigation/tabs/index.js");
|
|
59
|
+
const index$U = require("./src/components/navigation/tabbar/index.js");
|
|
60
|
+
const index$V = require("./src/components/navigation/tabbarItem/index.js");
|
|
61
|
+
const index$W = require("./src/components/navigation/treeSelect/index.js");
|
|
57
62
|
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");
|
|
58
|
-
const functionCall$1 = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/
|
|
59
|
-
const functionCall$2 = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/
|
|
63
|
+
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");
|
|
64
|
+
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");
|
|
65
|
+
const functionCall$3 = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/toast/function-call.js");
|
|
60
66
|
const index = {
|
|
61
67
|
install: (app) => {
|
|
62
68
|
for (let c in all) {
|
|
@@ -94,38 +100,44 @@ exports.MobileCheckbox = index$r.MobileCheckbox;
|
|
|
94
100
|
exports.MobileCheckboxGroup = index$s.MobileCheckboxGroup;
|
|
95
101
|
exports.MobileDatePicker = index$t.MobileDatePicker;
|
|
96
102
|
exports.MobileField = index$u.MobileField;
|
|
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.
|
|
103
|
+
exports.MobileFieldPicker = index$v.MobileFieldPicker;
|
|
104
|
+
exports.MobileFieldCalendarPicker = index$w.MobileFieldCalendarPicker;
|
|
105
|
+
exports.MobileFieldDatePicker = index$x.MobileFieldDatePicker;
|
|
106
|
+
exports.MobileFieldTimePicker = index$y.MobileFieldTimePicker;
|
|
107
|
+
exports.MobileFieldCascaderPicker = index$z.MobileFieldCascaderPicker;
|
|
108
|
+
exports.MobileForm = index$A.MobileForm;
|
|
109
|
+
exports.MobilePicker = index$B.MobilePicker;
|
|
110
|
+
exports.MobilePickerGroup = index$C.MobilePickerGroup;
|
|
111
|
+
exports.MobileRadio = index$D.MobileRadio;
|
|
112
|
+
exports.MobileRadioGroup = index$E.MobileRadioGroup;
|
|
113
|
+
exports.MobileSearch = index$F.MobileSearch;
|
|
114
|
+
exports.MobileTimePicker = index$G.MobileTimePicker;
|
|
115
|
+
exports.MobileUploader = index$H.MobileUploader;
|
|
116
|
+
exports.MobileActionBar = index$I.MobileActionBar;
|
|
117
|
+
exports.MobileBackTop = index$J.MobileBackTop;
|
|
118
|
+
exports.MobileGrid = index$K.MobileGrid;
|
|
119
|
+
exports.MobileGridItem = index$L.MobileGridItem;
|
|
120
|
+
exports.MobileIndexBar = index$M.MobileIndexBar;
|
|
121
|
+
exports.MobileIndexAnchor = index$N.MobileIndexAnchor;
|
|
122
|
+
exports.MobileNavBar = index$O.MobileNavBar;
|
|
123
|
+
exports.MobilePagination = index$P.MobilePagination;
|
|
124
|
+
exports.MobileSidebar = index$Q.MobileSidebar;
|
|
125
|
+
exports.MobileSidebarItem = index$R.MobileSidebarItem;
|
|
126
|
+
exports.MobileTab = index$S.MobileTab;
|
|
127
|
+
exports.MobileTabs = index$T.MobileTabs;
|
|
128
|
+
exports.MobileTabbar = index$U.MobileTabbar;
|
|
129
|
+
exports.MobileTabbarItem = index$V.MobileTabbarItem;
|
|
130
|
+
exports.MobileTreeSelect = index$W.MobileTreeSelect;
|
|
120
131
|
exports.closeDialog = functionCall.closeDialog;
|
|
121
132
|
exports.showConfirmDialog = functionCall.showConfirmDialog;
|
|
122
133
|
exports.showDialog = functionCall.showDialog;
|
|
123
|
-
exports.
|
|
124
|
-
exports.
|
|
125
|
-
exports.
|
|
126
|
-
exports.
|
|
127
|
-
exports.
|
|
128
|
-
exports.
|
|
129
|
-
exports.
|
|
130
|
-
exports.
|
|
134
|
+
exports.showImagePreview = functionCall$1.showImagePreview;
|
|
135
|
+
exports.closeNotify = functionCall$2.closeNotify;
|
|
136
|
+
exports.showNotify = functionCall$2.showNotify;
|
|
137
|
+
exports.allowMultipleToast = functionCall$3.allowMultipleToast;
|
|
138
|
+
exports.closeToast = functionCall$3.closeToast;
|
|
139
|
+
exports.showFailToast = functionCall$3.showFailToast;
|
|
140
|
+
exports.showLoadingToast = functionCall$3.showLoadingToast;
|
|
141
|
+
exports.showSuccessToast = functionCall$3.showSuccessToast;
|
|
142
|
+
exports.showToast = functionCall$3.showToast;
|
|
131
143
|
exports.default = index;
|
|
@@ -30,29 +30,34 @@ const index$q = require("./form/checkbox/index.js");
|
|
|
30
30
|
const index$r = require("./form/checkboxGroup/index.js");
|
|
31
31
|
const index$s = require("./form/datePicker/index.js");
|
|
32
32
|
const index$t = require("./form/field/index.js");
|
|
33
|
-
const index$u = require("./form/
|
|
34
|
-
const index$v = require("./form/
|
|
35
|
-
const index$w = require("./form/
|
|
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("./
|
|
42
|
-
const index$D = require("./
|
|
43
|
-
const index$E = require("./
|
|
44
|
-
const index$F = require("./
|
|
45
|
-
const index$G = require("./
|
|
46
|
-
const index$H = require("./navigation/
|
|
47
|
-
const index$I = require("./navigation/
|
|
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/
|
|
33
|
+
const index$u = require("./form/fieldPicker/index.js");
|
|
34
|
+
const index$v = require("./form/fieldCalendarPicker/index.js");
|
|
35
|
+
const index$w = require("./form/fieldDatePicker/index.js");
|
|
36
|
+
const index$x = require("./form/fieldTimePicker/index.js");
|
|
37
|
+
const index$y = require("./form/fieldCascaderPicker/index.js");
|
|
38
|
+
const index$z = require("./form/form/index.js");
|
|
39
|
+
const index$A = require("./form/picker/index.js");
|
|
40
|
+
const index$B = require("./form/pickerGroup/index.js");
|
|
41
|
+
const index$C = require("./form/radio/index.js");
|
|
42
|
+
const index$D = require("./form/radioGroup/index.js");
|
|
43
|
+
const index$E = require("./form/search/index.js");
|
|
44
|
+
const index$F = require("./form/timePicker/index.js");
|
|
45
|
+
const index$G = require("./form/uploader/index.js");
|
|
46
|
+
const index$H = require("./navigation/actionBar/index.js");
|
|
47
|
+
const index$I = require("./navigation/backTop/index.js");
|
|
48
|
+
const index$J = require("./navigation/grid/index.js");
|
|
49
|
+
const index$K = require("./navigation/gridItem/index.js");
|
|
50
|
+
const index$L = require("./navigation/indexBar/index.js");
|
|
51
|
+
const index$M = require("./navigation/indexAnchor/index.js");
|
|
52
|
+
const index$N = require("./navigation/navBar/index.js");
|
|
53
|
+
const index$O = require("./navigation/pagination/index.js");
|
|
54
|
+
const index$P = require("./navigation/sidebar/index.js");
|
|
55
|
+
const index$Q = require("./navigation/sidebarItem/index.js");
|
|
56
|
+
const index$R = require("./navigation/tab/index.js");
|
|
57
|
+
const index$S = require("./navigation/tabs/index.js");
|
|
58
|
+
const index$T = require("./navigation/tabbar/index.js");
|
|
59
|
+
const index$U = require("./navigation/tabbarItem/index.js");
|
|
60
|
+
const index$V = require("./navigation/treeSelect/index.js");
|
|
56
61
|
exports.MobileButton = index.MobileButton;
|
|
57
62
|
exports.MobileCell = index$1.MobileCell;
|
|
58
63
|
exports.MobileCellGroup = index$2.MobileCellGroup;
|
|
@@ -83,26 +88,31 @@ exports.MobileCheckbox = index$q.MobileCheckbox;
|
|
|
83
88
|
exports.MobileCheckboxGroup = index$r.MobileCheckboxGroup;
|
|
84
89
|
exports.MobileDatePicker = index$s.MobileDatePicker;
|
|
85
90
|
exports.MobileField = index$t.MobileField;
|
|
86
|
-
exports.
|
|
87
|
-
exports.
|
|
88
|
-
exports.
|
|
89
|
-
exports.
|
|
90
|
-
exports.
|
|
91
|
-
exports.
|
|
92
|
-
exports.
|
|
93
|
-
exports.
|
|
94
|
-
exports.
|
|
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.
|
|
91
|
+
exports.MobileFieldPicker = index$u.MobileFieldPicker;
|
|
92
|
+
exports.MobileFieldCalendarPicker = index$v.MobileFieldCalendarPicker;
|
|
93
|
+
exports.MobileFieldDatePicker = index$w.MobileFieldDatePicker;
|
|
94
|
+
exports.MobileFieldTimePicker = index$x.MobileFieldTimePicker;
|
|
95
|
+
exports.MobileFieldCascaderPicker = index$y.MobileFieldCascaderPicker;
|
|
96
|
+
exports.MobileForm = index$z.MobileForm;
|
|
97
|
+
exports.MobilePicker = index$A.MobilePicker;
|
|
98
|
+
exports.MobilePickerGroup = index$B.MobilePickerGroup;
|
|
99
|
+
exports.MobileRadio = index$C.MobileRadio;
|
|
100
|
+
exports.MobileRadioGroup = index$D.MobileRadioGroup;
|
|
101
|
+
exports.MobileSearch = index$E.MobileSearch;
|
|
102
|
+
exports.MobileTimePicker = index$F.MobileTimePicker;
|
|
103
|
+
exports.MobileUploader = index$G.MobileUploader;
|
|
104
|
+
exports.MobileActionBar = index$H.MobileActionBar;
|
|
105
|
+
exports.MobileBackTop = index$I.MobileBackTop;
|
|
106
|
+
exports.MobileGrid = index$J.MobileGrid;
|
|
107
|
+
exports.MobileGridItem = index$K.MobileGridItem;
|
|
108
|
+
exports.MobileIndexBar = index$L.MobileIndexBar;
|
|
109
|
+
exports.MobileIndexAnchor = index$M.MobileIndexAnchor;
|
|
110
|
+
exports.MobileNavBar = index$N.MobileNavBar;
|
|
111
|
+
exports.MobilePagination = index$O.MobilePagination;
|
|
112
|
+
exports.MobileSidebar = index$P.MobileSidebar;
|
|
113
|
+
exports.MobileSidebarItem = index$Q.MobileSidebarItem;
|
|
114
|
+
exports.MobileTab = index$R.MobileTab;
|
|
115
|
+
exports.MobileTabs = index$S.MobileTabs;
|
|
116
|
+
exports.MobileTabbar = index$T.MobileTabbar;
|
|
117
|
+
exports.MobileTabbarItem = index$U.MobileTabbarItem;
|
|
118
|
+
exports.MobileTreeSelect = index$V.MobileTreeSelect;
|
package/lib/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.js
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
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
|
+
;/* empty css */
|
|
17
|
+
;/* empty css */
|
|
18
|
+
;/* empty css */
|
|
19
|
+
;/* empty css */
|
|
20
|
+
;/* empty css */
|
|
21
|
+
const vue = require("vue");
|
|
22
|
+
const moment = require("../../../../../../node_modules/.pnpm/moment@2.30.1/node_modules/moment/dist/moment.js");
|
|
23
|
+
const index = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/field/index.js");
|
|
24
|
+
const index$1 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/calendar/index.js");
|
|
25
|
+
const _sfc_main = {
|
|
26
|
+
__name: "FieldCalendarPicker",
|
|
27
|
+
props: {
|
|
28
|
+
title: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "日期选择"
|
|
31
|
+
},
|
|
32
|
+
calendarType: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "single"
|
|
35
|
+
},
|
|
36
|
+
textFormat: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: "YYYY-MM-DD"
|
|
39
|
+
},
|
|
40
|
+
valueFormat: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: "YYYYMMDD"
|
|
43
|
+
},
|
|
44
|
+
modelValue: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ""
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
emits: ["update:modelValue"],
|
|
50
|
+
setup(__props, { emit: __emit }) {
|
|
51
|
+
const props = __props;
|
|
52
|
+
const fieldTextValue = vue.ref("");
|
|
53
|
+
const showCalendar = vue.ref(false);
|
|
54
|
+
const emit = __emit;
|
|
55
|
+
const defaultDate = vue.computed({
|
|
56
|
+
get: () => {
|
|
57
|
+
if (props.calendarType == "single") {
|
|
58
|
+
try {
|
|
59
|
+
return moment.default(props.modelValue, props.valueFormat).toDate();
|
|
60
|
+
} catch (error) {
|
|
61
|
+
return /* @__PURE__ */ new Date();
|
|
62
|
+
}
|
|
63
|
+
} else if (props.calendarType == "multiple") {
|
|
64
|
+
try {
|
|
65
|
+
return props.modelValue.map(
|
|
66
|
+
(value) => moment.default(value, props.valueFormat).toDate()
|
|
67
|
+
);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
return [/* @__PURE__ */ new Date()];
|
|
70
|
+
}
|
|
71
|
+
} else if (props.calendarType == "range") {
|
|
72
|
+
try {
|
|
73
|
+
return props.modelValue.map(
|
|
74
|
+
(value) => moment.default(value, props.valueFormat).toDate()
|
|
75
|
+
);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
set: (val) => {
|
|
82
|
+
emit("update:modelValue", val);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
vue.watch(
|
|
86
|
+
() => props.modelValue,
|
|
87
|
+
(value) => {
|
|
88
|
+
if (props.calendarType == "single") {
|
|
89
|
+
fieldTextValue.value = moment.default(value, props.valueFormat).format(
|
|
90
|
+
props.textFormat
|
|
91
|
+
);
|
|
92
|
+
} else if (props.calendarType == "multiple") {
|
|
93
|
+
if (Array.isArray(value)) {
|
|
94
|
+
fieldTextValue.value = `选择了 ${value.length} 个日期`;
|
|
95
|
+
}
|
|
96
|
+
} else if (props.calendarType == "range") {
|
|
97
|
+
if (Array.isArray(value)) {
|
|
98
|
+
const [start, end] = value;
|
|
99
|
+
fieldTextValue.value = `${moment.default(start, props.valueFormat).format(
|
|
100
|
+
props.textFormat
|
|
101
|
+
)} 至 ${moment.default(end, props.valueFormat).format(props.textFormat)}`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{ immediate: true }
|
|
106
|
+
);
|
|
107
|
+
const onConfirm = (values) => {
|
|
108
|
+
if (props.calendarType == "single") {
|
|
109
|
+
defaultDate.value = moment.default(values).format(props.valueFormat);
|
|
110
|
+
} else if (props.calendarType == "multiple") {
|
|
111
|
+
defaultDate.value = values.map(
|
|
112
|
+
(value) => moment.default(value).format(props.valueFormat)
|
|
113
|
+
);
|
|
114
|
+
} else if (props.calendarType == "range") {
|
|
115
|
+
defaultDate.value = values.map(
|
|
116
|
+
(value) => moment.default(value).format(props.valueFormat)
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
showCalendar.value = false;
|
|
120
|
+
};
|
|
121
|
+
return (_ctx, _cache) => {
|
|
122
|
+
const _component_van_field = index.Field;
|
|
123
|
+
const _component_van_calendar = index$1.Calendar;
|
|
124
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
125
|
+
vue.createVNode(_component_van_field, vue.mergeProps({
|
|
126
|
+
modelValue: vue.unref(fieldTextValue),
|
|
127
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
128
|
+
"is-link": "",
|
|
129
|
+
readonly: "",
|
|
130
|
+
name: "picker"
|
|
131
|
+
}, _ctx.$attrs, {
|
|
132
|
+
onClick: _cache[1] || (_cache[1] = ($event) => showCalendar.value = true)
|
|
133
|
+
}), vue.createSlots({ _: 2 }, [
|
|
134
|
+
vue.renderList(_ctx.$slots, (item, key) => {
|
|
135
|
+
return {
|
|
136
|
+
name: key,
|
|
137
|
+
fn: vue.withCtx(() => [
|
|
138
|
+
vue.renderSlot(_ctx.$slots, key)
|
|
139
|
+
])
|
|
140
|
+
};
|
|
141
|
+
})
|
|
142
|
+
]), 1040, ["modelValue"]),
|
|
143
|
+
vue.createVNode(_component_van_calendar, vue.mergeProps(_ctx.$attrs, {
|
|
144
|
+
show: vue.unref(showCalendar),
|
|
145
|
+
"onUpdate:show": _cache[2] || (_cache[2] = ($event) => vue.isRef(showCalendar) ? showCalendar.value = $event : null),
|
|
146
|
+
"default-date": vue.unref(defaultDate),
|
|
147
|
+
title: __props.title,
|
|
148
|
+
type: __props.calendarType,
|
|
149
|
+
"switch-mode": "year-month",
|
|
150
|
+
onConfirm
|
|
151
|
+
}), null, 16, ["show", "default-date", "title", "type"])
|
|
152
|
+
], 64);
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const FieldCalendarPicker = require("./FieldCalendarPicker.vue.js");
|
|
4
|
+
const install = require("../../../utils/install.js");
|
|
5
|
+
const MobileFieldCalendarPicker = install.default.withInstall(
|
|
6
|
+
"MobileFieldCalendarPicker",
|
|
7
|
+
FieldCalendarPicker.default
|
|
8
|
+
);
|
|
9
|
+
exports.MobileFieldCalendarPicker = MobileFieldCalendarPicker;
|
|
10
|
+
exports.default = MobileFieldCalendarPicker;
|
package/lib/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
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("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/field/index.js");
|
|
18
|
+
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");
|
|
19
|
+
const index$2 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/cascader/index.js");
|
|
20
|
+
const _sfc_main = {
|
|
21
|
+
__name: "fieldCascaderPicker",
|
|
22
|
+
props: {
|
|
23
|
+
options: {
|
|
24
|
+
type: Array,
|
|
25
|
+
default: []
|
|
26
|
+
},
|
|
27
|
+
fieldNames: {
|
|
28
|
+
type: Object,
|
|
29
|
+
default: {
|
|
30
|
+
text: "text",
|
|
31
|
+
value: "value",
|
|
32
|
+
children: "children"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
modelValue: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: ""
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
emits: ["update:modelValue"],
|
|
41
|
+
setup(__props, { emit: __emit }) {
|
|
42
|
+
const props = __props;
|
|
43
|
+
const fieldTextValue = vue.ref("");
|
|
44
|
+
const showPicker = vue.ref(false);
|
|
45
|
+
const emit = __emit;
|
|
46
|
+
const pickerValue = vue.computed({
|
|
47
|
+
get: () => {
|
|
48
|
+
const value = props.modelValue.split("/");
|
|
49
|
+
return value[value.length - 1];
|
|
50
|
+
},
|
|
51
|
+
set: (val) => {
|
|
52
|
+
emit("update:modelValue", val);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
function getDisplayValue(options, fieldNames, modelValue) {
|
|
56
|
+
const { text, value, children } = fieldNames;
|
|
57
|
+
const values = modelValue.split("/");
|
|
58
|
+
const displayValues = [];
|
|
59
|
+
function findValueInOptions(currentOptions, targetValue) {
|
|
60
|
+
for (const option of currentOptions) {
|
|
61
|
+
if (option[value] === targetValue) {
|
|
62
|
+
return option[text];
|
|
63
|
+
}
|
|
64
|
+
if (option[children] && option[children].length > 0) {
|
|
65
|
+
const result = findValueInOptions(option[children], targetValue);
|
|
66
|
+
if (result) {
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
for (const val of values) {
|
|
74
|
+
const displayValue = findValueInOptions(options, val);
|
|
75
|
+
if (displayValue) {
|
|
76
|
+
displayValues.push(displayValue);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return displayValues.join("/");
|
|
80
|
+
}
|
|
81
|
+
vue.watch(
|
|
82
|
+
() => props.modelValue,
|
|
83
|
+
(value) => {
|
|
84
|
+
fieldTextValue.value = getDisplayValue(
|
|
85
|
+
props.options,
|
|
86
|
+
props.fieldNames,
|
|
87
|
+
value
|
|
88
|
+
);
|
|
89
|
+
},
|
|
90
|
+
{ immediate: true }
|
|
91
|
+
);
|
|
92
|
+
const onFinish = ({ selectedOptions }) => {
|
|
93
|
+
pickerValue.value = selectedOptions.map((option) => option[props.fieldNames.value]).join("/");
|
|
94
|
+
showPicker.value = false;
|
|
95
|
+
};
|
|
96
|
+
return (_ctx, _cache) => {
|
|
97
|
+
const _component_van_field = index.Field;
|
|
98
|
+
const _component_van_cascader = index$2.Cascader;
|
|
99
|
+
const _component_van_popup = index$1.Popup;
|
|
100
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
101
|
+
vue.createVNode(_component_van_field, vue.mergeProps({
|
|
102
|
+
modelValue: vue.unref(fieldTextValue),
|
|
103
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
104
|
+
"is-link": "",
|
|
105
|
+
readonly: "",
|
|
106
|
+
name: "picker"
|
|
107
|
+
}, _ctx.$attrs, {
|
|
108
|
+
onClick: _cache[1] || (_cache[1] = ($event) => showPicker.value = true)
|
|
109
|
+
}), vue.createSlots({ _: 2 }, [
|
|
110
|
+
vue.renderList(_ctx.$slots, (item, key) => {
|
|
111
|
+
return {
|
|
112
|
+
name: key,
|
|
113
|
+
fn: vue.withCtx(() => [
|
|
114
|
+
vue.renderSlot(_ctx.$slots, key)
|
|
115
|
+
])
|
|
116
|
+
};
|
|
117
|
+
})
|
|
118
|
+
]), 1040, ["modelValue"]),
|
|
119
|
+
vue.createVNode(_component_van_popup, {
|
|
120
|
+
show: vue.unref(showPicker),
|
|
121
|
+
"onUpdate:show": _cache[4] || (_cache[4] = ($event) => vue.isRef(showPicker) ? showPicker.value = $event : null),
|
|
122
|
+
"destroy-on-close": "",
|
|
123
|
+
position: "bottom"
|
|
124
|
+
}, {
|
|
125
|
+
default: vue.withCtx(() => [
|
|
126
|
+
vue.createVNode(_component_van_cascader, vue.mergeProps(_ctx.$attrs, {
|
|
127
|
+
modelValue: vue.unref(pickerValue),
|
|
128
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.isRef(pickerValue) ? pickerValue.value = $event : null),
|
|
129
|
+
options: __props.options,
|
|
130
|
+
"field-names": _ctx.columnsFieldNames,
|
|
131
|
+
placeholder: "请选择",
|
|
132
|
+
onFinish,
|
|
133
|
+
onClose: _cache[3] || (_cache[3] = ($event) => showPicker.value = false)
|
|
134
|
+
}), null, 16, ["modelValue", "options", "field-names"])
|
|
135
|
+
]),
|
|
136
|
+
_: 1
|
|
137
|
+
}, 8, ["show"])
|
|
138
|
+
], 64);
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const fieldCascaderPicker = require("./fieldCascaderPicker.vue.js");
|
|
4
|
+
const install = require("../../../utils/install.js");
|
|
5
|
+
const MobileFieldCascaderPicker = install.default.withInstall(
|
|
6
|
+
"MobileFieldCascaderPicker",
|
|
7
|
+
fieldCascaderPicker.default
|
|
8
|
+
);
|
|
9
|
+
exports.MobileFieldCascaderPicker = MobileFieldCascaderPicker;
|
|
10
|
+
exports.default = MobileFieldCascaderPicker;
|