general-basic-form 2.0.10 → 2.0.12
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 +5 -1
- package/dist/index.js +240 -189
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -163,6 +163,7 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
163
163
|
prop: "spName",
|
|
164
164
|
type: "select",
|
|
165
165
|
multiple:true, //多选
|
|
166
|
+
selectSetting:{},
|
|
166
167
|
option: [
|
|
167
168
|
{ value: "3", label: "满印" },
|
|
168
169
|
{ value: "1", label: "区域印花" },
|
|
@@ -173,7 +174,9 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
173
174
|
label: "创建时间",
|
|
174
175
|
prop: "create_time",
|
|
175
176
|
type: "date-picker",
|
|
176
|
-
|
|
177
|
+
datePackerSetting: {
|
|
178
|
+
"range-separator": "至",
|
|
179
|
+
}
|
|
177
180
|
},
|
|
178
181
|
{
|
|
179
182
|
label: "二次工艺成本价格(人民币分)",
|
|
@@ -249,6 +252,7 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
249
252
|
label: "分类",
|
|
250
253
|
prop: "分类",
|
|
251
254
|
type: "cascader",
|
|
255
|
+
selectSetting:{},
|
|
252
256
|
options: [
|
|
253
257
|
{
|
|
254
258
|
value: "zhinan",
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as h, inject as _, resolveComponent as c, openBlock as o, createBlock as s, mergeProps as b, withKeys as J, createSlots as F, renderList as k, withCtx as g, resolveDynamicComponent as U, createCommentVNode as y, ref as v, unref as d, resolveDirective as G, withDirectives as I, createElementBlock as V, createVNode as N, createElementVNode as X, computed as R, onBeforeUnmount as Y, normalizeStyle as Z, createTextVNode as $, toDisplayString as E, h as x, normalizeProps as ee, guardReactiveProps as te, Fragment as C, provide as q, renderSlot as D, vShow as ne } from "vue";
|
|
2
|
+
import { useRoute as oe } from "vue-router";
|
|
3
|
+
const A = {
|
|
4
4
|
placeholder: "请输入",
|
|
5
5
|
style: "width: 200px",
|
|
6
6
|
clearable: !0
|
|
7
|
-
},
|
|
7
|
+
}, re = {
|
|
8
|
+
style: "width: 227px",
|
|
9
|
+
"start-placeholder": "开始日期",
|
|
10
|
+
"end-placeholder": "结束日期",
|
|
11
|
+
type: "daterange"
|
|
12
|
+
}, Q = {
|
|
13
|
+
placeholder: "请选择",
|
|
14
|
+
filterable: !0,
|
|
15
|
+
clearable: !0,
|
|
16
|
+
style: "width: 200px"
|
|
17
|
+
}, ae = h({
|
|
8
18
|
components: {
|
|
9
19
|
InputArchive: (e) => {
|
|
10
20
|
const { templateEle: n } = e;
|
|
@@ -16,13 +26,13 @@ const Q = {
|
|
|
16
26
|
// null就是any
|
|
17
27
|
},
|
|
18
28
|
setup() {
|
|
19
|
-
const e =
|
|
29
|
+
const e = _("queryParams", {}), n = _("getList"), t = _("size");
|
|
20
30
|
return { queryParams: e, getList: n, size: t };
|
|
21
31
|
},
|
|
22
32
|
data() {
|
|
23
33
|
return {
|
|
24
34
|
inputSetting: {
|
|
25
|
-
...
|
|
35
|
+
...A,
|
|
26
36
|
...this.item.inputSetting
|
|
27
37
|
}
|
|
28
38
|
};
|
|
@@ -44,120 +54,120 @@ const Q = {
|
|
|
44
54
|
// console.log(val);
|
|
45
55
|
// },
|
|
46
56
|
// },
|
|
47
|
-
}),
|
|
57
|
+
}), P = (e, n) => {
|
|
48
58
|
const t = e.__vccOpts || e;
|
|
49
|
-
for (const [
|
|
50
|
-
t[
|
|
59
|
+
for (const [r, a] of n)
|
|
60
|
+
t[r] = a;
|
|
51
61
|
return t;
|
|
52
62
|
};
|
|
53
|
-
function ie(e, n, t,
|
|
54
|
-
const
|
|
55
|
-
return
|
|
56
|
-
onKeydown:
|
|
63
|
+
function ie(e, n, t, r, a, i) {
|
|
64
|
+
const l = c("el-input");
|
|
65
|
+
return o(), s(l, b({
|
|
66
|
+
onKeydown: J(e.getList, ["enter"]),
|
|
57
67
|
modelValue: e.queryParams[e.item.prop],
|
|
58
68
|
"onUpdate:modelValue": n[0] || (n[0] = (u) => e.queryParams[e.item.prop] = u),
|
|
59
69
|
size: e.size
|
|
60
|
-
}, e.inputSetting),
|
|
61
|
-
|
|
62
|
-
name:
|
|
63
|
-
fn:
|
|
64
|
-
u ? (
|
|
65
|
-
key:
|
|
70
|
+
}, e.inputSetting), F({ _: 2 }, [
|
|
71
|
+
k(e.item.template, (u, m) => ({
|
|
72
|
+
name: m,
|
|
73
|
+
fn: g(() => [
|
|
74
|
+
u ? (o(), s(U(e.currentInputComponent()), {
|
|
75
|
+
key: m,
|
|
66
76
|
templateEle: u
|
|
67
|
-
}, null, 8, ["templateEle"])) :
|
|
77
|
+
}, null, 8, ["templateEle"])) : y("", !0)
|
|
68
78
|
])
|
|
69
79
|
}))
|
|
70
80
|
]), 1040, ["onKeydown", "modelValue", "size"]);
|
|
71
81
|
}
|
|
72
|
-
const
|
|
82
|
+
const L = /* @__PURE__ */ P(ae, [["render", ie]]), se = /* @__PURE__ */ h({
|
|
73
83
|
__name: "index",
|
|
74
84
|
props: {
|
|
75
85
|
item: {}
|
|
76
86
|
},
|
|
77
87
|
setup(e) {
|
|
78
|
-
const { item: n } = e, t =
|
|
79
|
-
...
|
|
88
|
+
const { item: n } = e, t = _("queryParams", {}), r = _("size"), a = v({
|
|
89
|
+
...A,
|
|
80
90
|
...n.inputSetting
|
|
81
91
|
});
|
|
82
|
-
return (
|
|
83
|
-
const u =
|
|
84
|
-
return
|
|
85
|
-
modelValue:
|
|
86
|
-
"onUpdate:modelValue":
|
|
87
|
-
size:
|
|
88
|
-
},
|
|
92
|
+
return (i, l) => {
|
|
93
|
+
const u = c("el-input-number");
|
|
94
|
+
return o(), s(u, b({
|
|
95
|
+
modelValue: d(t)[i.item.prop],
|
|
96
|
+
"onUpdate:modelValue": l[0] || (l[0] = (m) => d(t)[i.item.prop] = m),
|
|
97
|
+
size: d(r)
|
|
98
|
+
}, a.value), null, 16, ["modelValue", "size"]);
|
|
89
99
|
};
|
|
90
100
|
}
|
|
91
|
-
}), T = Symbol(),
|
|
101
|
+
}), T = Symbol(), le = { class: "input-graphic-verification" }, ue = ["src"], pe = /* @__PURE__ */ h({
|
|
92
102
|
__name: "index",
|
|
93
103
|
props: {
|
|
94
104
|
item: {}
|
|
95
105
|
},
|
|
96
106
|
setup(e) {
|
|
97
|
-
const { item: n } = e, { graphicSrc: t = "", getGraphic:
|
|
98
|
-
} } = n, { formLoading:
|
|
99
|
-
|
|
107
|
+
const { item: n } = e, { graphicSrc: t = "", getGraphic: r = () => {
|
|
108
|
+
} } = n, { formLoading: a, updateFormLoading: i } = _(T), l = async () => {
|
|
109
|
+
r && !a.value && await r();
|
|
100
110
|
};
|
|
101
|
-
return (u,
|
|
102
|
-
const
|
|
103
|
-
return
|
|
104
|
-
|
|
111
|
+
return (u, m) => {
|
|
112
|
+
const f = G("loading");
|
|
113
|
+
return I((o(), V("div", le, [
|
|
114
|
+
N(L, {
|
|
105
115
|
item: u.item,
|
|
106
116
|
class: "input"
|
|
107
117
|
}, null, 8, ["item"]),
|
|
108
|
-
|
|
118
|
+
X("img", {
|
|
109
119
|
class: "graphic",
|
|
110
|
-
onClick:
|
|
111
|
-
src:
|
|
120
|
+
onClick: l,
|
|
121
|
+
src: d(t)
|
|
112
122
|
}, null, 8, ue)
|
|
113
123
|
])), [
|
|
114
|
-
[
|
|
124
|
+
[f, d(a)]
|
|
115
125
|
]);
|
|
116
126
|
};
|
|
117
127
|
}
|
|
118
128
|
});
|
|
119
|
-
const ce = /* @__PURE__ */
|
|
129
|
+
const ce = /* @__PURE__ */ P(pe, [["__scopeId", "data-v-500ec9b0"]]), z = "获取验证码", me = 60, de = /* @__PURE__ */ h({
|
|
120
130
|
__name: "verification-button",
|
|
121
131
|
props: {
|
|
122
132
|
getSmscode: { type: Function }
|
|
123
133
|
},
|
|
124
134
|
setup(e) {
|
|
125
|
-
const { getSmscode: n } = e, t = z
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
if (t.value ===
|
|
129
|
-
if (t.value =
|
|
135
|
+
const { getSmscode: n } = e, t = v(z), r = v(null), a = R(() => t.value === z), i = () => {
|
|
136
|
+
r && (clearInterval(r.value), r.value = null, t.value = z);
|
|
137
|
+
}, l = async () => {
|
|
138
|
+
if (t.value === z)
|
|
139
|
+
if (t.value = me, r.value = setInterval(() => {
|
|
130
140
|
if (Number(t.value) <= 0 || !t.value) {
|
|
131
|
-
|
|
141
|
+
i();
|
|
132
142
|
return;
|
|
133
143
|
} else
|
|
134
144
|
t.value = Number(t.value) - 1;
|
|
135
145
|
}, 1e3), n)
|
|
136
|
-
await n() === !1 &&
|
|
146
|
+
await n() === !1 && i();
|
|
137
147
|
else
|
|
138
148
|
return;
|
|
139
149
|
};
|
|
140
|
-
return
|
|
141
|
-
|
|
142
|
-
}), (u,
|
|
143
|
-
const
|
|
144
|
-
return
|
|
150
|
+
return Y(() => {
|
|
151
|
+
i();
|
|
152
|
+
}), (u, m) => {
|
|
153
|
+
const f = c("el-button");
|
|
154
|
+
return o(), s(f, {
|
|
145
155
|
class: "verifiaction-button",
|
|
146
|
-
style:
|
|
147
|
-
color:
|
|
148
|
-
cursor:
|
|
156
|
+
style: Z({
|
|
157
|
+
color: a.value ? "var(--color-primary, #409EFF)" : "var(--text-color-placeholder, #A8ABB2)",
|
|
158
|
+
cursor: a.value ? "pointer" : "default"
|
|
149
159
|
}),
|
|
150
|
-
onClick:
|
|
160
|
+
onClick: l
|
|
151
161
|
}, {
|
|
152
|
-
default:
|
|
153
|
-
|
|
162
|
+
default: g(() => [
|
|
163
|
+
$(E(a.value ? z : t.value + "s"), 1)
|
|
154
164
|
]),
|
|
155
165
|
_: 1
|
|
156
166
|
}, 8, ["style"]);
|
|
157
167
|
};
|
|
158
168
|
}
|
|
159
169
|
});
|
|
160
|
-
const
|
|
170
|
+
const _e = /* @__PURE__ */ P(de, [["__scopeId", "data-v-4074e137"]]), fe = /* @__PURE__ */ h({
|
|
161
171
|
__name: "index",
|
|
162
172
|
props: {
|
|
163
173
|
item: {}
|
|
@@ -165,15 +175,15 @@ const fe = /* @__PURE__ */ V(me, [["__scopeId", "data-v-4074e137"]]), _e = /* @_
|
|
|
165
175
|
setup(e) {
|
|
166
176
|
const { item: n } = e, t = n;
|
|
167
177
|
return t.template = {
|
|
168
|
-
append: () =>
|
|
178
|
+
append: () => x(_e, {
|
|
169
179
|
getSmscode: t.getSmscode
|
|
170
180
|
})
|
|
171
|
-
}, (
|
|
172
|
-
item:
|
|
181
|
+
}, (r, a) => (o(), s(L, {
|
|
182
|
+
item: d(t),
|
|
173
183
|
class: "input"
|
|
174
184
|
}, null, 8, ["item"]));
|
|
175
185
|
}
|
|
176
|
-
}), ye =
|
|
186
|
+
}), ye = h({
|
|
177
187
|
components: {
|
|
178
188
|
slotArchive: (e) => {
|
|
179
189
|
const { templateEle: n } = e;
|
|
@@ -199,46 +209,46 @@ const fe = /* @__PURE__ */ V(me, [["__scopeId", "data-v-4074e137"]]), _e = /* @_
|
|
|
199
209
|
}
|
|
200
210
|
}
|
|
201
211
|
});
|
|
202
|
-
function
|
|
203
|
-
const
|
|
204
|
-
return
|
|
205
|
-
|
|
206
|
-
name:
|
|
207
|
-
fn:
|
|
208
|
-
u ? (
|
|
209
|
-
key:
|
|
212
|
+
function ge(e, n, t, r, a, i) {
|
|
213
|
+
const l = c("el-divider");
|
|
214
|
+
return o(), s(l, ee(te(e.dividerSetting)), F({ _: 2 }, [
|
|
215
|
+
k(e.item.template, (u, m) => ({
|
|
216
|
+
name: m,
|
|
217
|
+
fn: g(() => [
|
|
218
|
+
u ? (o(), s(U(e.currentInputComponent()), {
|
|
219
|
+
key: m,
|
|
210
220
|
templateEle: u
|
|
211
|
-
}, null, 8, ["templateEle"])) :
|
|
221
|
+
}, null, 8, ["templateEle"])) : y("", !0)
|
|
212
222
|
])
|
|
213
223
|
}))
|
|
214
224
|
]), 1040);
|
|
215
225
|
}
|
|
216
|
-
const
|
|
226
|
+
const he = /* @__PURE__ */ P(ye, [["render", ge]]), ve = /* @__PURE__ */ h({
|
|
217
227
|
__name: "index",
|
|
218
228
|
props: {
|
|
219
229
|
item: {}
|
|
220
230
|
},
|
|
221
231
|
setup(e) {
|
|
222
|
-
const { item: n } = e, t =
|
|
232
|
+
const { item: n } = e, t = _("queryParams", {}), r = _("size"), a = v({
|
|
223
233
|
...n.radioSetting
|
|
224
|
-
}),
|
|
234
|
+
}), i = v({
|
|
225
235
|
...n.radioGroupSetting
|
|
226
236
|
});
|
|
227
|
-
return (
|
|
228
|
-
const
|
|
229
|
-
return
|
|
230
|
-
modelValue:
|
|
231
|
-
"onUpdate:modelValue": u[0] || (u[0] = (S) =>
|
|
232
|
-
size:
|
|
233
|
-
},
|
|
234
|
-
default:
|
|
235
|
-
(
|
|
236
|
-
size:
|
|
237
|
+
return (l, u) => {
|
|
238
|
+
const m = c("el-radio"), f = c("el-radio-group");
|
|
239
|
+
return o(), s(f, b({
|
|
240
|
+
modelValue: d(t)[l.item.prop],
|
|
241
|
+
"onUpdate:modelValue": u[0] || (u[0] = (S) => d(t)[l.item.prop] = S),
|
|
242
|
+
size: d(r)
|
|
243
|
+
}, i.value), {
|
|
244
|
+
default: g(() => [
|
|
245
|
+
(o(!0), V(C, null, k(l.item.option || [], (S) => (o(), s(m, b({
|
|
246
|
+
size: d(r),
|
|
237
247
|
label: S.label,
|
|
238
248
|
key: S.label
|
|
239
|
-
},
|
|
240
|
-
default:
|
|
241
|
-
|
|
249
|
+
}, a.value), {
|
|
250
|
+
default: g(() => [
|
|
251
|
+
$(E(S.value), 1)
|
|
242
252
|
]),
|
|
243
253
|
_: 2
|
|
244
254
|
}, 1040, ["size", "label"]))), 128))
|
|
@@ -247,15 +257,85 @@ const ge = /* @__PURE__ */ V(ye, [["render", he]]), ve = /* @__PURE__ */ v({
|
|
|
247
257
|
}, 16, ["modelValue", "size"]);
|
|
248
258
|
};
|
|
249
259
|
}
|
|
250
|
-
}), be =
|
|
260
|
+
}), be = /* @__PURE__ */ h({
|
|
261
|
+
__name: "index",
|
|
262
|
+
props: {
|
|
263
|
+
item: {}
|
|
264
|
+
},
|
|
265
|
+
setup(e) {
|
|
266
|
+
const { item: n } = e, t = _("queryParams", {}), r = _("size"), a = v({
|
|
267
|
+
...re,
|
|
268
|
+
...n.datePackerSetting
|
|
269
|
+
});
|
|
270
|
+
return (i, l) => {
|
|
271
|
+
const u = c("el-date-picker");
|
|
272
|
+
return o(), s(u, b({
|
|
273
|
+
modelValue: d(t)[i.item.prop],
|
|
274
|
+
"onUpdate:modelValue": l[0] || (l[0] = (m) => d(t)[i.item.prop] = m),
|
|
275
|
+
size: d(r)
|
|
276
|
+
}, a.value), null, 16, ["modelValue", "size"]);
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
}), Se = /* @__PURE__ */ h({
|
|
280
|
+
__name: "index",
|
|
281
|
+
props: {
|
|
282
|
+
item: {}
|
|
283
|
+
},
|
|
284
|
+
setup(e) {
|
|
285
|
+
const { item: n } = e, t = _("queryParams", {}), r = _("size"), a = v({
|
|
286
|
+
...Q,
|
|
287
|
+
...n.selectSetting
|
|
288
|
+
});
|
|
289
|
+
return (i, l) => {
|
|
290
|
+
const u = c("el-option"), m = c("el-select");
|
|
291
|
+
return o(), s(m, b({
|
|
292
|
+
modelValue: d(t)[i.item.prop],
|
|
293
|
+
"onUpdate:modelValue": l[0] || (l[0] = (f) => d(t)[i.item.prop] = f),
|
|
294
|
+
size: d(r)
|
|
295
|
+
}, a.value), {
|
|
296
|
+
default: g(() => [
|
|
297
|
+
(o(!0), V(C, null, k(i.item.option || [], (f) => (o(), s(u, {
|
|
298
|
+
key: f.value,
|
|
299
|
+
label: f.label,
|
|
300
|
+
value: f.value
|
|
301
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
302
|
+
]),
|
|
303
|
+
_: 1
|
|
304
|
+
}, 16, ["modelValue", "size"]);
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
}), ze = /* @__PURE__ */ h({
|
|
308
|
+
__name: "index",
|
|
309
|
+
props: {
|
|
310
|
+
item: {}
|
|
311
|
+
},
|
|
312
|
+
setup(e) {
|
|
313
|
+
const { item: n } = e, t = _("queryParams", {}), r = _("size"), a = v({
|
|
314
|
+
...Q,
|
|
315
|
+
...n.selectSetting
|
|
316
|
+
});
|
|
317
|
+
return (i, l) => {
|
|
318
|
+
const u = c("el-cascader");
|
|
319
|
+
return o(), s(u, b({
|
|
320
|
+
modelValue: d(t)[i.item.prop],
|
|
321
|
+
"onUpdate:modelValue": l[0] || (l[0] = (m) => d(t)[i.item.prop] = m),
|
|
322
|
+
size: d(r),
|
|
323
|
+
options: i.item.options || []
|
|
324
|
+
}, a.value), null, 16, ["modelValue", "size", "options"]);
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
}), ke = h({
|
|
251
328
|
name: "GeneralBasicForm",
|
|
252
329
|
components: {
|
|
253
|
-
Input:
|
|
254
|
-
InputNumber:
|
|
330
|
+
Input: L,
|
|
331
|
+
InputNumber: se,
|
|
255
332
|
InputGraphicVerification: ce,
|
|
256
|
-
InputMobileVerification:
|
|
257
|
-
Divider:
|
|
258
|
-
Radio: ve
|
|
333
|
+
InputMobileVerification: fe,
|
|
334
|
+
Divider: he,
|
|
335
|
+
Radio: ve,
|
|
336
|
+
DatePicker: be,
|
|
337
|
+
Select: Se,
|
|
338
|
+
Cascader: ze
|
|
259
339
|
},
|
|
260
340
|
props: {
|
|
261
341
|
showSearch: {
|
|
@@ -314,41 +394,30 @@ const ge = /* @__PURE__ */ V(ye, [["render", he]]), ve = /* @__PURE__ */ v({
|
|
|
314
394
|
},
|
|
315
395
|
data() {
|
|
316
396
|
return {
|
|
317
|
-
formLoading: this.loading || !1
|
|
318
|
-
selectSetting: {
|
|
319
|
-
placeholder: "请选择",
|
|
320
|
-
clearable: !0,
|
|
321
|
-
style: "width: 200px"
|
|
322
|
-
},
|
|
323
|
-
datePackerSetting: {
|
|
324
|
-
style: "width: 227px",
|
|
325
|
-
"start-placeholder": "开始日期",
|
|
326
|
-
"end-placeholder": "结束日期",
|
|
327
|
-
type: "daterange"
|
|
328
|
-
}
|
|
397
|
+
formLoading: this.loading || !1
|
|
329
398
|
};
|
|
330
399
|
},
|
|
331
400
|
setup(e) {
|
|
332
|
-
const { size: n, noUrlParameters: t, getList:
|
|
333
|
-
...t ? {} :
|
|
401
|
+
const { size: n, noUrlParameters: t, getList: r } = e, a = oe(), i = v({
|
|
402
|
+
...t ? {} : a == null ? void 0 : a.query
|
|
334
403
|
});
|
|
335
|
-
return
|
|
404
|
+
return q(
|
|
336
405
|
/* 注入名 */
|
|
337
406
|
"queryParams",
|
|
338
407
|
/* 值 */
|
|
339
|
-
|
|
340
|
-
),
|
|
408
|
+
i
|
|
409
|
+
), q(
|
|
341
410
|
/* 注入名 */
|
|
342
411
|
"size",
|
|
343
412
|
/* 值 */
|
|
344
413
|
n
|
|
345
|
-
),
|
|
414
|
+
), q(
|
|
346
415
|
/* 注入名 */
|
|
347
416
|
"getList",
|
|
348
417
|
/* 值 */
|
|
349
|
-
|
|
418
|
+
r
|
|
350
419
|
), {
|
|
351
|
-
queryParams:
|
|
420
|
+
queryParams: i
|
|
352
421
|
};
|
|
353
422
|
},
|
|
354
423
|
watch: {
|
|
@@ -375,7 +444,7 @@ const ge = /* @__PURE__ */ V(ye, [["render", he]]), ve = /* @__PURE__ */ v({
|
|
|
375
444
|
return {
|
|
376
445
|
// 显式提供一个计算属性
|
|
377
446
|
[T]: {
|
|
378
|
-
formLoading:
|
|
447
|
+
formLoading: R(() => this.formLoading),
|
|
379
448
|
updateFormLoading: (e) => {
|
|
380
449
|
this.formLoading = e;
|
|
381
450
|
}
|
|
@@ -410,115 +479,97 @@ const ge = /* @__PURE__ */ V(ye, [["render", he]]), ve = /* @__PURE__ */ v({
|
|
|
410
479
|
}
|
|
411
480
|
}
|
|
412
481
|
});
|
|
413
|
-
function
|
|
414
|
-
const
|
|
415
|
-
return
|
|
482
|
+
function Pe(e, n, t, r, a, i) {
|
|
483
|
+
const l = c("Input"), u = c("Radio"), m = c("Select"), f = c("Divider"), S = c("Cascader"), K = c("DatePicker"), O = c("InputNumber"), M = c("InputMobileVerification"), j = c("InputGraphicVerification"), w = c("el-form-item"), B = c("el-button"), W = c("el-form"), H = G("loading");
|
|
484
|
+
return I((o(), s(W, b({
|
|
416
485
|
model: e.queryParams,
|
|
417
486
|
ref: "queryFormRef",
|
|
418
487
|
inline: "",
|
|
419
488
|
"label-position": "left",
|
|
420
489
|
"label-width": e.labelWidth
|
|
421
490
|
}, e.$attrs), {
|
|
422
|
-
default:
|
|
423
|
-
(
|
|
424
|
-
label:
|
|
425
|
-
prop:
|
|
426
|
-
key:
|
|
427
|
-
rules:
|
|
491
|
+
default: g(() => [
|
|
492
|
+
(o(!0), V(C, null, k(e.formItem, (p) => (o(), s(w, {
|
|
493
|
+
label: p.label,
|
|
494
|
+
prop: p.prop,
|
|
495
|
+
key: p.prop,
|
|
496
|
+
rules: p.rules
|
|
428
497
|
}, {
|
|
429
|
-
default:
|
|
430
|
-
|
|
498
|
+
default: g(() => [
|
|
499
|
+
p.type === "input" ? (o(), s(l, {
|
|
431
500
|
key: 0,
|
|
432
|
-
item:
|
|
433
|
-
}, null, 8, ["item"])) :
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}, null, 8, ["item"])) :
|
|
438
|
-
|
|
501
|
+
item: p
|
|
502
|
+
}, null, 8, ["item"])) : y("", !0),
|
|
503
|
+
p.type === "radio" ? (o(), s(u, {
|
|
504
|
+
key: 1,
|
|
505
|
+
item: p
|
|
506
|
+
}, null, 8, ["item"])) : y("", !0),
|
|
507
|
+
p.type === "select" ? (o(), s(m, {
|
|
439
508
|
key: 2,
|
|
440
|
-
item:
|
|
441
|
-
}, null, 8, ["item"])) :
|
|
442
|
-
|
|
509
|
+
item: p
|
|
510
|
+
}, null, 8, ["item"])) : y("", !0),
|
|
511
|
+
p.type === "divider" ? (o(), s(f, {
|
|
443
512
|
key: 3,
|
|
444
|
-
item:
|
|
445
|
-
}, null, 8, ["item"])) :
|
|
446
|
-
|
|
513
|
+
item: p
|
|
514
|
+
}, null, 8, ["item"])) : y("", !0),
|
|
515
|
+
p.type === "cascader" ? (o(), s(S, {
|
|
447
516
|
key: 4,
|
|
448
|
-
item:
|
|
449
|
-
}, null, 8, ["item"])) :
|
|
450
|
-
|
|
517
|
+
item: p
|
|
518
|
+
}, null, 8, ["item"])) : y("", !0),
|
|
519
|
+
p.type === "date-picker" ? (o(), s(K, {
|
|
451
520
|
key: 5,
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
size: e.size
|
|
456
|
-
}, o.selectSetting || e.selectSetting), {
|
|
457
|
-
default: f(() => [
|
|
458
|
-
(r(!0), $(C, null, P(o.option || [], (y) => (r(), a(K, {
|
|
459
|
-
key: y.value,
|
|
460
|
-
label: y.label,
|
|
461
|
-
value: y.value
|
|
462
|
-
}, null, 8, ["label", "value"]))), 128))
|
|
463
|
-
]),
|
|
464
|
-
_: 2
|
|
465
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "size"])) : m("", !0),
|
|
466
|
-
o.type === "cascader" ? (r(), a(M, h({
|
|
521
|
+
item: p
|
|
522
|
+
}, null, 8, ["item"])) : y("", !0),
|
|
523
|
+
p.type === "input-number" ? (o(), s(O, {
|
|
467
524
|
key: 6,
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
size: e.size,
|
|
472
|
-
options: o.options || []
|
|
473
|
-
}, o.selectSetting || e.selectSetting), null, 16, ["modelValue", "onUpdate:modelValue", "size", "options"])) : m("", !0),
|
|
474
|
-
o.type === "date-picker" ? (r(), a(j, h({
|
|
525
|
+
item: p
|
|
526
|
+
}, null, 8, ["item"])) : y("", !0),
|
|
527
|
+
p.type === "input-mobile-verification" ? (o(), s(M, {
|
|
475
528
|
key: 7,
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
item: o
|
|
483
|
-
}, null, 8, ["item"])) : m("", !0)
|
|
529
|
+
item: p
|
|
530
|
+
}, null, 8, ["item"])) : y("", !0),
|
|
531
|
+
p.type === "input-graphic-verification" ? (o(), s(j, {
|
|
532
|
+
item: p,
|
|
533
|
+
key: p.key
|
|
534
|
+
}, null, 8, ["item"])) : y("", !0)
|
|
484
535
|
]),
|
|
485
536
|
_: 2
|
|
486
537
|
}, 1032, ["label", "prop", "rules"]))), 128)),
|
|
487
|
-
|
|
488
|
-
e.formOnly ?
|
|
489
|
-
default:
|
|
490
|
-
|
|
538
|
+
D(e.$slots, "default"),
|
|
539
|
+
e.formOnly ? y("", !0) : (o(), s(w, { key: 0 }, {
|
|
540
|
+
default: g(() => [
|
|
541
|
+
I((o(), s(B, {
|
|
491
542
|
type: "primary",
|
|
492
543
|
size: e.size,
|
|
493
544
|
onClick: e.handleQuery
|
|
494
545
|
}, {
|
|
495
|
-
default:
|
|
496
|
-
|
|
546
|
+
default: g(() => [
|
|
547
|
+
$("查询")
|
|
497
548
|
]),
|
|
498
549
|
_: 1
|
|
499
550
|
}, 8, ["size", "onClick"])), [
|
|
500
|
-
[
|
|
551
|
+
[H, e.formLoading]
|
|
501
552
|
]),
|
|
502
|
-
|
|
553
|
+
N(B, {
|
|
503
554
|
size: e.size,
|
|
504
555
|
onClick: e.resetQuery
|
|
505
556
|
}, {
|
|
506
|
-
default:
|
|
507
|
-
|
|
557
|
+
default: g(() => [
|
|
558
|
+
$("重置")
|
|
508
559
|
]),
|
|
509
560
|
_: 1
|
|
510
561
|
}, 8, ["size", "onClick"])
|
|
511
562
|
]),
|
|
512
563
|
_: 1
|
|
513
564
|
})),
|
|
514
|
-
|
|
565
|
+
D(e.$slots, "behind-the-button")
|
|
515
566
|
]),
|
|
516
567
|
_: 3
|
|
517
568
|
}, 16, ["model", "label-width"])), [
|
|
518
|
-
[
|
|
569
|
+
[ne, e.showSearch]
|
|
519
570
|
]);
|
|
520
571
|
}
|
|
521
|
-
const
|
|
572
|
+
const $e = /* @__PURE__ */ P(ke, [["render", Pe]]), Ie = $e;
|
|
522
573
|
export {
|
|
523
|
-
|
|
574
|
+
Ie as VGeneralBasicForm
|
|
524
575
|
};
|
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,V){"use strict";const k={placeholder:"请输入",style:"width: 200px",clearable:!0},b=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:{...k,...this.item.inputSetting}}},methods:{currentInputComponent(){return"input-archive"}}}),y=(t,n)=>{const o=t.__vccOpts||t;for(const[a,l]of n)o[a]=l;return o};function P(t,n,o,a,l,c){const s=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(s,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=y(b,[["render",P]]),S=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),a=e.inject("size"),l=e.ref({...k,...n.inputSetting});return(c,s)=>{const i=e.resolveComponent("el-input-number");return e.openBlock(),e.createBlock(i,e.mergeProps({modelValue:e.unref(o)[c.item.prop],"onUpdate:modelValue":s[0]||(s[0]=p=>e.unref(o)[c.item.prop]=p),size:e.unref(a)},l.value),null,16,["modelValue","size"])}}}),g=Symbol(),z={class:"input-graphic-verification"},q=["src"],$=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,{graphicSrc:o="",getGraphic:a=()=>{}}=n,{formLoading:l,updateFormLoading:c}=e.inject(g),s=async()=>{a&&!l.value&&await a()};return(i,p)=>{const u=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",z,[e.createVNode(h,{item:i.item,class:"input"},null,8,["item"]),e.createElementVNode("img",{class:"graphic",onClick:s,src:e.unref(o)},null,8,q)])),[[u,e.unref(l)]])}}}),J="",w=y($,[["__scopeId","data-v-500ec9b0"]]),_="获取验证码",I=60,L=e.defineComponent({__name:"verification-button",props:{getSmscode:{type:Function}},setup(t){const{getSmscode:n}=t,o=e.ref(_),a=e.ref(null),l=e.computed(()=>o.value===_),c=()=>{a&&(clearInterval(a.value),a.value=null,o.value=_)},s=async()=>{if(o.value===_)if(o.value=I,a.value=setInterval(()=>{if(Number(o.value)<=0||!o.value){c();return}else o.value=Number(o.value)-1},1e3),n)await n()===!1&&c();else return};return e.onBeforeUnmount(()=>{c()}),(i,p)=>{const u=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(u,{class:"verifiaction-button",style:e.normalizeStyle({color:l.value?"var(--color-primary, #409EFF)":"var(--text-color-placeholder, #A8ABB2)",cursor:l.value?"pointer":"default"}),onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value?_:o.value+"s"),1)]),_:1},8,["style"])}}}),X="",N=y(L,[["__scopeId","data-v-4074e137"]]),F=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=n;return o.template={append:()=>e.h(N,{getSmscode:o.getSmscode})},(a,l)=>(e.openBlock(),e.createBlock(h,{item:e.unref(o),class:"input"},null,8,["item"]))}}),D=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 U(t,n,o,a,l,c){const s=e.resolveComponent("el-divider");return e.openBlock(),e.createBlock(s,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 j=y(D,[["render",U]]),E=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),a=e.inject("size"),l=e.ref({...n.radioSetting}),c=e.ref({...n.radioGroupSetting});return(s,i)=>{const p=e.resolveComponent("el-radio"),u=e.resolveComponent("el-radio-group");return e.openBlock(),e.createBlock(u,e.mergeProps({modelValue:e.unref(o)[s.item.prop],"onUpdate:modelValue":i[0]||(i[0]=f=>e.unref(o)[s.item.prop]=f),size:e.unref(a)},c.value),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.item.option||[],f=>(e.openBlock(),e.createBlock(p,e.mergeProps({size:e.unref(a),label:f.label,key:f.label},l.value),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value),1)]),_:2},1040,["size","label"]))),128))]),_:1},16,["modelValue","size"])}}}),G=e.defineComponent({name:"GeneralBasicForm",components:{Input:h,InputNumber:S,InputGraphicVerification:w,InputMobileVerification:F,Divider:j,Radio:E},props:{showSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},formOnly:{type:Boolean,default:!1},getList:{type:Function,default:()=>{}},afterReset:{type:Function,default:()=>{}},formItem:{type:Array,default:[]},size:{type:String,default:"default"},labelWidth:{type:String,default:"90px"},noUrlParameters:{type:Boolean,default:()=>!1},formData:{type:Object,default:()=>{}}},data(){return{formLoading:this.loading||!1,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:a}=t,l=V.useRoute(),c=e.ref({...o?{}:l==null?void 0:l.query});return e.provide("queryParams",c),e.provide("size",n),e.provide("getList",a),{queryParams:c}},watch:{formData:{handler(t){this.queryParams={...this.noUrlParameters?{}:this.queryParams,...t}},immediate:!0},loading(t){this.formLoading!==t&&(this.formLoading=t)},formLoading(t){this.loading!==t&&this.$emit("update:loading",t)}},provide(){return{[g]:{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,a,l,c){const s=e.resolveComponent("Input"),i=e.resolveComponent("InputGraphicVerification"),p=e.resolveComponent("InputMobileVerification"),u=e.resolveComponent("Divider"),f=e.resolveComponent("Radio"),A=e.resolveComponent("el-option"),O=e.resolveComponent("el-select"),Q=e.resolveComponent("el-cascader"),K=e.resolveComponent("el-date-picker"),M=e.resolveComponent("InputNumber"),B=e.resolveComponent("el-form-item"),C=e.resolveComponent("el-button"),W=e.resolveComponent("el-form"),H=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,r=>(e.openBlock(),e.createBlock(B,{label:r.label,prop:r.prop,key:r.prop,rules:r.rules},{default:e.withCtx(()=>[r.type==="input"?(e.openBlock(),e.createBlock(s,{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(u,{key:3,item:r},null,8,["item"])):e.createCommentVNode("",!0),r.type==="radio"?(e.openBlock(),e.createBlock(f,{key:4,item:r},null,8,["item"])):e.createCommentVNode("",!0),r.type==="select"?(e.openBlock(),e.createBlock(O,e.mergeProps({key:5,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(A,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","size"])):e.createCommentVNode("",!0),r.type==="cascader"?(e.openBlock(),e.createBlock(Q,e.mergeProps({key:6,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"])):e.createCommentVNode("",!0),r.type==="date-picker"?(e.openBlock(),e.createBlock(K,e.mergeProps({key:7,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(M,{key:8,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(B,{key:0},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(C,{type:"primary",size:t.size,onClick:t.handleQuery},{default:e.withCtx(()=>[e.createTextVNode("查询")]),_:1},8,["size","onClick"])),[[H,t.formLoading]]),e.createVNode(C,{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 R=y(G,[["render",T]]);d.VGeneralBasicForm=R,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
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,b){"use strict";const k={placeholder:"请输入",style:"width: 200px",clearable:!0},V={style:"width: 227px","start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange"},h={placeholder:"请选择",filterable:!0,clearable:!0,style:"width: 200px"},P=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:{...k,...this.item.inputSetting}}},methods:{currentInputComponent(){return"input-archive"}}}),u=(t,n)=>{const o=t.__vccOpts||t;for(const[r,i]of n)o[r]=i;return o};function S(t,n,o,r,i,a){const l=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(l,e.mergeProps({onKeydown:e.withKeys(t.getList,["enter"]),modelValue:t.queryParams[t.item.prop],"onUpdate:modelValue":n[0]||(n[0]=s=>t.queryParams[t.item.prop]=s),size:t.size},t.inputSetting),e.createSlots({_:2},[e.renderList(t.item.template,(s,p)=>({name:p,fn:e.withCtx(()=>[s?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.currentInputComponent()),{key:p,templateEle:s},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040,["onKeydown","modelValue","size"])}const y=u(P,[["render",S]]),z=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),r=e.inject("size"),i=e.ref({...k,...n.inputSetting});return(a,l)=>{const s=e.resolveComponent("el-input-number");return e.openBlock(),e.createBlock(s,e.mergeProps({modelValue:e.unref(o)[a.item.prop],"onUpdate:modelValue":l[0]||(l[0]=p=>e.unref(o)[a.item.prop]=p),size:e.unref(r)},i.value),null,16,["modelValue","size"])}}}),g=Symbol(),$={class:"input-graphic-verification"},q=["src"],w=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,{graphicSrc:o="",getGraphic:r=()=>{}}=n,{formLoading:i,updateFormLoading:a}=e.inject(g),l=async()=>{r&&!i.value&&await r()};return(s,p)=>{const m=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",$,[e.createVNode(y,{item:s.item,class:"input"},null,8,["item"]),e.createElementVNode("img",{class:"graphic",onClick:l,src:e.unref(o)},null,8,q)])),[[m,e.unref(i)]])}}}),Y="",I=u(w,[["__scopeId","data-v-500ec9b0"]]),_="获取验证码",L=60,N=e.defineComponent({__name:"verification-button",props:{getSmscode:{type:Function}},setup(t){const{getSmscode:n}=t,o=e.ref(_),r=e.ref(null),i=e.computed(()=>o.value===_),a=()=>{r&&(clearInterval(r.value),r.value=null,o.value=_)},l=async()=>{if(o.value===_)if(o.value=L,r.value=setInterval(()=>{if(Number(o.value)<=0||!o.value){a();return}else o.value=Number(o.value)-1},1e3),n)await n()===!1&&a();else return};return e.onBeforeUnmount(()=>{a()}),(s,p)=>{const m=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(m,{class:"verifiaction-button",style:e.normalizeStyle({color:i.value?"var(--color-primary, #409EFF)":"var(--text-color-placeholder, #A8ABB2)",cursor:i.value?"pointer":"default"}),onClick:l},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value?_:o.value+"s"),1)]),_:1},8,["style"])}}}),Z="",D=u(N,[["__scopeId","data-v-4074e137"]]),F=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=n;return o.template={append:()=>e.h(D,{getSmscode:o.getSmscode})},(r,i)=>(e.openBlock(),e.createBlock(y,{item:e.unref(o),class:"input"},null,8,["item"]))}}),j=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 U(t,n,o,r,i,a){const l=e.resolveComponent("el-divider");return e.openBlock(),e.createBlock(l,e.normalizeProps(e.guardReactiveProps(t.dividerSetting)),e.createSlots({_:2},[e.renderList(t.item.template,(s,p)=>({name:p,fn:e.withCtx(()=>[s?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.currentInputComponent()),{key:p,templateEle:s},null,8,["templateEle"])):e.createCommentVNode("",!0)])}))]),1040)}const E=u(j,[["render",U]]),G=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),r=e.inject("size"),i=e.ref({...n.radioSetting}),a=e.ref({...n.radioGroupSetting});return(l,s)=>{const p=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":s[0]||(s[0]=f=>e.unref(o)[l.item.prop]=f),size:e.unref(r)},a.value),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.option||[],f=>(e.openBlock(),e.createBlock(p,e.mergeProps({size:e.unref(r),label:f.label,key:f.label},i.value),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value),1)]),_:2},1040,["size","label"]))),128))]),_:1},16,["modelValue","size"])}}}),T=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),r=e.inject("size"),i=e.ref({...V,...n.datePackerSetting});return(a,l)=>{const s=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(s,e.mergeProps({modelValue:e.unref(o)[a.item.prop],"onUpdate:modelValue":l[0]||(l[0]=p=>e.unref(o)[a.item.prop]=p),size:e.unref(r)},i.value),null,16,["modelValue","size"])}}}),R=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),r=e.inject("size"),i=e.ref({...h,...n.selectSetting});return(a,l)=>{const s=e.resolveComponent("el-option"),p=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(p,e.mergeProps({modelValue:e.unref(o)[a.item.prop],"onUpdate:modelValue":l[0]||(l[0]=m=>e.unref(o)[a.item.prop]=m),size:e.unref(r)},i.value),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.item.option||[],m=>(e.openBlock(),e.createBlock(s,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","size"])}}}),x=e.defineComponent({__name:"index",props:{item:{}},setup(t){const{item:n}=t,o=e.inject("queryParams",{}),r=e.inject("size"),i=e.ref({...h,...n.selectSetting});return(a,l)=>{const s=e.resolveComponent("el-cascader");return e.openBlock(),e.createBlock(s,e.mergeProps({modelValue:e.unref(o)[a.item.prop],"onUpdate:modelValue":l[0]||(l[0]=p=>e.unref(o)[a.item.prop]=p),size:e.unref(r),options:a.item.options||[]},i.value),null,16,["modelValue","size","options"])}}}),A=e.defineComponent({name:"GeneralBasicForm",components:{Input:y,InputNumber:z,InputGraphicVerification:I,InputMobileVerification:F,Divider:E,Radio:G,DatePicker:T,Select:R,Cascader:x},props:{showSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},formOnly:{type:Boolean,default:!1},getList:{type:Function,default:()=>{}},afterReset:{type:Function,default:()=>{}},formItem:{type:Array,default:[]},size:{type:String,default:"default"},labelWidth:{type:String,default:"90px"},noUrlParameters:{type:Boolean,default:()=>!1},formData:{type:Object,default:()=>{}}},data(){return{formLoading:this.loading||!1}},setup(t){const{size:n,noUrlParameters:o,getList:r}=t,i=b.useRoute(),a=e.ref({...o?{}:i==null?void 0:i.query});return e.provide("queryParams",a),e.provide("size",n),e.provide("getList",r),{queryParams:a}},watch:{formData:{handler(t){this.queryParams={...this.noUrlParameters?{}:this.queryParams,...t}},immediate:!0},loading(t){this.formLoading!==t&&(this.formLoading=t)},formLoading(t){this.loading!==t&&this.$emit("update:loading",t)}},provide(){return{[g]:{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 O(t,n,o,r,i,a){const l=e.resolveComponent("Input"),s=e.resolveComponent("Radio"),p=e.resolveComponent("Select"),m=e.resolveComponent("Divider"),f=e.resolveComponent("Cascader"),K=e.resolveComponent("DatePicker"),M=e.resolveComponent("InputNumber"),W=e.resolveComponent("InputMobileVerification"),H=e.resolveComponent("InputGraphicVerification"),B=e.resolveComponent("el-form-item"),C=e.resolveComponent("el-button"),J=e.resolveComponent("el-form"),X=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(J,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(B,{label:c.label,prop:c.prop,key:c.prop,rules:c.rules},{default:e.withCtx(()=>[c.type==="input"?(e.openBlock(),e.createBlock(l,{key:0,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="radio"?(e.openBlock(),e.createBlock(s,{key:1,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="select"?(e.openBlock(),e.createBlock(p,{key:2,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="divider"?(e.openBlock(),e.createBlock(m,{key:3,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="cascader"?(e.openBlock(),e.createBlock(f,{key:4,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="date-picker"?(e.openBlock(),e.createBlock(K,{key:5,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="input-number"?(e.openBlock(),e.createBlock(M,{key:6,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="input-mobile-verification"?(e.openBlock(),e.createBlock(W,{key:7,item:c},null,8,["item"])):e.createCommentVNode("",!0),c.type==="input-graphic-verification"?(e.openBlock(),e.createBlock(H,{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(B,{key:0},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(C,{type:"primary",size:t.size,onClick:t.handleQuery},{default:e.withCtx(()=>[e.createTextVNode("查询")]),_:1},8,["size","onClick"])),[[X,t.formLoading]]),e.createVNode(C,{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 Q=u(A,[["render",O]]);d.VGeneralBasicForm=Q,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|