@fecp/mobile 1.0.59 → 1.0.61
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/packages/mobile/src/components/base/popup/Popup.vue.mjs +6 -2
- package/es/packages/mobile/src/components/form/fieldArea/FieldArea.vue.mjs +40 -11
- package/es/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.mjs +5 -9
- package/lib/packages/mobile/src/components/base/popup/Popup.vue.js +5 -1
- package/lib/packages/mobile/src/components/form/fieldArea/FieldArea.vue.js +40 -11
- package/lib/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.js +5 -9
- package/package.json +1 -1
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { createBlock, openBlock,
|
|
6
|
+
import { createBlock, openBlock, mergeProps, createSlots, renderList, withCtx, renderSlot } from "vue";
|
|
7
7
|
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
8
8
|
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";
|
|
9
9
|
const _sfc_main = {};
|
|
10
10
|
function _sfc_render(_ctx, _cache) {
|
|
11
11
|
const _component_van_popup = Popup;
|
|
12
|
-
return openBlock(), createBlock(_component_van_popup,
|
|
12
|
+
return openBlock(), createBlock(_component_van_popup, mergeProps(_ctx.$attrs, {
|
|
13
|
+
position: "bottom",
|
|
14
|
+
"close-on-popstate": "",
|
|
15
|
+
"safe-area-inset-bottom": ""
|
|
16
|
+
}), createSlots({ _: 2 }, [
|
|
13
17
|
renderList(_ctx.$slots, (item, key) => {
|
|
14
18
|
return {
|
|
15
19
|
name: key,
|
|
@@ -38,23 +38,51 @@ const _sfc_main = {
|
|
|
38
38
|
type: Boolean,
|
|
39
39
|
default: false
|
|
40
40
|
},
|
|
41
|
-
"is-link": false
|
|
41
|
+
"is-link": false,
|
|
42
|
+
areaType: {
|
|
43
|
+
//1-省市区,2-省市,3-省
|
|
44
|
+
type: String,
|
|
45
|
+
default: "1"
|
|
46
|
+
}
|
|
42
47
|
},
|
|
43
48
|
emits: ["update:modelValue"],
|
|
44
49
|
setup(__props, { emit: __emit }) {
|
|
45
50
|
const props = __props;
|
|
46
|
-
const finalOptions = ref(
|
|
51
|
+
const finalOptions = ref([]);
|
|
52
|
+
if (props.areaType == "1") {
|
|
53
|
+
finalOptions.value = useCascaderAreaData();
|
|
54
|
+
} else if (props.areaType == "2") {
|
|
55
|
+
finalOptions.value = parseOptionsByLevel(useCascaderAreaData(), 1);
|
|
56
|
+
} else if (props.areaType == "3") {
|
|
57
|
+
finalOptions.value = parseOptionsByLevel(useCascaderAreaData(), 0);
|
|
58
|
+
}
|
|
59
|
+
function parseOptionsByLevel(data, level) {
|
|
60
|
+
if (level === 0) {
|
|
61
|
+
return data.map((item) => ({
|
|
62
|
+
text: item.text,
|
|
63
|
+
value: item.value
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
function processNode(node, currentLevel) {
|
|
67
|
+
const newNode = {
|
|
68
|
+
text: node.text,
|
|
69
|
+
value: node.value
|
|
70
|
+
};
|
|
71
|
+
if (currentLevel < level && node.children) {
|
|
72
|
+
newNode.children = node.children.map(
|
|
73
|
+
(child) => processNode(child, currentLevel + 1)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
return newNode;
|
|
77
|
+
}
|
|
78
|
+
return data.map((node) => processNode(node, 0));
|
|
79
|
+
}
|
|
47
80
|
const fieldTextValue = ref("");
|
|
48
81
|
const showPicker = ref(false);
|
|
49
82
|
const emit = __emit;
|
|
50
|
-
const pickerValue = computed({
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return value[value.length - 1];
|
|
54
|
-
},
|
|
55
|
-
set: (val) => {
|
|
56
|
-
emit("update:modelValue", val);
|
|
57
|
-
}
|
|
83
|
+
const pickerValue = computed(() => {
|
|
84
|
+
const value = props.modelValue.split("/");
|
|
85
|
+
return value[value.length - 1];
|
|
58
86
|
});
|
|
59
87
|
function getDisplayValue(options, fieldNames, modelValue) {
|
|
60
88
|
const { text, value, children } = fieldNames;
|
|
@@ -98,7 +126,8 @@ const _sfc_main = {
|
|
|
98
126
|
{ immediate: true }
|
|
99
127
|
);
|
|
100
128
|
const onFinish = ({ selectedOptions }) => {
|
|
101
|
-
|
|
129
|
+
const value = selectedOptions.map((option) => option[props.treeOptionsFieldNames.value]).join("/");
|
|
130
|
+
emit("update:modelValue", value);
|
|
102
131
|
showPicker.value = false;
|
|
103
132
|
};
|
|
104
133
|
return (_ctx, _cache) => {
|
package/es/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.mjs
CHANGED
|
@@ -75,14 +75,9 @@ const _sfc_main = {
|
|
|
75
75
|
const fieldTextValue = ref("");
|
|
76
76
|
const showPicker = ref(false);
|
|
77
77
|
const emit = __emit;
|
|
78
|
-
const pickerValue = computed({
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return value[value.length - 1];
|
|
82
|
-
},
|
|
83
|
-
set: (val) => {
|
|
84
|
-
emit("update:modelValue", val);
|
|
85
|
-
}
|
|
78
|
+
const pickerValue = computed(() => {
|
|
79
|
+
const value = props.modelValue.split("/");
|
|
80
|
+
return value[value.length - 1];
|
|
86
81
|
});
|
|
87
82
|
function getDisplayValue(options, fieldNames, modelValue) {
|
|
88
83
|
const { text, value, children } = fieldNames;
|
|
@@ -126,7 +121,8 @@ const _sfc_main = {
|
|
|
126
121
|
{ immediate: true }
|
|
127
122
|
);
|
|
128
123
|
const onFinish = ({ selectedOptions }) => {
|
|
129
|
-
|
|
124
|
+
const value = selectedOptions.map((option) => option[props.treeOptionsFieldNames.value]).join("/");
|
|
125
|
+
emit("update:modelValue", value);
|
|
130
126
|
showPicker.value = false;
|
|
131
127
|
};
|
|
132
128
|
return (_ctx, _cache) => {
|
|
@@ -11,7 +11,11 @@ const index = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.
|
|
|
11
11
|
const _sfc_main = {};
|
|
12
12
|
function _sfc_render(_ctx, _cache) {
|
|
13
13
|
const _component_van_popup = index.Popup;
|
|
14
|
-
return vue.openBlock(), vue.createBlock(_component_van_popup, vue.
|
|
14
|
+
return vue.openBlock(), vue.createBlock(_component_van_popup, vue.mergeProps(_ctx.$attrs, {
|
|
15
|
+
position: "bottom",
|
|
16
|
+
"close-on-popstate": "",
|
|
17
|
+
"safe-area-inset-bottom": ""
|
|
18
|
+
}), vue.createSlots({ _: 2 }, [
|
|
15
19
|
vue.renderList(_ctx.$slots, (item, key) => {
|
|
16
20
|
return {
|
|
17
21
|
name: key,
|
|
@@ -40,23 +40,51 @@ const _sfc_main = {
|
|
|
40
40
|
type: Boolean,
|
|
41
41
|
default: false
|
|
42
42
|
},
|
|
43
|
-
"is-link": false
|
|
43
|
+
"is-link": false,
|
|
44
|
+
areaType: {
|
|
45
|
+
//1-省市区,2-省市,3-省
|
|
46
|
+
type: String,
|
|
47
|
+
default: "1"
|
|
48
|
+
}
|
|
44
49
|
},
|
|
45
50
|
emits: ["update:modelValue"],
|
|
46
51
|
setup(__props, { emit: __emit }) {
|
|
47
52
|
const props = __props;
|
|
48
|
-
const finalOptions = vue.ref(
|
|
53
|
+
const finalOptions = vue.ref([]);
|
|
54
|
+
if (props.areaType == "1") {
|
|
55
|
+
finalOptions.value = index_esm.useCascaderAreaData();
|
|
56
|
+
} else if (props.areaType == "2") {
|
|
57
|
+
finalOptions.value = parseOptionsByLevel(index_esm.useCascaderAreaData(), 1);
|
|
58
|
+
} else if (props.areaType == "3") {
|
|
59
|
+
finalOptions.value = parseOptionsByLevel(index_esm.useCascaderAreaData(), 0);
|
|
60
|
+
}
|
|
61
|
+
function parseOptionsByLevel(data, level) {
|
|
62
|
+
if (level === 0) {
|
|
63
|
+
return data.map((item) => ({
|
|
64
|
+
text: item.text,
|
|
65
|
+
value: item.value
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
function processNode(node, currentLevel) {
|
|
69
|
+
const newNode = {
|
|
70
|
+
text: node.text,
|
|
71
|
+
value: node.value
|
|
72
|
+
};
|
|
73
|
+
if (currentLevel < level && node.children) {
|
|
74
|
+
newNode.children = node.children.map(
|
|
75
|
+
(child) => processNode(child, currentLevel + 1)
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
return newNode;
|
|
79
|
+
}
|
|
80
|
+
return data.map((node) => processNode(node, 0));
|
|
81
|
+
}
|
|
49
82
|
const fieldTextValue = vue.ref("");
|
|
50
83
|
const showPicker = vue.ref(false);
|
|
51
84
|
const emit = __emit;
|
|
52
|
-
const pickerValue = vue.computed({
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return value[value.length - 1];
|
|
56
|
-
},
|
|
57
|
-
set: (val) => {
|
|
58
|
-
emit("update:modelValue", val);
|
|
59
|
-
}
|
|
85
|
+
const pickerValue = vue.computed(() => {
|
|
86
|
+
const value = props.modelValue.split("/");
|
|
87
|
+
return value[value.length - 1];
|
|
60
88
|
});
|
|
61
89
|
function getDisplayValue(options, fieldNames, modelValue) {
|
|
62
90
|
const { text, value, children } = fieldNames;
|
|
@@ -100,7 +128,8 @@ const _sfc_main = {
|
|
|
100
128
|
{ immediate: true }
|
|
101
129
|
);
|
|
102
130
|
const onFinish = ({ selectedOptions }) => {
|
|
103
|
-
|
|
131
|
+
const value = selectedOptions.map((option) => option[props.treeOptionsFieldNames.value]).join("/");
|
|
132
|
+
emit("update:modelValue", value);
|
|
104
133
|
showPicker.value = false;
|
|
105
134
|
};
|
|
106
135
|
return (_ctx, _cache) => {
|
package/lib/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.js
CHANGED
|
@@ -77,14 +77,9 @@ const _sfc_main = {
|
|
|
77
77
|
const fieldTextValue = vue.ref("");
|
|
78
78
|
const showPicker = vue.ref(false);
|
|
79
79
|
const emit = __emit;
|
|
80
|
-
const pickerValue = vue.computed({
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return value[value.length - 1];
|
|
84
|
-
},
|
|
85
|
-
set: (val) => {
|
|
86
|
-
emit("update:modelValue", val);
|
|
87
|
-
}
|
|
80
|
+
const pickerValue = vue.computed(() => {
|
|
81
|
+
const value = props.modelValue.split("/");
|
|
82
|
+
return value[value.length - 1];
|
|
88
83
|
});
|
|
89
84
|
function getDisplayValue(options, fieldNames, modelValue) {
|
|
90
85
|
const { text, value, children } = fieldNames;
|
|
@@ -128,7 +123,8 @@ const _sfc_main = {
|
|
|
128
123
|
{ immediate: true }
|
|
129
124
|
);
|
|
130
125
|
const onFinish = ({ selectedOptions }) => {
|
|
131
|
-
|
|
126
|
+
const value = selectedOptions.map((option) => option[props.treeOptionsFieldNames.value]).join("/");
|
|
127
|
+
emit("update:modelValue", value);
|
|
132
128
|
showPicker.value = false;
|
|
133
129
|
};
|
|
134
130
|
return (_ctx, _cache) => {
|