act-plus 1.1.56 → 1.1.57

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.
@@ -0,0 +1,106 @@
1
+ import { ref as R, inject as l, watch as j, resolveComponent as y, resolveDirective as q, openBlock as r, createElementBlock as u, Fragment as f, renderList as E, unref as d, createBlock as i, resolveDynamicComponent as H, withCtx as b, withDirectives as C, createCommentVNode as _, createTextVNode as k, toDisplayString as B } from "vue";
2
+ import { _ as M, u as z } from "./index-5fa8f416.js";
3
+ import "vue-router";
4
+ import "element-plus";
5
+ const G = { class: "header-operate-container" }, J = {
6
+ __name: "index",
7
+ props: {
8
+ data: { type: Object, default: () => ({}) }
9
+ },
10
+ emits: ["onOperate"],
11
+ setup(w, { emit: x }) {
12
+ const N = x, T = w, { t: D } = z();
13
+ let h = R([]);
14
+ const V = l("globalProps"), v = l("menuPermissionBtns"), F = l("stringToBoolean"), $ = l("matchCondition"), S = l("getTableData"), P = l("tableBtnRefs"), A = (s) => {
15
+ if (!s.matchFields.length)
16
+ return !0;
17
+ const t = s.matchFields.filter((o) => o.matchType != "default"), a = (o) => V.matchData[o.matchType][o.matchFieldName];
18
+ let c = t.reduce((o, n, m) => {
19
+ const L = a(n);
20
+ return o += $(
21
+ n.matchCondition,
22
+ L,
23
+ n.fieldValue == "" ? null : n.fieldValue == "true" || n.fieldValue == "false" ? F(n.fieldValue) : n.fieldValue
24
+ ), m !== t.length - 1 && (o += n.spliceCondition || "&&"), o;
25
+ }, "").split("||"), e = c.reduce((o, n, m) => (o += `(${n})`, m < c.length - 1 && (o += "||"), o), "");
26
+ return new Function(`return ${e}`)();
27
+ }, I = (s) => v.value.some((t) => t.unique == s.permissionCode) && A(s), O = (s) => {
28
+ h.value = (s || []).filter((t) => t.permissionCode !== 1001 && t.btnPostion.includes("header")).sort((t, a) => t.sort - a.sort).map((t) => (t.btnAlias && (t.btnName = t.btnAlias), t));
29
+ };
30
+ j(
31
+ () => T.data,
32
+ (s, t) => {
33
+ O(s.buttons);
34
+ },
35
+ { immediate: !0 }
36
+ );
37
+ const g = (s) => {
38
+ N("onOperate", s, {});
39
+ };
40
+ return (s, t) => {
41
+ const a = y("a-svg-icon"), p = y("el-button"), c = q("debounce");
42
+ return r(), u("div", G, [
43
+ (r(!0), u(f, null, E(d(h), (e, o) => (r(), u(f, { key: o }, [
44
+ I(e) ? (r(), u(f, { key: 0 }, [
45
+ e.isCustomBtn && e.customType == "component" ? (r(), i(H(e[e.customComponentName]), {
46
+ key: 0,
47
+ class: "custom-btn",
48
+ ref_for: !0,
49
+ ref: (n) => d(P)[`${e.customComponentName}-${e.permissionCode}`] = n,
50
+ buttonData: e,
51
+ onRefresh: t[0] || (t[0] = (n) => d(S)())
52
+ }, {
53
+ default: b(() => [
54
+ C((r(), i(p, {
55
+ class: "el-btn",
56
+ type: e.btnColor,
57
+ onClick: (n) => g(e)
58
+ }, {
59
+ default: b(() => [
60
+ e.btnIcon ? (r(), i(a, {
61
+ key: 0,
62
+ class: "mr4",
63
+ name: e.btnIcon,
64
+ width: "12",
65
+ height: "12",
66
+ color: "#fff"
67
+ }, null, 8, ["name"])) : _("", !0),
68
+ k(" " + B(e.btnName), 1)
69
+ ]),
70
+ _: 2
71
+ }, 1032, ["type", "onClick"])), [
72
+ [c]
73
+ ])
74
+ ]),
75
+ _: 2
76
+ }, 1064, ["buttonData"])) : C((r(), i(p, {
77
+ key: 1,
78
+ class: "el-btn",
79
+ type: e.btnColor,
80
+ loading: e.opeateLoading,
81
+ onClick: (n) => g(e)
82
+ }, {
83
+ default: b(() => [
84
+ e.btnIcon ? (r(), i(a, {
85
+ key: 0,
86
+ class: "mr4",
87
+ name: e.btnIcon,
88
+ width: "12",
89
+ height: "12",
90
+ color: "#fff"
91
+ }, null, 8, ["name"])) : _("", !0),
92
+ k(" " + B(e.opeateLoading ? e.btnName + d(D)("act.loading") + "..." : e.btnName), 1)
93
+ ]),
94
+ _: 2
95
+ }, 1032, ["type", "loading", "onClick"])), [
96
+ [c]
97
+ ])
98
+ ], 64)) : _("", !0)
99
+ ], 64))), 128))
100
+ ]);
101
+ };
102
+ }
103
+ }, X = /* @__PURE__ */ M(J, [["__scopeId", "data-v-6477fb97"]]);
104
+ export {
105
+ X as default
106
+ };
@@ -0,0 +1,65 @@
1
+ import { reactive as m, watch as b, resolveComponent as s, openBlock as v, createBlock as g, withCtx as o, createElementVNode as i, createVNode as x, createTextVNode as y, toDisplayString as h, unref as C } from "vue";
2
+ import { _ as k, u as w } from "./index-5fa8f416.js";
3
+ import "vue-router";
4
+ import "element-plus";
5
+ const V = ["innerHTML"], B = { class: "dialog-footer" }, D = {
6
+ __name: "index",
7
+ props: {
8
+ visible: { type: Boolean, default: !1 },
9
+ title: { type: String, default: "" },
10
+ data: { type: Object, default: () => ({}) }
11
+ },
12
+ emits: ["update:visible", "refresh"],
13
+ setup(l, { emit: c }) {
14
+ const { t: d } = w(), r = c, t = l;
15
+ let a = m((() => ({
16
+ loading: !1
17
+ }))());
18
+ b(
19
+ () => t.visible,
20
+ async (e, p) => {
21
+ e && (a.loading = !0, a.loading = !1);
22
+ }
23
+ );
24
+ const _ = (e) => {
25
+ n(), e();
26
+ }, n = () => {
27
+ r("update:visible", !1);
28
+ };
29
+ return (e, p) => {
30
+ const f = s("el-button"), u = s("el-dialog");
31
+ return v(), g(u, {
32
+ "model-value": t.visible,
33
+ title: t.title,
34
+ top: "5vh",
35
+ width: 800,
36
+ "append-to-body": "",
37
+ "destroy-on-close": "",
38
+ draggable: "",
39
+ overflow: "",
40
+ "close-on-click-modal": !1,
41
+ "before-close": _
42
+ }, {
43
+ footer: o(() => [
44
+ i("span", B, [
45
+ x(f, { onClick: n }, {
46
+ default: o(() => [
47
+ y(h(C(d)("act.cancel")), 1)
48
+ ]),
49
+ _: 1
50
+ })
51
+ ])
52
+ ]),
53
+ default: o(() => [
54
+ i("div", {
55
+ innerHTML: l.data.editorContent
56
+ }, null, 8, V)
57
+ ]),
58
+ _: 1
59
+ }, 8, ["model-value", "title"]);
60
+ };
61
+ }
62
+ }, M = /* @__PURE__ */ k(D, [["__scopeId", "data-v-be1c5be6"]]);
63
+ export {
64
+ M as default
65
+ };
@@ -0,0 +1,289 @@
1
+ import { defineAsyncComponent as re, inject as C, ref as U, watch as ne, resolveComponent as f, resolveDirective as se, unref as t, openBlock as n, createElementBlock as V, createVNode as ue, normalizeStyle as de, withCtx as g, Fragment as q, renderList as L, createBlock as d, mergeProps as _, withKeys as I, withModifiers as B, createCommentVNode as h, resolveDynamicComponent as pe, createElementVNode as ie, toDisplayString as S, createTextVNode as M, withDirectives as ce } from "vue";
2
+ import { _ as fe, u as ye, P as me, a as be, b as Ve } from "./index-5fa8f416.js";
3
+ import "vue-router";
4
+ import "element-plus";
5
+ const _e = {
6
+ key: 0,
7
+ class: "search-module-container"
8
+ }, Ce = { class: "no-config-field" }, he = {
9
+ __name: "index",
10
+ props: {
11
+ data: { type: Object, default: () => ({}) }
12
+ },
13
+ emits: ["reset", "search"],
14
+ setup(j, { emit: H }) {
15
+ const K = re(() => import("./index-e2f2023d.js")), { t: p } = ye(), W = C("request"), O = C("globalProps"), G = C("loadComponents"), y = C("getFieldUiProps"), x = C("formatDataType"), z = C("disposeDate"), J = C("getDefaultQueryValues"), A = H, m = j, X = U({});
16
+ let b = U([]), Y = U([]), T = U(!0);
17
+ const Z = (s) => m.data.tableConfig.isExpandQuery && T.value ? m.data.tableConfig.tableQueryRowWidth > s + 1 : !0, ee = async (s) => {
18
+ b.value = await Promise.all(
19
+ s.filter((l) => l.useScenes.includes("tableSearch")).map(async (l) => {
20
+ l.tableQueryDefaultValue && (["date", "dateRange"].includes(l.fieldType) ? l.queryValue = z(l) : l.queryValue = l.tableQueryDefaultValue ? l.tableQueryDefaultValue : void 0), O.defaultParams.some((o) => {
21
+ o.field == l.fieldKey && o.operate === l.tableQueryCondition && (l.queryValue = o.value);
22
+ });
23
+ const u = (l.formCustomComponentes ?? []).find((o) => o.permissionCode === "tableSearch");
24
+ if (l.isQueryFieldCustom = !1, u && u.isFieldCustom) {
25
+ const { isFieldCustom: o, customComponentName: k, customComponentUrl: P } = u;
26
+ if (l.isQueryFieldCustom = !0, o && !l.customQueryComponent) {
27
+ const $ = await G(P, k);
28
+ l.customQueryComponent = $;
29
+ }
30
+ }
31
+ return l;
32
+ })
33
+ );
34
+ }, le = (s) => {
35
+ const l = (s || []).filter((u) => u.permissionCode === 1001).map((u) => ({ ...u, loading: !1 }));
36
+ Y.value = [...l, { btnName: p("act.reset"), permissionCode: "9999", btnColor: "info", btnIcon: "btn-reset", loading: !1 }];
37
+ }, ae = async ({ node: s, resolve: l }, u) => {
38
+ const o = y(u), { label: k, value: P, children: $, isLeaf: w } = { ...Ve, ...o.treeProps || {} };
39
+ if (s[w])
40
+ return l([]);
41
+ const Q = u.postRequestParams.filter((r) => r.submitType === "default").reduce((r, e) => (r[e.submitName] = x(e.paramsType, e.submitValue), r), {}), D = u.postRequestParams.filter((r) => r.submitType === "match").reduce((r, e) => (r[e.submitName] = x(e.paramsType, O.matchData[e.submitValue][e.submitName]), r), {}), R = u.postRequestParams.filter((r) => r.submitType === "dynamic").map((r) => ({
42
+ field: r.submitName,
43
+ operate: r.submitMatchType,
44
+ value: o.loadCode ? s == null ? void 0 : s.data.value : x(r.paramsType, r.submitValue)
45
+ }));
46
+ let c = {};
47
+ Object.keys(Q).length && (c = { ...c, ...Q }), Object.keys(D).length && (c = { ...c, ...D }), R.length && (c.dynamicFilters = R), o.loadCode && Reflect.has(c, o.loadCode) && (c[o.loadCode] = s == null ? void 0 : s.data.value);
48
+ const { data: E } = await W({
49
+ url: u.fieldRequestUrl,
50
+ method: u.fieldRequestType || "GET",
51
+ data: c
52
+ }), v = (E || []).map((r) => ({ label: r[k], value: r[P], children: [], isLeaf: r[w] }));
53
+ l(v);
54
+ };
55
+ ne(
56
+ () => m.data,
57
+ (s, l) => {
58
+ ee(s.fields), le(s.buttons);
59
+ },
60
+ { immediate: !0, deep: !0 }
61
+ );
62
+ const i = (s) => {
63
+ switch (s.loading = !0, s.permissionCode) {
64
+ case "9999":
65
+ b.value.forEach((o) => {
66
+ o.tableQueryDefaultValue ? ["date", "dateRange"].includes(o.fieldType) ? o.queryValue = z(o) : o.queryValue = o.tableQueryDefaultValue ? o.tableQueryDefaultValue : void 0 : o.fieldType.includes("&") ? o.queryValue = [] : o.queryValue = void 0;
67
+ });
68
+ const l = J();
69
+ A("reset", l, () => {
70
+ s.loading = !1;
71
+ });
72
+ break;
73
+ default:
74
+ const u = b.value.filter((o) => Array.isArray(o.queryValue) ? o.queryValue.length : !!o.queryValue);
75
+ A("search", u, () => {
76
+ s.loading = !1;
77
+ });
78
+ break;
79
+ }
80
+ }, te = () => {
81
+ T.value = !T.value;
82
+ }, oe = () => {
83
+ i({ permissionCode: 1001 });
84
+ };
85
+ return (s, l) => {
86
+ var r;
87
+ const u = f("el-input"), o = f("el-option"), k = f("el-select"), P = f("el-select-v2"), $ = f("el-cascader"), w = f("el-tree-select"), Q = f("el-date-picker"), D = f("el-form-item"), R = f("a-svg-icon"), c = f("el-button"), E = f("el-form"), v = se("debounce");
88
+ return t(b) && t(b).length ? (n(), V("div", _e, [
89
+ ue(E, {
90
+ style: de({ "--table-query-row": m.data.tableConfig.tableQueryRowWidth }),
91
+ class: "form-content",
92
+ ref: "elForm",
93
+ "label-suffix": ":",
94
+ "label-position": "right"
95
+ }, {
96
+ default: g(() => [
97
+ (n(!0), V(q, null, L(t(b), (e, N) => (n(), V(q, { key: N }, [
98
+ Z(N) ? (n(), V(q, { key: 0 }, [
99
+ e.isQueryFieldCustom ? (n(), V(q, { key: 1 }, [
100
+ e.customQueryComponent ? (n(), d(pe(e.customQueryComponent), {
101
+ key: 0,
102
+ class: "custom-btn",
103
+ ref_for: !0,
104
+ ref: (a) => X.value.customQueryComponent = a,
105
+ queryItem: e,
106
+ data: m.data,
107
+ onRefresh: (a) => i(e)
108
+ }, null, 40, ["queryItem", "data", "onRefresh"])) : (n(), V("div", {
109
+ class: "no-config",
110
+ key: N
111
+ }, [
112
+ ie("span", Ce, "【" + S(e.fieldName) + "】", 1),
113
+ M(S(t(p)("act.fieldCustom")), 1)
114
+ ]))
115
+ ], 64)) : (n(), d(D, {
116
+ key: 0,
117
+ class: "search-form-item",
118
+ "label-width": m.data.tableConfig.tableQueryLabelWidth,
119
+ label: e.fieldName
120
+ }, {
121
+ default: g(() => [
122
+ e.fieldType === "input" || e.fieldType === "editor" ? (n(), d(u, _({
123
+ key: 0,
124
+ modelValue: e.queryValue,
125
+ "onUpdate:modelValue": (a) => e.queryValue = a,
126
+ placeholder: `${t(p)("act.inputPlaceholder")}${e.fieldName}`,
127
+ clearable: "",
128
+ ref_for: !0
129
+ }, t(y)(e), {
130
+ onKeyup: l[0] || (l[0] = I(B((a) => i({ permissionCode: 1001 }), ["prevent"]), ["enter", "native"])),
131
+ onClear: oe
132
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder"])) : h("", !0),
133
+ e.fieldType === "inputNumber" ? (n(), d(t(K), _({
134
+ key: 1,
135
+ modelValue: e.queryValue,
136
+ "onUpdate:modelValue": (a) => e.queryValue = a,
137
+ placeholder: `${t(p)("act.inputPlaceholder")}${e.fieldName}`,
138
+ clearable: "",
139
+ onKeyup: l[1] || (l[1] = I(B((a) => i({ permissionCode: 1001 }), ["prevent"]), ["enter", "native"])),
140
+ ref_for: !0
141
+ }, t(y)(e)), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder"])) : ["select", "switch", "multipleSelect"].includes(e.fieldType) ? (n(), d(k, _({
142
+ key: 2,
143
+ modelValue: e.queryValue,
144
+ "onUpdate:modelValue": (a) => e.queryValue = a,
145
+ placeholder: `${t(p)("act.selectPlaceholder")}${e.fieldName}`,
146
+ clearable: "",
147
+ filterable: "",
148
+ ref_for: !0
149
+ }, t(y)(e), {
150
+ multiple: e.fieldType === "multipleSelect",
151
+ "collapse-tags": e.fieldType === "multipleSelect",
152
+ "collapse-tags-tooltip": e.fieldType === "multipleSelect",
153
+ onChange: l[2] || (l[2] = (a) => i({ permissionCode: 1001 }))
154
+ }), {
155
+ default: g(() => [
156
+ (n(!0), V(q, null, L(e.dataList, (a, F) => (n(), d(o, {
157
+ key: F,
158
+ label: a.key,
159
+ value: a.value
160
+ }, null, 8, ["label", "value"]))), 128))
161
+ ]),
162
+ _: 2
163
+ }, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "collapse-tags", "collapse-tags-tooltip"])) : ["virtualizedSelect", "virtualizedMultipleSelect"].includes(e.fieldType) ? (n(), d(P, _({
164
+ key: 3,
165
+ modelValue: e.queryValue,
166
+ "onUpdate:modelValue": (a) => e.queryValue = a,
167
+ options: e.dataList,
168
+ props: { ...t(me) },
169
+ placeholder: `${t(p)("act.selectPlaceholder")}${e.fieldName}`,
170
+ clearable: "",
171
+ filterable: "",
172
+ ref_for: !0
173
+ }, t(y)(e), {
174
+ "collapse-tags": e.fieldType === "virtualizedMultipleSelect",
175
+ "collapse-tags-tooltip": e.fieldType === "virtualizedMultipleSelect",
176
+ multiple: e.fieldType === "virtualizedMultipleSelect",
177
+ onChange: l[3] || (l[3] = (a) => i({ permissionCode: 1001 }))
178
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "options", "props", "placeholder", "collapse-tags", "collapse-tags-tooltip", "multiple"])) : e.fieldType === "provinceCascade" ? (n(), d($, _({
179
+ key: 4,
180
+ modelValue: e.queryValue,
181
+ "onUpdate:modelValue": (a) => e.queryValue = a,
182
+ options: e.dataList,
183
+ props: { ...t(be) },
184
+ clearable: "",
185
+ filterable: "",
186
+ placeholder: `${t(p)("act.selectPlaceholder")}${e.fieldName}`,
187
+ ref_for: !0
188
+ }, t(y)(e), {
189
+ onChange: l[4] || (l[4] = (a) => i({ permissionCode: 1001 }))
190
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "options", "props", "placeholder"])) : e.fieldType === "treeSelect" ? (n(), d(w, _({
191
+ key: 5,
192
+ modelValue: e.queryValue,
193
+ "onUpdate:modelValue": (a) => e.queryValue = a,
194
+ placeholder: `请选择${e.fieldName}`,
195
+ props: { isLeaf: "isLeaf" },
196
+ "render-after-expand": !1,
197
+ "collapse-tags": "",
198
+ "collapse-tags-tooltip": "",
199
+ multiple: "",
200
+ "show-checkbox": "",
201
+ clearable: "",
202
+ filterable: "",
203
+ lazy: "",
204
+ load: (a, F) => ae({ node: a, resolve: F }, e),
205
+ ref_for: !0
206
+ }, t(y)(e), {
207
+ onChange: l[5] || (l[5] = (a) => i({ permissionCode: 1001 }))
208
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "load"])) : e.fieldType === "date" ? (n(), d(Q, _({
209
+ key: 6,
210
+ modelValue: e.queryValue,
211
+ "onUpdate:modelValue": (a) => e.queryValue = a,
212
+ type: "date",
213
+ placeholder: `${t(p)("act.selectPlaceholder")}${t(p)("act.time")}`,
214
+ "value-format": "YYYY-MM-DD HH:mm:ss",
215
+ clearable: "",
216
+ ref_for: !0
217
+ }, t(y)(e), {
218
+ onChange: l[6] || (l[6] = (a) => i({ permissionCode: 1001 }))
219
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder"])) : e.fieldType === "dateRange" ? (n(), d(Q, _({
220
+ key: 7,
221
+ modelValue: e.queryValue,
222
+ "onUpdate:modelValue": (a) => e.queryValue = a,
223
+ type: "daterange",
224
+ "start-placeholder": t(p)("act.startTime"),
225
+ "end-placeholder": t(p)("act.endTime"),
226
+ "value-format": "YYYY-MM-DD HH:mm:ss",
227
+ clearable: "",
228
+ ref_for: !0
229
+ }, t(y)(e), {
230
+ onChange: l[7] || (l[7] = (a) => i({ permissionCode: 1001 }))
231
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "start-placeholder", "end-placeholder"])) : h("", !0)
232
+ ]),
233
+ _: 2
234
+ }, 1032, ["label-width", "label"]))
235
+ ], 64)) : h("", !0)
236
+ ], 64))), 128)),
237
+ t(b).length ? (n(), d(D, {
238
+ key: 0,
239
+ class: "search-form-btn",
240
+ "label-width": "0"
241
+ }, {
242
+ default: g(() => [
243
+ (n(!0), V(q, null, L(t(Y), (e, N) => ce((n(), d(c, {
244
+ key: N,
245
+ type: e.btnColor,
246
+ loading: e.loading,
247
+ onClick: (a) => i(e)
248
+ }, {
249
+ default: g(() => [
250
+ e.btnIcon ? (n(), d(R, {
251
+ key: 0,
252
+ class: "mr6",
253
+ name: e.btnIcon,
254
+ width: "12",
255
+ height: "12",
256
+ color: "#fff"
257
+ }, null, 8, ["name"])) : h("", !0),
258
+ M(" " + S(e.btnName), 1)
259
+ ]),
260
+ _: 2
261
+ }, 1032, ["type", "loading", "onClick"])), [
262
+ [v]
263
+ ])), 128))
264
+ ]),
265
+ _: 1
266
+ })) : h("", !0)
267
+ ]),
268
+ _: 1
269
+ }, 8, ["style"]),
270
+ m.data.tableConfig.isExpandQuery && ((r = t(b)) == null ? void 0 : r.length) > m.data.tableConfig.tableQueryRowWidth ? (n(), d(c, {
271
+ key: 0,
272
+ class: "expand",
273
+ text: "",
274
+ size: "small",
275
+ icon: t(T) ? "ArrowDown" : "ArrowUp",
276
+ onClick: te
277
+ }, {
278
+ default: g(() => [
279
+ M(S(t(T) ? t(p)("act.expand") : t(p)("act.retract")), 1)
280
+ ]),
281
+ _: 1
282
+ }, 8, ["icon"])) : h("", !0)
283
+ ])) : h("", !0);
284
+ };
285
+ }
286
+ }, Pe = /* @__PURE__ */ fe(he, [["__scopeId", "data-v-3c6eb654"]]);
287
+ export {
288
+ Pe as default
289
+ };
@@ -0,0 +1,147 @@
1
+ import { ref as N, watch as O, resolveComponent as u, resolveDirective as T, openBlock as l, createElementBlock as d, withDirectives as j, createBlock as i, mergeProps as D, withCtx as c, createTextVNode as K, toDisplayString as W, unref as f, Fragment as s, renderList as A, renderSlot as y, createCommentVNode as E, nextTick as w } from "vue";
2
+ import { _ as H, u as U } from "./index-5fa8f416.js";
3
+ import "vue-router";
4
+ import "element-plus";
5
+ const V = { class: "act-table" }, $ = {
6
+ __name: "index",
7
+ props: {
8
+ loading: { type: Boolean, default: !1 },
9
+ maxHeight: { type: Number, default: 600 },
10
+ total: { type: Number, default: 0 },
11
+ tableQuery: { type: Object, default: () => ({ pageIndex: 1, pageSize: 10 }) },
12
+ selection: { type: Array, default: () => [] },
13
+ headers: { type: Array, default: () => [] },
14
+ data: { type: Array, default: () => [] },
15
+ showSerialNumber: { type: Boolean, default: !0 },
16
+ showPagination: { type: Boolean, default: !0 },
17
+ rowKey: { type: String, default: "id" },
18
+ treeProps: { type: Object, default: () => ({ children: "children", hasChildren: "hasChildren" }) },
19
+ tableConfig: { type: Object, default: () => ({}) }
20
+ },
21
+ emits: ["update:tableQuery", "update:selection", "refresh", "onRowClick"],
22
+ setup(g, { expose: b, emit: x }) {
23
+ const { t: h } = U(), r = x, t = g;
24
+ let p = N(null);
25
+ const _ = (o) => t.showPagination ? o + 1 + (t.tableQuery.pageIndex - 1) * t.tableQuery.pageSize : o + 1, k = (o) => {
26
+ w(() => {
27
+ t.data.forEach((a) => {
28
+ o.includes(a[t.rowKey]) && p.value.toggleRowSelection(a, !0);
29
+ });
30
+ });
31
+ }, C = (o) => p.value.getSelectionRows();
32
+ O(
33
+ () => t.selection,
34
+ (o, a) => {
35
+ o && o.length && k(o);
36
+ },
37
+ { deep: !0, immediate: !0 }
38
+ );
39
+ const S = (o) => {
40
+ r("update:selection", o);
41
+ }, m = (o, a) => {
42
+ o && w(() => {
43
+ t.data.forEach((n) => {
44
+ o.includes(n[a || t.rowKey]) && p.value.toggleRowSelection(n, !0);
45
+ });
46
+ });
47
+ }, v = (o) => {
48
+ r("update:tableQuery", { ...t.tableQuery, pageSize: o }), r("refresh", []);
49
+ }, z = (o) => {
50
+ r("update:tableQuery", { ...t.tableQuery, pageIndex: o }), r("refresh", []);
51
+ }, Q = (o, a, n) => {
52
+ r("onRowClick", o, a, n);
53
+ };
54
+ return b({ getSelectionRows: C, updateSelection: m }), (o, a) => {
55
+ const n = u("el-table-column"), R = u("el-table"), I = u("el-pagination"), P = T("loading");
56
+ return l(), d("div", V, [
57
+ j((l(), i(R, D({
58
+ style: { width: "100%" },
59
+ ref_key: "tableRef",
60
+ ref: p,
61
+ data: t.data,
62
+ stripe: "",
63
+ border: "",
64
+ "highlight-current-row": "",
65
+ "max-height": t.maxHeight,
66
+ "row-key": t.rowKey,
67
+ "default-expand-all": "",
68
+ "tree-props": g.treeProps
69
+ }, t.tableConfig, {
70
+ onSelectionChange: S,
71
+ onRowClick: Q
72
+ }), {
73
+ empty: c(() => [
74
+ K(W(t.data.length || t.data.length == 0 ? f(h)("act.noData") : ""), 1)
75
+ ]),
76
+ default: c(() => [
77
+ (l(!0), d(s, null, A(t.headers, (e) => (l(), d(s, { key: e }, [
78
+ e.isCustomTableHeader ? y(o.$slots, e.prop, { key: 0 }, void 0, !0) : (l(), d(s, { key: 1 }, [
79
+ e.render ? (l(), i(n, {
80
+ key: 0,
81
+ label: e.label,
82
+ align: e.align,
83
+ width: e.width,
84
+ minWidth: e.minWidth,
85
+ sortable: e.sort,
86
+ "show-overflow-tooltip": e.prop == "operate" ? !1 : e.showOverflowTooltip,
87
+ fixed: e.fixed
88
+ }, {
89
+ default: c((B) => [
90
+ y(o.$slots, e.prop, { scope: B }, void 0, !0)
91
+ ]),
92
+ _: 2
93
+ }, 1032, ["label", "align", "width", "minWidth", "sortable", "show-overflow-tooltip", "fixed"])) : (l(), d(s, { key: 1 }, [
94
+ e.prop == "checkbox" ? (l(), i(n, {
95
+ key: 0,
96
+ type: "selection",
97
+ align: "center",
98
+ width: e.width,
99
+ fixed: ""
100
+ }, null, 8, ["width"])) : e.prop == "serialNumber" ? (l(), i(n, {
101
+ key: 1,
102
+ index: _,
103
+ type: "index",
104
+ align: "center",
105
+ width: e.width,
106
+ label: f(h)("act.sort"),
107
+ fixed: ""
108
+ }, null, 8, ["width", "label"])) : (l(), i(n, {
109
+ key: 2,
110
+ prop: e.prop,
111
+ label: e.label,
112
+ align: e.align,
113
+ sortable: e.sort,
114
+ "show-overflow-tooltip": e.showOverflowTooltip,
115
+ width: e.width,
116
+ "min-width": e.minWidth,
117
+ fixed: e.fixed
118
+ }, null, 8, ["prop", "label", "align", "sortable", "show-overflow-tooltip", "width", "min-width", "fixed"]))
119
+ ], 64))
120
+ ], 64))
121
+ ], 64))), 128))
122
+ ]),
123
+ _: 3
124
+ }, 16, ["data", "max-height", "row-key", "tree-props"])), [
125
+ [P, t.loading]
126
+ ]),
127
+ t.showPagination ? (l(), i(I, {
128
+ key: 0,
129
+ class: "table-pagination",
130
+ "current-page": t.tableQuery.pageIndex,
131
+ "onUpdate:currentPage": a[0] || (a[0] = (e) => t.tableQuery.pageIndex = e),
132
+ "page-size": t.tableQuery.pageSize,
133
+ "onUpdate:pageSize": a[1] || (a[1] = (e) => t.tableQuery.pageSize = e),
134
+ "page-sizes": [10, 20, 50, 75, 100, 200, 500],
135
+ background: "",
136
+ layout: "total, sizes, prev, pager, next, jumper",
137
+ total: t.total,
138
+ onSizeChange: v,
139
+ onCurrentChange: z
140
+ }, null, 8, ["current-page", "page-size", "total"])) : E("", !0)
141
+ ]);
142
+ };
143
+ }
144
+ }, G = /* @__PURE__ */ H($, [["__scopeId", "data-v-651542d6"]]);
145
+ export {
146
+ G as default
147
+ };
@@ -0,0 +1,35 @@
1
+ import { computed as u, resolveComponent as d, openBlock as i, createBlock as V, mergeProps as g } from "vue";
2
+ const _ = {
3
+ __name: "index",
4
+ props: {
5
+ modelValue: { type: String }
6
+ },
7
+ emits: ["update:modelValue"],
8
+ setup(n, { emit: r }) {
9
+ const p = r, l = n, o = u({
10
+ get() {
11
+ return l.modelValue;
12
+ },
13
+ set(e) {
14
+ p("update:modelValue", e);
15
+ }
16
+ }), m = (e) => {
17
+ let t = e.charAt(0);
18
+ return e = e.replace(/[^\d.]/g, ""), e = e.replace(/^\./g, ""), e = e.replace(/\.{2,}/g, "."), e = e.replace(".", "$#$").replace(/\./g, "").replace("$#$", "."), t == "-" && (e = "-" + e), e;
19
+ }, a = (e) => {
20
+ o.value = m(e);
21
+ };
22
+ return (e, t) => {
23
+ const c = d("el-input");
24
+ return i(), V(c, g({
25
+ modelValue: o.value,
26
+ "onUpdate:modelValue": t[0] || (t[0] = (s) => o.value = s),
27
+ modelModifiers: { number: !0 },
28
+ placeholder: "Please input"
29
+ }, e.$attrs, { onInput: a }), null, 16, ["modelValue"]);
30
+ };
31
+ }
32
+ };
33
+ export {
34
+ _ as default
35
+ };