general-basic-form 2.0.63 → 2.0.64
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/index.js +1399 -0
- package/dist/index.umd.cjs +1 -0
- package/dist/style.css +1 -0
- package/package.json +15 -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,1399 @@
|
|
|
1
|
+
import { defineComponent as q, inject as k, resolveComponent as P, openBlock as u, createBlock as f, mergeProps as w, withKeys as ke, createSlots as de, renderList as F, withCtx as I, resolveDynamicComponent as R, createCommentVNode as D, ref as $, unref as g, onMounted as Ne, createElementBlock as z, computed as H, shallowRef as ee, onBeforeUnmount as Te, createTextVNode as j, toDisplayString as J, h as _e, normalizeProps as Fe, guardReactiveProps as Le, Fragment as G, provide as be, resolveDirective as ce, withDirectives as X, renderSlot as ue, createVNode as Ie, vShow as Ee, watch as De, normalizeStyle as Qe, createElementVNode as Re } from "vue";
|
|
2
|
+
const fe = {
|
|
3
|
+
placeholder: "请输入",
|
|
4
|
+
style: "width: 200px",
|
|
5
|
+
clearable: !0
|
|
6
|
+
}, Ae = {
|
|
7
|
+
style: "width: 227px",
|
|
8
|
+
"start-placeholder": "开始日期",
|
|
9
|
+
"end-placeholder": "结束日期",
|
|
10
|
+
type: "daterange"
|
|
11
|
+
}, we = {
|
|
12
|
+
placeholder: "请选择",
|
|
13
|
+
filterable: !0,
|
|
14
|
+
clearable: !0,
|
|
15
|
+
style: "width: 200px"
|
|
16
|
+
}, Oe = q({
|
|
17
|
+
components: {
|
|
18
|
+
InputArchive: (e) => {
|
|
19
|
+
const { templateEle: n } = e;
|
|
20
|
+
return n();
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
item: null
|
|
25
|
+
// null就是any
|
|
26
|
+
},
|
|
27
|
+
setup() {
|
|
28
|
+
const e = k("queryParams", {}), n = k("getList"), t = k("size", "default");
|
|
29
|
+
return { queryParams: e, getList: n, size: t };
|
|
30
|
+
},
|
|
31
|
+
data() {
|
|
32
|
+
return {
|
|
33
|
+
inputSetting: {
|
|
34
|
+
...fe,
|
|
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
|
+
}), U = (e, n) => {
|
|
58
|
+
const t = e.__vccOpts || e;
|
|
59
|
+
for (const [r, a] of n)
|
|
60
|
+
t[r] = a;
|
|
61
|
+
return t;
|
|
62
|
+
};
|
|
63
|
+
function je(e, n, t, r, a, l) {
|
|
64
|
+
const s = P("el-input");
|
|
65
|
+
return u(), f(s, w({
|
|
66
|
+
onKeydown: ke(e.getList, ["enter"]),
|
|
67
|
+
modelValue: e.queryParams[e.item.prop],
|
|
68
|
+
"onUpdate:modelValue": n[0] || (n[0] = (i) => e.queryParams[e.item.prop] = i),
|
|
69
|
+
size: e.size
|
|
70
|
+
}, e.inputSetting), de({ _: 2 }, [
|
|
71
|
+
F(e.item.template, (i, o) => ({
|
|
72
|
+
name: o,
|
|
73
|
+
fn: I(() => [
|
|
74
|
+
i ? (u(), f(R(e.currentInputComponent()), {
|
|
75
|
+
key: o,
|
|
76
|
+
templateEle: i
|
|
77
|
+
}, null, 8, ["templateEle"])) : D("", !0)
|
|
78
|
+
])
|
|
79
|
+
}))
|
|
80
|
+
]), 1040, ["onKeydown", "modelValue", "size"]);
|
|
81
|
+
}
|
|
82
|
+
const te = /* @__PURE__ */ U(Oe, [["render", je]]), Ge = /* @__PURE__ */ q({
|
|
83
|
+
__name: "index",
|
|
84
|
+
props: {
|
|
85
|
+
item: {}
|
|
86
|
+
},
|
|
87
|
+
setup(e) {
|
|
88
|
+
const n = k("queryParams", {}), t = k("size"), r = $({
|
|
89
|
+
...fe,
|
|
90
|
+
...e.item.inputSetting,
|
|
91
|
+
...e.item.setting
|
|
92
|
+
});
|
|
93
|
+
return (a, l) => {
|
|
94
|
+
const s = P("el-input-number");
|
|
95
|
+
return u(), f(s, w({
|
|
96
|
+
modelValue: g(n)[a.item.prop],
|
|
97
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => g(n)[a.item.prop] = i),
|
|
98
|
+
size: g(t)
|
|
99
|
+
}, r.value), null, 16, ["modelValue", "size"]);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}), Me = q({
|
|
103
|
+
components: {
|
|
104
|
+
InputArchive: (e) => {
|
|
105
|
+
const { templateEle: n } = e;
|
|
106
|
+
return n();
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
props: {
|
|
110
|
+
item: null
|
|
111
|
+
// null就是any
|
|
112
|
+
},
|
|
113
|
+
setup() {
|
|
114
|
+
const e = k("queryParams", {}), n = k("getList", () => {
|
|
115
|
+
}), t = k("size", "default"), a = k("Form").useInjectFormItemContext();
|
|
116
|
+
return { queryParams: e, getList: n, size: t, formItemContext: a };
|
|
117
|
+
},
|
|
118
|
+
data() {
|
|
119
|
+
return {
|
|
120
|
+
inputSetting: {
|
|
121
|
+
...fe,
|
|
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 Ue(e, n, t, r, a, l) {
|
|
149
|
+
const s = P("a-input");
|
|
150
|
+
return u(), f(s, w({
|
|
151
|
+
onKeydown: ke(e.getList, ["enter"]),
|
|
152
|
+
onChange: e.onInputChange,
|
|
153
|
+
value: e.queryParams[e.item.prop],
|
|
154
|
+
size: e.size
|
|
155
|
+
}, e.inputSetting), de({ _: 2 }, [
|
|
156
|
+
F(e.item.template, (i, o) => ({
|
|
157
|
+
name: o,
|
|
158
|
+
fn: I(() => [
|
|
159
|
+
i ? (u(), f(R(e.currentInputComponent()), {
|
|
160
|
+
key: o,
|
|
161
|
+
templateEle: i
|
|
162
|
+
}, null, 8, ["templateEle"])) : D("", !0)
|
|
163
|
+
])
|
|
164
|
+
}))
|
|
165
|
+
]), 1040, ["onKeydown", "onChange", "value", "size"]);
|
|
166
|
+
}
|
|
167
|
+
const Be = /* @__PURE__ */ U(Me, [["render", Ue]]), $e = Symbol(), Je = /* @__PURE__ */ q({
|
|
168
|
+
__name: "index",
|
|
169
|
+
props: {
|
|
170
|
+
imgSrc: {}
|
|
171
|
+
},
|
|
172
|
+
setup(e) {
|
|
173
|
+
const n = $();
|
|
174
|
+
return Ne(() => {
|
|
175
|
+
const t = new Image(), r = [], a = 8, l = 8;
|
|
176
|
+
let s = 0, i = 0;
|
|
177
|
+
const o = 300, p = n.value, m = p.getContext("2d");
|
|
178
|
+
t.onload = function() {
|
|
179
|
+
p.width = t.width, p.height = t.height, i = Math.floor(t.width / a), s = Math.floor(t.height / l), d(), y();
|
|
180
|
+
}, t.src = e.imgSrc;
|
|
181
|
+
const d = () => {
|
|
182
|
+
for (let h = 0; h < l; h++)
|
|
183
|
+
for (let v = 0; v < a; v++)
|
|
184
|
+
r.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
|
+
m.clearRect(0, 0, p.width, p.height);
|
|
192
|
+
let h = !0;
|
|
193
|
+
r.forEach((v, _) => {
|
|
194
|
+
m.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
|
+
d(), y();
|
|
197
|
+
}, 300) : requestAnimationFrame(y);
|
|
198
|
+
};
|
|
199
|
+
}), (t, r) => (u(), z("canvas", {
|
|
200
|
+
ref_key: "loadingCanvas",
|
|
201
|
+
ref: n
|
|
202
|
+
}, null, 512));
|
|
203
|
+
}
|
|
204
|
+
}), We = { class: "input-graphic-verification" }, Ze = ["src", "alt"], Ye = /* @__PURE__ */ q({
|
|
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: n = "",
|
|
214
|
+
graphicAlt: t = "",
|
|
215
|
+
getGraphic: r = () => {
|
|
216
|
+
},
|
|
217
|
+
key: a
|
|
218
|
+
} = e.item, { formLoading: l } = k($e, !1), s = H(() => (l == null ? void 0 : l.value) || e.loading), i = async () => {
|
|
219
|
+
r && !(s != null && s.value) && await r();
|
|
220
|
+
}, o = ee(te);
|
|
221
|
+
switch (e.componentType) {
|
|
222
|
+
case "Element Plus":
|
|
223
|
+
o.value = te;
|
|
224
|
+
break;
|
|
225
|
+
case "Ant Design Vue":
|
|
226
|
+
o.value = Be;
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
return (p, m) => (u(), z("div", We, [
|
|
230
|
+
(u(), f(R(o.value), {
|
|
231
|
+
item: p.item,
|
|
232
|
+
class: "input"
|
|
233
|
+
}, null, 8, ["item"])),
|
|
234
|
+
s.value ? (u(), f(Je, {
|
|
235
|
+
key: 0,
|
|
236
|
+
class: "graphic",
|
|
237
|
+
imgSrc: g(n)
|
|
238
|
+
}, null, 8, ["imgSrc"])) : (u(), z("img", {
|
|
239
|
+
key: 1,
|
|
240
|
+
class: "graphic",
|
|
241
|
+
onClick: i,
|
|
242
|
+
src: g(n),
|
|
243
|
+
alt: g(t) || `${g(a)}`
|
|
244
|
+
}, null, 8, Ze))
|
|
245
|
+
]));
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
const qe = /* @__PURE__ */ U(Ye, [["__scopeId", "data-v-fb7aa300"]]), W = "获取验证码", Xe = 60, He = /* @__PURE__ */ q({
|
|
249
|
+
__name: "verification-button",
|
|
250
|
+
props: {
|
|
251
|
+
getSmscode: { type: Function },
|
|
252
|
+
componentType: { default: "Element Plus" },
|
|
253
|
+
item: {}
|
|
254
|
+
},
|
|
255
|
+
setup(e, { expose: n }) {
|
|
256
|
+
const t = $(W), r = $(null), a = H(() => t.value === W), l = ee("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
|
+
r && (clearInterval(r.value), r.value = null, t.value = W);
|
|
267
|
+
}, i = async () => {
|
|
268
|
+
if (t.value === W)
|
|
269
|
+
if (t.value = Xe, r.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
|
+
Te(() => {
|
|
281
|
+
s();
|
|
282
|
+
});
|
|
283
|
+
const o = { ...e.item.buttonSetting };
|
|
284
|
+
return n({ buttonClick: i, reset: s }), (p, m) => (u(), f(R(l.value), w({
|
|
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: I(() => [
|
|
293
|
+
j(J(a.value ? W : t.value + "s"), 1)
|
|
294
|
+
]),
|
|
295
|
+
_: 1
|
|
296
|
+
}, 16, ["style"]));
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
const Pe = /* @__PURE__ */ U(He, [["__scopeId", "data-v-aa89c1b7"]]), ze = /* @__PURE__ */ q({
|
|
300
|
+
__name: "index",
|
|
301
|
+
props: {
|
|
302
|
+
item: {},
|
|
303
|
+
componentType: { default: "Element Plus" }
|
|
304
|
+
},
|
|
305
|
+
setup(e, { expose: n }) {
|
|
306
|
+
const t = e.item, r = ee(te), a = $();
|
|
307
|
+
switch (e.componentType) {
|
|
308
|
+
case "Element Plus":
|
|
309
|
+
r.value = te, t.template = {
|
|
310
|
+
append: () => _e(Pe, {
|
|
311
|
+
getSmscode: t.getSmscode,
|
|
312
|
+
item: e.item,
|
|
313
|
+
ref: a
|
|
314
|
+
})
|
|
315
|
+
};
|
|
316
|
+
break;
|
|
317
|
+
case "Ant Design Vue":
|
|
318
|
+
r.value = Be, t.template = {
|
|
319
|
+
suffix: () => _e(Pe, {
|
|
320
|
+
getSmscode: t.getSmscode,
|
|
321
|
+
item: e.item,
|
|
322
|
+
ref: a
|
|
323
|
+
})
|
|
324
|
+
};
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
return n({ VerificationButtonRef: a }), (l, s) => (u(), f(R(r.value), {
|
|
328
|
+
item: g(t),
|
|
329
|
+
class: "input"
|
|
330
|
+
}, null, 8, ["item"]));
|
|
331
|
+
}
|
|
332
|
+
}), et = q({
|
|
333
|
+
components: {
|
|
334
|
+
slotArchive: (e) => {
|
|
335
|
+
const { templateEle: n } = e;
|
|
336
|
+
return n();
|
|
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 tt(e, n, t, r, a, l) {
|
|
360
|
+
const s = P("el-divider");
|
|
361
|
+
return u(), f(s, Fe(Le(e.dividerSetting)), de({ _: 2 }, [
|
|
362
|
+
F(e.item.template, (i, o) => ({
|
|
363
|
+
name: o,
|
|
364
|
+
fn: I(() => [
|
|
365
|
+
i ? (u(), f(R(e.currentInputComponent()), {
|
|
366
|
+
key: o,
|
|
367
|
+
templateEle: i
|
|
368
|
+
}, null, 8, ["templateEle"])) : D("", !0)
|
|
369
|
+
])
|
|
370
|
+
}))
|
|
371
|
+
]), 1040);
|
|
372
|
+
}
|
|
373
|
+
const nt = /* @__PURE__ */ U(et, [["render", tt]]), rt = /* @__PURE__ */ q({
|
|
374
|
+
__name: "index",
|
|
375
|
+
props: {
|
|
376
|
+
item: {}
|
|
377
|
+
},
|
|
378
|
+
setup(e) {
|
|
379
|
+
const n = k("queryParams", {}), t = k("size"), r = $({
|
|
380
|
+
...e.item.radioGroupSetting,
|
|
381
|
+
...e.item.setting
|
|
382
|
+
});
|
|
383
|
+
return (a, l) => {
|
|
384
|
+
const s = P("el-radio"), i = P("el-radio-group");
|
|
385
|
+
return u(), f(i, w({
|
|
386
|
+
modelValue: g(n)[a.item.prop],
|
|
387
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => g(n)[a.item.prop] = o),
|
|
388
|
+
size: g(t)
|
|
389
|
+
}, r.value), {
|
|
390
|
+
default: I(() => [
|
|
391
|
+
(u(!0), z(G, null, F(a.item.option || [], (o) => (u(), f(s, w({
|
|
392
|
+
size: g(t),
|
|
393
|
+
key: o.value,
|
|
394
|
+
ref_for: !0
|
|
395
|
+
}, o), {
|
|
396
|
+
default: I(() => [
|
|
397
|
+
j(J(o.label), 1)
|
|
398
|
+
]),
|
|
399
|
+
_: 2
|
|
400
|
+
}, 1040, ["size"]))), 128))
|
|
401
|
+
]),
|
|
402
|
+
_: 1
|
|
403
|
+
}, 16, ["modelValue", "size"]);
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
}), at = /* @__PURE__ */ q({
|
|
407
|
+
__name: "index",
|
|
408
|
+
props: {
|
|
409
|
+
item: {}
|
|
410
|
+
},
|
|
411
|
+
setup(e) {
|
|
412
|
+
const n = k("queryParams", {}), t = k("size"), r = $({
|
|
413
|
+
...e.item.checkboxGroupSetting,
|
|
414
|
+
...e.item.setting
|
|
415
|
+
});
|
|
416
|
+
return (a, l) => {
|
|
417
|
+
const s = P("el-checkbox"), i = P("el-checkbox-group");
|
|
418
|
+
return u(), f(i, w({
|
|
419
|
+
modelValue: g(n)[a.item.prop],
|
|
420
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => g(n)[a.item.prop] = o),
|
|
421
|
+
size: g(t)
|
|
422
|
+
}, r.value), {
|
|
423
|
+
default: I(() => [
|
|
424
|
+
(u(!0), z(G, null, F(a.item.option || [], (o) => (u(), f(s, w({
|
|
425
|
+
size: g(t),
|
|
426
|
+
key: o.value,
|
|
427
|
+
ref_for: !0
|
|
428
|
+
}, o), {
|
|
429
|
+
default: I(() => [
|
|
430
|
+
j(J(o.label), 1)
|
|
431
|
+
]),
|
|
432
|
+
_: 2
|
|
433
|
+
}, 1040, ["size"]))), 128))
|
|
434
|
+
]),
|
|
435
|
+
_: 1
|
|
436
|
+
}, 16, ["modelValue", "size"]);
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
}), ot = /* @__PURE__ */ q({
|
|
440
|
+
__name: "index",
|
|
441
|
+
props: {
|
|
442
|
+
item: {}
|
|
443
|
+
},
|
|
444
|
+
setup(e) {
|
|
445
|
+
const n = k("queryParams", {}), t = k("size"), r = $({
|
|
446
|
+
...Ae,
|
|
447
|
+
...e.item.datePackerSetting,
|
|
448
|
+
...e.item.setting
|
|
449
|
+
});
|
|
450
|
+
return (a, l) => {
|
|
451
|
+
const s = P("el-date-picker");
|
|
452
|
+
return u(), f(s, w({
|
|
453
|
+
modelValue: g(n)[a.item.prop],
|
|
454
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => g(n)[a.item.prop] = i),
|
|
455
|
+
size: g(t)
|
|
456
|
+
}, r.value), null, 16, ["modelValue", "size"]);
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
}), st = /* @__PURE__ */ q({
|
|
460
|
+
__name: "index",
|
|
461
|
+
props: {
|
|
462
|
+
item: {}
|
|
463
|
+
},
|
|
464
|
+
setup(e) {
|
|
465
|
+
const n = k("queryParams", {}), t = k("size"), r = $({
|
|
466
|
+
...we,
|
|
467
|
+
...e.item.selectSetting,
|
|
468
|
+
...e.item.setting
|
|
469
|
+
});
|
|
470
|
+
return (a, l) => {
|
|
471
|
+
const s = P("el-option"), i = P("el-select");
|
|
472
|
+
return u(), f(i, w({
|
|
473
|
+
modelValue: g(n)[a.item.prop],
|
|
474
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => g(n)[a.item.prop] = o),
|
|
475
|
+
size: g(t)
|
|
476
|
+
}, r.value), {
|
|
477
|
+
default: I(() => [
|
|
478
|
+
(u(!0), z(G, null, F(a.item.option || [], (o) => (u(), f(s, w({
|
|
479
|
+
key: o.value,
|
|
480
|
+
ref_for: !0
|
|
481
|
+
}, o), null, 16))), 128))
|
|
482
|
+
]),
|
|
483
|
+
_: 1
|
|
484
|
+
}, 16, ["modelValue", "size"]);
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
}), it = /* @__PURE__ */ q({
|
|
488
|
+
__name: "index",
|
|
489
|
+
props: {
|
|
490
|
+
item: {}
|
|
491
|
+
},
|
|
492
|
+
setup(e) {
|
|
493
|
+
const n = k("queryParams", {}), t = k("size"), r = $({
|
|
494
|
+
...we,
|
|
495
|
+
...e.item.selectSetting,
|
|
496
|
+
...e.item.setting
|
|
497
|
+
});
|
|
498
|
+
return (a, l) => {
|
|
499
|
+
const s = P("el-cascader");
|
|
500
|
+
return u(), f(s, w({
|
|
501
|
+
modelValue: g(n)[a.item.prop],
|
|
502
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => g(n)[a.item.prop] = i),
|
|
503
|
+
size: g(t),
|
|
504
|
+
options: a.item.options || []
|
|
505
|
+
}, r.value), null, 16, ["modelValue", "size", "options"]);
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
}), lt = (e = {}) => {
|
|
509
|
+
for (const n in e)
|
|
510
|
+
if (Object.prototype.hasOwnProperty.call(e, n)) {
|
|
511
|
+
const t = e[n];
|
|
512
|
+
Object.prototype.toString.call(t) === "[object Object]" && (e[n] = JSON.stringify(t));
|
|
513
|
+
}
|
|
514
|
+
return e;
|
|
515
|
+
}, ut = (e = {}) => {
|
|
516
|
+
for (const n in e)
|
|
517
|
+
if (Object.prototype.hasOwnProperty.call(e, n)) {
|
|
518
|
+
const t = e[n];
|
|
519
|
+
try {
|
|
520
|
+
/[{]+/g.test(t) && /[}]+/g.test(t) && (e[n] = JSON.parse(t));
|
|
521
|
+
} catch {
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
return e;
|
|
525
|
+
}, ye = { paramsToQuery: lt, queryToData: ut }, Q = M;
|
|
526
|
+
(function(e, n) {
|
|
527
|
+
const t = M, r = 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) === n)
|
|
531
|
+
break;
|
|
532
|
+
r.push(r.shift());
|
|
533
|
+
} catch {
|
|
534
|
+
r.push(r.shift());
|
|
535
|
+
}
|
|
536
|
+
})(oe, 819524);
|
|
537
|
+
const C = {};
|
|
538
|
+
let O = null;
|
|
539
|
+
const Se = async (e, n) => {
|
|
540
|
+
const t = M;
|
|
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: r = "", DBVersion: a = 1 } = e;
|
|
543
|
+
let l, s = !1;
|
|
544
|
+
try {
|
|
545
|
+
const i = window[t(543)][t(519)](r, a);
|
|
546
|
+
await new Promise((o, p) => {
|
|
547
|
+
const m = t;
|
|
548
|
+
i[m(551)] = async function(d) {
|
|
549
|
+
const y = m, h = d.target.result, { stores: v = [] } = e;
|
|
550
|
+
await Promise.all(v[y(509)](async (_) => {
|
|
551
|
+
const b = y, { DBStoreName: S = "", properties: x = {} } = _;
|
|
552
|
+
try {
|
|
553
|
+
const K = {};
|
|
554
|
+
K[b(536)] = e[b(557)];
|
|
555
|
+
const c = d[b(541)][b(520)][b(554)](S, K);
|
|
556
|
+
if (Object[b(548)](x)[b(500)] === 0) {
|
|
557
|
+
console[b(559)](S + "没有设置默认值");
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
for (const B in x)
|
|
561
|
+
if (x[b(556)][b(515)](x, B)) {
|
|
562
|
+
const N = x[B], L = { ...N.createIndex };
|
|
563
|
+
c[b(504)](B, B, L);
|
|
564
|
+
}
|
|
565
|
+
} catch (K) {
|
|
566
|
+
console[b(559)](K);
|
|
567
|
+
}
|
|
568
|
+
})), l = h, s = !0;
|
|
569
|
+
}, i[m(535)] = async function(d) {
|
|
570
|
+
const y = m;
|
|
571
|
+
if (l = this[y(520)], s) {
|
|
572
|
+
const { stores: h = [] } = e;
|
|
573
|
+
await Promise[y(528)](h[y(509)](async (v) => {
|
|
574
|
+
const _ = y, { DBStoreName: b = "" } = v, S = l[_(552)]([b], _(547)), x = S[_(496)](b), K = {};
|
|
575
|
+
K[e[_(557)]] = n, x[_(502)](K);
|
|
576
|
+
try {
|
|
577
|
+
await new Promise((c, B) => {
|
|
578
|
+
const N = _;
|
|
579
|
+
S[N(525)] = function(L) {
|
|
580
|
+
const E = N;
|
|
581
|
+
console[E(513)](E(512), L), B();
|
|
582
|
+
}, S[N(544)] = function(L) {
|
|
583
|
+
c();
|
|
584
|
+
}, S[N(529)] = function(L) {
|
|
585
|
+
const E = N;
|
|
586
|
+
console[E(513)](E(534), L), B();
|
|
587
|
+
};
|
|
588
|
+
});
|
|
589
|
+
} catch (c) {
|
|
590
|
+
console.warn(_(511), c);
|
|
591
|
+
}
|
|
592
|
+
}));
|
|
593
|
+
}
|
|
594
|
+
o();
|
|
595
|
+
}, i.onerror = function(d) {
|
|
596
|
+
p(d);
|
|
597
|
+
};
|
|
598
|
+
});
|
|
599
|
+
} catch (i) {
|
|
600
|
+
console[t(513)](i, t(526));
|
|
601
|
+
}
|
|
602
|
+
return l;
|
|
603
|
+
};
|
|
604
|
+
function oe() {
|
|
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 oe = function() {
|
|
607
|
+
return e;
|
|
608
|
+
}, oe();
|
|
609
|
+
}
|
|
610
|
+
function M(e, n) {
|
|
611
|
+
const t = oe();
|
|
612
|
+
return M = function(r, a) {
|
|
613
|
+
return r = r - 496, t[r];
|
|
614
|
+
}, M(e, n);
|
|
615
|
+
}
|
|
616
|
+
let ne = !1;
|
|
617
|
+
C[Q(549)] = async (e, n) => {
|
|
618
|
+
const t = Q, { mapDB: r, primaryKey: a } = e;
|
|
619
|
+
return r ? a ? (ne && await new Promise(async (l, s) => {
|
|
620
|
+
const i = () => {
|
|
621
|
+
ne ? setTimeout(() => {
|
|
622
|
+
i();
|
|
623
|
+
}, 200) : l();
|
|
624
|
+
};
|
|
625
|
+
i();
|
|
626
|
+
}), !O && (ne = !0, O = await Se(r, a), O == null || O.addEventListener(t(555), async () => {
|
|
627
|
+
console.info(t(532)), O = await Se(r, a);
|
|
628
|
+
}), ne = !1), n && n(O), O) : (console[t(559)](t(542)), !1) : (console[t(559)]("必须传入数据库配置信息"), !1);
|
|
629
|
+
}, C[Q(523)] = async (e, n) => {
|
|
630
|
+
const t = Q, { mapDB: r, tableName: a, primaryKey: l } = e, s = {};
|
|
631
|
+
s[t(508)] = r, s[t(557)] = l;
|
|
632
|
+
const i = await C.getDB(s);
|
|
633
|
+
if (!i)
|
|
634
|
+
return;
|
|
635
|
+
const o = i.transaction([a]), p = o[t(496)](a), m = p[t(522)](l);
|
|
636
|
+
return new Promise((d, y) => {
|
|
637
|
+
const h = t;
|
|
638
|
+
m.onsuccess = function(v) {
|
|
639
|
+
const _ = M;
|
|
640
|
+
n && n(a + _(538) + m[_(520)]), d(m[_(520)]);
|
|
641
|
+
}, m[h(529)] = function(v) {
|
|
642
|
+
console.error(a + h(545) + v), y();
|
|
643
|
+
};
|
|
644
|
+
});
|
|
645
|
+
}, C.updateStore = async (e, n) => {
|
|
646
|
+
var t;
|
|
647
|
+
const r = Q, { mapDB: a, tableName: l, updateData: s } = e;
|
|
648
|
+
!s[a == null ? void 0 : a[r(557)]] && console[r(559)](r(507) + a[r(557)]);
|
|
649
|
+
const i = {};
|
|
650
|
+
i.mapDB = a, i[r(557)] = s[a == null ? void 0 : a[r(557)]];
|
|
651
|
+
const o = await C[r(549)](i);
|
|
652
|
+
if (!o)
|
|
653
|
+
return;
|
|
654
|
+
let p = null;
|
|
655
|
+
try {
|
|
656
|
+
p = o[r(552)]([l], r(547)).objectStore(l);
|
|
657
|
+
} catch (h) {
|
|
658
|
+
console[r(513)](r(499), h);
|
|
659
|
+
}
|
|
660
|
+
let m = null, d = null;
|
|
661
|
+
const y = await new Promise((h, v) => {
|
|
662
|
+
const _ = r, b = p[_(501)](s[a == null ? void 0 : a[_(557)]]);
|
|
663
|
+
b[_(535)] = (S) => {
|
|
664
|
+
h(S);
|
|
665
|
+
}, b.onerror = (S) => {
|
|
666
|
+
v(S);
|
|
667
|
+
};
|
|
668
|
+
});
|
|
669
|
+
d = (t = y == null ? void 0 : y[r(533)]) == null ? void 0 : t[r(520)];
|
|
670
|
+
try {
|
|
671
|
+
d && (d == null ? void 0 : d.primaryKey) === s[a == null ? void 0 : a.primaryKey] ? m = d[r(517)](s) : m = p[r(530)](s);
|
|
672
|
+
} catch (h) {
|
|
673
|
+
console[r(513)](r(539), h, s);
|
|
674
|
+
}
|
|
675
|
+
new Promise((h, v) => {
|
|
676
|
+
const _ = r;
|
|
677
|
+
!m && (console[_(513)](l + _(531)), v()), m[_(535)] = function(b) {
|
|
678
|
+
n && n(l + _(537)), h();
|
|
679
|
+
}, m[_(529)] = function(b) {
|
|
680
|
+
const S = _;
|
|
681
|
+
console[S(513)](l + S(497), b), v();
|
|
682
|
+
};
|
|
683
|
+
}), d && d[r(516)]();
|
|
684
|
+
}, C[Q(518)] = async (e, n) => {
|
|
685
|
+
const t = Q, { mapDB: r, tableName: a, primaryKey: l } = e, s = {};
|
|
686
|
+
s[t(508)] = r, s[t(557)] = l;
|
|
687
|
+
const i = await C.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((p, m) => {
|
|
692
|
+
const d = t;
|
|
693
|
+
o[d(535)] = function(y) {
|
|
694
|
+
n && n(a + "数据删除成功"), p();
|
|
695
|
+
}, o.onerror = function(y) {
|
|
696
|
+
const h = d;
|
|
697
|
+
console[h(513)](a + h(524) + y), m();
|
|
698
|
+
};
|
|
699
|
+
});
|
|
700
|
+
}, C[Q(505)] = async (e, n) => {
|
|
701
|
+
const { mapDB: t } = e, r = window.indexedDB.deleteDatabase(t.DBName);
|
|
702
|
+
return new Promise((a, l) => {
|
|
703
|
+
const s = M;
|
|
704
|
+
r[s(535)] = (i) => {
|
|
705
|
+
n && n(t[s(553)] + "数据库已删除"), a();
|
|
706
|
+
}, r[s(529)] = (i) => {
|
|
707
|
+
const o = s;
|
|
708
|
+
console[o(513)](t[o(553)] + o(514) + i), l();
|
|
709
|
+
};
|
|
710
|
+
});
|
|
711
|
+
};
|
|
712
|
+
function A(e, n) {
|
|
713
|
+
const t = se();
|
|
714
|
+
return A = function(r, a) {
|
|
715
|
+
return r = r - 125, t[r];
|
|
716
|
+
}, A(e, n);
|
|
717
|
+
}
|
|
718
|
+
function se() {
|
|
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 se = function() {
|
|
721
|
+
return e;
|
|
722
|
+
}, se();
|
|
723
|
+
}
|
|
724
|
+
const re = A;
|
|
725
|
+
(function(e, n) {
|
|
726
|
+
const t = A, r = 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 === n)
|
|
730
|
+
break;
|
|
731
|
+
r.push(r.shift());
|
|
732
|
+
} catch {
|
|
733
|
+
r.push(r.shift());
|
|
734
|
+
}
|
|
735
|
+
})(se, 330152);
|
|
736
|
+
async function ct(e, n) {
|
|
737
|
+
const t = A, { tableName: r, propertiesKey: a, parameter: l, primaryKey: s, mapDB: i } = e;
|
|
738
|
+
let o = null, p = { [i[t(138)]]: s };
|
|
739
|
+
const m = {};
|
|
740
|
+
m[t(132)] = i, m.tableName = r, m[t(138)] = s;
|
|
741
|
+
const d = await C[t(136)](m);
|
|
742
|
+
d && (p = { ...d, [i.primaryKey]: s }), p[a] = l;
|
|
743
|
+
const y = {};
|
|
744
|
+
return y[t(132)] = i, y.tableName = r, y[t(134)] = p, await C[t(129)](y), l && (o = l), n && n(o), o;
|
|
745
|
+
}
|
|
746
|
+
async function pt(e, n) {
|
|
747
|
+
const t = A, { tableName: r, propertiesKey: a, primaryKey: l, mapDB: s } = e;
|
|
748
|
+
let i = null;
|
|
749
|
+
const o = {};
|
|
750
|
+
o[t(132)] = s, o[t(146)] = r, o.primaryKey = l;
|
|
751
|
+
const p = await C[t(136)](o);
|
|
752
|
+
return p && (i = p[a]), n && n(i), i;
|
|
753
|
+
}
|
|
754
|
+
async function mt(e, n) {
|
|
755
|
+
const t = A, { tableName: r, propertiesKey: a, parameter: l, primaryKey: s, mapDB: i } = e;
|
|
756
|
+
let o = {};
|
|
757
|
+
const p = {};
|
|
758
|
+
p.mapDB = i, p[t(146)] = r, p[t(138)] = s;
|
|
759
|
+
const m = await C[t(136)](p);
|
|
760
|
+
try {
|
|
761
|
+
if (m) {
|
|
762
|
+
o = { ...m[a], ...l };
|
|
763
|
+
const d = { [i[t(138)]]: s }, y = d;
|
|
764
|
+
y[a] = o;
|
|
765
|
+
const h = {};
|
|
766
|
+
h[t(132)] = i, h[t(146)] = r, h[t(134)] = y, await C.updateStore(h);
|
|
767
|
+
} else
|
|
768
|
+
console.warn(r + "为空,请先调用handleData");
|
|
769
|
+
} catch (d) {
|
|
770
|
+
console[t(135)](d);
|
|
771
|
+
}
|
|
772
|
+
return n && n(o), o;
|
|
773
|
+
}
|
|
774
|
+
async function dt(e, n) {
|
|
775
|
+
const t = A, { tableName: r, primaryKey: a, mapDB: l } = e;
|
|
776
|
+
let s = null;
|
|
777
|
+
try {
|
|
778
|
+
const i = {};
|
|
779
|
+
i.mapDB = l, i[t(146)] = r, i[t(138)] = a, await C[t(126)](i);
|
|
780
|
+
} catch (i) {
|
|
781
|
+
console.error(i);
|
|
782
|
+
}
|
|
783
|
+
return n && n(s), s;
|
|
784
|
+
}
|
|
785
|
+
const Z = {};
|
|
786
|
+
Z[re(139)] = ct, Z[re(130)] = pt, Z[re(134)] = mt, Z[re(131)] = dt;
|
|
787
|
+
var V = le;
|
|
788
|
+
(function(e, n) {
|
|
789
|
+
for (var t = le, r = 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 === n)
|
|
793
|
+
break;
|
|
794
|
+
r.push(r.shift());
|
|
795
|
+
} catch {
|
|
796
|
+
r.push(r.shift());
|
|
797
|
+
}
|
|
798
|
+
})(ie, 363872);
|
|
799
|
+
var Ce = {};
|
|
800
|
+
Ce[V(397)] = !1;
|
|
801
|
+
var pe = {};
|
|
802
|
+
pe[V(384)] = Ce, pe[V(392)] = {};
|
|
803
|
+
var Ve = {};
|
|
804
|
+
function ie() {
|
|
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 ie = function() {
|
|
807
|
+
return e;
|
|
808
|
+
}, ie();
|
|
809
|
+
}
|
|
810
|
+
Ve[V(390)] = pe;
|
|
811
|
+
function le(e, n) {
|
|
812
|
+
var t = ie();
|
|
813
|
+
return le = function(r, a) {
|
|
814
|
+
r = r - 382;
|
|
815
|
+
var l = t[r];
|
|
816
|
+
return l;
|
|
817
|
+
}, le(e, n);
|
|
818
|
+
}
|
|
819
|
+
var me = {};
|
|
820
|
+
me[V(391)] = V(401), me[V(383)] = Ve;
|
|
821
|
+
var Y = {};
|
|
822
|
+
Y[V(395)] = "userId", Y[V(382)] = V(393), Y[V(388)] = 1, Y[V(396)] = [me];
|
|
823
|
+
const ft = {
|
|
824
|
+
formSchema: Y
|
|
825
|
+
}, yt = Z, { handleData: ht, getData: xe } = yt, { formSchema: he } = ft, ge = async (e, n) => {
|
|
826
|
+
var t;
|
|
827
|
+
return n.parametersType === "url" && (e = {
|
|
828
|
+
...ye.queryToData((t = n.$route) == null ? void 0 : t.query),
|
|
829
|
+
...e
|
|
830
|
+
}), n.parametersType === "indexDB" && (e = {
|
|
831
|
+
...await xe({
|
|
832
|
+
tableName: "formParams",
|
|
833
|
+
propertiesKey: n.$route.path || "defQueryParams",
|
|
834
|
+
primaryKey: n.DBPrimaryKey || "default",
|
|
835
|
+
mapDB: he
|
|
836
|
+
}),
|
|
837
|
+
...e
|
|
838
|
+
}), e;
|
|
839
|
+
}, ve = async (e, n) => {
|
|
840
|
+
n.parametersType === "url" && await n.$router.push({
|
|
841
|
+
query: ye.paramsToQuery({ ...e })
|
|
842
|
+
}), n.parametersType === "indexDB" && await ht({
|
|
843
|
+
tableName: "formParams",
|
|
844
|
+
propertiesKey: n.$route.path || "defQueryParams",
|
|
845
|
+
parameter: { ...e },
|
|
846
|
+
primaryKey: n.DBPrimaryKey || "default",
|
|
847
|
+
mapDB: he
|
|
848
|
+
});
|
|
849
|
+
}, gt = async ({ queryParameter: e = {}, vm: n = {} }) => {
|
|
850
|
+
e.defaultPageFirst ?? (e.defaultPageFirst = !0);
|
|
851
|
+
const t = { [n.currentPageKey]: n.defCurrentPage };
|
|
852
|
+
let r = {
|
|
853
|
+
...t,
|
|
854
|
+
...n.queryParams
|
|
855
|
+
};
|
|
856
|
+
r = await ge(r, n), e.defaultPageFirst && (r = {
|
|
857
|
+
...r,
|
|
858
|
+
...t
|
|
859
|
+
}), await ve(r, n), n.getList({
|
|
860
|
+
...r
|
|
861
|
+
});
|
|
862
|
+
}, vt = async ({ vm: e = {} }) => {
|
|
863
|
+
e.$refs.queryFormRef.resetFields();
|
|
864
|
+
const n = await ge({}, e), t = {
|
|
865
|
+
[e.currentPageKey]: e.defCurrentPage,
|
|
866
|
+
[e.pageSizeKey]: (n == null ? void 0 : n[e.pageSizeKey]) || e.defPageSize
|
|
867
|
+
};
|
|
868
|
+
await ve(t, e), e.queryParams = { ...t }, e.afterReset(), e.handleQuery();
|
|
869
|
+
}, _t = ({ vm: e = {} }) => {
|
|
870
|
+
var n;
|
|
871
|
+
let t = {
|
|
872
|
+
[e.pageSizeKey]: e.defPageSize
|
|
873
|
+
};
|
|
874
|
+
return e.parametersType === "url" && (t = {
|
|
875
|
+
...t,
|
|
876
|
+
...ye.queryToData((n = e.$route) == null ? void 0 : n.query)
|
|
877
|
+
}), e.parametersType === "indexDB" && xe(
|
|
878
|
+
{
|
|
879
|
+
tableName: "formParams",
|
|
880
|
+
propertiesKey: e.$route.path || "defQueryParams",
|
|
881
|
+
primaryKey: e.DBPrimaryKey || "default",
|
|
882
|
+
mapDB: he
|
|
883
|
+
},
|
|
884
|
+
(r) => {
|
|
885
|
+
r && (e.queryParams = { ...t, ...r }), 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
|
+
}, bt = ({ item: e = {}, vm: n = {} }) => {
|
|
893
|
+
const { type: t, rules: r = [] } = e, a = [...r];
|
|
894
|
+
return n.noInputBlank && t === "input" && a.push({
|
|
895
|
+
pattern: /\S/,
|
|
896
|
+
message: "请输入(不能仅输入空格)",
|
|
897
|
+
trigger: "blur"
|
|
898
|
+
}), a;
|
|
899
|
+
}, Pt = {
|
|
900
|
+
makeParamsByType: ge,
|
|
901
|
+
saveParamsByType: ve,
|
|
902
|
+
handleQuery: gt,
|
|
903
|
+
resetQuery: vt,
|
|
904
|
+
initQueryParams: _t,
|
|
905
|
+
getItemRules: bt
|
|
906
|
+
}, ae = Pt, St = q({
|
|
907
|
+
name: "GeneralBasicForm",
|
|
908
|
+
components: {
|
|
909
|
+
Input: te,
|
|
910
|
+
InputNumber: Ge,
|
|
911
|
+
InputGraphicVerification: qe,
|
|
912
|
+
InputMobileVerification: ze,
|
|
913
|
+
Divider: nt,
|
|
914
|
+
Radio: rt,
|
|
915
|
+
Checkbox: at,
|
|
916
|
+
DatePicker: ot,
|
|
917
|
+
Select: st,
|
|
918
|
+
Cascader: it
|
|
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: ae.initQueryParams({
|
|
1009
|
+
vm: this
|
|
1010
|
+
})
|
|
1011
|
+
// form表单数据
|
|
1012
|
+
};
|
|
1013
|
+
},
|
|
1014
|
+
provide() {
|
|
1015
|
+
return {
|
|
1016
|
+
// 显式提供一个计算属性
|
|
1017
|
+
[$e]: {
|
|
1018
|
+
formLoading: H(() => this.formLoading),
|
|
1019
|
+
updateFormLoading: (e) => {
|
|
1020
|
+
this.formLoading = e;
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
// 使用computed保持响应性
|
|
1024
|
+
queryParams: H(() => this.queryParams)
|
|
1025
|
+
};
|
|
1026
|
+
},
|
|
1027
|
+
setup(e) {
|
|
1028
|
+
const { size: n, getList: t } = e;
|
|
1029
|
+
be(
|
|
1030
|
+
/* 注入名 */
|
|
1031
|
+
"size",
|
|
1032
|
+
/* 值 */
|
|
1033
|
+
n
|
|
1034
|
+
), be(
|
|
1035
|
+
/* 注入名 */
|
|
1036
|
+
"getList",
|
|
1037
|
+
/* 值 */
|
|
1038
|
+
t
|
|
1039
|
+
);
|
|
1040
|
+
},
|
|
1041
|
+
watch: {
|
|
1042
|
+
formData: {
|
|
1043
|
+
handler(e, n) {
|
|
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
|
+
ae.handleQuery({
|
|
1071
|
+
queryParameter: e,
|
|
1072
|
+
vm: this
|
|
1073
|
+
});
|
|
1074
|
+
},
|
|
1075
|
+
/** 重置按钮操作 */
|
|
1076
|
+
resetQuery() {
|
|
1077
|
+
ae.resetQuery({
|
|
1078
|
+
vm: this
|
|
1079
|
+
});
|
|
1080
|
+
},
|
|
1081
|
+
getItemRules(e) {
|
|
1082
|
+
return ae.getItemRules({
|
|
1083
|
+
item: e,
|
|
1084
|
+
vm: this
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
function kt(e, n, t, r, a, l) {
|
|
1090
|
+
const s = P("Input"), i = P("Radio"), o = P("Select"), p = P("Divider"), m = P("Cascader"), d = P("Checkbox"), y = P("DatePicker"), h = P("InputNumber"), v = P("InputMobileVerification"), _ = P("InputGraphicVerification"), b = P("el-form-item"), S = P("el-button"), x = P("el-form"), K = ce("loading");
|
|
1091
|
+
return X((u(), f(x, w({
|
|
1092
|
+
model: e.queryParams,
|
|
1093
|
+
ref: "queryFormRef",
|
|
1094
|
+
inline: "",
|
|
1095
|
+
"label-position": "left",
|
|
1096
|
+
"label-width": e.labelWidth
|
|
1097
|
+
}, e.$attrs), {
|
|
1098
|
+
default: I(() => [
|
|
1099
|
+
(u(!0), z(G, null, F(e.formItem, (c) => (u(), f(b, {
|
|
1100
|
+
label: c.label,
|
|
1101
|
+
prop: c.prop,
|
|
1102
|
+
key: c.prop,
|
|
1103
|
+
rules: e.getItemRules(c)
|
|
1104
|
+
}, {
|
|
1105
|
+
default: I(() => [
|
|
1106
|
+
/^input$/i.test(c.type) ? (u(), f(s, {
|
|
1107
|
+
key: 0,
|
|
1108
|
+
item: c
|
|
1109
|
+
}, null, 8, ["item"])) : D("", !0),
|
|
1110
|
+
/^radio$/i.test(c.type) ? (u(), f(i, {
|
|
1111
|
+
key: 1,
|
|
1112
|
+
item: c
|
|
1113
|
+
}, null, 8, ["item"])) : D("", !0),
|
|
1114
|
+
/^select$/i.test(c.type) ? (u(), f(o, {
|
|
1115
|
+
key: 2,
|
|
1116
|
+
item: c
|
|
1117
|
+
}, null, 8, ["item"])) : D("", !0),
|
|
1118
|
+
/^divider$/i.test(c.type) ? (u(), f(p, {
|
|
1119
|
+
key: 3,
|
|
1120
|
+
item: c
|
|
1121
|
+
}, null, 8, ["item"])) : D("", !0),
|
|
1122
|
+
/^cascader$/i.test(c.type) ? (u(), f(m, {
|
|
1123
|
+
key: 4,
|
|
1124
|
+
item: c
|
|
1125
|
+
}, null, 8, ["item"])) : D("", !0),
|
|
1126
|
+
/^checkbox$/i.test(c.type) ? (u(), f(d, {
|
|
1127
|
+
key: 5,
|
|
1128
|
+
item: c
|
|
1129
|
+
}, null, 8, ["item"])) : D("", !0),
|
|
1130
|
+
/^date-picker$/i.test(c.type) ? (u(), f(y, {
|
|
1131
|
+
key: 6,
|
|
1132
|
+
item: c
|
|
1133
|
+
}, null, 8, ["item"])) : D("", !0),
|
|
1134
|
+
/^input-number$/i.test(c.type) ? (u(), f(h, {
|
|
1135
|
+
key: 7,
|
|
1136
|
+
item: c
|
|
1137
|
+
}, null, 8, ["item"])) : D("", !0),
|
|
1138
|
+
/^form-item-slot$/i.test(c.type) ? ue(e.$slots, c.name, { key: 8 }) : D("", !0),
|
|
1139
|
+
/^input-mobile-verification$/i.test(c.type) ? (u(), f(v, {
|
|
1140
|
+
key: 9,
|
|
1141
|
+
item: c
|
|
1142
|
+
}, null, 8, ["item"])) : D("", !0),
|
|
1143
|
+
/^input-graphic-verification$/i.test(c.type) ? (u(), f(_, {
|
|
1144
|
+
item: c,
|
|
1145
|
+
key: c.key
|
|
1146
|
+
}, null, 8, ["item"])) : D("", !0)
|
|
1147
|
+
]),
|
|
1148
|
+
_: 2
|
|
1149
|
+
}, 1032, ["label", "prop", "rules"]))), 128)),
|
|
1150
|
+
ue(e.$slots, "default"),
|
|
1151
|
+
e.formOnly ? D("", !0) : (u(), f(b, { key: 0 }, {
|
|
1152
|
+
default: I(() => [
|
|
1153
|
+
X((u(), f(S, {
|
|
1154
|
+
type: "primary",
|
|
1155
|
+
size: e.size,
|
|
1156
|
+
onClick: e.handleQuery
|
|
1157
|
+
}, {
|
|
1158
|
+
default: I(() => n[0] || (n[0] = [
|
|
1159
|
+
j("查询")
|
|
1160
|
+
])),
|
|
1161
|
+
_: 1
|
|
1162
|
+
}, 8, ["size", "onClick"])), [
|
|
1163
|
+
[K, e.formLoading]
|
|
1164
|
+
]),
|
|
1165
|
+
Ie(S, {
|
|
1166
|
+
size: e.size,
|
|
1167
|
+
onClick: e.resetQuery
|
|
1168
|
+
}, {
|
|
1169
|
+
default: I(() => n[1] || (n[1] = [
|
|
1170
|
+
j("重置")
|
|
1171
|
+
])),
|
|
1172
|
+
_: 1
|
|
1173
|
+
}, 8, ["size", "onClick"])
|
|
1174
|
+
]),
|
|
1175
|
+
_: 1
|
|
1176
|
+
})),
|
|
1177
|
+
ue(e.$slots, "behind-the-button")
|
|
1178
|
+
]),
|
|
1179
|
+
_: 3
|
|
1180
|
+
}, 16, ["model", "label-width"])), [
|
|
1181
|
+
[Ee, e.showSearch]
|
|
1182
|
+
]);
|
|
1183
|
+
}
|
|
1184
|
+
const It = /* @__PURE__ */ U(St, [["render", kt]]), Dt = ["infinite-scroll-disabled"], wt = ["infinite-scroll-disabled"], Bt = { class: "checkbox" }, $t = /* @__PURE__ */ q({
|
|
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: n }) {
|
|
1218
|
+
const t = e, { search: r, id: a, name: l, extra: s, height: i } = t, o = $([]), p = $(1), m = $(!1), d = $([]), y = $(!1), h = (c, B) => {
|
|
1219
|
+
const { i: N } = c;
|
|
1220
|
+
return s && s !== "false" ? s(N) : "";
|
|
1221
|
+
}, v = (c) => {
|
|
1222
|
+
d.value = c.map((B) => typeof B == "object" ? B[a] : B);
|
|
1223
|
+
};
|
|
1224
|
+
De(
|
|
1225
|
+
() => t.defaultSelection,
|
|
1226
|
+
(c = [], B = []) => {
|
|
1227
|
+
v(c);
|
|
1228
|
+
},
|
|
1229
|
+
{ immediate: !0 }
|
|
1230
|
+
);
|
|
1231
|
+
const _ = () => {
|
|
1232
|
+
b(), d.value = [];
|
|
1233
|
+
}, b = () => {
|
|
1234
|
+
p.value = 1, o.value = [], m.value = !1;
|
|
1235
|
+
}, S = async () => {
|
|
1236
|
+
if (y.value || m.value)
|
|
1237
|
+
return;
|
|
1238
|
+
y.value = !0;
|
|
1239
|
+
const c = await r(p.value);
|
|
1240
|
+
c && c.length > 0 ? (o.value = [...o.value, ...c], p.value += 1) : m.value = !0, y.value = !1;
|
|
1241
|
+
}, x = async () => {
|
|
1242
|
+
b(), await S();
|
|
1243
|
+
}, K = H(
|
|
1244
|
+
() => o.value.filter((c) => d.value.includes(c[a]))
|
|
1245
|
+
) || {};
|
|
1246
|
+
return n({
|
|
1247
|
+
reset: _,
|
|
1248
|
+
lowReset: b,
|
|
1249
|
+
loadList: S,
|
|
1250
|
+
selectInfo: K,
|
|
1251
|
+
list: o,
|
|
1252
|
+
ifbottom: m,
|
|
1253
|
+
refreshList: x,
|
|
1254
|
+
loading: y
|
|
1255
|
+
}), (c, B) => {
|
|
1256
|
+
const N = P("el-checkbox"), L = P("el-checkbox-group"), E = ce("infinite-scroll"), Ke = ce("loading");
|
|
1257
|
+
return t.checkbox ? X((u(), f(L, w({
|
|
1258
|
+
key: 0,
|
|
1259
|
+
modelValue: d.value,
|
|
1260
|
+
"onUpdate:modelValue": B[0] || (B[0] = (T) => d.value = T)
|
|
1261
|
+
}, t), {
|
|
1262
|
+
default: I(() => [
|
|
1263
|
+
X((u(), z("ul", {
|
|
1264
|
+
class: "list",
|
|
1265
|
+
"infinite-scroll-disabled": m.value,
|
|
1266
|
+
style: Qe({ height: g(i) })
|
|
1267
|
+
}, [
|
|
1268
|
+
(u(!0), z(G, null, F(o.value, (T) => (u(), z("li", {
|
|
1269
|
+
key: T[g(a)],
|
|
1270
|
+
class: "list-item"
|
|
1271
|
+
}, [
|
|
1272
|
+
Ie(N, {
|
|
1273
|
+
value: T[g(a)],
|
|
1274
|
+
class: "checkbox"
|
|
1275
|
+
}, {
|
|
1276
|
+
default: I(() => [
|
|
1277
|
+
j(J(T[g(l)]) + " ", 1),
|
|
1278
|
+
t.extra ? (u(), f(h, {
|
|
1279
|
+
key: 0,
|
|
1280
|
+
i: T
|
|
1281
|
+
}, null, 8, ["i"])) : D("", !0)
|
|
1282
|
+
]),
|
|
1283
|
+
_: 2
|
|
1284
|
+
}, 1032, ["value"])
|
|
1285
|
+
]))), 128))
|
|
1286
|
+
], 12, Dt)), [
|
|
1287
|
+
[E, S]
|
|
1288
|
+
])
|
|
1289
|
+
]),
|
|
1290
|
+
_: 1
|
|
1291
|
+
}, 16, ["modelValue"])), [
|
|
1292
|
+
[Ke, y.value]
|
|
1293
|
+
]) : X((u(), z("ul", w({
|
|
1294
|
+
key: 1,
|
|
1295
|
+
class: "list",
|
|
1296
|
+
"infinite-scroll-disabled": m.value,
|
|
1297
|
+
style: { height: g(i) }
|
|
1298
|
+
}, t), [
|
|
1299
|
+
(u(!0), z(G, null, F(o.value, (T) => (u(), z("li", {
|
|
1300
|
+
key: T[g(a)],
|
|
1301
|
+
class: "list-item"
|
|
1302
|
+
}, [
|
|
1303
|
+
Re("div", Bt, [
|
|
1304
|
+
j(J(T[g(l)]) + " ", 1),
|
|
1305
|
+
t.extra ? (u(), f(h, {
|
|
1306
|
+
key: 0,
|
|
1307
|
+
i: T
|
|
1308
|
+
}, null, 8, ["i"])) : D("", !0)
|
|
1309
|
+
])
|
|
1310
|
+
]))), 128))
|
|
1311
|
+
], 16, wt)), [
|
|
1312
|
+
[E, S]
|
|
1313
|
+
]);
|
|
1314
|
+
};
|
|
1315
|
+
}
|
|
1316
|
+
});
|
|
1317
|
+
const qt = /* @__PURE__ */ U($t, [["__scopeId", "data-v-3ff9d47e"]]), zt = { key: 1 }, Ct = /* @__PURE__ */ q({
|
|
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 n = e, t = $([]);
|
|
1340
|
+
De(
|
|
1341
|
+
() => [n.formData, n.formItem],
|
|
1342
|
+
([s = {}, i = []]) => {
|
|
1343
|
+
let o = i;
|
|
1344
|
+
if (n.strict)
|
|
1345
|
+
for (const p in s)
|
|
1346
|
+
Object.prototype.hasOwnProperty.call(s, p) && (s[p] || (o = o.filter((d) => d.prop !== p || d.render)));
|
|
1347
|
+
t.value = o;
|
|
1348
|
+
},
|
|
1349
|
+
{ immediate: !0 }
|
|
1350
|
+
);
|
|
1351
|
+
const r = ee("el-descriptions"), a = ee("el-descriptions-item");
|
|
1352
|
+
switch (n.componentType) {
|
|
1353
|
+
case "Element Plus":
|
|
1354
|
+
r.value = "el-descriptions", a.value = "el-descriptions-item";
|
|
1355
|
+
break;
|
|
1356
|
+
case "Ant Design Vue":
|
|
1357
|
+
r.value = "a-descriptions", a.value = "a-descriptions-item";
|
|
1358
|
+
break;
|
|
1359
|
+
}
|
|
1360
|
+
const l = (s, i) => {
|
|
1361
|
+
const { i: o, render: p, formData: m } = s;
|
|
1362
|
+
return p({
|
|
1363
|
+
row: m,
|
|
1364
|
+
$index: o
|
|
1365
|
+
});
|
|
1366
|
+
};
|
|
1367
|
+
return (s, i) => (u(), f(R(r.value), w({
|
|
1368
|
+
column: 1,
|
|
1369
|
+
border: "",
|
|
1370
|
+
class: "form-width"
|
|
1371
|
+
}, s.$attrs), {
|
|
1372
|
+
default: I(() => [
|
|
1373
|
+
(u(!0), z(G, null, F(t.value, (o, p) => (u(), f(R(a.value), w({
|
|
1374
|
+
key: o.prop,
|
|
1375
|
+
label: o.label,
|
|
1376
|
+
ref_for: !0
|
|
1377
|
+
}, o.descriptionsItemProps), {
|
|
1378
|
+
default: I(() => [
|
|
1379
|
+
o.render ? (u(), f(l, {
|
|
1380
|
+
key: 0,
|
|
1381
|
+
i: p,
|
|
1382
|
+
render: o.render,
|
|
1383
|
+
formData: e.formData
|
|
1384
|
+
}, null, 8, ["i", "render", "formData"])) : (u(), z("span", zt, J(e.formData[o.prop]), 1))
|
|
1385
|
+
]),
|
|
1386
|
+
_: 2
|
|
1387
|
+
}, 1040, ["label"]))), 128))
|
|
1388
|
+
]),
|
|
1389
|
+
_: 1
|
|
1390
|
+
}, 16));
|
|
1391
|
+
}
|
|
1392
|
+
}), xt = It, Kt = qt, Nt = Ct, Tt = qe, Ft = ze;
|
|
1393
|
+
export {
|
|
1394
|
+
Nt as VDescriptions,
|
|
1395
|
+
xt as VGeneralBasicForm,
|
|
1396
|
+
Kt as VInfiniteScrollList,
|
|
1397
|
+
Tt as VInputGraphicVerification,
|
|
1398
|
+
Ft as VInputMobilecVerification
|
|
1399
|
+
};
|