general-basic-form 2.0.11 → 2.0.13
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 +71 -2
- package/dist/index.js +688 -0
- package/dist/index.umd.cjs +1 -0
- package/dist/style.css +1 -0
- package/package.json +14 -3
- package/README.assets/image-20210820173738506.png +0 -0
- package/script/link.ts +0 -36
- package/script/unlink.ts +0 -45
- package/src/GeneralBasicForm.vue +0 -246
- package/src/assets/image-20210820173037871.png +0 -0
- package/src/assets/logo.png +0 -0
- package/src/components/VBasic/cascader/index.vue +0 -31
- package/src/components/VBasic/date-picker/index.vue +0 -30
- package/src/components/VBasic/divider/index.vue +0 -52
- package/src/components/VBasic/input/index.vue +0 -67
- package/src/components/VBasic/input-graphic-verification/index.vue +0 -56
- package/src/components/VBasic/input-mobile-verification/index.vue +0 -31
- package/src/components/VBasic/input-mobile-verification/verification-button.vue +0 -64
- package/src/components/VBasic/input-number/index.vue +0 -30
- package/src/components/VBasic/radio/index.vue +0 -40
- package/src/components/VBasic/select/index.vue +0 -37
- package/src/components/setting.ts +0 -28
- package/src/index.ts +0 -15
- package/src/injectKey.ts +0 -2
- package/src/types/basicFrom.ts +0 -53
- package/src/types/componentsProps.ts +0 -17
- 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,688 @@
|
|
|
1
|
+
import { defineComponent as g, inject as v, resolveComponent as c, openBlock as o, createBlock as u, mergeProps as k, withKeys as X, createSlots as x, renderList as z, withCtx as f, resolveDynamicComponent as K, createCommentVNode as b, ref as y, unref as m, resolveDirective as U, withDirectives as D, createElementBlock as P, createVNode as O, createElementVNode as Y, computed as Q, onBeforeUnmount as Z, normalizeStyle as ee, createTextVNode as V, toDisplayString as w, h as te, normalizeProps as ne, guardReactiveProps as oe, Fragment as F, provide as A, renderSlot as j, vShow as re } from "vue";
|
|
2
|
+
import { useRoute as se } from "vue-router";
|
|
3
|
+
const M = {
|
|
4
|
+
placeholder: "请输入",
|
|
5
|
+
style: "width: 200px",
|
|
6
|
+
clearable: !0
|
|
7
|
+
}, ie = {
|
|
8
|
+
style: "width: 227px",
|
|
9
|
+
"start-placeholder": "开始日期",
|
|
10
|
+
"end-placeholder": "结束日期",
|
|
11
|
+
type: "daterange"
|
|
12
|
+
}, W = {
|
|
13
|
+
placeholder: "请选择",
|
|
14
|
+
filterable: !0,
|
|
15
|
+
clearable: !0,
|
|
16
|
+
style: "width: 200px"
|
|
17
|
+
}, ae = g({
|
|
18
|
+
components: {
|
|
19
|
+
InputArchive: (e) => {
|
|
20
|
+
const { templateEle: n } = e;
|
|
21
|
+
return n();
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
item: null
|
|
26
|
+
// null就是any
|
|
27
|
+
},
|
|
28
|
+
setup() {
|
|
29
|
+
const e = v("queryParams", {}), n = v("getList"), t = v("size");
|
|
30
|
+
return { queryParams: e, getList: n, size: t };
|
|
31
|
+
},
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
inputSetting: {
|
|
35
|
+
...M,
|
|
36
|
+
...this.item.inputSetting
|
|
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
|
+
}), I = (e, n) => {
|
|
58
|
+
const t = e.__vccOpts || e;
|
|
59
|
+
for (const [l, s] of n)
|
|
60
|
+
t[l] = s;
|
|
61
|
+
return t;
|
|
62
|
+
};
|
|
63
|
+
function le(e, n, t, l, s, a) {
|
|
64
|
+
const r = c("el-input");
|
|
65
|
+
return o(), u(r, k({
|
|
66
|
+
onKeydown: X(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), x({ _: 2 }, [
|
|
71
|
+
z(e.item.template, (i, d) => ({
|
|
72
|
+
name: d,
|
|
73
|
+
fn: f(() => [
|
|
74
|
+
i ? (o(), u(K(e.currentInputComponent()), {
|
|
75
|
+
key: d,
|
|
76
|
+
templateEle: i
|
|
77
|
+
}, null, 8, ["templateEle"])) : b("", !0)
|
|
78
|
+
])
|
|
79
|
+
}))
|
|
80
|
+
]), 1040, ["onKeydown", "modelValue", "size"]);
|
|
81
|
+
}
|
|
82
|
+
const T = /* @__PURE__ */ I(ae, [["render", le]]), ue = /* @__PURE__ */ g({
|
|
83
|
+
__name: "index",
|
|
84
|
+
props: {
|
|
85
|
+
item: {}
|
|
86
|
+
},
|
|
87
|
+
setup(e) {
|
|
88
|
+
const { item: n } = e, t = v("queryParams", {}), l = v("size"), s = y({
|
|
89
|
+
...M,
|
|
90
|
+
...n.inputSetting
|
|
91
|
+
});
|
|
92
|
+
return (a, r) => {
|
|
93
|
+
const i = c("el-input-number");
|
|
94
|
+
return o(), u(i, k({
|
|
95
|
+
modelValue: m(t)[a.item.prop],
|
|
96
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => m(t)[a.item.prop] = d),
|
|
97
|
+
size: m(l)
|
|
98
|
+
}, s.value), null, 16, ["modelValue", "size"]);
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}), H = Symbol(), ce = { class: "input-graphic-verification" }, pe = ["src"], me = /* @__PURE__ */ g({
|
|
102
|
+
__name: "index",
|
|
103
|
+
props: {
|
|
104
|
+
item: {}
|
|
105
|
+
},
|
|
106
|
+
setup(e) {
|
|
107
|
+
const { item: n } = e, { graphicSrc: t = "", getGraphic: l = () => {
|
|
108
|
+
} } = n, { formLoading: s, updateFormLoading: a } = v(H), r = async () => {
|
|
109
|
+
l && !s.value && await l();
|
|
110
|
+
};
|
|
111
|
+
return (i, d) => {
|
|
112
|
+
const _ = U("loading");
|
|
113
|
+
return D((o(), P("div", ce, [
|
|
114
|
+
O(T, {
|
|
115
|
+
item: i.item,
|
|
116
|
+
class: "input"
|
|
117
|
+
}, null, 8, ["item"]),
|
|
118
|
+
Y("img", {
|
|
119
|
+
class: "graphic",
|
|
120
|
+
onClick: r,
|
|
121
|
+
src: m(t)
|
|
122
|
+
}, null, 8, pe)
|
|
123
|
+
])), [
|
|
124
|
+
[_, m(s)]
|
|
125
|
+
]);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
const de = /* @__PURE__ */ I(me, [["__scopeId", "data-v-500ec9b0"]]), C = "获取验证码", _e = 60, fe = /* @__PURE__ */ g({
|
|
130
|
+
__name: "verification-button",
|
|
131
|
+
props: {
|
|
132
|
+
getSmscode: { type: Function }
|
|
133
|
+
},
|
|
134
|
+
setup(e) {
|
|
135
|
+
const { getSmscode: n } = e, t = y(C), l = y(null), s = Q(() => t.value === C), a = () => {
|
|
136
|
+
l && (clearInterval(l.value), l.value = null, t.value = C);
|
|
137
|
+
}, r = async () => {
|
|
138
|
+
if (t.value === C)
|
|
139
|
+
if (t.value = _e, l.value = setInterval(() => {
|
|
140
|
+
if (Number(t.value) <= 0 || !t.value) {
|
|
141
|
+
a();
|
|
142
|
+
return;
|
|
143
|
+
} else
|
|
144
|
+
t.value = Number(t.value) - 1;
|
|
145
|
+
}, 1e3), n)
|
|
146
|
+
await n() === !1 && a();
|
|
147
|
+
else
|
|
148
|
+
return;
|
|
149
|
+
};
|
|
150
|
+
return Z(() => {
|
|
151
|
+
a();
|
|
152
|
+
}), (i, d) => {
|
|
153
|
+
const _ = c("el-button");
|
|
154
|
+
return o(), u(_, {
|
|
155
|
+
class: "verifiaction-button",
|
|
156
|
+
style: ee({
|
|
157
|
+
color: s.value ? "var(--color-primary, #409EFF)" : "var(--text-color-placeholder, #A8ABB2)",
|
|
158
|
+
cursor: s.value ? "pointer" : "default"
|
|
159
|
+
}),
|
|
160
|
+
onClick: r
|
|
161
|
+
}, {
|
|
162
|
+
default: f(() => [
|
|
163
|
+
V(w(s.value ? C : t.value + "s"), 1)
|
|
164
|
+
]),
|
|
165
|
+
_: 1
|
|
166
|
+
}, 8, ["style"]);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
const ye = /* @__PURE__ */ I(fe, [["__scopeId", "data-v-4074e137"]]), ve = /* @__PURE__ */ g({
|
|
171
|
+
__name: "index",
|
|
172
|
+
props: {
|
|
173
|
+
item: {}
|
|
174
|
+
},
|
|
175
|
+
setup(e) {
|
|
176
|
+
const { item: n } = e, t = n;
|
|
177
|
+
return t.template = {
|
|
178
|
+
append: () => te(ye, {
|
|
179
|
+
getSmscode: t.getSmscode
|
|
180
|
+
})
|
|
181
|
+
}, (l, s) => (o(), u(T, {
|
|
182
|
+
item: m(t),
|
|
183
|
+
class: "input"
|
|
184
|
+
}, null, 8, ["item"]));
|
|
185
|
+
}
|
|
186
|
+
}), ge = g({
|
|
187
|
+
components: {
|
|
188
|
+
slotArchive: (e) => {
|
|
189
|
+
const { templateEle: n } = e;
|
|
190
|
+
return n();
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
props: {
|
|
194
|
+
item: null
|
|
195
|
+
// null就是any
|
|
196
|
+
},
|
|
197
|
+
setup() {
|
|
198
|
+
},
|
|
199
|
+
data() {
|
|
200
|
+
return {
|
|
201
|
+
dividerSetting: {
|
|
202
|
+
...this.item.dividerSetting
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
},
|
|
206
|
+
methods: {
|
|
207
|
+
currentInputComponent() {
|
|
208
|
+
return "slot-archive";
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
function he(e, n, t, l, s, a) {
|
|
213
|
+
const r = c("el-divider");
|
|
214
|
+
return o(), u(r, ne(oe(e.dividerSetting)), x({ _: 2 }, [
|
|
215
|
+
z(e.item.template, (i, d) => ({
|
|
216
|
+
name: d,
|
|
217
|
+
fn: f(() => [
|
|
218
|
+
i ? (o(), u(K(e.currentInputComponent()), {
|
|
219
|
+
key: d,
|
|
220
|
+
templateEle: i
|
|
221
|
+
}, null, 8, ["templateEle"])) : b("", !0)
|
|
222
|
+
])
|
|
223
|
+
}))
|
|
224
|
+
]), 1040);
|
|
225
|
+
}
|
|
226
|
+
const be = /* @__PURE__ */ I(ge, [["render", he]]), ke = /* @__PURE__ */ g({
|
|
227
|
+
__name: "index",
|
|
228
|
+
props: {
|
|
229
|
+
item: {}
|
|
230
|
+
},
|
|
231
|
+
setup(e) {
|
|
232
|
+
const { item: n } = e, t = v("queryParams", {}), l = v("size"), s = y({
|
|
233
|
+
...n.radioSetting
|
|
234
|
+
}), a = y({
|
|
235
|
+
...n.radioGroupSetting
|
|
236
|
+
});
|
|
237
|
+
return (r, i) => {
|
|
238
|
+
const d = c("el-radio"), _ = c("el-radio-group");
|
|
239
|
+
return o(), u(_, k({
|
|
240
|
+
modelValue: m(t)[r.item.prop],
|
|
241
|
+
"onUpdate:modelValue": i[0] || (i[0] = (h) => m(t)[r.item.prop] = h),
|
|
242
|
+
size: m(l)
|
|
243
|
+
}, a.value), {
|
|
244
|
+
default: f(() => [
|
|
245
|
+
(o(!0), P(F, null, z(r.item.option || [], (h) => (o(), u(d, k({
|
|
246
|
+
size: m(l),
|
|
247
|
+
label: h.label,
|
|
248
|
+
key: h.label
|
|
249
|
+
}, s.value), {
|
|
250
|
+
default: f(() => [
|
|
251
|
+
V(w(h.value), 1)
|
|
252
|
+
]),
|
|
253
|
+
_: 2
|
|
254
|
+
}, 1040, ["size", "label"]))), 128))
|
|
255
|
+
]),
|
|
256
|
+
_: 1
|
|
257
|
+
}, 16, ["modelValue", "size"]);
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
}), Se = /* @__PURE__ */ g({
|
|
261
|
+
__name: "index",
|
|
262
|
+
props: {
|
|
263
|
+
item: {}
|
|
264
|
+
},
|
|
265
|
+
setup(e) {
|
|
266
|
+
const { item: n } = e, t = v("queryParams", {}), l = v("size"), s = y({
|
|
267
|
+
...ie,
|
|
268
|
+
...n.datePackerSetting
|
|
269
|
+
});
|
|
270
|
+
return (a, r) => {
|
|
271
|
+
const i = c("el-date-picker");
|
|
272
|
+
return o(), u(i, k({
|
|
273
|
+
modelValue: m(t)[a.item.prop],
|
|
274
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => m(t)[a.item.prop] = d),
|
|
275
|
+
size: m(l)
|
|
276
|
+
}, s.value), null, 16, ["modelValue", "size"]);
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
}), Pe = /* @__PURE__ */ g({
|
|
280
|
+
__name: "index",
|
|
281
|
+
props: {
|
|
282
|
+
item: {}
|
|
283
|
+
},
|
|
284
|
+
setup(e) {
|
|
285
|
+
const { item: n } = e, t = v("queryParams", {}), l = v("size"), s = y({
|
|
286
|
+
...W,
|
|
287
|
+
...n.selectSetting
|
|
288
|
+
});
|
|
289
|
+
return (a, r) => {
|
|
290
|
+
const i = c("el-option"), d = c("el-select");
|
|
291
|
+
return o(), u(d, k({
|
|
292
|
+
modelValue: m(t)[a.item.prop],
|
|
293
|
+
"onUpdate:modelValue": r[0] || (r[0] = (_) => m(t)[a.item.prop] = _),
|
|
294
|
+
size: m(l)
|
|
295
|
+
}, s.value), {
|
|
296
|
+
default: f(() => [
|
|
297
|
+
(o(!0), P(F, null, z(a.item.option || [], (_) => (o(), u(i, {
|
|
298
|
+
key: _.value,
|
|
299
|
+
label: _.label,
|
|
300
|
+
value: _.value
|
|
301
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
302
|
+
]),
|
|
303
|
+
_: 1
|
|
304
|
+
}, 16, ["modelValue", "size"]);
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
}), ze = /* @__PURE__ */ g({
|
|
308
|
+
__name: "index",
|
|
309
|
+
props: {
|
|
310
|
+
item: {}
|
|
311
|
+
},
|
|
312
|
+
setup(e) {
|
|
313
|
+
const { item: n } = e, t = v("queryParams", {}), l = v("size"), s = y({
|
|
314
|
+
...W,
|
|
315
|
+
...n.selectSetting
|
|
316
|
+
});
|
|
317
|
+
return (a, r) => {
|
|
318
|
+
const i = c("el-cascader");
|
|
319
|
+
return o(), u(i, k({
|
|
320
|
+
modelValue: m(t)[a.item.prop],
|
|
321
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => m(t)[a.item.prop] = d),
|
|
322
|
+
size: m(l),
|
|
323
|
+
options: a.item.options || []
|
|
324
|
+
}, s.value), null, 16, ["modelValue", "size", "options"]);
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
}), $e = g({
|
|
328
|
+
name: "GeneralBasicForm",
|
|
329
|
+
components: {
|
|
330
|
+
Input: T,
|
|
331
|
+
InputNumber: ue,
|
|
332
|
+
InputGraphicVerification: de,
|
|
333
|
+
InputMobileVerification: ve,
|
|
334
|
+
Divider: be,
|
|
335
|
+
Radio: ke,
|
|
336
|
+
DatePicker: Se,
|
|
337
|
+
Select: Pe,
|
|
338
|
+
Cascader: ze
|
|
339
|
+
},
|
|
340
|
+
props: {
|
|
341
|
+
showSearch: {
|
|
342
|
+
// 是否展示所有元素
|
|
343
|
+
type: Boolean,
|
|
344
|
+
default: !0
|
|
345
|
+
},
|
|
346
|
+
loading: {
|
|
347
|
+
// 加载动画
|
|
348
|
+
type: Boolean,
|
|
349
|
+
default: !1
|
|
350
|
+
},
|
|
351
|
+
formOnly: {
|
|
352
|
+
// 是否只展示表单不展示按钮
|
|
353
|
+
type: Boolean,
|
|
354
|
+
default: !1
|
|
355
|
+
},
|
|
356
|
+
getList: {
|
|
357
|
+
// 查找数据调用的函数
|
|
358
|
+
type: Function,
|
|
359
|
+
default: () => {
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
afterReset: {
|
|
363
|
+
// 在重置按钮点击完后但还没重新请求时触发的的函数
|
|
364
|
+
type: Function,
|
|
365
|
+
default: () => {
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
formItem: {
|
|
369
|
+
// 定义表单的数据
|
|
370
|
+
type: Array,
|
|
371
|
+
default: []
|
|
372
|
+
},
|
|
373
|
+
size: {
|
|
374
|
+
// 控制按钮大小
|
|
375
|
+
type: String,
|
|
376
|
+
default: "default"
|
|
377
|
+
},
|
|
378
|
+
labelWidth: {
|
|
379
|
+
// 表单文字宽度
|
|
380
|
+
type: String,
|
|
381
|
+
default: "90px"
|
|
382
|
+
},
|
|
383
|
+
noUrlParameters: {
|
|
384
|
+
// 不接受和不改变url的参数
|
|
385
|
+
type: Boolean,
|
|
386
|
+
default: () => !1
|
|
387
|
+
},
|
|
388
|
+
formData: {
|
|
389
|
+
// 外部传入的表单数据,用于回填
|
|
390
|
+
type: Object,
|
|
391
|
+
default: () => {
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
data() {
|
|
396
|
+
return {
|
|
397
|
+
formLoading: this.loading || !1
|
|
398
|
+
};
|
|
399
|
+
},
|
|
400
|
+
setup(e) {
|
|
401
|
+
const { size: n, noUrlParameters: t, getList: l } = e, s = se(), a = y({
|
|
402
|
+
...t ? {} : s == null ? void 0 : s.query
|
|
403
|
+
});
|
|
404
|
+
return A(
|
|
405
|
+
/* 注入名 */
|
|
406
|
+
"queryParams",
|
|
407
|
+
/* 值 */
|
|
408
|
+
a
|
|
409
|
+
), A(
|
|
410
|
+
/* 注入名 */
|
|
411
|
+
"size",
|
|
412
|
+
/* 值 */
|
|
413
|
+
n
|
|
414
|
+
), A(
|
|
415
|
+
/* 注入名 */
|
|
416
|
+
"getList",
|
|
417
|
+
/* 值 */
|
|
418
|
+
l
|
|
419
|
+
), {
|
|
420
|
+
queryParams: a
|
|
421
|
+
};
|
|
422
|
+
},
|
|
423
|
+
watch: {
|
|
424
|
+
formData: {
|
|
425
|
+
handler(e) {
|
|
426
|
+
this.queryParams = {
|
|
427
|
+
...this.noUrlParameters ? {} : this.queryParams,
|
|
428
|
+
...e
|
|
429
|
+
};
|
|
430
|
+
},
|
|
431
|
+
// watch 默认是懒执行的:仅当数据源变化时,才会执行回调。但在某些场景中,我们希望在创建侦听器时,立即执行一遍回调。举例来说,我们想请求一些初始数据,然后在相关状态更改时重新请求数据。
|
|
432
|
+
// https://cn.vuejs.org/guide/essentials/watchers.html#deep-watchers
|
|
433
|
+
immediate: !0
|
|
434
|
+
// deep: true,
|
|
435
|
+
},
|
|
436
|
+
loading(e) {
|
|
437
|
+
this.formLoading !== e && (this.formLoading = e);
|
|
438
|
+
},
|
|
439
|
+
formLoading(e) {
|
|
440
|
+
this.loading !== e && this.$emit("update:loading", e);
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
provide() {
|
|
444
|
+
return {
|
|
445
|
+
// 显式提供一个计算属性
|
|
446
|
+
[H]: {
|
|
447
|
+
formLoading: Q(() => this.formLoading),
|
|
448
|
+
updateFormLoading: (e) => {
|
|
449
|
+
this.formLoading = e;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
},
|
|
454
|
+
methods: {
|
|
455
|
+
/** 搜索按钮操作 */
|
|
456
|
+
handleQuery() {
|
|
457
|
+
var t;
|
|
458
|
+
const e = { page: 1, limit: 10 }, n = {
|
|
459
|
+
...(t = this.$route) == null ? void 0 : t.query,
|
|
460
|
+
...this.queryParams,
|
|
461
|
+
...e
|
|
462
|
+
};
|
|
463
|
+
this.noUrlParameters || this.$router.push({
|
|
464
|
+
query: { ...n }
|
|
465
|
+
}), this.getList({
|
|
466
|
+
...n
|
|
467
|
+
});
|
|
468
|
+
},
|
|
469
|
+
/** 重置按钮操作 */
|
|
470
|
+
async resetQuery() {
|
|
471
|
+
var n;
|
|
472
|
+
this.$refs.queryFormRef.resetFields();
|
|
473
|
+
const e = { page: 1 };
|
|
474
|
+
this.noUrlParameters || await this.$router.push({
|
|
475
|
+
query: { ...e }
|
|
476
|
+
}), this.queryParams = {
|
|
477
|
+
...this.noUrlParameters ? {} : (n = this.$route) == null ? void 0 : n.query
|
|
478
|
+
}, this.afterReset(), this.handleQuery();
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
function qe(e, n, t, l, s, a) {
|
|
483
|
+
const r = c("Input"), i = c("Radio"), d = c("Select"), _ = c("Divider"), h = c("Cascader"), $ = c("DatePicker"), G = c("InputNumber"), B = c("InputMobileVerification"), N = c("InputGraphicVerification"), S = c("el-form-item"), L = c("el-button"), R = c("el-form"), E = U("loading");
|
|
484
|
+
return D((o(), u(R, k({
|
|
485
|
+
model: e.queryParams,
|
|
486
|
+
ref: "queryFormRef",
|
|
487
|
+
inline: "",
|
|
488
|
+
"label-position": "left",
|
|
489
|
+
"label-width": e.labelWidth
|
|
490
|
+
}, e.$attrs), {
|
|
491
|
+
default: f(() => [
|
|
492
|
+
(o(!0), P(F, null, z(e.formItem, (p) => (o(), u(S, {
|
|
493
|
+
label: p.label,
|
|
494
|
+
prop: p.prop,
|
|
495
|
+
key: p.prop,
|
|
496
|
+
rules: p.rules
|
|
497
|
+
}, {
|
|
498
|
+
default: f(() => [
|
|
499
|
+
p.type === "input" ? (o(), u(r, {
|
|
500
|
+
key: 0,
|
|
501
|
+
item: p
|
|
502
|
+
}, null, 8, ["item"])) : b("", !0),
|
|
503
|
+
p.type === "radio" ? (o(), u(i, {
|
|
504
|
+
key: 1,
|
|
505
|
+
item: p
|
|
506
|
+
}, null, 8, ["item"])) : b("", !0),
|
|
507
|
+
p.type === "select" ? (o(), u(d, {
|
|
508
|
+
key: 2,
|
|
509
|
+
item: p
|
|
510
|
+
}, null, 8, ["item"])) : b("", !0),
|
|
511
|
+
p.type === "divider" ? (o(), u(_, {
|
|
512
|
+
key: 3,
|
|
513
|
+
item: p
|
|
514
|
+
}, null, 8, ["item"])) : b("", !0),
|
|
515
|
+
p.type === "cascader" ? (o(), u(h, {
|
|
516
|
+
key: 4,
|
|
517
|
+
item: p
|
|
518
|
+
}, null, 8, ["item"])) : b("", !0),
|
|
519
|
+
p.type === "date-picker" ? (o(), u($, {
|
|
520
|
+
key: 5,
|
|
521
|
+
item: p
|
|
522
|
+
}, null, 8, ["item"])) : b("", !0),
|
|
523
|
+
p.type === "input-number" ? (o(), u(G, {
|
|
524
|
+
key: 6,
|
|
525
|
+
item: p
|
|
526
|
+
}, null, 8, ["item"])) : b("", !0),
|
|
527
|
+
p.type === "input-mobile-verification" ? (o(), u(B, {
|
|
528
|
+
key: 7,
|
|
529
|
+
item: p
|
|
530
|
+
}, null, 8, ["item"])) : b("", !0),
|
|
531
|
+
p.type === "input-graphic-verification" ? (o(), u(N, {
|
|
532
|
+
item: p,
|
|
533
|
+
key: p.key
|
|
534
|
+
}, null, 8, ["item"])) : b("", !0)
|
|
535
|
+
]),
|
|
536
|
+
_: 2
|
|
537
|
+
}, 1032, ["label", "prop", "rules"]))), 128)),
|
|
538
|
+
j(e.$slots, "default"),
|
|
539
|
+
e.formOnly ? b("", !0) : (o(), u(S, { key: 0 }, {
|
|
540
|
+
default: f(() => [
|
|
541
|
+
D((o(), u(L, {
|
|
542
|
+
type: "primary",
|
|
543
|
+
size: e.size,
|
|
544
|
+
onClick: e.handleQuery
|
|
545
|
+
}, {
|
|
546
|
+
default: f(() => [
|
|
547
|
+
V("查询")
|
|
548
|
+
]),
|
|
549
|
+
_: 1
|
|
550
|
+
}, 8, ["size", "onClick"])), [
|
|
551
|
+
[E, e.formLoading]
|
|
552
|
+
]),
|
|
553
|
+
O(L, {
|
|
554
|
+
size: e.size,
|
|
555
|
+
onClick: e.resetQuery
|
|
556
|
+
}, {
|
|
557
|
+
default: f(() => [
|
|
558
|
+
V("重置")
|
|
559
|
+
]),
|
|
560
|
+
_: 1
|
|
561
|
+
}, 8, ["size", "onClick"])
|
|
562
|
+
]),
|
|
563
|
+
_: 1
|
|
564
|
+
})),
|
|
565
|
+
j(e.$slots, "behind-the-button")
|
|
566
|
+
]),
|
|
567
|
+
_: 3
|
|
568
|
+
}, 16, ["model", "label-width"])), [
|
|
569
|
+
[re, e.showSearch]
|
|
570
|
+
]);
|
|
571
|
+
}
|
|
572
|
+
const Ve = /* @__PURE__ */ I($e, [["render", qe]]), Ie = ["infinite-scroll-disabled"], Le = /* @__PURE__ */ g({
|
|
573
|
+
__name: "InfiniteScrollList",
|
|
574
|
+
props: {
|
|
575
|
+
search: {
|
|
576
|
+
type: Function,
|
|
577
|
+
required: !0
|
|
578
|
+
},
|
|
579
|
+
id: {
|
|
580
|
+
type: String,
|
|
581
|
+
required: !0
|
|
582
|
+
},
|
|
583
|
+
name: {
|
|
584
|
+
type: String,
|
|
585
|
+
required: !0
|
|
586
|
+
},
|
|
587
|
+
extra: {
|
|
588
|
+
type: Function,
|
|
589
|
+
required: !1
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
setup(e, { expose: n }) {
|
|
593
|
+
const t = e, { search: l, id: s, name: a, extra: r } = t, i = y([]), d = y(1), _ = y(!1), h = y([]), $ = y(!1), G = () => {
|
|
594
|
+
d.value = 1, i.value = [], h.value = [], _.value = !1;
|
|
595
|
+
}, B = async () => {
|
|
596
|
+
if ($.value || _.value)
|
|
597
|
+
return;
|
|
598
|
+
$.value = !0;
|
|
599
|
+
const S = await l(d.value);
|
|
600
|
+
S && S.length > 0 ? (i.value = [...i.value, ...S], d.value += 1) : _.value = !0, $.value = !1;
|
|
601
|
+
}, N = Q(
|
|
602
|
+
() => i.value.filter((S) => h.value.includes(S[s]))
|
|
603
|
+
) || {};
|
|
604
|
+
return n({ reset: G, loadList: B, selectInfo: N }), (S, L) => {
|
|
605
|
+
const R = c("el-checkbox"), E = c("el-checkbox-group"), p = U("infinite-scroll"), J = U("loading");
|
|
606
|
+
return D((o(), u(E, k({
|
|
607
|
+
modelValue: h.value,
|
|
608
|
+
"onUpdate:modelValue": L[0] || (L[0] = (q) => h.value = q)
|
|
609
|
+
}, t), {
|
|
610
|
+
default: f(() => [
|
|
611
|
+
D((o(), P("ul", {
|
|
612
|
+
class: "list",
|
|
613
|
+
"infinite-scroll-disabled": _.value
|
|
614
|
+
}, [
|
|
615
|
+
(o(!0), P(F, null, z(i.value, (q) => (o(), P("li", {
|
|
616
|
+
key: q[m(s)],
|
|
617
|
+
class: "list-item"
|
|
618
|
+
}, [
|
|
619
|
+
O(R, {
|
|
620
|
+
label: q[m(s)],
|
|
621
|
+
class: "checkbox"
|
|
622
|
+
}, {
|
|
623
|
+
default: f(() => [
|
|
624
|
+
V(w(q[m(a)]) + " " + w(m(r) && m(r)(q)), 1)
|
|
625
|
+
]),
|
|
626
|
+
_: 2
|
|
627
|
+
}, 1032, ["label"])
|
|
628
|
+
]))), 128))
|
|
629
|
+
], 8, Ie)), [
|
|
630
|
+
[p, B]
|
|
631
|
+
])
|
|
632
|
+
]),
|
|
633
|
+
_: 1
|
|
634
|
+
}, 16, ["modelValue"])), [
|
|
635
|
+
[J, $.value]
|
|
636
|
+
]);
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
const Ce = /* @__PURE__ */ I(Le, [["__scopeId", "data-v-fda8f794"]]), De = /* @__PURE__ */ g({
|
|
641
|
+
__name: "Descriptions",
|
|
642
|
+
props: {
|
|
643
|
+
formData: {
|
|
644
|
+
type: Object,
|
|
645
|
+
required: !0
|
|
646
|
+
},
|
|
647
|
+
descriptionsItemProps: {
|
|
648
|
+
type: Object,
|
|
649
|
+
required: !1
|
|
650
|
+
},
|
|
651
|
+
formItem: {
|
|
652
|
+
type: Array,
|
|
653
|
+
required: !0
|
|
654
|
+
}
|
|
655
|
+
},
|
|
656
|
+
setup(e) {
|
|
657
|
+
const n = e;
|
|
658
|
+
return (t, l) => {
|
|
659
|
+
const s = c("el-descriptions-item"), a = c("el-descriptions");
|
|
660
|
+
return o(), u(a, k({
|
|
661
|
+
column: 1,
|
|
662
|
+
border: "",
|
|
663
|
+
class: "form-width"
|
|
664
|
+
}, n), {
|
|
665
|
+
default: f(() => [
|
|
666
|
+
(o(!0), P(F, null, z(n.formItem, (r, i) => (o(), u(s, k({
|
|
667
|
+
key: r.prop,
|
|
668
|
+
label: r.label
|
|
669
|
+
}, n.descriptionsItemProps), {
|
|
670
|
+
default: f(() => [
|
|
671
|
+
V(w(r.render ? r.render({
|
|
672
|
+
row: e.formData,
|
|
673
|
+
$index: i
|
|
674
|
+
}) : e.formData[r.prop]), 1)
|
|
675
|
+
]),
|
|
676
|
+
_: 2
|
|
677
|
+
}, 1040, ["label"]))), 128))
|
|
678
|
+
]),
|
|
679
|
+
_: 1
|
|
680
|
+
}, 16);
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
}), Be = Ve, Ue = Ce, Ge = De;
|
|
684
|
+
export {
|
|
685
|
+
Ge as VDescriptions,
|
|
686
|
+
Be as VGeneralBasicForm,
|
|
687
|
+
Ue as VInfiniteScrollList
|
|
688
|
+
};
|