easy-ep-ui 0.1.0
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 +86 -0
- package/dist/easy-ep-ui.js +1 -0
- package/dist/style.css +1 -0
- package/es/components/ee-dict-select/index.d.ts +2 -0
- package/es/components/ee-dict-select/src/index.vue.d.ts +25 -0
- package/es/components/ee-form-dialog/index.d.ts +2 -0
- package/es/components/ee-form-dialog/src/index.vue.d.ts +126 -0
- package/es/components/ee-form-table/index.d.ts +2 -0
- package/es/components/ee-form-table/src/index.vue.d.ts +1323 -0
- package/es/components/ee-search-bar/index.d.ts +2 -0
- package/es/components/ee-search-bar/src/index.vue.d.ts +124 -0
- package/es/components/ee-status-tag/index.d.ts +2 -0
- package/es/components/ee-status-tag/src/index.vue.d.ts +13 -0
- package/es/index.d.ts +13 -0
- package/es/index.mjs +544 -0
- package/es/style.css +1 -0
- package/es/utils/types.d.ts +48 -0
- package/lib/components/ee-dict-select/index.d.ts +2 -0
- package/lib/components/ee-dict-select/src/index.vue.d.ts +25 -0
- package/lib/components/ee-form-dialog/index.d.ts +2 -0
- package/lib/components/ee-form-dialog/src/index.vue.d.ts +126 -0
- package/lib/components/ee-form-table/index.d.ts +2 -0
- package/lib/components/ee-form-table/src/index.vue.d.ts +1323 -0
- package/lib/components/ee-search-bar/index.d.ts +2 -0
- package/lib/components/ee-search-bar/src/index.vue.d.ts +124 -0
- package/lib/components/ee-status-tag/index.d.ts +2 -0
- package/lib/components/ee-status-tag/src/index.vue.d.ts +13 -0
- package/lib/index.cjs +1 -0
- package/lib/index.d.ts +13 -0
- package/lib/style.css +1 -0
- package/lib/utils/types.d.ts +48 -0
- package/package.json +62 -0
package/es/index.mjs
ADDED
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
import { defineComponent as F, ref as U, computed as $, onMounted as K, watch as Q, openBlock as t, createBlock as s, unref as o, mergeProps as S, withCtx as i, createElementBlock as h, Fragment as k, renderList as E, createTextVNode as w, toDisplayString as x, createVNode as g, resolveDynamicComponent as G, createCommentVNode as v, createElementVNode as A, renderSlot as I } from "vue";
|
|
2
|
+
import { ElSelect as N, ElOption as M, ElTag as X, ElForm as H, ElRow as J, ElCol as P, ElFormItem as W, ElInput as L, ElDatePicker as q, ElButton as D, ElDialog as Y, ElRadioGroup as Z, ElRadio as _, ElCheckboxGroup as ee, ElCheckbox as le, ElSwitch as ae, ElTable as te, ElTableColumn as O, ElPagination as oe } from "element-plus";
|
|
3
|
+
const B = /* @__PURE__ */ F({
|
|
4
|
+
name: "EeDictSelect",
|
|
5
|
+
__name: "index",
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: {},
|
|
8
|
+
options: {},
|
|
9
|
+
request: {},
|
|
10
|
+
valueField: { default: "value" },
|
|
11
|
+
labelField: { default: "label" }
|
|
12
|
+
},
|
|
13
|
+
emits: ["update:modelValue", "change", "clear", "focus", "blur"],
|
|
14
|
+
setup(e, { emit: y }) {
|
|
15
|
+
const r = e, p = y, b = U(!1), c = U([]), d = $(() => (r.options ?? c.value).map((m) => ({
|
|
16
|
+
value: String(m[r.valueField] ?? ""),
|
|
17
|
+
label: String(m[r.labelField] ?? ""),
|
|
18
|
+
disabled: m.disabled ?? !1
|
|
19
|
+
})));
|
|
20
|
+
async function a() {
|
|
21
|
+
if (!r.options && r.request) {
|
|
22
|
+
b.value = !0;
|
|
23
|
+
try {
|
|
24
|
+
c.value = await r.request();
|
|
25
|
+
} finally {
|
|
26
|
+
b.value = !1;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return K(a), Q(() => r.request, a), (f, m) => (t(), s(o(N), S(f.$attrs, {
|
|
31
|
+
"model-value": e.modelValue,
|
|
32
|
+
loading: b.value,
|
|
33
|
+
"onUpdate:modelValue": m[0] || (m[0] = (l) => p("update:modelValue", l)),
|
|
34
|
+
onChange: m[1] || (m[1] = (l) => p("change", l)),
|
|
35
|
+
onClear: m[2] || (m[2] = (l) => p("clear")),
|
|
36
|
+
onFocus: m[3] || (m[3] = (l) => p("focus", l)),
|
|
37
|
+
onBlur: m[4] || (m[4] = (l) => p("blur", l))
|
|
38
|
+
}), {
|
|
39
|
+
default: i(() => [
|
|
40
|
+
(t(!0), h(k, null, E(d.value, (l) => (t(), s(o(M), {
|
|
41
|
+
key: l.value,
|
|
42
|
+
label: l.label,
|
|
43
|
+
value: l.value,
|
|
44
|
+
disabled: l.disabled
|
|
45
|
+
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
46
|
+
]),
|
|
47
|
+
_: 1
|
|
48
|
+
}, 16, ["model-value", "loading"]));
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
B.install = (e) => {
|
|
52
|
+
e.component(B.name ?? "EeDictSelect", B);
|
|
53
|
+
};
|
|
54
|
+
const z = /* @__PURE__ */ F({
|
|
55
|
+
name: "EeStatusTag",
|
|
56
|
+
__name: "index",
|
|
57
|
+
props: {
|
|
58
|
+
value: {},
|
|
59
|
+
mapping: {},
|
|
60
|
+
fallbackLabel: {},
|
|
61
|
+
defaultType: { default: "info" },
|
|
62
|
+
defaultEffect: { default: "light" }
|
|
63
|
+
},
|
|
64
|
+
setup(e) {
|
|
65
|
+
const y = e, r = $(() => y.mapping.find((p) => p.value === y.value));
|
|
66
|
+
return (p, b) => {
|
|
67
|
+
var c, d;
|
|
68
|
+
return t(), s(o(X), S(p.$attrs, {
|
|
69
|
+
type: ((c = r.value) == null ? void 0 : c.type) ?? e.defaultType,
|
|
70
|
+
effect: ((d = r.value) == null ? void 0 : d.effect) ?? e.defaultEffect
|
|
71
|
+
}), {
|
|
72
|
+
default: i(() => {
|
|
73
|
+
var a;
|
|
74
|
+
return [
|
|
75
|
+
w(x(((a = r.value) == null ? void 0 : a.label) ?? e.fallbackLabel ?? e.value), 1)
|
|
76
|
+
];
|
|
77
|
+
}),
|
|
78
|
+
_: 1
|
|
79
|
+
}, 16, ["type", "effect"]);
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
z.install = (e) => {
|
|
84
|
+
e.component(z.name ?? "EeStatusTag", z);
|
|
85
|
+
};
|
|
86
|
+
const ne = { class: "ee-search-bar" }, ue = /* @__PURE__ */ F({
|
|
87
|
+
name: "EeSearchBar",
|
|
88
|
+
__name: "index",
|
|
89
|
+
props: {
|
|
90
|
+
modelValue: {},
|
|
91
|
+
fields: {},
|
|
92
|
+
inline: { type: Boolean, default: !0 },
|
|
93
|
+
labelWidth: { default: "auto" },
|
|
94
|
+
collapsible: { type: Boolean, default: !1 },
|
|
95
|
+
collapsedCount: { default: 3 }
|
|
96
|
+
},
|
|
97
|
+
emits: ["update:modelValue", "search", "reset"],
|
|
98
|
+
setup(e, { emit: y }) {
|
|
99
|
+
const r = e, p = y, b = U(), c = U(!1), d = $(() => {
|
|
100
|
+
const n = 24 - a.value.reduce((u, V) => u + (V.span ?? 6), 0) % 24;
|
|
101
|
+
return n === 24 ? 6 : n;
|
|
102
|
+
}), a = $(() => !r.collapsible || c.value ? r.fields : r.fields.slice(0, r.collapsedCount));
|
|
103
|
+
function f() {
|
|
104
|
+
p("search", { ...r.modelValue });
|
|
105
|
+
}
|
|
106
|
+
function m() {
|
|
107
|
+
const l = {};
|
|
108
|
+
r.fields.forEach((n) => {
|
|
109
|
+
l[n.prop] = "";
|
|
110
|
+
}), p("update:modelValue", l), p("reset");
|
|
111
|
+
}
|
|
112
|
+
return (l, n) => (t(), h("div", ne, [
|
|
113
|
+
g(o(H), S({
|
|
114
|
+
ref_key: "formRef",
|
|
115
|
+
ref: b,
|
|
116
|
+
model: e.modelValue,
|
|
117
|
+
inline: e.inline,
|
|
118
|
+
"label-width": e.labelWidth
|
|
119
|
+
}, l.$attrs), {
|
|
120
|
+
default: i(() => [
|
|
121
|
+
g(o(J), null, {
|
|
122
|
+
default: i(() => [
|
|
123
|
+
(t(!0), h(k, null, E(a.value, (u) => (t(), s(o(P), {
|
|
124
|
+
key: u.prop,
|
|
125
|
+
span: u.span ?? 6
|
|
126
|
+
}, {
|
|
127
|
+
default: i(() => [
|
|
128
|
+
g(o(W), {
|
|
129
|
+
label: u.label,
|
|
130
|
+
prop: u.prop
|
|
131
|
+
}, {
|
|
132
|
+
default: i(() => [
|
|
133
|
+
(u.type ?? "input") === "input" ? (t(), s(o(L), {
|
|
134
|
+
key: 0,
|
|
135
|
+
modelValue: e.modelValue[u.prop],
|
|
136
|
+
"onUpdate:modelValue": (V) => e.modelValue[u.prop] = V,
|
|
137
|
+
placeholder: u.placeholder ?? `请输入${u.label}`,
|
|
138
|
+
clearable: ""
|
|
139
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : u.type === "select" ? (t(), s(o(N), {
|
|
140
|
+
key: 1,
|
|
141
|
+
modelValue: e.modelValue[u.prop],
|
|
142
|
+
"onUpdate:modelValue": (V) => e.modelValue[u.prop] = V,
|
|
143
|
+
placeholder: u.placeholder ?? `请选择${u.label}`,
|
|
144
|
+
clearable: ""
|
|
145
|
+
}, {
|
|
146
|
+
default: i(() => [
|
|
147
|
+
(t(!0), h(k, null, E(u.options ?? [], (V) => (t(), s(o(M), {
|
|
148
|
+
key: V.value,
|
|
149
|
+
label: V.label,
|
|
150
|
+
value: V.value
|
|
151
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
152
|
+
]),
|
|
153
|
+
_: 2
|
|
154
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])) : u.type === "date" ? (t(), s(o(q), {
|
|
155
|
+
key: 2,
|
|
156
|
+
modelValue: e.modelValue[u.prop],
|
|
157
|
+
"onUpdate:modelValue": (V) => e.modelValue[u.prop] = V,
|
|
158
|
+
placeholder: u.placeholder ?? `请选择${u.label}`,
|
|
159
|
+
style: { width: "100%" }
|
|
160
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : u.type === "date-range" ? (t(), s(o(q), {
|
|
161
|
+
key: 3,
|
|
162
|
+
modelValue: e.modelValue[u.prop],
|
|
163
|
+
"onUpdate:modelValue": (V) => e.modelValue[u.prop] = V,
|
|
164
|
+
type: "daterange",
|
|
165
|
+
"range-separator": u.placeholder ?? "至",
|
|
166
|
+
"start-placeholder": u.placeholder ?? "开始日期",
|
|
167
|
+
"end-placeholder": u.placeholder ?? "结束日期",
|
|
168
|
+
style: { width: "100%" }
|
|
169
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "range-separator", "start-placeholder", "end-placeholder"])) : u.component ? (t(), s(G(u.component), {
|
|
170
|
+
key: 4,
|
|
171
|
+
modelValue: e.modelValue[u.prop],
|
|
172
|
+
"onUpdate:modelValue": (V) => e.modelValue[u.prop] = V
|
|
173
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : v("", !0)
|
|
174
|
+
]),
|
|
175
|
+
_: 2
|
|
176
|
+
}, 1032, ["label", "prop"])
|
|
177
|
+
]),
|
|
178
|
+
_: 2
|
|
179
|
+
}, 1032, ["span"]))), 128)),
|
|
180
|
+
g(o(P), { span: d.value }, {
|
|
181
|
+
default: i(() => [
|
|
182
|
+
g(o(W), null, {
|
|
183
|
+
default: i(() => [
|
|
184
|
+
g(o(D), {
|
|
185
|
+
type: "primary",
|
|
186
|
+
onClick: f
|
|
187
|
+
}, {
|
|
188
|
+
default: i(() => [...n[1] || (n[1] = [
|
|
189
|
+
w(" 搜索 ", -1)
|
|
190
|
+
])]),
|
|
191
|
+
_: 1
|
|
192
|
+
}),
|
|
193
|
+
g(o(D), { onClick: m }, {
|
|
194
|
+
default: i(() => [...n[2] || (n[2] = [
|
|
195
|
+
w(" 重置 ", -1)
|
|
196
|
+
])]),
|
|
197
|
+
_: 1
|
|
198
|
+
}),
|
|
199
|
+
e.collapsible && e.fields.length > e.collapsedCount ? (t(), s(o(D), {
|
|
200
|
+
key: 0,
|
|
201
|
+
text: "",
|
|
202
|
+
onClick: n[0] || (n[0] = (u) => c.value = !c.value)
|
|
203
|
+
}, {
|
|
204
|
+
default: i(() => [
|
|
205
|
+
w(x(c.value ? "收起" : "展开"), 1)
|
|
206
|
+
]),
|
|
207
|
+
_: 1
|
|
208
|
+
})) : v("", !0)
|
|
209
|
+
]),
|
|
210
|
+
_: 1
|
|
211
|
+
})
|
|
212
|
+
]),
|
|
213
|
+
_: 1
|
|
214
|
+
}, 8, ["span"])
|
|
215
|
+
]),
|
|
216
|
+
_: 1
|
|
217
|
+
})
|
|
218
|
+
]),
|
|
219
|
+
_: 1
|
|
220
|
+
}, 16, ["model", "inline", "label-width"])
|
|
221
|
+
]));
|
|
222
|
+
}
|
|
223
|
+
}), j = (e, y) => {
|
|
224
|
+
const r = e.__vccOpts || e;
|
|
225
|
+
for (const [p, b] of y)
|
|
226
|
+
r[p] = b;
|
|
227
|
+
return r;
|
|
228
|
+
}, C = /* @__PURE__ */ j(ue, [["__scopeId", "data-v-64bb08e9"]]);
|
|
229
|
+
C.install = (e) => {
|
|
230
|
+
e.component(C.name ?? "EeSearchBar", C);
|
|
231
|
+
};
|
|
232
|
+
const re = { class: "ee-form-dialog-footer" }, de = /* @__PURE__ */ F({
|
|
233
|
+
name: "EeFormDialog",
|
|
234
|
+
__name: "index",
|
|
235
|
+
props: {
|
|
236
|
+
modelValue: { type: Boolean },
|
|
237
|
+
title: { default: "表单" },
|
|
238
|
+
formData: {},
|
|
239
|
+
fields: {},
|
|
240
|
+
rules: {},
|
|
241
|
+
width: { default: "600px" },
|
|
242
|
+
labelWidth: { default: "auto" },
|
|
243
|
+
loading: { type: Boolean, default: !1 }
|
|
244
|
+
},
|
|
245
|
+
emits: ["update:modelValue", "submit", "cancel"],
|
|
246
|
+
setup(e, { emit: y }) {
|
|
247
|
+
const r = e, p = y, b = U(), c = $(() => {
|
|
248
|
+
const f = {};
|
|
249
|
+
for (const m of Object.keys(r))
|
|
250
|
+
[
|
|
251
|
+
"modelValue",
|
|
252
|
+
"title",
|
|
253
|
+
"formData",
|
|
254
|
+
"fields",
|
|
255
|
+
"rules",
|
|
256
|
+
"width",
|
|
257
|
+
"labelWidth",
|
|
258
|
+
"loading"
|
|
259
|
+
].includes(m) || (f[m] = r[m]);
|
|
260
|
+
return f;
|
|
261
|
+
});
|
|
262
|
+
function d() {
|
|
263
|
+
p("update:modelValue", !1), p("cancel");
|
|
264
|
+
}
|
|
265
|
+
async function a() {
|
|
266
|
+
if (b.value)
|
|
267
|
+
try {
|
|
268
|
+
await b.value.validate(), p("submit", { ...r.formData });
|
|
269
|
+
} catch {
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return (f, m) => (t(), s(o(Y), S(f.$attrs, {
|
|
273
|
+
"model-value": e.modelValue,
|
|
274
|
+
title: e.title,
|
|
275
|
+
width: e.width,
|
|
276
|
+
"onUpdate:modelValue": m[0] || (m[0] = (l) => p("update:modelValue", l)),
|
|
277
|
+
onClose: d
|
|
278
|
+
}), {
|
|
279
|
+
footer: i(() => [
|
|
280
|
+
A("span", re, [
|
|
281
|
+
g(o(D), { onClick: d }, {
|
|
282
|
+
default: i(() => [...m[1] || (m[1] = [
|
|
283
|
+
w("取消", -1)
|
|
284
|
+
])]),
|
|
285
|
+
_: 1
|
|
286
|
+
}),
|
|
287
|
+
g(o(D), {
|
|
288
|
+
type: "primary",
|
|
289
|
+
loading: e.loading,
|
|
290
|
+
onClick: a
|
|
291
|
+
}, {
|
|
292
|
+
default: i(() => [...m[2] || (m[2] = [
|
|
293
|
+
w(" 确定 ", -1)
|
|
294
|
+
])]),
|
|
295
|
+
_: 1
|
|
296
|
+
}, 8, ["loading"])
|
|
297
|
+
])
|
|
298
|
+
]),
|
|
299
|
+
default: i(() => [
|
|
300
|
+
g(o(H), S({
|
|
301
|
+
ref_key: "formRef",
|
|
302
|
+
ref: b,
|
|
303
|
+
model: e.formData,
|
|
304
|
+
rules: e.rules,
|
|
305
|
+
"label-width": e.labelWidth
|
|
306
|
+
}, c.value), {
|
|
307
|
+
default: i(() => [
|
|
308
|
+
g(o(J), { gutter: 20 }, {
|
|
309
|
+
default: i(() => [
|
|
310
|
+
(t(!0), h(k, null, E(e.fields, (l) => (t(), s(o(P), {
|
|
311
|
+
key: l.prop,
|
|
312
|
+
span: l.span ?? 24
|
|
313
|
+
}, {
|
|
314
|
+
default: i(() => [
|
|
315
|
+
g(o(W), {
|
|
316
|
+
label: l.label,
|
|
317
|
+
prop: l.prop
|
|
318
|
+
}, {
|
|
319
|
+
default: i(() => [
|
|
320
|
+
(l.type ?? "input") === "input" ? (t(), s(o(L), {
|
|
321
|
+
key: 0,
|
|
322
|
+
modelValue: e.formData[l.prop],
|
|
323
|
+
"onUpdate:modelValue": (n) => e.formData[l.prop] = n,
|
|
324
|
+
placeholder: l.placeholder ?? `请输入${l.label}`
|
|
325
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : l.type === "textarea" ? (t(), s(o(L), {
|
|
326
|
+
key: 1,
|
|
327
|
+
modelValue: e.formData[l.prop],
|
|
328
|
+
"onUpdate:modelValue": (n) => e.formData[l.prop] = n,
|
|
329
|
+
type: "textarea",
|
|
330
|
+
placeholder: l.placeholder ?? `请输入${l.label}`,
|
|
331
|
+
rows: 3
|
|
332
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : l.type === "select" ? (t(), s(o(N), {
|
|
333
|
+
key: 2,
|
|
334
|
+
modelValue: e.formData[l.prop],
|
|
335
|
+
"onUpdate:modelValue": (n) => e.formData[l.prop] = n,
|
|
336
|
+
placeholder: l.placeholder ?? `请选择${l.label}`,
|
|
337
|
+
style: { width: "100%" }
|
|
338
|
+
}, {
|
|
339
|
+
default: i(() => [
|
|
340
|
+
(t(!0), h(k, null, E(l.options ?? [], (n) => (t(), s(o(M), {
|
|
341
|
+
key: n.value,
|
|
342
|
+
label: n.label,
|
|
343
|
+
value: n.value
|
|
344
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
345
|
+
]),
|
|
346
|
+
_: 2
|
|
347
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])) : l.type === "radio" ? (t(), s(o(Z), {
|
|
348
|
+
key: 3,
|
|
349
|
+
modelValue: e.formData[l.prop],
|
|
350
|
+
"onUpdate:modelValue": (n) => e.formData[l.prop] = n
|
|
351
|
+
}, {
|
|
352
|
+
default: i(() => [
|
|
353
|
+
(t(!0), h(k, null, E(l.options ?? [], (n) => (t(), s(o(_), {
|
|
354
|
+
key: n.value,
|
|
355
|
+
label: n.value
|
|
356
|
+
}, {
|
|
357
|
+
default: i(() => [
|
|
358
|
+
w(x(n.label), 1)
|
|
359
|
+
]),
|
|
360
|
+
_: 2
|
|
361
|
+
}, 1032, ["label"]))), 128))
|
|
362
|
+
]),
|
|
363
|
+
_: 2
|
|
364
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : l.type === "checkbox" ? (t(), s(o(ee), {
|
|
365
|
+
key: 4,
|
|
366
|
+
modelValue: e.formData[l.prop],
|
|
367
|
+
"onUpdate:modelValue": (n) => e.formData[l.prop] = n
|
|
368
|
+
}, {
|
|
369
|
+
default: i(() => [
|
|
370
|
+
(t(!0), h(k, null, E(l.options ?? [], (n) => (t(), s(o(le), {
|
|
371
|
+
key: n.value,
|
|
372
|
+
label: n.value
|
|
373
|
+
}, {
|
|
374
|
+
default: i(() => [
|
|
375
|
+
w(x(n.label), 1)
|
|
376
|
+
]),
|
|
377
|
+
_: 2
|
|
378
|
+
}, 1032, ["label"]))), 128))
|
|
379
|
+
]),
|
|
380
|
+
_: 2
|
|
381
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : l.type === "switch" ? (t(), s(o(ae), {
|
|
382
|
+
key: 5,
|
|
383
|
+
modelValue: e.formData[l.prop],
|
|
384
|
+
"onUpdate:modelValue": (n) => e.formData[l.prop] = n
|
|
385
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : l.type === "date" ? (t(), s(o(q), {
|
|
386
|
+
key: 6,
|
|
387
|
+
modelValue: e.formData[l.prop],
|
|
388
|
+
"onUpdate:modelValue": (n) => e.formData[l.prop] = n,
|
|
389
|
+
placeholder: l.placeholder ?? `请选择${l.label}`,
|
|
390
|
+
style: { width: "100%" }
|
|
391
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : l.component ? (t(), s(G(l.component), {
|
|
392
|
+
key: 7,
|
|
393
|
+
modelValue: e.formData[l.prop],
|
|
394
|
+
"onUpdate:modelValue": (n) => e.formData[l.prop] = n
|
|
395
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : v("", !0)
|
|
396
|
+
]),
|
|
397
|
+
_: 2
|
|
398
|
+
}, 1032, ["label", "prop"])
|
|
399
|
+
]),
|
|
400
|
+
_: 2
|
|
401
|
+
}, 1032, ["span"]))), 128))
|
|
402
|
+
]),
|
|
403
|
+
_: 1
|
|
404
|
+
})
|
|
405
|
+
]),
|
|
406
|
+
_: 1
|
|
407
|
+
}, 16, ["model", "rules", "label-width"])
|
|
408
|
+
]),
|
|
409
|
+
_: 1
|
|
410
|
+
}, 16, ["model-value", "title", "width"]));
|
|
411
|
+
}
|
|
412
|
+
}), T = /* @__PURE__ */ j(de, [["__scopeId", "data-v-0307e8cf"]]);
|
|
413
|
+
T.install = (e) => {
|
|
414
|
+
e.component(T.name ?? "EeFormDialog", T);
|
|
415
|
+
};
|
|
416
|
+
const se = { class: "ee-form-table" }, me = {
|
|
417
|
+
key: 1,
|
|
418
|
+
class: "ee-form-table-toolbar"
|
|
419
|
+
}, ie = {
|
|
420
|
+
key: 2,
|
|
421
|
+
class: "ee-form-table-pagination"
|
|
422
|
+
}, pe = /* @__PURE__ */ F({
|
|
423
|
+
name: "EeFormTable",
|
|
424
|
+
__name: "index",
|
|
425
|
+
props: {
|
|
426
|
+
data: {},
|
|
427
|
+
columns: {},
|
|
428
|
+
searchFields: {},
|
|
429
|
+
pagination: {},
|
|
430
|
+
loading: { type: Boolean, default: !1 },
|
|
431
|
+
showSelection: { type: Boolean, default: !1 },
|
|
432
|
+
showIndex: { type: Boolean, default: !1 },
|
|
433
|
+
showPagination: { type: Boolean, default: !0 },
|
|
434
|
+
pageSizes: { default: () => [10, 20, 50, 100] },
|
|
435
|
+
paginationLayout: { default: "total, sizes, prev, pager, next, jumper" },
|
|
436
|
+
collapsible: { type: Boolean, default: !1 },
|
|
437
|
+
collapsedCount: { default: 3 }
|
|
438
|
+
},
|
|
439
|
+
emits: ["search", "reset", "selection-change", "sort-change", "current-change", "size-change"],
|
|
440
|
+
setup(e, { emit: y }) {
|
|
441
|
+
const r = y, p = U(), b = U({});
|
|
442
|
+
return (c, d) => (t(), h("div", se, [
|
|
443
|
+
e.searchFields && e.searchFields.length ? (t(), s(o(C), {
|
|
444
|
+
key: 0,
|
|
445
|
+
modelValue: b.value,
|
|
446
|
+
"onUpdate:modelValue": d[0] || (d[0] = (a) => b.value = a),
|
|
447
|
+
fields: e.searchFields,
|
|
448
|
+
collapsible: e.collapsible,
|
|
449
|
+
"collapsed-count": e.collapsedCount,
|
|
450
|
+
onSearch: d[1] || (d[1] = (a) => r("search", a)),
|
|
451
|
+
onReset: d[2] || (d[2] = (a) => r("reset"))
|
|
452
|
+
}, null, 8, ["modelValue", "fields", "collapsible", "collapsed-count"])) : v("", !0),
|
|
453
|
+
c.$slots.toolbar ? (t(), h("div", me, [
|
|
454
|
+
I(c.$slots, "toolbar", {}, void 0, !0)
|
|
455
|
+
])) : v("", !0),
|
|
456
|
+
g(o(te), S({
|
|
457
|
+
ref_key: "tableRef",
|
|
458
|
+
ref: p
|
|
459
|
+
}, c.$attrs, {
|
|
460
|
+
data: e.data,
|
|
461
|
+
loading: e.loading,
|
|
462
|
+
onSelectionChange: d[3] || (d[3] = (a) => r("selection-change", a)),
|
|
463
|
+
onSortChange: d[4] || (d[4] = (a) => r("sort-change", a))
|
|
464
|
+
}), {
|
|
465
|
+
default: i(() => [
|
|
466
|
+
e.showSelection ? (t(), s(o(O), {
|
|
467
|
+
key: 0,
|
|
468
|
+
type: "selection",
|
|
469
|
+
width: "50",
|
|
470
|
+
fixed: "left"
|
|
471
|
+
})) : v("", !0),
|
|
472
|
+
e.showIndex ? (t(), s(o(O), {
|
|
473
|
+
key: 1,
|
|
474
|
+
type: "index",
|
|
475
|
+
label: "序号",
|
|
476
|
+
width: "60",
|
|
477
|
+
fixed: "left"
|
|
478
|
+
})) : v("", !0),
|
|
479
|
+
(t(!0), h(k, null, E(e.columns, (a) => (t(), s(o(O), {
|
|
480
|
+
key: a.prop,
|
|
481
|
+
prop: a.prop,
|
|
482
|
+
label: a.label,
|
|
483
|
+
width: a.width,
|
|
484
|
+
"min-width": a.minWidth,
|
|
485
|
+
fixed: a.fixed,
|
|
486
|
+
sortable: a.sortable,
|
|
487
|
+
align: a.align ?? "center"
|
|
488
|
+
}, {
|
|
489
|
+
default: i((f) => [
|
|
490
|
+
I(c.$slots, a.prop, {
|
|
491
|
+
row: f.row,
|
|
492
|
+
index: f.$index
|
|
493
|
+
}, () => [
|
|
494
|
+
A("span", null, x(a.formatter ? a.formatter(f.row, a, f.row[a.prop], f.$index) : f.row[a.prop]), 1)
|
|
495
|
+
], !0)
|
|
496
|
+
]),
|
|
497
|
+
_: 2
|
|
498
|
+
}, 1032, ["prop", "label", "width", "min-width", "fixed", "sortable", "align"]))), 128)),
|
|
499
|
+
I(c.$slots, "default", {}, void 0, !0)
|
|
500
|
+
]),
|
|
501
|
+
_: 3
|
|
502
|
+
}, 16, ["data", "loading"]),
|
|
503
|
+
e.showPagination ? (t(), h("div", ie, [
|
|
504
|
+
g(o(oe), {
|
|
505
|
+
"current-page": e.pagination.current,
|
|
506
|
+
"onUpdate:currentPage": d[5] || (d[5] = (a) => e.pagination.current = a),
|
|
507
|
+
"page-size": e.pagination.pageSize,
|
|
508
|
+
"onUpdate:pageSize": d[6] || (d[6] = (a) => e.pagination.pageSize = a),
|
|
509
|
+
total: e.pagination.total,
|
|
510
|
+
"page-sizes": e.pageSizes,
|
|
511
|
+
layout: e.paginationLayout,
|
|
512
|
+
background: "",
|
|
513
|
+
onCurrentChange: d[7] || (d[7] = (a) => r("current-change", a)),
|
|
514
|
+
onSizeChange: d[8] || (d[8] = (a) => r("size-change", a))
|
|
515
|
+
}, null, 8, ["current-page", "page-size", "total", "page-sizes", "layout"])
|
|
516
|
+
])) : v("", !0)
|
|
517
|
+
]));
|
|
518
|
+
}
|
|
519
|
+
}), R = /* @__PURE__ */ j(pe, [["__scopeId", "data-v-70d01eeb"]]);
|
|
520
|
+
R.install = (e) => {
|
|
521
|
+
e.component(R.name ?? "EeFormTable", R);
|
|
522
|
+
};
|
|
523
|
+
const ce = [
|
|
524
|
+
B,
|
|
525
|
+
z,
|
|
526
|
+
C,
|
|
527
|
+
T,
|
|
528
|
+
R
|
|
529
|
+
];
|
|
530
|
+
function fe(e) {
|
|
531
|
+
ce.forEach((y) => {
|
|
532
|
+
e.use(y);
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
const ye = { install: fe };
|
|
536
|
+
export {
|
|
537
|
+
B as EeDictSelect,
|
|
538
|
+
T as EeFormDialog,
|
|
539
|
+
R as EeFormTable,
|
|
540
|
+
C as EeSearchBar,
|
|
541
|
+
z as EeStatusTag,
|
|
542
|
+
ye as default,
|
|
543
|
+
fe as install
|
|
544
|
+
};
|
package/es/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ee-search-bar[data-v-64bb08e9]{margin-bottom:16px}.ee-search-bar .el-form-item[data-v-64bb08e9]{margin-bottom:0}.ee-form-dialog-footer[data-v-0307e8cf]{display:flex;justify-content:flex-end;gap:12px}.ee-form-table-toolbar[data-v-70d01eeb]{margin-bottom:16px;display:flex;align-items:center;gap:12px}.ee-form-table-pagination[data-v-70d01eeb]{margin-top:16px;display:flex;justify-content:flex-end}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
export interface DictOption {
|
|
3
|
+
value: string | number;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface SearchField {
|
|
9
|
+
prop: string;
|
|
10
|
+
label: string;
|
|
11
|
+
type?: 'input' | 'select' | 'date' | 'date-range' | 'cascader';
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
options?: DictOption[];
|
|
14
|
+
span?: number;
|
|
15
|
+
component?: VNode;
|
|
16
|
+
}
|
|
17
|
+
export interface TableColumn {
|
|
18
|
+
prop: string;
|
|
19
|
+
label: string;
|
|
20
|
+
width?: string | number;
|
|
21
|
+
minWidth?: string | number;
|
|
22
|
+
fixed?: 'left' | 'right';
|
|
23
|
+
sortable?: boolean;
|
|
24
|
+
align?: 'left' | 'center' | 'right';
|
|
25
|
+
formatter?: (row: Record<string, unknown>, column: TableColumn, cellValue: unknown, index: number) => VNode | string;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
export interface FormField {
|
|
29
|
+
prop: string;
|
|
30
|
+
label: string;
|
|
31
|
+
type?: 'input' | 'textarea' | 'select' | 'radio' | 'checkbox' | 'date' | 'switch';
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
rules?: Record<string, unknown>[];
|
|
34
|
+
options?: DictOption[];
|
|
35
|
+
span?: number;
|
|
36
|
+
component?: VNode;
|
|
37
|
+
}
|
|
38
|
+
export interface Pagination {
|
|
39
|
+
current: number;
|
|
40
|
+
pageSize: number;
|
|
41
|
+
total: number;
|
|
42
|
+
}
|
|
43
|
+
export interface StatusMapping {
|
|
44
|
+
value: string | number;
|
|
45
|
+
label: string;
|
|
46
|
+
type?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
47
|
+
effect?: 'dark' | 'light' | 'plain';
|
|
48
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DictOption } from '../../../utils/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
modelValue?: string | number | unknown[];
|
|
4
|
+
options?: DictOption[];
|
|
5
|
+
request?: () => Promise<DictOption[]>;
|
|
6
|
+
valueField?: string;
|
|
7
|
+
labelField?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
10
|
+
"update:modelValue": (val: string | number | unknown[]) => any;
|
|
11
|
+
change: (val: string | number | unknown[]) => any;
|
|
12
|
+
clear: () => any;
|
|
13
|
+
focus: (evt: FocusEvent) => any;
|
|
14
|
+
blur: (evt: FocusEvent) => any;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((val: string | number | unknown[]) => any) | undefined;
|
|
17
|
+
onChange?: ((val: string | number | unknown[]) => any) | undefined;
|
|
18
|
+
onClear?: (() => any) | undefined;
|
|
19
|
+
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
20
|
+
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
valueField: string;
|
|
23
|
+
labelField: string;
|
|
24
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
export default _default;
|