general-basic-form 1.0.27 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +221 -636
- package/dist/index.umd.cjs +1 -1
- package/package.json +15 -3
- package/README.assets/image-20210820173738506.png +0 -0
- package/dist/style.css +0 -1
- package/public/index.d.ts +0 -17
- package/script/initialization.ts +0 -24
- package/script/link.ts +0 -14
- package/script/linkNode.ts +0 -14
- package/script/unlinkModule.ts +0 -48
- package/script/unlinkNode.ts +0 -38
- package/tsconfig.json +0 -14
- package/vite.config.js +0 -121
package/dist/index.js
CHANGED
|
@@ -1,376 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
style: "width: 227px",
|
|
9
|
-
"start-placeholder": "开始日期",
|
|
10
|
-
"end-placeholder": "结束日期",
|
|
11
|
-
type: "daterange"
|
|
12
|
-
}, Y = {
|
|
13
|
-
placeholder: "请选择",
|
|
14
|
-
filterable: !0,
|
|
15
|
-
clearable: !0,
|
|
16
|
-
style: "width: 200px"
|
|
17
|
-
}, me = k({
|
|
18
|
-
components: {
|
|
19
|
-
InputArchive: (e) => {
|
|
20
|
-
const { templateEle: n } = e;
|
|
21
|
-
return n();
|
|
22
|
-
}
|
|
23
|
-
},
|
|
1
|
+
import { resolveComponent as u, openBlock as a, createBlock as s, withCtx as c, createTextVNode as g, toDisplayString as D, resolveDirective as N, withDirectives as S, mergeProps as p, createElementBlock as k, Fragment as P, renderList as y, withKeys as V, createSlots as q, resolveDynamicComponent as x, createCommentVNode as f, createElementVNode as R, createVNode as z, renderSlot as O, vShow as E } from "vue";
|
|
2
|
+
const v = (e, n) => {
|
|
3
|
+
const r = e.__vccOpts || e;
|
|
4
|
+
for (const [d, o] of n)
|
|
5
|
+
r[d] = o;
|
|
6
|
+
return r;
|
|
7
|
+
}, K = {
|
|
24
8
|
props: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
9
|
+
verificationSetting: {
|
|
10
|
+
type: Object,
|
|
11
|
+
default: () => {
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
getSmscode: {
|
|
15
|
+
type: Function,
|
|
16
|
+
default: () => {
|
|
17
|
+
}
|
|
18
|
+
}
|
|
31
19
|
},
|
|
32
20
|
data() {
|
|
33
21
|
return {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
defaultText: this.verificationSetting.defaultText || "获取验证码",
|
|
23
|
+
buttonText: this.verificationSetting.defaultText || "获取验证码",
|
|
24
|
+
restTime: this.verificationSetting.restTime || 60,
|
|
25
|
+
timer: null
|
|
38
26
|
};
|
|
39
27
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
// },
|
|
44
|
-
methods: {
|
|
45
|
-
currentInputComponent() {
|
|
46
|
-
return "input-archive";
|
|
28
|
+
computed: {
|
|
29
|
+
buttonType() {
|
|
30
|
+
return this.buttonText === this.defaultText;
|
|
47
31
|
}
|
|
48
|
-
}
|
|
49
|
-
// watch: {
|
|
50
|
-
// item(val) {
|
|
51
|
-
// console.log("item", val);
|
|
52
|
-
// },
|
|
53
|
-
// size(val) {
|
|
54
|
-
// console.log(val);
|
|
55
|
-
// },
|
|
56
|
-
// },
|
|
57
|
-
}), w = (e, n) => {
|
|
58
|
-
const t = e.__vccOpts || e;
|
|
59
|
-
for (const [a, l] of n)
|
|
60
|
-
t[a] = l;
|
|
61
|
-
return t;
|
|
62
|
-
};
|
|
63
|
-
function de(e, n, t, a, l, s) {
|
|
64
|
-
const i = d("el-input");
|
|
65
|
-
return o(), c(i, b({
|
|
66
|
-
onKeydown: ne(e.getList, ["enter"]),
|
|
67
|
-
modelValue: e.queryParams[e.item.prop],
|
|
68
|
-
"onUpdate:modelValue": n[0] || (n[0] = (r) => e.queryParams[e.item.prop] = r),
|
|
69
|
-
size: e.size
|
|
70
|
-
}, e.inputSetting), J({ _: 2 }, [
|
|
71
|
-
$(e.item.template, (r, _) => ({
|
|
72
|
-
name: _,
|
|
73
|
-
fn: f(() => [
|
|
74
|
-
r ? (o(), c(W(e.currentInputComponent()), {
|
|
75
|
-
key: _,
|
|
76
|
-
templateEle: r
|
|
77
|
-
}, null, 8, ["templateEle"])) : y("", !0)
|
|
78
|
-
])
|
|
79
|
-
}))
|
|
80
|
-
]), 1040, ["onKeydown", "modelValue", "size"]);
|
|
81
|
-
}
|
|
82
|
-
const K = /* @__PURE__ */ w(me, [["render", de]]), _e = /* @__PURE__ */ k({
|
|
83
|
-
__name: "index",
|
|
84
|
-
props: {
|
|
85
|
-
item: {}
|
|
86
32
|
},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
...X,
|
|
90
|
-
...n.inputSetting
|
|
91
|
-
});
|
|
92
|
-
return (s, i) => {
|
|
93
|
-
const r = d("el-input-number");
|
|
94
|
-
return o(), c(r, b({
|
|
95
|
-
modelValue: m(t)[s.item.prop],
|
|
96
|
-
"onUpdate:modelValue": i[0] || (i[0] = (_) => m(t)[s.item.prop] = _),
|
|
97
|
-
size: m(a)
|
|
98
|
-
}, l.value), null, 16, ["modelValue", "size"]);
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
}), Z = Symbol(), fe = { class: "input-graphic-verification" }, ye = ["src", "alt"], he = /* @__PURE__ */ k({
|
|
102
|
-
__name: "index",
|
|
103
|
-
props: {
|
|
104
|
-
item: {}
|
|
105
|
-
},
|
|
106
|
-
setup(e) {
|
|
107
|
-
const { item: n } = e, {
|
|
108
|
-
graphicSrc: t = "",
|
|
109
|
-
graphicAlt: a = "",
|
|
110
|
-
getGraphic: l = () => {
|
|
111
|
-
},
|
|
112
|
-
key: s
|
|
113
|
-
} = n, { formLoading: i, updateFormLoading: r } = h(Z), _ = async () => {
|
|
114
|
-
l && !i.value && await l();
|
|
115
|
-
};
|
|
116
|
-
return (p, P) => {
|
|
117
|
-
const q = U("loading");
|
|
118
|
-
return C((o(), S("div", fe, [
|
|
119
|
-
T(K, {
|
|
120
|
-
item: p.item,
|
|
121
|
-
class: "input"
|
|
122
|
-
}, null, 8, ["item"]),
|
|
123
|
-
H("img", {
|
|
124
|
-
class: "graphic",
|
|
125
|
-
onClick: _,
|
|
126
|
-
src: m(t),
|
|
127
|
-
alt: m(a) || `${m(s)}`
|
|
128
|
-
}, null, 8, ye)
|
|
129
|
-
])), [
|
|
130
|
-
[q, m(i)]
|
|
131
|
-
]);
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
const ve = /* @__PURE__ */ w(he, [["__scopeId", "data-v-006751c3"]]), B = "获取验证码", ge = 60, be = /* @__PURE__ */ k({
|
|
136
|
-
__name: "verification-button",
|
|
137
|
-
props: {
|
|
138
|
-
getSmscode: { type: Function }
|
|
33
|
+
destroyed() {
|
|
34
|
+
this.reset();
|
|
139
35
|
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
36
|
+
methods: {
|
|
37
|
+
reset() {
|
|
38
|
+
this.timer && (clearInterval(this.timer), this.timer = null, this.buttonText = this.defaultText);
|
|
39
|
+
},
|
|
40
|
+
async buttonClick() {
|
|
41
|
+
if (this.buttonText === this.defaultText)
|
|
42
|
+
if (this.buttonText = this.restTime, this.timer = setInterval(() => {
|
|
43
|
+
if (Number(this.buttonText) <= 0 || !this.buttonText) {
|
|
44
|
+
this.reset();
|
|
148
45
|
return;
|
|
149
46
|
} else
|
|
150
|
-
|
|
151
|
-
}, 1e3),
|
|
152
|
-
await
|
|
47
|
+
this.buttonText = Number(this.buttonText) - 1;
|
|
48
|
+
}, 1e3), this.getSmscode)
|
|
49
|
+
await this.getSmscode() === !1 && this.reset();
|
|
153
50
|
else
|
|
154
51
|
return;
|
|
155
|
-
};
|
|
156
|
-
return oe(() => {
|
|
157
|
-
s();
|
|
158
|
-
}), (r, _) => {
|
|
159
|
-
const p = d("el-button");
|
|
160
|
-
return o(), c(p, {
|
|
161
|
-
class: "verifiaction-button",
|
|
162
|
-
style: re({
|
|
163
|
-
color: l.value ? "var(--color-primary, #409EFF)" : "var(--text-color-placeholder, #A8ABB2)",
|
|
164
|
-
cursor: l.value ? "pointer" : "default"
|
|
165
|
-
}),
|
|
166
|
-
onClick: i
|
|
167
|
-
}, {
|
|
168
|
-
default: f(() => [
|
|
169
|
-
I(D(l.value ? B : t.value + "s"), 1)
|
|
170
|
-
]),
|
|
171
|
-
_: 1
|
|
172
|
-
}, 8, ["style"]);
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
const ke = /* @__PURE__ */ w(be, [["__scopeId", "data-v-4074e137"]]), Se = /* @__PURE__ */ k({
|
|
177
|
-
__name: "index",
|
|
178
|
-
props: {
|
|
179
|
-
item: {}
|
|
180
|
-
},
|
|
181
|
-
setup(e) {
|
|
182
|
-
const { item: n } = e, t = n;
|
|
183
|
-
return t.template = {
|
|
184
|
-
append: () => se(ke, {
|
|
185
|
-
getSmscode: t.getSmscode
|
|
186
|
-
})
|
|
187
|
-
}, (a, l) => (o(), c(K, {
|
|
188
|
-
item: m(t),
|
|
189
|
-
class: "input"
|
|
190
|
-
}, null, 8, ["item"]));
|
|
191
|
-
}
|
|
192
|
-
}), ze = k({
|
|
193
|
-
components: {
|
|
194
|
-
slotArchive: (e) => {
|
|
195
|
-
const { templateEle: n } = e;
|
|
196
|
-
return n();
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
props: {
|
|
200
|
-
item: null
|
|
201
|
-
// null就是any
|
|
202
|
-
},
|
|
203
|
-
setup() {
|
|
204
|
-
},
|
|
205
|
-
data() {
|
|
206
|
-
return {
|
|
207
|
-
dividerSetting: {
|
|
208
|
-
...this.item.dividerSetting
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
},
|
|
212
|
-
methods: {
|
|
213
|
-
currentInputComponent() {
|
|
214
|
-
return "slot-archive";
|
|
215
52
|
}
|
|
216
53
|
}
|
|
217
|
-
}
|
|
218
|
-
function
|
|
219
|
-
const
|
|
220
|
-
return
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
templateEle: r
|
|
227
|
-
}, null, 8, ["templateEle"])) : y("", !0)
|
|
228
|
-
])
|
|
229
|
-
}))
|
|
230
|
-
]), 1040);
|
|
54
|
+
};
|
|
55
|
+
function Q(e, n, r, d, o, i) {
|
|
56
|
+
const h = u("el-button");
|
|
57
|
+
return a(), s(h, { onClick: i.buttonClick }, {
|
|
58
|
+
default: c(() => [
|
|
59
|
+
g(D(i.buttonType ? o.defaultText : o.buttonText + "s"), 1)
|
|
60
|
+
]),
|
|
61
|
+
_: 1
|
|
62
|
+
}, 8, ["onClick"]);
|
|
231
63
|
}
|
|
232
|
-
const
|
|
233
|
-
__name: "index",
|
|
234
|
-
props: {
|
|
235
|
-
item: {}
|
|
236
|
-
},
|
|
237
|
-
setup(e) {
|
|
238
|
-
const { item: n } = e, t = h("queryParams", {}), a = h("size"), l = g({
|
|
239
|
-
...n.radioGroupSetting
|
|
240
|
-
});
|
|
241
|
-
return (s, i) => {
|
|
242
|
-
const r = d("el-radio"), _ = d("el-radio-group");
|
|
243
|
-
return o(), c(_, b({
|
|
244
|
-
modelValue: m(t)[s.item.prop],
|
|
245
|
-
"onUpdate:modelValue": i[0] || (i[0] = (p) => m(t)[s.item.prop] = p),
|
|
246
|
-
size: m(a)
|
|
247
|
-
}, l.value), {
|
|
248
|
-
default: f(() => [
|
|
249
|
-
(o(!0), S(L, null, $(s.item.option || [], (p) => (o(), c(r, b({
|
|
250
|
-
size: m(a),
|
|
251
|
-
key: p.label
|
|
252
|
-
}, p), {
|
|
253
|
-
default: f(() => [
|
|
254
|
-
I(D(p.value), 1)
|
|
255
|
-
]),
|
|
256
|
-
_: 2
|
|
257
|
-
}, 1040, ["size"]))), 128))
|
|
258
|
-
]),
|
|
259
|
-
_: 1
|
|
260
|
-
}, 16, ["modelValue", "size"]);
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
}), Ve = /* @__PURE__ */ k({
|
|
264
|
-
__name: "index",
|
|
265
|
-
props: {
|
|
266
|
-
item: {}
|
|
267
|
-
},
|
|
268
|
-
setup(e) {
|
|
269
|
-
const { item: n } = e, t = h("queryParams", {}), a = h("size"), l = g({
|
|
270
|
-
...n.checkboxGroupSetting
|
|
271
|
-
});
|
|
272
|
-
return (s, i) => {
|
|
273
|
-
const r = d("el-checkbox"), _ = d("el-checkbox-group");
|
|
274
|
-
return o(), c(_, b({
|
|
275
|
-
modelValue: m(t)[s.item.prop],
|
|
276
|
-
"onUpdate:modelValue": i[0] || (i[0] = (p) => m(t)[s.item.prop] = p),
|
|
277
|
-
size: m(a)
|
|
278
|
-
}, l.value), {
|
|
279
|
-
default: f(() => [
|
|
280
|
-
(o(!0), S(L, null, $(s.item.option || [], (p) => (o(), c(r, b({
|
|
281
|
-
size: m(a),
|
|
282
|
-
key: p.label
|
|
283
|
-
}, p), {
|
|
284
|
-
default: f(() => [
|
|
285
|
-
I(D(p.value), 1)
|
|
286
|
-
]),
|
|
287
|
-
_: 2
|
|
288
|
-
}, 1040, ["size"]))), 128))
|
|
289
|
-
]),
|
|
290
|
-
_: 1
|
|
291
|
-
}, 16, ["modelValue", "size"]);
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
}), Ie = /* @__PURE__ */ k({
|
|
295
|
-
__name: "index",
|
|
296
|
-
props: {
|
|
297
|
-
item: {}
|
|
298
|
-
},
|
|
299
|
-
setup(e) {
|
|
300
|
-
const { item: n } = e, t = h("queryParams", {}), a = h("size"), l = g({
|
|
301
|
-
...pe,
|
|
302
|
-
...n.datePackerSetting
|
|
303
|
-
});
|
|
304
|
-
return (s, i) => {
|
|
305
|
-
const r = d("el-date-picker");
|
|
306
|
-
return o(), c(r, b({
|
|
307
|
-
modelValue: m(t)[s.item.prop],
|
|
308
|
-
"onUpdate:modelValue": i[0] || (i[0] = (_) => m(t)[s.item.prop] = _),
|
|
309
|
-
size: m(a)
|
|
310
|
-
}, l.value), null, 16, ["modelValue", "size"]);
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
}), Le = /* @__PURE__ */ k({
|
|
314
|
-
__name: "index",
|
|
315
|
-
props: {
|
|
316
|
-
item: {}
|
|
317
|
-
},
|
|
318
|
-
setup(e) {
|
|
319
|
-
const { item: n } = e, t = h("queryParams", {}), a = h("size"), l = g({
|
|
320
|
-
...Y,
|
|
321
|
-
...n.selectSetting
|
|
322
|
-
});
|
|
323
|
-
return (s, i) => {
|
|
324
|
-
const r = d("el-option"), _ = d("el-select");
|
|
325
|
-
return o(), c(_, b({
|
|
326
|
-
modelValue: m(t)[s.item.prop],
|
|
327
|
-
"onUpdate:modelValue": i[0] || (i[0] = (p) => m(t)[s.item.prop] = p),
|
|
328
|
-
size: m(a)
|
|
329
|
-
}, l.value), {
|
|
330
|
-
default: f(() => [
|
|
331
|
-
(o(!0), S(L, null, $(s.item.option || [], (p) => (o(), c(r, {
|
|
332
|
-
key: p.value,
|
|
333
|
-
label: p.label,
|
|
334
|
-
value: p.value
|
|
335
|
-
}, null, 8, ["label", "value"]))), 128))
|
|
336
|
-
]),
|
|
337
|
-
_: 1
|
|
338
|
-
}, 16, ["modelValue", "size"]);
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
}), Ce = /* @__PURE__ */ k({
|
|
342
|
-
__name: "index",
|
|
343
|
-
props: {
|
|
344
|
-
item: {}
|
|
345
|
-
},
|
|
346
|
-
setup(e) {
|
|
347
|
-
const { item: n } = e, t = h("queryParams", {}), a = h("size"), l = g({
|
|
348
|
-
...Y,
|
|
349
|
-
...n.selectSetting
|
|
350
|
-
});
|
|
351
|
-
return (s, i) => {
|
|
352
|
-
const r = d("el-cascader");
|
|
353
|
-
return o(), c(r, b({
|
|
354
|
-
modelValue: m(t)[s.item.prop],
|
|
355
|
-
"onUpdate:modelValue": i[0] || (i[0] = (_) => m(t)[s.item.prop] = _),
|
|
356
|
-
size: m(a),
|
|
357
|
-
options: s.item.options || []
|
|
358
|
-
}, l.value), null, 16, ["modelValue", "size", "options"]);
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
}), De = k({
|
|
64
|
+
const G = /* @__PURE__ */ v(K, [["render", Q]]), j = {
|
|
362
65
|
name: "GeneralBasicForm",
|
|
363
66
|
components: {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
Radio: qe,
|
|
370
|
-
Checkbox: Ve,
|
|
371
|
-
DatePicker: Ie,
|
|
372
|
-
Select: Le,
|
|
373
|
-
Cascader: Ce
|
|
67
|
+
InputArchive: (e) => {
|
|
68
|
+
const { templateEle: n } = e;
|
|
69
|
+
return n();
|
|
70
|
+
},
|
|
71
|
+
VerificationButton: G
|
|
374
72
|
},
|
|
375
73
|
props: {
|
|
376
74
|
showSearch: {
|
|
@@ -433,34 +131,46 @@ const Pe = /* @__PURE__ */ w(ze, [["render", $e]]), qe = /* @__PURE__ */ k({
|
|
|
433
131
|
}
|
|
434
132
|
},
|
|
435
133
|
data() {
|
|
134
|
+
var e;
|
|
436
135
|
return {
|
|
136
|
+
queryParams: {
|
|
137
|
+
...this.noUrlParameters ? {} : (e = this.$route) == null ? void 0 : e.query
|
|
138
|
+
},
|
|
139
|
+
// form表单数据
|
|
437
140
|
formLoading: this.loading || !1,
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
), O(
|
|
456
|
-
/* 注入名 */
|
|
457
|
-
"getList",
|
|
458
|
-
/* 值 */
|
|
459
|
-
a
|
|
460
|
-
), {
|
|
461
|
-
queryParams: s
|
|
141
|
+
selectSetting: {
|
|
142
|
+
placeholder: "请选择",
|
|
143
|
+
filterable: !0,
|
|
144
|
+
clearable: !0,
|
|
145
|
+
style: "width: 200px"
|
|
146
|
+
},
|
|
147
|
+
inputSetting: {
|
|
148
|
+
placeholder: "请输入",
|
|
149
|
+
style: "width: 200px",
|
|
150
|
+
clearable: !0
|
|
151
|
+
},
|
|
152
|
+
datePackerSetting: {
|
|
153
|
+
style: "width: 227px",
|
|
154
|
+
"start-placeholder": "开始日期",
|
|
155
|
+
"end-placeholder": "结束日期",
|
|
156
|
+
type: "daterange"
|
|
157
|
+
}
|
|
462
158
|
};
|
|
463
159
|
},
|
|
160
|
+
// setup(props) {
|
|
161
|
+
//设置默认值
|
|
162
|
+
// console.log(props);
|
|
163
|
+
// // const { formItem } = toRefs(props);
|
|
164
|
+
// const { formItem } = props;
|
|
165
|
+
// console.log(formItem);
|
|
166
|
+
// const queryParams = {};
|
|
167
|
+
// formItem.forEach((item) => {
|
|
168
|
+
// queryParams[item.prop] = "";
|
|
169
|
+
// });
|
|
170
|
+
// return {
|
|
171
|
+
// queryParams,
|
|
172
|
+
// };
|
|
173
|
+
// },
|
|
464
174
|
watch: {
|
|
465
175
|
formData: {
|
|
466
176
|
handler(e, n) {
|
|
@@ -487,23 +197,12 @@ const Pe = /* @__PURE__ */ w(ze, [["render", $e]]), qe = /* @__PURE__ */ k({
|
|
|
487
197
|
this.loading !== e && this.$emit("update:loading", e);
|
|
488
198
|
}
|
|
489
199
|
},
|
|
490
|
-
provide() {
|
|
491
|
-
return {
|
|
492
|
-
// 显式提供一个计算属性
|
|
493
|
-
[Z]: {
|
|
494
|
-
formLoading: j(() => this.formLoading),
|
|
495
|
-
updateFormLoading: (e) => {
|
|
496
|
-
this.formLoading = e;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
};
|
|
500
|
-
},
|
|
501
200
|
methods: {
|
|
502
201
|
/** 搜索按钮操作 */
|
|
503
202
|
handleQuery() {
|
|
504
|
-
var
|
|
203
|
+
var r;
|
|
505
204
|
const e = { page: 1, limit: 10 }, n = {
|
|
506
|
-
...(
|
|
205
|
+
...(r = this.$route) == null ? void 0 : r.query,
|
|
507
206
|
...this.queryParams,
|
|
508
207
|
...e
|
|
509
208
|
};
|
|
@@ -524,286 +223,172 @@ const Pe = /* @__PURE__ */ w(ze, [["render", $e]]), qe = /* @__PURE__ */ k({
|
|
|
524
223
|
...this.noUrlParameters ? {} : (n = this.$route) == null ? void 0 : n.query
|
|
525
224
|
}, this.afterReset(), this.handleQuery();
|
|
526
225
|
},
|
|
226
|
+
currentInputComponent() {
|
|
227
|
+
return "input-archive";
|
|
228
|
+
},
|
|
527
229
|
getItemRules(e) {
|
|
528
|
-
const { type: n, rules:
|
|
529
|
-
return this.noInputBlank && n === "input" &&
|
|
230
|
+
const { type: n, rules: r = [] } = e, d = [...r];
|
|
231
|
+
return this.noInputBlank && n === "input" && d.push({
|
|
530
232
|
pattern: this.trimRegex,
|
|
531
233
|
message: "请输入(不能仅输入空格)",
|
|
532
234
|
trigger: "blur"
|
|
533
|
-
}),
|
|
235
|
+
}), d;
|
|
236
|
+
},
|
|
237
|
+
getInputSetting(e) {
|
|
238
|
+
const { inputSetting: n } = e;
|
|
239
|
+
return {
|
|
240
|
+
...this.inputSetting,
|
|
241
|
+
...n
|
|
242
|
+
};
|
|
243
|
+
},
|
|
244
|
+
getSelectSetting(e) {
|
|
245
|
+
const { selectSetting: n } = e;
|
|
246
|
+
return {
|
|
247
|
+
...this.selectSetting,
|
|
248
|
+
...n
|
|
249
|
+
};
|
|
250
|
+
},
|
|
251
|
+
getDatePackerSetting(e) {
|
|
252
|
+
const { datePackerSetting: n } = e;
|
|
253
|
+
return {
|
|
254
|
+
...this.datePackerSetting,
|
|
255
|
+
...n
|
|
256
|
+
};
|
|
534
257
|
}
|
|
535
258
|
}
|
|
536
|
-
}
|
|
537
|
-
function
|
|
538
|
-
const
|
|
539
|
-
return
|
|
540
|
-
model:
|
|
259
|
+
}, A = { slot: "append" };
|
|
260
|
+
function J(e, n, r, d, o, i) {
|
|
261
|
+
const h = u("el-input"), T = u("verification-button"), w = u("el-option"), U = u("el-select"), I = u("el-cascader"), C = u("el-date-picker"), B = u("el-input-number"), _ = u("el-form-item"), b = u("el-button"), F = u("el-form"), L = N("loading");
|
|
262
|
+
return S((a(), s(F, p({
|
|
263
|
+
model: o.queryParams,
|
|
541
264
|
ref: "queryFormRef",
|
|
542
265
|
inline: "",
|
|
543
266
|
"label-position": "left",
|
|
544
|
-
"label-width":
|
|
267
|
+
"label-width": r.labelWidth
|
|
545
268
|
}, e.$attrs), {
|
|
546
|
-
default:
|
|
547
|
-
(
|
|
548
|
-
label:
|
|
549
|
-
prop:
|
|
550
|
-
key:
|
|
551
|
-
rules:
|
|
269
|
+
default: c(() => [
|
|
270
|
+
(a(!0), k(P, null, y(r.formItem, (t) => (a(), s(_, {
|
|
271
|
+
label: t.label,
|
|
272
|
+
prop: t.prop,
|
|
273
|
+
key: t.prop,
|
|
274
|
+
rules: i.getItemRules(t)
|
|
552
275
|
}, {
|
|
553
|
-
default:
|
|
554
|
-
|
|
276
|
+
default: c(() => [
|
|
277
|
+
t.type === "input" ? (a(), s(h, p({
|
|
555
278
|
key: 0,
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
279
|
+
onKeydown: V(r.getList, ["enter"]),
|
|
280
|
+
modelValue: o.queryParams[t.prop],
|
|
281
|
+
"onUpdate:modelValue": (l) => o.queryParams[t.prop] = l,
|
|
282
|
+
size: r.size
|
|
283
|
+
}, i.getInputSetting(t)), q({ _: 2 }, [
|
|
284
|
+
y(t.template, (l, m) => ({
|
|
285
|
+
name: m,
|
|
286
|
+
fn: c(() => [
|
|
287
|
+
l ? (a(), s(x(i.currentInputComponent()), {
|
|
288
|
+
key: m,
|
|
289
|
+
templateEle: l
|
|
290
|
+
}, null, 8, ["templateEle"])) : f("", !0)
|
|
291
|
+
])
|
|
292
|
+
}))
|
|
293
|
+
]), 1040, ["onKeydown", "modelValue", "onUpdate:modelValue", "size"])) : t.type === "input-mobile-verification" ? (a(), s(h, p({
|
|
559
294
|
key: 1,
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
295
|
+
onKeydown: V(r.getList, ["enter"]),
|
|
296
|
+
modelValue: o.queryParams[t.prop],
|
|
297
|
+
"onUpdate:modelValue": (l) => o.queryParams[t.prop] = l,
|
|
298
|
+
size: r.size
|
|
299
|
+
}, i.getInputSetting(t)), q({
|
|
300
|
+
default: c(() => [
|
|
301
|
+
R("template", A, [
|
|
302
|
+
z(T, {
|
|
303
|
+
verificationSetting: t.verificationSetting,
|
|
304
|
+
getSmscode: t.getSmscode
|
|
305
|
+
}, null, 8, ["verificationSetting", "getSmscode"])
|
|
306
|
+
])
|
|
307
|
+
]),
|
|
308
|
+
_: 2
|
|
309
|
+
}, [
|
|
310
|
+
y(t.template, (l, m) => ({
|
|
311
|
+
name: m,
|
|
312
|
+
fn: c(() => [
|
|
313
|
+
l ? (a(), s(x(i.currentInputComponent()), {
|
|
314
|
+
key: m,
|
|
315
|
+
templateEle: l
|
|
316
|
+
}, null, 8, ["templateEle"])) : f("", !0)
|
|
317
|
+
])
|
|
318
|
+
}))
|
|
319
|
+
]), 1040, ["onKeydown", "modelValue", "onUpdate:modelValue", "size"])) : t.type === "select" ? (a(), s(U, p({
|
|
563
320
|
key: 2,
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
321
|
+
filterable: "",
|
|
322
|
+
modelValue: o.queryParams[t.prop],
|
|
323
|
+
"onUpdate:modelValue": (l) => o.queryParams[t.prop] = l,
|
|
324
|
+
size: r.size
|
|
325
|
+
}, i.getSelectSetting(t)), {
|
|
326
|
+
default: c(() => [
|
|
327
|
+
(a(!0), k(P, null, y(t.option || [], (l) => (a(), s(w, {
|
|
328
|
+
key: l.value,
|
|
329
|
+
label: l.desc,
|
|
330
|
+
value: l.value
|
|
331
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
332
|
+
]),
|
|
333
|
+
_: 2
|
|
334
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "size"])) : t.type === "cascader" ? (a(), s(I, p({
|
|
567
335
|
key: 3,
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
336
|
+
filterable: "",
|
|
337
|
+
modelValue: o.queryParams[t.prop],
|
|
338
|
+
"onUpdate:modelValue": (l) => o.queryParams[t.prop] = l,
|
|
339
|
+
size: r.size,
|
|
340
|
+
options: t.options || []
|
|
341
|
+
}, i.getSelectSetting(t)), null, 16, ["modelValue", "onUpdate:modelValue", "size", "options"])) : t.type === "date-picker" ? (a(), s(C, p({
|
|
571
342
|
key: 4,
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
343
|
+
modelValue: o.queryParams[t.prop],
|
|
344
|
+
"onUpdate:modelValue": (l) => o.queryParams[t.prop] = l,
|
|
345
|
+
size: r.size
|
|
346
|
+
}, i.getDatePackerSetting(t)), null, 16, ["modelValue", "onUpdate:modelValue", "size"])) : f("", !0),
|
|
347
|
+
t.type === "input-number" ? (a(), s(B, p({
|
|
575
348
|
key: 5,
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
item: u
|
|
581
|
-
}, null, 8, ["item"])) : y("", !0),
|
|
582
|
-
u.type === "input-number" ? (o(), c(G, {
|
|
583
|
-
key: 7,
|
|
584
|
-
item: u
|
|
585
|
-
}, null, 8, ["item"])) : y("", !0),
|
|
586
|
-
u.type === "form-item-slot" ? Q(e.$slots, u.name, { key: 8 }) : y("", !0),
|
|
587
|
-
u.type === "input-mobile-verification" ? (o(), c(N, {
|
|
588
|
-
key: 9,
|
|
589
|
-
item: u
|
|
590
|
-
}, null, 8, ["item"])) : y("", !0),
|
|
591
|
-
u.type === "input-graphic-verification" ? (o(), c(x, {
|
|
592
|
-
item: u,
|
|
593
|
-
key: u.key
|
|
594
|
-
}, null, 8, ["item"])) : y("", !0)
|
|
349
|
+
modelValue: o.queryParams[t.prop],
|
|
350
|
+
"onUpdate:modelValue": (l) => o.queryParams[t.prop] = l,
|
|
351
|
+
size: r.size
|
|
352
|
+
}, i.getInputSetting(t)), null, 16, ["modelValue", "onUpdate:modelValue", "size"])) : f("", !0)
|
|
595
353
|
]),
|
|
596
354
|
_: 2
|
|
597
355
|
}, 1032, ["label", "prop", "rules"]))), 128)),
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
default:
|
|
601
|
-
|
|
356
|
+
O(e.$slots, "default"),
|
|
357
|
+
r.formOnly ? f("", !0) : (a(), s(_, { key: 0 }, {
|
|
358
|
+
default: c(() => [
|
|
359
|
+
S((a(), s(b, {
|
|
602
360
|
type: "primary",
|
|
603
|
-
|
|
604
|
-
|
|
361
|
+
icon: "el-icon-search",
|
|
362
|
+
size: r.size,
|
|
363
|
+
onClick: i.handleQuery
|
|
605
364
|
}, {
|
|
606
|
-
default:
|
|
607
|
-
|
|
365
|
+
default: c(() => [
|
|
366
|
+
g("查询")
|
|
608
367
|
]),
|
|
609
368
|
_: 1
|
|
610
369
|
}, 8, ["size", "onClick"])), [
|
|
611
|
-
[
|
|
370
|
+
[L, o.formLoading]
|
|
612
371
|
]),
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
372
|
+
z(b, {
|
|
373
|
+
icon: "el-icon-refresh",
|
|
374
|
+
size: r.size,
|
|
375
|
+
onClick: i.resetQuery
|
|
616
376
|
}, {
|
|
617
|
-
default:
|
|
618
|
-
|
|
377
|
+
default: c(() => [
|
|
378
|
+
g("重置")
|
|
619
379
|
]),
|
|
620
380
|
_: 1
|
|
621
381
|
}, 8, ["size", "onClick"])
|
|
622
382
|
]),
|
|
623
383
|
_: 1
|
|
624
|
-
}))
|
|
625
|
-
Q(e.$slots, "behind-the-button")
|
|
384
|
+
}))
|
|
626
385
|
]),
|
|
627
386
|
_: 3
|
|
628
387
|
}, 16, ["model", "label-width"])), [
|
|
629
|
-
[
|
|
388
|
+
[E, r.showSearch]
|
|
630
389
|
]);
|
|
631
390
|
}
|
|
632
|
-
const
|
|
633
|
-
__name: "InfiniteScrollList",
|
|
634
|
-
props: {
|
|
635
|
-
search: {
|
|
636
|
-
type: Function,
|
|
637
|
-
required: !0
|
|
638
|
-
},
|
|
639
|
-
checkbox: {
|
|
640
|
-
type: Boolean,
|
|
641
|
-
required: !1
|
|
642
|
-
},
|
|
643
|
-
id: {
|
|
644
|
-
type: String,
|
|
645
|
-
required: !0
|
|
646
|
-
},
|
|
647
|
-
name: {
|
|
648
|
-
type: String,
|
|
649
|
-
required: !0
|
|
650
|
-
},
|
|
651
|
-
extra: {
|
|
652
|
-
type: null,
|
|
653
|
-
required: !1
|
|
654
|
-
},
|
|
655
|
-
defaultSelection: {
|
|
656
|
-
type: Array,
|
|
657
|
-
required: !1
|
|
658
|
-
}
|
|
659
|
-
},
|
|
660
|
-
setup(e, { expose: n }) {
|
|
661
|
-
const t = e, { search: a, id: l, name: s, extra: i } = t, r = g([]), _ = g(1), p = g(!1), P = g([]), q = g(!1), F = (v, u) => {
|
|
662
|
-
const { i: A } = v;
|
|
663
|
-
return i && i !== "false" ? i(A) : "";
|
|
664
|
-
}, G = (v) => {
|
|
665
|
-
P.value = v.map((u) => typeof u == "object" ? u[l] : u);
|
|
666
|
-
};
|
|
667
|
-
ue(
|
|
668
|
-
() => t.defaultSelection,
|
|
669
|
-
(v = [], u = []) => {
|
|
670
|
-
G(v);
|
|
671
|
-
},
|
|
672
|
-
{ immediate: !0 }
|
|
673
|
-
);
|
|
674
|
-
const N = () => {
|
|
675
|
-
x(), P.value = [];
|
|
676
|
-
}, x = () => {
|
|
677
|
-
_.value = 1, r.value = [], p.value = !1;
|
|
678
|
-
}, V = async () => {
|
|
679
|
-
if (q.value || p.value)
|
|
680
|
-
return;
|
|
681
|
-
q.value = !0;
|
|
682
|
-
const v = await a(_.value);
|
|
683
|
-
v && v.length > 0 ? (r.value = [...r.value, ...v], _.value += 1) : p.value = !0, q.value = !1;
|
|
684
|
-
}, R = () => {
|
|
685
|
-
x(), V();
|
|
686
|
-
}, E = j(
|
|
687
|
-
() => r.value.filter((v) => P.value.includes(v[l]))
|
|
688
|
-
) || {};
|
|
689
|
-
return n({
|
|
690
|
-
reset: N,
|
|
691
|
-
lowReset: x,
|
|
692
|
-
loadList: V,
|
|
693
|
-
selectInfo: E,
|
|
694
|
-
list: r,
|
|
695
|
-
ifbottom: p,
|
|
696
|
-
refreshList: R
|
|
697
|
-
}), (v, u) => {
|
|
698
|
-
const A = d("el-checkbox"), ee = d("el-checkbox-group"), M = U("infinite-scroll"), te = U("loading");
|
|
699
|
-
return t.checkbox ? C((o(), c(ee, b({
|
|
700
|
-
key: 0,
|
|
701
|
-
modelValue: P.value,
|
|
702
|
-
"onUpdate:modelValue": u[0] || (u[0] = (z) => P.value = z)
|
|
703
|
-
}, t), {
|
|
704
|
-
default: f(() => [
|
|
705
|
-
C((o(), S("ul", {
|
|
706
|
-
class: "list",
|
|
707
|
-
"infinite-scroll-disabled": p.value
|
|
708
|
-
}, [
|
|
709
|
-
(o(!0), S(L, null, $(r.value, (z) => (o(), S("li", {
|
|
710
|
-
key: z[m(l)],
|
|
711
|
-
class: "list-item"
|
|
712
|
-
}, [
|
|
713
|
-
T(A, {
|
|
714
|
-
label: z[m(l)],
|
|
715
|
-
class: "checkbox"
|
|
716
|
-
}, {
|
|
717
|
-
default: f(() => [
|
|
718
|
-
I(D(z[m(s)]) + " ", 1),
|
|
719
|
-
t.extra ? (o(), c(F, {
|
|
720
|
-
key: 0,
|
|
721
|
-
i: z
|
|
722
|
-
}, null, 8, ["i"])) : y("", !0)
|
|
723
|
-
]),
|
|
724
|
-
_: 2
|
|
725
|
-
}, 1032, ["label"])
|
|
726
|
-
]))), 128))
|
|
727
|
-
], 8, Be)), [
|
|
728
|
-
[M, V]
|
|
729
|
-
])
|
|
730
|
-
]),
|
|
731
|
-
_: 1
|
|
732
|
-
}, 16, ["modelValue"])), [
|
|
733
|
-
[te, q.value]
|
|
734
|
-
]) : C((o(), S("ul", b({
|
|
735
|
-
key: 1,
|
|
736
|
-
class: "list",
|
|
737
|
-
"infinite-scroll-disabled": p.value
|
|
738
|
-
}, t), [
|
|
739
|
-
(o(!0), S(L, null, $(r.value, (z) => (o(), S("li", {
|
|
740
|
-
key: z[m(l)],
|
|
741
|
-
class: "list-item"
|
|
742
|
-
}, [
|
|
743
|
-
H("div", Re, [
|
|
744
|
-
I(D(z[m(s)]) + " ", 1),
|
|
745
|
-
t.extra ? (o(), c(F, {
|
|
746
|
-
key: 0,
|
|
747
|
-
i: z
|
|
748
|
-
}, null, 8, ["i"])) : y("", !0)
|
|
749
|
-
])
|
|
750
|
-
]))), 128))
|
|
751
|
-
], 16, Fe)), [
|
|
752
|
-
[M, V]
|
|
753
|
-
]);
|
|
754
|
-
};
|
|
755
|
-
}
|
|
756
|
-
});
|
|
757
|
-
const Ge = /* @__PURE__ */ w(Ue, [["__scopeId", "data-v-fa74e9b9"]]), Ne = { key: 1 }, Ee = /* @__PURE__ */ k({
|
|
758
|
-
__name: "Descriptions",
|
|
759
|
-
props: {
|
|
760
|
-
formData: {
|
|
761
|
-
type: Object,
|
|
762
|
-
required: !0
|
|
763
|
-
},
|
|
764
|
-
formItem: {
|
|
765
|
-
type: Array,
|
|
766
|
-
required: !0
|
|
767
|
-
}
|
|
768
|
-
},
|
|
769
|
-
setup(e) {
|
|
770
|
-
const n = e, t = (a, l) => {
|
|
771
|
-
const { i: s, render: i, formData: r } = a;
|
|
772
|
-
return i({
|
|
773
|
-
row: r,
|
|
774
|
-
$index: s
|
|
775
|
-
});
|
|
776
|
-
};
|
|
777
|
-
return (a, l) => {
|
|
778
|
-
const s = d("el-descriptions-item"), i = d("el-descriptions");
|
|
779
|
-
return o(), c(i, b({
|
|
780
|
-
column: 1,
|
|
781
|
-
border: "",
|
|
782
|
-
class: "form-width"
|
|
783
|
-
}, n), {
|
|
784
|
-
default: f(() => [
|
|
785
|
-
(o(!0), S(L, null, $(n.formItem, (r, _) => (o(), c(s, b({
|
|
786
|
-
key: r.prop,
|
|
787
|
-
label: r.label
|
|
788
|
-
}, r.descriptionsItemProps), {
|
|
789
|
-
default: f(() => [
|
|
790
|
-
r.render ? (o(), c(t, {
|
|
791
|
-
key: 0,
|
|
792
|
-
i: _,
|
|
793
|
-
render: r.render,
|
|
794
|
-
formData: e.formData
|
|
795
|
-
}, null, 8, ["i", "render", "formData"])) : (o(), S("span", Ne, D(e.formData[r.prop]), 1))
|
|
796
|
-
]),
|
|
797
|
-
_: 2
|
|
798
|
-
}, 1040, ["label"]))), 128))
|
|
799
|
-
]),
|
|
800
|
-
_: 1
|
|
801
|
-
}, 16);
|
|
802
|
-
};
|
|
803
|
-
}
|
|
804
|
-
}), Qe = xe, Te = Ge, je = Ee;
|
|
391
|
+
const W = /* @__PURE__ */ v(j, [["render", J]]), M = W;
|
|
805
392
|
export {
|
|
806
|
-
|
|
807
|
-
Qe as VGeneralBasicForm,
|
|
808
|
-
Te as VInfiniteScrollList
|
|
393
|
+
M as VGeneralBasicForm
|
|
809
394
|
};
|
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 z={placeholder:"请输入",style:"width: 200px",clearable:!0},L={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:{...z,...this.item.inputSetting}}},methods:{currentInputComponent(){return"input-archive"}}}),h=(t,n)=>{const o=t.__vccOpts||t;for(const[i,s]of n)o[i]=s;return o};function F(t,n,o,i,s,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(N,[["render",F]]),E=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),i=e.inject("size"),s=e.ref({...z,...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(i)},s.value),null,16,["modelValue","size"])}}}),q=Symbol(),j={class:"input-graphic-verification"},R=["src","alt"],U=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,{graphicSrc:o="",graphicAlt:i="",getGraphic:s=()=>{},key:l}=n,{formLoading:a,updateFormLoading:r}=e.inject(q),m=async()=>{s&&!a.value&&await s()};return(p,k)=>{const u=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",j,[e.createVNode(V,{item:p.item,class:"input"},null,8,["item"]),e.createElementVNode("img",{class:"graphic",onClick:m,src:e.unref(o),alt:e.unref(i)||`${e.unref(l)}`},null,8,R)])),[[u,e.unref(a)]])}}}),_e="",T=h(U,[["__scopeId","data-v-006751c3"]]),g="获取验证码",G=60,A=e.defineComponent({__name:"verification-button",props:{getSmscode:{type:Function}},setup(t){const{getSmscode:n}=t,o=e.ref(g),i=e.ref(null),s=e.computed(()=>o.value===g),l=()=>{i&&(clearInterval(i.value),i.value=null,o.value=g)},a=async()=>{if(o.value===g)if(o.value=G,i.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:s.value?"var(--color-primary, #409EFF)":"var(--text-color-placeholder, #A8ABB2)",cursor:s.value?"pointer":"default"}),onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value?g:o.value+"s"),1)]),_:1},8,["style"])}}}),ke="",O=h(A,[["__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(O,{getSmscode:o.getSmscode})},(i,s)=>(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,i,s,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=h(K,[["render",M]]),W=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),i=e.inject("size"),s=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(i)},s.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(i),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",{}),i=e.inject("size"),s=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(i)},s.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(i),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",{}),i=e.inject("size"),s=e.ref({...L,...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(i)},s.value),null,16,["modelValue","size"])}}}),Y=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),i=e.inject("size"),s=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(i)},s.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",{}),i=e.inject("size"),s=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(i),options:l.item.options||[]},s.value),null,16,["modelValue","size","options"])}}}),v=e.defineComponent({name:"GeneralBasicForm",components:{Input:V,InputNumber:E,InputGraphicVerification:T,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:()=>{}},noInputBlank:{type:Boolean,default:()=>!1}},data(){return{formLoading:this.loading||!1,trimRegex:/\S/}},setup(t){const{size:n,noUrlParameters:o,getList:i}=t,s=I.useRoute(),l=e.ref({...o?{}:s==null?void 0:s.query});return e.provide("queryParams",l),e.provide("size",n),e.provide("getList",i),{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()},getItemRules(t){const{type:n,rules:o=[]}=t,i=[...o];return this.noInputBlank&&n==="input"&&i.push({pattern:this.trimRegex,message:"请输入(不能仅输入空格)",trigger:"blur"}),i}}});function ee(t,n,o,i,s,l){const a=e.resolveComponent("Input"),r=e.resolveComponent("Radio"),m=e.resolveComponent("Select"),p=e.resolveComponent("Divider"),k=e.resolveComponent("Cascader"),u=e.resolveComponent("Checkbox"),C=e.resolveComponent("DatePicker"),S=e.resolveComponent("InputNumber"),P=e.resolveComponent("InputMobileVerification"),B=e.resolveComponent("InputGraphicVerification"),y=e.resolveComponent("el-form-item"),b=e.resolveComponent("el-button"),w=e.resolveComponent("el-form"),d=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(w,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(y,{label:c.label,prop:c.prop,key:c.prop,rules:t.getItemRules(c)},{default:e.withCtx(()=>[c.type==="input"?(e.openBlock(),e.createBlock(a,{key:0,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="radio"?(e.openBlock(),e.createBlock(r,{key:1,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="select"?(e.openBlock(),e.createBlock(m,{key:2,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="divider"?(e.openBlock(),e.createBlock(p,{key:3,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="cascader"?(e.openBlock(),e.createBlock(k,{key:4,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="checkbox"?(e.openBlock(),e.createBlock(u,{key:5,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="date-picker"?(e.openBlock(),e.createBlock(C,{key:6,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="input-number"?(e.openBlock(),e.createBlock(S,{key:7,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="form-item-slot"?e.renderSlot(t.$slots,c.name,{key:8}):e.createCommentVNode("",!0),c.type==="input-mobile-verification"?(e.openBlock(),e.createBlock(P,{key:9,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="input-graphic-verification"?(e.openBlock(),e.createBlock(B,{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(y,{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=h(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:i,id:s,name:l,extra:a}=o,r=e.ref([]),m=e.ref(1),p=e.ref(!1),k=e.ref([]),u=e.ref(!1),C=(d,c)=>{const{i:x}=d;return a&&a!=="false"?a(x):""},S=d=>{k.value=d.map(c=>typeof c=="object"?c[s]:c)};e.watch(()=>o.defaultSelection,(d=[],c=[])=>{S(d)},{immediate:!0});const P=()=>{B(),k.value=[]},B=()=>{m.value=1,r.value=[],p.value=!1},y=async()=>{if(u.value||p.value)return;u.value=!0;const d=await i(m.value);d&&d.length>0?(r.value=[...r.value,...d],m.value+=1):p.value=!0,u.value=!1},b=()=>{B(),y()},w=e.computed(()=>r.value.filter(d=>k.value.includes(d[s])))||{};return n({reset:P,lowReset:B,loadList:y,selectInfo:w,list:r,ifbottom:p,refreshList:b}),(d,c)=>{const x=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":c[0]||(c[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(s)],class:"list-item"},[e.createVNode(x,{label:_[e.unref(s)],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,y]])]),_:1},16,["modelValue"])),[[fe,u.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(s)],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,y]])}}}),ue="",ie=h(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=(i,s)=>{const{i:l,render:a,formData:r}=i;return a({row:r,$index:l})};return(i,s)=>{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"})});
|
|
1
|
+
(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s.Index={},s.Vue))})(this,function(s,e){"use strict";const m=(t,r)=>{const n=t.__vccOpts||t;for(const[c,a]of r)n[c]=a;return n},h={props:{verificationSetting:{type:Object,default:()=>{}},getSmscode:{type:Function,default:()=>{}}},data(){return{defaultText:this.verificationSetting.defaultText||"获取验证码",buttonText:this.verificationSetting.defaultText||"获取验证码",restTime:this.verificationSetting.restTime||60,timer:null}},computed:{buttonType(){return this.buttonText===this.defaultText}},destroyed(){this.reset()},methods:{reset(){this.timer&&(clearInterval(this.timer),this.timer=null,this.buttonText=this.defaultText)},async buttonClick(){if(this.buttonText===this.defaultText)if(this.buttonText=this.restTime,this.timer=setInterval(()=>{if(Number(this.buttonText)<=0||!this.buttonText){this.reset();return}else this.buttonText=Number(this.buttonText)-1},1e3),this.getSmscode)await this.getSmscode()===!1&&this.reset();else return}}};function y(t,r,n,c,a,i){const d=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(d,{onClick:i.buttonClick},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.buttonType?a.defaultText:a.buttonText+"s"),1)]),_:1},8,["onClick"])}const g={name:"GeneralBasicForm",components:{InputArchive:t=>{const{templateEle:r}=t;return r()},VerificationButton:m(h,[["render",y]])},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:()=>{}},noInputBlank:{type:Boolean,default:()=>!1}},data(){var t;return{queryParams:{...this.noUrlParameters?{}:(t=this.$route)==null?void 0:t.query},formLoading:this.loading||!1,selectSetting:{placeholder:"请选择",filterable:!0,clearable:!0,style:"width: 200px"},inputSetting:{placeholder:"请输入",style:"width: 200px",clearable:!0},datePackerSetting:{style:"width: 227px","start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange"}}},watch:{formData:{handler(t,r){JSON.stringify(t)!==JSON.stringify(r)&&(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)}},methods:{handleQuery(){var n;const t={page:1,limit:10},r={...(n=this.$route)==null?void 0:n.query,...this.queryParams,...t};this.noUrlParameters||this.$router.push({query:{...r}}),this.getList({...r})},async resetQuery(){var r;this.$refs.queryFormRef.resetFields();const t={page:1};this.noUrlParameters||await this.$router.push({query:{...t}}),this.queryParams={...this.noUrlParameters?{}:(r=this.$route)==null?void 0:r.query},this.afterReset(),this.handleQuery()},currentInputComponent(){return"input-archive"},getItemRules(t){const{type:r,rules:n=[]}=t,c=[...n];return this.noInputBlank&&r==="input"&&c.push({pattern:this.trimRegex,message:"请输入(不能仅输入空格)",trigger:"blur"}),c},getInputSetting(t){const{inputSetting:r}=t;return{...this.inputSetting,...r}},getSelectSetting(t){const{selectSetting:r}=t;return{...this.selectSetting,...r}},getDatePackerSetting(t){const{datePackerSetting:r}=t;return{...this.datePackerSetting,...r}}}},_={slot:"append"};function k(t,r,n,c,a,i){const d=e.resolveComponent("el-input"),b=e.resolveComponent("verification-button"),B=e.resolveComponent("el-option"),V=e.resolveComponent("el-select"),x=e.resolveComponent("el-cascader"),C=e.resolveComponent("el-date-picker"),P=e.resolveComponent("el-input-number"),u=e.resolveComponent("el-form-item"),f=e.resolveComponent("el-button"),w=e.resolveComponent("el-form"),T=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(w,e.mergeProps({model:a.queryParams,ref:"queryFormRef",inline:"","label-position":"left","label-width":n.labelWidth},t.$attrs),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.formItem,o=>(e.openBlock(),e.createBlock(u,{label:o.label,prop:o.prop,key:o.prop,rules:i.getItemRules(o)},{default:e.withCtx(()=>[o.type==="input"?(e.openBlock(),e.createBlock(d,e.mergeProps({key:0,onKeydown:e.withKeys(n.getList,["enter"]),modelValue:a.queryParams[o.prop],"onUpdate:modelValue":l=>a.queryParams[o.prop]=l,size:n.size},i.getInputSetting(o)),e.createSlots({_:2},[e.renderList(o.template,(l,p)=>({name:p,fn:e.withCtx(()=>[l?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.currentInputComponent()),{key:p,templateEle:l},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040,["onKeydown","modelValue","onUpdate:modelValue","size"])):o.type==="input-mobile-verification"?(e.openBlock(),e.createBlock(d,e.mergeProps({key:1,onKeydown:e.withKeys(n.getList,["enter"]),modelValue:a.queryParams[o.prop],"onUpdate:modelValue":l=>a.queryParams[o.prop]=l,size:n.size},i.getInputSetting(o)),e.createSlots({default:e.withCtx(()=>[e.createElementVNode("template",_,[e.createVNode(b,{verificationSetting:o.verificationSetting,getSmscode:o.getSmscode},null,8,["verificationSetting","getSmscode"])])]),_:2},[e.renderList(o.template,(l,p)=>({name:p,fn:e.withCtx(()=>[l?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.currentInputComponent()),{key:p,templateEle:l},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040,["onKeydown","modelValue","onUpdate:modelValue","size"])):o.type==="select"?(e.openBlock(),e.createBlock(V,e.mergeProps({key:2,filterable:"",modelValue:a.queryParams[o.prop],"onUpdate:modelValue":l=>a.queryParams[o.prop]=l,size:n.size},i.getSelectSetting(o)),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.option||[],l=>(e.openBlock(),e.createBlock(B,{key:l.value,label:l.desc,value:l.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","size"])):o.type==="cascader"?(e.openBlock(),e.createBlock(x,e.mergeProps({key:3,filterable:"",modelValue:a.queryParams[o.prop],"onUpdate:modelValue":l=>a.queryParams[o.prop]=l,size:n.size,options:o.options||[]},i.getSelectSetting(o)),null,16,["modelValue","onUpdate:modelValue","size","options"])):o.type==="date-picker"?(e.openBlock(),e.createBlock(C,e.mergeProps({key:4,modelValue:a.queryParams[o.prop],"onUpdate:modelValue":l=>a.queryParams[o.prop]=l,size:n.size},i.getDatePackerSetting(o)),null,16,["modelValue","onUpdate:modelValue","size"])):e.createCommentVNode("",!0),o.type==="input-number"?(e.openBlock(),e.createBlock(P,e.mergeProps({key:5,modelValue:a.queryParams[o.prop],"onUpdate:modelValue":l=>a.queryParams[o.prop]=l,size:n.size},i.getInputSetting(o)),null,16,["modelValue","onUpdate:modelValue","size"])):e.createCommentVNode("",!0)]),_:2},1032,["label","prop","rules"]))),128)),e.renderSlot(t.$slots,"default"),n.formOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(u,{key:0},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(f,{type:"primary",icon:"el-icon-search",size:n.size,onClick:i.handleQuery},{default:e.withCtx(()=>[e.createTextVNode("查询")]),_:1},8,["size","onClick"])),[[T,a.formLoading]]),e.createVNode(f,{icon:"el-icon-refresh",size:n.size,onClick:i.resetQuery},{default:e.withCtx(()=>[e.createTextVNode("重置")]),_:1},8,["size","onClick"])]),_:1}))]),_:3},16,["model","label-width"])),[[e.vShow,n.showSearch]])}const S=m(g,[["render",k]]);s.VGeneralBasicForm=S,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "general-basic-form",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "./
|
|
5
|
+
"main": "./dist/index.umd.cjs",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "cross-env CURRENT_ENV=prod run-p type-check && run-p build-only",
|
|
@@ -46,5 +46,17 @@
|
|
|
46
46
|
"typescript": "^5.2.2",
|
|
47
47
|
"vite-plugin-image-optimizer": "^1.1.6"
|
|
48
48
|
},
|
|
49
|
-
"typings": "./
|
|
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
|
+
"types": "./dist/index.d.ts"
|
|
56
|
+
},
|
|
57
|
+
"./style": "./dist/style.css"
|
|
58
|
+
},
|
|
59
|
+
"files": [
|
|
60
|
+
"/dist"
|
|
61
|
+
]
|
|
50
62
|
}
|
|
Binary file
|
package/dist/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.input-graphic-verification[data-v-006751c3]{display:flex;gap:12px;width:100%}.input-graphic-verification .input[data-v-006751c3]{flex:auto}.input-graphic-verification .graphic[data-v-006751c3]{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/public/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 陈德立*******419287484@qq.com
|
|
3
|
-
* @Date: 2023-11-07 17:55:59
|
|
4
|
-
* @LastEditTime: 2023-11-08 10:24:14
|
|
5
|
-
* @LastEditors: 陈德立*******419287484@qq.com
|
|
6
|
-
* @Github: https://github.com/Alan1034
|
|
7
|
-
* @Description:
|
|
8
|
-
* @FilePath: \GeneralBasicForm\public\index.d.ts
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
/// <reference types="vite/client" />
|
|
12
|
-
declare module "*.vue" {
|
|
13
|
-
import { DefineComponent } from "vue"
|
|
14
|
-
const component: DefineComponent<{}, {}, any>
|
|
15
|
-
export default component
|
|
16
|
-
}
|
|
17
|
-
declare module "general-basic-form";
|
package/script/initialization.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import fs from 'fs'
|
|
3
|
-
import chalk from 'chalk'
|
|
4
|
-
import { fileURLToPath } from 'url'
|
|
5
|
-
const __filenameNew = fileURLToPath(import.meta.url)
|
|
6
|
-
const __dirnameNew = path.dirname(__filenameNew)
|
|
7
|
-
export const updateMain = (mainDir:string) => {
|
|
8
|
-
try {
|
|
9
|
-
const packageTxt = fs.readFileSync(path.join(__dirnameNew, '../package.json'), 'utf8');
|
|
10
|
-
const packageJson = JSON.parse(packageTxt);
|
|
11
|
-
|
|
12
|
-
delete packageJson.files
|
|
13
|
-
delete packageJson.module
|
|
14
|
-
delete packageJson.exports
|
|
15
|
-
packageJson.typings = "./publish/index.d.ts"
|
|
16
|
-
packageJson.main = mainDir
|
|
17
|
-
const versionData = JSON.stringify(packageJson, null, 2);
|
|
18
|
-
fs.writeFileSync(path.join(__dirnameNew, '../package.json'), versionData, 'utf8');
|
|
19
|
-
console.log(chalk.green.bold('修改入口配置成功!当前入口路径为为:' + mainDir));
|
|
20
|
-
} catch (error) {
|
|
21
|
-
console.log(chalk.red.bold('修改入口配置出错:', error.toString()));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
}
|
package/script/link.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 陈德立*******419287484@qq.com
|
|
3
|
-
* @Date: 2023-11-10 09:39:59
|
|
4
|
-
* @LastEditTime: 2023-11-15 18:38:43
|
|
5
|
-
* @LastEditors: 陈德立*******419287484@qq.com
|
|
6
|
-
* @Github: https://github.com/Alan1034
|
|
7
|
-
* @Description: link处理流程
|
|
8
|
-
* @FilePath: \VueNpmFrame\script\link.ts
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
import { updateMain } from "./initialization";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
updateMain("./src/index.ts")
|
package/script/linkNode.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 陈德立*******419287484@qq.com
|
|
3
|
-
* @Date: 2023-11-10 09:39:59
|
|
4
|
-
* @LastEditTime: 2024-03-01 11:27:02
|
|
5
|
-
* @LastEditors: 陈德立*******419287484@qq.com
|
|
6
|
-
* @Github: https://github.com/Alan1034
|
|
7
|
-
* @Description: link处理流程
|
|
8
|
-
* @FilePath: \VueNpmFrame\script\linkNode.ts
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
import { updateMain } from "./initialization";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
updateMain("./dist/src/index.js")
|
package/script/unlinkModule.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 陈德立*******419287484@qq.com
|
|
3
|
-
* @Date: 2023-11-10 09:39:59
|
|
4
|
-
* @LastEditTime: 2023-11-25 23:52:27
|
|
5
|
-
* @LastEditors: 陈德立*******419287484@qq.com
|
|
6
|
-
* @Github: https://github.com/Alan1034
|
|
7
|
-
* @Description: unlink处理流程
|
|
8
|
-
* @FilePath: \vite-plugin-update-version\script\unlinkModule.ts
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
import path from "path";
|
|
12
|
-
import fs from 'fs'
|
|
13
|
-
import chalk from 'chalk'
|
|
14
|
-
import { fileURLToPath } from 'url'
|
|
15
|
-
const __filenameNew = fileURLToPath(import.meta.url)
|
|
16
|
-
const __dirnameNew = path.dirname(__filenameNew)
|
|
17
|
-
const updateMain = () => {
|
|
18
|
-
try {
|
|
19
|
-
const packageTxt = fs.readFileSync(path.join(__dirnameNew, '../package.json'), 'utf8');
|
|
20
|
-
const packageJson = JSON.parse(packageTxt);
|
|
21
|
-
const umdDir = "./dist/index.umd.cjs"
|
|
22
|
-
const esDir = "./dist/index.js"
|
|
23
|
-
const types = "./dist/index.d.ts"
|
|
24
|
-
packageJson.type = "module"
|
|
25
|
-
packageJson.main = umdDir
|
|
26
|
-
packageJson.module = esDir
|
|
27
|
-
packageJson.exports = {
|
|
28
|
-
".": {
|
|
29
|
-
"import": esDir,
|
|
30
|
-
"require": umdDir,
|
|
31
|
-
"types": types
|
|
32
|
-
},
|
|
33
|
-
"./style": "./dist/style.css"
|
|
34
|
-
}
|
|
35
|
-
packageJson.typings = types
|
|
36
|
-
packageJson.files = [
|
|
37
|
-
"/dist"
|
|
38
|
-
]
|
|
39
|
-
const versionData = JSON.stringify(packageJson, null, 2);
|
|
40
|
-
fs.writeFileSync(path.join(__dirnameNew, '../package.json'), versionData, 'utf8');
|
|
41
|
-
console.log(chalk.green.bold('修改入口配置成功!当前入口路径为为:' + umdDir));
|
|
42
|
-
} catch (error) {
|
|
43
|
-
console.log(chalk.red.bold('修改入口配置出错:', error.toString()));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
updateMain()
|
package/script/unlinkNode.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 陈德立*******419287484@qq.com
|
|
3
|
-
* @Date: 2023-11-10 09:39:59
|
|
4
|
-
* @LastEditTime: 2024-03-01 11:33:05
|
|
5
|
-
* @LastEditors: 陈德立*******419287484@qq.com
|
|
6
|
-
* @Github: https://github.com/Alan1034
|
|
7
|
-
* @Description: unlink处理流程
|
|
8
|
-
* @FilePath: \VueNpmFrame\script\unlinkNode.ts
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
import path from "path";
|
|
12
|
-
import fs from 'fs'
|
|
13
|
-
import chalk from 'chalk'
|
|
14
|
-
import { fileURLToPath } from 'url'
|
|
15
|
-
const __filenameNew = fileURLToPath(import.meta.url)
|
|
16
|
-
const __dirnameNew = path.dirname(__filenameNew)
|
|
17
|
-
const updateMain = () => {
|
|
18
|
-
try {
|
|
19
|
-
const packageTxt = fs.readFileSync(path.join(__dirnameNew, '../package.json'), 'utf8');
|
|
20
|
-
const packageJson = JSON.parse(packageTxt);
|
|
21
|
-
const cjsDir = "./dist/src/index.js"
|
|
22
|
-
const types = "./dist/src/index.d.ts"
|
|
23
|
-
delete packageJson.type
|
|
24
|
-
packageJson.main = cjsDir
|
|
25
|
-
packageJson.typings = types
|
|
26
|
-
packageJson.files = [
|
|
27
|
-
"/dist"
|
|
28
|
-
]
|
|
29
|
-
const versionData = JSON.stringify(packageJson, null, 2);
|
|
30
|
-
fs.writeFileSync(path.join(__dirnameNew, '../package.json'), versionData, 'utf8');
|
|
31
|
-
console.log(chalk.green.bold('修改入口配置成功!当前入口路径为为:' + cjsDir));
|
|
32
|
-
} catch (error) {
|
|
33
|
-
console.log(chalk.red.bold('修改入口配置出错:', error.toString()));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
updateMain()
|
package/tsconfig.json
DELETED
package/vite.config.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import legacy from '@vitejs/plugin-legacy'
|
|
2
|
-
import { fileURLToPath } from 'url'
|
|
3
|
-
import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite'
|
|
4
|
-
import vue from '@vitejs/plugin-vue'
|
|
5
|
-
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
6
|
-
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
|
|
7
|
-
import path from 'path';
|
|
8
|
-
const __filenameNew = fileURLToPath(import.meta.url)
|
|
9
|
-
const __dirnameNew = path.dirname(__filenameNew)
|
|
10
|
-
const resolve = (dir) => path.resolve(__dirnameNew, dir);
|
|
11
|
-
// https://vitejs.dev/config/
|
|
12
|
-
export default defineConfig(({ command, mode }) => {
|
|
13
|
-
// 根据当前工作目录中的 `mode` 加载 .env 文件
|
|
14
|
-
// 设置第三个参数为 '' 来加载所有环境变量,而不管是否有 `VITE_` 前缀。
|
|
15
|
-
const env = loadEnv(mode, process.cwd(), '')
|
|
16
|
-
// console.log(command)
|
|
17
|
-
// console.log(env)
|
|
18
|
-
// console.log(env.CURRENT_ENV)
|
|
19
|
-
// console.log(env.APP_ENV)
|
|
20
|
-
// console.log(env.VUE_APP_BASE_API)
|
|
21
|
-
return {
|
|
22
|
-
// vite环境变量配置
|
|
23
|
-
define: {
|
|
24
|
-
"CURRENT_ENV": JSON.stringify(env.CURRENT_ENV),
|
|
25
|
-
},
|
|
26
|
-
server: {
|
|
27
|
-
open: true,
|
|
28
|
-
},
|
|
29
|
-
resolve: {
|
|
30
|
-
alias: {
|
|
31
|
-
'@': resolve('src'),//路径化名
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
plugins: [
|
|
38
|
-
/**
|
|
39
|
-
* @description: vite自带的文件分割配置
|
|
40
|
-
* @return {*}
|
|
41
|
-
*/
|
|
42
|
-
{
|
|
43
|
-
...splitVendorChunkPlugin(),
|
|
44
|
-
apply: 'build',
|
|
45
|
-
},
|
|
46
|
-
/**
|
|
47
|
-
* @description: 图片压缩插件
|
|
48
|
-
* @return {*}
|
|
49
|
-
*/
|
|
50
|
-
{
|
|
51
|
-
...ViteImageOptimizer({
|
|
52
|
-
/* pass your config */
|
|
53
|
-
}),
|
|
54
|
-
// enforce: 'pre',
|
|
55
|
-
apply: 'build',
|
|
56
|
-
},
|
|
57
|
-
/**
|
|
58
|
-
* @description: 兼容旧版本浏览器
|
|
59
|
-
* @return {*}
|
|
60
|
-
*/
|
|
61
|
-
{
|
|
62
|
-
...legacy({
|
|
63
|
-
targets: ['defaults'],
|
|
64
|
-
}),
|
|
65
|
-
apply: 'build',
|
|
66
|
-
},
|
|
67
|
-
vue(),
|
|
68
|
-
vueJsx(),
|
|
69
|
-
],
|
|
70
|
-
css: {
|
|
71
|
-
preprocessorOptions: {
|
|
72
|
-
less: {
|
|
73
|
-
// 支持内联 JavaScript
|
|
74
|
-
javascriptEnabled: true,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
/**
|
|
79
|
-
* @description: 打包时才调用
|
|
80
|
-
* @return {*}
|
|
81
|
-
*/
|
|
82
|
-
build: {
|
|
83
|
-
lib: {
|
|
84
|
-
// Could also be a dictionary or array of multiple entry points
|
|
85
|
-
// 添加打包入口文件夹
|
|
86
|
-
entry: resolve(`${__dirnameNew}/src`, 'index.ts'),
|
|
87
|
-
// formats: ['es', 'cjs', 'umd', 'iife'],
|
|
88
|
-
name: 'Index',
|
|
89
|
-
// the proper extensions will be added
|
|
90
|
-
// fileName: (format) => `index.${format}.js`,
|
|
91
|
-
fileName: "index",
|
|
92
|
-
},
|
|
93
|
-
rollupOptions: {
|
|
94
|
-
// 确保外部化处理那些你不想打包进库的依赖
|
|
95
|
-
external: ['vue'],
|
|
96
|
-
output: {
|
|
97
|
-
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
|
|
98
|
-
globals: {
|
|
99
|
-
vue: 'Vue',
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
// minify: 'terser',
|
|
104
|
-
//打包环境移除console.log,debugger
|
|
105
|
-
// terserOptions: {
|
|
106
|
-
// compress: {
|
|
107
|
-
// drop_console: true,
|
|
108
|
-
// drop_debugger: true,
|
|
109
|
-
// },
|
|
110
|
-
// },
|
|
111
|
-
//打包文件按照类型分文件夹显示(貌似会导致性能下降)
|
|
112
|
-
// rollupOptions: {
|
|
113
|
-
// output: {
|
|
114
|
-
// chunkFileNames: 'js/[name]-chunk-[hash:7].js',
|
|
115
|
-
// entryFileNames: 'js/[name]-app-[hash:7].js',
|
|
116
|
-
// assetFileNames: '[ext]/[name]-chunk-[hash:7].[ext]',
|
|
117
|
-
// },
|
|
118
|
-
// },
|
|
119
|
-
},
|
|
120
|
-
}
|
|
121
|
-
})
|