general-basic-form 2.0.36 → 2.0.37
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 +4 -2
- package/dist/index.js +227 -213
- package/dist/index.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +61 -61
package/README.md
CHANGED
|
@@ -483,8 +483,10 @@ defaultSelection:包含数据key值的对象数组或者直接传入key值数
|
|
|
483
483
|
|
|
484
484
|
```
|
|
485
485
|
defineExpose({ reset, loadList, selectInfo, list, ifbottom });
|
|
486
|
-
InfiniteScrollListRef
|
|
487
|
-
InfiniteScrollListRef
|
|
486
|
+
InfiniteScrollListRef?.value?.reset():重置列表内容
|
|
487
|
+
InfiniteScrollListRef?.value?.lowReset():重置列表内容,但保留已选择的选项
|
|
488
|
+
InfiniteScrollListRef?.value?.loadList():向下滚动列表内容,受到loading和ifbottom的影响
|
|
489
|
+
InfiniteScrollListRef?.value?.refreshList():刷新列表,滚动列表会对整个内容重新请求数据,已选择的内容会自动选择
|
|
488
490
|
InfiniteScrollListRef?.value?.selectInfo:选择的内容
|
|
489
491
|
InfiniteScrollListRef?.value?.list:列表的内容
|
|
490
492
|
InfiniteScrollListRef?.value?.ifbottom:是否到底部
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as k, inject as h, resolveComponent as d, openBlock as n, createBlock as u, mergeProps as b, withKeys as ne, createSlots as J, renderList as $, withCtx as f, resolveDynamicComponent as W, createCommentVNode as y, ref as g, unref as m, resolveDirective as G, withDirectives as C, createElementBlock as S, createVNode as T, createElementVNode as H, computed as j, onBeforeUnmount as oe, normalizeStyle as re, createTextVNode as V, toDisplayString as D, h as se, normalizeProps as ae, guardReactiveProps as ie, Fragment as I, provide as O, renderSlot as Q, vShow as le, watch as ue } from "vue";
|
|
2
|
+
import { useRoute as ce } from "vue-router";
|
|
3
|
+
const X = {
|
|
4
4
|
placeholder: "请输入",
|
|
5
5
|
style: "width: 200px",
|
|
6
6
|
clearable: !0
|
|
7
|
-
},
|
|
7
|
+
}, pe = {
|
|
8
8
|
style: "width: 227px",
|
|
9
9
|
"start-placeholder": "开始日期",
|
|
10
10
|
"end-placeholder": "结束日期",
|
|
11
11
|
type: "daterange"
|
|
12
|
-
},
|
|
12
|
+
}, Y = {
|
|
13
13
|
placeholder: "请选择",
|
|
14
14
|
filterable: !0,
|
|
15
15
|
clearable: !0,
|
|
16
16
|
style: "width: 200px"
|
|
17
|
-
},
|
|
17
|
+
}, de = k({
|
|
18
18
|
components: {
|
|
19
19
|
InputArchive: (e) => {
|
|
20
20
|
const { templateEle: o } = e;
|
|
@@ -32,7 +32,7 @@ const W = {
|
|
|
32
32
|
data() {
|
|
33
33
|
return {
|
|
34
34
|
inputSetting: {
|
|
35
|
-
...
|
|
35
|
+
...X,
|
|
36
36
|
...this.item.inputSetting
|
|
37
37
|
}
|
|
38
38
|
};
|
|
@@ -54,24 +54,24 @@ const W = {
|
|
|
54
54
|
// console.log(val);
|
|
55
55
|
// },
|
|
56
56
|
// },
|
|
57
|
-
}),
|
|
57
|
+
}), w = (e, o) => {
|
|
58
58
|
const t = e.__vccOpts || e;
|
|
59
|
-
for (const [
|
|
60
|
-
t[
|
|
59
|
+
for (const [c, a] of o)
|
|
60
|
+
t[c] = a;
|
|
61
61
|
return t;
|
|
62
62
|
};
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
return n(),
|
|
66
|
-
onKeydown:
|
|
63
|
+
function me(e, o, t, c, a, s) {
|
|
64
|
+
const l = d("el-input");
|
|
65
|
+
return n(), u(l, b({
|
|
66
|
+
onKeydown: ne(e.getList, ["enter"]),
|
|
67
67
|
modelValue: e.queryParams[e.item.prop],
|
|
68
68
|
"onUpdate:modelValue": o[0] || (o[0] = (r) => e.queryParams[e.item.prop] = r),
|
|
69
69
|
size: e.size
|
|
70
|
-
}, e.inputSetting),
|
|
71
|
-
|
|
70
|
+
}, e.inputSetting), J({ _: 2 }, [
|
|
71
|
+
$(e.item.template, (r, _) => ({
|
|
72
72
|
name: _,
|
|
73
73
|
fn: f(() => [
|
|
74
|
-
r ? (n(),
|
|
74
|
+
r ? (n(), u(W(e.currentInputComponent()), {
|
|
75
75
|
key: _,
|
|
76
76
|
templateEle: r
|
|
77
77
|
}, null, 8, ["templateEle"])) : y("", !0)
|
|
@@ -79,64 +79,64 @@ function ce(e, o, t, l, a, s) {
|
|
|
79
79
|
}))
|
|
80
80
|
]), 1040, ["onKeydown", "modelValue", "size"]);
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const K = /* @__PURE__ */ w(de, [["render", me]]), _e = /* @__PURE__ */ k({
|
|
83
83
|
__name: "index",
|
|
84
84
|
props: {
|
|
85
85
|
item: {}
|
|
86
86
|
},
|
|
87
87
|
setup(e) {
|
|
88
|
-
const { item: o } = e, t = h("queryParams", {}),
|
|
89
|
-
...
|
|
88
|
+
const { item: o } = e, t = h("queryParams", {}), c = h("size"), a = g({
|
|
89
|
+
...X,
|
|
90
90
|
...o.inputSetting
|
|
91
91
|
});
|
|
92
|
-
return (s,
|
|
92
|
+
return (s, l) => {
|
|
93
93
|
const r = d("el-input-number");
|
|
94
|
-
return n(),
|
|
94
|
+
return n(), u(r, b({
|
|
95
95
|
modelValue: m(t)[s.item.prop],
|
|
96
|
-
"onUpdate:modelValue":
|
|
97
|
-
size: m(
|
|
96
|
+
"onUpdate:modelValue": l[0] || (l[0] = (_) => m(t)[s.item.prop] = _),
|
|
97
|
+
size: m(c)
|
|
98
98
|
}, a.value), null, 16, ["modelValue", "size"]);
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
}),
|
|
101
|
+
}), Z = Symbol(), fe = { class: "input-graphic-verification" }, ye = ["src"], he = /* @__PURE__ */ k({
|
|
102
102
|
__name: "index",
|
|
103
103
|
props: {
|
|
104
104
|
item: {}
|
|
105
105
|
},
|
|
106
106
|
setup(e) {
|
|
107
|
-
const { item: o } = e, { graphicSrc: t = "", getGraphic:
|
|
108
|
-
} } = o, { formLoading: a, updateFormLoading: s } = h(
|
|
109
|
-
|
|
107
|
+
const { item: o } = e, { graphicSrc: t = "", getGraphic: c = () => {
|
|
108
|
+
} } = o, { formLoading: a, updateFormLoading: s } = h(Z), l = async () => {
|
|
109
|
+
c && !a.value && await c();
|
|
110
110
|
};
|
|
111
111
|
return (r, _) => {
|
|
112
|
-
const
|
|
113
|
-
return
|
|
114
|
-
|
|
112
|
+
const p = G("loading");
|
|
113
|
+
return C((n(), S("div", fe, [
|
|
114
|
+
T(K, {
|
|
115
115
|
item: r.item,
|
|
116
116
|
class: "input"
|
|
117
117
|
}, null, 8, ["item"]),
|
|
118
|
-
|
|
118
|
+
H("img", {
|
|
119
119
|
class: "graphic",
|
|
120
|
-
onClick:
|
|
120
|
+
onClick: l,
|
|
121
121
|
src: m(t)
|
|
122
|
-
}, null, 8,
|
|
122
|
+
}, null, 8, ye)
|
|
123
123
|
])), [
|
|
124
|
-
[
|
|
124
|
+
[p, m(a)]
|
|
125
125
|
]);
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
|
-
const
|
|
129
|
+
const ve = /* @__PURE__ */ w(he, [["__scopeId", "data-v-500ec9b0"]]), B = "获取验证码", ge = 60, be = /* @__PURE__ */ k({
|
|
130
130
|
__name: "verification-button",
|
|
131
131
|
props: {
|
|
132
132
|
getSmscode: { type: Function }
|
|
133
133
|
},
|
|
134
134
|
setup(e) {
|
|
135
|
-
const { getSmscode: o } = e, t =
|
|
136
|
-
|
|
137
|
-
},
|
|
135
|
+
const { getSmscode: o } = e, t = g(B), c = g(null), a = j(() => t.value === B), s = () => {
|
|
136
|
+
c && (clearInterval(c.value), c.value = null, t.value = B);
|
|
137
|
+
}, l = async () => {
|
|
138
138
|
if (t.value === B)
|
|
139
|
-
if (t.value =
|
|
139
|
+
if (t.value = ge, c.value = setInterval(() => {
|
|
140
140
|
if (Number(t.value) <= 0 || !t.value) {
|
|
141
141
|
s();
|
|
142
142
|
return;
|
|
@@ -147,27 +147,27 @@ const fe = /* @__PURE__ */ x(_e, [["__scopeId", "data-v-500ec9b0"]]), B = "获
|
|
|
147
147
|
else
|
|
148
148
|
return;
|
|
149
149
|
};
|
|
150
|
-
return
|
|
150
|
+
return oe(() => {
|
|
151
151
|
s();
|
|
152
152
|
}), (r, _) => {
|
|
153
|
-
const
|
|
154
|
-
return n(),
|
|
153
|
+
const p = d("el-button");
|
|
154
|
+
return n(), u(p, {
|
|
155
155
|
class: "verifiaction-button",
|
|
156
|
-
style:
|
|
156
|
+
style: re({
|
|
157
157
|
color: a.value ? "var(--color-primary, #409EFF)" : "var(--text-color-placeholder, #A8ABB2)",
|
|
158
158
|
cursor: a.value ? "pointer" : "default"
|
|
159
159
|
}),
|
|
160
|
-
onClick:
|
|
160
|
+
onClick: l
|
|
161
161
|
}, {
|
|
162
162
|
default: f(() => [
|
|
163
|
-
|
|
163
|
+
V(D(a.value ? B : t.value + "s"), 1)
|
|
164
164
|
]),
|
|
165
165
|
_: 1
|
|
166
166
|
}, 8, ["style"]);
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
|
-
const
|
|
170
|
+
const ke = /* @__PURE__ */ w(be, [["__scopeId", "data-v-4074e137"]]), Se = /* @__PURE__ */ k({
|
|
171
171
|
__name: "index",
|
|
172
172
|
props: {
|
|
173
173
|
item: {}
|
|
@@ -175,15 +175,15 @@ const ve = /* @__PURE__ */ x(he, [["__scopeId", "data-v-4074e137"]]), ge = /* @_
|
|
|
175
175
|
setup(e) {
|
|
176
176
|
const { item: o } = e, t = o;
|
|
177
177
|
return t.template = {
|
|
178
|
-
append: () =>
|
|
178
|
+
append: () => se(ke, {
|
|
179
179
|
getSmscode: t.getSmscode
|
|
180
180
|
})
|
|
181
|
-
}, (
|
|
181
|
+
}, (c, a) => (n(), u(K, {
|
|
182
182
|
item: m(t),
|
|
183
183
|
class: "input"
|
|
184
184
|
}, null, 8, ["item"]));
|
|
185
185
|
}
|
|
186
|
-
}),
|
|
186
|
+
}), ze = k({
|
|
187
187
|
components: {
|
|
188
188
|
slotArchive: (e) => {
|
|
189
189
|
const { templateEle: o } = e;
|
|
@@ -209,13 +209,13 @@ const ve = /* @__PURE__ */ x(he, [["__scopeId", "data-v-4074e137"]]), ge = /* @_
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
|
-
function
|
|
213
|
-
const
|
|
214
|
-
return n(),
|
|
215
|
-
|
|
212
|
+
function $e(e, o, t, c, a, s) {
|
|
213
|
+
const l = d("el-divider");
|
|
214
|
+
return n(), u(l, ae(ie(e.dividerSetting)), J({ _: 2 }, [
|
|
215
|
+
$(e.item.template, (r, _) => ({
|
|
216
216
|
name: _,
|
|
217
217
|
fn: f(() => [
|
|
218
|
-
r ? (n(),
|
|
218
|
+
r ? (n(), u(W(e.currentInputComponent()), {
|
|
219
219
|
key: _,
|
|
220
220
|
templateEle: r
|
|
221
221
|
}, null, 8, ["templateEle"])) : y("", !0)
|
|
@@ -223,29 +223,29 @@ function ke(e, o, t, l, a, s) {
|
|
|
223
223
|
}))
|
|
224
224
|
]), 1040);
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const Pe = /* @__PURE__ */ w(ze, [["render", $e]]), qe = /* @__PURE__ */ k({
|
|
227
227
|
__name: "index",
|
|
228
228
|
props: {
|
|
229
229
|
item: {}
|
|
230
230
|
},
|
|
231
231
|
setup(e) {
|
|
232
|
-
const { item: o } = e, t = h("queryParams", {}),
|
|
232
|
+
const { item: o } = e, t = h("queryParams", {}), c = h("size"), a = g({
|
|
233
233
|
...o.radioGroupSetting
|
|
234
234
|
});
|
|
235
|
-
return (s,
|
|
235
|
+
return (s, l) => {
|
|
236
236
|
const r = d("el-radio"), _ = d("el-radio-group");
|
|
237
|
-
return n(),
|
|
237
|
+
return n(), u(_, b({
|
|
238
238
|
modelValue: m(t)[s.item.prop],
|
|
239
|
-
"onUpdate:modelValue":
|
|
240
|
-
size: m(
|
|
239
|
+
"onUpdate:modelValue": l[0] || (l[0] = (p) => m(t)[s.item.prop] = p),
|
|
240
|
+
size: m(c)
|
|
241
241
|
}, a.value), {
|
|
242
242
|
default: f(() => [
|
|
243
|
-
(n(!0), S(
|
|
244
|
-
size: m(
|
|
245
|
-
key:
|
|
246
|
-
},
|
|
243
|
+
(n(!0), S(I, null, $(s.item.option || [], (p) => (n(), u(r, b({
|
|
244
|
+
size: m(c),
|
|
245
|
+
key: p.label
|
|
246
|
+
}, p), {
|
|
247
247
|
default: f(() => [
|
|
248
|
-
|
|
248
|
+
V(D(p.value), 1)
|
|
249
249
|
]),
|
|
250
250
|
_: 2
|
|
251
251
|
}, 1040, ["size"]))), 128))
|
|
@@ -254,29 +254,29 @@ const Se = /* @__PURE__ */ x(be, [["render", ke]]), ze = /* @__PURE__ */ b({
|
|
|
254
254
|
}, 16, ["modelValue", "size"]);
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
}),
|
|
257
|
+
}), Ve = /* @__PURE__ */ k({
|
|
258
258
|
__name: "index",
|
|
259
259
|
props: {
|
|
260
260
|
item: {}
|
|
261
261
|
},
|
|
262
262
|
setup(e) {
|
|
263
|
-
const { item: o } = e, t = h("queryParams", {}),
|
|
263
|
+
const { item: o } = e, t = h("queryParams", {}), c = h("size"), a = g({
|
|
264
264
|
...o.checkboxGroupSetting
|
|
265
265
|
});
|
|
266
|
-
return (s,
|
|
266
|
+
return (s, l) => {
|
|
267
267
|
const r = d("el-checkbox"), _ = d("el-checkbox-group");
|
|
268
|
-
return n(),
|
|
268
|
+
return n(), u(_, b({
|
|
269
269
|
modelValue: m(t)[s.item.prop],
|
|
270
|
-
"onUpdate:modelValue":
|
|
271
|
-
size: m(
|
|
270
|
+
"onUpdate:modelValue": l[0] || (l[0] = (p) => m(t)[s.item.prop] = p),
|
|
271
|
+
size: m(c)
|
|
272
272
|
}, a.value), {
|
|
273
273
|
default: f(() => [
|
|
274
|
-
(n(!0), S(
|
|
275
|
-
size: m(
|
|
276
|
-
key:
|
|
277
|
-
},
|
|
274
|
+
(n(!0), S(I, null, $(s.item.option || [], (p) => (n(), u(r, b({
|
|
275
|
+
size: m(c),
|
|
276
|
+
key: p.label
|
|
277
|
+
}, p), {
|
|
278
278
|
default: f(() => [
|
|
279
|
-
|
|
279
|
+
V(D(p.value), 1)
|
|
280
280
|
]),
|
|
281
281
|
_: 2
|
|
282
282
|
}, 1040, ["size"]))), 128))
|
|
@@ -285,86 +285,86 @@ const Se = /* @__PURE__ */ x(be, [["render", ke]]), ze = /* @__PURE__ */ b({
|
|
|
285
285
|
}, 16, ["modelValue", "size"]);
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
|
-
}),
|
|
288
|
+
}), Ie = /* @__PURE__ */ k({
|
|
289
289
|
__name: "index",
|
|
290
290
|
props: {
|
|
291
291
|
item: {}
|
|
292
292
|
},
|
|
293
293
|
setup(e) {
|
|
294
|
-
const { item: o } = e, t = h("queryParams", {}),
|
|
295
|
-
...
|
|
294
|
+
const { item: o } = e, t = h("queryParams", {}), c = h("size"), a = g({
|
|
295
|
+
...pe,
|
|
296
296
|
...o.datePackerSetting
|
|
297
297
|
});
|
|
298
|
-
return (s,
|
|
298
|
+
return (s, l) => {
|
|
299
299
|
const r = d("el-date-picker");
|
|
300
|
-
return n(),
|
|
300
|
+
return n(), u(r, b({
|
|
301
301
|
modelValue: m(t)[s.item.prop],
|
|
302
|
-
"onUpdate:modelValue":
|
|
303
|
-
size: m(
|
|
302
|
+
"onUpdate:modelValue": l[0] || (l[0] = (_) => m(t)[s.item.prop] = _),
|
|
303
|
+
size: m(c)
|
|
304
304
|
}, a.value), null, 16, ["modelValue", "size"]);
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
-
}),
|
|
307
|
+
}), Le = /* @__PURE__ */ k({
|
|
308
308
|
__name: "index",
|
|
309
309
|
props: {
|
|
310
310
|
item: {}
|
|
311
311
|
},
|
|
312
312
|
setup(e) {
|
|
313
|
-
const { item: o } = e, t = h("queryParams", {}),
|
|
314
|
-
...
|
|
313
|
+
const { item: o } = e, t = h("queryParams", {}), c = h("size"), a = g({
|
|
314
|
+
...Y,
|
|
315
315
|
...o.selectSetting
|
|
316
316
|
});
|
|
317
|
-
return (s,
|
|
317
|
+
return (s, l) => {
|
|
318
318
|
const r = d("el-option"), _ = d("el-select");
|
|
319
|
-
return n(),
|
|
319
|
+
return n(), u(_, b({
|
|
320
320
|
modelValue: m(t)[s.item.prop],
|
|
321
|
-
"onUpdate:modelValue":
|
|
322
|
-
size: m(
|
|
321
|
+
"onUpdate:modelValue": l[0] || (l[0] = (p) => m(t)[s.item.prop] = p),
|
|
322
|
+
size: m(c)
|
|
323
323
|
}, a.value), {
|
|
324
324
|
default: f(() => [
|
|
325
|
-
(n(!0), S(
|
|
326
|
-
key:
|
|
327
|
-
label:
|
|
328
|
-
value:
|
|
325
|
+
(n(!0), S(I, null, $(s.item.option || [], (p) => (n(), u(r, {
|
|
326
|
+
key: p.value,
|
|
327
|
+
label: p.label,
|
|
328
|
+
value: p.value
|
|
329
329
|
}, null, 8, ["label", "value"]))), 128))
|
|
330
330
|
]),
|
|
331
331
|
_: 1
|
|
332
332
|
}, 16, ["modelValue", "size"]);
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
|
-
}),
|
|
335
|
+
}), Ce = /* @__PURE__ */ k({
|
|
336
336
|
__name: "index",
|
|
337
337
|
props: {
|
|
338
338
|
item: {}
|
|
339
339
|
},
|
|
340
340
|
setup(e) {
|
|
341
|
-
const { item: o } = e, t = h("queryParams", {}),
|
|
342
|
-
...
|
|
341
|
+
const { item: o } = e, t = h("queryParams", {}), c = h("size"), a = g({
|
|
342
|
+
...Y,
|
|
343
343
|
...o.selectSetting
|
|
344
344
|
});
|
|
345
|
-
return (s,
|
|
345
|
+
return (s, l) => {
|
|
346
346
|
const r = d("el-cascader");
|
|
347
|
-
return n(),
|
|
347
|
+
return n(), u(r, b({
|
|
348
348
|
modelValue: m(t)[s.item.prop],
|
|
349
|
-
"onUpdate:modelValue":
|
|
350
|
-
size: m(
|
|
349
|
+
"onUpdate:modelValue": l[0] || (l[0] = (_) => m(t)[s.item.prop] = _),
|
|
350
|
+
size: m(c),
|
|
351
351
|
options: s.item.options || []
|
|
352
352
|
}, a.value), null, 16, ["modelValue", "size", "options"]);
|
|
353
353
|
};
|
|
354
354
|
}
|
|
355
|
-
}),
|
|
355
|
+
}), De = k({
|
|
356
356
|
name: "GeneralBasicForm",
|
|
357
357
|
components: {
|
|
358
|
-
Input:
|
|
359
|
-
InputNumber:
|
|
360
|
-
InputGraphicVerification:
|
|
361
|
-
InputMobileVerification:
|
|
362
|
-
Divider:
|
|
363
|
-
Radio:
|
|
364
|
-
Checkbox:
|
|
365
|
-
DatePicker:
|
|
366
|
-
Select:
|
|
367
|
-
Cascader:
|
|
358
|
+
Input: K,
|
|
359
|
+
InputNumber: _e,
|
|
360
|
+
InputGraphicVerification: ve,
|
|
361
|
+
InputMobileVerification: Se,
|
|
362
|
+
Divider: Pe,
|
|
363
|
+
Radio: qe,
|
|
364
|
+
Checkbox: Ve,
|
|
365
|
+
DatePicker: Ie,
|
|
366
|
+
Select: Le,
|
|
367
|
+
Cascader: Ce
|
|
368
368
|
},
|
|
369
369
|
props: {
|
|
370
370
|
showSearch: {
|
|
@@ -427,24 +427,24 @@ const Se = /* @__PURE__ */ x(be, [["render", ke]]), ze = /* @__PURE__ */ b({
|
|
|
427
427
|
};
|
|
428
428
|
},
|
|
429
429
|
setup(e) {
|
|
430
|
-
const { size: o, noUrlParameters: t, getList:
|
|
430
|
+
const { size: o, noUrlParameters: t, getList: c } = e, a = ce(), s = g({
|
|
431
431
|
...t ? {} : a == null ? void 0 : a.query
|
|
432
432
|
});
|
|
433
|
-
return
|
|
433
|
+
return O(
|
|
434
434
|
/* 注入名 */
|
|
435
435
|
"queryParams",
|
|
436
436
|
/* 值 */
|
|
437
437
|
s
|
|
438
|
-
),
|
|
438
|
+
), O(
|
|
439
439
|
/* 注入名 */
|
|
440
440
|
"size",
|
|
441
441
|
/* 值 */
|
|
442
442
|
o
|
|
443
|
-
),
|
|
443
|
+
), O(
|
|
444
444
|
/* 注入名 */
|
|
445
445
|
"getList",
|
|
446
446
|
/* 值 */
|
|
447
|
-
|
|
447
|
+
c
|
|
448
448
|
), {
|
|
449
449
|
queryParams: s
|
|
450
450
|
};
|
|
@@ -464,7 +464,7 @@ const Se = /* @__PURE__ */ x(be, [["render", ke]]), ze = /* @__PURE__ */ b({
|
|
|
464
464
|
},
|
|
465
465
|
queryParams: {
|
|
466
466
|
handler(e) {
|
|
467
|
-
this.$emit("update:
|
|
467
|
+
this.$emit("update:formData", e);
|
|
468
468
|
},
|
|
469
469
|
deep: !0
|
|
470
470
|
},
|
|
@@ -478,8 +478,8 @@ const Se = /* @__PURE__ */ x(be, [["render", ke]]), ze = /* @__PURE__ */ b({
|
|
|
478
478
|
provide() {
|
|
479
479
|
return {
|
|
480
480
|
// 显式提供一个计算属性
|
|
481
|
-
[
|
|
482
|
-
formLoading:
|
|
481
|
+
[Z]: {
|
|
482
|
+
formLoading: j(() => this.formLoading),
|
|
483
483
|
updateFormLoading: (e) => {
|
|
484
484
|
this.formLoading = e;
|
|
485
485
|
}
|
|
@@ -514,9 +514,9 @@ const Se = /* @__PURE__ */ x(be, [["render", ke]]), ze = /* @__PURE__ */ b({
|
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
516
|
});
|
|
517
|
-
function
|
|
518
|
-
const
|
|
519
|
-
return
|
|
517
|
+
function we(e, o, t, c, a, s) {
|
|
518
|
+
const l = d("Input"), r = d("Radio"), _ = d("Select"), p = d("Divider"), P = d("Cascader"), L = d("Checkbox"), F = d("DatePicker"), N = d("InputNumber"), R = d("InputMobileVerification"), x = d("InputGraphicVerification"), q = d("el-form-item"), U = d("el-button"), E = d("el-form"), v = G("loading");
|
|
519
|
+
return C((n(), u(E, b({
|
|
520
520
|
model: e.queryParams,
|
|
521
521
|
ref: "queryFormRef",
|
|
522
522
|
inline: "",
|
|
@@ -524,92 +524,92 @@ function Le(e, o, t, l, a, s) {
|
|
|
524
524
|
"label-width": e.labelWidth
|
|
525
525
|
}, e.$attrs), {
|
|
526
526
|
default: f(() => [
|
|
527
|
-
(n(!0), S(
|
|
528
|
-
label:
|
|
529
|
-
prop:
|
|
530
|
-
key:
|
|
531
|
-
rules:
|
|
527
|
+
(n(!0), S(I, null, $(e.formItem, (i) => (n(), u(q, {
|
|
528
|
+
label: i.label,
|
|
529
|
+
prop: i.prop,
|
|
530
|
+
key: i.prop,
|
|
531
|
+
rules: i.rules
|
|
532
532
|
}, {
|
|
533
533
|
default: f(() => [
|
|
534
|
-
|
|
534
|
+
i.type === "input" ? (n(), u(l, {
|
|
535
535
|
key: 0,
|
|
536
|
-
item:
|
|
536
|
+
item: i
|
|
537
537
|
}, null, 8, ["item"])) : y("", !0),
|
|
538
|
-
|
|
538
|
+
i.type === "radio" ? (n(), u(r, {
|
|
539
539
|
key: 1,
|
|
540
|
-
item:
|
|
540
|
+
item: i
|
|
541
541
|
}, null, 8, ["item"])) : y("", !0),
|
|
542
|
-
|
|
542
|
+
i.type === "select" ? (n(), u(_, {
|
|
543
543
|
key: 2,
|
|
544
|
-
item:
|
|
544
|
+
item: i
|
|
545
545
|
}, null, 8, ["item"])) : y("", !0),
|
|
546
|
-
|
|
546
|
+
i.type === "divider" ? (n(), u(p, {
|
|
547
547
|
key: 3,
|
|
548
|
-
item:
|
|
548
|
+
item: i
|
|
549
549
|
}, null, 8, ["item"])) : y("", !0),
|
|
550
|
-
|
|
550
|
+
i.type === "cascader" ? (n(), u(P, {
|
|
551
551
|
key: 4,
|
|
552
|
-
item:
|
|
552
|
+
item: i
|
|
553
553
|
}, null, 8, ["item"])) : y("", !0),
|
|
554
|
-
|
|
554
|
+
i.type === "checkbox" ? (n(), u(L, {
|
|
555
555
|
key: 5,
|
|
556
|
-
item:
|
|
556
|
+
item: i
|
|
557
557
|
}, null, 8, ["item"])) : y("", !0),
|
|
558
|
-
|
|
558
|
+
i.type === "date-picker" ? (n(), u(F, {
|
|
559
559
|
key: 6,
|
|
560
|
-
item:
|
|
560
|
+
item: i
|
|
561
561
|
}, null, 8, ["item"])) : y("", !0),
|
|
562
|
-
|
|
562
|
+
i.type === "input-number" ? (n(), u(N, {
|
|
563
563
|
key: 7,
|
|
564
|
-
item:
|
|
564
|
+
item: i
|
|
565
565
|
}, null, 8, ["item"])) : y("", !0),
|
|
566
|
-
|
|
567
|
-
|
|
566
|
+
i.type === "form-item-slot" ? Q(e.$slots, i.name, { key: 8 }) : y("", !0),
|
|
567
|
+
i.type === "input-mobile-verification" ? (n(), u(R, {
|
|
568
568
|
key: 9,
|
|
569
|
-
item:
|
|
569
|
+
item: i
|
|
570
570
|
}, null, 8, ["item"])) : y("", !0),
|
|
571
|
-
|
|
572
|
-
item:
|
|
573
|
-
key:
|
|
571
|
+
i.type === "input-graphic-verification" ? (n(), u(x, {
|
|
572
|
+
item: i,
|
|
573
|
+
key: i.key
|
|
574
574
|
}, null, 8, ["item"])) : y("", !0)
|
|
575
575
|
]),
|
|
576
576
|
_: 2
|
|
577
577
|
}, 1032, ["label", "prop", "rules"]))), 128)),
|
|
578
|
-
|
|
579
|
-
e.formOnly ? y("", !0) : (n(),
|
|
578
|
+
Q(e.$slots, "default"),
|
|
579
|
+
e.formOnly ? y("", !0) : (n(), u(q, { key: 0 }, {
|
|
580
580
|
default: f(() => [
|
|
581
|
-
|
|
581
|
+
C((n(), u(U, {
|
|
582
582
|
type: "primary",
|
|
583
583
|
size: e.size,
|
|
584
584
|
onClick: e.handleQuery
|
|
585
585
|
}, {
|
|
586
586
|
default: f(() => [
|
|
587
|
-
|
|
587
|
+
V("查询")
|
|
588
588
|
]),
|
|
589
589
|
_: 1
|
|
590
590
|
}, 8, ["size", "onClick"])), [
|
|
591
|
-
[
|
|
591
|
+
[v, e.formLoading]
|
|
592
592
|
]),
|
|
593
|
-
|
|
593
|
+
T(U, {
|
|
594
594
|
size: e.size,
|
|
595
595
|
onClick: e.resetQuery
|
|
596
596
|
}, {
|
|
597
597
|
default: f(() => [
|
|
598
|
-
|
|
598
|
+
V("重置")
|
|
599
599
|
]),
|
|
600
600
|
_: 1
|
|
601
601
|
}, 8, ["size", "onClick"])
|
|
602
602
|
]),
|
|
603
603
|
_: 1
|
|
604
604
|
})),
|
|
605
|
-
|
|
605
|
+
Q(e.$slots, "behind-the-button")
|
|
606
606
|
]),
|
|
607
607
|
_: 3
|
|
608
608
|
}, 16, ["model", "label-width"])), [
|
|
609
|
-
[
|
|
609
|
+
[le, e.showSearch]
|
|
610
610
|
]);
|
|
611
611
|
}
|
|
612
|
-
const
|
|
612
|
+
const xe = /* @__PURE__ */ w(De, [["render", we]]), Be = ["infinite-scroll-disabled"], Fe = ["infinite-scroll-disabled"], Ue = { class: "checkbox" }, Ge = /* @__PURE__ */ k({
|
|
613
613
|
__name: "InfiniteScrollList",
|
|
614
614
|
props: {
|
|
615
615
|
search: {
|
|
@@ -629,7 +629,7 @@ const Ce = /* @__PURE__ */ x(Ie, [["render", Le]]), De = ["infinite-scroll-disab
|
|
|
629
629
|
required: !0
|
|
630
630
|
},
|
|
631
631
|
extra: {
|
|
632
|
-
type:
|
|
632
|
+
type: null,
|
|
633
633
|
required: !1
|
|
634
634
|
},
|
|
635
635
|
defaultSelection: {
|
|
@@ -638,51 +638,65 @@ const Ce = /* @__PURE__ */ x(Ie, [["render", Le]]), De = ["infinite-scroll-disab
|
|
|
638
638
|
}
|
|
639
639
|
},
|
|
640
640
|
setup(e, { expose: o }) {
|
|
641
|
-
const t = e, { search:
|
|
642
|
-
const { i:
|
|
643
|
-
return
|
|
641
|
+
const t = e, { search: c, id: a, name: s, extra: l } = t, r = g([]), _ = g(1), p = g(!1), P = g([]), L = g(!1), F = (v, i) => {
|
|
642
|
+
const { i: A } = v;
|
|
643
|
+
return l && l !== "false" ? l(A) : "";
|
|
644
|
+
}, N = (v) => {
|
|
645
|
+
P.value = v.map((i) => typeof i == "object" ? i[a] : i);
|
|
644
646
|
};
|
|
645
|
-
|
|
647
|
+
ue(
|
|
646
648
|
() => t.defaultSelection,
|
|
647
|
-
(
|
|
648
|
-
|
|
649
|
+
(v = [], i = []) => {
|
|
650
|
+
N(v);
|
|
649
651
|
},
|
|
650
652
|
{ immediate: !0 }
|
|
651
653
|
);
|
|
652
|
-
const
|
|
653
|
-
|
|
654
|
-
},
|
|
655
|
-
|
|
654
|
+
const R = () => {
|
|
655
|
+
x(), P.value = [];
|
|
656
|
+
}, x = () => {
|
|
657
|
+
_.value = 1, r.value = [], p.value = !1;
|
|
658
|
+
}, q = async () => {
|
|
659
|
+
if (L.value || p.value)
|
|
656
660
|
return;
|
|
657
|
-
|
|
658
|
-
const
|
|
659
|
-
|
|
660
|
-
},
|
|
661
|
-
()
|
|
661
|
+
L.value = !0;
|
|
662
|
+
const v = await c(_.value);
|
|
663
|
+
v && v.length > 0 ? (r.value = [...r.value, ...v], _.value += 1) : p.value = !0, L.value = !1;
|
|
664
|
+
}, U = () => {
|
|
665
|
+
x(), q();
|
|
666
|
+
}, E = j(
|
|
667
|
+
() => r.value.filter((v) => P.value.includes(v[a]))
|
|
662
668
|
) || {};
|
|
663
|
-
return o({
|
|
664
|
-
|
|
665
|
-
|
|
669
|
+
return o({
|
|
670
|
+
reset: R,
|
|
671
|
+
lowReset: x,
|
|
672
|
+
loadList: q,
|
|
673
|
+
selectInfo: E,
|
|
674
|
+
list: r,
|
|
675
|
+
ifbottom: p,
|
|
676
|
+
refreshList: U
|
|
677
|
+
}), (v, i) => {
|
|
678
|
+
const A = d("el-checkbox"), ee = d("el-checkbox-group"), M = G("infinite-scroll"), te = G("loading");
|
|
679
|
+
return t.checkbox ? C((n(), u(ee, b({
|
|
666
680
|
key: 0,
|
|
667
|
-
modelValue:
|
|
668
|
-
"onUpdate:modelValue":
|
|
681
|
+
modelValue: P.value,
|
|
682
|
+
"onUpdate:modelValue": i[0] || (i[0] = (z) => P.value = z)
|
|
669
683
|
}, t), {
|
|
670
684
|
default: f(() => [
|
|
671
|
-
|
|
685
|
+
C((n(), S("ul", {
|
|
672
686
|
class: "list",
|
|
673
|
-
"infinite-scroll-disabled":
|
|
687
|
+
"infinite-scroll-disabled": p.value
|
|
674
688
|
}, [
|
|
675
|
-
(n(!0), S(
|
|
689
|
+
(n(!0), S(I, null, $(r.value, (z) => (n(), S("li", {
|
|
676
690
|
key: z[m(a)],
|
|
677
691
|
class: "list-item"
|
|
678
692
|
}, [
|
|
679
|
-
|
|
693
|
+
T(A, {
|
|
680
694
|
label: z[m(a)],
|
|
681
695
|
class: "checkbox"
|
|
682
696
|
}, {
|
|
683
697
|
default: f(() => [
|
|
684
|
-
|
|
685
|
-
t.extra ? (n(),
|
|
698
|
+
V(D(z[m(s)]) + " ", 1),
|
|
699
|
+
t.extra ? (n(), u(F, {
|
|
686
700
|
key: 0,
|
|
687
701
|
i: z
|
|
688
702
|
}, null, 8, ["i"])) : y("", !0)
|
|
@@ -690,37 +704,37 @@ const Ce = /* @__PURE__ */ x(Ie, [["render", Le]]), De = ["infinite-scroll-disab
|
|
|
690
704
|
_: 2
|
|
691
705
|
}, 1032, ["label"])
|
|
692
706
|
]))), 128))
|
|
693
|
-
], 8,
|
|
694
|
-
[
|
|
707
|
+
], 8, Be)), [
|
|
708
|
+
[M, q]
|
|
695
709
|
])
|
|
696
710
|
]),
|
|
697
711
|
_: 1
|
|
698
712
|
}, 16, ["modelValue"])), [
|
|
699
|
-
[
|
|
700
|
-
]) :
|
|
713
|
+
[te, L.value]
|
|
714
|
+
]) : C((n(), S("ul", b({
|
|
701
715
|
key: 1,
|
|
702
716
|
class: "list",
|
|
703
|
-
"infinite-scroll-disabled":
|
|
717
|
+
"infinite-scroll-disabled": p.value
|
|
704
718
|
}, t), [
|
|
705
|
-
(n(!0), S(
|
|
719
|
+
(n(!0), S(I, null, $(r.value, (z) => (n(), S("li", {
|
|
706
720
|
key: z[m(a)],
|
|
707
721
|
class: "list-item"
|
|
708
722
|
}, [
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
t.extra ? (n(),
|
|
723
|
+
H("div", Ue, [
|
|
724
|
+
V(D(z[m(s)]) + " ", 1),
|
|
725
|
+
t.extra ? (n(), u(F, {
|
|
712
726
|
key: 0,
|
|
713
727
|
i: z
|
|
714
728
|
}, null, 8, ["i"])) : y("", !0)
|
|
715
729
|
])
|
|
716
730
|
]))), 128))
|
|
717
|
-
], 16,
|
|
718
|
-
[
|
|
731
|
+
], 16, Fe)), [
|
|
732
|
+
[M, q]
|
|
719
733
|
]);
|
|
720
734
|
};
|
|
721
735
|
}
|
|
722
736
|
});
|
|
723
|
-
const
|
|
737
|
+
const Ne = /* @__PURE__ */ w(Ge, [["__scopeId", "data-v-fa74e9b9"]]), Re = { key: 1 }, Ee = /* @__PURE__ */ k({
|
|
724
738
|
__name: "Descriptions",
|
|
725
739
|
props: {
|
|
726
740
|
formData: {
|
|
@@ -733,32 +747,32 @@ const Be = /* @__PURE__ */ x(Fe, [["__scopeId", "data-v-6bf38adc"]]), Ue = { key
|
|
|
733
747
|
}
|
|
734
748
|
},
|
|
735
749
|
setup(e) {
|
|
736
|
-
const o = e, t = (
|
|
737
|
-
const { i: s, render:
|
|
738
|
-
return
|
|
750
|
+
const o = e, t = (c, a) => {
|
|
751
|
+
const { i: s, render: l, formData: r } = c;
|
|
752
|
+
return l({
|
|
739
753
|
row: r,
|
|
740
754
|
$index: s
|
|
741
755
|
});
|
|
742
756
|
};
|
|
743
|
-
return (
|
|
744
|
-
const s = d("el-descriptions-item"),
|
|
745
|
-
return n(),
|
|
757
|
+
return (c, a) => {
|
|
758
|
+
const s = d("el-descriptions-item"), l = d("el-descriptions");
|
|
759
|
+
return n(), u(l, b({
|
|
746
760
|
column: 1,
|
|
747
761
|
border: "",
|
|
748
762
|
class: "form-width"
|
|
749
763
|
}, o), {
|
|
750
764
|
default: f(() => [
|
|
751
|
-
(n(!0), S(
|
|
765
|
+
(n(!0), S(I, null, $(o.formItem, (r, _) => (n(), u(s, b({
|
|
752
766
|
key: r.prop,
|
|
753
767
|
label: r.label
|
|
754
768
|
}, r.descriptionsItemProps), {
|
|
755
769
|
default: f(() => [
|
|
756
|
-
r.render ? (n(),
|
|
770
|
+
r.render ? (n(), u(t, {
|
|
757
771
|
key: 0,
|
|
758
772
|
i: _,
|
|
759
773
|
render: r.render,
|
|
760
774
|
formData: e.formData
|
|
761
|
-
}, null, 8, ["i", "render", "formData"])) : (n(), S("span",
|
|
775
|
+
}, null, 8, ["i", "render", "formData"])) : (n(), S("span", Re, D(e.formData[r.prop]), 1))
|
|
762
776
|
]),
|
|
763
777
|
_: 2
|
|
764
778
|
}, 1040, ["label"]))), 128))
|
|
@@ -767,9 +781,9 @@ const Be = /* @__PURE__ */ x(Fe, [["__scopeId", "data-v-6bf38adc"]]), Ue = { key
|
|
|
767
781
|
}, 16);
|
|
768
782
|
};
|
|
769
783
|
}
|
|
770
|
-
}),
|
|
784
|
+
}), Qe = xe, Te = Ne, je = Ee;
|
|
771
785
|
export {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
786
|
+
je as VDescriptions,
|
|
787
|
+
Qe as VGeneralBasicForm,
|
|
788
|
+
Te as VInfiniteScrollList
|
|
775
789
|
};
|
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,q){"use strict";const w={placeholder:"请输入",style:"width: 200px",clearable:!0},D={style:"width: 227px","start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange"},x={placeholder:"请选择",filterable:!0,clearable:!0,style:"width: 200px"},L=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"}}}),h=(t,n)=>{const o=t.__vccOpts||t;for(const[s,i]of n)o[s]=i;return o};function I(t,n,o,s,i,l){const a=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(a,e.mergeProps({onKeydown:e.withKeys(t.getList,["enter"]),modelValue:t.queryParams[t.item.prop],"onUpdate:modelValue":n[0]||(n[0]=r=>t.queryParams[t.item.prop]=r),size:t.size},t.inputSetting),e.createSlots({_:2},[e.renderList(t.item.template,(r,m)=>({name:m,fn:e.withCtx(()=>[r?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.currentInputComponent()),{key:m,templateEle:r},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040,["onKeydown","modelValue","size"])}const V=h(L,[["render",I]]),N=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),s=e.inject("size"),i=e.ref({...w,...n.inputSetting});return(l,a)=>{const r=e.resolveComponent("el-input-number");return e.openBlock(),e.createBlock(r,e.mergeProps({modelValue:e.unref(o)[l.item.prop],"onUpdate:modelValue":a[0]||(a[0]=m=>e.unref(o)[l.item.prop]=m),size:e.unref(s)},i.value),null,16,["modelValue","size"])}}}),$=Symbol(),F={class:"input-graphic-verification"},E=["src"],j=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,{graphicSrc:o="",getGraphic:s=()=>{}}=n,{formLoading:i,updateFormLoading:l}=e.inject($),a=async()=>{s&&!i.value&&await s()};return(r,m)=>{const c=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",F,[e.createVNode(V,{item:r.item,class:"input"},null,8,["item"]),e.createElementVNode("img",{class:"graphic",onClick:a,src:e.unref(o)},null,8,E)])),[[c,e.unref(i)]])}}}),me="",U=h(j,[["__scopeId","data-v-500ec9b0"]]),B="获取验证码",T=60,G=e.defineComponent({__name:"verification-button",props:{getSmscode:{type:Function}},setup(t){const{getSmscode:n}=t,o=e.ref(B),s=e.ref(null),i=e.computed(()=>o.value===B),l=()=>{s&&(clearInterval(s.value),s.value=null,o.value=B)},a=async()=>{if(o.value===B)if(o.value=T,s.value=setInterval(()=>{if(Number(o.value)<=0||!o.value){l();return}else o.value=Number(o.value)-1},1e3),n)await n()===!1&&l();else return};return e.onBeforeUnmount(()=>{l()}),(r,m)=>{const c=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(c,{class:"verifiaction-button",style:e.normalizeStyle({color:i.value?"var(--color-primary, #409EFF)":"var(--text-color-placeholder, #A8ABB2)",cursor:i.value?"pointer":"default"}),onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value?B:o.value+"s"),1)]),_:1},8,["style"])}}}),de="",R=h(G,[["__scopeId","data-v-4074e137"]]),O=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=n;return o.template={append:()=>e.h(R,{getSmscode:o.getSmscode})},(s,i)=>(e.openBlock(),e.createBlock(V,{item:e.unref(o),class:"input"},null,8,["item"]))}}),A=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 Q(t,n,o,s,i,l){const a=e.resolveComponent("el-divider");return e.openBlock(),e.createBlock(a,e.normalizeProps(e.guardReactiveProps(t.dividerSetting)),e.createSlots({_:2},[e.renderList(t.item.template,(r,m)=>({name:m,fn:e.withCtx(()=>[r?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.currentInputComponent()),{key:m,templateEle:r},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040)}const K=h(A,[["render",Q]]),M=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),s=e.inject("size"),i=e.ref({...n.radioGroupSetting});return(l,a)=>{const r=e.resolveComponent("el-radio"),m=e.resolveComponent("el-radio-group");return e.openBlock(),e.createBlock(m,e.mergeProps({modelValue:e.unref(o)[l.item.prop],"onUpdate:modelValue":a[0]||(a[0]=c=>e.unref(o)[l.item.prop]=c),size:e.unref(s)},i.value),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.option||[],c=>(e.openBlock(),e.createBlock(r,e.mergeProps({size:e.unref(s),key:c.label},c),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:2},1040,["size"]))),128))]),_:1},16,["modelValue","size"])}}}),J=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),s=e.inject("size"),i=e.ref({...n.checkboxGroupSetting});return(l,a)=>{const r=e.resolveComponent("el-checkbox"),m=e.resolveComponent("el-checkbox-group");return e.openBlock(),e.createBlock(m,e.mergeProps({modelValue:e.unref(o)[l.item.prop],"onUpdate:modelValue":a[0]||(a[0]=c=>e.unref(o)[l.item.prop]=c),size:e.unref(s)},i.value),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.option||[],c=>(e.openBlock(),e.createBlock(r,e.mergeProps({size:e.unref(s),key:c.label},c),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:2},1040,["size"]))),128))]),_:1},16,["modelValue","size"])}}}),W=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),s=e.inject("size"),i=e.ref({...D,...n.datePackerSetting});return(l,a)=>{const r=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(r,e.mergeProps({modelValue:e.unref(o)[l.item.prop],"onUpdate:modelValue":a[0]||(a[0]=m=>e.unref(o)[l.item.prop]=m),size:e.unref(s)},i.value),null,16,["modelValue","size"])}}}),H=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),s=e.inject("size"),i=e.ref({...x,...n.selectSetting});return(l,a)=>{const r=e.resolveComponent("el-option"),m=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(m,e.mergeProps({modelValue:e.unref(o)[l.item.prop],"onUpdate:modelValue":a[0]||(a[0]=c=>e.unref(o)[l.item.prop]=c),size:e.unref(s)},i.value),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.option||[],c=>(e.openBlock(),e.createBlock(r,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","size"])}}}),X=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),s=e.inject("size"),i=e.ref({...x,...n.selectSetting});return(l,a)=>{const r=e.resolveComponent("el-cascader");return e.openBlock(),e.createBlock(r,e.mergeProps({modelValue:e.unref(o)[l.item.prop],"onUpdate:modelValue":a[0]||(a[0]=m=>e.unref(o)[l.item.prop]=m),size:e.unref(s),options:l.item.options||[]},i.value),null,16,["modelValue","size","options"])}}}),Y=e.defineComponent({name:"GeneralBasicForm",components:{Input:V,InputNumber:N,InputGraphicVerification:U,InputMobileVerification:O,Divider:K,Radio:M,Checkbox:J,DatePicker:W,Select:H,Cascader:X},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:s}=t,i=q.useRoute(),l=e.ref({...o?{}:i==null?void 0:i.query});return e.provide("queryParams",l),e.provide("size",n),e.provide("getList",s),{queryParams:l}},watch:{formData:{handler(t,n){JSON.stringify(t)!==JSON.stringify(n)&&(this.queryParams={...this.noUrlParameters?{}:this.queryParams,...t})},immediate:!0},queryParams:{handler(t){this.$emit("update:newFormData",t)},deep:!0},loading(t){this.formLoading!==t&&(this.formLoading=t)},formLoading(t){this.loading!==t&&this.$emit("update:loading",t)}},provide(){return{[$]:{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 Z(t,n,o,s,i,l){const a=e.resolveComponent("Input"),r=e.resolveComponent("Radio"),m=e.resolveComponent("Select"),c=e.resolveComponent("Divider"),u=e.resolveComponent("Cascader"),g=e.resolveComponent("Checkbox"),b=e.resolveComponent("DatePicker"),S=e.resolveComponent("InputNumber"),C=e.resolveComponent("InputMobileVerification"),P=e.resolveComponent("InputGraphicVerification"),d=e.resolveComponent("el-form-item"),y=e.resolveComponent("el-button"),k=e.resolveComponent("el-form"),z=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(k,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,p=>(e.openBlock(),e.createBlock(d,{label:p.label,prop:p.prop,key:p.prop,rules:p.rules},{default:e.withCtx(()=>[p.type==="input"?(e.openBlock(),e.createBlock(a,{key:0,item:p},null,8,["item"])):e.createCommentVNode("",!0),p.type==="radio"?(e.openBlock(),e.createBlock(r,{key:1,item:p},null,8,["item"])):e.createCommentVNode("",!0),p.type==="select"?(e.openBlock(),e.createBlock(m,{key:2,item:p},null,8,["item"])):e.createCommentVNode("",!0),p.type==="divider"?(e.openBlock(),e.createBlock(c,{key:3,item:p},null,8,["item"])):e.createCommentVNode("",!0),p.type==="cascader"?(e.openBlock(),e.createBlock(u,{key:4,item:p},null,8,["item"])):e.createCommentVNode("",!0),p.type==="checkbox"?(e.openBlock(),e.createBlock(g,{key:5,item:p},null,8,["item"])):e.createCommentVNode("",!0),p.type==="date-picker"?(e.openBlock(),e.createBlock(b,{key:6,item:p},null,8,["item"])):e.createCommentVNode("",!0),p.type==="input-number"?(e.openBlock(),e.createBlock(S,{key:7,item:p},null,8,["item"])):e.createCommentVNode("",!0),p.type==="form-item-slot"?e.renderSlot(t.$slots,p.name,{key:8}):e.createCommentVNode("",!0),p.type==="input-mobile-verification"?(e.openBlock(),e.createBlock(C,{key:9,item:p},null,8,["item"])):e.createCommentVNode("",!0),p.type==="input-graphic-verification"?(e.openBlock(),e.createBlock(P,{item:p,key:p.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(d,{key:0},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(y,{type:"primary",size:t.size,onClick:t.handleQuery},{default:e.withCtx(()=>[e.createTextVNode("查询")]),_:1},8,["size","onClick"])),[[z,t.formLoading]]),e.createVNode(y,{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 v=h(Y,[["render",Z]]),ee=["infinite-scroll-disabled"],te=["infinite-scroll-disabled"],oe={class:"checkbox"},ne=e.defineComponent({__name:"InfiniteScrollList",props:{search:{type:Function,required:!0},checkbox:{type:Boolean,required:!1},id:{type:String,required:!0},name:{type:String,required:!0},extra:{type:Function,required:!1},defaultSelection:{type:Array,required:!1}},setup(t,{expose:n}){const o=t,{search:s,id:i,name:l,extra:a}=o,r=e.ref([]),m=e.ref(1),c=e.ref(!1),u=e.ref([]),g=e.ref(!1),b=(d,y)=>{const{i:k}=d;return a(k)};e.watch(()=>o.defaultSelection,(d=[],y=[])=>{u.value=d.map(k=>typeof k=="object"?k[i]:k)},{immediate:!0});const S=()=>{m.value=1,r.value=[],u.value=[],c.value=!1},C=async()=>{if(g.value||c.value)return;g.value=!0;const d=await s(m.value);d&&d.length>0?(r.value=[...r.value,...d],m.value+=1):c.value=!0,g.value=!1},P=e.computed(()=>r.value.filter(d=>u.value.includes(d[i])))||{};return n({reset:S,loadList:C,selectInfo:P,list:r,ifbottom:c}),(d,y)=>{const k=e.resolveComponent("el-checkbox"),z=e.resolveComponent("el-checkbox-group"),p=e.resolveDirective("infinite-scroll"),pe=e.resolveDirective("loading");return o.checkbox?e.withDirectives((e.openBlock(),e.createBlock(z,e.mergeProps({key:0,modelValue:u.value,"onUpdate:modelValue":y[0]||(y[0]=_=>u.value=_)},o),{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("ul",{class:"list","infinite-scroll-disabled":c.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,_=>(e.openBlock(),e.createElementBlock("li",{key:_[e.unref(i)],class:"list-item"},[e.createVNode(k,{label:_[e.unref(i)],class:"checkbox"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_[e.unref(l)])+" ",1),o.extra?(e.openBlock(),e.createBlock(b,{key:0,i:_},null,8,["i"])):e.createCommentVNode("",!0)]),_:2},1032,["label"])]))),128))],8,ee)),[[p,C]])]),_:1},16,["modelValue"])),[[pe,g.value]]):e.withDirectives((e.openBlock(),e.createElementBlock("ul",e.mergeProps({key:1,class:"list","infinite-scroll-disabled":c.value},o),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,_=>(e.openBlock(),e.createElementBlock("li",{key:_[e.unref(i)],class:"list-item"},[e.createElementVNode("div",oe,[e.createTextVNode(e.toDisplayString(_[e.unref(l)])+" ",1),o.extra?(e.openBlock(),e.createBlock(b,{key:0,i:_},null,8,["i"])):e.createCommentVNode("",!0)])]))),128))],16,te)),[[p,C]])}}}),fe="",re=h(ne,[["__scopeId","data-v-6bf38adc"]]),le={key:1},ie=e.defineComponent({__name:"Descriptions",props:{formData:{type:Object,required:!0},formItem:{type:Array,required:!0}},setup(t){const n=t,o=(s,i)=>{const{i:l,render:a,formData:r}=s;return a({row:r,$index:l})};return(s,i)=>{const l=e.resolveComponent("el-descriptions-item"),a=e.resolveComponent("el-descriptions");return e.openBlock(),e.createBlock(a,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,m)=>(e.openBlock(),e.createBlock(l,e.mergeProps({key:r.prop,label:r.label},r.descriptionsItemProps),{default:e.withCtx(()=>[r.render?(e.openBlock(),e.createBlock(o,{key:0,i:m,render:r.render,formData:t.formData},null,8,["i","render","formData"])):(e.openBlock(),e.createElementBlock("span",le,e.toDisplayString(t.formData[r.prop]),1))]),_:2},1040,["label"]))),128))]),_:1},16)}}}),se=v,ae=re,ce=ie;f.VDescriptions=ce,f.VGeneralBasicForm=se,f.VInfiniteScrollList=ae,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,L){"use strict";const x={placeholder:"请输入",style:"width: 200px",clearable:!0},I={style:"width: 227px","start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange"},$={placeholder:"请选择",filterable:!0,clearable:!0,style:"width: 200px"},N=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:{...x,...this.item.inputSetting}}},methods:{currentInputComponent(){return"input-archive"}}}),y=(t,n)=>{const o=t.__vccOpts||t;for(const[c,i]of n)o[c]=i;return o};function F(t,n,o,c,i,l){const a=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(a,e.mergeProps({onKeydown:e.withKeys(t.getList,["enter"]),modelValue:t.queryParams[t.item.prop],"onUpdate:modelValue":n[0]||(n[0]=r=>t.queryParams[t.item.prop]=r),size:t.size},t.inputSetting),e.createSlots({_:2},[e.renderList(t.item.template,(r,m)=>({name:m,fn:e.withCtx(()=>[r?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.currentInputComponent()),{key:m,templateEle:r},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040,["onKeydown","modelValue","size"])}const V=y(N,[["render",F]]),E=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),c=e.inject("size"),i=e.ref({...x,...n.inputSetting});return(l,a)=>{const r=e.resolveComponent("el-input-number");return e.openBlock(),e.createBlock(r,e.mergeProps({modelValue:e.unref(o)[l.item.prop],"onUpdate:modelValue":a[0]||(a[0]=m=>e.unref(o)[l.item.prop]=m),size:e.unref(c)},i.value),null,16,["modelValue","size"])}}}),q=Symbol(),j={class:"input-graphic-verification"},U=["src"],T=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,{graphicSrc:o="",getGraphic:c=()=>{}}=n,{formLoading:i,updateFormLoading:l}=e.inject(q),a=async()=>{c&&!i.value&&await c()};return(r,m)=>{const p=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",j,[e.createVNode(V,{item:r.item,class:"input"},null,8,["item"]),e.createElementVNode("img",{class:"graphic",onClick:a,src:e.unref(o)},null,8,U)])),[[p,e.unref(i)]])}}}),_e="",G=y(T,[["__scopeId","data-v-500ec9b0"]]),g="获取验证码",R=60,O=e.defineComponent({__name:"verification-button",props:{getSmscode:{type:Function}},setup(t){const{getSmscode:n}=t,o=e.ref(g),c=e.ref(null),i=e.computed(()=>o.value===g),l=()=>{c&&(clearInterval(c.value),c.value=null,o.value=g)},a=async()=>{if(o.value===g)if(o.value=R,c.value=setInterval(()=>{if(Number(o.value)<=0||!o.value){l();return}else o.value=Number(o.value)-1},1e3),n)await n()===!1&&l();else return};return e.onBeforeUnmount(()=>{l()}),(r,m)=>{const p=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(p,{class:"verifiaction-button",style:e.normalizeStyle({color:i.value?"var(--color-primary, #409EFF)":"var(--text-color-placeholder, #A8ABB2)",cursor:i.value?"pointer":"default"}),onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value?g:o.value+"s"),1)]),_:1},8,["style"])}}}),ke="",A=y(O,[["__scopeId","data-v-4074e137"]]),Q=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=n;return o.template={append:()=>e.h(A,{getSmscode:o.getSmscode})},(c,i)=>(e.openBlock(),e.createBlock(V,{item:e.unref(o),class:"input"},null,8,["item"]))}}),K=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 M(t,n,o,c,i,l){const a=e.resolveComponent("el-divider");return e.openBlock(),e.createBlock(a,e.normalizeProps(e.guardReactiveProps(t.dividerSetting)),e.createSlots({_:2},[e.renderList(t.item.template,(r,m)=>({name:m,fn:e.withCtx(()=>[r?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.currentInputComponent()),{key:m,templateEle:r},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040)}const J=y(K,[["render",M]]),W=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),c=e.inject("size"),i=e.ref({...n.radioGroupSetting});return(l,a)=>{const r=e.resolveComponent("el-radio"),m=e.resolveComponent("el-radio-group");return e.openBlock(),e.createBlock(m,e.mergeProps({modelValue:e.unref(o)[l.item.prop],"onUpdate:modelValue":a[0]||(a[0]=p=>e.unref(o)[l.item.prop]=p),size:e.unref(c)},i.value),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.option||[],p=>(e.openBlock(),e.createBlock(r,e.mergeProps({size:e.unref(c),key:p.label},p),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value),1)]),_:2},1040,["size"]))),128))]),_:1},16,["modelValue","size"])}}}),H=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),c=e.inject("size"),i=e.ref({...n.checkboxGroupSetting});return(l,a)=>{const r=e.resolveComponent("el-checkbox"),m=e.resolveComponent("el-checkbox-group");return e.openBlock(),e.createBlock(m,e.mergeProps({modelValue:e.unref(o)[l.item.prop],"onUpdate:modelValue":a[0]||(a[0]=p=>e.unref(o)[l.item.prop]=p),size:e.unref(c)},i.value),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.option||[],p=>(e.openBlock(),e.createBlock(r,e.mergeProps({size:e.unref(c),key:p.label},p),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value),1)]),_:2},1040,["size"]))),128))]),_:1},16,["modelValue","size"])}}}),X=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),c=e.inject("size"),i=e.ref({...I,...n.datePackerSetting});return(l,a)=>{const r=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(r,e.mergeProps({modelValue:e.unref(o)[l.item.prop],"onUpdate:modelValue":a[0]||(a[0]=m=>e.unref(o)[l.item.prop]=m),size:e.unref(c)},i.value),null,16,["modelValue","size"])}}}),Y=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),c=e.inject("size"),i=e.ref({...$,...n.selectSetting});return(l,a)=>{const r=e.resolveComponent("el-option"),m=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(m,e.mergeProps({modelValue:e.unref(o)[l.item.prop],"onUpdate:modelValue":a[0]||(a[0]=p=>e.unref(o)[l.item.prop]=p),size:e.unref(c)},i.value),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.option||[],p=>(e.openBlock(),e.createBlock(r,{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","size"])}}}),Z=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),c=e.inject("size"),i=e.ref({...$,...n.selectSetting});return(l,a)=>{const r=e.resolveComponent("el-cascader");return e.openBlock(),e.createBlock(r,e.mergeProps({modelValue:e.unref(o)[l.item.prop],"onUpdate:modelValue":a[0]||(a[0]=m=>e.unref(o)[l.item.prop]=m),size:e.unref(c),options:l.item.options||[]},i.value),null,16,["modelValue","size","options"])}}}),v=e.defineComponent({name:"GeneralBasicForm",components:{Input:V,InputNumber:E,InputGraphicVerification:G,InputMobileVerification:Q,Divider:J,Radio:W,Checkbox:H,DatePicker:X,Select:Y,Cascader:Z},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:c}=t,i=L.useRoute(),l=e.ref({...o?{}:i==null?void 0:i.query});return e.provide("queryParams",l),e.provide("size",n),e.provide("getList",c),{queryParams:l}},watch:{formData:{handler(t,n){JSON.stringify(t)!==JSON.stringify(n)&&(this.queryParams={...this.noUrlParameters?{}:this.queryParams,...t})},immediate:!0},queryParams:{handler(t){this.$emit("update:formData",t)},deep:!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 ee(t,n,o,c,i,l){const a=e.resolveComponent("Input"),r=e.resolveComponent("Radio"),m=e.resolveComponent("Select"),p=e.resolveComponent("Divider"),k=e.resolveComponent("Cascader"),h=e.resolveComponent("Checkbox"),C=e.resolveComponent("DatePicker"),S=e.resolveComponent("InputNumber"),P=e.resolveComponent("InputMobileVerification"),B=e.resolveComponent("InputGraphicVerification"),u=e.resolveComponent("el-form-item"),b=e.resolveComponent("el-button"),z=e.resolveComponent("el-form"),d=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(z,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,s=>(e.openBlock(),e.createBlock(u,{label:s.label,prop:s.prop,key:s.prop,rules:s.rules},{default:e.withCtx(()=>[s.type==="input"?(e.openBlock(),e.createBlock(a,{key:0,item:s},null,8,["item"])):e.createCommentVNode("",!0),s.type==="radio"?(e.openBlock(),e.createBlock(r,{key:1,item:s},null,8,["item"])):e.createCommentVNode("",!0),s.type==="select"?(e.openBlock(),e.createBlock(m,{key:2,item:s},null,8,["item"])):e.createCommentVNode("",!0),s.type==="divider"?(e.openBlock(),e.createBlock(p,{key:3,item:s},null,8,["item"])):e.createCommentVNode("",!0),s.type==="cascader"?(e.openBlock(),e.createBlock(k,{key:4,item:s},null,8,["item"])):e.createCommentVNode("",!0),s.type==="checkbox"?(e.openBlock(),e.createBlock(h,{key:5,item:s},null,8,["item"])):e.createCommentVNode("",!0),s.type==="date-picker"?(e.openBlock(),e.createBlock(C,{key:6,item:s},null,8,["item"])):e.createCommentVNode("",!0),s.type==="input-number"?(e.openBlock(),e.createBlock(S,{key:7,item:s},null,8,["item"])):e.createCommentVNode("",!0),s.type==="form-item-slot"?e.renderSlot(t.$slots,s.name,{key:8}):e.createCommentVNode("",!0),s.type==="input-mobile-verification"?(e.openBlock(),e.createBlock(P,{key:9,item:s},null,8,["item"])):e.createCommentVNode("",!0),s.type==="input-graphic-verification"?(e.openBlock(),e.createBlock(B,{item:s,key:s.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(u,{key:0},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(b,{type:"primary",size:t.size,onClick:t.handleQuery},{default:e.withCtx(()=>[e.createTextVNode("查询")]),_:1},8,["size","onClick"])),[[d,t.formLoading]]),e.createVNode(b,{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 te=y(v,[["render",ee]]),oe=["infinite-scroll-disabled"],ne=["infinite-scroll-disabled"],re={class:"checkbox"},le=e.defineComponent({__name:"InfiniteScrollList",props:{search:{type:Function,required:!0},checkbox:{type:Boolean,required:!1},id:{type:String,required:!0},name:{type:String,required:!0},extra:{type:null,required:!1},defaultSelection:{type:Array,required:!1}},setup(t,{expose:n}){const o=t,{search:c,id:i,name:l,extra:a}=o,r=e.ref([]),m=e.ref(1),p=e.ref(!1),k=e.ref([]),h=e.ref(!1),C=(d,s)=>{const{i:w}=d;return a&&a!=="false"?a(w):""},S=d=>{k.value=d.map(s=>typeof s=="object"?s[i]:s)};e.watch(()=>o.defaultSelection,(d=[],s=[])=>{S(d)},{immediate:!0});const P=()=>{B(),k.value=[]},B=()=>{m.value=1,r.value=[],p.value=!1},u=async()=>{if(h.value||p.value)return;h.value=!0;const d=await c(m.value);d&&d.length>0?(r.value=[...r.value,...d],m.value+=1):p.value=!0,h.value=!1},b=()=>{B(),u()},z=e.computed(()=>r.value.filter(d=>k.value.includes(d[i])))||{};return n({reset:P,lowReset:B,loadList:u,selectInfo:z,list:r,ifbottom:p,refreshList:b}),(d,s)=>{const w=e.resolveComponent("el-checkbox"),de=e.resolveComponent("el-checkbox-group"),D=e.resolveDirective("infinite-scroll"),fe=e.resolveDirective("loading");return o.checkbox?e.withDirectives((e.openBlock(),e.createBlock(de,e.mergeProps({key:0,modelValue:k.value,"onUpdate:modelValue":s[0]||(s[0]=_=>k.value=_)},o),{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("ul",{class:"list","infinite-scroll-disabled":p.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,_=>(e.openBlock(),e.createElementBlock("li",{key:_[e.unref(i)],class:"list-item"},[e.createVNode(w,{label:_[e.unref(i)],class:"checkbox"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_[e.unref(l)])+" ",1),o.extra?(e.openBlock(),e.createBlock(C,{key:0,i:_},null,8,["i"])):e.createCommentVNode("",!0)]),_:2},1032,["label"])]))),128))],8,oe)),[[D,u]])]),_:1},16,["modelValue"])),[[fe,h.value]]):e.withDirectives((e.openBlock(),e.createElementBlock("ul",e.mergeProps({key:1,class:"list","infinite-scroll-disabled":p.value},o),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,_=>(e.openBlock(),e.createElementBlock("li",{key:_[e.unref(i)],class:"list-item"},[e.createElementVNode("div",re,[e.createTextVNode(e.toDisplayString(_[e.unref(l)])+" ",1),o.extra?(e.openBlock(),e.createBlock(C,{key:0,i:_},null,8,["i"])):e.createCommentVNode("",!0)])]))),128))],16,ne)),[[D,u]])}}}),ue="",ie=y(le,[["__scopeId","data-v-fa74e9b9"]]),se={key:1},ae=e.defineComponent({__name:"Descriptions",props:{formData:{type:Object,required:!0},formItem:{type:Array,required:!0}},setup(t){const n=t,o=(c,i)=>{const{i:l,render:a,formData:r}=c;return a({row:r,$index:l})};return(c,i)=>{const l=e.resolveComponent("el-descriptions-item"),a=e.resolveComponent("el-descriptions");return e.openBlock(),e.createBlock(a,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,m)=>(e.openBlock(),e.createBlock(l,e.mergeProps({key:r.prop,label:r.label},r.descriptionsItemProps),{default:e.withCtx(()=>[r.render?(e.openBlock(),e.createBlock(o,{key:0,i:m,render:r.render,formData:t.formData},null,8,["i","render","formData"])):(e.openBlock(),e.createElementBlock("span",se,e.toDisplayString(t.formData[r.prop]),1))]),_:2},1040,["label"]))),128))]),_:1},16)}}}),ce=te,pe=ie,me=ae;f.VDescriptions=me,f.VGeneralBasicForm=ce,f.VInfiniteScrollList=pe,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.input-graphic-verification[data-v-500ec9b0]{display:flex;gap:12px;width:100%}.input-graphic-verification .input[data-v-500ec9b0]{flex:auto}.input-graphic-verification .graphic[data-v-500ec9b0]{width:109px;height:43px;object-fit:fill;flex:none}.verifiaction-button[data-v-4074e137]{width:109px}.list[data-v-
|
|
1
|
+
.input-graphic-verification[data-v-500ec9b0]{display:flex;gap:12px;width:100%}.input-graphic-verification .input[data-v-500ec9b0]{flex:auto}.input-graphic-verification .graphic[data-v-500ec9b0]{width:109px;height:43px;object-fit:fill;flex:none}.verifiaction-button[data-v-4074e137]{width:109px}.list[data-v-fa74e9b9]{height:272px;overflow:auto;padding:8px 0}.list .checkbox[data-v-fa74e9b9]{width:calc(100% - 32px);padding:0 16px}
|
package/package.json
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "general-basic-form",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "./dist/index.umd.cjs",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "cross-env CURRENT_ENV=prod run-p type-check build-only",
|
|
9
|
-
"test:e2e": "playwright test",
|
|
10
|
-
"build-only": "vite build",
|
|
11
|
-
"type-check": "tsc --noEmit -p tsconfig.json --composite false",
|
|
12
|
-
"link": "tsx script/link.ts && yarn link",
|
|
13
|
-
"unlink": "tsx script/unlink.ts && yarn unlink && run-p build",
|
|
14
|
-
"unlinkSetting": "tsx script/unlink.ts"
|
|
15
|
-
},
|
|
16
|
-
"keywords": [
|
|
17
|
-
"general-basic-form",
|
|
18
|
-
"form",
|
|
19
|
-
"vue",
|
|
20
|
-
"vue2",
|
|
21
|
-
"vue3",
|
|
22
|
-
"element-plus"
|
|
23
|
-
],
|
|
24
|
-
"author": "chendeli419287484@qq.com",
|
|
25
|
-
"license": "ISC",
|
|
26
|
-
"repository": {
|
|
27
|
-
"type": "git",
|
|
28
|
-
"url": "git+https://github.com/Alan1034/GeneralBasicForm.git"
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@playwright/test": "^1.36.1",
|
|
32
|
-
"@types/node": "^20.8.10",
|
|
33
|
-
"@vitejs/plugin-legacy": "^4.1.1",
|
|
34
|
-
"@vitejs/plugin-vue": "^4.2.3",
|
|
35
|
-
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
|
36
|
-
"chalk": "^2.4.2",
|
|
37
|
-
"cross-env": "^7.0.3",
|
|
38
|
-
"less": "^4.2.0",
|
|
39
|
-
"npm-run-all": "^4.1.5",
|
|
40
|
-
"tsx": "^4.0.0",
|
|
41
|
-
"typescript": "^5.2.2",
|
|
42
|
-
"vite-plugin-image-optimizer": "^1.1.6"
|
|
43
|
-
},
|
|
44
|
-
"peerDependencies": {
|
|
45
|
-
"element-plus": ">=2.4.2",
|
|
46
|
-
"vue": ">=3.3.4",
|
|
47
|
-
"vue-router": ">=4.2.4"
|
|
48
|
-
},
|
|
49
|
-
"typings": "./dist/index.d.ts",
|
|
50
|
-
"module": "./dist/index.js",
|
|
51
|
-
"exports": {
|
|
52
|
-
".": {
|
|
53
|
-
"import": "./dist/index.js",
|
|
54
|
-
"require": "./dist/index.umd.cjs"
|
|
55
|
-
},
|
|
56
|
-
"./style": "./dist/style.css"
|
|
57
|
-
},
|
|
58
|
-
"files": [
|
|
59
|
-
"/dist"
|
|
60
|
-
]
|
|
61
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "general-basic-form",
|
|
3
|
+
"version": "2.0.37",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "./dist/index.umd.cjs",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "cross-env CURRENT_ENV=prod run-p type-check build-only",
|
|
9
|
+
"test:e2e": "playwright test",
|
|
10
|
+
"build-only": "vite build",
|
|
11
|
+
"type-check": "tsc --noEmit -p tsconfig.json --composite false",
|
|
12
|
+
"link": "tsx script/link.ts && yarn link",
|
|
13
|
+
"unlink": "tsx script/unlink.ts && yarn unlink && run-p build",
|
|
14
|
+
"unlinkSetting": "tsx script/unlink.ts"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"general-basic-form",
|
|
18
|
+
"form",
|
|
19
|
+
"vue",
|
|
20
|
+
"vue2",
|
|
21
|
+
"vue3",
|
|
22
|
+
"element-plus"
|
|
23
|
+
],
|
|
24
|
+
"author": "chendeli419287484@qq.com",
|
|
25
|
+
"license": "ISC",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/Alan1034/GeneralBasicForm.git"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@playwright/test": "^1.36.1",
|
|
32
|
+
"@types/node": "^20.8.10",
|
|
33
|
+
"@vitejs/plugin-legacy": "^4.1.1",
|
|
34
|
+
"@vitejs/plugin-vue": "^4.2.3",
|
|
35
|
+
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
|
36
|
+
"chalk": "^2.4.2",
|
|
37
|
+
"cross-env": "^7.0.3",
|
|
38
|
+
"less": "^4.2.0",
|
|
39
|
+
"npm-run-all": "^4.1.5",
|
|
40
|
+
"tsx": "^4.0.0",
|
|
41
|
+
"typescript": "^5.2.2",
|
|
42
|
+
"vite-plugin-image-optimizer": "^1.1.6"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"element-plus": ">=2.4.2",
|
|
46
|
+
"vue": ">=3.3.4",
|
|
47
|
+
"vue-router": ">=4.2.4"
|
|
48
|
+
},
|
|
49
|
+
"typings": "./dist/index.d.ts",
|
|
50
|
+
"module": "./dist/index.js",
|
|
51
|
+
"exports": {
|
|
52
|
+
".": {
|
|
53
|
+
"import": "./dist/index.js",
|
|
54
|
+
"require": "./dist/index.umd.cjs"
|
|
55
|
+
},
|
|
56
|
+
"./style": "./dist/style.css"
|
|
57
|
+
},
|
|
58
|
+
"files": [
|
|
59
|
+
"/dist"
|
|
60
|
+
]
|
|
61
|
+
}
|