fangguo-component 1.1.3 → 1.1.5
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 +92 -92
- 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-AyPvTEmu.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-CLBJrzbA.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
package/dist/ArgHover.css
CHANGED
|
@@ -1 +1,20 @@
|
|
|
1
|
-
.arghover
|
|
1
|
+
.arghover {
|
|
2
|
+
white-space: pre-wrap;
|
|
3
|
+
}
|
|
4
|
+
.arghover .fg-arg-hover-trigger {
|
|
5
|
+
color: #9198A8;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
vertical-align: middle;
|
|
8
|
+
}
|
|
9
|
+
.arghover.el-popper.is-light > .el-popper__arrow::before {
|
|
10
|
+
right: 0;
|
|
11
|
+
background: #F5F9FF;
|
|
12
|
+
border: 1px solid rgba(68, 133, 245, 0.5803921569);
|
|
13
|
+
}
|
|
14
|
+
.arghover.el-popper.is-light {
|
|
15
|
+
background: #F5F9FF;
|
|
16
|
+
border: 1px solid rgba(68, 133, 245, 0.5803921569);
|
|
17
|
+
}
|
|
18
|
+
.arghover.el-popover.el-popper.is-light {
|
|
19
|
+
box-shadow: none;
|
|
20
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ElPopover, ElIcon } from "element-plus/es";
|
|
2
|
+
import { defineComponent, openBlock, createBlock, withCtx, renderSlot, createVNode, normalizeStyle, normalizeClass, unref } from "vue";
|
|
3
|
+
import { QuestionFilled } from "@element-plus/icons-vue";
|
|
4
|
+
import './ArgHover.css';const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "ArgHover",
|
|
6
|
+
props: {
|
|
7
|
+
text: String,
|
|
8
|
+
placement: {
|
|
9
|
+
default: "top"
|
|
10
|
+
},
|
|
11
|
+
effect: {
|
|
12
|
+
default: "light"
|
|
13
|
+
},
|
|
14
|
+
width: {
|
|
15
|
+
default: 200
|
|
16
|
+
},
|
|
17
|
+
color: {
|
|
18
|
+
default: "#9198A8"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
setup(__props) {
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
const _component_el_icon = ElIcon;
|
|
24
|
+
const _component_el_popover = ElPopover;
|
|
25
|
+
return openBlock(), createBlock(_component_el_popover, {
|
|
26
|
+
"popper-class": "arghover",
|
|
27
|
+
placement: __props.placement,
|
|
28
|
+
effect: __props.effect,
|
|
29
|
+
width: __props.width,
|
|
30
|
+
content: __props.text
|
|
31
|
+
}, {
|
|
32
|
+
reference: withCtx(() => [
|
|
33
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
34
|
+
createVNode(_component_el_icon, {
|
|
35
|
+
class: normalizeClass(["fg-arg-hover-trigger", _ctx.$attrs.class]),
|
|
36
|
+
style: normalizeStyle({ color: __props.color }),
|
|
37
|
+
size: 16
|
|
38
|
+
}, {
|
|
39
|
+
default: withCtx(() => [
|
|
40
|
+
createVNode(unref(QuestionFilled))
|
|
41
|
+
]),
|
|
42
|
+
_: 1
|
|
43
|
+
}, 8, ["class", "style"])
|
|
44
|
+
])
|
|
45
|
+
]),
|
|
46
|
+
default: withCtx(() => [
|
|
47
|
+
renderSlot(_ctx.$slots, "content")
|
|
48
|
+
]),
|
|
49
|
+
_: 3
|
|
50
|
+
}, 8, ["placement", "effect", "width", "content"]);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
export {
|
|
55
|
+
_sfc_main as _
|
|
56
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import './ButtonGroup.css';var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { defineComponent, ref, onMounted, onUnmounted, watch, openBlock, createElementBlock, createElementVNode, normalizeClass, Fragment, renderList, toDisplayString, normalizeStyle, nextTick } from "vue";
|
|
22
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
|
|
23
|
+
const _hoisted_1 = ["onClick"];
|
|
24
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
25
|
+
__name: "ButtonGroup",
|
|
26
|
+
props: {
|
|
27
|
+
data: {}
|
|
28
|
+
},
|
|
29
|
+
emits: ["change"],
|
|
30
|
+
setup(__props, { emit: __emit }) {
|
|
31
|
+
const btnGroupRef = ref(null);
|
|
32
|
+
const props = __props;
|
|
33
|
+
const emit = __emit;
|
|
34
|
+
const btnRefs = ref([]);
|
|
35
|
+
const bgSlideData = ref({
|
|
36
|
+
width: 0,
|
|
37
|
+
left: 0
|
|
38
|
+
});
|
|
39
|
+
const cloneList = ref([]);
|
|
40
|
+
let resizeObserver = null;
|
|
41
|
+
function syncSlideToActiveItem() {
|
|
42
|
+
return __async(this, null, function* () {
|
|
43
|
+
yield nextTick();
|
|
44
|
+
const activeIndex = cloneList.value.findIndex((item) => item.active);
|
|
45
|
+
if (activeIndex < 0) {
|
|
46
|
+
bgSlideData.value = { width: 0, left: 0 };
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const el = btnRefs.value[activeIndex];
|
|
50
|
+
if (!el) {
|
|
51
|
+
bgSlideData.value = { width: 0, left: 0 };
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
bgSlideData.value = {
|
|
55
|
+
width: el.clientWidth,
|
|
56
|
+
left: el.offsetLeft
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
const activeClick = (e, index) => {
|
|
61
|
+
const width = e.target.clientWidth || 0;
|
|
62
|
+
const left = e.target.offsetLeft || 0;
|
|
63
|
+
bgSlideData.value = {
|
|
64
|
+
width,
|
|
65
|
+
left
|
|
66
|
+
};
|
|
67
|
+
cloneList.value.forEach((item, i) => {
|
|
68
|
+
i === index ? item.active = true : item.active = false;
|
|
69
|
+
});
|
|
70
|
+
emit("change", cloneList.value[index]);
|
|
71
|
+
};
|
|
72
|
+
onMounted(() => __async(null, null, function* () {
|
|
73
|
+
cloneList.value = props.data;
|
|
74
|
+
yield syncSlideToActiveItem();
|
|
75
|
+
if (btnGroupRef.value) {
|
|
76
|
+
resizeObserver = new ResizeObserver(() => {
|
|
77
|
+
void syncSlideToActiveItem();
|
|
78
|
+
});
|
|
79
|
+
resizeObserver.observe(btnGroupRef.value);
|
|
80
|
+
}
|
|
81
|
+
}));
|
|
82
|
+
onUnmounted(() => {
|
|
83
|
+
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
|
84
|
+
resizeObserver = null;
|
|
85
|
+
});
|
|
86
|
+
watch(
|
|
87
|
+
() => props.data,
|
|
88
|
+
(data) => __async(null, null, function* () {
|
|
89
|
+
cloneList.value = data;
|
|
90
|
+
yield syncSlideToActiveItem();
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
return (_ctx, _cache) => {
|
|
94
|
+
return openBlock(), createElementBlock("div", {
|
|
95
|
+
ref_key: "btnGroupRef",
|
|
96
|
+
ref: btnGroupRef,
|
|
97
|
+
class: "flex"
|
|
98
|
+
}, [
|
|
99
|
+
createElementVNode("div", {
|
|
100
|
+
class: normalizeClass([_ctx.$style["but-group-wrap"], "pattern-box"])
|
|
101
|
+
}, [
|
|
102
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(cloneList.value, (item, index) => {
|
|
103
|
+
return openBlock(), createElementBlock("span", {
|
|
104
|
+
key: index,
|
|
105
|
+
class: normalizeClass([_ctx.$style["btn-items"], { [_ctx.$style["active"]]: item.active }, { "pattern-active": item.active }, "pattern-box-btn"]),
|
|
106
|
+
ref_for: true,
|
|
107
|
+
ref_key: "btnRefs",
|
|
108
|
+
ref: btnRefs,
|
|
109
|
+
onClick: ($event) => activeClick($event, index)
|
|
110
|
+
}, toDisplayString(item.label), 11, _hoisted_1);
|
|
111
|
+
}), 128)),
|
|
112
|
+
createElementVNode("div", {
|
|
113
|
+
class: normalizeClass([_ctx.$style["slide-bg"], "pattern-box-bg"]),
|
|
114
|
+
style: normalizeStyle({ width: `${bgSlideData.value.width}px`, left: `${bgSlideData.value.left}px` })
|
|
115
|
+
}, null, 6)
|
|
116
|
+
], 2)
|
|
117
|
+
], 512);
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
const active = "_active_127vp_22";
|
|
122
|
+
const style0 = {
|
|
123
|
+
"but-group-wrap": "_but-group-wrap_127vp_1",
|
|
124
|
+
"btn-items": "_btn-items_127vp_10",
|
|
125
|
+
active,
|
|
126
|
+
"slide-bg": "_slide-bg_127vp_25"
|
|
127
|
+
};
|
|
128
|
+
const cssModules = {
|
|
129
|
+
"$style": style0
|
|
130
|
+
};
|
|
131
|
+
const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
|
|
132
|
+
export {
|
|
133
|
+
ButtonGroup as B
|
|
134
|
+
};
|
package/dist/ButtonGroup.css
CHANGED
|
@@ -1 +1,35 @@
|
|
|
1
|
-
._but-group-wrap_127vp_1
|
|
1
|
+
._but-group-wrap_127vp_1 {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
font-size: 14px;
|
|
7
|
+
background: #F5F7FA;
|
|
8
|
+
border-radius: 19px;
|
|
9
|
+
}
|
|
10
|
+
._but-group-wrap_127vp_1 ._btn-items_127vp_10 {
|
|
11
|
+
z-index: 1;
|
|
12
|
+
display: inline-block;
|
|
13
|
+
padding: 0 8px;
|
|
14
|
+
text-align: center;
|
|
15
|
+
color: #9198A8;
|
|
16
|
+
line-height: 36px;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
._but-group-wrap_127vp_1 ._btn-items_127vp_10:hover {
|
|
20
|
+
color: var(--el-color-primary);
|
|
21
|
+
}
|
|
22
|
+
._but-group-wrap_127vp_1 ._btn-items_127vp_10._active_127vp_22 {
|
|
23
|
+
color: #fff;
|
|
24
|
+
}
|
|
25
|
+
._but-group-wrap_127vp_1 ._slide-bg_127vp_25 {
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 0;
|
|
28
|
+
width: 0;
|
|
29
|
+
height: 36px;
|
|
30
|
+
background: var(--el-color-primary);
|
|
31
|
+
border-radius: 19px;
|
|
32
|
+
transition-property: width, left;
|
|
33
|
+
transition-duration: 0.3s, 0.3s;
|
|
34
|
+
transition-timing-function: ease;
|
|
35
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { ElSelect, ElOption } from "element-plus/es";
|
|
2
|
+
import { defineComponent, ref, onMounted, watch, openBlock, createElementBlock, createVNode, withCtx, Fragment, renderList, createBlock, createCommentVNode } from "vue";
|
|
3
|
+
const _hoisted_1 = { class: "flex w-full" };
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "CitySelect",
|
|
6
|
+
props: {
|
|
7
|
+
provinceCode: {},
|
|
8
|
+
cityCode: {},
|
|
9
|
+
areaCode: {},
|
|
10
|
+
parentKey: { default: "parentCode" },
|
|
11
|
+
source: {},
|
|
12
|
+
valueKey: { default: "code" },
|
|
13
|
+
nameKey: { default: "name" },
|
|
14
|
+
level: { default: 3 }
|
|
15
|
+
},
|
|
16
|
+
emits: ["success"],
|
|
17
|
+
setup(__props, { emit: __emit }) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const emit = __emit;
|
|
20
|
+
const provinceValue = ref(null);
|
|
21
|
+
const cityValue = ref(null);
|
|
22
|
+
const areaValue = ref(null);
|
|
23
|
+
const provinceList = ref([]);
|
|
24
|
+
const cityList = ref([]);
|
|
25
|
+
const areaList = ref([]);
|
|
26
|
+
const allData = ref(/* @__PURE__ */ new Map());
|
|
27
|
+
const initData = (data) => {
|
|
28
|
+
if (!data.source.length) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
if (props.valueKey === "code") {
|
|
32
|
+
areaValue.value = data.areaCode || "";
|
|
33
|
+
cityValue.value = data.cityCode || "";
|
|
34
|
+
provinceValue.value = data.provinceCode || "";
|
|
35
|
+
}
|
|
36
|
+
const provinceArr = [];
|
|
37
|
+
data.source.forEach((province) => {
|
|
38
|
+
const provinceData = {
|
|
39
|
+
name: province[data.nameKey],
|
|
40
|
+
code: province[data.valueKey],
|
|
41
|
+
parentCode: province[data.parentKey],
|
|
42
|
+
areasList: /* @__PURE__ */ new Map()
|
|
43
|
+
};
|
|
44
|
+
provinceArr.push({
|
|
45
|
+
name: province[data.nameKey],
|
|
46
|
+
code: province[data.valueKey],
|
|
47
|
+
parentCode: province[data.parentKey]
|
|
48
|
+
});
|
|
49
|
+
if (Array.isArray(province.areasList)) {
|
|
50
|
+
province.areasList.forEach((city) => {
|
|
51
|
+
const cityData = {
|
|
52
|
+
name: city[data.nameKey],
|
|
53
|
+
code: city[data.valueKey],
|
|
54
|
+
parentCode: city[data.parentKey],
|
|
55
|
+
areasList: /* @__PURE__ */ new Map()
|
|
56
|
+
};
|
|
57
|
+
if (Array.isArray(city.areasList)) {
|
|
58
|
+
city.areasList.forEach((area) => {
|
|
59
|
+
const areaData = {
|
|
60
|
+
name: area[data.nameKey],
|
|
61
|
+
code: area[data.valueKey],
|
|
62
|
+
parentCode: area[data.parentKey]
|
|
63
|
+
};
|
|
64
|
+
cityData.areasList.set(areaData.code, areaData);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
provinceData.areasList.set(city.code, cityData);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
allData.value.set(province.code, provinceData);
|
|
71
|
+
});
|
|
72
|
+
provinceList.value = provinceArr;
|
|
73
|
+
if (data.provinceCode) {
|
|
74
|
+
provinceValue.value = data.provinceCode;
|
|
75
|
+
provinceChange(data.provinceCode);
|
|
76
|
+
}
|
|
77
|
+
if (data.cityCode) {
|
|
78
|
+
cityValue.value = data.cityCode;
|
|
79
|
+
cityChange(data.cityCode);
|
|
80
|
+
}
|
|
81
|
+
if (data.areaCode) {
|
|
82
|
+
areaValue.value = data.areaCode;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const provinceChange = (val) => {
|
|
86
|
+
const valueData = allData.value.get(val);
|
|
87
|
+
if (!valueData) return;
|
|
88
|
+
const newArr = [];
|
|
89
|
+
valueData.areasList.forEach((value) => {
|
|
90
|
+
newArr.push({
|
|
91
|
+
name: value.name,
|
|
92
|
+
code: value.code,
|
|
93
|
+
parentCode: value.parentCode
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
cityValue.value = null;
|
|
97
|
+
areaValue.value = null;
|
|
98
|
+
cityList.value = newArr;
|
|
99
|
+
if (props.level === 1) {
|
|
100
|
+
emit("success", {
|
|
101
|
+
level: 1,
|
|
102
|
+
provinceName: valueData.name || "",
|
|
103
|
+
provinceCode: valueData.code || ""
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const cityChange = (val) => {
|
|
108
|
+
const provinceData = allData.value.get(provinceValue.value);
|
|
109
|
+
if (!provinceData || !provinceData.areasList) return;
|
|
110
|
+
const cityData = provinceData.areasList.get(val);
|
|
111
|
+
const newArr = [];
|
|
112
|
+
if (!cityData || !cityData.areasList) return;
|
|
113
|
+
cityData.areasList.forEach((value) => {
|
|
114
|
+
newArr.push({
|
|
115
|
+
name: value.name,
|
|
116
|
+
code: value.code,
|
|
117
|
+
parentCode: value.parentCode
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
areaValue.value = null;
|
|
121
|
+
areaList.value = newArr;
|
|
122
|
+
if (props.level === 2) {
|
|
123
|
+
emit("success", {
|
|
124
|
+
level: 2,
|
|
125
|
+
provinceName: provinceData.name || "",
|
|
126
|
+
provinceCode: provinceData.code || "",
|
|
127
|
+
cityName: cityData.name || "",
|
|
128
|
+
cityCode: cityData.code || ""
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const areaChange = (val) => {
|
|
133
|
+
const provinceData = allData.value.get(provinceValue.value);
|
|
134
|
+
const cityData = provinceData.areasList.get(cityValue.value);
|
|
135
|
+
const areaData = cityData.areasList.get(val);
|
|
136
|
+
const obj = {
|
|
137
|
+
level: 3,
|
|
138
|
+
provinceName: provinceData.name || "",
|
|
139
|
+
provinceCode: provinceData.code || "",
|
|
140
|
+
cityName: cityData.name || "",
|
|
141
|
+
cityCode: cityData.code || "",
|
|
142
|
+
areaName: areaData.name || "",
|
|
143
|
+
areaCode: areaData.code || ""
|
|
144
|
+
};
|
|
145
|
+
emit("success", obj);
|
|
146
|
+
};
|
|
147
|
+
onMounted(() => {
|
|
148
|
+
initData(props);
|
|
149
|
+
});
|
|
150
|
+
watch(props, (newVal) => {
|
|
151
|
+
initData(newVal);
|
|
152
|
+
});
|
|
153
|
+
return (_ctx, _cache) => {
|
|
154
|
+
const _component_el_option = ElOption;
|
|
155
|
+
const _component_el_select = ElSelect;
|
|
156
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
157
|
+
createVNode(_component_el_select, {
|
|
158
|
+
placeholder: "省",
|
|
159
|
+
class: "mr-[10px] flex-1",
|
|
160
|
+
modelValue: provinceValue.value,
|
|
161
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => provinceValue.value = $event),
|
|
162
|
+
filterable: "",
|
|
163
|
+
onChange: provinceChange
|
|
164
|
+
}, {
|
|
165
|
+
default: withCtx(() => [
|
|
166
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(provinceList.value, (item) => {
|
|
167
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
168
|
+
key: item.code,
|
|
169
|
+
value: item.code,
|
|
170
|
+
label: item.name
|
|
171
|
+
}, null, 8, ["value", "label"]);
|
|
172
|
+
}), 128))
|
|
173
|
+
]),
|
|
174
|
+
_: 1
|
|
175
|
+
}, 8, ["modelValue"]),
|
|
176
|
+
props.level >= 2 ? (openBlock(), createBlock(_component_el_select, {
|
|
177
|
+
key: 0,
|
|
178
|
+
placeholder: "市",
|
|
179
|
+
class: "mr-[10px] flex-1",
|
|
180
|
+
modelValue: cityValue.value,
|
|
181
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => cityValue.value = $event),
|
|
182
|
+
filterable: "",
|
|
183
|
+
onChange: cityChange
|
|
184
|
+
}, {
|
|
185
|
+
default: withCtx(() => [
|
|
186
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(cityList.value, (item) => {
|
|
187
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
188
|
+
key: item.code,
|
|
189
|
+
value: item.code,
|
|
190
|
+
label: item.name
|
|
191
|
+
}, null, 8, ["value", "label"]);
|
|
192
|
+
}), 128))
|
|
193
|
+
]),
|
|
194
|
+
_: 1
|
|
195
|
+
}, 8, ["modelValue"])) : createCommentVNode("", true),
|
|
196
|
+
props.level >= 3 ? (openBlock(), createBlock(_component_el_select, {
|
|
197
|
+
key: 1,
|
|
198
|
+
placeholder: "区/县",
|
|
199
|
+
modelValue: areaValue.value,
|
|
200
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => areaValue.value = $event),
|
|
201
|
+
class: "flex-1",
|
|
202
|
+
filterable: "",
|
|
203
|
+
onChange: areaChange
|
|
204
|
+
}, {
|
|
205
|
+
default: withCtx(() => [
|
|
206
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(areaList.value.filter((data) => {
|
|
207
|
+
return data.parentCode === cityValue.value;
|
|
208
|
+
}), (item) => {
|
|
209
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
210
|
+
key: item[props.valueKey],
|
|
211
|
+
value: item[props.valueKey],
|
|
212
|
+
label: item[props.nameKey]
|
|
213
|
+
}, null, 8, ["value", "label"]);
|
|
214
|
+
}), 128))
|
|
215
|
+
]),
|
|
216
|
+
_: 1
|
|
217
|
+
}, 8, ["modelValue"])) : createCommentVNode("", true)
|
|
218
|
+
]);
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
export {
|
|
223
|
+
_sfc_main as _
|
|
224
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, toDisplayString, renderSlot } from "vue";
|
|
2
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
|
|
3
|
+
import './ContentTitle.css';const _hoisted_1 = { class: "flex items-baseline gap-x-[4px]" };
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "ContentTitle",
|
|
6
|
+
props: {
|
|
7
|
+
title: {}
|
|
8
|
+
},
|
|
9
|
+
setup(__props) {
|
|
10
|
+
const props = __props;
|
|
11
|
+
return (_ctx, _cache) => {
|
|
12
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
13
|
+
createElementVNode("h3", {
|
|
14
|
+
class: normalizeClass(_ctx.$style["content-title"])
|
|
15
|
+
}, toDisplayString(props.title), 3),
|
|
16
|
+
renderSlot(_ctx.$slots, "default")
|
|
17
|
+
]);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const style0 = {
|
|
22
|
+
"content-title": "_content-title_1dl6y_1"
|
|
23
|
+
};
|
|
24
|
+
const cssModules = {
|
|
25
|
+
"$style": style0
|
|
26
|
+
};
|
|
27
|
+
const ContentTitle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
|
|
28
|
+
export {
|
|
29
|
+
ContentTitle as C
|
|
30
|
+
};
|
package/dist/ContentTitle.css
CHANGED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { ElInput, ElSelect, ElOption, ElDialog, ElButton } from "element-plus/es";
|
|
2
|
+
import { defineComponent, useModel, ref, useSlots, useAttrs, openBlock, createElementBlock, Fragment, createVNode, mergeProps, unref, createSlots, withCtx, renderList, createBlock, renderSlot, createElementVNode, toDisplayString, createTextVNode, createCommentVNode, mergeModels } from "vue";
|
|
3
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
|
|
4
|
+
import './CustomInputV2.css';const _hoisted_1 = { key: 0 };
|
|
5
|
+
const _hoisted_2 = {
|
|
6
|
+
class: "py-[12px] text-fill-900",
|
|
7
|
+
style: { "font-family": "MicrosoftYaHei, sans-serif" }
|
|
8
|
+
};
|
|
9
|
+
const _hoisted_3 = { class: "pt-[24px] pb-[12px]" };
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
__name: "CustomInputV2",
|
|
12
|
+
props: /* @__PURE__ */ mergeModels({
|
|
13
|
+
placeholder: { default: "请输入" },
|
|
14
|
+
isShowCondition: { type: Boolean, default: true },
|
|
15
|
+
name: { default: "" },
|
|
16
|
+
isShowMultiple: { type: Boolean, default: true },
|
|
17
|
+
options: { default: () => [
|
|
18
|
+
{ label: "模糊匹配", value: true },
|
|
19
|
+
{ label: "精准匹配", value: false }
|
|
20
|
+
] }
|
|
21
|
+
}, {
|
|
22
|
+
"modelValue": {},
|
|
23
|
+
"modelModifiers": {},
|
|
24
|
+
"condition": {},
|
|
25
|
+
"conditionModifiers": {}
|
|
26
|
+
}),
|
|
27
|
+
emits: ["update:modelValue", "update:condition"],
|
|
28
|
+
setup(__props) {
|
|
29
|
+
const modelValue = useModel(__props, "modelValue");
|
|
30
|
+
const condition = useModel(__props, "condition");
|
|
31
|
+
const props = __props;
|
|
32
|
+
const titleName = ref();
|
|
33
|
+
const modelName = ref("多个值以逗号隔开或空格隔开");
|
|
34
|
+
const slots = useSlots();
|
|
35
|
+
const attrs = useAttrs();
|
|
36
|
+
const moreShow = ref(false);
|
|
37
|
+
const getFirstPart = (inputString) => {
|
|
38
|
+
const regex = /,|,/;
|
|
39
|
+
const parts = inputString.split(regex);
|
|
40
|
+
return parts;
|
|
41
|
+
};
|
|
42
|
+
titleName.value = props.name || getFirstPart(props.placeholder)[0];
|
|
43
|
+
modelName.value = getFirstPart(props.placeholder)[1];
|
|
44
|
+
return (_ctx, _cache) => {
|
|
45
|
+
const _component_el_option = ElOption;
|
|
46
|
+
const _component_el_select = ElSelect;
|
|
47
|
+
const _component_el_input = ElInput;
|
|
48
|
+
const _component_el_button = ElButton;
|
|
49
|
+
const _component_el_dialog = ElDialog;
|
|
50
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
51
|
+
createVNode(_component_el_input, mergeProps({ class: "custom-input" }, unref(attrs), {
|
|
52
|
+
modelValue: modelValue.value,
|
|
53
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => modelValue.value = $event),
|
|
54
|
+
placeholder: __props.placeholder
|
|
55
|
+
}), createSlots({ _: 2 }, [
|
|
56
|
+
__props.isShowCondition && !unref(slots).prepend ? {
|
|
57
|
+
name: "prepend",
|
|
58
|
+
fn: withCtx(() => [
|
|
59
|
+
createVNode(_component_el_select, {
|
|
60
|
+
class: "!w-[100px] flex-shrink-0",
|
|
61
|
+
modelValue: condition.value,
|
|
62
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => condition.value = $event)
|
|
63
|
+
}, {
|
|
64
|
+
default: withCtx(() => [
|
|
65
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index) => {
|
|
66
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
67
|
+
key: index,
|
|
68
|
+
label: item.label,
|
|
69
|
+
value: item.value
|
|
70
|
+
}, null, 8, ["label", "value"]);
|
|
71
|
+
}), 128))
|
|
72
|
+
]),
|
|
73
|
+
_: 1
|
|
74
|
+
}, 8, ["modelValue"])
|
|
75
|
+
]),
|
|
76
|
+
key: "0"
|
|
77
|
+
} : void 0,
|
|
78
|
+
unref(slots).prepend ? {
|
|
79
|
+
name: "prepend",
|
|
80
|
+
fn: withCtx(() => [
|
|
81
|
+
renderSlot(_ctx.$slots, "prepend", {}, void 0, true)
|
|
82
|
+
]),
|
|
83
|
+
key: "1"
|
|
84
|
+
} : void 0,
|
|
85
|
+
__props.isShowMultiple && !unref(slots).append ? {
|
|
86
|
+
name: "append",
|
|
87
|
+
fn: withCtx(() => [
|
|
88
|
+
createElementVNode("span", {
|
|
89
|
+
onClick: _cache[1] || (_cache[1] = ($event) => moreShow.value = true)
|
|
90
|
+
}, "•••")
|
|
91
|
+
]),
|
|
92
|
+
key: "2"
|
|
93
|
+
} : void 0,
|
|
94
|
+
unref(slots).append ? {
|
|
95
|
+
name: "append",
|
|
96
|
+
fn: withCtx(() => [
|
|
97
|
+
renderSlot(_ctx.$slots, "append", {}, void 0, true)
|
|
98
|
+
]),
|
|
99
|
+
key: "3"
|
|
100
|
+
} : void 0
|
|
101
|
+
]), 1040, ["modelValue", "placeholder"]),
|
|
102
|
+
__props.isShowMultiple ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
103
|
+
createVNode(_component_el_dialog, {
|
|
104
|
+
class: "order-dialog",
|
|
105
|
+
modelValue: moreShow.value,
|
|
106
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => moreShow.value = $event),
|
|
107
|
+
width: "480px",
|
|
108
|
+
title: titleName.value,
|
|
109
|
+
"align-center": "",
|
|
110
|
+
draggable: "",
|
|
111
|
+
"close-on-click-modal": false
|
|
112
|
+
}, {
|
|
113
|
+
footer: withCtx(() => [
|
|
114
|
+
createElementVNode("div", _hoisted_3, [
|
|
115
|
+
createVNode(_component_el_button, {
|
|
116
|
+
type: "info",
|
|
117
|
+
plain: "",
|
|
118
|
+
onClick: _cache[4] || (_cache[4] = ($event) => moreShow.value = false)
|
|
119
|
+
}, {
|
|
120
|
+
default: withCtx(() => [..._cache[7] || (_cache[7] = [
|
|
121
|
+
createTextVNode("取消", -1)
|
|
122
|
+
])]),
|
|
123
|
+
_: 1
|
|
124
|
+
}),
|
|
125
|
+
createVNode(_component_el_button, {
|
|
126
|
+
class: "!ml-[14px]",
|
|
127
|
+
type: "primary",
|
|
128
|
+
onClick: _cache[5] || (_cache[5] = ($event) => moreShow.value = false)
|
|
129
|
+
}, {
|
|
130
|
+
default: withCtx(() => [..._cache[8] || (_cache[8] = [
|
|
131
|
+
createTextVNode("确认", -1)
|
|
132
|
+
])]),
|
|
133
|
+
_: 1
|
|
134
|
+
})
|
|
135
|
+
])
|
|
136
|
+
]),
|
|
137
|
+
default: withCtx(() => [
|
|
138
|
+
createElementVNode("div", _hoisted_2, toDisplayString(modelName.value), 1),
|
|
139
|
+
createVNode(_component_el_input, {
|
|
140
|
+
modelValue: modelValue.value,
|
|
141
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => modelValue.value = $event),
|
|
142
|
+
type: "textarea",
|
|
143
|
+
autosize: { minRows: 3, maxRows: 5 },
|
|
144
|
+
placeholder: modelName.value
|
|
145
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
146
|
+
]),
|
|
147
|
+
_: 1
|
|
148
|
+
}, 8, ["modelValue", "title"])
|
|
149
|
+
])) : createCommentVNode("", true)
|
|
150
|
+
], 64);
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
const CustomInputV2 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ce2bdbe3"]]);
|
|
155
|
+
export {
|
|
156
|
+
CustomInputV2 as C
|
|
157
|
+
};
|
package/dist/CustomInputV2.css
CHANGED