fangguo-component 1.1.2 → 1.1.4
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/dist/ArgHover.css +20 -1
- package/dist/ArgHover.vue_vue_type_style_index_0_lang-CSymSDRl.js +56 -0
- package/dist/ButtonGroup-DqViorHX.js +134 -0
- package/dist/ButtonGroup.css +35 -1
- package/dist/CitySelect.vue_vue_type_script_setup_true_lang-DZp6834K.js +224 -0
- package/dist/ContentTitle-By0Zk1u7.js +30 -0
- package/dist/ContentTitle.css +6 -1
- package/dist/CustomInputV2-BqhBSO53.js +157 -0
- package/dist/CustomInputV2.css +5 -1
- package/dist/CustomMultipleInput-DRMTUtkE.js +125 -0
- package/dist/CustomMultipleInput.css +8 -1
- package/dist/DragResizable.css +126 -1
- package/dist/DragResizable.vue_vue_type_style_index_0_lang-BePpQHve.js +331 -0
- package/dist/DragSort-5WetnkmW.js +98 -0
- package/dist/DragSort.css +5 -1
- package/dist/ErrorImage-Ao9kEEUg.js +36 -0
- package/dist/ErrorImage.css +4 -1
- package/dist/FgCascader.css +37 -1
- package/dist/FgCascader.vue_vue_type_style_index_0_lang-CM8FxFLJ.js +2424 -0
- package/dist/HSelect-BFkWiCFi.js +671 -0
- package/dist/HSelect.css +80 -1
- package/dist/HSelectAll.vue_vue_type_script_setup_true_lang-BZX7ch2I.js +50 -0
- package/dist/HSelectSJ-DZmtdyjF.js +671 -0
- package/dist/HSelectSJ.css +88 -1
- package/dist/IdentifyAddress.vue_vue_type_script_setup_true_lang-BCIOF-Oy.js +5202 -0
- package/dist/ImageLoupe.vue_vue_type_script_setup_true_lang-BaXHYlDu.js +92 -0
- package/dist/LazyComponent.vue_vue_type_script_setup_true_lang-D5KGqlj4.js +107 -0
- package/dist/LazyPopover.vue_vue_type_script_setup_true_lang-B2vtU4f4.js +34 -0
- package/dist/LoadingBtn-DWm2cY9k.js +87 -0
- package/dist/LoadingBtn.css +12 -1
- package/dist/MInput-s_P63myh.js +114 -0
- package/dist/MInput.css +21 -1
- package/dist/MyTable-CHvxPYgk.js +94 -0
- package/dist/MyTable.css +33 -1
- package/dist/NoRender.vue_vue_type_script_setup_true_lang-B0G6jxPg.js +31 -0
- package/dist/SelectAddress-CCepDxu8.js +254 -0
- package/dist/SelectAddress.css +18 -1
- package/dist/SelectAll.vue_vue_type_script_setup_true_lang-CyzY8ams.js +101 -0
- package/dist/SelectAll2.vue_vue_type_script_setup_true_lang-CrsaohxU.js +103 -0
- package/dist/SelectCustomAll.css +8 -1
- package/dist/SelectCustomAll.vue_vue_type_style_index_0_lang-BEZwlGXa.js +111 -0
- package/dist/SelectTimePicker.vue_vue_type_script_setup_true_lang-Dk4TpTBN.js +48 -0
- package/dist/SelectTree-DHbWogEU.js +1276 -0
- package/dist/SelectTree.css +74 -1
- package/dist/SvgIcon-DIg0upEk.js +33 -0
- package/dist/TextCopy-th0FAxwl.js +44 -0
- package/dist/TextCopy.css +7 -1
- package/dist/TextEllipsisTooltip.vue_vue_type_script_setup_true_lang-DVE1CxPm.js +174 -0
- package/dist/VirtualTable-Cm_L7q9W.js +703 -0
- package/dist/VirtualTable.css +185 -1
- package/dist/_commonjsHelpers-DnzVkjQg.js +38 -0
- package/dist/_plugin-vue_export-helper-1tPrXgE0.js +10 -0
- package/dist/common-B1nSpTGn.js +9669 -0
- package/dist/components/VirtualTable/index.js +2 -2
- package/dist/components/argHover/index.js +2 -2
- package/dist/components/buttonGroup/index.js +2 -2
- package/dist/components/cascader/index.js +2 -2
- package/dist/components/citySelect/index.js +2 -2
- package/dist/components/contentTitle/index.js +2 -2
- package/dist/components/customInputV2/index.js +2 -2
- package/dist/components/customMultipleInput/index.js +2 -2
- package/dist/components/dragResizable/index.js +2 -2
- package/dist/components/dragSort/index.js +2 -2
- package/dist/components/errorImage/index.js +2 -2
- package/dist/components/hSelect/index.js +2 -2
- package/dist/components/hSelectAll/index.js +2 -2
- package/dist/components/hSelectSJ/index.js +2 -2
- package/dist/components/identifyAddress/index.js +2 -2
- package/dist/components/imageLoupe/index.js +2 -2
- package/dist/components/index.js +62 -62
- package/dist/components/lazyComponent/index.js +2 -2
- package/dist/components/lazyPopover/index.js +2 -2
- package/dist/components/loadingBtn/index.js +2 -2
- package/dist/components/mInput/index.js +2 -2
- package/dist/components/myTable/index.js +2 -2
- package/dist/components/noRender/index.js +2 -2
- package/dist/components/selectAddress/index.js +2 -2
- package/dist/components/selectAll/index.js +2 -2
- package/dist/components/selectAll2/index.js +2 -2
- package/dist/components/selectCustomAll/index.js +2 -2
- package/dist/components/selectTimePicker/index.js +2 -2
- package/dist/components/selectTree/index.js +2 -2
- package/dist/components/svgIcon/index.js +2 -2
- package/dist/components/textCopy/index.js +2 -2
- package/dist/components/textEllipsisTooltip/index.js +2 -2
- package/dist/dateShortcuts-DjFC_Txu.js +27 -0
- package/dist/directive/index.js +2 -2
- package/dist/directive/loading/index.js +2 -2
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/usePagination/index.js +2 -2
- package/dist/index-BPnixsfc.js +103 -0
- package/dist/index-C9zyi90j.js +165 -0
- package/dist/index-CSMWzzp0.js +8 -0
- package/dist/index-DfQiknXJ.js +8 -0
- package/dist/index-DzdLpetc.js +29184 -0
- package/dist/index-uQXqC9BF.js +68 -0
- package/dist/index.css +1 -1
- package/dist/index.js +204 -194
- package/dist/loading-CGrVcnNl.js +47 -0
- package/dist/loading.css +110 -1
- package/dist/tools/ImageParserUtils/index.js +17239 -9074
- package/dist/tools/common/index.js +86 -86
- package/dist/tools/index.js +95 -95
- package/dist/usePagination-C63IRXjZ.js +29 -0
- package/dist/vue-virtual-scroller.esm-ZgBoGAjX.js +1507 -0
- package/package.json +1 -1
- package/dist/ArgHover.vue_vue_type_style_index_0_lang-CMhRP09M.js +0 -54
- package/dist/ButtonGroup-C0yZEkxK.js +0 -103
- package/dist/CitySelect.vue_vue_type_script_setup_true_lang-8EbHD3Nt.js +0 -159
- package/dist/ContentTitle-mqrusLjx.js +0 -24
- package/dist/CustomInputV2-uARhbFc8.js +0 -135
- package/dist/CustomMultipleInput-DDaqoHVU.js +0 -109
- package/dist/DragResizable.vue_vue_type_style_index_0_lang-CHv0gJmo.js +0 -179
- package/dist/DragSort-CfDeFAIG.js +0 -66
- package/dist/ErrorImage-CTP_5sal.js +0 -32
- package/dist/FgCascader.vue_vue_type_style_index_0_lang-BUZDDcVn.js +0 -1656
- package/dist/HSelect-Drf6YBwO.js +0 -468
- package/dist/HSelectAll.vue_vue_type_script_setup_true_lang-Blq9xpfa.js +0 -36
- package/dist/HSelectSJ-D3GrXmvj.js +0 -462
- package/dist/IdentifyAddress.vue_vue_type_script_setup_true_lang-BJheMI1q.js +0 -4743
- package/dist/ImageLoupe.vue_vue_type_script_setup_true_lang-BlX4VbRi.js +0 -79
- package/dist/LazyComponent.vue_vue_type_script_setup_true_lang-vNk68D8E.js +0 -82
- package/dist/LazyPopover.vue_vue_type_script_setup_true_lang-DcOrcH0T.js +0 -33
- package/dist/LoadingBtn-BhbhNboo.js +0 -66
- package/dist/MInput-CpoW17Wh.js +0 -101
- package/dist/MyTable-DmwyEVJb.js +0 -68
- package/dist/NoRender.vue_vue_type_script_setup_true_lang-Do36nSsV.js +0 -30
- package/dist/SelectAddress-B4oK5erq.js +0 -173
- package/dist/SelectAll.vue_vue_type_script_setup_true_lang-BC3q2U8f.js +0 -79
- package/dist/SelectAll2.vue_vue_type_script_setup_true_lang-CaET5eli.js +0 -74
- package/dist/SelectCustomAll.vue_vue_type_style_index_0_lang-_wCRO217.js +0 -83
- package/dist/SelectTimePicker.vue_vue_type_script_setup_true_lang-Bj0KMOKv.js +0 -45
- package/dist/SelectTree-Dm5259kY.js +0 -911
- package/dist/SvgIcon-C2ah8E0Z.js +0 -30
- package/dist/TextCopy-hOj-Wj2H.js +0 -41
- package/dist/TextEllipsisTooltip.vue_vue_type_script_setup_true_lang-aZbEQmbM.js +0 -112
- package/dist/VirtualTable-BWugJiQ5.js +0 -349
- package/dist/_commonjsHelpers-ByYUsBRP.js +0 -33
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/common-BIEgCXbl.js +0 -7030
- package/dist/dateShortcuts-DDPtAhDI.js +0 -26
- package/dist/index-BRcBDlVs.js +0 -68
- package/dist/index-CeWudY6u.js +0 -8
- package/dist/index-DIX8TpoT.js +0 -118
- package/dist/index-DpPsTMp0.js +0 -8
- package/dist/index-epuVZjZV.js +0 -103
- package/dist/index-uf7oyYDF.js +0 -16847
- package/dist/loading-DJVNc0eN.js +0 -36
- package/dist/usePagination-CwShBEjA.js +0 -20
- package/dist/vue-virtual-scroller.esm-CH-jx4ri.js +0 -1051
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { ElSelect, ElOption } from "element-plus/es";
|
|
2
|
+
import { defineComponent, ref, watch, openBlock, createElementBlock, renderSlot, createVNode, withCtx, Fragment, renderList, createBlock, createCommentVNode } from "vue";
|
|
3
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
|
|
4
|
+
import './SelectAddress.css';const _hoisted_1 = { class: "select-address-area flex" };
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "SelectAddress",
|
|
7
|
+
props: {
|
|
8
|
+
province: {
|
|
9
|
+
type: [Number, String],
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
city: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
area: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
town: {
|
|
21
|
+
type: [Number, String],
|
|
22
|
+
required: true
|
|
23
|
+
},
|
|
24
|
+
list: {
|
|
25
|
+
type: Array
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "default"
|
|
30
|
+
},
|
|
31
|
+
type: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "code"
|
|
34
|
+
},
|
|
35
|
+
// 是否展示街道,针对跨境物流管理兼容
|
|
36
|
+
showTown: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: true
|
|
39
|
+
},
|
|
40
|
+
changeEmit: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
emits: ["update:province", "update:city", "update:area", "update:town", "change"],
|
|
46
|
+
setup(__props, { emit: __emit }) {
|
|
47
|
+
const props = __props;
|
|
48
|
+
const provinceCode = ref("");
|
|
49
|
+
const cityCode = ref("");
|
|
50
|
+
const areaCode = ref("");
|
|
51
|
+
const townCode = ref("");
|
|
52
|
+
const provinceList = ref([]);
|
|
53
|
+
const cityList = ref([]);
|
|
54
|
+
const areaList = ref([]);
|
|
55
|
+
const townList = ref([]);
|
|
56
|
+
const emit = __emit;
|
|
57
|
+
const resultDataMap = {
|
|
58
|
+
province: {},
|
|
59
|
+
city: {},
|
|
60
|
+
area: {},
|
|
61
|
+
town: {},
|
|
62
|
+
current: ""
|
|
63
|
+
};
|
|
64
|
+
const selectProvince = (province) => {
|
|
65
|
+
const provinceData = provinceList.value.find((i) => i[props.type] === province) || {};
|
|
66
|
+
resultDataMap.province = { name: provinceData.name, code: provinceData.code };
|
|
67
|
+
resultDataMap.city = {};
|
|
68
|
+
resultDataMap.area = {};
|
|
69
|
+
resultDataMap.town = {};
|
|
70
|
+
resultDataMap.current = "province";
|
|
71
|
+
cityList.value = provinceData && provinceData[props.type] ? provinceData.areasList || [] : [];
|
|
72
|
+
cityCode.value = "";
|
|
73
|
+
areaCode.value = "";
|
|
74
|
+
townCode.value = "";
|
|
75
|
+
emit("update:province", provinceCode.value);
|
|
76
|
+
emit("update:city", cityCode.value);
|
|
77
|
+
emit("update:area", areaCode.value);
|
|
78
|
+
emit("update:town", townCode.value);
|
|
79
|
+
emit("change", resultDataMap);
|
|
80
|
+
};
|
|
81
|
+
const selectCity = (city) => {
|
|
82
|
+
const cityData = cityList.value.find((i) => i[props.type] === city) || {};
|
|
83
|
+
resultDataMap.city = { name: cityData.name, code: cityData.code };
|
|
84
|
+
resultDataMap.area = {};
|
|
85
|
+
resultDataMap.town = {};
|
|
86
|
+
resultDataMap.current = "city";
|
|
87
|
+
areaList.value = cityData && cityData[props.type] ? cityData.areasList || [] : [];
|
|
88
|
+
areaCode.value = "";
|
|
89
|
+
townCode.value = "";
|
|
90
|
+
emit("update:city", cityCode.value);
|
|
91
|
+
emit("update:area", areaCode.value);
|
|
92
|
+
emit("update:town", townCode.value);
|
|
93
|
+
emit("change", resultDataMap);
|
|
94
|
+
};
|
|
95
|
+
const selectArea = (area) => {
|
|
96
|
+
const areaData = areaList.value.find((i) => i[props.type] === area) || {};
|
|
97
|
+
resultDataMap.area = { name: areaData.name, code: areaData.code };
|
|
98
|
+
resultDataMap.town = {};
|
|
99
|
+
resultDataMap.current = "area";
|
|
100
|
+
townList.value = areaData && areaData[props.type] ? areaData.areasList || [] : [];
|
|
101
|
+
townCode.value = "";
|
|
102
|
+
emit("update:area", area);
|
|
103
|
+
emit("update:town", townCode.value);
|
|
104
|
+
emit("change", resultDataMap);
|
|
105
|
+
};
|
|
106
|
+
const selectTown = (town) => {
|
|
107
|
+
const townData = townList.value.find((i) => i[props.type] === town) || {};
|
|
108
|
+
resultDataMap.town = { name: townData.name, code: townData.code };
|
|
109
|
+
resultDataMap.current = "town";
|
|
110
|
+
emit("update:town", townCode.value);
|
|
111
|
+
emit("change", resultDataMap);
|
|
112
|
+
};
|
|
113
|
+
watch([() => props.province, () => props.city, () => props.area, () => props.town, () => props.list], ([province, city, area, town, list]) => {
|
|
114
|
+
if (!list || !list.length) return;
|
|
115
|
+
provinceList.value = list;
|
|
116
|
+
if (props.type === "code") {
|
|
117
|
+
if (province) province = Number(province);
|
|
118
|
+
if (city) city = Number(city);
|
|
119
|
+
if (area) area = Number(area);
|
|
120
|
+
if (town) town = Number(town);
|
|
121
|
+
}
|
|
122
|
+
if (!province) {
|
|
123
|
+
provinceCode.value = "";
|
|
124
|
+
cityCode.value = "";
|
|
125
|
+
areaCode.value = "";
|
|
126
|
+
townCode.value = "";
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
provinceCode.value = province || "";
|
|
130
|
+
const provinceData = provinceList.value.find((i) => i[props.type] === provinceCode.value) || {};
|
|
131
|
+
resultDataMap.province = { name: provinceData.name, code: provinceData.code };
|
|
132
|
+
cityList.value = provinceData && provinceData[props.type] ? provinceData.areasList || [] : [];
|
|
133
|
+
if (!cityList.value.length) {
|
|
134
|
+
cityCode.value = "";
|
|
135
|
+
areaCode.value = "";
|
|
136
|
+
townCode.value = "";
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
cityCode.value = city || "";
|
|
140
|
+
const cityData = cityList.value.find((i) => i[props.type] === cityCode.value) || {};
|
|
141
|
+
resultDataMap.city = { name: cityData.name, code: cityData.code };
|
|
142
|
+
areaList.value = cityData && cityData[props.type] ? cityData.areasList || [] : [];
|
|
143
|
+
if (!areaList.value.length) {
|
|
144
|
+
areaCode.value = "";
|
|
145
|
+
townCode.value = "";
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
areaCode.value = area || "";
|
|
149
|
+
const areaData = areaList.value.find((i) => i[props.type] === areaCode.value) || {};
|
|
150
|
+
resultDataMap.area = { name: areaData.name, code: areaData.code };
|
|
151
|
+
townList.value = areaData && areaData[props.type] ? areaData.areasList || [] : [];
|
|
152
|
+
townCode.value = townList.value.length ? town : "";
|
|
153
|
+
const townData = townList.value.find((i) => i[props.type] === town) || {};
|
|
154
|
+
resultDataMap.town = { name: townData.name, code: townData.code };
|
|
155
|
+
resultDataMap.current = "";
|
|
156
|
+
if (props.changeEmit) emit("change", resultDataMap);
|
|
157
|
+
}, { immediate: true });
|
|
158
|
+
return (_ctx, _cache) => {
|
|
159
|
+
const _component_el_option = ElOption;
|
|
160
|
+
const _component_el_select = ElSelect;
|
|
161
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
162
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true),
|
|
163
|
+
createVNode(_component_el_select, {
|
|
164
|
+
modelValue: provinceCode.value,
|
|
165
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => provinceCode.value = $event),
|
|
166
|
+
siez: __props.size,
|
|
167
|
+
onChange: selectProvince,
|
|
168
|
+
clearable: "",
|
|
169
|
+
filterable: "",
|
|
170
|
+
placeholder: "请选择省份"
|
|
171
|
+
}, {
|
|
172
|
+
default: withCtx(() => [
|
|
173
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(provinceList.value, (item) => {
|
|
174
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
175
|
+
key: item.code,
|
|
176
|
+
label: item.name,
|
|
177
|
+
value: item[__props.type]
|
|
178
|
+
}, null, 8, ["label", "value"]);
|
|
179
|
+
}), 128))
|
|
180
|
+
]),
|
|
181
|
+
_: 1
|
|
182
|
+
}, 8, ["modelValue", "siez"]),
|
|
183
|
+
createVNode(_component_el_select, {
|
|
184
|
+
modelValue: cityCode.value,
|
|
185
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => cityCode.value = $event),
|
|
186
|
+
placeholder: "请选择城市",
|
|
187
|
+
siez: __props.size,
|
|
188
|
+
disabled: !provinceCode.value,
|
|
189
|
+
onChange: selectCity,
|
|
190
|
+
clearable: "",
|
|
191
|
+
filterable: ""
|
|
192
|
+
}, {
|
|
193
|
+
default: withCtx(() => [
|
|
194
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(cityList.value, (item) => {
|
|
195
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
196
|
+
key: item.code,
|
|
197
|
+
label: item.name,
|
|
198
|
+
value: item[__props.type]
|
|
199
|
+
}, null, 8, ["label", "value"]);
|
|
200
|
+
}), 128))
|
|
201
|
+
]),
|
|
202
|
+
_: 1
|
|
203
|
+
}, 8, ["modelValue", "siez", "disabled"]),
|
|
204
|
+
createVNode(_component_el_select, {
|
|
205
|
+
modelValue: areaCode.value,
|
|
206
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => areaCode.value = $event),
|
|
207
|
+
placeholder: "请选择区/县",
|
|
208
|
+
siez: __props.size,
|
|
209
|
+
disabled: !cityCode.value,
|
|
210
|
+
onChange: selectArea,
|
|
211
|
+
clearable: "",
|
|
212
|
+
filterable: ""
|
|
213
|
+
}, {
|
|
214
|
+
default: withCtx(() => [
|
|
215
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(areaList.value, (item) => {
|
|
216
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
217
|
+
key: item.code,
|
|
218
|
+
label: item.name,
|
|
219
|
+
value: item[__props.type]
|
|
220
|
+
}, null, 8, ["label", "value"]);
|
|
221
|
+
}), 128))
|
|
222
|
+
]),
|
|
223
|
+
_: 1
|
|
224
|
+
}, 8, ["modelValue", "siez", "disabled"]),
|
|
225
|
+
__props.showTown ? (openBlock(), createBlock(_component_el_select, {
|
|
226
|
+
key: 0,
|
|
227
|
+
modelValue: townCode.value,
|
|
228
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => townCode.value = $event),
|
|
229
|
+
placeholder: "请选择街道",
|
|
230
|
+
siez: __props.size,
|
|
231
|
+
disabled: !areaCode.value,
|
|
232
|
+
onChange: selectTown,
|
|
233
|
+
clearable: "",
|
|
234
|
+
filterable: ""
|
|
235
|
+
}, {
|
|
236
|
+
default: withCtx(() => [
|
|
237
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(townList.value, (item) => {
|
|
238
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
239
|
+
key: item.code,
|
|
240
|
+
label: item.name,
|
|
241
|
+
value: item[__props.type]
|
|
242
|
+
}, null, 8, ["label", "value"]);
|
|
243
|
+
}), 128))
|
|
244
|
+
]),
|
|
245
|
+
_: 1
|
|
246
|
+
}, 8, ["modelValue", "siez", "disabled"])) : createCommentVNode("", true)
|
|
247
|
+
]);
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
const SelectAddress = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5a82450f"]]);
|
|
252
|
+
export {
|
|
253
|
+
SelectAddress as S
|
|
254
|
+
};
|
package/dist/SelectAddress.css
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
-
.select-address-area>div[data-v-5a82450f]:not(:last-child){
|
|
1
|
+
.select-address-area > div[data-v-5a82450f]:not(:last-child) {
|
|
2
|
+
margin-right: 12px
|
|
3
|
+
}
|
|
4
|
+
@media (max-width: 1680px) {
|
|
5
|
+
.select-address-area > div[data-v-5a82450f]:not(:last-child) {
|
|
6
|
+
margin-right: 10px
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
@media (max-width: 1550px) {
|
|
10
|
+
.select-address-area > div[data-v-5a82450f]:not(:last-child) {
|
|
11
|
+
margin-right: 8px
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
@media (max-width: 1440px) {
|
|
15
|
+
.select-address-area > div[data-v-5a82450f]:not(:last-child) {
|
|
16
|
+
margin-right: 6px
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { ElSelect, ElOption } from "element-plus/es";
|
|
2
|
+
import { defineComponent, ref, computed, openBlock, createBlock, withCtx, createVNode, createElementBlock, Fragment, renderList } from "vue";
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "SelectAll",
|
|
5
|
+
props: {
|
|
6
|
+
placeholder: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: () => ""
|
|
9
|
+
},
|
|
10
|
+
allValue: {
|
|
11
|
+
// 所有选项绑定的 id, 取数据的时候需要过滤掉
|
|
12
|
+
type: Number,
|
|
13
|
+
default: () => -10
|
|
14
|
+
},
|
|
15
|
+
all: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: () => "全部"
|
|
18
|
+
},
|
|
19
|
+
id: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: () => "id"
|
|
22
|
+
},
|
|
23
|
+
label: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: () => "name"
|
|
26
|
+
},
|
|
27
|
+
list: {
|
|
28
|
+
// 传入的列表
|
|
29
|
+
type: Array,
|
|
30
|
+
default: () => []
|
|
31
|
+
},
|
|
32
|
+
value: {
|
|
33
|
+
// 双向绑定的值
|
|
34
|
+
type: Array,
|
|
35
|
+
default: () => []
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
emits: ["update:value"],
|
|
39
|
+
setup(__props, { emit: __emit }) {
|
|
40
|
+
const lastChecked = ref([]);
|
|
41
|
+
const props = __props;
|
|
42
|
+
const emit = __emit;
|
|
43
|
+
const currentValue = computed({
|
|
44
|
+
get() {
|
|
45
|
+
return props.value;
|
|
46
|
+
},
|
|
47
|
+
set(val) {
|
|
48
|
+
emit("update:value", val);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const itemsChange = (v) => {
|
|
52
|
+
let resArr = [];
|
|
53
|
+
if (v.includes(props.allValue)) {
|
|
54
|
+
if (lastChecked.value.length > props.list.length) {
|
|
55
|
+
resArr = v.filter((e) => e > 0);
|
|
56
|
+
} else {
|
|
57
|
+
resArr = [props.allValue, ...props.list.map((e) => e.id)];
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
if (v.length === props.list.length) {
|
|
61
|
+
resArr = [props.allValue, ...v];
|
|
62
|
+
} else {
|
|
63
|
+
resArr = v;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
currentValue.value = resArr;
|
|
67
|
+
lastChecked.value = [...resArr];
|
|
68
|
+
};
|
|
69
|
+
return (_ctx, _cache) => {
|
|
70
|
+
const _component_el_option = ElOption;
|
|
71
|
+
const _component_el_select = ElSelect;
|
|
72
|
+
return openBlock(), createBlock(_component_el_select, {
|
|
73
|
+
multiple: "",
|
|
74
|
+
"collapse-tags": "",
|
|
75
|
+
modelValue: currentValue.value,
|
|
76
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => currentValue.value = $event),
|
|
77
|
+
clearable: "",
|
|
78
|
+
placeholder: props.placeholder,
|
|
79
|
+
onChange: itemsChange
|
|
80
|
+
}, {
|
|
81
|
+
default: withCtx(() => [
|
|
82
|
+
createVNode(_component_el_option, {
|
|
83
|
+
value: props.allValue,
|
|
84
|
+
label: props.all
|
|
85
|
+
}, null, 8, ["value", "label"]),
|
|
86
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(props.list, (item) => {
|
|
87
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
88
|
+
key: item.id,
|
|
89
|
+
value: item[props.id],
|
|
90
|
+
label: item[props.label]
|
|
91
|
+
}, null, 8, ["value", "label"]);
|
|
92
|
+
}), 128))
|
|
93
|
+
]),
|
|
94
|
+
_: 1
|
|
95
|
+
}, 8, ["modelValue", "placeholder"]);
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
export {
|
|
100
|
+
_sfc_main as _
|
|
101
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { ElSelectV2 } from "element-plus/es";
|
|
2
|
+
import { defineComponent, useModel, ref, watch, onMounted, openBlock, createBlock, mergeProps, mergeModels, nextTick } from "vue";
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "SelectAll2",
|
|
5
|
+
props: /* @__PURE__ */ mergeModels({
|
|
6
|
+
labelkey: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: "label"
|
|
9
|
+
},
|
|
10
|
+
valuekey: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: "value"
|
|
13
|
+
},
|
|
14
|
+
binds: {
|
|
15
|
+
type: Object,
|
|
16
|
+
default: () => ({})
|
|
17
|
+
},
|
|
18
|
+
list: {
|
|
19
|
+
// 传入的列表
|
|
20
|
+
type: Array,
|
|
21
|
+
default: () => []
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
"modelValue": { type: Array },
|
|
25
|
+
"modelModifiers": {}
|
|
26
|
+
}),
|
|
27
|
+
emits: /* @__PURE__ */ mergeModels(["change", "clear"], ["update:modelValue"]),
|
|
28
|
+
setup(__props, { emit: __emit }) {
|
|
29
|
+
const modelValue = useModel(__props, "modelValue");
|
|
30
|
+
const emit = __emit;
|
|
31
|
+
const props = __props;
|
|
32
|
+
const selections = ref([]);
|
|
33
|
+
watch(() => props.list, () => {
|
|
34
|
+
setOptions();
|
|
35
|
+
});
|
|
36
|
+
watch(modelValue, (n, o) => {
|
|
37
|
+
if (JSON.stringify(n) === JSON.stringify(o)) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
selections.value = modelValue.value;
|
|
41
|
+
});
|
|
42
|
+
const setOptions = () => {
|
|
43
|
+
const _options = JSON.parse(JSON.stringify(props.list));
|
|
44
|
+
_options.unshift({ [props.labelkey]: "全部选择", [props.valuekey]: "ALL" });
|
|
45
|
+
options.value = _options;
|
|
46
|
+
};
|
|
47
|
+
const options = ref([]);
|
|
48
|
+
const attrChange = (v) => {
|
|
49
|
+
nextTick(() => {
|
|
50
|
+
if (selections.value.includes("ALL")) {
|
|
51
|
+
const itemsArr = [];
|
|
52
|
+
const _val = [];
|
|
53
|
+
options.value.forEach((item) => {
|
|
54
|
+
if (item[props.valuekey] !== "ALL" && !selections.value.includes(item[props.valuekey])) {
|
|
55
|
+
itemsArr.push(item[props.valuekey]);
|
|
56
|
+
_val.push(item[props.valuekey]);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
selections.value = _val;
|
|
60
|
+
options.value[0][props.valuekey] = "CANCEL";
|
|
61
|
+
options.value[0][props.labelkey] = "全部取消";
|
|
62
|
+
} else if (selections.value.includes("CANCEL")) {
|
|
63
|
+
selections.value = [];
|
|
64
|
+
options.value[0][props.valuekey] = "ALL";
|
|
65
|
+
options.value[0][props.labelkey] = "全部选择";
|
|
66
|
+
}
|
|
67
|
+
modelValue.value = selections.value;
|
|
68
|
+
emit("change", modelValue.value);
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
const clear = () => {
|
|
72
|
+
modelValue.value = [];
|
|
73
|
+
options.value[0][props.valuekey] = "ALL";
|
|
74
|
+
options.value[0][props.labelkey] = "全部选择";
|
|
75
|
+
emit("clear");
|
|
76
|
+
};
|
|
77
|
+
onMounted(() => {
|
|
78
|
+
setOptions();
|
|
79
|
+
selections.value = modelValue.value;
|
|
80
|
+
});
|
|
81
|
+
return (_ctx, _cache) => {
|
|
82
|
+
const _component_el_select_v2 = ElSelectV2;
|
|
83
|
+
return openBlock(), createBlock(_component_el_select_v2, mergeProps({
|
|
84
|
+
filterable: "",
|
|
85
|
+
modelValue: selections.value,
|
|
86
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selections.value = $event)
|
|
87
|
+
}, __props.binds, {
|
|
88
|
+
options: options.value,
|
|
89
|
+
style: { "width": "150px" },
|
|
90
|
+
multiple: "",
|
|
91
|
+
clearable: "",
|
|
92
|
+
"collapse-tags": "",
|
|
93
|
+
"collapse-tags-tooltip": "",
|
|
94
|
+
onChange: attrChange,
|
|
95
|
+
onClear: clear,
|
|
96
|
+
height: 300
|
|
97
|
+
}), null, 16, ["modelValue", "options"]);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
export {
|
|
102
|
+
_sfc_main as _
|
|
103
|
+
};
|
package/dist/SelectCustomAll.css
CHANGED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { ElSelect, ElOption, ElCheckbox } from "element-plus/es";
|
|
2
|
+
import { defineComponent, ref, useModel, watch, openBlock, createBlock, mergeProps, createSlots, withCtx, createElementBlock, Fragment, renderList, createVNode, createTextVNode, mergeModels } from "vue";
|
|
3
|
+
import './SelectCustomAll.css';const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "SelectCustomAll",
|
|
5
|
+
props: /* @__PURE__ */ mergeModels({
|
|
6
|
+
list: {
|
|
7
|
+
// 传入的列表
|
|
8
|
+
type: Array,
|
|
9
|
+
default: () => []
|
|
10
|
+
},
|
|
11
|
+
label: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "label"
|
|
14
|
+
},
|
|
15
|
+
value: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "value"
|
|
18
|
+
},
|
|
19
|
+
selectAll: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: true
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
"modelValue": {},
|
|
25
|
+
"modelModifiers": {}
|
|
26
|
+
}),
|
|
27
|
+
emits: ["update:modelValue"],
|
|
28
|
+
setup(__props) {
|
|
29
|
+
const props = __props;
|
|
30
|
+
const optionsList = ref(JSON.parse(JSON.stringify(props.list)));
|
|
31
|
+
const modelValue = useModel(__props, "modelValue");
|
|
32
|
+
const checkAll = ref(false);
|
|
33
|
+
const indeterminate = ref(false);
|
|
34
|
+
const handleCheckAllStatus = () => {
|
|
35
|
+
if (modelValue.value.length) {
|
|
36
|
+
const isMatch = modelValue.value.some((e) => optionsList.value.some((f) => f[props.value] === e));
|
|
37
|
+
const isAllMatch = optionsList.value.every((e) => modelValue.value.some((f) => e[props.value] === f));
|
|
38
|
+
if (isAllMatch) {
|
|
39
|
+
checkAll.value = true;
|
|
40
|
+
indeterminate.value = false;
|
|
41
|
+
} else if (isMatch) {
|
|
42
|
+
indeterminate.value = true;
|
|
43
|
+
} else {
|
|
44
|
+
checkAll.value = false;
|
|
45
|
+
indeterminate.value = false;
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
indeterminate.value = false;
|
|
49
|
+
checkAll.value = false;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const filterMethod = (val) => {
|
|
53
|
+
optionsList.value = props.list.filter((e) => e[props.label].toLowerCase().indexOf(val.toLowerCase()) >= 0);
|
|
54
|
+
handleCheckAllStatus();
|
|
55
|
+
};
|
|
56
|
+
watch(() => modelValue.value, () => {
|
|
57
|
+
handleCheckAllStatus();
|
|
58
|
+
});
|
|
59
|
+
const handleCheckAll = (val) => {
|
|
60
|
+
indeterminate.value = false;
|
|
61
|
+
if (val) {
|
|
62
|
+
modelValue.value = optionsList.value.map((e) => e[props.value]);
|
|
63
|
+
} else {
|
|
64
|
+
modelValue.value = [];
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return (_ctx, _cache) => {
|
|
68
|
+
const _component_el_checkbox = ElCheckbox;
|
|
69
|
+
const _component_el_option = ElOption;
|
|
70
|
+
const _component_el_select = ElSelect;
|
|
71
|
+
return openBlock(), createBlock(_component_el_select, mergeProps(_ctx.$attrs, {
|
|
72
|
+
modelValue: modelValue.value,
|
|
73
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event),
|
|
74
|
+
"filter-method": filterMethod,
|
|
75
|
+
placeholder: "请选择"
|
|
76
|
+
}), createSlots({
|
|
77
|
+
default: withCtx(() => [
|
|
78
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(optionsList.value, (item) => {
|
|
79
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
80
|
+
key: item.value,
|
|
81
|
+
label: item[props.label],
|
|
82
|
+
value: item[props.value]
|
|
83
|
+
}, null, 8, ["label", "value"]);
|
|
84
|
+
}), 128))
|
|
85
|
+
]),
|
|
86
|
+
_: 2
|
|
87
|
+
}, [
|
|
88
|
+
__props.selectAll ? {
|
|
89
|
+
name: "header",
|
|
90
|
+
fn: withCtx(() => [
|
|
91
|
+
createVNode(_component_el_checkbox, {
|
|
92
|
+
modelValue: checkAll.value,
|
|
93
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checkAll.value = $event),
|
|
94
|
+
indeterminate: indeterminate.value,
|
|
95
|
+
onChange: handleCheckAll
|
|
96
|
+
}, {
|
|
97
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
98
|
+
createTextVNode(" 全选 ", -1)
|
|
99
|
+
])]),
|
|
100
|
+
_: 1
|
|
101
|
+
}, 8, ["modelValue", "indeterminate"])
|
|
102
|
+
]),
|
|
103
|
+
key: "0"
|
|
104
|
+
} : void 0
|
|
105
|
+
]), 1040, ["modelValue"]);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
export {
|
|
110
|
+
_sfc_main as _
|
|
111
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ElSelectV2, ElDatePicker } from "element-plus/es";
|
|
2
|
+
import { defineComponent, useModel, openBlock, createElementBlock, createVNode, unref, mergeModels } from "vue";
|
|
3
|
+
import { dayjs } from "element-plus";
|
|
4
|
+
import { s as shortcuts } from "./dateShortcuts-DjFC_Txu.js";
|
|
5
|
+
const _hoisted_1 = { class: "flex" };
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "SelectTimePicker",
|
|
8
|
+
props: /* @__PURE__ */ mergeModels({
|
|
9
|
+
mapData: {},
|
|
10
|
+
selectOption: {},
|
|
11
|
+
propsConfig: {}
|
|
12
|
+
}, {
|
|
13
|
+
"modelValue": {},
|
|
14
|
+
"modelModifiers": {}
|
|
15
|
+
}),
|
|
16
|
+
emits: ["update:modelValue"],
|
|
17
|
+
setup(__props) {
|
|
18
|
+
const model = useModel(__props, "modelValue");
|
|
19
|
+
return (_ctx, _cache) => {
|
|
20
|
+
const _component_el_select_v2 = ElSelectV2;
|
|
21
|
+
const _component_el_date_picker = ElDatePicker;
|
|
22
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
23
|
+
createVNode(_component_el_select_v2, {
|
|
24
|
+
modelValue: model.value[__props.mapData.selectLabel],
|
|
25
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value[__props.mapData.selectLabel] = $event),
|
|
26
|
+
options: __props.selectOption,
|
|
27
|
+
placeholder: "时间类型",
|
|
28
|
+
style: { "width": "125px" },
|
|
29
|
+
clearable: ""
|
|
30
|
+
}, null, 8, ["modelValue", "options"]),
|
|
31
|
+
createVNode(_component_el_date_picker, {
|
|
32
|
+
modelValue: model.value[__props.mapData.timeLabel],
|
|
33
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => model.value[__props.mapData.timeLabel] = $event),
|
|
34
|
+
type: "daterange",
|
|
35
|
+
"value-format": "x",
|
|
36
|
+
"start-placeholder": "开始时间",
|
|
37
|
+
"end-placeholder": "结束时间",
|
|
38
|
+
defaultTime: [unref(dayjs)().startOf("day"), unref(dayjs)().endOf("day")],
|
|
39
|
+
shortcuts: unref(shortcuts),
|
|
40
|
+
style: { "width": "260px" }
|
|
41
|
+
}, null, 8, ["modelValue", "defaultTime", "shortcuts"])
|
|
42
|
+
]);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
_sfc_main as _
|
|
48
|
+
};
|