general-basic-form 2.0.5 → 2.0.6
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 +2 -0
- package/dist/index.js +164 -139
- package/dist/index.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,6 +42,7 @@ import GeneralBasicForm from 'general-basic-form'
|
|
|
42
42
|
}
|
|
43
43
|
noUrlParameters
|
|
44
44
|
:afterReset="afterReset"
|
|
45
|
+
v-model:loading="loading"
|
|
45
46
|
/>
|
|
46
47
|
|
|
47
48
|
<style lang="scss" scoped>
|
|
@@ -98,6 +99,7 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
98
99
|
afterReset(); // 在重置按钮点击完后但还没重新请求时触发的的函数
|
|
99
100
|
formOnly:true // 只展示表单不展示按钮
|
|
100
101
|
noUrlParameters:true // 不接受和不改变url的参数
|
|
102
|
+
loading:false // 加载动画
|
|
101
103
|
formItem: [
|
|
102
104
|
{
|
|
103
105
|
label: '',
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as _, inject as g, resolveComponent as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as _, inject as g, resolveComponent as l, openBlock as r, createBlock as a, mergeProps as h, withKeys as W, createSlots as F, renderList as S, withCtx as f, resolveDynamicComponent as U, createCommentVNode as y, ref as V, unref as v, resolveDirective as D, withDirectives as $, createElementBlock as q, createVNode as N, createElementVNode as H, computed as E, onBeforeUnmount as J, normalizeStyle as X, createTextVNode as I, toDisplayString as Y, h as Z, normalizeProps as x, guardReactiveProps as ee, provide as z, Fragment as B, renderSlot as te, vShow as ne } from "vue";
|
|
2
|
+
import { useRoute as oe } from "vue-router";
|
|
3
|
+
const G = {
|
|
4
4
|
placeholder: "请输入",
|
|
5
5
|
style: "width: 200px",
|
|
6
6
|
clearable: !0
|
|
7
|
-
},
|
|
7
|
+
}, re = _({
|
|
8
8
|
components: {
|
|
9
9
|
InputArchive: (e) => {
|
|
10
10
|
const { templateEle: n } = e;
|
|
@@ -22,7 +22,7 @@ const E = {
|
|
|
22
22
|
data() {
|
|
23
23
|
return {
|
|
24
24
|
inputSetting: {
|
|
25
|
-
...
|
|
25
|
+
...G,
|
|
26
26
|
...this.item.inputSetting
|
|
27
27
|
}
|
|
28
28
|
};
|
|
@@ -46,118 +46,118 @@ const E = {
|
|
|
46
46
|
// },
|
|
47
47
|
}), P = (e, n) => {
|
|
48
48
|
const t = e.__vccOpts || e;
|
|
49
|
-
for (const [
|
|
50
|
-
t[
|
|
49
|
+
for (const [s, i] of n)
|
|
50
|
+
t[s] = i;
|
|
51
51
|
return t;
|
|
52
52
|
};
|
|
53
|
-
function
|
|
54
|
-
const c =
|
|
55
|
-
return
|
|
56
|
-
onKeydown:
|
|
53
|
+
function ae(e, n, t, s, i, p) {
|
|
54
|
+
const c = l("el-input");
|
|
55
|
+
return r(), a(c, h({
|
|
56
|
+
onKeydown: W(e.getList, ["enter"]),
|
|
57
57
|
modelValue: e.queryParams[e.item.prop],
|
|
58
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
58
|
+
"onUpdate:modelValue": n[0] || (n[0] = (u) => e.queryParams[e.item.prop] = u),
|
|
59
59
|
size: e.size
|
|
60
60
|
}, e.inputSetting), F({ _: 2 }, [
|
|
61
|
-
S(e.item.template, (
|
|
62
|
-
name:
|
|
63
|
-
fn:
|
|
64
|
-
|
|
65
|
-
key:
|
|
66
|
-
templateEle:
|
|
67
|
-
}, null, 8, ["templateEle"])) :
|
|
61
|
+
S(e.item.template, (u, d) => ({
|
|
62
|
+
name: d,
|
|
63
|
+
fn: f(() => [
|
|
64
|
+
u ? (r(), a(U(e.currentInputComponent()), {
|
|
65
|
+
key: d,
|
|
66
|
+
templateEle: u
|
|
67
|
+
}, null, 8, ["templateEle"])) : y("", !0)
|
|
68
68
|
])
|
|
69
69
|
}))
|
|
70
70
|
]), 1040, ["onKeydown", "modelValue", "size"]);
|
|
71
71
|
}
|
|
72
|
-
const
|
|
72
|
+
const L = /* @__PURE__ */ P(re, [["render", ae]]), ie = /* @__PURE__ */ _({
|
|
73
73
|
__name: "index",
|
|
74
74
|
props: {
|
|
75
75
|
item: {}
|
|
76
76
|
},
|
|
77
77
|
setup(e) {
|
|
78
|
-
const { item: n } = e, t = g("queryParams", {}),
|
|
79
|
-
...
|
|
78
|
+
const { item: n } = e, t = g("queryParams", {}), s = g("size"), i = V({
|
|
79
|
+
...G,
|
|
80
80
|
...n.inputSetting
|
|
81
81
|
});
|
|
82
|
-
return (
|
|
83
|
-
const
|
|
84
|
-
return
|
|
85
|
-
modelValue:
|
|
86
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
87
|
-
size:
|
|
88
|
-
},
|
|
82
|
+
return (p, c) => {
|
|
83
|
+
const u = l("el-input-number");
|
|
84
|
+
return r(), a(u, h({
|
|
85
|
+
modelValue: v(t)[p.item.prop],
|
|
86
|
+
"onUpdate:modelValue": c[0] || (c[0] = (d) => v(t)[p.item.prop] = d),
|
|
87
|
+
size: v(s)
|
|
88
|
+
}, i.value), null, 16, ["modelValue", "size"]);
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
}),
|
|
91
|
+
}), R = Symbol(), se = { class: "input-graphic-verification" }, le = ["src"], ue = /* @__PURE__ */ _({
|
|
92
92
|
__name: "index",
|
|
93
93
|
props: {
|
|
94
94
|
item: {}
|
|
95
95
|
},
|
|
96
96
|
setup(e) {
|
|
97
|
-
const { item: n } = e, { graphicSrc: t = "", getGraphic:
|
|
98
|
-
} } = n,
|
|
99
|
-
|
|
97
|
+
const { item: n } = e, { graphicSrc: t = "", getGraphic: s = () => {
|
|
98
|
+
} } = n, { formLoading: i, updateFormLoading: p } = g(R), c = async () => {
|
|
99
|
+
s && !i.value && await s();
|
|
100
100
|
};
|
|
101
|
-
return (
|
|
102
|
-
const
|
|
103
|
-
return
|
|
104
|
-
|
|
105
|
-
item:
|
|
101
|
+
return (u, d) => {
|
|
102
|
+
const b = D("loading");
|
|
103
|
+
return $((r(), q("div", se, [
|
|
104
|
+
N(L, {
|
|
105
|
+
item: u.item,
|
|
106
106
|
class: "input"
|
|
107
107
|
}, null, 8, ["item"]),
|
|
108
|
-
|
|
108
|
+
H("img", {
|
|
109
109
|
class: "graphic",
|
|
110
|
-
onClick:
|
|
111
|
-
src:
|
|
112
|
-
}, null, 8,
|
|
110
|
+
onClick: c,
|
|
111
|
+
src: v(t)
|
|
112
|
+
}, null, 8, le)
|
|
113
113
|
])), [
|
|
114
|
-
[
|
|
114
|
+
[b, v(i)]
|
|
115
115
|
]);
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
|
-
const
|
|
119
|
+
const pe = /* @__PURE__ */ P(ue, [["__scopeId", "data-v-500ec9b0"]]), k = "获取验证码", ce = 60, de = /* @__PURE__ */ _({
|
|
120
120
|
__name: "verification-button",
|
|
121
121
|
props: {
|
|
122
122
|
getSmscode: { type: Function }
|
|
123
123
|
},
|
|
124
124
|
setup(e) {
|
|
125
|
-
const { getSmscode: n } = e, t = k
|
|
126
|
-
|
|
125
|
+
const { getSmscode: n } = e, t = V(k), s = V(null), i = E(() => t.value === k), p = () => {
|
|
126
|
+
s && (clearInterval(s.value), s.value = null, t.value = k);
|
|
127
127
|
}, c = async () => {
|
|
128
|
-
if (t.value ===
|
|
129
|
-
if (t.value =
|
|
128
|
+
if (t.value === k)
|
|
129
|
+
if (t.value = ce, s.value = setInterval(() => {
|
|
130
130
|
if (Number(t.value) <= 0 || !t.value) {
|
|
131
|
-
|
|
131
|
+
p();
|
|
132
132
|
return;
|
|
133
133
|
} else
|
|
134
134
|
t.value = Number(t.value) - 1;
|
|
135
135
|
}, 1e3), n)
|
|
136
|
-
await n() === !1 &&
|
|
136
|
+
await n() === !1 && p();
|
|
137
137
|
else
|
|
138
138
|
return;
|
|
139
139
|
};
|
|
140
|
-
return
|
|
141
|
-
|
|
142
|
-
}), (
|
|
143
|
-
const
|
|
144
|
-
return
|
|
140
|
+
return J(() => {
|
|
141
|
+
p();
|
|
142
|
+
}), (u, d) => {
|
|
143
|
+
const b = l("el-button");
|
|
144
|
+
return r(), a(b, {
|
|
145
145
|
class: "verifiaction-button",
|
|
146
|
-
style:
|
|
147
|
-
color:
|
|
148
|
-
cursor:
|
|
146
|
+
style: X({
|
|
147
|
+
color: i.value ? "var(--color-primary, #409EFF)" : "var(--text-color-placeholder, #A8ABB2)",
|
|
148
|
+
cursor: i.value ? "pointer" : "default"
|
|
149
149
|
}),
|
|
150
150
|
onClick: c
|
|
151
151
|
}, {
|
|
152
|
-
default:
|
|
153
|
-
I(
|
|
152
|
+
default: f(() => [
|
|
153
|
+
I(Y(i.value ? k : t.value + "s"), 1)
|
|
154
154
|
]),
|
|
155
155
|
_: 1
|
|
156
156
|
}, 8, ["style"]);
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
|
-
const
|
|
160
|
+
const me = /* @__PURE__ */ P(de, [["__scopeId", "data-v-4074e137"]]), fe = /* @__PURE__ */ _({
|
|
161
161
|
__name: "index",
|
|
162
162
|
props: {
|
|
163
163
|
item: {}
|
|
@@ -165,15 +165,15 @@ const ce = /* @__PURE__ */ P(pe, [["__scopeId", "data-v-4074e137"]]), me = /* @_
|
|
|
165
165
|
setup(e) {
|
|
166
166
|
const { item: n } = e, t = n;
|
|
167
167
|
return t.template = {
|
|
168
|
-
append: () =>
|
|
168
|
+
append: () => Z(me, {
|
|
169
169
|
getSmscode: t.getSmscode
|
|
170
170
|
})
|
|
171
|
-
}, (
|
|
172
|
-
item:
|
|
171
|
+
}, (s, i) => (r(), a(L, {
|
|
172
|
+
item: v(t),
|
|
173
173
|
class: "input"
|
|
174
174
|
}, null, 8, ["item"]));
|
|
175
175
|
}
|
|
176
|
-
}),
|
|
176
|
+
}), ye = _({
|
|
177
177
|
components: {
|
|
178
178
|
slotArchive: (e) => {
|
|
179
179
|
const { templateEle: n } = e;
|
|
@@ -199,28 +199,28 @@ const ce = /* @__PURE__ */ P(pe, [["__scopeId", "data-v-4074e137"]]), me = /* @_
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
});
|
|
202
|
-
function
|
|
203
|
-
const c =
|
|
204
|
-
return
|
|
205
|
-
S(e.item.template, (
|
|
206
|
-
name:
|
|
207
|
-
fn:
|
|
208
|
-
|
|
209
|
-
key:
|
|
210
|
-
templateEle:
|
|
211
|
-
}, null, 8, ["templateEle"])) :
|
|
202
|
+
function _e(e, n, t, s, i, p) {
|
|
203
|
+
const c = l("el-divider");
|
|
204
|
+
return r(), a(c, x(ee(e.dividerSetting)), F({ _: 2 }, [
|
|
205
|
+
S(e.item.template, (u, d) => ({
|
|
206
|
+
name: d,
|
|
207
|
+
fn: f(() => [
|
|
208
|
+
u ? (r(), a(U(e.currentInputComponent()), {
|
|
209
|
+
key: d,
|
|
210
|
+
templateEle: u
|
|
211
|
+
}, null, 8, ["templateEle"])) : y("", !0)
|
|
212
212
|
])
|
|
213
213
|
}))
|
|
214
214
|
]), 1040);
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const he = /* @__PURE__ */ P(ye, [["render", _e]]), ge = _({
|
|
217
217
|
name: "GeneralBasicForm",
|
|
218
218
|
components: {
|
|
219
|
-
Input:
|
|
220
|
-
InputNumber:
|
|
221
|
-
InputGraphicVerification:
|
|
222
|
-
InputMobileVerification:
|
|
223
|
-
Divider:
|
|
219
|
+
Input: L,
|
|
220
|
+
InputNumber: ie,
|
|
221
|
+
InputGraphicVerification: pe,
|
|
222
|
+
InputMobileVerification: fe,
|
|
223
|
+
Divider: he
|
|
224
224
|
},
|
|
225
225
|
props: {
|
|
226
226
|
showSearch: {
|
|
@@ -228,6 +228,11 @@ const fe = /* @__PURE__ */ P(de, [["render", ye]]), _e = _({
|
|
|
228
228
|
type: Boolean,
|
|
229
229
|
default: !0
|
|
230
230
|
},
|
|
231
|
+
loading: {
|
|
232
|
+
// 加载动画
|
|
233
|
+
type: Boolean,
|
|
234
|
+
default: !1
|
|
235
|
+
},
|
|
231
236
|
formOnly: {
|
|
232
237
|
// 是否只展示表单不展示按钮
|
|
233
238
|
type: Boolean,
|
|
@@ -274,6 +279,7 @@ const fe = /* @__PURE__ */ P(de, [["render", ye]]), _e = _({
|
|
|
274
279
|
},
|
|
275
280
|
data() {
|
|
276
281
|
return {
|
|
282
|
+
formLoading: this.loading || !1,
|
|
277
283
|
selectSetting: {
|
|
278
284
|
placeholder: "请选择",
|
|
279
285
|
clearable: !0,
|
|
@@ -288,14 +294,14 @@ const fe = /* @__PURE__ */ P(de, [["render", ye]]), _e = _({
|
|
|
288
294
|
};
|
|
289
295
|
},
|
|
290
296
|
setup(e) {
|
|
291
|
-
const { size: n, noUrlParameters: t, getList:
|
|
292
|
-
...t ? {} :
|
|
297
|
+
const { size: n, noUrlParameters: t, getList: s } = e, i = oe(), p = V({
|
|
298
|
+
...t ? {} : i == null ? void 0 : i.query
|
|
293
299
|
});
|
|
294
300
|
return z(
|
|
295
301
|
/* 注入名 */
|
|
296
302
|
"queryParams",
|
|
297
303
|
/* 值 */
|
|
298
|
-
|
|
304
|
+
p
|
|
299
305
|
), z(
|
|
300
306
|
/* 注入名 */
|
|
301
307
|
"size",
|
|
@@ -305,9 +311,9 @@ const fe = /* @__PURE__ */ P(de, [["render", ye]]), _e = _({
|
|
|
305
311
|
/* 注入名 */
|
|
306
312
|
"getList",
|
|
307
313
|
/* 值 */
|
|
308
|
-
|
|
314
|
+
s
|
|
309
315
|
), {
|
|
310
|
-
queryParams:
|
|
316
|
+
queryParams: p
|
|
311
317
|
};
|
|
312
318
|
},
|
|
313
319
|
watch: {
|
|
@@ -316,8 +322,25 @@ const fe = /* @__PURE__ */ P(de, [["render", ye]]), _e = _({
|
|
|
316
322
|
...this.noUrlParameters ? {} : this.queryParams,
|
|
317
323
|
...e
|
|
318
324
|
};
|
|
325
|
+
},
|
|
326
|
+
loading(e) {
|
|
327
|
+
this.formLoading !== e && (this.formLoading = e);
|
|
328
|
+
},
|
|
329
|
+
formLoading(e) {
|
|
330
|
+
this.loading !== e && this.$emit("update:loading", e);
|
|
319
331
|
}
|
|
320
332
|
},
|
|
333
|
+
provide() {
|
|
334
|
+
return {
|
|
335
|
+
// 显式提供一个计算属性
|
|
336
|
+
[R]: {
|
|
337
|
+
formLoading: E(() => this.formLoading),
|
|
338
|
+
updateFormLoading: (e) => {
|
|
339
|
+
this.formLoading = e;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
},
|
|
321
344
|
methods: {
|
|
322
345
|
/** 搜索按钮操作 */
|
|
323
346
|
handleQuery() {
|
|
@@ -346,93 +369,95 @@ const fe = /* @__PURE__ */ P(de, [["render", ye]]), _e = _({
|
|
|
346
369
|
}
|
|
347
370
|
}
|
|
348
371
|
});
|
|
349
|
-
function
|
|
350
|
-
const c =
|
|
351
|
-
return
|
|
372
|
+
function ve(e, n, t, s, i, p) {
|
|
373
|
+
const c = l("Input"), u = l("InputGraphicVerification"), d = l("InputMobileVerification"), b = l("Divider"), A = l("el-option"), Q = l("el-select"), T = l("el-cascader"), K = l("el-date-picker"), O = l("InputNumber"), C = l("el-form-item"), w = l("el-button"), M = l("el-form"), j = D("loading");
|
|
374
|
+
return $((r(), a(M, h({
|
|
352
375
|
model: e.queryParams,
|
|
353
376
|
ref: "queryFormRef",
|
|
354
377
|
inline: "",
|
|
355
378
|
"label-position": "left",
|
|
356
379
|
"label-width": e.labelWidth
|
|
357
380
|
}, e.$attrs), {
|
|
358
|
-
default:
|
|
359
|
-
(
|
|
360
|
-
label:
|
|
361
|
-
prop:
|
|
362
|
-
key:
|
|
363
|
-
rules:
|
|
381
|
+
default: f(() => [
|
|
382
|
+
(r(!0), q(B, null, S(e.formItem, (o) => (r(), a(C, {
|
|
383
|
+
label: o.label,
|
|
384
|
+
prop: o.prop,
|
|
385
|
+
key: o.prop,
|
|
386
|
+
rules: o.rules
|
|
364
387
|
}, {
|
|
365
|
-
default:
|
|
366
|
-
|
|
388
|
+
default: f(() => [
|
|
389
|
+
o.type === "input" ? (r(), a(c, {
|
|
367
390
|
key: 0,
|
|
368
|
-
item:
|
|
369
|
-
}, null, 8, ["item"])) :
|
|
370
|
-
|
|
371
|
-
item:
|
|
372
|
-
key:
|
|
373
|
-
}, null, 8, ["item"])) :
|
|
374
|
-
|
|
391
|
+
item: o
|
|
392
|
+
}, null, 8, ["item"])) : y("", !0),
|
|
393
|
+
o.type === "input-graphic-verification" ? (r(), a(u, {
|
|
394
|
+
item: o,
|
|
395
|
+
key: o.key
|
|
396
|
+
}, null, 8, ["item"])) : y("", !0),
|
|
397
|
+
o.type === "input-mobile-verification" ? (r(), a(d, {
|
|
375
398
|
key: 2,
|
|
376
|
-
item:
|
|
377
|
-
}, null, 8, ["item"])) :
|
|
378
|
-
|
|
399
|
+
item: o
|
|
400
|
+
}, null, 8, ["item"])) : y("", !0),
|
|
401
|
+
o.type === "divider" ? (r(), a(b, {
|
|
379
402
|
key: 3,
|
|
380
|
-
item:
|
|
381
|
-
}, null, 8, ["item"])) :
|
|
403
|
+
item: o
|
|
404
|
+
}, null, 8, ["item"])) : o.type === "select" ? (r(), a(Q, h({
|
|
382
405
|
key: 4,
|
|
383
406
|
filterable: "",
|
|
384
|
-
modelValue: e.queryParams[
|
|
385
|
-
"onUpdate:modelValue": (
|
|
407
|
+
modelValue: e.queryParams[o.prop],
|
|
408
|
+
"onUpdate:modelValue": (m) => e.queryParams[o.prop] = m,
|
|
386
409
|
size: e.size
|
|
387
|
-
},
|
|
388
|
-
default:
|
|
389
|
-
(
|
|
390
|
-
key:
|
|
391
|
-
label:
|
|
392
|
-
value:
|
|
410
|
+
}, o.selectSetting || e.selectSetting), {
|
|
411
|
+
default: f(() => [
|
|
412
|
+
(r(!0), q(B, null, S(o.option || [], (m) => (r(), a(A, {
|
|
413
|
+
key: m.value,
|
|
414
|
+
label: m.desc,
|
|
415
|
+
value: m.value
|
|
393
416
|
}, null, 8, ["label", "value"]))), 128))
|
|
394
417
|
]),
|
|
395
418
|
_: 2
|
|
396
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "size"])) :
|
|
419
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "size"])) : o.type === "cascader" ? (r(), a(T, h({
|
|
397
420
|
key: 5,
|
|
398
421
|
filterable: "",
|
|
399
|
-
modelValue: e.queryParams[
|
|
400
|
-
"onUpdate:modelValue": (
|
|
422
|
+
modelValue: e.queryParams[o.prop],
|
|
423
|
+
"onUpdate:modelValue": (m) => e.queryParams[o.prop] = m,
|
|
401
424
|
size: e.size,
|
|
402
|
-
options:
|
|
403
|
-
},
|
|
425
|
+
options: o.options || []
|
|
426
|
+
}, o.selectSetting || e.selectSetting), null, 16, ["modelValue", "onUpdate:modelValue", "size", "options"])) : o.type === "date-picker" ? (r(), a(K, h({
|
|
404
427
|
key: 6,
|
|
405
|
-
modelValue: e.queryParams[
|
|
406
|
-
"onUpdate:modelValue": (
|
|
428
|
+
modelValue: e.queryParams[o.prop],
|
|
429
|
+
"onUpdate:modelValue": (m) => e.queryParams[o.prop] = m,
|
|
407
430
|
size: e.size
|
|
408
|
-
},
|
|
409
|
-
|
|
431
|
+
}, o.datePackerSetting || e.datePackerSetting), null, 16, ["modelValue", "onUpdate:modelValue", "size"])) : y("", !0),
|
|
432
|
+
o.type === "input-number" ? (r(), a(O, {
|
|
410
433
|
key: 7,
|
|
411
|
-
item:
|
|
412
|
-
}, null, 8, ["item"])) :
|
|
434
|
+
item: o
|
|
435
|
+
}, null, 8, ["item"])) : y("", !0)
|
|
413
436
|
]),
|
|
414
437
|
_: 2
|
|
415
438
|
}, 1032, ["label", "prop", "rules"]))), 128)),
|
|
416
|
-
|
|
417
|
-
e.formOnly ?
|
|
418
|
-
default:
|
|
419
|
-
|
|
439
|
+
te(e.$slots, "default"),
|
|
440
|
+
e.formOnly ? y("", !0) : (r(), a(C, { key: 0 }, {
|
|
441
|
+
default: f(() => [
|
|
442
|
+
$((r(), a(w, {
|
|
420
443
|
type: "primary",
|
|
421
444
|
icon: "el-icon-search",
|
|
422
445
|
size: e.size,
|
|
423
446
|
onClick: e.handleQuery
|
|
424
447
|
}, {
|
|
425
|
-
default:
|
|
448
|
+
default: f(() => [
|
|
426
449
|
I("查询")
|
|
427
450
|
]),
|
|
428
451
|
_: 1
|
|
429
|
-
}, 8, ["size", "onClick"]),
|
|
430
|
-
|
|
452
|
+
}, 8, ["size", "onClick"])), [
|
|
453
|
+
[j, e.formLoading]
|
|
454
|
+
]),
|
|
455
|
+
N(w, {
|
|
431
456
|
icon: "el-icon-refresh",
|
|
432
457
|
size: e.size,
|
|
433
458
|
onClick: e.resetQuery
|
|
434
459
|
}, {
|
|
435
|
-
default:
|
|
460
|
+
default: f(() => [
|
|
436
461
|
I("重置")
|
|
437
462
|
]),
|
|
438
463
|
_: 1
|
|
@@ -443,10 +468,10 @@ function he(e, n, t, l, a, u) {
|
|
|
443
468
|
]),
|
|
444
469
|
_: 3
|
|
445
470
|
}, 16, ["model", "label-width"])), [
|
|
446
|
-
[
|
|
471
|
+
[ne, e.showSearch]
|
|
447
472
|
]);
|
|
448
473
|
}
|
|
449
|
-
const
|
|
474
|
+
const be = /* @__PURE__ */ P(ge, [["render", ve]]), Se = be;
|
|
450
475
|
export {
|
|
451
|
-
|
|
476
|
+
Se as VGeneralBasicForm
|
|
452
477
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(d,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):(d=typeof globalThis<"u"?globalThis:d||self,e(d.Index={},d.Vue,d["vue-router"]))})(this,function(d,e,
|
|
1
|
+
(function(d,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):(d=typeof globalThis<"u"?globalThis:d||self,e(d.Index={},d.Vue,d["vue-router"]))})(this,function(d,e,C){"use strict";const _={placeholder:"请输入",style:"width: 200px",clearable:!0},V=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:{..._,...this.item.inputSetting}}},methods:{currentInputComponent(){return"input-archive"}}}),u=(t,n)=>{const o=t.__vccOpts||t;for(const[l,a]of n)o[l]=a;return o};function b(t,n,o,l,a,s){const c=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(c,e.mergeProps({onKeydown:e.withKeys(t.getList,["enter"]),modelValue:t.queryParams[t.item.prop],"onUpdate:modelValue":n[0]||(n[0]=i=>t.queryParams[t.item.prop]=i),size:t.size},t.inputSetting),e.createSlots({_:2},[e.renderList(t.item.template,(i,p)=>({name:p,fn:e.withCtx(()=>[i?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.currentInputComponent()),{key:p,templateEle:i},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040,["onKeydown","modelValue","size"])}const h=u(V,[["render",b]]),P=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),l=e.inject("size"),a=e.ref({..._,...n.inputSetting});return(s,c)=>{const i=e.resolveComponent("el-input-number");return e.openBlock(),e.createBlock(i,e.mergeProps({modelValue:e.unref(o)[s.item.prop],"onUpdate:modelValue":c[0]||(c[0]=p=>e.unref(o)[s.item.prop]=p),size:e.unref(l)},a.value),null,16,["modelValue","size"])}}}),k=Symbol(),S={class:"input-graphic-verification"},z=["src"],q=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,{graphicSrc:o="",getGraphic:l=()=>{}}=n,{formLoading:a,updateFormLoading:s}=e.inject(k),c=async()=>{l&&!a.value&&await l()};return(i,p)=>{const y=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",S,[e.createVNode(h,{item:i.item,class:"input"},null,8,["item"]),e.createElementVNode("img",{class:"graphic",onClick:c,src:e.unref(o)},null,8,z)])),[[y,e.unref(a)]])}}}),W="",$=u(q,[["__scopeId","data-v-500ec9b0"]]),f="获取验证码",w=60,I=e.defineComponent({__name:"verification-button",props:{getSmscode:{type:Function}},setup(t){const{getSmscode:n}=t,o=e.ref(f),l=e.ref(null),a=e.computed(()=>o.value===f),s=()=>{l&&(clearInterval(l.value),l.value=null,o.value=f)},c=async()=>{if(o.value===f)if(o.value=w,l.value=setInterval(()=>{if(Number(o.value)<=0||!o.value){s();return}else o.value=Number(o.value)-1},1e3),n)await n()===!1&&s();else return};return e.onBeforeUnmount(()=>{s()}),(i,p)=>{const y=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(y,{class:"verifiaction-button",style:e.normalizeStyle({color:a.value?"var(--color-primary, #409EFF)":"var(--text-color-placeholder, #A8ABB2)",cursor:a.value?"pointer":"default"}),onClick:c},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.value?f:o.value+"s"),1)]),_:1},8,["style"])}}}),H="",L=u(I,[["__scopeId","data-v-4074e137"]]),N=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=n;return o.template={append:()=>e.h(L,{getSmscode:o.getSmscode})},(l,a)=>(e.openBlock(),e.createBlock(h,{item:e.unref(o),class:"input"},null,8,["item"]))}}),F=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 D(t,n,o,l,a,s){const c=e.resolveComponent("el-divider");return e.openBlock(),e.createBlock(c,e.normalizeProps(e.guardReactiveProps(t.dividerSetting)),e.createSlots({_:2},[e.renderList(t.item.template,(i,p)=>({name:p,fn:e.withCtx(()=>[i?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.currentInputComponent()),{key:p,templateEle:i},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040)}const U=u(F,[["render",D]]),E=e.defineComponent({name:"GeneralBasicForm",components:{Input:h,InputNumber:P,InputGraphicVerification:$,InputMobileVerification:N,Divider:U},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:"medium"},labelWidth:{type:String,default:"90px"},noUrlParameters:{type:Boolean,default:()=>!1},formData:{type:Object,default:()=>{}}},data(){return{formLoading:this.loading||!1,selectSetting:{placeholder:"请选择",clearable:!0,style:"width: 200px"},datePackerSetting:{style:"width: 227px","start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange"}}},setup(t){const{size:n,noUrlParameters:o,getList:l}=t,a=C.useRoute(),s=e.ref({...o?{}:a==null?void 0:a.query});return e.provide("queryParams",s),e.provide("size",n),e.provide("getList",l),{queryParams:s}},watch:{formData(t){this.queryParams={...this.noUrlParameters?{}:this.queryParams,...t}},loading(t){this.formLoading!==t&&(this.formLoading=t)},formLoading(t){this.loading!==t&&this.$emit("update:loading",t)}},provide(){return{[k]:{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 T(t,n,o,l,a,s){const c=e.resolveComponent("Input"),i=e.resolveComponent("InputGraphicVerification"),p=e.resolveComponent("InputMobileVerification"),y=e.resolveComponent("Divider"),G=e.resolveComponent("el-option"),R=e.resolveComponent("el-select"),A=e.resolveComponent("el-cascader"),O=e.resolveComponent("el-date-picker"),Q=e.resolveComponent("InputNumber"),g=e.resolveComponent("el-form-item"),B=e.resolveComponent("el-button"),K=e.resolveComponent("el-form"),M=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,r=>(e.openBlock(),e.createBlock(g,{label:r.label,prop:r.prop,key:r.prop,rules:r.rules},{default:e.withCtx(()=>[r.type==="input"?(e.openBlock(),e.createBlock(c,{key:0,item:r},null,8,["item"])):e.createCommentVNode("",!0),r.type==="input-graphic-verification"?(e.openBlock(),e.createBlock(i,{item:r,key:r.key},null,8,["item"])):e.createCommentVNode("",!0),r.type==="input-mobile-verification"?(e.openBlock(),e.createBlock(p,{key:2,item:r},null,8,["item"])):e.createCommentVNode("",!0),r.type==="divider"?(e.openBlock(),e.createBlock(y,{key:3,item:r},null,8,["item"])):r.type==="select"?(e.openBlock(),e.createBlock(R,e.mergeProps({key:4,filterable:"",modelValue:t.queryParams[r.prop],"onUpdate:modelValue":m=>t.queryParams[r.prop]=m,size:t.size},r.selectSetting||t.selectSetting),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.option||[],m=>(e.openBlock(),e.createBlock(G,{key:m.value,label:m.desc,value:m.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","size"])):r.type==="cascader"?(e.openBlock(),e.createBlock(A,e.mergeProps({key:5,filterable:"",modelValue:t.queryParams[r.prop],"onUpdate:modelValue":m=>t.queryParams[r.prop]=m,size:t.size,options:r.options||[]},r.selectSetting||t.selectSetting),null,16,["modelValue","onUpdate:modelValue","size","options"])):r.type==="date-picker"?(e.openBlock(),e.createBlock(O,e.mergeProps({key:6,modelValue:t.queryParams[r.prop],"onUpdate:modelValue":m=>t.queryParams[r.prop]=m,size:t.size},r.datePackerSetting||t.datePackerSetting),null,16,["modelValue","onUpdate:modelValue","size"])):e.createCommentVNode("",!0),r.type==="input-number"?(e.openBlock(),e.createBlock(Q,{key:7,item:r},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(g,{key:0},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(B,{type:"primary",icon:"el-icon-search",size:t.size,onClick:t.handleQuery},{default:e.withCtx(()=>[e.createTextVNode("查询")]),_:1},8,["size","onClick"])),[[M,t.formLoading]]),e.createVNode(B,{icon:"el-icon-refresh",size:t.size,onClick:t.resetQuery},{default:e.withCtx(()=>[e.createTextVNode("重置")]),_:1},8,["size","onClick"])]),_:1}))]),_:3},16,["model","label-width"])),[[e.vShow,t.showSearch]])}const j=u(E,[["render",T]]);d.VGeneralBasicForm=j,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.input-graphic-verification[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}
|