jmash-region 0.1.1 → 0.1.3
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/{edit-BXvdnzoT.mjs → edit-NHfz0cw9.mjs} +1 -1
- package/dist/{edit.vue_vue_type_script_setup_true_lang-Gi7YHMmj.mjs → edit.vue_vue_type_script_setup_true_lang-Bg_pgF1A.mjs} +1 -1
- package/dist/index-C-SPDbON.mjs +89 -0
- package/dist/{index-BcPZUI78.mjs → index-CzthgOl_.mjs} +2 -2
- package/dist/index-DeCw46m6.mjs +1747 -0
- package/dist/index.mjs +1 -1
- package/dts/src/components/JmashRegionCascader2/index.vue.d.ts +9 -2
- package/dts/src/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/index-BkUaS5vM.mjs +0 -1679
- package/dist/index-OHtSnxRs.mjs +0 -153
package/dist/index-OHtSnxRs.mjs
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { defineComponent as V, mergeModels as I, useModel as T, ref as _, resolveComponent as h, openBlock as b, createBlock as x, mergeProps as N, createElementBlock as B, createVNode as r, withCtx as s, createTextVNode as g, toDisplayString as C } from "vue";
|
|
2
|
-
import { d as y, _ as S, a as E } from "./index-BkUaS5vM.mjs";
|
|
3
|
-
const U = /* @__PURE__ */ V({
|
|
4
|
-
__name: "index",
|
|
5
|
-
props: /* @__PURE__ */ I({
|
|
6
|
-
checkStrictly: {
|
|
7
|
-
type: Boolean,
|
|
8
|
-
default: !0
|
|
9
|
-
}
|
|
10
|
-
}, {
|
|
11
|
-
modelValue: {},
|
|
12
|
-
modelModifiers: {}
|
|
13
|
-
}),
|
|
14
|
-
emits: ["update:modelValue"],
|
|
15
|
-
setup(m) {
|
|
16
|
-
const o = T(m, "modelValue"), u = _();
|
|
17
|
-
u.value = w(o.value);
|
|
18
|
-
const t = (e) => {
|
|
19
|
-
o.value = e[e.length - 1];
|
|
20
|
-
}, p = {
|
|
21
|
-
lazy: !0,
|
|
22
|
-
// 开启懒加载
|
|
23
|
-
checkStrictly: m.checkStrictly,
|
|
24
|
-
// 选择任意一级选项
|
|
25
|
-
lazyLoad(e, l) {
|
|
26
|
-
var a;
|
|
27
|
-
y.findList({
|
|
28
|
-
parentId: (a = e.data) == null ? void 0 : a.regionId
|
|
29
|
-
}).then(({ data: c }) => {
|
|
30
|
-
l(v(c.results));
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}, d = () => {
|
|
34
|
-
u.value = [], f.value = [];
|
|
35
|
-
}, f = _([]), k = (e) => (y.findList({
|
|
36
|
-
likeRegionName: e
|
|
37
|
-
}).then(({ data: l }) => {
|
|
38
|
-
f.value = v(l.results);
|
|
39
|
-
}), !1), v = (e) => e.map((l) => ({
|
|
40
|
-
label: l.regionName,
|
|
41
|
-
value: l.regionCode,
|
|
42
|
-
regionId: l.regionId,
|
|
43
|
-
leaf: !l.hasChildren
|
|
44
|
-
}));
|
|
45
|
-
function w(e = "", l = [2, 4, 6, 9, 12]) {
|
|
46
|
-
if (typeof e != "string")
|
|
47
|
-
throw new TypeError("输入必须是字符串类型");
|
|
48
|
-
if (e.length === 0)
|
|
49
|
-
throw new Error("输入字符串不能为空");
|
|
50
|
-
if (!Array.isArray(l) || l.some((i) => !Number.isInteger(i) || i < 1))
|
|
51
|
-
throw new TypeError("拆分位置必须是正整数数组");
|
|
52
|
-
const a = [];
|
|
53
|
-
for (const i of l) {
|
|
54
|
-
if (i > e.length) break;
|
|
55
|
-
a.push(e.substring(0, i));
|
|
56
|
-
}
|
|
57
|
-
return a[a.length - 1] !== e && a.push(e), a;
|
|
58
|
-
}
|
|
59
|
-
return (e, l) => {
|
|
60
|
-
const a = h("el-cascader");
|
|
61
|
-
return b(), x(a, N({
|
|
62
|
-
modelValue: u.value,
|
|
63
|
-
"onUpdate:modelValue": l[0] || (l[0] = (c) => u.value = c),
|
|
64
|
-
props: p,
|
|
65
|
-
options: f.value,
|
|
66
|
-
filterable: "",
|
|
67
|
-
onClear: d,
|
|
68
|
-
"before-filter": k
|
|
69
|
-
}, e.$attrs, { onChange: t }), null, 16, ["modelValue", "options"]);
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
}), $ = { class: "app-container" }, M = /* @__PURE__ */ V({
|
|
73
|
-
__name: "index",
|
|
74
|
-
setup(m) {
|
|
75
|
-
const o = _({
|
|
76
|
-
regionCodeTree: "141024100",
|
|
77
|
-
regionCodeCascader: ["14", "1410", "141024", "141024100", "141024100231"],
|
|
78
|
-
regionCodeCascade2: "141024100"
|
|
79
|
-
});
|
|
80
|
-
return (u, t) => {
|
|
81
|
-
const n = h("el-form-item"), p = h("el-form");
|
|
82
|
-
return b(), B("div", $, [
|
|
83
|
-
r(p, {
|
|
84
|
-
ref: "queryFormRef",
|
|
85
|
-
model: o.value
|
|
86
|
-
}, {
|
|
87
|
-
default: s(() => [
|
|
88
|
-
r(n, { label: "树形控件地区编码" }, {
|
|
89
|
-
default: s(() => [
|
|
90
|
-
g(C(o.value.regionCodeTree), 1)
|
|
91
|
-
]),
|
|
92
|
-
_: 1
|
|
93
|
-
}),
|
|
94
|
-
r(n, { label: "树形控件" }, {
|
|
95
|
-
default: s(() => [
|
|
96
|
-
r(S, {
|
|
97
|
-
modelValue: o.value.regionCodeTree,
|
|
98
|
-
"onUpdate:modelValue": t[0] || (t[0] = (d) => o.value.regionCodeTree = d),
|
|
99
|
-
clearable: "",
|
|
100
|
-
"check-strictly": !0,
|
|
101
|
-
placeholder: "请选择地区"
|
|
102
|
-
}, null, 8, ["modelValue"])
|
|
103
|
-
]),
|
|
104
|
-
_: 1
|
|
105
|
-
}),
|
|
106
|
-
r(n, { label: "级联控件地区编码" }, {
|
|
107
|
-
default: s(() => [
|
|
108
|
-
g(C(o.value.regionCodeCascader), 1)
|
|
109
|
-
]),
|
|
110
|
-
_: 1
|
|
111
|
-
}),
|
|
112
|
-
r(n, { label: "级联控件" }, {
|
|
113
|
-
default: s(() => [
|
|
114
|
-
r(E, {
|
|
115
|
-
style: { width: "100%" },
|
|
116
|
-
modelValue: o.value.regionCodeCascader,
|
|
117
|
-
"onUpdate:modelValue": t[1] || (t[1] = (d) => o.value.regionCodeCascader = d),
|
|
118
|
-
clearable: "",
|
|
119
|
-
"check-strictly": !1,
|
|
120
|
-
placeholder: "请选择地区"
|
|
121
|
-
}, null, 8, ["modelValue"])
|
|
122
|
-
]),
|
|
123
|
-
_: 1
|
|
124
|
-
}),
|
|
125
|
-
r(n, { label: "级联控件地区编码" }, {
|
|
126
|
-
default: s(() => [
|
|
127
|
-
g(C(o.value.regionCodeCascade2), 1)
|
|
128
|
-
]),
|
|
129
|
-
_: 1
|
|
130
|
-
}),
|
|
131
|
-
r(n, { label: "级联控件" }, {
|
|
132
|
-
default: s(() => [
|
|
133
|
-
r(U, {
|
|
134
|
-
style: { width: "100%" },
|
|
135
|
-
modelValue: o.value.regionCodeCascade2,
|
|
136
|
-
"onUpdate:modelValue": t[2] || (t[2] = (d) => o.value.regionCodeCascade2 = d),
|
|
137
|
-
clearable: "",
|
|
138
|
-
"check-strictly": !0,
|
|
139
|
-
placeholder: "请选择地区"
|
|
140
|
-
}, null, 8, ["modelValue"])
|
|
141
|
-
]),
|
|
142
|
-
_: 1
|
|
143
|
-
})
|
|
144
|
-
]),
|
|
145
|
-
_: 1
|
|
146
|
-
}, 8, ["model"])
|
|
147
|
-
]);
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
export {
|
|
152
|
-
M as default
|
|
153
|
-
};
|