general-basic-form 2.0.63 → 2.1.0
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/README.md +45 -3
- package/dist/index.js +1576 -0
- package/dist/index.umd.cjs +1 -0
- package/dist/style.css +1 -0
- package/package.json +16 -4
- package/README.assets/image-20210820173738506.png +0 -0
- package/script/link.ts +0 -36
- package/script/unlink.ts +0 -45
- package/src/Descriptions.vue +0 -107
- package/src/GeneralBasicForm.vue +0 -240
- package/src/InfiniteScrollList.vue +0 -163
- package/src/assets/image-20210820173037871.png +0 -0
- package/src/assets/logo.png +0 -0
- package/src/components/CustomCom/img-mask/index.vue +0 -79
- package/src/components/CustomCom/input-graphic-verification/index.vue +0 -81
- package/src/components/CustomCom/input-mobile-verification/index.vue +0 -56
- package/src/components/CustomCom/input-mobile-verification/verification-button.vue +0 -82
- package/src/components/VABasic/input/index.vue +0 -75
- package/src/components/VBasic/cascader/index.vue +0 -32
- package/src/components/VBasic/checkbox/index.vue +0 -37
- package/src/components/VBasic/date-picker/index.vue +0 -31
- package/src/components/VBasic/divider/index.vue +0 -53
- package/src/components/VBasic/input/index.vue +0 -67
- package/src/components/VBasic/input-number/index.vue +0 -31
- package/src/components/VBasic/radio/index.vue +0 -37
- package/src/components/VBasic/select/index.vue +0 -37
- package/src/components/setting.ts +0 -28
- package/src/index.ts +0 -30
- package/src/injectKey.ts +0 -2
- package/src/types/basicFrom.ts +0 -63
- package/src/types/componentType.ts +0 -6
- package/src/types/componentsProps.ts +0 -18
- package/tsconfig.json +0 -14
- package/vite.config.js +0 -123
- /package/{public → dist}/index.d.ts +0 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1576 @@
|
|
|
1
|
+
import { defineComponent as x, inject as P, resolveComponent as g, openBlock as u, createBlock as m, mergeProps as D, withKeys as De, createSlots as ye, renderList as F, withCtx as S, resolveDynamicComponent as Q, createCommentVNode as I, ref as C, unref as _, onMounted as Fe, createElementBlock as B, computed as te, shallowRef as re, onBeforeUnmount as Le, createTextVNode as L, toDisplayString as j, h as ke, normalizeProps as Ae, guardReactiveProps as Ee, Fragment as J, provide as we, resolveDirective as de, withDirectives as ee, renderSlot as pe, createVNode as O, vShow as Re, watch as Be, normalizeStyle as Oe, createElementVNode as Z, markRaw as Se } from "vue";
|
|
2
|
+
const he = {
|
|
3
|
+
placeholder: "请输入",
|
|
4
|
+
style: "width: 200px",
|
|
5
|
+
clearable: !0
|
|
6
|
+
}, Qe = {
|
|
7
|
+
style: "width: 227px",
|
|
8
|
+
"start-placeholder": "开始日期",
|
|
9
|
+
"end-placeholder": "结束日期",
|
|
10
|
+
type: "daterange"
|
|
11
|
+
}, xe = {
|
|
12
|
+
placeholder: "请选择",
|
|
13
|
+
filterable: !0,
|
|
14
|
+
clearable: !0,
|
|
15
|
+
style: "width: 200px"
|
|
16
|
+
}, je = x({
|
|
17
|
+
components: {
|
|
18
|
+
InputArchive: (e) => {
|
|
19
|
+
const { templateEle: r } = e;
|
|
20
|
+
return r();
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
item: null
|
|
25
|
+
// null就是any
|
|
26
|
+
},
|
|
27
|
+
setup() {
|
|
28
|
+
const e = P("queryParams", {}), r = P("getList"), t = P("size", "default");
|
|
29
|
+
return { queryParams: e, getList: r, size: t };
|
|
30
|
+
},
|
|
31
|
+
data() {
|
|
32
|
+
return {
|
|
33
|
+
inputSetting: {
|
|
34
|
+
...he,
|
|
35
|
+
...this.item.inputSetting,
|
|
36
|
+
...this.item.setting
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
// created() {
|
|
41
|
+
// console.log("new", this.item);
|
|
42
|
+
// console.log("new", this.inputSetting);
|
|
43
|
+
// },
|
|
44
|
+
methods: {
|
|
45
|
+
currentInputComponent() {
|
|
46
|
+
return "input-archive";
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// watch: {
|
|
50
|
+
// item(val) {
|
|
51
|
+
// console.log("item", val);
|
|
52
|
+
// },
|
|
53
|
+
// size(val) {
|
|
54
|
+
// console.log(val);
|
|
55
|
+
// },
|
|
56
|
+
// },
|
|
57
|
+
}), M = (e, r) => {
|
|
58
|
+
const t = e.__vccOpts || e;
|
|
59
|
+
for (const [n, a] of r)
|
|
60
|
+
t[n] = a;
|
|
61
|
+
return t;
|
|
62
|
+
};
|
|
63
|
+
function Ge(e, r, t, n, a, l) {
|
|
64
|
+
const s = g("el-input");
|
|
65
|
+
return u(), m(s, D({
|
|
66
|
+
onKeydown: De(e.getList, ["enter"]),
|
|
67
|
+
modelValue: e.queryParams[e.item.prop],
|
|
68
|
+
"onUpdate:modelValue": r[0] || (r[0] = (i) => e.queryParams[e.item.prop] = i),
|
|
69
|
+
size: e.size
|
|
70
|
+
}, e.inputSetting), ye({ _: 2 }, [
|
|
71
|
+
F(e.item.template, (i, o) => ({
|
|
72
|
+
name: o,
|
|
73
|
+
fn: S(() => [
|
|
74
|
+
i ? (u(), m(Q(e.currentInputComponent()), {
|
|
75
|
+
key: o,
|
|
76
|
+
templateEle: i
|
|
77
|
+
}, null, 8, ["templateEle"])) : I("", !0)
|
|
78
|
+
])
|
|
79
|
+
}))
|
|
80
|
+
]), 1040, ["onKeydown", "modelValue", "size"]);
|
|
81
|
+
}
|
|
82
|
+
const ne = /* @__PURE__ */ M(je, [["render", Ge]]), Me = /* @__PURE__ */ x({
|
|
83
|
+
__name: "index",
|
|
84
|
+
props: {
|
|
85
|
+
item: {}
|
|
86
|
+
},
|
|
87
|
+
setup(e) {
|
|
88
|
+
const r = P("queryParams", {}), t = P("size"), n = C({
|
|
89
|
+
...he,
|
|
90
|
+
...e.item.inputSetting,
|
|
91
|
+
...e.item.setting
|
|
92
|
+
});
|
|
93
|
+
return (a, l) => {
|
|
94
|
+
const s = g("el-input-number");
|
|
95
|
+
return u(), m(s, D({
|
|
96
|
+
modelValue: _(r)[a.item.prop],
|
|
97
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => _(r)[a.item.prop] = i),
|
|
98
|
+
size: _(t)
|
|
99
|
+
}, n.value), null, 16, ["modelValue", "size"]);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}), Ue = x({
|
|
103
|
+
components: {
|
|
104
|
+
InputArchive: (e) => {
|
|
105
|
+
const { templateEle: r } = e;
|
|
106
|
+
return r();
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
props: {
|
|
110
|
+
item: null
|
|
111
|
+
// null就是any
|
|
112
|
+
},
|
|
113
|
+
setup() {
|
|
114
|
+
const e = P("queryParams", {}), r = P("getList", () => {
|
|
115
|
+
}), t = P("size", "default"), a = P("Form").useInjectFormItemContext();
|
|
116
|
+
return { queryParams: e, getList: r, size: t, formItemContext: a };
|
|
117
|
+
},
|
|
118
|
+
data() {
|
|
119
|
+
return {
|
|
120
|
+
inputSetting: {
|
|
121
|
+
...he,
|
|
122
|
+
...this.item.inputSetting,
|
|
123
|
+
...this.item.setting
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
// created() {
|
|
128
|
+
// console.log("new", this.item);
|
|
129
|
+
// console.log("new", this.inputSetting);
|
|
130
|
+
// },
|
|
131
|
+
methods: {
|
|
132
|
+
currentInputComponent() {
|
|
133
|
+
return "input-archive";
|
|
134
|
+
},
|
|
135
|
+
onInputChange(e) {
|
|
136
|
+
this.queryParams[this.item.prop] = e.target.value, this.formItemContext.onFieldChange();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// watch: {
|
|
140
|
+
// item(val) {
|
|
141
|
+
// console.log("item", val);
|
|
142
|
+
// },
|
|
143
|
+
// size(val) {
|
|
144
|
+
// console.log(val);
|
|
145
|
+
// },
|
|
146
|
+
// },
|
|
147
|
+
});
|
|
148
|
+
function Je(e, r, t, n, a, l) {
|
|
149
|
+
const s = g("a-input");
|
|
150
|
+
return u(), m(s, D({
|
|
151
|
+
onKeydown: De(e.getList, ["enter"]),
|
|
152
|
+
onChange: e.onInputChange,
|
|
153
|
+
value: e.queryParams[e.item.prop],
|
|
154
|
+
size: e.size
|
|
155
|
+
}, e.inputSetting), ye({ _: 2 }, [
|
|
156
|
+
F(e.item.template, (i, o) => ({
|
|
157
|
+
name: o,
|
|
158
|
+
fn: S(() => [
|
|
159
|
+
i ? (u(), m(Q(e.currentInputComponent()), {
|
|
160
|
+
key: o,
|
|
161
|
+
templateEle: i
|
|
162
|
+
}, null, 8, ["templateEle"])) : I("", !0)
|
|
163
|
+
])
|
|
164
|
+
}))
|
|
165
|
+
]), 1040, ["onKeydown", "onChange", "value", "size"]);
|
|
166
|
+
}
|
|
167
|
+
const Te = /* @__PURE__ */ M(Ue, [["render", Je]]), Ce = Symbol(), We = /* @__PURE__ */ x({
|
|
168
|
+
__name: "index",
|
|
169
|
+
props: {
|
|
170
|
+
imgSrc: {}
|
|
171
|
+
},
|
|
172
|
+
setup(e) {
|
|
173
|
+
const r = C();
|
|
174
|
+
return Fe(() => {
|
|
175
|
+
const t = new Image(), n = [], a = 8, l = 8;
|
|
176
|
+
let s = 0, i = 0;
|
|
177
|
+
const o = 300, c = r.value, p = c.getContext("2d");
|
|
178
|
+
t.onload = function() {
|
|
179
|
+
c.width = t.width, c.height = t.height, i = Math.floor(t.width / a), s = Math.floor(t.height / l), f(), y();
|
|
180
|
+
}, t.src = e.imgSrc;
|
|
181
|
+
const f = () => {
|
|
182
|
+
for (let h = 0; h < l; h++)
|
|
183
|
+
for (let v = 0; v < a; v++)
|
|
184
|
+
n.push({
|
|
185
|
+
x: i * v,
|
|
186
|
+
y: s * h,
|
|
187
|
+
offsetX: (Math.random() - 0.5) * o,
|
|
188
|
+
offsetY: (Math.random() - 0.5) * o
|
|
189
|
+
});
|
|
190
|
+
}, y = () => {
|
|
191
|
+
p.clearRect(0, 0, c.width, c.height);
|
|
192
|
+
let h = !0;
|
|
193
|
+
n.forEach((v, b) => {
|
|
194
|
+
p.drawImage(t, v.x, v.y, i, s, v.x + v.offsetX, v.y + v.offsetY, i, s), Math.abs(v.offsetX) > 0.5 && (h = !1, v.offsetX *= 0.95), Math.abs(v.offsetY) > 0.5 && (v.offsetY *= 0.95, h = !1);
|
|
195
|
+
}), h ? setTimeout(() => {
|
|
196
|
+
f(), y();
|
|
197
|
+
}, 300) : requestAnimationFrame(y);
|
|
198
|
+
};
|
|
199
|
+
}), (t, n) => (u(), B("canvas", {
|
|
200
|
+
ref_key: "loadingCanvas",
|
|
201
|
+
ref: r
|
|
202
|
+
}, null, 512));
|
|
203
|
+
}
|
|
204
|
+
}), Ze = { class: "input-graphic-verification" }, Ye = ["src", "alt"], He = /* @__PURE__ */ x({
|
|
205
|
+
__name: "index",
|
|
206
|
+
props: {
|
|
207
|
+
item: {},
|
|
208
|
+
componentType: { default: "Element Plus" },
|
|
209
|
+
loading: { type: Boolean, default: !1 }
|
|
210
|
+
},
|
|
211
|
+
setup(e) {
|
|
212
|
+
const {
|
|
213
|
+
graphicSrc: r = "",
|
|
214
|
+
graphicAlt: t = "",
|
|
215
|
+
getGraphic: n = () => {
|
|
216
|
+
},
|
|
217
|
+
key: a
|
|
218
|
+
} = e.item, { formLoading: l } = P(Ce, !1), s = te(() => (l == null ? void 0 : l.value) || e.loading), i = async () => {
|
|
219
|
+
n && !(s != null && s.value) && await n();
|
|
220
|
+
}, o = re(ne);
|
|
221
|
+
switch (e.componentType) {
|
|
222
|
+
case "Element Plus":
|
|
223
|
+
o.value = ne;
|
|
224
|
+
break;
|
|
225
|
+
case "Ant Design Vue":
|
|
226
|
+
o.value = Te;
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
return (c, p) => (u(), B("div", Ze, [
|
|
230
|
+
(u(), m(Q(o.value), {
|
|
231
|
+
item: c.item,
|
|
232
|
+
class: "input"
|
|
233
|
+
}, null, 8, ["item"])),
|
|
234
|
+
s.value ? (u(), m(We, {
|
|
235
|
+
key: 0,
|
|
236
|
+
class: "graphic",
|
|
237
|
+
imgSrc: _(r)
|
|
238
|
+
}, null, 8, ["imgSrc"])) : (u(), B("img", {
|
|
239
|
+
key: 1,
|
|
240
|
+
class: "graphic",
|
|
241
|
+
onClick: i,
|
|
242
|
+
src: _(r),
|
|
243
|
+
alt: _(t) || `${_(a)}`
|
|
244
|
+
}, null, 8, Ye))
|
|
245
|
+
]));
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
const ze = /* @__PURE__ */ M(He, [["__scopeId", "data-v-fb7aa300"]]), Y = "获取验证码", Xe = 60, et = /* @__PURE__ */ x({
|
|
249
|
+
__name: "verification-button",
|
|
250
|
+
props: {
|
|
251
|
+
getSmscode: { type: Function },
|
|
252
|
+
componentType: { default: "Element Plus" },
|
|
253
|
+
item: {}
|
|
254
|
+
},
|
|
255
|
+
setup(e, { expose: r }) {
|
|
256
|
+
const t = C(Y), n = C(null), a = te(() => t.value === Y), l = re("el-button");
|
|
257
|
+
switch (e.componentType) {
|
|
258
|
+
case "Element Plus":
|
|
259
|
+
l.value = "el-button";
|
|
260
|
+
break;
|
|
261
|
+
case "Ant Design Vue":
|
|
262
|
+
l.value = "a-button";
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
const s = () => {
|
|
266
|
+
n && (clearInterval(n.value), n.value = null, t.value = Y);
|
|
267
|
+
}, i = async () => {
|
|
268
|
+
if (t.value === Y)
|
|
269
|
+
if (t.value = Xe, n.value = setInterval(() => {
|
|
270
|
+
if (Number(t.value) <= 0 || !t.value) {
|
|
271
|
+
s();
|
|
272
|
+
return;
|
|
273
|
+
} else
|
|
274
|
+
t.value = Number(t.value) - 1;
|
|
275
|
+
}, 1e3), e.getSmscode)
|
|
276
|
+
await e.getSmscode() === !1 && s();
|
|
277
|
+
else
|
|
278
|
+
return;
|
|
279
|
+
};
|
|
280
|
+
Le(() => {
|
|
281
|
+
s();
|
|
282
|
+
});
|
|
283
|
+
const o = { ...e.item.buttonSetting };
|
|
284
|
+
return r({ buttonClick: i, reset: s }), (c, p) => (u(), m(Q(l.value), D({
|
|
285
|
+
class: "verifiaction-button",
|
|
286
|
+
style: {
|
|
287
|
+
color: a.value ? "var(--color-primary, #409EFF)" : "var(--text-color-placeholder, #A8ABB2)",
|
|
288
|
+
cursor: a.value ? "pointer" : "default"
|
|
289
|
+
},
|
|
290
|
+
onClick: i
|
|
291
|
+
}, o), {
|
|
292
|
+
default: S(() => [
|
|
293
|
+
L(j(a.value ? Y : t.value + "s"), 1)
|
|
294
|
+
]),
|
|
295
|
+
_: 1
|
|
296
|
+
}, 16, ["style"]));
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
const Pe = /* @__PURE__ */ M(et, [["__scopeId", "data-v-aa89c1b7"]]), $e = /* @__PURE__ */ x({
|
|
300
|
+
__name: "index",
|
|
301
|
+
props: {
|
|
302
|
+
item: {},
|
|
303
|
+
componentType: { default: "Element Plus" }
|
|
304
|
+
},
|
|
305
|
+
setup(e, { expose: r }) {
|
|
306
|
+
const t = e.item, n = re(ne), a = C();
|
|
307
|
+
switch (e.componentType) {
|
|
308
|
+
case "Element Plus":
|
|
309
|
+
n.value = ne, t.template = {
|
|
310
|
+
append: () => ke(Pe, {
|
|
311
|
+
getSmscode: t.getSmscode,
|
|
312
|
+
item: e.item,
|
|
313
|
+
ref: a
|
|
314
|
+
})
|
|
315
|
+
};
|
|
316
|
+
break;
|
|
317
|
+
case "Ant Design Vue":
|
|
318
|
+
n.value = Te, t.template = {
|
|
319
|
+
suffix: () => ke(Pe, {
|
|
320
|
+
getSmscode: t.getSmscode,
|
|
321
|
+
item: e.item,
|
|
322
|
+
ref: a
|
|
323
|
+
})
|
|
324
|
+
};
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
return r({ VerificationButtonRef: a }), (l, s) => (u(), m(Q(n.value), {
|
|
328
|
+
item: _(t),
|
|
329
|
+
class: "input"
|
|
330
|
+
}, null, 8, ["item"]));
|
|
331
|
+
}
|
|
332
|
+
}), tt = x({
|
|
333
|
+
components: {
|
|
334
|
+
slotArchive: (e) => {
|
|
335
|
+
const { templateEle: r } = e;
|
|
336
|
+
return r();
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
props: {
|
|
340
|
+
item: null
|
|
341
|
+
// null就是any
|
|
342
|
+
},
|
|
343
|
+
setup() {
|
|
344
|
+
},
|
|
345
|
+
data() {
|
|
346
|
+
return {
|
|
347
|
+
dividerSetting: {
|
|
348
|
+
...this.item.dividerSetting,
|
|
349
|
+
...this.item.setting
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
},
|
|
353
|
+
methods: {
|
|
354
|
+
currentInputComponent() {
|
|
355
|
+
return "slot-archive";
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
function rt(e, r, t, n, a, l) {
|
|
360
|
+
const s = g("el-divider");
|
|
361
|
+
return u(), m(s, Ae(Ee(e.dividerSetting)), ye({ _: 2 }, [
|
|
362
|
+
F(e.item.template, (i, o) => ({
|
|
363
|
+
name: o,
|
|
364
|
+
fn: S(() => [
|
|
365
|
+
i ? (u(), m(Q(e.currentInputComponent()), {
|
|
366
|
+
key: o,
|
|
367
|
+
templateEle: i
|
|
368
|
+
}, null, 8, ["templateEle"])) : I("", !0)
|
|
369
|
+
])
|
|
370
|
+
}))
|
|
371
|
+
]), 1040);
|
|
372
|
+
}
|
|
373
|
+
const nt = /* @__PURE__ */ M(tt, [["render", rt]]), at = /* @__PURE__ */ x({
|
|
374
|
+
__name: "index",
|
|
375
|
+
props: {
|
|
376
|
+
item: {}
|
|
377
|
+
},
|
|
378
|
+
setup(e) {
|
|
379
|
+
const r = P("queryParams", {}), t = P("size"), n = C({
|
|
380
|
+
...e.item.radioGroupSetting,
|
|
381
|
+
...e.item.setting
|
|
382
|
+
});
|
|
383
|
+
return (a, l) => {
|
|
384
|
+
const s = g("el-radio"), i = g("el-radio-group");
|
|
385
|
+
return u(), m(i, D({
|
|
386
|
+
modelValue: _(r)[a.item.prop],
|
|
387
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => _(r)[a.item.prop] = o),
|
|
388
|
+
size: _(t)
|
|
389
|
+
}, n.value), {
|
|
390
|
+
default: S(() => [
|
|
391
|
+
(u(!0), B(J, null, F(a.item.option || [], (o) => (u(), m(s, D({
|
|
392
|
+
size: _(t),
|
|
393
|
+
key: o.value,
|
|
394
|
+
ref_for: !0
|
|
395
|
+
}, o), {
|
|
396
|
+
default: S(() => [
|
|
397
|
+
L(j(o.label), 1)
|
|
398
|
+
]),
|
|
399
|
+
_: 2
|
|
400
|
+
}, 1040, ["size"]))), 128))
|
|
401
|
+
]),
|
|
402
|
+
_: 1
|
|
403
|
+
}, 16, ["modelValue", "size"]);
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
}), ot = /* @__PURE__ */ x({
|
|
407
|
+
__name: "index",
|
|
408
|
+
props: {
|
|
409
|
+
item: {}
|
|
410
|
+
},
|
|
411
|
+
setup(e) {
|
|
412
|
+
const r = P("queryParams", {}), t = P("size"), n = C({
|
|
413
|
+
...e.item.checkboxGroupSetting,
|
|
414
|
+
...e.item.setting
|
|
415
|
+
});
|
|
416
|
+
return (a, l) => {
|
|
417
|
+
const s = g("el-checkbox"), i = g("el-checkbox-group");
|
|
418
|
+
return u(), m(i, D({
|
|
419
|
+
modelValue: _(r)[a.item.prop],
|
|
420
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => _(r)[a.item.prop] = o),
|
|
421
|
+
size: _(t)
|
|
422
|
+
}, n.value), {
|
|
423
|
+
default: S(() => [
|
|
424
|
+
(u(!0), B(J, null, F(a.item.option || [], (o) => (u(), m(s, D({
|
|
425
|
+
size: _(t),
|
|
426
|
+
key: o.value,
|
|
427
|
+
ref_for: !0
|
|
428
|
+
}, o), {
|
|
429
|
+
default: S(() => [
|
|
430
|
+
L(j(o.label), 1)
|
|
431
|
+
]),
|
|
432
|
+
_: 2
|
|
433
|
+
}, 1040, ["size"]))), 128))
|
|
434
|
+
]),
|
|
435
|
+
_: 1
|
|
436
|
+
}, 16, ["modelValue", "size"]);
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
}), st = /* @__PURE__ */ x({
|
|
440
|
+
__name: "index",
|
|
441
|
+
props: {
|
|
442
|
+
item: {}
|
|
443
|
+
},
|
|
444
|
+
setup(e) {
|
|
445
|
+
const r = P("queryParams", {}), t = P("size"), n = C({
|
|
446
|
+
...Qe,
|
|
447
|
+
...e.item.datePackerSetting,
|
|
448
|
+
...e.item.setting
|
|
449
|
+
});
|
|
450
|
+
return (a, l) => {
|
|
451
|
+
const s = g("el-date-picker");
|
|
452
|
+
return u(), m(s, D({
|
|
453
|
+
modelValue: _(r)[a.item.prop],
|
|
454
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => _(r)[a.item.prop] = i),
|
|
455
|
+
size: _(t)
|
|
456
|
+
}, n.value), null, 16, ["modelValue", "size"]);
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
}), it = /* @__PURE__ */ x({
|
|
460
|
+
__name: "index",
|
|
461
|
+
props: {
|
|
462
|
+
item: {}
|
|
463
|
+
},
|
|
464
|
+
setup(e) {
|
|
465
|
+
const r = P("queryParams", {}), t = P("size"), n = C({
|
|
466
|
+
...xe,
|
|
467
|
+
...e.item.selectSetting,
|
|
468
|
+
...e.item.setting
|
|
469
|
+
});
|
|
470
|
+
return (a, l) => {
|
|
471
|
+
const s = g("el-option"), i = g("el-select");
|
|
472
|
+
return u(), m(i, D({
|
|
473
|
+
modelValue: _(r)[a.item.prop],
|
|
474
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => _(r)[a.item.prop] = o),
|
|
475
|
+
size: _(t)
|
|
476
|
+
}, n.value), {
|
|
477
|
+
default: S(() => [
|
|
478
|
+
(u(!0), B(J, null, F(a.item.option || [], (o) => (u(), m(s, D({
|
|
479
|
+
key: o.value,
|
|
480
|
+
ref_for: !0
|
|
481
|
+
}, o), null, 16))), 128))
|
|
482
|
+
]),
|
|
483
|
+
_: 1
|
|
484
|
+
}, 16, ["modelValue", "size"]);
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
}), lt = /* @__PURE__ */ x({
|
|
488
|
+
__name: "index",
|
|
489
|
+
props: {
|
|
490
|
+
item: {}
|
|
491
|
+
},
|
|
492
|
+
setup(e) {
|
|
493
|
+
const r = P("queryParams", {}), t = P("size"), n = C({
|
|
494
|
+
...xe,
|
|
495
|
+
...e.item.selectSetting,
|
|
496
|
+
...e.item.setting
|
|
497
|
+
});
|
|
498
|
+
return (a, l) => {
|
|
499
|
+
const s = g("el-cascader");
|
|
500
|
+
return u(), m(s, D({
|
|
501
|
+
modelValue: _(r)[a.item.prop],
|
|
502
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => _(r)[a.item.prop] = i),
|
|
503
|
+
size: _(t),
|
|
504
|
+
options: a.item.options || []
|
|
505
|
+
}, n.value), null, 16, ["modelValue", "size", "options"]);
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
}), ut = (e = {}) => {
|
|
509
|
+
for (const r in e)
|
|
510
|
+
if (Object.prototype.hasOwnProperty.call(e, r)) {
|
|
511
|
+
const t = e[r];
|
|
512
|
+
Object.prototype.toString.call(t) === "[object Object]" && (e[r] = JSON.stringify(t));
|
|
513
|
+
}
|
|
514
|
+
return e;
|
|
515
|
+
}, ct = (e = {}) => {
|
|
516
|
+
for (const r in e)
|
|
517
|
+
if (Object.prototype.hasOwnProperty.call(e, r)) {
|
|
518
|
+
const t = e[r];
|
|
519
|
+
try {
|
|
520
|
+
/[{]+/g.test(t) && /[}]+/g.test(t) && (e[r] = JSON.parse(t));
|
|
521
|
+
} catch {
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
return e;
|
|
525
|
+
}, _e = { paramsToQuery: ut, queryToData: ct }, R = W;
|
|
526
|
+
(function(e, r) {
|
|
527
|
+
const t = W, n = e();
|
|
528
|
+
for (; ; )
|
|
529
|
+
try {
|
|
530
|
+
if (parseInt(t(561)) / 1 + -parseInt(t(558)) / 2 + parseInt(t(521)) / 3 * (parseInt(t(527)) / 4) + -parseInt(t(506)) / 5 * (parseInt(t(510)) / 6) + -parseInt(t(550)) / 7 * (parseInt(t(503)) / 8) + parseInt(t(540)) / 9 + -parseInt(t(546)) / 10 * (-parseInt(t(562)) / 11) === r)
|
|
531
|
+
break;
|
|
532
|
+
n.push(n.shift());
|
|
533
|
+
} catch {
|
|
534
|
+
n.push(n.shift());
|
|
535
|
+
}
|
|
536
|
+
})(ie, 819524);
|
|
537
|
+
const z = {};
|
|
538
|
+
let U = null;
|
|
539
|
+
const Ie = async (e, r) => {
|
|
540
|
+
const t = W;
|
|
541
|
+
!window[t(543)] && window[t(498)]("您的浏览器不支持IndexedDB的稳定版本。离线数据功能将不可用。Your browser doesn't support a stable version of IndexedDB. offline data feature will not be available.");
|
|
542
|
+
const { DBName: n = "", DBVersion: a = 1 } = e;
|
|
543
|
+
let l, s = !1;
|
|
544
|
+
try {
|
|
545
|
+
const i = window[t(543)][t(519)](n, a);
|
|
546
|
+
await new Promise((o, c) => {
|
|
547
|
+
const p = t;
|
|
548
|
+
i[p(551)] = async function(f) {
|
|
549
|
+
const y = p, h = f.target.result, { stores: v = [] } = e;
|
|
550
|
+
await Promise.all(v[y(509)](async (b) => {
|
|
551
|
+
const k = y, { DBStoreName: w = "", properties: q = {} } = b;
|
|
552
|
+
try {
|
|
553
|
+
const V = {};
|
|
554
|
+
V[k(536)] = e[k(557)];
|
|
555
|
+
const d = f[k(541)][k(520)][k(554)](w, V);
|
|
556
|
+
if (Object[k(548)](q)[k(500)] === 0) {
|
|
557
|
+
console[k(559)](w + "没有设置默认值");
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
for (const T in q)
|
|
561
|
+
if (q[k(556)][k(515)](q, T)) {
|
|
562
|
+
const K = q[T], A = { ...K.createIndex };
|
|
563
|
+
d[k(504)](T, T, A);
|
|
564
|
+
}
|
|
565
|
+
} catch (V) {
|
|
566
|
+
console[k(559)](V);
|
|
567
|
+
}
|
|
568
|
+
})), l = h, s = !0;
|
|
569
|
+
}, i[p(535)] = async function(f) {
|
|
570
|
+
const y = p;
|
|
571
|
+
if (l = this[y(520)], s) {
|
|
572
|
+
const { stores: h = [] } = e;
|
|
573
|
+
await Promise[y(528)](h[y(509)](async (v) => {
|
|
574
|
+
const b = y, { DBStoreName: k = "" } = v, w = l[b(552)]([k], b(547)), q = w[b(496)](k), V = {};
|
|
575
|
+
V[e[b(557)]] = r, q[b(502)](V);
|
|
576
|
+
try {
|
|
577
|
+
await new Promise((d, T) => {
|
|
578
|
+
const K = b;
|
|
579
|
+
w[K(525)] = function(A) {
|
|
580
|
+
const E = K;
|
|
581
|
+
console[E(513)](E(512), A), T();
|
|
582
|
+
}, w[K(544)] = function(A) {
|
|
583
|
+
d();
|
|
584
|
+
}, w[K(529)] = function(A) {
|
|
585
|
+
const E = K;
|
|
586
|
+
console[E(513)](E(534), A), T();
|
|
587
|
+
};
|
|
588
|
+
});
|
|
589
|
+
} catch (d) {
|
|
590
|
+
console.warn(b(511), d);
|
|
591
|
+
}
|
|
592
|
+
}));
|
|
593
|
+
}
|
|
594
|
+
o();
|
|
595
|
+
}, i.onerror = function(f) {
|
|
596
|
+
c(f);
|
|
597
|
+
};
|
|
598
|
+
});
|
|
599
|
+
} catch (i) {
|
|
600
|
+
console[t(513)](i, t(526));
|
|
601
|
+
}
|
|
602
|
+
return l;
|
|
603
|
+
};
|
|
604
|
+
function ie() {
|
|
605
|
+
const e = ["transaction", "DBName", "createObjectStore", "close", "hasOwnProperty", "primaryKey", "208156ZfrAJr", "warn", "delete", "1575928bFmnZg", "154LBDnQZ", "objectStore", "数据更新失败", "alert", "store不存在,请更新schema和DBVersion并重启前端服务", "length", "openCursor", "add", "15752fkogxb", "createIndex", "deleteDB", "299045NkkBTh", "请传入主键", "mapDB", "map", "102uEoUGM", "目前所有数据都在用户ID的主键下面,所以没有主键的话做重新载入页面处理", "主键插入中止", "error", "数据库删除失败", "call", "continue", "update", "deleteStore", "open", "result", "66891DVCnfv", "get", "getDataByKey", "数据删除失败", "onabort", "打开数据库报错,可能是数据库版本不对,或者储存容量不足等原因", "52JGzdMb", "all", "onerror", "put", "数据更新失败没有request", "Database connection closed, reconnecting...", "target", "主键插入失败", "onsuccess", "keyPath", "数据更新成功", "主键查询结果:", "传入结构化克隆算法不支持的数据类型可能导致报错", "4779333CtWPbr", "currentTarget", "获取Database缺乏用户信息,请先传入对primaryKey的赋值", "indexedDB", "oncomplete", "事务失败", "634540WpNScH", "readwrite", "keys", "getDB", "4781SEkDBZ", "onupgradeneeded"];
|
|
606
|
+
return ie = function() {
|
|
607
|
+
return e;
|
|
608
|
+
}, ie();
|
|
609
|
+
}
|
|
610
|
+
function W(e, r) {
|
|
611
|
+
const t = ie();
|
|
612
|
+
return W = function(n, a) {
|
|
613
|
+
return n = n - 496, t[n];
|
|
614
|
+
}, W(e, r);
|
|
615
|
+
}
|
|
616
|
+
let ae = !1;
|
|
617
|
+
z[R(549)] = async (e, r) => {
|
|
618
|
+
const t = R, { mapDB: n, primaryKey: a } = e;
|
|
619
|
+
return n ? a ? (ae && await new Promise(async (l, s) => {
|
|
620
|
+
const i = () => {
|
|
621
|
+
ae ? setTimeout(() => {
|
|
622
|
+
i();
|
|
623
|
+
}, 200) : l();
|
|
624
|
+
};
|
|
625
|
+
i();
|
|
626
|
+
}), !U && (ae = !0, U = await Ie(n, a), U == null || U.addEventListener(t(555), async () => {
|
|
627
|
+
console.info(t(532)), U = await Ie(n, a);
|
|
628
|
+
}), ae = !1), r && r(U), U) : (console[t(559)](t(542)), !1) : (console[t(559)]("必须传入数据库配置信息"), !1);
|
|
629
|
+
}, z[R(523)] = async (e, r) => {
|
|
630
|
+
const t = R, { mapDB: n, tableName: a, primaryKey: l } = e, s = {};
|
|
631
|
+
s[t(508)] = n, s[t(557)] = l;
|
|
632
|
+
const i = await z.getDB(s);
|
|
633
|
+
if (!i)
|
|
634
|
+
return;
|
|
635
|
+
const o = i.transaction([a]), c = o[t(496)](a), p = c[t(522)](l);
|
|
636
|
+
return new Promise((f, y) => {
|
|
637
|
+
const h = t;
|
|
638
|
+
p.onsuccess = function(v) {
|
|
639
|
+
const b = W;
|
|
640
|
+
r && r(a + b(538) + p[b(520)]), f(p[b(520)]);
|
|
641
|
+
}, p[h(529)] = function(v) {
|
|
642
|
+
console.error(a + h(545) + v), y();
|
|
643
|
+
};
|
|
644
|
+
});
|
|
645
|
+
}, z.updateStore = async (e, r) => {
|
|
646
|
+
var t;
|
|
647
|
+
const n = R, { mapDB: a, tableName: l, updateData: s } = e;
|
|
648
|
+
!s[a == null ? void 0 : a[n(557)]] && console[n(559)](n(507) + a[n(557)]);
|
|
649
|
+
const i = {};
|
|
650
|
+
i.mapDB = a, i[n(557)] = s[a == null ? void 0 : a[n(557)]];
|
|
651
|
+
const o = await z[n(549)](i);
|
|
652
|
+
if (!o)
|
|
653
|
+
return;
|
|
654
|
+
let c = null;
|
|
655
|
+
try {
|
|
656
|
+
c = o[n(552)]([l], n(547)).objectStore(l);
|
|
657
|
+
} catch (h) {
|
|
658
|
+
console[n(513)](n(499), h);
|
|
659
|
+
}
|
|
660
|
+
let p = null, f = null;
|
|
661
|
+
const y = await new Promise((h, v) => {
|
|
662
|
+
const b = n, k = c[b(501)](s[a == null ? void 0 : a[b(557)]]);
|
|
663
|
+
k[b(535)] = (w) => {
|
|
664
|
+
h(w);
|
|
665
|
+
}, k.onerror = (w) => {
|
|
666
|
+
v(w);
|
|
667
|
+
};
|
|
668
|
+
});
|
|
669
|
+
f = (t = y == null ? void 0 : y[n(533)]) == null ? void 0 : t[n(520)];
|
|
670
|
+
try {
|
|
671
|
+
f && (f == null ? void 0 : f.primaryKey) === s[a == null ? void 0 : a.primaryKey] ? p = f[n(517)](s) : p = c[n(530)](s);
|
|
672
|
+
} catch (h) {
|
|
673
|
+
console[n(513)](n(539), h, s);
|
|
674
|
+
}
|
|
675
|
+
new Promise((h, v) => {
|
|
676
|
+
const b = n;
|
|
677
|
+
!p && (console[b(513)](l + b(531)), v()), p[b(535)] = function(k) {
|
|
678
|
+
r && r(l + b(537)), h();
|
|
679
|
+
}, p[b(529)] = function(k) {
|
|
680
|
+
const w = b;
|
|
681
|
+
console[w(513)](l + w(497), k), v();
|
|
682
|
+
};
|
|
683
|
+
}), f && f[n(516)]();
|
|
684
|
+
}, z[R(518)] = async (e, r) => {
|
|
685
|
+
const t = R, { mapDB: n, tableName: a, primaryKey: l } = e, s = {};
|
|
686
|
+
s[t(508)] = n, s[t(557)] = l;
|
|
687
|
+
const i = await z.getDB(s);
|
|
688
|
+
if (!i)
|
|
689
|
+
return;
|
|
690
|
+
const o = i[t(552)]([a], t(547))[t(496)](a)[t(560)](l);
|
|
691
|
+
return new Promise((c, p) => {
|
|
692
|
+
const f = t;
|
|
693
|
+
o[f(535)] = function(y) {
|
|
694
|
+
r && r(a + "数据删除成功"), c();
|
|
695
|
+
}, o.onerror = function(y) {
|
|
696
|
+
const h = f;
|
|
697
|
+
console[h(513)](a + h(524) + y), p();
|
|
698
|
+
};
|
|
699
|
+
});
|
|
700
|
+
}, z[R(505)] = async (e, r) => {
|
|
701
|
+
const { mapDB: t } = e, n = window.indexedDB.deleteDatabase(t.DBName);
|
|
702
|
+
return new Promise((a, l) => {
|
|
703
|
+
const s = W;
|
|
704
|
+
n[s(535)] = (i) => {
|
|
705
|
+
r && r(t[s(553)] + "数据库已删除"), a();
|
|
706
|
+
}, n[s(529)] = (i) => {
|
|
707
|
+
const o = s;
|
|
708
|
+
console[o(513)](t[o(553)] + o(514) + i), l();
|
|
709
|
+
};
|
|
710
|
+
});
|
|
711
|
+
};
|
|
712
|
+
function G(e, r) {
|
|
713
|
+
const t = le();
|
|
714
|
+
return G = function(n, a) {
|
|
715
|
+
return n = n - 125, t[n];
|
|
716
|
+
}, G(e, r);
|
|
717
|
+
}
|
|
718
|
+
function le() {
|
|
719
|
+
const e = ["updateData", "error", "getDataByKey", "531aQoQZo", "primaryKey", "handleData", "2kSsgxs", "777jFjQPc", "1271805RJVSFy", "546pnZEJw", "3522904vvFeGW", "4wGSwDA", "tableName", "780ChApSf", "deleteStore", "655364nEjUrb", "3705144rIEFqv", "updateStore", "getData", "clearData", "mapDB", "3003845nIJAzp"];
|
|
720
|
+
return le = function() {
|
|
721
|
+
return e;
|
|
722
|
+
}, le();
|
|
723
|
+
}
|
|
724
|
+
const oe = G;
|
|
725
|
+
(function(e, r) {
|
|
726
|
+
const t = G, n = e();
|
|
727
|
+
for (; ; )
|
|
728
|
+
try {
|
|
729
|
+
if (-parseInt(t(140)) / 1 * (-parseInt(t(127)) / 2) + parseInt(t(142)) / 3 * (parseInt(t(145)) / 4) + -parseInt(t(133)) / 5 + -parseInt(t(143)) / 6 * (parseInt(t(141)) / 7) + -parseInt(t(128)) / 8 + parseInt(t(137)) / 9 * (parseInt(t(125)) / 10) + parseInt(t(144)) / 11 === r)
|
|
730
|
+
break;
|
|
731
|
+
n.push(n.shift());
|
|
732
|
+
} catch {
|
|
733
|
+
n.push(n.shift());
|
|
734
|
+
}
|
|
735
|
+
})(le, 330152);
|
|
736
|
+
async function pt(e, r) {
|
|
737
|
+
const t = G, { tableName: n, propertiesKey: a, parameter: l, primaryKey: s, mapDB: i } = e;
|
|
738
|
+
let o = null, c = { [i[t(138)]]: s };
|
|
739
|
+
const p = {};
|
|
740
|
+
p[t(132)] = i, p.tableName = n, p[t(138)] = s;
|
|
741
|
+
const f = await z[t(136)](p);
|
|
742
|
+
f && (c = { ...f, [i.primaryKey]: s }), c[a] = l;
|
|
743
|
+
const y = {};
|
|
744
|
+
return y[t(132)] = i, y.tableName = n, y[t(134)] = c, await z[t(129)](y), l && (o = l), r && r(o), o;
|
|
745
|
+
}
|
|
746
|
+
async function dt(e, r) {
|
|
747
|
+
const t = G, { tableName: n, propertiesKey: a, primaryKey: l, mapDB: s } = e;
|
|
748
|
+
let i = null;
|
|
749
|
+
const o = {};
|
|
750
|
+
o[t(132)] = s, o[t(146)] = n, o.primaryKey = l;
|
|
751
|
+
const c = await z[t(136)](o);
|
|
752
|
+
return c && (i = c[a]), r && r(i), i;
|
|
753
|
+
}
|
|
754
|
+
async function mt(e, r) {
|
|
755
|
+
const t = G, { tableName: n, propertiesKey: a, parameter: l, primaryKey: s, mapDB: i } = e;
|
|
756
|
+
let o = {};
|
|
757
|
+
const c = {};
|
|
758
|
+
c.mapDB = i, c[t(146)] = n, c[t(138)] = s;
|
|
759
|
+
const p = await z[t(136)](c);
|
|
760
|
+
try {
|
|
761
|
+
if (p) {
|
|
762
|
+
o = { ...p[a], ...l };
|
|
763
|
+
const f = { [i[t(138)]]: s }, y = f;
|
|
764
|
+
y[a] = o;
|
|
765
|
+
const h = {};
|
|
766
|
+
h[t(132)] = i, h[t(146)] = n, h[t(134)] = y, await z.updateStore(h);
|
|
767
|
+
} else
|
|
768
|
+
console.warn(n + "为空,请先调用handleData");
|
|
769
|
+
} catch (f) {
|
|
770
|
+
console[t(135)](f);
|
|
771
|
+
}
|
|
772
|
+
return r && r(o), o;
|
|
773
|
+
}
|
|
774
|
+
async function ft(e, r) {
|
|
775
|
+
const t = G, { tableName: n, primaryKey: a, mapDB: l } = e;
|
|
776
|
+
let s = null;
|
|
777
|
+
try {
|
|
778
|
+
const i = {};
|
|
779
|
+
i.mapDB = l, i[t(146)] = n, i[t(138)] = a, await z[t(126)](i);
|
|
780
|
+
} catch (i) {
|
|
781
|
+
console.error(i);
|
|
782
|
+
}
|
|
783
|
+
return r && r(s), s;
|
|
784
|
+
}
|
|
785
|
+
const H = {};
|
|
786
|
+
H[oe(139)] = pt, H[oe(130)] = dt, H[oe(134)] = mt, H[oe(131)] = ft;
|
|
787
|
+
var $ = ce;
|
|
788
|
+
(function(e, r) {
|
|
789
|
+
for (var t = ce, n = e(); ; )
|
|
790
|
+
try {
|
|
791
|
+
var a = -parseInt(t(385)) / 1 + parseInt(t(387)) / 2 + -parseInt(t(389)) / 3 + -parseInt(t(398)) / 4 * (parseInt(t(394)) / 5) + -parseInt(t(402)) / 6 + -parseInt(t(399)) / 7 + -parseInt(t(386)) / 8 * (-parseInt(t(400)) / 9);
|
|
792
|
+
if (a === r)
|
|
793
|
+
break;
|
|
794
|
+
n.push(n.shift());
|
|
795
|
+
} catch {
|
|
796
|
+
n.push(n.shift());
|
|
797
|
+
}
|
|
798
|
+
})(ue, 363872);
|
|
799
|
+
var qe = {};
|
|
800
|
+
qe[$(397)] = !1;
|
|
801
|
+
var me = {};
|
|
802
|
+
me[$(384)] = qe, me[$(392)] = {};
|
|
803
|
+
var Ve = {};
|
|
804
|
+
function ue() {
|
|
805
|
+
var e = ["default", "mapDB-indexeddb-form-schema", "663915ecCGKl", "primaryKey", "stores", "unique", "12QKZOdu", "2103521TxMjSC", "1212714qgZAmF", "formParams", "3534618LLAImJ", "DBName", "properties", "createIndex", "464644FTRsMp", "128qSoFyx", "33606razpoB", "DBVersion", "168804drPGaG", "queryParams", "DBStoreName"];
|
|
806
|
+
return ue = function() {
|
|
807
|
+
return e;
|
|
808
|
+
}, ue();
|
|
809
|
+
}
|
|
810
|
+
Ve[$(390)] = me;
|
|
811
|
+
function ce(e, r) {
|
|
812
|
+
var t = ue();
|
|
813
|
+
return ce = function(n, a) {
|
|
814
|
+
n = n - 382;
|
|
815
|
+
var l = t[n];
|
|
816
|
+
return l;
|
|
817
|
+
}, ce(e, r);
|
|
818
|
+
}
|
|
819
|
+
var fe = {};
|
|
820
|
+
fe[$(391)] = $(401), fe[$(383)] = Ve;
|
|
821
|
+
var X = {};
|
|
822
|
+
X[$(395)] = "userId", X[$(382)] = $(393), X[$(388)] = 1, X[$(396)] = [fe];
|
|
823
|
+
const yt = {
|
|
824
|
+
formSchema: X
|
|
825
|
+
}, ht = H, { handleData: _t, getData: Ke } = ht, { formSchema: ge } = yt, ve = async (e, r) => {
|
|
826
|
+
var t;
|
|
827
|
+
return r.parametersType === "url" && (e = {
|
|
828
|
+
..._e.queryToData((t = r.$route) == null ? void 0 : t.query),
|
|
829
|
+
...e
|
|
830
|
+
}), r.parametersType === "indexDB" && (e = {
|
|
831
|
+
...await Ke({
|
|
832
|
+
tableName: "formParams",
|
|
833
|
+
propertiesKey: r.$route.path || "defQueryParams",
|
|
834
|
+
primaryKey: r.DBPrimaryKey || "default",
|
|
835
|
+
mapDB: ge
|
|
836
|
+
}),
|
|
837
|
+
...e
|
|
838
|
+
}), e;
|
|
839
|
+
}, be = async (e, r) => {
|
|
840
|
+
r.parametersType === "url" && await r.$router.push({
|
|
841
|
+
query: _e.paramsToQuery({ ...e })
|
|
842
|
+
}), r.parametersType === "indexDB" && await _t({
|
|
843
|
+
tableName: "formParams",
|
|
844
|
+
propertiesKey: r.$route.path || "defQueryParams",
|
|
845
|
+
parameter: { ...e },
|
|
846
|
+
primaryKey: r.DBPrimaryKey || "default",
|
|
847
|
+
mapDB: ge
|
|
848
|
+
});
|
|
849
|
+
}, gt = async ({ queryParameter: e = {}, vm: r = {} }) => {
|
|
850
|
+
e.defaultPageFirst ?? (e.defaultPageFirst = !0);
|
|
851
|
+
const t = { [r.currentPageKey]: r.defCurrentPage };
|
|
852
|
+
let n = {
|
|
853
|
+
...t,
|
|
854
|
+
...r.queryParams
|
|
855
|
+
};
|
|
856
|
+
n = await ve(n, r), e.defaultPageFirst && (n = {
|
|
857
|
+
...n,
|
|
858
|
+
...t
|
|
859
|
+
}), await be(n, r), r.getList({
|
|
860
|
+
...n
|
|
861
|
+
});
|
|
862
|
+
}, vt = async ({ vm: e = {} }) => {
|
|
863
|
+
e.$refs.queryFormRef.resetFields();
|
|
864
|
+
const r = await ve({}, e), t = {
|
|
865
|
+
[e.currentPageKey]: e.defCurrentPage,
|
|
866
|
+
[e.pageSizeKey]: (r == null ? void 0 : r[e.pageSizeKey]) || e.defPageSize
|
|
867
|
+
};
|
|
868
|
+
await be(t, e), e.queryParams = { ...t }, e.afterReset(), e.handleQuery();
|
|
869
|
+
}, bt = ({ vm: e = {} }) => {
|
|
870
|
+
var r;
|
|
871
|
+
let t = {
|
|
872
|
+
[e.pageSizeKey]: e.defPageSize
|
|
873
|
+
};
|
|
874
|
+
return e.parametersType === "url" && (t = {
|
|
875
|
+
...t,
|
|
876
|
+
..._e.queryToData((r = e.$route) == null ? void 0 : r.query)
|
|
877
|
+
}), e.parametersType === "indexDB" && Ke(
|
|
878
|
+
{
|
|
879
|
+
tableName: "formParams",
|
|
880
|
+
propertiesKey: e.$route.path || "defQueryParams",
|
|
881
|
+
primaryKey: e.DBPrimaryKey || "default",
|
|
882
|
+
mapDB: ge
|
|
883
|
+
},
|
|
884
|
+
(n) => {
|
|
885
|
+
n && (e.queryParams = { ...t, ...n }), e.queryWhenReady && e.$nextTick(() => {
|
|
886
|
+
e.handleQuery({ defaultPageFirst: !1 });
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
), e.queryWhenReady && e.parametersType !== "indexDB" && e.$nextTick(() => {
|
|
890
|
+
e.handleQuery({ defaultPageFirst: !1 });
|
|
891
|
+
}), t;
|
|
892
|
+
}, kt = ({ item: e = {}, vm: r = {} }) => {
|
|
893
|
+
const { type: t, rules: n = [] } = e, a = [...n];
|
|
894
|
+
return r.noInputBlank && t === "input" && a.push({
|
|
895
|
+
pattern: /\S/,
|
|
896
|
+
message: "请输入(不能仅输入空格)",
|
|
897
|
+
trigger: "blur"
|
|
898
|
+
}), a;
|
|
899
|
+
}, wt = {
|
|
900
|
+
makeParamsByType: ve,
|
|
901
|
+
saveParamsByType: be,
|
|
902
|
+
handleQuery: gt,
|
|
903
|
+
resetQuery: vt,
|
|
904
|
+
initQueryParams: bt,
|
|
905
|
+
getItemRules: kt
|
|
906
|
+
}, se = wt, St = x({
|
|
907
|
+
name: "GeneralBasicForm",
|
|
908
|
+
components: {
|
|
909
|
+
Input: ne,
|
|
910
|
+
InputNumber: Me,
|
|
911
|
+
InputGraphicVerification: ze,
|
|
912
|
+
InputMobileVerification: $e,
|
|
913
|
+
Divider: nt,
|
|
914
|
+
Radio: at,
|
|
915
|
+
Checkbox: ot,
|
|
916
|
+
DatePicker: st,
|
|
917
|
+
Select: it,
|
|
918
|
+
Cascader: lt
|
|
919
|
+
},
|
|
920
|
+
props: {
|
|
921
|
+
showSearch: {
|
|
922
|
+
// 是否展示所有元素
|
|
923
|
+
type: Boolean,
|
|
924
|
+
default: !0
|
|
925
|
+
},
|
|
926
|
+
loading: {
|
|
927
|
+
// 加载动画
|
|
928
|
+
type: Boolean,
|
|
929
|
+
default: !1
|
|
930
|
+
},
|
|
931
|
+
formOnly: {
|
|
932
|
+
// 是否只展示表单不展示按钮
|
|
933
|
+
type: Boolean,
|
|
934
|
+
default: !1
|
|
935
|
+
},
|
|
936
|
+
getList: {
|
|
937
|
+
// 查找数据调用的函数
|
|
938
|
+
type: Function,
|
|
939
|
+
default: () => {
|
|
940
|
+
}
|
|
941
|
+
},
|
|
942
|
+
afterReset: {
|
|
943
|
+
// 在重置按钮点击完后但还没重新请求时触发的的函数
|
|
944
|
+
type: Function,
|
|
945
|
+
default: () => {
|
|
946
|
+
}
|
|
947
|
+
},
|
|
948
|
+
formItem: {
|
|
949
|
+
// 定义表单的数据
|
|
950
|
+
type: Array,
|
|
951
|
+
default: () => []
|
|
952
|
+
},
|
|
953
|
+
size: {
|
|
954
|
+
// 控制按钮大小
|
|
955
|
+
type: String,
|
|
956
|
+
default: "default"
|
|
957
|
+
},
|
|
958
|
+
labelWidth: {
|
|
959
|
+
// 表单文字宽度
|
|
960
|
+
type: String,
|
|
961
|
+
default: "90px"
|
|
962
|
+
},
|
|
963
|
+
parametersType: {
|
|
964
|
+
type: String,
|
|
965
|
+
default: "url"
|
|
966
|
+
},
|
|
967
|
+
DBPrimaryKey: {
|
|
968
|
+
// indexDB的primaryKey,一般配合parametersType==="indexDB"使用
|
|
969
|
+
type: [String, Number],
|
|
970
|
+
required: !1
|
|
971
|
+
},
|
|
972
|
+
formData: {
|
|
973
|
+
// 外部传入的表单数据,用于回填
|
|
974
|
+
type: Object,
|
|
975
|
+
default: () => {
|
|
976
|
+
}
|
|
977
|
+
},
|
|
978
|
+
noInputBlank: {
|
|
979
|
+
// 用于判断input框是否校验仅空格
|
|
980
|
+
type: Boolean,
|
|
981
|
+
default: () => !1
|
|
982
|
+
},
|
|
983
|
+
currentPageKey: {
|
|
984
|
+
type: String,
|
|
985
|
+
default: "page"
|
|
986
|
+
},
|
|
987
|
+
pageSizeKey: {
|
|
988
|
+
type: String,
|
|
989
|
+
default: "limit"
|
|
990
|
+
},
|
|
991
|
+
defCurrentPage: {
|
|
992
|
+
type: Number,
|
|
993
|
+
default: 1
|
|
994
|
+
},
|
|
995
|
+
defPageSize: {
|
|
996
|
+
type: Number,
|
|
997
|
+
default: 10
|
|
998
|
+
},
|
|
999
|
+
queryWhenReady: {
|
|
1000
|
+
// 初始化完成后自动触发查找数据函数
|
|
1001
|
+
type: Boolean,
|
|
1002
|
+
default: () => !1
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
data() {
|
|
1006
|
+
return {
|
|
1007
|
+
formLoading: this.loading || !1,
|
|
1008
|
+
queryParams: se.initQueryParams({
|
|
1009
|
+
vm: this
|
|
1010
|
+
})
|
|
1011
|
+
// form表单数据
|
|
1012
|
+
};
|
|
1013
|
+
},
|
|
1014
|
+
provide() {
|
|
1015
|
+
return {
|
|
1016
|
+
// 显式提供一个计算属性
|
|
1017
|
+
[Ce]: {
|
|
1018
|
+
formLoading: te(() => this.formLoading),
|
|
1019
|
+
updateFormLoading: (e) => {
|
|
1020
|
+
this.formLoading = e;
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
// 使用computed保持响应性
|
|
1024
|
+
queryParams: te(() => this.queryParams)
|
|
1025
|
+
};
|
|
1026
|
+
},
|
|
1027
|
+
setup(e) {
|
|
1028
|
+
const { size: r, getList: t } = e;
|
|
1029
|
+
we(
|
|
1030
|
+
/* 注入名 */
|
|
1031
|
+
"size",
|
|
1032
|
+
/* 值 */
|
|
1033
|
+
r
|
|
1034
|
+
), we(
|
|
1035
|
+
/* 注入名 */
|
|
1036
|
+
"getList",
|
|
1037
|
+
/* 值 */
|
|
1038
|
+
t
|
|
1039
|
+
);
|
|
1040
|
+
},
|
|
1041
|
+
watch: {
|
|
1042
|
+
formData: {
|
|
1043
|
+
handler(e, r) {
|
|
1044
|
+
JSON.stringify(e) !== JSON.stringify(this.queryParams) && (this.queryParams = {
|
|
1045
|
+
...this.queryParams,
|
|
1046
|
+
...e
|
|
1047
|
+
});
|
|
1048
|
+
},
|
|
1049
|
+
// watch 默认是懒执行的:仅当数据源变化时,才会执行回调。但在某些场景中,我们希望在创建侦听器时,立即执行一遍回调。举例来说,我们想请求一些初始数据,然后在相关状态更改时重新请求数据。
|
|
1050
|
+
// https://cn.vuejs.org/guide/essentials/watchers.html#deep-watchers
|
|
1051
|
+
immediate: !0,
|
|
1052
|
+
deep: !0
|
|
1053
|
+
},
|
|
1054
|
+
queryParams: {
|
|
1055
|
+
handler(e) {
|
|
1056
|
+
this.$emit("update:formData", { ...e });
|
|
1057
|
+
},
|
|
1058
|
+
deep: !0
|
|
1059
|
+
},
|
|
1060
|
+
loading(e) {
|
|
1061
|
+
this.formLoading !== e && (this.formLoading = e);
|
|
1062
|
+
},
|
|
1063
|
+
formLoading(e) {
|
|
1064
|
+
this.loading !== e && this.$emit("update:loading", e);
|
|
1065
|
+
}
|
|
1066
|
+
},
|
|
1067
|
+
methods: {
|
|
1068
|
+
/** 搜索按钮操作 */
|
|
1069
|
+
handleQuery(e = {}) {
|
|
1070
|
+
se.handleQuery({
|
|
1071
|
+
queryParameter: e,
|
|
1072
|
+
vm: this
|
|
1073
|
+
});
|
|
1074
|
+
},
|
|
1075
|
+
/** 重置按钮操作 */
|
|
1076
|
+
resetQuery() {
|
|
1077
|
+
se.resetQuery({
|
|
1078
|
+
vm: this
|
|
1079
|
+
});
|
|
1080
|
+
},
|
|
1081
|
+
getItemRules(e) {
|
|
1082
|
+
return se.getItemRules({
|
|
1083
|
+
item: e,
|
|
1084
|
+
vm: this
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
function Pt(e, r, t, n, a, l) {
|
|
1090
|
+
const s = g("Input"), i = g("Radio"), o = g("Select"), c = g("Divider"), p = g("Cascader"), f = g("Checkbox"), y = g("DatePicker"), h = g("InputNumber"), v = g("InputMobileVerification"), b = g("InputGraphicVerification"), k = g("el-form-item"), w = g("el-button"), q = g("el-form"), V = de("loading");
|
|
1091
|
+
return ee((u(), m(q, D({
|
|
1092
|
+
model: e.queryParams,
|
|
1093
|
+
ref: "queryFormRef",
|
|
1094
|
+
inline: "",
|
|
1095
|
+
"label-position": "left",
|
|
1096
|
+
"label-width": e.labelWidth
|
|
1097
|
+
}, e.$attrs), {
|
|
1098
|
+
default: S(() => [
|
|
1099
|
+
(u(!0), B(J, null, F(e.formItem, (d) => (u(), m(k, {
|
|
1100
|
+
label: d.label,
|
|
1101
|
+
prop: d.prop,
|
|
1102
|
+
key: d.prop,
|
|
1103
|
+
rules: e.getItemRules(d)
|
|
1104
|
+
}, {
|
|
1105
|
+
default: S(() => [
|
|
1106
|
+
/^input$/i.test(d.type) ? (u(), m(s, {
|
|
1107
|
+
key: 0,
|
|
1108
|
+
item: d
|
|
1109
|
+
}, null, 8, ["item"])) : I("", !0),
|
|
1110
|
+
/^radio$/i.test(d.type) ? (u(), m(i, {
|
|
1111
|
+
key: 1,
|
|
1112
|
+
item: d
|
|
1113
|
+
}, null, 8, ["item"])) : I("", !0),
|
|
1114
|
+
/^select$/i.test(d.type) ? (u(), m(o, {
|
|
1115
|
+
key: 2,
|
|
1116
|
+
item: d
|
|
1117
|
+
}, null, 8, ["item"])) : I("", !0),
|
|
1118
|
+
/^divider$/i.test(d.type) ? (u(), m(c, {
|
|
1119
|
+
key: 3,
|
|
1120
|
+
item: d
|
|
1121
|
+
}, null, 8, ["item"])) : I("", !0),
|
|
1122
|
+
/^cascader$/i.test(d.type) ? (u(), m(p, {
|
|
1123
|
+
key: 4,
|
|
1124
|
+
item: d
|
|
1125
|
+
}, null, 8, ["item"])) : I("", !0),
|
|
1126
|
+
/^checkbox$/i.test(d.type) ? (u(), m(f, {
|
|
1127
|
+
key: 5,
|
|
1128
|
+
item: d
|
|
1129
|
+
}, null, 8, ["item"])) : I("", !0),
|
|
1130
|
+
/^date-picker$/i.test(d.type) ? (u(), m(y, {
|
|
1131
|
+
key: 6,
|
|
1132
|
+
item: d
|
|
1133
|
+
}, null, 8, ["item"])) : I("", !0),
|
|
1134
|
+
/^input-number$/i.test(d.type) ? (u(), m(h, {
|
|
1135
|
+
key: 7,
|
|
1136
|
+
item: d
|
|
1137
|
+
}, null, 8, ["item"])) : I("", !0),
|
|
1138
|
+
/^form-item-slot$/i.test(d.type) ? pe(e.$slots, d.name, { key: 8 }) : I("", !0),
|
|
1139
|
+
/^input-mobile-verification$/i.test(d.type) ? (u(), m(v, {
|
|
1140
|
+
key: 9,
|
|
1141
|
+
item: d
|
|
1142
|
+
}, null, 8, ["item"])) : I("", !0),
|
|
1143
|
+
/^input-graphic-verification$/i.test(d.type) ? (u(), m(b, {
|
|
1144
|
+
item: d,
|
|
1145
|
+
key: d.key
|
|
1146
|
+
}, null, 8, ["item"])) : I("", !0)
|
|
1147
|
+
]),
|
|
1148
|
+
_: 2
|
|
1149
|
+
}, 1032, ["label", "prop", "rules"]))), 128)),
|
|
1150
|
+
pe(e.$slots, "default"),
|
|
1151
|
+
e.formOnly ? I("", !0) : (u(), m(k, { key: 0 }, {
|
|
1152
|
+
default: S(() => [
|
|
1153
|
+
ee((u(), m(w, {
|
|
1154
|
+
type: "primary",
|
|
1155
|
+
size: e.size,
|
|
1156
|
+
onClick: e.handleQuery
|
|
1157
|
+
}, {
|
|
1158
|
+
default: S(() => r[0] || (r[0] = [
|
|
1159
|
+
L("查询")
|
|
1160
|
+
])),
|
|
1161
|
+
_: 1
|
|
1162
|
+
}, 8, ["size", "onClick"])), [
|
|
1163
|
+
[V, e.formLoading]
|
|
1164
|
+
]),
|
|
1165
|
+
O(w, {
|
|
1166
|
+
size: e.size,
|
|
1167
|
+
onClick: e.resetQuery
|
|
1168
|
+
}, {
|
|
1169
|
+
default: S(() => r[1] || (r[1] = [
|
|
1170
|
+
L("重置")
|
|
1171
|
+
])),
|
|
1172
|
+
_: 1
|
|
1173
|
+
}, 8, ["size", "onClick"])
|
|
1174
|
+
]),
|
|
1175
|
+
_: 1
|
|
1176
|
+
})),
|
|
1177
|
+
pe(e.$slots, "behind-the-button")
|
|
1178
|
+
]),
|
|
1179
|
+
_: 3
|
|
1180
|
+
}, 16, ["model", "label-width"])), [
|
|
1181
|
+
[Re, e.showSearch]
|
|
1182
|
+
]);
|
|
1183
|
+
}
|
|
1184
|
+
const It = /* @__PURE__ */ M(St, [["render", Pt]]), Dt = ["infinite-scroll-disabled"], Bt = ["infinite-scroll-disabled"], xt = { class: "checkbox" }, Tt = /* @__PURE__ */ x({
|
|
1185
|
+
__name: "InfiniteScrollList",
|
|
1186
|
+
props: {
|
|
1187
|
+
search: {
|
|
1188
|
+
type: Function,
|
|
1189
|
+
required: !0
|
|
1190
|
+
},
|
|
1191
|
+
checkbox: {
|
|
1192
|
+
type: Boolean,
|
|
1193
|
+
required: !1
|
|
1194
|
+
},
|
|
1195
|
+
id: {
|
|
1196
|
+
type: String,
|
|
1197
|
+
required: !0
|
|
1198
|
+
},
|
|
1199
|
+
name: {
|
|
1200
|
+
type: String,
|
|
1201
|
+
required: !1
|
|
1202
|
+
},
|
|
1203
|
+
extra: {
|
|
1204
|
+
type: null,
|
|
1205
|
+
required: !1
|
|
1206
|
+
},
|
|
1207
|
+
defaultSelection: {
|
|
1208
|
+
type: Array,
|
|
1209
|
+
required: !1
|
|
1210
|
+
},
|
|
1211
|
+
height: {
|
|
1212
|
+
type: String,
|
|
1213
|
+
required: !1,
|
|
1214
|
+
default: "272px"
|
|
1215
|
+
}
|
|
1216
|
+
},
|
|
1217
|
+
setup(e, { expose: r }) {
|
|
1218
|
+
const t = e, { search: n, id: a, name: l, extra: s, height: i } = t, o = C([]), c = C(1), p = C(!1), f = C([]), y = C(!1), h = (d, T) => {
|
|
1219
|
+
const { i: K } = d;
|
|
1220
|
+
return s && s !== "false" ? s(K) : "";
|
|
1221
|
+
}, v = (d) => {
|
|
1222
|
+
f.value = d.map((T) => typeof T == "object" ? T[a] : T);
|
|
1223
|
+
};
|
|
1224
|
+
Be(
|
|
1225
|
+
() => t.defaultSelection,
|
|
1226
|
+
(d = [], T = []) => {
|
|
1227
|
+
v(d);
|
|
1228
|
+
},
|
|
1229
|
+
{ immediate: !0 }
|
|
1230
|
+
);
|
|
1231
|
+
const b = () => {
|
|
1232
|
+
k(), f.value = [];
|
|
1233
|
+
}, k = () => {
|
|
1234
|
+
c.value = 1, o.value = [], p.value = !1;
|
|
1235
|
+
}, w = async () => {
|
|
1236
|
+
if (y.value || p.value)
|
|
1237
|
+
return;
|
|
1238
|
+
y.value = !0;
|
|
1239
|
+
const d = await n(c.value);
|
|
1240
|
+
d && d.length > 0 ? (o.value = [...o.value, ...d], c.value += 1) : p.value = !0, y.value = !1;
|
|
1241
|
+
}, q = async () => {
|
|
1242
|
+
k(), await w();
|
|
1243
|
+
}, V = te(
|
|
1244
|
+
() => o.value.filter((d) => f.value.includes(d[a]))
|
|
1245
|
+
) || {};
|
|
1246
|
+
return r({
|
|
1247
|
+
reset: b,
|
|
1248
|
+
lowReset: k,
|
|
1249
|
+
loadList: w,
|
|
1250
|
+
selectInfo: V,
|
|
1251
|
+
list: o,
|
|
1252
|
+
ifbottom: p,
|
|
1253
|
+
refreshList: q,
|
|
1254
|
+
loading: y
|
|
1255
|
+
}), (d, T) => {
|
|
1256
|
+
const K = g("el-checkbox"), A = g("el-checkbox-group"), E = de("infinite-scroll"), Ne = de("loading");
|
|
1257
|
+
return t.checkbox ? ee((u(), m(A, D({
|
|
1258
|
+
key: 0,
|
|
1259
|
+
modelValue: f.value,
|
|
1260
|
+
"onUpdate:modelValue": T[0] || (T[0] = (N) => f.value = N)
|
|
1261
|
+
}, t), {
|
|
1262
|
+
default: S(() => [
|
|
1263
|
+
ee((u(), B("ul", {
|
|
1264
|
+
class: "list",
|
|
1265
|
+
"infinite-scroll-disabled": p.value,
|
|
1266
|
+
style: Oe({ height: _(i) })
|
|
1267
|
+
}, [
|
|
1268
|
+
(u(!0), B(J, null, F(o.value, (N) => (u(), B("li", {
|
|
1269
|
+
key: N[_(a)],
|
|
1270
|
+
class: "list-item"
|
|
1271
|
+
}, [
|
|
1272
|
+
O(K, {
|
|
1273
|
+
value: N[_(a)],
|
|
1274
|
+
class: "checkbox"
|
|
1275
|
+
}, {
|
|
1276
|
+
default: S(() => [
|
|
1277
|
+
L(j(N[_(l)]) + " ", 1),
|
|
1278
|
+
t.extra ? (u(), m(h, {
|
|
1279
|
+
key: 0,
|
|
1280
|
+
i: N
|
|
1281
|
+
}, null, 8, ["i"])) : I("", !0)
|
|
1282
|
+
]),
|
|
1283
|
+
_: 2
|
|
1284
|
+
}, 1032, ["value"])
|
|
1285
|
+
]))), 128))
|
|
1286
|
+
], 12, Dt)), [
|
|
1287
|
+
[E, w]
|
|
1288
|
+
])
|
|
1289
|
+
]),
|
|
1290
|
+
_: 1
|
|
1291
|
+
}, 16, ["modelValue"])), [
|
|
1292
|
+
[Ne, y.value]
|
|
1293
|
+
]) : ee((u(), B("ul", D({
|
|
1294
|
+
key: 1,
|
|
1295
|
+
class: "list",
|
|
1296
|
+
"infinite-scroll-disabled": p.value,
|
|
1297
|
+
style: { height: _(i) }
|
|
1298
|
+
}, t), [
|
|
1299
|
+
(u(!0), B(J, null, F(o.value, (N) => (u(), B("li", {
|
|
1300
|
+
key: N[_(a)],
|
|
1301
|
+
class: "list-item"
|
|
1302
|
+
}, [
|
|
1303
|
+
Z("div", xt, [
|
|
1304
|
+
L(j(N[_(l)]) + " ", 1),
|
|
1305
|
+
t.extra ? (u(), m(h, {
|
|
1306
|
+
key: 0,
|
|
1307
|
+
i: N
|
|
1308
|
+
}, null, 8, ["i"])) : I("", !0)
|
|
1309
|
+
])
|
|
1310
|
+
]))), 128))
|
|
1311
|
+
], 16, Bt)), [
|
|
1312
|
+
[E, w]
|
|
1313
|
+
]);
|
|
1314
|
+
};
|
|
1315
|
+
}
|
|
1316
|
+
});
|
|
1317
|
+
const Ct = /* @__PURE__ */ M(Tt, [["__scopeId", "data-v-3ff9d47e"]]), zt = { key: 1 }, $t = /* @__PURE__ */ x({
|
|
1318
|
+
__name: "Descriptions",
|
|
1319
|
+
props: {
|
|
1320
|
+
formData: {
|
|
1321
|
+
type: Object,
|
|
1322
|
+
required: !0
|
|
1323
|
+
},
|
|
1324
|
+
formItem: {
|
|
1325
|
+
type: Array,
|
|
1326
|
+
required: !0
|
|
1327
|
+
},
|
|
1328
|
+
componentType: {
|
|
1329
|
+
type: String,
|
|
1330
|
+
default: "Element Plus"
|
|
1331
|
+
},
|
|
1332
|
+
strict: {
|
|
1333
|
+
// 使用strict参数后,如果formData内的某个字段没有值,对应的描述元素将不会展示(包括标签文字),但有render的字段仍然会展示
|
|
1334
|
+
type: Boolean,
|
|
1335
|
+
default: !1
|
|
1336
|
+
}
|
|
1337
|
+
},
|
|
1338
|
+
setup(e) {
|
|
1339
|
+
const r = e, t = C([]);
|
|
1340
|
+
Be(
|
|
1341
|
+
() => [r.formData, r.formItem],
|
|
1342
|
+
([s = {}, i = []]) => {
|
|
1343
|
+
let o = i;
|
|
1344
|
+
if (r.strict)
|
|
1345
|
+
for (const c in s)
|
|
1346
|
+
Object.prototype.hasOwnProperty.call(s, c) && (s[c] || (o = o.filter((f) => f.prop !== c || f.render)));
|
|
1347
|
+
t.value = o;
|
|
1348
|
+
},
|
|
1349
|
+
{ immediate: !0 }
|
|
1350
|
+
);
|
|
1351
|
+
const n = re("el-descriptions"), a = re("el-descriptions-item");
|
|
1352
|
+
switch (r.componentType) {
|
|
1353
|
+
case "Element Plus":
|
|
1354
|
+
n.value = "el-descriptions", a.value = "el-descriptions-item";
|
|
1355
|
+
break;
|
|
1356
|
+
case "Ant Design Vue":
|
|
1357
|
+
n.value = "a-descriptions", a.value = "a-descriptions-item";
|
|
1358
|
+
break;
|
|
1359
|
+
}
|
|
1360
|
+
const l = (s, i) => {
|
|
1361
|
+
const { i: o, render: c, formData: p } = s;
|
|
1362
|
+
return c({
|
|
1363
|
+
row: p,
|
|
1364
|
+
$index: o
|
|
1365
|
+
});
|
|
1366
|
+
};
|
|
1367
|
+
return (s, i) => (u(), m(Q(n.value), D({
|
|
1368
|
+
column: 1,
|
|
1369
|
+
border: "",
|
|
1370
|
+
class: "form-width"
|
|
1371
|
+
}, s.$attrs), {
|
|
1372
|
+
default: S(() => [
|
|
1373
|
+
(u(!0), B(J, null, F(t.value, (o, c) => (u(), m(Q(a.value), D({
|
|
1374
|
+
key: o.prop,
|
|
1375
|
+
label: o.label,
|
|
1376
|
+
ref_for: !0
|
|
1377
|
+
}, o.descriptionsItemProps), {
|
|
1378
|
+
default: S(() => [
|
|
1379
|
+
o.render ? (u(), m(l, {
|
|
1380
|
+
key: 0,
|
|
1381
|
+
i: c,
|
|
1382
|
+
render: o.render,
|
|
1383
|
+
formData: e.formData
|
|
1384
|
+
}, null, 8, ["i", "render", "formData"])) : (u(), B("span", zt, j(e.formData[o.prop]), 1))
|
|
1385
|
+
]),
|
|
1386
|
+
_: 2
|
|
1387
|
+
}, 1040, ["label"]))), 128))
|
|
1388
|
+
]),
|
|
1389
|
+
_: 1
|
|
1390
|
+
}, 16));
|
|
1391
|
+
}
|
|
1392
|
+
});
|
|
1393
|
+
/*! Element Plus Icons Vue v2.3.1 */
|
|
1394
|
+
var qt = /* @__PURE__ */ x({
|
|
1395
|
+
name: "ArrowLeftBold",
|
|
1396
|
+
__name: "arrow-left-bold",
|
|
1397
|
+
setup(e) {
|
|
1398
|
+
return (r, t) => (u(), B("svg", {
|
|
1399
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1400
|
+
viewBox: "0 0 1024 1024"
|
|
1401
|
+
}, [
|
|
1402
|
+
Z("path", {
|
|
1403
|
+
fill: "currentColor",
|
|
1404
|
+
d: "M685.248 104.704a64 64 0 0 1 0 90.496L368.448 512l316.8 316.8a64 64 0 0 1-90.496 90.496L232.704 557.248a64 64 0 0 1 0-90.496l362.048-362.048a64 64 0 0 1 90.496 0z"
|
|
1405
|
+
})
|
|
1406
|
+
]));
|
|
1407
|
+
}
|
|
1408
|
+
}), Vt = qt, Kt = /* @__PURE__ */ x({
|
|
1409
|
+
name: "ArrowRightBold",
|
|
1410
|
+
__name: "arrow-right-bold",
|
|
1411
|
+
setup(e) {
|
|
1412
|
+
return (r, t) => (u(), B("svg", {
|
|
1413
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1414
|
+
viewBox: "0 0 1024 1024"
|
|
1415
|
+
}, [
|
|
1416
|
+
Z("path", {
|
|
1417
|
+
fill: "currentColor",
|
|
1418
|
+
d: "M338.752 104.704a64 64 0 0 0 0 90.496l316.8 316.8-316.8 316.8a64 64 0 0 0 90.496 90.496l362.048-362.048a64 64 0 0 0 0-90.496L429.248 104.704a64 64 0 0 0-90.496 0z"
|
|
1419
|
+
})
|
|
1420
|
+
]));
|
|
1421
|
+
}
|
|
1422
|
+
}), Nt = Kt;
|
|
1423
|
+
const Ft = {
|
|
1424
|
+
props: {
|
|
1425
|
+
treeAttributes: {
|
|
1426
|
+
type: Object,
|
|
1427
|
+
default: () => {
|
|
1428
|
+
}
|
|
1429
|
+
},
|
|
1430
|
+
filterable: {
|
|
1431
|
+
type: Boolean,
|
|
1432
|
+
default: !1
|
|
1433
|
+
},
|
|
1434
|
+
dataSource: {
|
|
1435
|
+
type: Array,
|
|
1436
|
+
default: () => []
|
|
1437
|
+
},
|
|
1438
|
+
checkedKeys: {
|
|
1439
|
+
type: Array,
|
|
1440
|
+
default: () => []
|
|
1441
|
+
},
|
|
1442
|
+
transferTitleLeft: {
|
|
1443
|
+
type: String,
|
|
1444
|
+
default: ""
|
|
1445
|
+
},
|
|
1446
|
+
transferTitleRight: {
|
|
1447
|
+
type: String,
|
|
1448
|
+
default: ""
|
|
1449
|
+
}
|
|
1450
|
+
},
|
|
1451
|
+
watch: {
|
|
1452
|
+
sourceFilterText(e) {
|
|
1453
|
+
this.$refs.sourceTree.filter(e);
|
|
1454
|
+
},
|
|
1455
|
+
selectedFilterText(e) {
|
|
1456
|
+
this.$refs.selectTree.filter(e);
|
|
1457
|
+
},
|
|
1458
|
+
checkedKeys() {
|
|
1459
|
+
this.defCheckedKeys();
|
|
1460
|
+
},
|
|
1461
|
+
dataSource() {
|
|
1462
|
+
this.defCheckedKeys();
|
|
1463
|
+
}
|
|
1464
|
+
},
|
|
1465
|
+
data() {
|
|
1466
|
+
return {
|
|
1467
|
+
defaultTreeAttributes: {
|
|
1468
|
+
"default-expand-all": !0,
|
|
1469
|
+
"show-checkbox": !0,
|
|
1470
|
+
"node-key": "id",
|
|
1471
|
+
...this.treeAttributes
|
|
1472
|
+
},
|
|
1473
|
+
selectedList: [],
|
|
1474
|
+
sourceFilterText: "",
|
|
1475
|
+
selectedFilterText: "",
|
|
1476
|
+
ArrowRightBold: Se(Nt),
|
|
1477
|
+
ArrowLeftBold: Se(Vt)
|
|
1478
|
+
};
|
|
1479
|
+
},
|
|
1480
|
+
methods: {
|
|
1481
|
+
sourceFilterNode(e, r) {
|
|
1482
|
+
var n, a;
|
|
1483
|
+
if (!e)
|
|
1484
|
+
return !0;
|
|
1485
|
+
const t = ((a = (n = this.defaultTreeAttributes) == null ? void 0 : n.props) == null ? void 0 : a.label) || "label";
|
|
1486
|
+
return r[t].includes(e);
|
|
1487
|
+
},
|
|
1488
|
+
getSelectedData() {
|
|
1489
|
+
let e = !0, r;
|
|
1490
|
+
const t = this.$refs.sourceTree.getCheckedNodes(e, r);
|
|
1491
|
+
this.selectedList = t;
|
|
1492
|
+
},
|
|
1493
|
+
removeSelectedData() {
|
|
1494
|
+
let e, r;
|
|
1495
|
+
const t = this.$refs.selectTree.getCheckedNodes(e, r), n = {}, a = this.defaultTreeAttributes.nodeKey || this.defaultTreeAttributes["node-key"];
|
|
1496
|
+
t.forEach((l) => {
|
|
1497
|
+
n[l[a]] = l;
|
|
1498
|
+
}), this.selectedList = this.selectedList.filter((l) => !n[l[a]]);
|
|
1499
|
+
},
|
|
1500
|
+
defCheckedKeys() {
|
|
1501
|
+
this.$refs.sourceTree.setCheckedKeys(this.checkedKeys), this.$nextTick(() => {
|
|
1502
|
+
this.getSelectedData(), this.$refs.selectTree.setCheckedKeys(this.checkedKeys);
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
}, Lt = { class: "tree-box" }, At = { class: "left-box" }, Et = { class: "mid-box" }, Rt = { class: "right-box" };
|
|
1507
|
+
function Ot(e, r, t, n, a, l) {
|
|
1508
|
+
const s = g("el-text"), i = g("el-input"), o = g("el-tree"), c = g("el-button");
|
|
1509
|
+
return u(), B("div", Lt, [
|
|
1510
|
+
Z("div", At, [
|
|
1511
|
+
O(s, {
|
|
1512
|
+
class: "v-tree-transfer-title",
|
|
1513
|
+
size: "large"
|
|
1514
|
+
}, {
|
|
1515
|
+
default: S(() => [
|
|
1516
|
+
L(j(t.transferTitleLeft), 1)
|
|
1517
|
+
]),
|
|
1518
|
+
_: 1
|
|
1519
|
+
}),
|
|
1520
|
+
t.filterable ? (u(), m(i, {
|
|
1521
|
+
key: 0,
|
|
1522
|
+
placeholder: "输入关键字进行过滤",
|
|
1523
|
+
modelValue: a.sourceFilterText,
|
|
1524
|
+
"onUpdate:modelValue": r[0] || (r[0] = (p) => a.sourceFilterText = p)
|
|
1525
|
+
}, null, 8, ["modelValue"])) : I("", !0),
|
|
1526
|
+
O(o, D({
|
|
1527
|
+
data: t.dataSource,
|
|
1528
|
+
ref: "sourceTree",
|
|
1529
|
+
"filter-node-method": l.sourceFilterNode
|
|
1530
|
+
}, { ...a.defaultTreeAttributes }), null, 16, ["data", "filter-node-method"])
|
|
1531
|
+
]),
|
|
1532
|
+
Z("div", Et, [
|
|
1533
|
+
O(c, {
|
|
1534
|
+
icon: a.ArrowRightBold,
|
|
1535
|
+
circle: "",
|
|
1536
|
+
onClick: l.getSelectedData
|
|
1537
|
+
}, null, 8, ["icon", "onClick"]),
|
|
1538
|
+
O(c, {
|
|
1539
|
+
icon: a.ArrowLeftBold,
|
|
1540
|
+
circle: "",
|
|
1541
|
+
onClick: l.removeSelectedData
|
|
1542
|
+
}, null, 8, ["icon", "onClick"])
|
|
1543
|
+
]),
|
|
1544
|
+
Z("div", Rt, [
|
|
1545
|
+
O(s, {
|
|
1546
|
+
class: "v-tree-transfer-title",
|
|
1547
|
+
size: "large"
|
|
1548
|
+
}, {
|
|
1549
|
+
default: S(() => [
|
|
1550
|
+
L(j(t.transferTitleRight), 1)
|
|
1551
|
+
]),
|
|
1552
|
+
_: 1
|
|
1553
|
+
}),
|
|
1554
|
+
t.filterable ? (u(), m(i, {
|
|
1555
|
+
key: 0,
|
|
1556
|
+
placeholder: "输入关键字进行过滤",
|
|
1557
|
+
modelValue: a.selectedFilterText,
|
|
1558
|
+
"onUpdate:modelValue": r[1] || (r[1] = (p) => a.selectedFilterText = p)
|
|
1559
|
+
}, null, 8, ["modelValue"])) : I("", !0),
|
|
1560
|
+
O(o, D({
|
|
1561
|
+
data: a.selectedList,
|
|
1562
|
+
ref: "selectTree",
|
|
1563
|
+
"filter-node-method": l.sourceFilterNode
|
|
1564
|
+
}, { ...a.defaultTreeAttributes }), null, 16, ["data", "filter-node-method"])
|
|
1565
|
+
])
|
|
1566
|
+
]);
|
|
1567
|
+
}
|
|
1568
|
+
const Qt = /* @__PURE__ */ M(Ft, [["render", Ot], ["__scopeId", "data-v-d9a75723"]]), Gt = It, Mt = Ct, Ut = $t, Jt = ze, Wt = $e, Zt = Qt;
|
|
1569
|
+
export {
|
|
1570
|
+
Ut as VDescriptions,
|
|
1571
|
+
Gt as VGeneralBasicForm,
|
|
1572
|
+
Mt as VInfiniteScrollList,
|
|
1573
|
+
Jt as VInputGraphicVerification,
|
|
1574
|
+
Wt as VInputMobilecVerification,
|
|
1575
|
+
Zt as VTreeTransfer
|
|
1576
|
+
};
|