@fecp/mobile 1.0.25 → 1.0.27
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/mobile.css +7 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/index.mjs +38 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/adapters.mjs +60 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/fetch.mjs +174 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/xhr.mjs +138 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/axios.mjs +50 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/cancel/CancelToken.mjs +99 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/cancel/CanceledError.mjs +12 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/cancel/isCancel.mjs +6 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/Axios.mjs +181 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/AxiosError.mjs +76 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/AxiosHeaders.mjs +223 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/InterceptorManager.mjs +65 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/buildFullPath.mjs +12 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/dispatchRequest.mjs +52 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/mergeConfig.mjs +83 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/settle.mjs +18 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/transformData.mjs +17 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/defaults/index.mjs +116 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/defaults/transitional.mjs +8 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/env/data.mjs +4 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/AxiosURLSearchParams.mjs +34 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/HttpStatusCode.mjs +71 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/bind.mjs +8 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/buildURL.mjs +34 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/combineURLs.mjs +6 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/composeSignals.mjs +39 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/cookies.mjs +36 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/formDataToJSON.mjs +54 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/isAbsoluteURL.mjs +6 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/isAxiosError.mjs +7 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/isURLSameOrigin.mjs +11 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/null.mjs +4 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/parseHeaders.mjs +47 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/parseProtocol.mjs +7 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/progressEventReducer.mjs +41 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/resolveConfig.mjs +42 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/speedometer.mjs +36 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/spread.mjs +8 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/throttle.mjs +35 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/toFormData.mjs +114 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/toURLEncodedForm.mjs +17 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/trackStream.mjs +80 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/validator.mjs +67 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/classes/Blob.mjs +4 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/classes/FormData.mjs +4 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/classes/URLSearchParams.mjs +5 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/index.mjs +15 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/common/utils.mjs +15 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/index.mjs +9 -0
- package/es/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/utils.mjs +364 -0
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/composables/use-tab-status.mjs +4 -2
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/list/List.mjs +145 -0
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/list/index.mjs +8 -0
- package/es/packages/mobile/index.mjs +2 -0
- package/es/packages/mobile/src/axios/config.mjs +105 -0
- package/es/packages/mobile/src/axios/index.mjs +11 -0
- package/es/packages/mobile/src/components/all.mjs +2 -0
- package/es/packages/mobile/src/components/dataDisplay/list/List.vue.mjs +100 -0
- package/es/packages/mobile/src/components/dataDisplay/list/index.mjs +7 -0
- package/es/packages/mobile/src/components/form/field/Field.vue.mjs +6 -2
- package/es/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.mjs +22 -7
- package/es/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.mjs +27 -9
- package/es/packages/mobile/src/components/form/fieldCheckbox/FieldCheckbox.vue.mjs +14 -3
- package/es/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.mjs +24 -9
- package/es/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.mjs +23 -8
- package/es/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.mjs +24 -9
- package/es/packages/mobile/src/utils/dataSourceUtil.mjs +71 -0
- package/lib/mobile.css +7 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/index.js +38 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/adapters.js +60 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/fetch.js +174 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/adapters/xhr.js +138 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/axios.js +50 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/cancel/CancelToken.js +99 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/cancel/CanceledError.js +12 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/cancel/isCancel.js +6 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/Axios.js +181 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/AxiosError.js +76 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/AxiosHeaders.js +223 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/InterceptorManager.js +65 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/buildFullPath.js +12 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/dispatchRequest.js +52 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/mergeConfig.js +83 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/settle.js +18 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/core/transformData.js +17 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/defaults/index.js +116 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/defaults/transitional.js +8 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/env/data.js +4 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +34 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/bind.js +8 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/buildURL.js +34 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/combineURLs.js +6 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/composeSignals.js +39 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/cookies.js +36 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/formDataToJSON.js +54 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/isAbsoluteURL.js +6 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/isAxiosError.js +7 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/isURLSameOrigin.js +11 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/null.js +4 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/parseHeaders.js +47 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/parseProtocol.js +7 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/progressEventReducer.js +41 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/resolveConfig.js +42 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/speedometer.js +36 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/spread.js +8 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/throttle.js +35 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/toFormData.js +114 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/toURLEncodedForm.js +17 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/trackStream.js +80 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/helpers/validator.js +67 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/classes/Blob.js +4 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/classes/FormData.js +4 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +5 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/browser/index.js +15 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/common/utils.js +15 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/platform/index.js +9 -0
- package/lib/node_modules/.pnpm/axios@1.8.4/node_modules/axios/lib/utils.js +364 -0
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/composables/use-tab-status.js +3 -1
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/list/List.js +145 -0
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/list/index.js +7 -0
- package/lib/packages/mobile/index.js +92 -90
- package/lib/packages/mobile/src/axios/config.js +105 -0
- package/lib/packages/mobile/src/axios/index.js +11 -0
- package/lib/packages/mobile/src/components/all.js +92 -90
- package/lib/packages/mobile/src/components/dataDisplay/list/List.vue.js +100 -0
- package/lib/packages/mobile/src/components/dataDisplay/list/index.js +7 -0
- package/lib/packages/mobile/src/components/form/field/Field.vue.js +5 -1
- package/lib/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.js +21 -6
- package/lib/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.js +26 -8
- package/lib/packages/mobile/src/components/form/fieldCheckbox/FieldCheckbox.vue.js +13 -2
- package/lib/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.js +23 -8
- package/lib/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.js +22 -7
- package/lib/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.js +23 -8
- package/lib/packages/mobile/src/utils/dataSourceUtil.js +71 -0
- package/package.json +1 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { computed, ref, createBlock, openBlock, unref, isRef, withCtx, renderSlot } from "vue";
|
|
5
|
+
import { useDataSource } from "../../../utils/dataSourceUtil.mjs";
|
|
6
|
+
import { List } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/list/index.mjs";
|
|
7
|
+
const _sfc_main = {
|
|
8
|
+
__name: "List",
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: []
|
|
13
|
+
},
|
|
14
|
+
disabledLoad: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false
|
|
17
|
+
},
|
|
18
|
+
offset: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "0"
|
|
21
|
+
},
|
|
22
|
+
direction: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "down"
|
|
25
|
+
},
|
|
26
|
+
dataSource: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
29
|
+
},
|
|
30
|
+
params: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: {}
|
|
33
|
+
},
|
|
34
|
+
pageSize: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "10"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
emits: ["update:modelValue"],
|
|
40
|
+
setup(__props, { emit: __emit }) {
|
|
41
|
+
const props = __props;
|
|
42
|
+
const emit = __emit;
|
|
43
|
+
const tableData = computed({
|
|
44
|
+
get: () => {
|
|
45
|
+
return props.modelValue;
|
|
46
|
+
},
|
|
47
|
+
set: (val) => {
|
|
48
|
+
emit("update:modelValue", val);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const finished = ref(false);
|
|
52
|
+
const error = ref(false);
|
|
53
|
+
const loading = ref(false);
|
|
54
|
+
let pageNo = 1;
|
|
55
|
+
const dataSource = useDataSource(props.dataSource);
|
|
56
|
+
call();
|
|
57
|
+
function onLoad() {
|
|
58
|
+
loading.value = true;
|
|
59
|
+
pageNo++;
|
|
60
|
+
call();
|
|
61
|
+
}
|
|
62
|
+
function call() {
|
|
63
|
+
dataSource.load({ ...props.params, pageNo, pageSize: props.pageSize }).then((res) => {
|
|
64
|
+
var _a;
|
|
65
|
+
const data = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.records) || (res == null ? void 0 : res.data) || res;
|
|
66
|
+
tableData.value.push(...data);
|
|
67
|
+
if (data.length < props.pageSize) {
|
|
68
|
+
finished.value = true;
|
|
69
|
+
}
|
|
70
|
+
loading.value = false;
|
|
71
|
+
}).catch((err) => {
|
|
72
|
+
console.error(err);
|
|
73
|
+
error.value = true;
|
|
74
|
+
loading.value = false;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return (_ctx, _cache) => {
|
|
78
|
+
const _component_van_list = List;
|
|
79
|
+
return openBlock(), createBlock(_component_van_list, {
|
|
80
|
+
loading: unref(loading),
|
|
81
|
+
"onUpdate:loading": _cache[0] || (_cache[0] = ($event) => isRef(loading) ? loading.value = $event : null),
|
|
82
|
+
error: unref(error),
|
|
83
|
+
"onUpdate:error": _cache[1] || (_cache[1] = ($event) => isRef(error) ? error.value = $event : null),
|
|
84
|
+
finished: unref(finished),
|
|
85
|
+
disabled: __props.disabledLoad,
|
|
86
|
+
offset: __props.offset,
|
|
87
|
+
"finished-text": "没有更多了",
|
|
88
|
+
onLoad
|
|
89
|
+
}, {
|
|
90
|
+
default: withCtx(() => [
|
|
91
|
+
renderSlot(_ctx.$slots, "default")
|
|
92
|
+
]),
|
|
93
|
+
_: 3
|
|
94
|
+
}, 8, ["loading", "error", "finished", "disabled", "offset"]);
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
export {
|
|
99
|
+
_sfc_main as default
|
|
100
|
+
};
|
|
@@ -3,14 +3,18 @@
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { createElementBlock, openBlock, Fragment, createVNode, renderSlot,
|
|
6
|
+
import { createElementBlock, openBlock, Fragment, createVNode, renderSlot, mergeProps, createSlots, renderList, withCtx } from "vue";
|
|
7
|
+
/* empty css */
|
|
7
8
|
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
8
9
|
import { Field } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/field/index.mjs";
|
|
9
10
|
const _sfc_main = {};
|
|
10
11
|
function _sfc_render(_ctx, _cache) {
|
|
11
12
|
const _component_van_field = Field;
|
|
12
13
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
13
|
-
createVNode(_component_van_field,
|
|
14
|
+
createVNode(_component_van_field, mergeProps(_ctx.$attrs, {
|
|
15
|
+
clearable: "",
|
|
16
|
+
"clear-trigger": "always"
|
|
17
|
+
}), createSlots({ _: 2 }, [
|
|
14
18
|
renderList(_ctx.$slots, (item, key) => {
|
|
15
19
|
return {
|
|
16
20
|
name: key,
|
package/es/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.mjs
CHANGED
|
@@ -14,10 +14,11 @@
|
|
|
14
14
|
/* empty css */
|
|
15
15
|
/* empty css */
|
|
16
16
|
/* empty css */
|
|
17
|
-
import { ref, computed, watch, createBlock, openBlock, unref, mergeProps, isRef, withCtx, createVNode } from "vue";
|
|
17
|
+
import { ref, computed, watch, createBlock, openBlock, unref, mergeProps, isRef, createSlots, withCtx, createVNode, withModifiers } from "vue";
|
|
18
18
|
import { MobileField } from "../field/index.mjs";
|
|
19
19
|
import hooks from "../../../../../../node_modules/.pnpm/moment@2.30.1/node_modules/moment/dist/moment.mjs";
|
|
20
20
|
import { Calendar } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/calendar/index.mjs";
|
|
21
|
+
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";
|
|
21
22
|
const _sfc_main = {
|
|
22
23
|
__name: "FieldCalendarPicker",
|
|
23
24
|
props: {
|
|
@@ -87,6 +88,7 @@ const _sfc_main = {
|
|
|
87
88
|
() => props.modelValue,
|
|
88
89
|
(value) => {
|
|
89
90
|
if (!value) {
|
|
91
|
+
fieldTextValue.value = "";
|
|
90
92
|
return;
|
|
91
93
|
}
|
|
92
94
|
if (props.calendarType == "single") {
|
|
@@ -123,18 +125,19 @@ const _sfc_main = {
|
|
|
123
125
|
showCalendar.value = false;
|
|
124
126
|
};
|
|
125
127
|
return (_ctx, _cache) => {
|
|
128
|
+
const _component_van_icon = Icon;
|
|
126
129
|
const _component_van_calendar = Calendar;
|
|
127
130
|
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
128
131
|
modelValue: unref(fieldTextValue),
|
|
129
|
-
"onUpdate:modelValue": _cache[
|
|
132
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
130
133
|
"is-link": "",
|
|
131
134
|
readonly: "",
|
|
132
|
-
onClick: _cache[
|
|
133
|
-
}), {
|
|
135
|
+
onClick: _cache[3] || (_cache[3] = ($event) => showCalendar.value = true)
|
|
136
|
+
}), createSlots({
|
|
134
137
|
default: withCtx(() => [
|
|
135
138
|
createVNode(_component_van_calendar, mergeProps(_ctx.$attrs, {
|
|
136
139
|
show: unref(showCalendar),
|
|
137
|
-
"onUpdate:show": _cache[
|
|
140
|
+
"onUpdate:show": _cache[1] || (_cache[1] = ($event) => isRef(showCalendar) ? showCalendar.value = $event : null),
|
|
138
141
|
"default-date": unref(defaultDate),
|
|
139
142
|
title: __props.title,
|
|
140
143
|
type: __props.calendarType,
|
|
@@ -143,8 +146,20 @@ const _sfc_main = {
|
|
|
143
146
|
onConfirm
|
|
144
147
|
}), null, 16, ["show", "default-date", "title", "type"])
|
|
145
148
|
]),
|
|
146
|
-
_:
|
|
147
|
-
},
|
|
149
|
+
_: 2
|
|
150
|
+
}, [
|
|
151
|
+
unref(fieldTextValue) ? {
|
|
152
|
+
name: "right-icon",
|
|
153
|
+
fn: withCtx(() => [
|
|
154
|
+
createVNode(_component_van_icon, {
|
|
155
|
+
name: "clear",
|
|
156
|
+
class: "custom-close-icon",
|
|
157
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => defaultDate.value = null, ["stop"]))
|
|
158
|
+
})
|
|
159
|
+
]),
|
|
160
|
+
key: "0"
|
|
161
|
+
} : void 0
|
|
162
|
+
]), 1040, ["modelValue"]);
|
|
148
163
|
};
|
|
149
164
|
}
|
|
150
165
|
};
|
package/es/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.mjs
CHANGED
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
11
|
/* empty css */
|
|
12
|
-
import { ref, computed, watch, createBlock, openBlock, unref, mergeProps, isRef, withCtx, createVNode } from "vue";
|
|
12
|
+
import { ref, computed, watch, createBlock, openBlock, unref, mergeProps, isRef, createSlots, withCtx, createVNode, withModifiers } from "vue";
|
|
13
13
|
import { MobileField } from "../field/index.mjs";
|
|
14
14
|
import { Cascader } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/cascader/index.mjs";
|
|
15
15
|
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";
|
|
16
|
+
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";
|
|
16
17
|
const _sfc_main = {
|
|
17
18
|
__name: "fieldCascaderPicker",
|
|
18
19
|
props: {
|
|
@@ -79,6 +80,10 @@ const _sfc_main = {
|
|
|
79
80
|
watch(
|
|
80
81
|
() => props.modelValue,
|
|
81
82
|
(value) => {
|
|
83
|
+
if (!value) {
|
|
84
|
+
fieldTextValue.value = "";
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
82
87
|
fieldTextValue.value = getDisplayValue(
|
|
83
88
|
props.treeOptions,
|
|
84
89
|
props.treeOptionsFieldNames,
|
|
@@ -92,38 +97,51 @@ const _sfc_main = {
|
|
|
92
97
|
showPicker.value = false;
|
|
93
98
|
};
|
|
94
99
|
return (_ctx, _cache) => {
|
|
100
|
+
const _component_van_icon = Icon;
|
|
95
101
|
const _component_van_cascader = Cascader;
|
|
96
102
|
const _component_van_popup = Popup;
|
|
97
103
|
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
98
104
|
modelValue: unref(fieldTextValue),
|
|
99
|
-
"onUpdate:modelValue": _cache[
|
|
105
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
100
106
|
"is-link": "",
|
|
101
107
|
readonly: "",
|
|
102
|
-
onClick: _cache[
|
|
103
|
-
}), {
|
|
108
|
+
onClick: _cache[5] || (_cache[5] = ($event) => showPicker.value = true)
|
|
109
|
+
}), createSlots({
|
|
104
110
|
default: withCtx(() => [
|
|
105
111
|
createVNode(_component_van_popup, {
|
|
106
112
|
show: unref(showPicker),
|
|
107
|
-
"onUpdate:show": _cache[
|
|
113
|
+
"onUpdate:show": _cache[3] || (_cache[3] = ($event) => isRef(showPicker) ? showPicker.value = $event : null),
|
|
108
114
|
"destroy-on-close": "",
|
|
109
115
|
position: "bottom"
|
|
110
116
|
}, {
|
|
111
117
|
default: withCtx(() => [
|
|
112
118
|
createVNode(_component_van_cascader, mergeProps(_ctx.$attrs, {
|
|
113
119
|
modelValue: unref(pickerValue),
|
|
114
|
-
"onUpdate:modelValue": _cache[
|
|
120
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(pickerValue) ? pickerValue.value = $event : null),
|
|
115
121
|
options: __props.treeOptions,
|
|
116
122
|
"field-names": __props.treeOptionsFieldNames,
|
|
117
123
|
placeholder: "请选择",
|
|
118
124
|
onFinish,
|
|
119
|
-
onClose: _cache[
|
|
125
|
+
onClose: _cache[2] || (_cache[2] = ($event) => showPicker.value = false)
|
|
120
126
|
}), null, 16, ["modelValue", "options", "field-names"])
|
|
121
127
|
]),
|
|
122
128
|
_: 1
|
|
123
129
|
}, 8, ["show"])
|
|
124
130
|
]),
|
|
125
|
-
_:
|
|
126
|
-
},
|
|
131
|
+
_: 2
|
|
132
|
+
}, [
|
|
133
|
+
unref(fieldTextValue) ? {
|
|
134
|
+
name: "right-icon",
|
|
135
|
+
fn: withCtx(() => [
|
|
136
|
+
createVNode(_component_van_icon, {
|
|
137
|
+
name: "clear",
|
|
138
|
+
class: "custom-close-icon",
|
|
139
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => pickerValue.value = null, ["stop"]))
|
|
140
|
+
})
|
|
141
|
+
]),
|
|
142
|
+
key: "0"
|
|
143
|
+
} : void 0
|
|
144
|
+
]), 1040, ["modelValue"]);
|
|
127
145
|
};
|
|
128
146
|
}
|
|
129
147
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, createBlock, openBlock, unref, mergeProps, withCtx, createVNode
|
|
1
|
+
import { computed, createBlock, openBlock, unref, mergeProps, isRef, withCtx, createVNode } from "vue";
|
|
2
2
|
import { MobileField } from "../field/index.mjs";
|
|
3
3
|
import { MobileCheckboxGroup } from "../checkboxGroup/index.mjs";
|
|
4
4
|
const _sfc_main = {
|
|
@@ -29,8 +29,19 @@ const _sfc_main = {
|
|
|
29
29
|
emit("update:modelValue", val.join(","));
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
+
const inputValue = computed({
|
|
33
|
+
get: () => {
|
|
34
|
+
return compValue.value.join(",");
|
|
35
|
+
},
|
|
36
|
+
set: (val) => {
|
|
37
|
+
emit("update:modelValue", val);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
32
40
|
return (_ctx, _cache) => {
|
|
33
|
-
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
41
|
+
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
42
|
+
modelValue: unref(inputValue),
|
|
43
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(inputValue) ? inputValue.value = $event : null)
|
|
44
|
+
}), {
|
|
34
45
|
input: withCtx(() => [
|
|
35
46
|
createVNode(unref(MobileCheckboxGroup), mergeProps(_ctx.$attrs, {
|
|
36
47
|
modelValue: unref(compValue),
|
|
@@ -38,7 +49,7 @@ const _sfc_main = {
|
|
|
38
49
|
}), null, 16, ["modelValue"])
|
|
39
50
|
]),
|
|
40
51
|
_: 1
|
|
41
|
-
}, 16);
|
|
52
|
+
}, 16, ["modelValue"]);
|
|
42
53
|
};
|
|
43
54
|
}
|
|
44
55
|
};
|
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
/* empty css */
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
|
-
import { ref, computed, watch, createBlock, openBlock, unref, mergeProps, isRef, withCtx, createVNode } from "vue";
|
|
14
|
+
import { ref, computed, watch, createBlock, openBlock, unref, mergeProps, isRef, createSlots, withCtx, createVNode, withModifiers } from "vue";
|
|
15
15
|
import { MobileField } from "../field/index.mjs";
|
|
16
16
|
import hooks from "../../../../../../node_modules/.pnpm/moment@2.30.1/node_modules/moment/dist/moment.mjs";
|
|
17
17
|
import { parseDateFormatter } from "../../../utils/dateUtil.mjs";
|
|
18
18
|
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";
|
|
19
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 { Icon } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/icon/index.mjs";
|
|
20
21
|
const _sfc_main = {
|
|
21
22
|
__name: "FieldDatePicker",
|
|
22
23
|
props: {
|
|
@@ -93,6 +94,7 @@ const _sfc_main = {
|
|
|
93
94
|
() => props.modelValue,
|
|
94
95
|
(value) => {
|
|
95
96
|
if (!value) {
|
|
97
|
+
fieldTextValue.value = "";
|
|
96
98
|
return;
|
|
97
99
|
}
|
|
98
100
|
fieldTextValue.value = hooks(value, valueFormat).format(textFormat);
|
|
@@ -108,38 +110,51 @@ const _sfc_main = {
|
|
|
108
110
|
showPicker.value = false;
|
|
109
111
|
};
|
|
110
112
|
return (_ctx, _cache) => {
|
|
113
|
+
const _component_van_icon = Icon;
|
|
111
114
|
const _component_van_date_picker = DatePicker;
|
|
112
115
|
const _component_van_popup = Popup;
|
|
113
116
|
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
114
117
|
modelValue: unref(fieldTextValue),
|
|
115
|
-
"onUpdate:modelValue": _cache[
|
|
118
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
116
119
|
"is-link": "",
|
|
117
120
|
readonly: "",
|
|
118
|
-
onClick: _cache[
|
|
119
|
-
}), {
|
|
121
|
+
onClick: _cache[5] || (_cache[5] = ($event) => showPicker.value = true)
|
|
122
|
+
}), createSlots({
|
|
120
123
|
default: withCtx(() => [
|
|
121
124
|
createVNode(_component_van_popup, {
|
|
122
125
|
show: unref(showPicker),
|
|
123
|
-
"onUpdate:show": _cache[
|
|
126
|
+
"onUpdate:show": _cache[3] || (_cache[3] = ($event) => isRef(showPicker) ? showPicker.value = $event : null),
|
|
124
127
|
"destroy-on-close": "",
|
|
125
128
|
position: "bottom"
|
|
126
129
|
}, {
|
|
127
130
|
default: withCtx(() => [
|
|
128
131
|
createVNode(_component_van_date_picker, mergeProps(_ctx.$attrs, {
|
|
129
132
|
modelValue: unref(pickerValue),
|
|
130
|
-
"onUpdate:modelValue": _cache[
|
|
133
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(pickerValue) ? pickerValue.value = $event : null),
|
|
131
134
|
readonly: false,
|
|
132
135
|
onConfirm,
|
|
133
136
|
columnsType: unref(columnsType),
|
|
134
137
|
formatter,
|
|
135
|
-
onCancel: _cache[
|
|
138
|
+
onCancel: _cache[2] || (_cache[2] = ($event) => showPicker.value = false)
|
|
136
139
|
}), null, 16, ["modelValue", "columnsType"])
|
|
137
140
|
]),
|
|
138
141
|
_: 1
|
|
139
142
|
}, 8, ["show"])
|
|
140
143
|
]),
|
|
141
|
-
_:
|
|
142
|
-
},
|
|
144
|
+
_: 2
|
|
145
|
+
}, [
|
|
146
|
+
unref(fieldTextValue) ? {
|
|
147
|
+
name: "right-icon",
|
|
148
|
+
fn: withCtx(() => [
|
|
149
|
+
createVNode(_component_van_icon, {
|
|
150
|
+
name: "clear",
|
|
151
|
+
class: "custom-close-icon",
|
|
152
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("update:modelValue", null), ["stop"]))
|
|
153
|
+
})
|
|
154
|
+
]),
|
|
155
|
+
key: "0"
|
|
156
|
+
} : void 0
|
|
157
|
+
]), 1040, ["modelValue"]);
|
|
143
158
|
};
|
|
144
159
|
}
|
|
145
160
|
};
|
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
/* empty css */
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
|
-
import { ref, computed, watch, createBlock, openBlock, unref, mergeProps, isRef, withCtx, createVNode } from "vue";
|
|
14
|
+
import { ref, computed, watch, createBlock, openBlock, unref, mergeProps, isRef, createSlots, withCtx, createVNode, withModifiers } from "vue";
|
|
15
15
|
import { MobileField } from "../field/index.mjs";
|
|
16
16
|
import { Picker } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/picker/index.mjs";
|
|
17
|
+
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";
|
|
17
18
|
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";
|
|
18
19
|
const _sfc_main = {
|
|
19
20
|
__name: "FieldPicker",
|
|
@@ -55,6 +56,7 @@ const _sfc_main = {
|
|
|
55
56
|
() => props.modelValue,
|
|
56
57
|
(value) => {
|
|
57
58
|
if (!value) {
|
|
59
|
+
fieldTextValue.value = "";
|
|
58
60
|
return;
|
|
59
61
|
}
|
|
60
62
|
const optionItem = props.pickerOptions.find(
|
|
@@ -69,19 +71,20 @@ const _sfc_main = {
|
|
|
69
71
|
showPicker.value = false;
|
|
70
72
|
};
|
|
71
73
|
return (_ctx, _cache) => {
|
|
74
|
+
const _component_van_icon = Icon;
|
|
72
75
|
const _component_van_picker = Picker;
|
|
73
76
|
const _component_van_popup = Popup;
|
|
74
77
|
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
75
78
|
modelValue: unref(fieldTextValue),
|
|
76
|
-
"onUpdate:modelValue": _cache[
|
|
79
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
77
80
|
"is-link": "",
|
|
78
81
|
readonly: "",
|
|
79
|
-
onClick: _cache[
|
|
80
|
-
}), {
|
|
82
|
+
onClick: _cache[4] || (_cache[4] = ($event) => showPicker.value = true)
|
|
83
|
+
}), createSlots({
|
|
81
84
|
default: withCtx(() => [
|
|
82
85
|
createVNode(_component_van_popup, {
|
|
83
86
|
show: unref(showPicker),
|
|
84
|
-
"onUpdate:show": _cache[
|
|
87
|
+
"onUpdate:show": _cache[2] || (_cache[2] = ($event) => isRef(showPicker) ? showPicker.value = $event : null),
|
|
85
88
|
"destroy-on-close": "",
|
|
86
89
|
position: "bottom"
|
|
87
90
|
}, {
|
|
@@ -92,14 +95,26 @@ const _sfc_main = {
|
|
|
92
95
|
"model-value": unref(pickerValue),
|
|
93
96
|
readonly: false,
|
|
94
97
|
onConfirm,
|
|
95
|
-
onCancel: _cache[
|
|
98
|
+
onCancel: _cache[1] || (_cache[1] = ($event) => showPicker.value = false)
|
|
96
99
|
}), null, 16, ["columns", "columns-field-names", "model-value"])
|
|
97
100
|
]),
|
|
98
101
|
_: 1
|
|
99
102
|
}, 8, ["show"])
|
|
100
103
|
]),
|
|
101
|
-
_:
|
|
102
|
-
},
|
|
104
|
+
_: 2
|
|
105
|
+
}, [
|
|
106
|
+
unref(fieldTextValue) ? {
|
|
107
|
+
name: "right-icon",
|
|
108
|
+
fn: withCtx(() => [
|
|
109
|
+
createVNode(_component_van_icon, {
|
|
110
|
+
name: "clear",
|
|
111
|
+
class: "custom-close-icon",
|
|
112
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => pickerValue.value = null, ["stop"]))
|
|
113
|
+
})
|
|
114
|
+
]),
|
|
115
|
+
key: "0"
|
|
116
|
+
} : void 0
|
|
117
|
+
]), 1040, ["modelValue"]);
|
|
103
118
|
};
|
|
104
119
|
}
|
|
105
120
|
};
|
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
/* empty css */
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
|
-
import { ref, computed, watch, createBlock, openBlock, unref, mergeProps, isRef, withCtx, createVNode } from "vue";
|
|
14
|
+
import { ref, computed, watch, createBlock, openBlock, unref, mergeProps, isRef, createSlots, withCtx, createVNode, withModifiers } from "vue";
|
|
15
15
|
import { MobileField } from "../field/index.mjs";
|
|
16
16
|
import hooks from "../../../../../../node_modules/.pnpm/moment@2.30.1/node_modules/moment/dist/moment.mjs";
|
|
17
17
|
import { parseTimeFormatter } from "../../../utils/dateUtil.mjs";
|
|
18
18
|
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";
|
|
19
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 { Icon } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/icon/index.mjs";
|
|
20
21
|
const _sfc_main = {
|
|
21
22
|
__name: "FieldTimePicker",
|
|
22
23
|
props: {
|
|
@@ -95,6 +96,7 @@ const _sfc_main = {
|
|
|
95
96
|
() => props.modelValue,
|
|
96
97
|
(value) => {
|
|
97
98
|
if (!value) {
|
|
99
|
+
fieldTextValue.value = "";
|
|
98
100
|
return;
|
|
99
101
|
}
|
|
100
102
|
fieldTextValue.value = hooks(value, valueFormat).format(textFormat);
|
|
@@ -110,38 +112,51 @@ const _sfc_main = {
|
|
|
110
112
|
showPicker.value = false;
|
|
111
113
|
};
|
|
112
114
|
return (_ctx, _cache) => {
|
|
115
|
+
const _component_van_icon = Icon;
|
|
113
116
|
const _component_van_time_picker = TimePicker;
|
|
114
117
|
const _component_van_popup = Popup;
|
|
115
118
|
return openBlock(), createBlock(unref(MobileField), mergeProps(_ctx.$attrs, {
|
|
116
119
|
modelValue: unref(fieldTextValue),
|
|
117
|
-
"onUpdate:modelValue": _cache[
|
|
120
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
|
|
118
121
|
"is-link": "",
|
|
119
122
|
readonly: "",
|
|
120
|
-
onClick: _cache[
|
|
121
|
-
}), {
|
|
123
|
+
onClick: _cache[5] || (_cache[5] = ($event) => showPicker.value = true)
|
|
124
|
+
}), createSlots({
|
|
122
125
|
default: withCtx(() => [
|
|
123
126
|
createVNode(_component_van_popup, {
|
|
124
127
|
show: unref(showPicker),
|
|
125
|
-
"onUpdate:show": _cache[
|
|
128
|
+
"onUpdate:show": _cache[3] || (_cache[3] = ($event) => isRef(showPicker) ? showPicker.value = $event : null),
|
|
126
129
|
"destroy-on-close": "",
|
|
127
130
|
position: "bottom"
|
|
128
131
|
}, {
|
|
129
132
|
default: withCtx(() => [
|
|
130
133
|
createVNode(_component_van_time_picker, mergeProps(_ctx.$attrs, {
|
|
131
134
|
modelValue: unref(pickerValue),
|
|
132
|
-
"onUpdate:modelValue": _cache[
|
|
135
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(pickerValue) ? pickerValue.value = $event : null),
|
|
133
136
|
readonly: false,
|
|
134
137
|
columnsType: unref(columnsType),
|
|
135
138
|
formatter,
|
|
136
139
|
onConfirm,
|
|
137
|
-
onCancel: _cache[
|
|
140
|
+
onCancel: _cache[2] || (_cache[2] = ($event) => showPicker.value = false)
|
|
138
141
|
}), null, 16, ["modelValue", "columnsType"])
|
|
139
142
|
]),
|
|
140
143
|
_: 1
|
|
141
144
|
}, 8, ["show"])
|
|
142
145
|
]),
|
|
143
|
-
_:
|
|
144
|
-
},
|
|
146
|
+
_: 2
|
|
147
|
+
}, [
|
|
148
|
+
unref(fieldTextValue) ? {
|
|
149
|
+
name: "right-icon",
|
|
150
|
+
fn: withCtx(() => [
|
|
151
|
+
createVNode(_component_van_icon, {
|
|
152
|
+
name: "clear",
|
|
153
|
+
class: "custom-close-icon",
|
|
154
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("update:modelValue", null), ["stop"]))
|
|
155
|
+
})
|
|
156
|
+
]),
|
|
157
|
+
key: "0"
|
|
158
|
+
} : void 0
|
|
159
|
+
]), 1040, ["modelValue"]);
|
|
145
160
|
};
|
|
146
161
|
}
|
|
147
162
|
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import useHttp from "../axios/index.mjs";
|
|
2
|
+
const useDataSource = (dataSourceJson) => {
|
|
3
|
+
var _a, _b;
|
|
4
|
+
const dataSource = JSON.parse(dataSourceJson.replace(/'/g, '"'));
|
|
5
|
+
const globalDataHandle = dataSource.dataHandler ? createFn(dataSource.dataHandler.value) : (res) => res;
|
|
6
|
+
const http = useHttp(globalDataHandle);
|
|
7
|
+
const shouldFetch = ((_a = dataSource.shouldFetch) == null ? void 0 : _a.value) ? createFn(dataSource.shouldFetch.value) : () => true;
|
|
8
|
+
const willFetch = ((_b = dataSource.willFetch) == null ? void 0 : _b.value) ? createFn(dataSource.willFetch.value) : (options) => options;
|
|
9
|
+
const dataHandler = (res) => {
|
|
10
|
+
var _a2;
|
|
11
|
+
const data = ((_a2 = dataSource.dataHandler) == null ? void 0 : _a2.value) ? createFn(dataSource.dataHandler.value)(res) : res;
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
const errorHandler = (error) => {
|
|
15
|
+
var _a2;
|
|
16
|
+
if ((_a2 = dataSource.errorHandler) == null ? void 0 : _a2.value) {
|
|
17
|
+
createFn(dataSource.errorHandler.value)(error);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
http.interceptors.request.use(willFetch, errorHandler);
|
|
21
|
+
http.interceptors.response.use(dataHandler, errorHandler);
|
|
22
|
+
return {
|
|
23
|
+
load: createLoad(http, dataSource, shouldFetch)
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
const createFn = (fnContent) => {
|
|
27
|
+
return (...args) => {
|
|
28
|
+
window.eval("var fn = " + fnContent);
|
|
29
|
+
return fn.apply(void 0, args);
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const createLoad = (http, dataSource, shouldFetch) => (params) => {
|
|
33
|
+
if (!shouldFetch()) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (dataSource.mockSwitch == "1") {
|
|
37
|
+
let mockData = dataSource.mockData;
|
|
38
|
+
return new Promise((resolve) => {
|
|
39
|
+
const mockDataHandle = createFn(dataSource.mockDataHandlerValue);
|
|
40
|
+
resolve(mockDataHandle(mockData));
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const {
|
|
44
|
+
method,
|
|
45
|
+
uri: url,
|
|
46
|
+
params: defaultParams,
|
|
47
|
+
timeout,
|
|
48
|
+
headers,
|
|
49
|
+
serviceAddr
|
|
50
|
+
} = dataSource.options;
|
|
51
|
+
const config = { method, url, headers, timeout };
|
|
52
|
+
const data = params && JSON.stringify(params) != "{}" ? params : defaultParams;
|
|
53
|
+
if (serviceAddr) {
|
|
54
|
+
const serviceAddrValue = dataSource == null ? void 0 : dataSource.serviceAddr;
|
|
55
|
+
const serviceAddrItem = serviceAddrValue == null ? void 0 : serviceAddrValue.find(
|
|
56
|
+
(item) => item.name == serviceAddr
|
|
57
|
+
);
|
|
58
|
+
config.url = (serviceAddrItem == null ? void 0 : serviceAddrItem.url) ? serviceAddrItem.url + config.url : config.url;
|
|
59
|
+
} else {
|
|
60
|
+
config.url = config.url;
|
|
61
|
+
}
|
|
62
|
+
if (method.toLowerCase() === "get") {
|
|
63
|
+
config.params = data;
|
|
64
|
+
} else {
|
|
65
|
+
config.data = data;
|
|
66
|
+
}
|
|
67
|
+
return http.request(config);
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
useDataSource
|
|
71
|
+
};
|