general-basic-form 2.0.13 → 2.0.15
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 +10 -0
- package/dist/index.js +134 -133
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -248,6 +248,16 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
248
248
|
}
|
|
249
249
|
]
|
|
250
250
|
},
|
|
251
|
+
{
|
|
252
|
+
label: '受访人',
|
|
253
|
+
prop: 'contactors',
|
|
254
|
+
type: 'form-item-slot',
|
|
255
|
+
name: "contactors"
|
|
256
|
+
// 插槽组件使用:
|
|
257
|
+
// <VGeneralBasicForm ...>
|
|
258
|
+
// <template #contactors> <div>一些组件</div></template>
|
|
259
|
+
// </VGeneralBasicForm>
|
|
260
|
+
},
|
|
251
261
|
{
|
|
252
262
|
label: "分类",
|
|
253
263
|
prop: "分类",
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as h, inject as v, resolveComponent as p, openBlock as o, createBlock as u, mergeProps as k, withKeys as X, createSlots as K, renderList as z, withCtx as f, resolveDynamicComponent as x, createCommentVNode as g, ref as y, unref as m, resolveDirective as U, withDirectives as D, createElementBlock as P, createVNode as Q, createElementVNode as Y, computed as T, 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 O, vShow as re } from "vue";
|
|
2
2
|
import { useRoute as se } from "vue-router";
|
|
3
3
|
const M = {
|
|
4
4
|
placeholder: "请输入",
|
|
5
5
|
style: "width: 200px",
|
|
6
6
|
clearable: !0
|
|
7
|
-
},
|
|
7
|
+
}, ae = {
|
|
8
8
|
style: "width: 227px",
|
|
9
9
|
"start-placeholder": "开始日期",
|
|
10
10
|
"end-placeholder": "结束日期",
|
|
@@ -14,7 +14,7 @@ const M = {
|
|
|
14
14
|
filterable: !0,
|
|
15
15
|
clearable: !0,
|
|
16
16
|
style: "width: 200px"
|
|
17
|
-
},
|
|
17
|
+
}, ie = h({
|
|
18
18
|
components: {
|
|
19
19
|
InputArchive: (e) => {
|
|
20
20
|
const { templateEle: n } = e;
|
|
@@ -60,26 +60,26 @@ const M = {
|
|
|
60
60
|
t[l] = s;
|
|
61
61
|
return t;
|
|
62
62
|
};
|
|
63
|
-
function le(e, n, t, l, s,
|
|
64
|
-
const r =
|
|
63
|
+
function le(e, n, t, l, s, i) {
|
|
64
|
+
const r = p("el-input");
|
|
65
65
|
return o(), u(r, k({
|
|
66
66
|
onKeydown: X(e.getList, ["enter"]),
|
|
67
67
|
modelValue: e.queryParams[e.item.prop],
|
|
68
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
68
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => e.queryParams[e.item.prop] = a),
|
|
69
69
|
size: e.size
|
|
70
|
-
}, e.inputSetting),
|
|
71
|
-
z(e.item.template, (
|
|
70
|
+
}, e.inputSetting), K({ _: 2 }, [
|
|
71
|
+
z(e.item.template, (a, d) => ({
|
|
72
72
|
name: d,
|
|
73
73
|
fn: f(() => [
|
|
74
|
-
|
|
74
|
+
a ? (o(), u(x(e.currentInputComponent()), {
|
|
75
75
|
key: d,
|
|
76
|
-
templateEle:
|
|
77
|
-
}, null, 8, ["templateEle"])) :
|
|
76
|
+
templateEle: a
|
|
77
|
+
}, null, 8, ["templateEle"])) : g("", !0)
|
|
78
78
|
])
|
|
79
79
|
}))
|
|
80
80
|
]), 1040, ["onKeydown", "modelValue", "size"]);
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const j = /* @__PURE__ */ I(ie, [["render", le]]), ue = /* @__PURE__ */ h({
|
|
83
83
|
__name: "index",
|
|
84
84
|
props: {
|
|
85
85
|
item: {}
|
|
@@ -89,30 +89,30 @@ const T = /* @__PURE__ */ I(ae, [["render", le]]), ue = /* @__PURE__ */ g({
|
|
|
89
89
|
...M,
|
|
90
90
|
...n.inputSetting
|
|
91
91
|
});
|
|
92
|
-
return (
|
|
93
|
-
const
|
|
94
|
-
return o(), u(
|
|
95
|
-
modelValue: m(t)[
|
|
96
|
-
"onUpdate:modelValue": r[0] || (r[0] = (d) => m(t)[
|
|
92
|
+
return (i, r) => {
|
|
93
|
+
const a = p("el-input-number");
|
|
94
|
+
return o(), u(a, k({
|
|
95
|
+
modelValue: m(t)[i.item.prop],
|
|
96
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => m(t)[i.item.prop] = d),
|
|
97
97
|
size: m(l)
|
|
98
98
|
}, s.value), null, 16, ["modelValue", "size"]);
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
}), H = Symbol(), ce = { class: "input-graphic-verification" }, pe = ["src"], me = /* @__PURE__ */
|
|
101
|
+
}), H = Symbol(), ce = { class: "input-graphic-verification" }, pe = ["src"], me = /* @__PURE__ */ h({
|
|
102
102
|
__name: "index",
|
|
103
103
|
props: {
|
|
104
104
|
item: {}
|
|
105
105
|
},
|
|
106
106
|
setup(e) {
|
|
107
107
|
const { item: n } = e, { graphicSrc: t = "", getGraphic: l = () => {
|
|
108
|
-
} } = n, { formLoading: s, updateFormLoading:
|
|
108
|
+
} } = n, { formLoading: s, updateFormLoading: i } = v(H), r = async () => {
|
|
109
109
|
l && !s.value && await l();
|
|
110
110
|
};
|
|
111
|
-
return (
|
|
111
|
+
return (a, d) => {
|
|
112
112
|
const _ = U("loading");
|
|
113
113
|
return D((o(), P("div", ce, [
|
|
114
|
-
|
|
115
|
-
item:
|
|
114
|
+
Q(j, {
|
|
115
|
+
item: a.item,
|
|
116
116
|
class: "input"
|
|
117
117
|
}, null, 8, ["item"]),
|
|
118
118
|
Y("img", {
|
|
@@ -126,31 +126,31 @@ const T = /* @__PURE__ */ I(ae, [["render", le]]), ue = /* @__PURE__ */ g({
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
|
-
const de = /* @__PURE__ */ I(me, [["__scopeId", "data-v-500ec9b0"]]), C = "获取验证码", _e = 60, fe = /* @__PURE__ */
|
|
129
|
+
const de = /* @__PURE__ */ I(me, [["__scopeId", "data-v-500ec9b0"]]), C = "获取验证码", _e = 60, fe = /* @__PURE__ */ h({
|
|
130
130
|
__name: "verification-button",
|
|
131
131
|
props: {
|
|
132
132
|
getSmscode: { type: Function }
|
|
133
133
|
},
|
|
134
134
|
setup(e) {
|
|
135
|
-
const { getSmscode: n } = e, t = y(C), l = y(null), s =
|
|
135
|
+
const { getSmscode: n } = e, t = y(C), l = y(null), s = T(() => t.value === C), i = () => {
|
|
136
136
|
l && (clearInterval(l.value), l.value = null, t.value = C);
|
|
137
137
|
}, r = async () => {
|
|
138
138
|
if (t.value === C)
|
|
139
139
|
if (t.value = _e, l.value = setInterval(() => {
|
|
140
140
|
if (Number(t.value) <= 0 || !t.value) {
|
|
141
|
-
|
|
141
|
+
i();
|
|
142
142
|
return;
|
|
143
143
|
} else
|
|
144
144
|
t.value = Number(t.value) - 1;
|
|
145
145
|
}, 1e3), n)
|
|
146
|
-
await n() === !1 &&
|
|
146
|
+
await n() === !1 && i();
|
|
147
147
|
else
|
|
148
148
|
return;
|
|
149
149
|
};
|
|
150
150
|
return Z(() => {
|
|
151
|
-
|
|
152
|
-
}), (
|
|
153
|
-
const _ =
|
|
151
|
+
i();
|
|
152
|
+
}), (a, d) => {
|
|
153
|
+
const _ = p("el-button");
|
|
154
154
|
return o(), u(_, {
|
|
155
155
|
class: "verifiaction-button",
|
|
156
156
|
style: ee({
|
|
@@ -167,7 +167,7 @@ const de = /* @__PURE__ */ I(me, [["__scopeId", "data-v-500ec9b0"]]), C = "获
|
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
|
-
const ye = /* @__PURE__ */ I(fe, [["__scopeId", "data-v-4074e137"]]), ve = /* @__PURE__ */
|
|
170
|
+
const ye = /* @__PURE__ */ I(fe, [["__scopeId", "data-v-4074e137"]]), ve = /* @__PURE__ */ h({
|
|
171
171
|
__name: "index",
|
|
172
172
|
props: {
|
|
173
173
|
item: {}
|
|
@@ -178,12 +178,12 @@ const ye = /* @__PURE__ */ I(fe, [["__scopeId", "data-v-4074e137"]]), ve = /* @_
|
|
|
178
178
|
append: () => te(ye, {
|
|
179
179
|
getSmscode: t.getSmscode
|
|
180
180
|
})
|
|
181
|
-
}, (l, s) => (o(), u(
|
|
181
|
+
}, (l, s) => (o(), u(j, {
|
|
182
182
|
item: m(t),
|
|
183
183
|
class: "input"
|
|
184
184
|
}, null, 8, ["item"]));
|
|
185
185
|
}
|
|
186
|
-
}), ge =
|
|
186
|
+
}), ge = h({
|
|
187
187
|
components: {
|
|
188
188
|
slotArchive: (e) => {
|
|
189
189
|
const { templateEle: n } = e;
|
|
@@ -209,21 +209,21 @@ const ye = /* @__PURE__ */ I(fe, [["__scopeId", "data-v-4074e137"]]), ve = /* @_
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
|
-
function he(e, n, t, l, s,
|
|
213
|
-
const r =
|
|
214
|
-
return o(), u(r, ne(oe(e.dividerSetting)),
|
|
215
|
-
z(e.item.template, (
|
|
212
|
+
function he(e, n, t, l, s, i) {
|
|
213
|
+
const r = p("el-divider");
|
|
214
|
+
return o(), u(r, ne(oe(e.dividerSetting)), K({ _: 2 }, [
|
|
215
|
+
z(e.item.template, (a, d) => ({
|
|
216
216
|
name: d,
|
|
217
217
|
fn: f(() => [
|
|
218
|
-
|
|
218
|
+
a ? (o(), u(x(e.currentInputComponent()), {
|
|
219
219
|
key: d,
|
|
220
|
-
templateEle:
|
|
221
|
-
}, null, 8, ["templateEle"])) :
|
|
220
|
+
templateEle: a
|
|
221
|
+
}, null, 8, ["templateEle"])) : g("", !0)
|
|
222
222
|
])
|
|
223
223
|
}))
|
|
224
224
|
]), 1040);
|
|
225
225
|
}
|
|
226
|
-
const be = /* @__PURE__ */ I(ge, [["render", he]]), ke = /* @__PURE__ */
|
|
226
|
+
const be = /* @__PURE__ */ I(ge, [["render", he]]), ke = /* @__PURE__ */ h({
|
|
227
227
|
__name: "index",
|
|
228
228
|
props: {
|
|
229
229
|
item: {}
|
|
@@ -231,24 +231,24 @@ const be = /* @__PURE__ */ I(ge, [["render", he]]), ke = /* @__PURE__ */ g({
|
|
|
231
231
|
setup(e) {
|
|
232
232
|
const { item: n } = e, t = v("queryParams", {}), l = v("size"), s = y({
|
|
233
233
|
...n.radioSetting
|
|
234
|
-
}),
|
|
234
|
+
}), i = y({
|
|
235
235
|
...n.radioGroupSetting
|
|
236
236
|
});
|
|
237
|
-
return (r,
|
|
238
|
-
const d =
|
|
237
|
+
return (r, a) => {
|
|
238
|
+
const d = p("el-radio"), _ = p("el-radio-group");
|
|
239
239
|
return o(), u(_, k({
|
|
240
240
|
modelValue: m(t)[r.item.prop],
|
|
241
|
-
"onUpdate:modelValue":
|
|
241
|
+
"onUpdate:modelValue": a[0] || (a[0] = (b) => m(t)[r.item.prop] = b),
|
|
242
242
|
size: m(l)
|
|
243
|
-
},
|
|
243
|
+
}, i.value), {
|
|
244
244
|
default: f(() => [
|
|
245
|
-
(o(!0), P(F, null, z(r.item.option || [], (
|
|
245
|
+
(o(!0), P(F, null, z(r.item.option || [], (b) => (o(), u(d, k({
|
|
246
246
|
size: m(l),
|
|
247
|
-
label:
|
|
248
|
-
key:
|
|
247
|
+
label: b.label,
|
|
248
|
+
key: b.label
|
|
249
249
|
}, s.value), {
|
|
250
250
|
default: f(() => [
|
|
251
|
-
V(w(
|
|
251
|
+
V(w(b.value), 1)
|
|
252
252
|
]),
|
|
253
253
|
_: 2
|
|
254
254
|
}, 1040, ["size", "label"]))), 128))
|
|
@@ -257,26 +257,26 @@ const be = /* @__PURE__ */ I(ge, [["render", he]]), ke = /* @__PURE__ */ g({
|
|
|
257
257
|
}, 16, ["modelValue", "size"]);
|
|
258
258
|
};
|
|
259
259
|
}
|
|
260
|
-
}), Se = /* @__PURE__ */
|
|
260
|
+
}), Se = /* @__PURE__ */ h({
|
|
261
261
|
__name: "index",
|
|
262
262
|
props: {
|
|
263
263
|
item: {}
|
|
264
264
|
},
|
|
265
265
|
setup(e) {
|
|
266
266
|
const { item: n } = e, t = v("queryParams", {}), l = v("size"), s = y({
|
|
267
|
-
...
|
|
267
|
+
...ae,
|
|
268
268
|
...n.datePackerSetting
|
|
269
269
|
});
|
|
270
|
-
return (
|
|
271
|
-
const
|
|
272
|
-
return o(), u(
|
|
273
|
-
modelValue: m(t)[
|
|
274
|
-
"onUpdate:modelValue": r[0] || (r[0] = (d) => m(t)[
|
|
270
|
+
return (i, r) => {
|
|
271
|
+
const a = p("el-date-picker");
|
|
272
|
+
return o(), u(a, k({
|
|
273
|
+
modelValue: m(t)[i.item.prop],
|
|
274
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => m(t)[i.item.prop] = d),
|
|
275
275
|
size: m(l)
|
|
276
276
|
}, s.value), null, 16, ["modelValue", "size"]);
|
|
277
277
|
};
|
|
278
278
|
}
|
|
279
|
-
}), Pe = /* @__PURE__ */
|
|
279
|
+
}), Pe = /* @__PURE__ */ h({
|
|
280
280
|
__name: "index",
|
|
281
281
|
props: {
|
|
282
282
|
item: {}
|
|
@@ -286,15 +286,15 @@ const be = /* @__PURE__ */ I(ge, [["render", he]]), ke = /* @__PURE__ */ g({
|
|
|
286
286
|
...W,
|
|
287
287
|
...n.selectSetting
|
|
288
288
|
});
|
|
289
|
-
return (
|
|
290
|
-
const
|
|
289
|
+
return (i, r) => {
|
|
290
|
+
const a = p("el-option"), d = p("el-select");
|
|
291
291
|
return o(), u(d, k({
|
|
292
|
-
modelValue: m(t)[
|
|
293
|
-
"onUpdate:modelValue": r[0] || (r[0] = (_) => m(t)[
|
|
292
|
+
modelValue: m(t)[i.item.prop],
|
|
293
|
+
"onUpdate:modelValue": r[0] || (r[0] = (_) => m(t)[i.item.prop] = _),
|
|
294
294
|
size: m(l)
|
|
295
295
|
}, s.value), {
|
|
296
296
|
default: f(() => [
|
|
297
|
-
(o(!0), P(F, null, z(
|
|
297
|
+
(o(!0), P(F, null, z(i.item.option || [], (_) => (o(), u(a, {
|
|
298
298
|
key: _.value,
|
|
299
299
|
label: _.label,
|
|
300
300
|
value: _.value
|
|
@@ -304,7 +304,7 @@ const be = /* @__PURE__ */ I(ge, [["render", he]]), ke = /* @__PURE__ */ g({
|
|
|
304
304
|
}, 16, ["modelValue", "size"]);
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
-
}), ze = /* @__PURE__ */
|
|
307
|
+
}), ze = /* @__PURE__ */ h({
|
|
308
308
|
__name: "index",
|
|
309
309
|
props: {
|
|
310
310
|
item: {}
|
|
@@ -314,20 +314,20 @@ const be = /* @__PURE__ */ I(ge, [["render", he]]), ke = /* @__PURE__ */ g({
|
|
|
314
314
|
...W,
|
|
315
315
|
...n.selectSetting
|
|
316
316
|
});
|
|
317
|
-
return (
|
|
318
|
-
const
|
|
319
|
-
return o(), u(
|
|
320
|
-
modelValue: m(t)[
|
|
321
|
-
"onUpdate:modelValue": r[0] || (r[0] = (d) => m(t)[
|
|
317
|
+
return (i, r) => {
|
|
318
|
+
const a = p("el-cascader");
|
|
319
|
+
return o(), u(a, k({
|
|
320
|
+
modelValue: m(t)[i.item.prop],
|
|
321
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => m(t)[i.item.prop] = d),
|
|
322
322
|
size: m(l),
|
|
323
|
-
options:
|
|
323
|
+
options: i.item.options || []
|
|
324
324
|
}, s.value), null, 16, ["modelValue", "size", "options"]);
|
|
325
325
|
};
|
|
326
326
|
}
|
|
327
|
-
}), $e =
|
|
327
|
+
}), $e = h({
|
|
328
328
|
name: "GeneralBasicForm",
|
|
329
329
|
components: {
|
|
330
|
-
Input:
|
|
330
|
+
Input: j,
|
|
331
331
|
InputNumber: ue,
|
|
332
332
|
InputGraphicVerification: de,
|
|
333
333
|
InputMobileVerification: ve,
|
|
@@ -398,14 +398,14 @@ const be = /* @__PURE__ */ I(ge, [["render", he]]), ke = /* @__PURE__ */ g({
|
|
|
398
398
|
};
|
|
399
399
|
},
|
|
400
400
|
setup(e) {
|
|
401
|
-
const { size: n, noUrlParameters: t, getList: l } = e, s = se(),
|
|
401
|
+
const { size: n, noUrlParameters: t, getList: l } = e, s = se(), i = y({
|
|
402
402
|
...t ? {} : s == null ? void 0 : s.query
|
|
403
403
|
});
|
|
404
404
|
return A(
|
|
405
405
|
/* 注入名 */
|
|
406
406
|
"queryParams",
|
|
407
407
|
/* 值 */
|
|
408
|
-
|
|
408
|
+
i
|
|
409
409
|
), A(
|
|
410
410
|
/* 注入名 */
|
|
411
411
|
"size",
|
|
@@ -417,7 +417,7 @@ const be = /* @__PURE__ */ I(ge, [["render", he]]), ke = /* @__PURE__ */ g({
|
|
|
417
417
|
/* 值 */
|
|
418
418
|
l
|
|
419
419
|
), {
|
|
420
|
-
queryParams:
|
|
420
|
+
queryParams: i
|
|
421
421
|
};
|
|
422
422
|
},
|
|
423
423
|
watch: {
|
|
@@ -444,7 +444,7 @@ const be = /* @__PURE__ */ I(ge, [["render", he]]), ke = /* @__PURE__ */ g({
|
|
|
444
444
|
return {
|
|
445
445
|
// 显式提供一个计算属性
|
|
446
446
|
[H]: {
|
|
447
|
-
formLoading:
|
|
447
|
+
formLoading: T(() => this.formLoading),
|
|
448
448
|
updateFormLoading: (e) => {
|
|
449
449
|
this.formLoading = e;
|
|
450
450
|
}
|
|
@@ -479,8 +479,8 @@ const be = /* @__PURE__ */ I(ge, [["render", he]]), ke = /* @__PURE__ */ g({
|
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
});
|
|
482
|
-
function qe(e, n, t, l, s,
|
|
483
|
-
const r =
|
|
482
|
+
function qe(e, n, t, l, s, i) {
|
|
483
|
+
const r = p("Input"), a = p("Radio"), d = p("Select"), _ = p("Divider"), b = p("Cascader"), $ = p("DatePicker"), G = p("InputNumber"), B = p("InputMobileVerification"), N = p("InputGraphicVerification"), S = p("el-form-item"), L = p("el-button"), R = p("el-form"), E = U("loading");
|
|
484
484
|
return D((o(), u(R, k({
|
|
485
485
|
model: e.queryParams,
|
|
486
486
|
ref: "queryFormRef",
|
|
@@ -489,54 +489,55 @@ function qe(e, n, t, l, s, a) {
|
|
|
489
489
|
"label-width": e.labelWidth
|
|
490
490
|
}, e.$attrs), {
|
|
491
491
|
default: f(() => [
|
|
492
|
-
(o(!0), P(F, null, z(e.formItem, (
|
|
493
|
-
label:
|
|
494
|
-
prop:
|
|
495
|
-
key:
|
|
496
|
-
rules:
|
|
492
|
+
(o(!0), P(F, null, z(e.formItem, (c) => (o(), u(S, {
|
|
493
|
+
label: c.label,
|
|
494
|
+
prop: c.prop,
|
|
495
|
+
key: c.prop,
|
|
496
|
+
rules: c.rules
|
|
497
497
|
}, {
|
|
498
498
|
default: f(() => [
|
|
499
|
-
|
|
499
|
+
c.type === "input" ? (o(), u(r, {
|
|
500
500
|
key: 0,
|
|
501
|
-
item:
|
|
502
|
-
}, null, 8, ["item"])) :
|
|
503
|
-
|
|
501
|
+
item: c
|
|
502
|
+
}, null, 8, ["item"])) : g("", !0),
|
|
503
|
+
c.type === "radio" ? (o(), u(a, {
|
|
504
504
|
key: 1,
|
|
505
|
-
item:
|
|
506
|
-
}, null, 8, ["item"])) :
|
|
507
|
-
|
|
505
|
+
item: c
|
|
506
|
+
}, null, 8, ["item"])) : g("", !0),
|
|
507
|
+
c.type === "select" ? (o(), u(d, {
|
|
508
508
|
key: 2,
|
|
509
|
-
item:
|
|
510
|
-
}, null, 8, ["item"])) :
|
|
511
|
-
|
|
509
|
+
item: c
|
|
510
|
+
}, null, 8, ["item"])) : g("", !0),
|
|
511
|
+
c.type === "divider" ? (o(), u(_, {
|
|
512
512
|
key: 3,
|
|
513
|
-
item:
|
|
514
|
-
}, null, 8, ["item"])) :
|
|
515
|
-
|
|
513
|
+
item: c
|
|
514
|
+
}, null, 8, ["item"])) : g("", !0),
|
|
515
|
+
c.type === "cascader" ? (o(), u(b, {
|
|
516
516
|
key: 4,
|
|
517
|
-
item:
|
|
518
|
-
}, null, 8, ["item"])) :
|
|
519
|
-
|
|
517
|
+
item: c
|
|
518
|
+
}, null, 8, ["item"])) : g("", !0),
|
|
519
|
+
c.type === "date-picker" ? (o(), u($, {
|
|
520
520
|
key: 5,
|
|
521
|
-
item:
|
|
522
|
-
}, null, 8, ["item"])) :
|
|
523
|
-
|
|
521
|
+
item: c
|
|
522
|
+
}, null, 8, ["item"])) : g("", !0),
|
|
523
|
+
c.type === "input-number" ? (o(), u(G, {
|
|
524
524
|
key: 6,
|
|
525
|
-
item:
|
|
526
|
-
}, null, 8, ["item"])) :
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
525
|
+
item: c
|
|
526
|
+
}, null, 8, ["item"])) : g("", !0),
|
|
527
|
+
c.type === "form-item-slot" ? O(e.$slots, c.name, { key: 7 }) : g("", !0),
|
|
528
|
+
c.type === "input-mobile-verification" ? (o(), u(B, {
|
|
529
|
+
key: 8,
|
|
530
|
+
item: c
|
|
531
|
+
}, null, 8, ["item"])) : g("", !0),
|
|
532
|
+
c.type === "input-graphic-verification" ? (o(), u(N, {
|
|
533
|
+
item: c,
|
|
534
|
+
key: c.key
|
|
535
|
+
}, null, 8, ["item"])) : g("", !0)
|
|
535
536
|
]),
|
|
536
537
|
_: 2
|
|
537
538
|
}, 1032, ["label", "prop", "rules"]))), 128)),
|
|
538
|
-
|
|
539
|
-
e.formOnly ?
|
|
539
|
+
O(e.$slots, "default"),
|
|
540
|
+
e.formOnly ? g("", !0) : (o(), u(S, { key: 0 }, {
|
|
540
541
|
default: f(() => [
|
|
541
542
|
D((o(), u(L, {
|
|
542
543
|
type: "primary",
|
|
@@ -550,7 +551,7 @@ function qe(e, n, t, l, s, a) {
|
|
|
550
551
|
}, 8, ["size", "onClick"])), [
|
|
551
552
|
[E, e.formLoading]
|
|
552
553
|
]),
|
|
553
|
-
|
|
554
|
+
Q(L, {
|
|
554
555
|
size: e.size,
|
|
555
556
|
onClick: e.resetQuery
|
|
556
557
|
}, {
|
|
@@ -562,14 +563,14 @@ function qe(e, n, t, l, s, a) {
|
|
|
562
563
|
]),
|
|
563
564
|
_: 1
|
|
564
565
|
})),
|
|
565
|
-
|
|
566
|
+
O(e.$slots, "behind-the-button")
|
|
566
567
|
]),
|
|
567
568
|
_: 3
|
|
568
569
|
}, 16, ["model", "label-width"])), [
|
|
569
570
|
[re, e.showSearch]
|
|
570
571
|
]);
|
|
571
572
|
}
|
|
572
|
-
const Ve = /* @__PURE__ */ I($e, [["render", qe]]), Ie = ["infinite-scroll-disabled"], Le = /* @__PURE__ */
|
|
573
|
+
const Ve = /* @__PURE__ */ I($e, [["render", qe]]), Ie = ["infinite-scroll-disabled"], Le = /* @__PURE__ */ h({
|
|
573
574
|
__name: "InfiniteScrollList",
|
|
574
575
|
props: {
|
|
575
576
|
search: {
|
|
@@ -590,44 +591,44 @@ const Ve = /* @__PURE__ */ I($e, [["render", qe]]), Ie = ["infinite-scroll-disab
|
|
|
590
591
|
}
|
|
591
592
|
},
|
|
592
593
|
setup(e, { expose: n }) {
|
|
593
|
-
const t = e, { search: l, id: s, name:
|
|
594
|
-
d.value = 1,
|
|
594
|
+
const t = e, { search: l, id: s, name: i, extra: r } = t, a = y([]), d = y(1), _ = y(!1), b = y([]), $ = y(!1), G = () => {
|
|
595
|
+
d.value = 1, a.value = [], b.value = [], _.value = !1;
|
|
595
596
|
}, B = async () => {
|
|
596
597
|
if ($.value || _.value)
|
|
597
598
|
return;
|
|
598
599
|
$.value = !0;
|
|
599
600
|
const S = await l(d.value);
|
|
600
|
-
S && S.length > 0 ? (
|
|
601
|
-
}, N =
|
|
602
|
-
() =>
|
|
601
|
+
S && S.length > 0 ? (a.value = [...a.value, ...S], d.value += 1) : _.value = !0, $.value = !1;
|
|
602
|
+
}, N = T(
|
|
603
|
+
() => a.value.filter((S) => b.value.includes(S[s]))
|
|
603
604
|
) || {};
|
|
604
605
|
return n({ reset: G, loadList: B, selectInfo: N }), (S, L) => {
|
|
605
|
-
const R =
|
|
606
|
+
const R = p("el-checkbox"), E = p("el-checkbox-group"), c = U("infinite-scroll"), J = U("loading");
|
|
606
607
|
return D((o(), u(E, k({
|
|
607
|
-
modelValue:
|
|
608
|
-
"onUpdate:modelValue": L[0] || (L[0] = (q) =>
|
|
608
|
+
modelValue: b.value,
|
|
609
|
+
"onUpdate:modelValue": L[0] || (L[0] = (q) => b.value = q)
|
|
609
610
|
}, t), {
|
|
610
611
|
default: f(() => [
|
|
611
612
|
D((o(), P("ul", {
|
|
612
613
|
class: "list",
|
|
613
614
|
"infinite-scroll-disabled": _.value
|
|
614
615
|
}, [
|
|
615
|
-
(o(!0), P(F, null, z(
|
|
616
|
+
(o(!0), P(F, null, z(a.value, (q) => (o(), P("li", {
|
|
616
617
|
key: q[m(s)],
|
|
617
618
|
class: "list-item"
|
|
618
619
|
}, [
|
|
619
|
-
|
|
620
|
+
Q(R, {
|
|
620
621
|
label: q[m(s)],
|
|
621
622
|
class: "checkbox"
|
|
622
623
|
}, {
|
|
623
624
|
default: f(() => [
|
|
624
|
-
V(w(q[m(
|
|
625
|
+
V(w(q[m(i)]) + " " + w(m(r) && m(r)(q)), 1)
|
|
625
626
|
]),
|
|
626
627
|
_: 2
|
|
627
628
|
}, 1032, ["label"])
|
|
628
629
|
]))), 128))
|
|
629
630
|
], 8, Ie)), [
|
|
630
|
-
[
|
|
631
|
+
[c, B]
|
|
631
632
|
])
|
|
632
633
|
]),
|
|
633
634
|
_: 1
|
|
@@ -637,7 +638,7 @@ const Ve = /* @__PURE__ */ I($e, [["render", qe]]), Ie = ["infinite-scroll-disab
|
|
|
637
638
|
};
|
|
638
639
|
}
|
|
639
640
|
});
|
|
640
|
-
const Ce = /* @__PURE__ */ I(Le, [["__scopeId", "data-v-fda8f794"]]), De = /* @__PURE__ */
|
|
641
|
+
const Ce = /* @__PURE__ */ I(Le, [["__scopeId", "data-v-fda8f794"]]), De = /* @__PURE__ */ h({
|
|
641
642
|
__name: "Descriptions",
|
|
642
643
|
props: {
|
|
643
644
|
formData: {
|
|
@@ -656,21 +657,21 @@ const Ce = /* @__PURE__ */ I(Le, [["__scopeId", "data-v-fda8f794"]]), De = /* @_
|
|
|
656
657
|
setup(e) {
|
|
657
658
|
const n = e;
|
|
658
659
|
return (t, l) => {
|
|
659
|
-
const s =
|
|
660
|
-
return o(), u(
|
|
660
|
+
const s = p("el-descriptions-item"), i = p("el-descriptions");
|
|
661
|
+
return o(), u(i, k({
|
|
661
662
|
column: 1,
|
|
662
663
|
border: "",
|
|
663
664
|
class: "form-width"
|
|
664
665
|
}, n), {
|
|
665
666
|
default: f(() => [
|
|
666
|
-
(o(!0), P(F, null, z(n.formItem, (r,
|
|
667
|
+
(o(!0), P(F, null, z(n.formItem, (r, a) => (o(), u(s, k({
|
|
667
668
|
key: r.prop,
|
|
668
669
|
label: r.label
|
|
669
670
|
}, n.descriptionsItemProps), {
|
|
670
671
|
default: f(() => [
|
|
671
672
|
V(w(r.render ? r.render({
|
|
672
673
|
row: e.formData,
|
|
673
|
-
$index:
|
|
674
|
+
$index: a
|
|
674
675
|
}) : e.formData[r.prop]), 1)
|
|
675
676
|
]),
|
|
676
677
|
_: 2
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f.Index={},f.Vue,f["vue-router"]))})(this,function(f,e,I){"use strict";const w={placeholder:"请输入",style:"width: 200px",clearable:!0},$={style:"width: 227px","start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange"},z={placeholder:"请选择",filterable:!0,clearable:!0,style:"width: 200px"},D=e.defineComponent({components:{InputArchive:t=>{const{templateEle:n}=t;return n()}},props:{item:null},setup(){const t=e.inject("queryParams",{}),n=e.inject("getList"),o=e.inject("size");return{queryParams:t,getList:n,size:o}},data(){return{inputSetting:{...w,...this.item.inputSetting}}},methods:{currentInputComponent(){return"input-archive"}}}),u=(t,n)=>{const o=t.__vccOpts||t;for(const[a,l]of n)o[a]=l;return o};function L(t,n,o,a,l,s){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({onKeydown:e.withKeys(t.getList,["enter"]),modelValue:t.queryParams[t.item.prop],"onUpdate:modelValue":n[0]||(n[0]=i=>t.queryParams[t.item.prop]=i),size:t.size},t.inputSetting),e.createSlots({_:2},[e.renderList(t.item.template,(i,p)=>({name:p,fn:e.withCtx(()=>[i?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.currentInputComponent()),{key:p,templateEle:i},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040,["onKeydown","modelValue","size"])}const C=u(D,[["render",L]]),N=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),a=e.inject("size"),l=e.ref({...w,...n.inputSetting});return(s,r)=>{const i=e.resolveComponent("el-input-number");return e.openBlock(),e.createBlock(i,e.mergeProps({modelValue:e.unref(o)[s.item.prop],"onUpdate:modelValue":r[0]||(r[0]=p=>e.unref(o)[s.item.prop]=p),size:e.unref(a)},l.value),null,16,["modelValue","size"])}}}),q=Symbol(),x={class:"input-graphic-verification"},F=["src"],j=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,{graphicSrc:o="",getGraphic:a=()=>{}}=n,{formLoading:l,updateFormLoading:s}=e.inject(q),r=async()=>{a&&!l.value&&await a()};return(i,p)=>{const m=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",x,[e.createVNode(C,{item:i.item,class:"input"},null,8,["item"]),e.createElementVNode("img",{class:"graphic",onClick:r,src:e.unref(o)},null,8,F)])),[[m,e.unref(l)]])}}}),ie="",E=u(j,[["__scopeId","data-v-500ec9b0"]]),h="获取验证码",U=60,T=e.defineComponent({__name:"verification-button",props:{getSmscode:{type:Function}},setup(t){const{getSmscode:n}=t,o=e.ref(h),a=e.ref(null),l=e.computed(()=>o.value===h),s=()=>{a&&(clearInterval(a.value),a.value=null,o.value=h)},r=async()=>{if(o.value===h)if(o.value=U,a.value=setInterval(()=>{if(Number(o.value)<=0||!o.value){s();return}else o.value=Number(o.value)-1},1e3),n)await n()===!1&&s();else return};return e.onBeforeUnmount(()=>{s()}),(i,p)=>{const m=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(m,{class:"verifiaction-button",style:e.normalizeStyle({color:l.value?"var(--color-primary, #409EFF)":"var(--text-color-placeholder, #A8ABB2)",cursor:l.value?"pointer":"default"}),onClick:r},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value?h:o.value+"s"),1)]),_:1},8,["style"])}}}),se="",G=u(T,[["__scopeId","data-v-4074e137"]]),R=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=n;return o.template={append:()=>e.h(G,{getSmscode:o.getSmscode})},(a,l)=>(e.openBlock(),e.createBlock(C,{item:e.unref(o),class:"input"},null,8,["item"]))}}),O=e.defineComponent({components:{slotArchive:t=>{const{templateEle:n}=t;return n()}},props:{item:null},setup(){},data(){return{dividerSetting:{...this.item.dividerSetting}}},methods:{currentInputComponent(){return"slot-archive"}}});function A(t,n,o,a,l,s){const r=e.resolveComponent("el-divider");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.dividerSetting)),e.createSlots({_:2},[e.renderList(t.item.template,(i,p)=>({name:p,fn:e.withCtx(()=>[i?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.currentInputComponent()),{key:p,templateEle:i},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040)}const Q=u(O,[["render",A]]),K=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),a=e.inject("size"),l=e.ref({...n.radioSetting}),s=e.ref({...n.radioGroupSetting});return(r,i)=>{const p=e.resolveComponent("el-radio"),m=e.resolveComponent("el-radio-group");return e.openBlock(),e.createBlock(m,e.mergeProps({modelValue:e.unref(o)[r.item.prop],"onUpdate:modelValue":i[0]||(i[0]=d=>e.unref(o)[r.item.prop]=d),size:e.unref(a)},s.value),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.item.option||[],d=>(e.openBlock(),e.createBlock(p,e.mergeProps({size:e.unref(a),label:d.label,key:d.label},l.value),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:2},1040,["size","label"]))),128))]),_:1},16,["modelValue","size"])}}}),M=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),a=e.inject("size"),l=e.ref({...$,...n.datePackerSetting});return(s,r)=>{const i=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(i,e.mergeProps({modelValue:e.unref(o)[s.item.prop],"onUpdate:modelValue":r[0]||(r[0]=p=>e.unref(o)[s.item.prop]=p),size:e.unref(a)},l.value),null,16,["modelValue","size"])}}}),W=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),a=e.inject("size"),l=e.ref({...z,...n.selectSetting});return(s,r)=>{const i=e.resolveComponent("el-option"),p=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(p,e.mergeProps({modelValue:e.unref(o)[s.item.prop],"onUpdate:modelValue":r[0]||(r[0]=m=>e.unref(o)[s.item.prop]=m),size:e.unref(a)},l.value),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.item.option||[],m=>(e.openBlock(),e.createBlock(i,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","size"])}}}),H=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),a=e.inject("size"),l=e.ref({...z,...n.selectSetting});return(s,r)=>{const i=e.resolveComponent("el-cascader");return e.openBlock(),e.createBlock(i,e.mergeProps({modelValue:e.unref(o)[s.item.prop],"onUpdate:modelValue":r[0]||(r[0]=p=>e.unref(o)[s.item.prop]=p),size:e.unref(a),options:s.item.options||[]},l.value),null,16,["modelValue","size","options"])}}}),J=e.defineComponent({name:"GeneralBasicForm",components:{Input:C,InputNumber:N,InputGraphicVerification:E,InputMobileVerification:R,Divider:Q,Radio:K,DatePicker:M,Select:W,Cascader:H},props:{showSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},formOnly:{type:Boolean,default:!1},getList:{type:Function,default:()=>{}},afterReset:{type:Function,default:()=>{}},formItem:{type:Array,default:[]},size:{type:String,default:"default"},labelWidth:{type:String,default:"90px"},noUrlParameters:{type:Boolean,default:()=>!1},formData:{type:Object,default:()=>{}}},data(){return{formLoading:this.loading||!1}},setup(t){const{size:n,noUrlParameters:o,getList:a}=t,l=I.useRoute(),s=e.ref({...o?{}:l==null?void 0:l.query});return e.provide("queryParams",s),e.provide("size",n),e.provide("getList",a),{queryParams:s}},watch:{formData:{handler(t){this.queryParams={...this.noUrlParameters?{}:this.queryParams,...t}},immediate:!0},loading(t){this.formLoading!==t&&(this.formLoading=t)},formLoading(t){this.loading!==t&&this.$emit("update:loading",t)}},provide(){return{[q]:{formLoading:e.computed(()=>this.formLoading),updateFormLoading:t=>{this.formLoading=t}}}},methods:{handleQuery(){var o;const t={page:1,limit:10},n={...(o=this.$route)==null?void 0:o.query,...this.queryParams,...t};this.noUrlParameters||this.$router.push({query:{...n}}),this.getList({...n})},async resetQuery(){var n;this.$refs.queryFormRef.resetFields();const t={page:1};this.noUrlParameters||await this.$router.push({query:{...t}}),this.queryParams={...this.noUrlParameters?{}:(n=this.$route)==null?void 0:n.query},this.afterReset(),this.handleQuery()}}});function X(t,n,o,a,l,s){const r=e.resolveComponent("Input"),i=e.resolveComponent("Radio"),p=e.resolveComponent("Select"),m=e.resolveComponent("Divider"),d=e.resolveComponent("Cascader"),y=e.resolveComponent("DatePicker"),b=e.resolveComponent("InputNumber"),B=e.resolveComponent("InputMobileVerification"),V=e.resolveComponent("InputGraphicVerification"),_=e.resolveComponent("el-form-item"),g=e.resolveComponent("el-button"),S=e.resolveComponent("el-form"),P=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(S,e.mergeProps({model:t.queryParams,ref:"queryFormRef",inline:"","label-position":"left","label-width":t.labelWidth},t.$attrs),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formItem,c=>(e.openBlock(),e.createBlock(_,{label:c.label,prop:c.prop,key:c.prop,rules:c.rules},{default:e.withCtx(()=>[c.type==="input"?(e.openBlock(),e.createBlock(r,{key:0,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="radio"?(e.openBlock(),e.createBlock(i,{key:1,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="select"?(e.openBlock(),e.createBlock(p,{key:2,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="divider"?(e.openBlock(),e.createBlock(m,{key:3,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="cascader"?(e.openBlock(),e.createBlock(d,{key:4,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="date-picker"?(e.openBlock(),e.createBlock(y,{key:5,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="input-number"?(e.openBlock(),e.createBlock(b,{key:6,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="input-mobile-verification"?(e.openBlock(),e.createBlock(B,{key:7,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="input-graphic-verification"?(e.openBlock(),e.createBlock(V,{item:c,key:c.key},null,8,["item"])):e.createCommentVNode("",!0)]),_:2},1032,["label","prop","rules"]))),128)),e.renderSlot(t.$slots,"default"),t.formOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_,{key:0},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(g,{type:"primary",size:t.size,onClick:t.handleQuery},{default:e.withCtx(()=>[e.createTextVNode("查询")]),_:1},8,["size","onClick"])),[[P,t.formLoading]]),e.createVNode(g,{size:t.size,onClick:t.resetQuery},{default:e.withCtx(()=>[e.createTextVNode("重置")]),_:1},8,["size","onClick"])]),_:1})),e.renderSlot(t.$slots,"behind-the-button")]),_:3},16,["model","label-width"])),[[e.vShow,t.showSearch]])}const Y=u(J,[["render",X]]),Z=["infinite-scroll-disabled"],v=e.defineComponent({__name:"InfiniteScrollList",props:{search:{type:Function,required:!0},id:{type:String,required:!0},name:{type:String,required:!0},extra:{type:Function,required:!1}},setup(t,{expose:n}){const o=t,{search:a,id:l,name:s,extra:r}=o,i=e.ref([]),p=e.ref(1),m=e.ref(!1),d=e.ref([]),y=e.ref(!1),b=()=>{p.value=1,i.value=[],d.value=[],m.value=!1},B=async()=>{if(y.value||m.value)return;y.value=!0;const _=await a(p.value);_&&_.length>0?(i.value=[...i.value,..._],p.value+=1):m.value=!0,y.value=!1},V=e.computed(()=>i.value.filter(_=>d.value.includes(_[l])))||{};return n({reset:b,loadList:B,selectInfo:V}),(_,g)=>{const S=e.resolveComponent("el-checkbox"),P=e.resolveComponent("el-checkbox-group"),c=e.resolveDirective("infinite-scroll"),le=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(P,e.mergeProps({modelValue:d.value,"onUpdate:modelValue":g[0]||(g[0]=k=>d.value=k)},o),{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("ul",{class:"list","infinite-scroll-disabled":m.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,k=>(e.openBlock(),e.createElementBlock("li",{key:k[e.unref(l)],class:"list-item"},[e.createVNode(S,{label:k[e.unref(l)],class:"checkbox"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k[e.unref(s)])+" "+e.toDisplayString(e.unref(r)&&e.unref(r)(k)),1)]),_:2},1032,["label"])]))),128))],8,Z)),[[c,B]])]),_:1},16,["modelValue"])),[[le,y.value]])}}}),ae="",ee=u(v,[["__scopeId","data-v-fda8f794"]]),te=e.defineComponent({__name:"Descriptions",props:{formData:{type:Object,required:!0},descriptionsItemProps:{type:Object,required:!1},formItem:{type:Array,required:!0}},setup(t){const n=t;return(o,a)=>{const l=e.resolveComponent("el-descriptions-item"),s=e.resolveComponent("el-descriptions");return e.openBlock(),e.createBlock(s,e.mergeProps({column:1,border:"",class:"form-width"},n),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.formItem,(r,i)=>(e.openBlock(),e.createBlock(l,e.mergeProps({key:r.prop,label:r.label},n.descriptionsItemProps),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.render?r.render({row:t.formData,$index:i}):t.formData[r.prop]),1)]),_:2},1040,["label"]))),128))]),_:1},16)}}}),oe=Y,ne=ee,re=te;f.VDescriptions=re,f.VGeneralBasicForm=oe,f.VInfiniteScrollList=ne,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f.Index={},f.Vue,f["vue-router"]))})(this,function(f,e,$){"use strict";const w={placeholder:"请输入",style:"width: 200px",clearable:!0},I={style:"width: 227px","start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange"},z={placeholder:"请选择",filterable:!0,clearable:!0,style:"width: 200px"},D=e.defineComponent({components:{InputArchive:t=>{const{templateEle:n}=t;return n()}},props:{item:null},setup(){const t=e.inject("queryParams",{}),n=e.inject("getList"),o=e.inject("size");return{queryParams:t,getList:n,size:o}},data(){return{inputSetting:{...w,...this.item.inputSetting}}},methods:{currentInputComponent(){return"input-archive"}}}),u=(t,n)=>{const o=t.__vccOpts||t;for(const[a,l]of n)o[a]=l;return o};function L(t,n,o,a,l,s){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({onKeydown:e.withKeys(t.getList,["enter"]),modelValue:t.queryParams[t.item.prop],"onUpdate:modelValue":n[0]||(n[0]=i=>t.queryParams[t.item.prop]=i),size:t.size},t.inputSetting),e.createSlots({_:2},[e.renderList(t.item.template,(i,p)=>({name:p,fn:e.withCtx(()=>[i?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.currentInputComponent()),{key:p,templateEle:i},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040,["onKeydown","modelValue","size"])}const C=u(D,[["render",L]]),N=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),a=e.inject("size"),l=e.ref({...w,...n.inputSetting});return(s,r)=>{const i=e.resolveComponent("el-input-number");return e.openBlock(),e.createBlock(i,e.mergeProps({modelValue:e.unref(o)[s.item.prop],"onUpdate:modelValue":r[0]||(r[0]=p=>e.unref(o)[s.item.prop]=p),size:e.unref(a)},l.value),null,16,["modelValue","size"])}}}),q=Symbol(),x={class:"input-graphic-verification"},F=["src"],j=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,{graphicSrc:o="",getGraphic:a=()=>{}}=n,{formLoading:l,updateFormLoading:s}=e.inject(q),r=async()=>{a&&!l.value&&await a()};return(i,p)=>{const m=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",x,[e.createVNode(C,{item:i.item,class:"input"},null,8,["item"]),e.createElementVNode("img",{class:"graphic",onClick:r,src:e.unref(o)},null,8,F)])),[[m,e.unref(l)]])}}}),ie="",E=u(j,[["__scopeId","data-v-500ec9b0"]]),h="获取验证码",U=60,T=e.defineComponent({__name:"verification-button",props:{getSmscode:{type:Function}},setup(t){const{getSmscode:n}=t,o=e.ref(h),a=e.ref(null),l=e.computed(()=>o.value===h),s=()=>{a&&(clearInterval(a.value),a.value=null,o.value=h)},r=async()=>{if(o.value===h)if(o.value=U,a.value=setInterval(()=>{if(Number(o.value)<=0||!o.value){s();return}else o.value=Number(o.value)-1},1e3),n)await n()===!1&&s();else return};return e.onBeforeUnmount(()=>{s()}),(i,p)=>{const m=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(m,{class:"verifiaction-button",style:e.normalizeStyle({color:l.value?"var(--color-primary, #409EFF)":"var(--text-color-placeholder, #A8ABB2)",cursor:l.value?"pointer":"default"}),onClick:r},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value?h:o.value+"s"),1)]),_:1},8,["style"])}}}),se="",G=u(T,[["__scopeId","data-v-4074e137"]]),R=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=n;return o.template={append:()=>e.h(G,{getSmscode:o.getSmscode})},(a,l)=>(e.openBlock(),e.createBlock(C,{item:e.unref(o),class:"input"},null,8,["item"]))}}),O=e.defineComponent({components:{slotArchive:t=>{const{templateEle:n}=t;return n()}},props:{item:null},setup(){},data(){return{dividerSetting:{...this.item.dividerSetting}}},methods:{currentInputComponent(){return"slot-archive"}}});function A(t,n,o,a,l,s){const r=e.resolveComponent("el-divider");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.dividerSetting)),e.createSlots({_:2},[e.renderList(t.item.template,(i,p)=>({name:p,fn:e.withCtx(()=>[i?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.currentInputComponent()),{key:p,templateEle:i},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040)}const Q=u(O,[["render",A]]),K=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),a=e.inject("size"),l=e.ref({...n.radioSetting}),s=e.ref({...n.radioGroupSetting});return(r,i)=>{const p=e.resolveComponent("el-radio"),m=e.resolveComponent("el-radio-group");return e.openBlock(),e.createBlock(m,e.mergeProps({modelValue:e.unref(o)[r.item.prop],"onUpdate:modelValue":i[0]||(i[0]=d=>e.unref(o)[r.item.prop]=d),size:e.unref(a)},s.value),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.item.option||[],d=>(e.openBlock(),e.createBlock(p,e.mergeProps({size:e.unref(a),label:d.label,key:d.label},l.value),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:2},1040,["size","label"]))),128))]),_:1},16,["modelValue","size"])}}}),M=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),a=e.inject("size"),l=e.ref({...I,...n.datePackerSetting});return(s,r)=>{const i=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(i,e.mergeProps({modelValue:e.unref(o)[s.item.prop],"onUpdate:modelValue":r[0]||(r[0]=p=>e.unref(o)[s.item.prop]=p),size:e.unref(a)},l.value),null,16,["modelValue","size"])}}}),W=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),a=e.inject("size"),l=e.ref({...z,...n.selectSetting});return(s,r)=>{const i=e.resolveComponent("el-option"),p=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(p,e.mergeProps({modelValue:e.unref(o)[s.item.prop],"onUpdate:modelValue":r[0]||(r[0]=m=>e.unref(o)[s.item.prop]=m),size:e.unref(a)},l.value),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.item.option||[],m=>(e.openBlock(),e.createBlock(i,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","size"])}}}),H=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),a=e.inject("size"),l=e.ref({...z,...n.selectSetting});return(s,r)=>{const i=e.resolveComponent("el-cascader");return e.openBlock(),e.createBlock(i,e.mergeProps({modelValue:e.unref(o)[s.item.prop],"onUpdate:modelValue":r[0]||(r[0]=p=>e.unref(o)[s.item.prop]=p),size:e.unref(a),options:s.item.options||[]},l.value),null,16,["modelValue","size","options"])}}}),J=e.defineComponent({name:"GeneralBasicForm",components:{Input:C,InputNumber:N,InputGraphicVerification:E,InputMobileVerification:R,Divider:Q,Radio:K,DatePicker:M,Select:W,Cascader:H},props:{showSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},formOnly:{type:Boolean,default:!1},getList:{type:Function,default:()=>{}},afterReset:{type:Function,default:()=>{}},formItem:{type:Array,default:[]},size:{type:String,default:"default"},labelWidth:{type:String,default:"90px"},noUrlParameters:{type:Boolean,default:()=>!1},formData:{type:Object,default:()=>{}}},data(){return{formLoading:this.loading||!1}},setup(t){const{size:n,noUrlParameters:o,getList:a}=t,l=$.useRoute(),s=e.ref({...o?{}:l==null?void 0:l.query});return e.provide("queryParams",s),e.provide("size",n),e.provide("getList",a),{queryParams:s}},watch:{formData:{handler(t){this.queryParams={...this.noUrlParameters?{}:this.queryParams,...t}},immediate:!0},loading(t){this.formLoading!==t&&(this.formLoading=t)},formLoading(t){this.loading!==t&&this.$emit("update:loading",t)}},provide(){return{[q]:{formLoading:e.computed(()=>this.formLoading),updateFormLoading:t=>{this.formLoading=t}}}},methods:{handleQuery(){var o;const t={page:1,limit:10},n={...(o=this.$route)==null?void 0:o.query,...this.queryParams,...t};this.noUrlParameters||this.$router.push({query:{...n}}),this.getList({...n})},async resetQuery(){var n;this.$refs.queryFormRef.resetFields();const t={page:1};this.noUrlParameters||await this.$router.push({query:{...t}}),this.queryParams={...this.noUrlParameters?{}:(n=this.$route)==null?void 0:n.query},this.afterReset(),this.handleQuery()}}});function X(t,n,o,a,l,s){const r=e.resolveComponent("Input"),i=e.resolveComponent("Radio"),p=e.resolveComponent("Select"),m=e.resolveComponent("Divider"),d=e.resolveComponent("Cascader"),y=e.resolveComponent("DatePicker"),b=e.resolveComponent("InputNumber"),B=e.resolveComponent("InputMobileVerification"),V=e.resolveComponent("InputGraphicVerification"),_=e.resolveComponent("el-form-item"),g=e.resolveComponent("el-button"),S=e.resolveComponent("el-form"),P=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(S,e.mergeProps({model:t.queryParams,ref:"queryFormRef",inline:"","label-position":"left","label-width":t.labelWidth},t.$attrs),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formItem,c=>(e.openBlock(),e.createBlock(_,{label:c.label,prop:c.prop,key:c.prop,rules:c.rules},{default:e.withCtx(()=>[c.type==="input"?(e.openBlock(),e.createBlock(r,{key:0,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="radio"?(e.openBlock(),e.createBlock(i,{key:1,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="select"?(e.openBlock(),e.createBlock(p,{key:2,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="divider"?(e.openBlock(),e.createBlock(m,{key:3,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="cascader"?(e.openBlock(),e.createBlock(d,{key:4,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="date-picker"?(e.openBlock(),e.createBlock(y,{key:5,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="input-number"?(e.openBlock(),e.createBlock(b,{key:6,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="form-item-slot"?e.renderSlot(t.$slots,c.name,{key:7}):e.createCommentVNode("",!0),c.type==="input-mobile-verification"?(e.openBlock(),e.createBlock(B,{key:8,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="input-graphic-verification"?(e.openBlock(),e.createBlock(V,{item:c,key:c.key},null,8,["item"])):e.createCommentVNode("",!0)]),_:2},1032,["label","prop","rules"]))),128)),e.renderSlot(t.$slots,"default"),t.formOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_,{key:0},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(g,{type:"primary",size:t.size,onClick:t.handleQuery},{default:e.withCtx(()=>[e.createTextVNode("查询")]),_:1},8,["size","onClick"])),[[P,t.formLoading]]),e.createVNode(g,{size:t.size,onClick:t.resetQuery},{default:e.withCtx(()=>[e.createTextVNode("重置")]),_:1},8,["size","onClick"])]),_:1})),e.renderSlot(t.$slots,"behind-the-button")]),_:3},16,["model","label-width"])),[[e.vShow,t.showSearch]])}const Y=u(J,[["render",X]]),Z=["infinite-scroll-disabled"],v=e.defineComponent({__name:"InfiniteScrollList",props:{search:{type:Function,required:!0},id:{type:String,required:!0},name:{type:String,required:!0},extra:{type:Function,required:!1}},setup(t,{expose:n}){const o=t,{search:a,id:l,name:s,extra:r}=o,i=e.ref([]),p=e.ref(1),m=e.ref(!1),d=e.ref([]),y=e.ref(!1),b=()=>{p.value=1,i.value=[],d.value=[],m.value=!1},B=async()=>{if(y.value||m.value)return;y.value=!0;const _=await a(p.value);_&&_.length>0?(i.value=[...i.value,..._],p.value+=1):m.value=!0,y.value=!1},V=e.computed(()=>i.value.filter(_=>d.value.includes(_[l])))||{};return n({reset:b,loadList:B,selectInfo:V}),(_,g)=>{const S=e.resolveComponent("el-checkbox"),P=e.resolveComponent("el-checkbox-group"),c=e.resolveDirective("infinite-scroll"),le=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(P,e.mergeProps({modelValue:d.value,"onUpdate:modelValue":g[0]||(g[0]=k=>d.value=k)},o),{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("ul",{class:"list","infinite-scroll-disabled":m.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,k=>(e.openBlock(),e.createElementBlock("li",{key:k[e.unref(l)],class:"list-item"},[e.createVNode(S,{label:k[e.unref(l)],class:"checkbox"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k[e.unref(s)])+" "+e.toDisplayString(e.unref(r)&&e.unref(r)(k)),1)]),_:2},1032,["label"])]))),128))],8,Z)),[[c,B]])]),_:1},16,["modelValue"])),[[le,y.value]])}}}),ae="",ee=u(v,[["__scopeId","data-v-fda8f794"]]),te=e.defineComponent({__name:"Descriptions",props:{formData:{type:Object,required:!0},descriptionsItemProps:{type:Object,required:!1},formItem:{type:Array,required:!0}},setup(t){const n=t;return(o,a)=>{const l=e.resolveComponent("el-descriptions-item"),s=e.resolveComponent("el-descriptions");return e.openBlock(),e.createBlock(s,e.mergeProps({column:1,border:"",class:"form-width"},n),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.formItem,(r,i)=>(e.openBlock(),e.createBlock(l,e.mergeProps({key:r.prop,label:r.label},n.descriptionsItemProps),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.render?r.render({row:t.formData,$index:i}):t.formData[r.prop]),1)]),_:2},1040,["label"]))),128))]),_:1},16)}}}),oe=Y,ne=ee,re=te;f.VDescriptions=re,f.VGeneralBasicForm=oe,f.VInfiniteScrollList=ne,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|