zhihao-ui 1.3.53 → 1.3.55

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.
Files changed (43) hide show
  1. package/dist/es/{BaseInfo-BZ34efZZ.js → BaseInfo-Bz9HbxrR.js} +1 -1
  2. package/dist/es/{BaseItem-DxfKmzHN.js → BaseItem-YGnpIugn.js} +3 -3
  3. package/dist/es/{Button-ByWikGvS.js → Button-DSjKm2wO.js} +4 -4
  4. package/dist/es/CascaderLoadMore-BwYi7PBx.js +287 -0
  5. package/dist/es/{DatePicker-BS2zGuNF.js → DatePicker-BkKUo2v1.js} +3 -3
  6. package/dist/es/{DetailHeader-Bdjj2rT_.js → DetailHeader-lzEy7t5Y.js} +3 -3
  7. package/dist/es/{DetailSubTitle-oDZVGEDj.js → DetailSubTitle-DfqGXyKI.js} +2 -2
  8. package/dist/es/{Dialog-6oittA9s.js → Dialog-MVXB7s2S.js} +3 -3
  9. package/dist/es/DiyDataTable-Yp1HvbS1.js +367 -0
  10. package/dist/es/{EditInfoPair-CZXKGl2-.js → EditInfoPair-BXF1tV3S.js} +3 -3
  11. package/dist/es/{FileWrapper-B4nZf2F1.js → FileWrapper-CqbiXynu.js} +4 -4
  12. package/dist/es/{Grid-anvIeL2d.js → Grid-CDS9IrCA.js} +2 -2
  13. package/dist/es/{InfoPair-C6PjunKe.js → InfoPair-jRjF91Ro.js} +3 -3
  14. package/dist/es/{Input-v0wMSltt.js → Input-CJadFglX.js} +3 -3
  15. package/dist/es/{Loading-C86LqgY4.js → Loading-C9Te67Gr.js} +2 -2
  16. package/dist/es/Map-BoN5eeEB.js +2326 -0
  17. package/dist/es/{MessageBox-Mt0l51rJ.js → MessageBox-BzwToZ0E.js} +2 -2
  18. package/dist/es/{MoneyInput-DU9wly48.js → MoneyInput-oY4Jr4Du.js} +5 -5
  19. package/dist/es/{PageHeadPanel-CJNtdEZb.js → PageHeadPanel-oLoxYR29.js} +2 -2
  20. package/dist/es/Table-BU_pHf2Y.js +1180 -0
  21. package/dist/es/{ToolTips-DtkJa3Ld.js → ToolTips-H93PrmYL.js} +3 -3
  22. package/dist/es/index.js +23 -23
  23. package/dist/es/{utils-BXhGHET2.js → utils-DRDkj6ga.js} +1 -1
  24. package/dist/es/{vendor-DIFwbdTH.js → vendor-CxcudVpO.js} +10946 -10410
  25. package/dist/index.css +1 -1
  26. package/dist/types/components/CascaderLoadMore/CascaderLoadMore.vue.d.ts +18 -0
  27. package/dist/types/components/CascaderLoadMore/index.d.ts +30 -0
  28. package/dist/types/components/DiyDataTable/DiyDataTable.vue.d.ts +2 -1
  29. package/dist/types/components/DiyDataTable/index.d.ts +6 -3
  30. package/dist/types/components/DiyDataTable/type.d.ts +3 -1
  31. package/dist/types/components/Map/Map.vue.d.ts +1 -0
  32. package/dist/types/components/Map/function/position.d.ts +2 -1
  33. package/dist/types/components/Map/function/ship/index.d.ts +1 -0
  34. package/dist/types/components/Map/index.d.ts +3 -0
  35. package/dist/types/components/Map/interface/position.d.ts +2 -0
  36. package/dist/types/components/ToolTips/index.d.ts +6 -6
  37. package/dist/umd/index.css +1 -1
  38. package/dist/umd/index.umd.cjs +44 -44
  39. package/package.json +3 -5
  40. package/dist/es/CascaderLoadMore-CF_J-i8H.js +0 -261
  41. package/dist/es/DiyDataTable-BzfRDF0J.js +0 -366
  42. package/dist/es/Map-CGiEKZ7_.js +0 -2280
  43. package/dist/es/Table-BgW-kh7S.js +0 -1177
@@ -0,0 +1,1180 @@
1
+ import { reactive as te, computed as O, toRefs as Ae, ref as z, defineComponent as le, useCssVars as dt, inject as Ue, openBlock as S, createElementBlock as I, createBlock as L, resolveDynamicComponent as fe, mergeProps as G, withKeys as pt, unref as u, createSlots as me, withCtx as w, Fragment as Y, renderList as ge, renderSlot as W, createElementVNode as B, toDisplayString as X, createCommentVNode as M, createVNode as k, withModifiers as ht, normalizeClass as Ze, createTextVNode as Q, useSlots as Ke, isVNode as ft, normalizeProps as We, guardReactiveProps as je, nextTick as ve, onMounted as mt, onActivated as gt, onDeactivated as vt, onUnmounted as Ct, watch as bt, provide as yt, resolveDirective as St, withDirectives as we, vShow as wt, toHandlers as kt } from "vue";
2
+ import { a5 as Ne, a6 as _t, a7 as Pt, a8 as qe, a9 as Tt, n as Et, aa as $t, q as Bt, ab as zt, a4 as Ce, b as Te, a as be, ac as Mt, ad as It, p as re, ae as Ft, af as Lt, ag as Dt, ah as xe, ai as He, e as J, o as Je, aj as Le, ak as Vt, al as Ye, am as Rt, an as Ot, ao as At, ap as Ut, E as ke, aq as Zt, m as Kt, ar as Wt, as as De, at as Ve } from "./vendor-CxcudVpO.js";
3
+ import { D as ae, C as jt } from "./BaseItem-YGnpIugn.js";
4
+ import { Z as Nt } from "./CascaderLoadMore-BwYi7PBx.js";
5
+ import { _ as se, Z as _e } from "./Button-DSjKm2wO.js";
6
+ import { _ as qt } from "./Dialog-MVXB7s2S.js";
7
+ import { w as xt } from "./utils-DRDkj6ga.js";
8
+ const Ht = 12;
9
+ function Ee(m, d, a, h) {
10
+ return m.reduce((f, y) => {
11
+ if (f) return f;
12
+ if (y[a] === d) return y;
13
+ if (y[h]) return Ee(y[h], d, a, h);
14
+ }, null);
15
+ }
16
+ function Jt(m, d, a) {
17
+ const h = Pt(a) ? ae : a, f = Ne(m, d);
18
+ return _t(f) || f === "" ? h : f;
19
+ }
20
+ const Re = Jt;
21
+ function A(m) {
22
+ const d = m.split(".");
23
+ return d.length == 1 ? m : d[d.length - 1];
24
+ }
25
+ function Oe(m, d, a, h) {
26
+ const f = (a == null ? void 0 : a.value) ?? "value", y = (a == null ? void 0 : a.label) ?? "label", t = (a == null ? void 0 : a.children) ?? "children";
27
+ let C = {};
28
+ return Array.isArray(d) && (C = Ee(d, m, f, t)), h == "tag" ? C != null && C.tagType ? C.tagType : "" : C ? C[y] : ae;
29
+ }
30
+ function Yt(m, d, a) {
31
+ const h = "value", f = "children";
32
+ let y = {};
33
+ return Array.isArray(d) && (y = Ee(d, m, h, f)), y;
34
+ }
35
+ function Gt(m) {
36
+ return qe(m) ? m.length ? m.join(" / ") : ae : m ?? ae;
37
+ }
38
+ function he(m, d) {
39
+ return d.includes(".") ? (d.split(".").forEach((a) => m = m[a] ?? ae), m) : m[d] ?? ae;
40
+ }
41
+ const oe = (m, d) => {
42
+ const a = d || Ht, f = document.createElement("canvas").getContext("2d");
43
+ return f.font = `${a}px Microsoft YaHei`, f.measureText(m).width;
44
+ }, Qt = (m) => {
45
+ const d = m || "zhihao-col-setting", a = () => {
46
+ const C = localStorage.getItem(d);
47
+ return C ? JSON.parse(C) : {};
48
+ }, h = (C) => {
49
+ localStorage.setItem(d, JSON.stringify(C));
50
+ };
51
+ return {
52
+ getMap: a,
53
+ setMap: h,
54
+ getColumnCache: (C) => a()[C] || [],
55
+ setColumnCache: (C, o) => {
56
+ const p = a();
57
+ p[C] = o, h(p);
58
+ },
59
+ removeColumnCache: (C) => {
60
+ const o = a();
61
+ delete o[C], h(o);
62
+ }
63
+ };
64
+ }, Xt = `<g clip-path="url(#clip0_94_5585)">
65
+ <path d="M9.48792 55.1851C11.0631 55.1851 12.3401 53.9081 12.3401 52.3329C12.3401 50.7577 11.0631 49.4807 9.48792 49.4807C7.91271 49.4807 6.63574 50.7577 6.63574 52.3329C6.63574 53.9081 7.91271 55.1851 9.48792 55.1851Z" fill="#9CBEFC"/>
66
+ <path d="M2.44202 35.4087C4.01723 35.4087 5.2942 34.1317 5.2942 32.5565C5.2942 30.9813 4.01723 29.7043 2.44202 29.7043C0.866808 29.7043 -0.410156 30.9813 -0.410156 32.5565C-0.410156 34.1317 0.866808 35.4087 2.44202 35.4087Z" fill="#9CBEFC"/>
67
+ <path d="M9.48799 16.7354C11.859 16.7354 13.7812 14.8133 13.7812 12.4422C13.7812 10.0712 11.859 8.14907 9.48799 8.14907C7.11694 8.14907 5.19482 10.0712 5.19482 12.4422C5.19482 14.8133 7.11694 16.7354 9.48799 16.7354Z" fill="#9CBEFC"/>
68
+ <path d="M29.2644 63.7615C31.6354 63.7615 33.5575 61.8394 33.5575 59.4683C33.5575 57.0973 31.6354 55.1752 29.2644 55.1752C26.8933 55.1752 24.9712 57.0973 24.9712 59.4683C24.9712 61.8394 26.8933 63.7615 29.2644 63.7615Z" fill="#9CBEFC"/>
69
+ <path d="M49.5177 57.7491C52.509 57.7491 54.9339 55.3242 54.9339 52.3329C54.9339 49.3417 52.509 46.9168 49.5177 46.9168C46.5265 46.9168 44.1016 49.3417 44.1016 52.3329C44.1016 55.3242 46.5265 57.7491 49.5177 57.7491Z" fill="#9CBEFC"/>
70
+ <path d="M29.2643 10.8323C32.2555 10.8323 34.6804 8.40741 34.6804 5.41615C34.6804 2.4249 32.2555 0 29.2643 0C26.273 0 23.8481 2.4249 23.8481 5.41615C23.8481 8.40741 26.273 10.8323 29.2643 10.8323Z" fill="#9CBEFC"/>
71
+ <path d="M48.9613 20.4422C53.1106 20.4422 56.4743 17.0785 56.4743 12.9292C56.4743 8.77985 53.1106 5.41615 48.9613 5.41615C44.8119 5.41615 41.4482 8.77985 41.4482 12.9292C41.4482 17.0785 44.8119 20.4422 48.9613 20.4422Z" fill="#9CBEFC"/>
72
+ <path d="M56.4744 39.672C60.4042 39.672 63.5899 36.4863 63.5899 32.5565C63.5899 28.6267 60.4042 25.441 56.4744 25.441C52.5446 25.441 49.3589 28.6267 49.3589 32.5565C49.3589 36.4863 52.5446 39.672 56.4744 39.672Z" fill="#9CBEFC"/>
73
+ </g>
74
+ <defs>
75
+ <clipPath id="clip0_94_5585">
76
+ <rect width="64" height="64" fill="white"/>
77
+ </clipPath>
78
+ </defs>`, ea = (m, d = {}, a = !0, h, f, y = (t) => t) => {
79
+ const t = te({
80
+ // 表格数据
81
+ tableData: [],
82
+ // 分页数据
83
+ pageable: {
84
+ // 当前页数
85
+ page: 1,
86
+ // 每页显示条数
87
+ size: 10,
88
+ // 总条数
89
+ total: 0
90
+ },
91
+ // 查询参数(只包括查询)
92
+ searchParam: {},
93
+ // 初始化默认的查询参数
94
+ searchInitParam: {},
95
+ // 总参数(包含分页和查询参数)
96
+ totalParam: {},
97
+ // 是否在加载中
98
+ loading: !1
99
+ }), C = O({
100
+ get: () => ({
101
+ page: t.pageable.page,
102
+ size: t.pageable.size
103
+ }),
104
+ set: (E) => {
105
+ console.log("我是分页更新之后的值", E);
106
+ }
107
+ }), o = async () => {
108
+ if (t.loading = !0, !m) {
109
+ t.loading = !1;
110
+ return;
111
+ }
112
+ try {
113
+ Object.assign(t.totalParam, d, a ? C.value : {});
114
+ for (const e in t.searchParam)
115
+ t.searchParam[e] === "" && delete t.searchParam[e];
116
+ let E = await m(y({ ...t.searchInitParam, ...t.totalParam }));
117
+ if (h && (E = await h(E)), t.tableData = a ? E.list : E, a) {
118
+ const { currentPage: e, pageSize: g, total: _ } = E;
119
+ V({ page: e, size: g, total: _ });
120
+ }
121
+ } catch (E) {
122
+ f && f(E);
123
+ } finally {
124
+ t.loading = !1;
125
+ }
126
+ }, p = () => {
127
+ t.totalParam = {}, t.searchInitParam = {}, d = {};
128
+ const E = {};
129
+ for (const e in t.searchParam)
130
+ (t.searchParam[e] || t.searchParam[e] === !1 || t.searchParam[e] === 0) && (E[e] = t.searchParam[e]);
131
+ Object.assign(t.totalParam, E, a ? C.value : {});
132
+ }, V = (E) => {
133
+ Object.assign(t.pageable, E);
134
+ }, R = () => {
135
+ t.pageable.page = 1, p(), o().then();
136
+ }, x = () => {
137
+ t.pageable.page = 1, t.searchParam = { ...t.searchInitParam }, p(), o().then();
138
+ }, H = (E) => {
139
+ t.pageable.page = 1, t.pageable.size = E, o().then();
140
+ }, U = (E) => {
141
+ t.pageable.page = E, o().then();
142
+ };
143
+ return {
144
+ ...Ae(t),
145
+ getTableList: o,
146
+ search: R,
147
+ reset: x,
148
+ handleSizeChange: H,
149
+ handleCurrentChange: U,
150
+ updatedTotalParam: p
151
+ };
152
+ }, ta = (m = "id", d) => {
153
+ const a = z(!1), h = z([]), f = O(() => {
154
+ const t = [];
155
+ return h.value.forEach((C) => t.push(Ne(C, m))), t;
156
+ });
157
+ return {
158
+ isSelected: a,
159
+ selectedList: h,
160
+ selectedListIds: f,
161
+ selectionChange: (t) => {
162
+ t.length ? a.value = !0 : a.value = !1, h.value = t, d && d(t);
163
+ }
164
+ };
165
+ }, aa = { class: "search-form-item" }, na = /* @__PURE__ */ le({
166
+ name: "SearchFormItem",
167
+ __name: "SearchFormItem",
168
+ props: {
169
+ column: {},
170
+ searchParam: {}
171
+ },
172
+ emits: ["search"],
173
+ setup(m, { emit: d }) {
174
+ dt((e) => ({
175
+ "6720d772": R.value
176
+ }));
177
+ const a = m, h = d, f = O(() => a.searchParam), y = O(() => {
178
+ var e, g, _;
179
+ return {
180
+ label: ((e = a.column.fieldNames) == null ? void 0 : e.label) ?? "label",
181
+ value: ((g = a.column.fieldNames) == null ? void 0 : g.value) ?? "value",
182
+ children: ((_ = a.column.fieldNames) == null ? void 0 : _.children) ?? "children"
183
+ };
184
+ }), t = Ue("enumMap", z(/* @__PURE__ */ new Map())), C = O(() => {
185
+ var g;
186
+ let e = t.value.get(a.column.prop);
187
+ return e ? (((g = a.column.search) == null ? void 0 : g.el) === "select-v2" && a.column.fieldNames && (e = e.map((_) => ({ ..._, label: _[y.value.label], value: _[y.value.value] }))), e) : [];
188
+ }), o = O(() => {
189
+ var e, g;
190
+ return ((g = (e = a.column.search) == null ? void 0 : e.props) == null ? void 0 : g.options) ?? C.value ?? [];
191
+ }), p = O(() => {
192
+ var i, P;
193
+ const e = y.value.label, g = y.value.value, _ = y.value.children, b = (i = a.column.search) == null ? void 0 : i.el;
194
+ let r = ((P = a.column.search) == null ? void 0 : P.props) ?? {};
195
+ return b === "tree-select" && (r = { ...r, props: { ...r.props, label: e, children: _ }, nodeKey: g }), b === "cascader" && (r = { ...r, props: { ...r.props, label: e, value: g, children: _ } }), r;
196
+ }), V = O(() => {
197
+ var _, b, r, i, P, T, v;
198
+ const e = a.column.search;
199
+ return ["datetimerange", "daterange", "monthrange"].includes((_ = e == null ? void 0 : e.props) == null ? void 0 : _.type) || (b = e == null ? void 0 : e.props) != null && b.isRange ? {
200
+ rangeSeparator: ((r = e == null ? void 0 : e.props) == null ? void 0 : r.rangeSeparator) ?? "-",
201
+ startPlaceholder: ((i = e == null ? void 0 : e.props) == null ? void 0 : i.startPlaceholder) ?? "开始时间",
202
+ endPlaceholder: ((P = e == null ? void 0 : e.props) == null ? void 0 : P.endPlaceholder) ?? "结束时间"
203
+ } : { placeholder: ((T = e == null ? void 0 : e.props) == null ? void 0 : T.placeholder) ?? ((v = e == null ? void 0 : e.el) != null && v.includes("input") ? "请输入" : "请选择") };
204
+ }), R = O(() => {
205
+ var r, i;
206
+ const e = a.column.search, g = f.value[(e == null ? void 0 : e.key) ?? A(a.column.prop)], _ = e == null ? void 0 : e.el, b = (r = e == null ? void 0 : e.props) == null ? void 0 : r.placeholder;
207
+ if (e != null && e.width)
208
+ if (Tt(e == null ? void 0 : e.width)) {
209
+ if (e == null ? void 0 : e.width(g))
210
+ return (e == null ? void 0 : e.width(g)) + "px";
211
+ } else
212
+ return (e == null ? void 0 : e.width) + "px";
213
+ if (g && g.length !== 0 && ["select", "select-v2", "tree-select", "cascader"].includes(_ || "")) {
214
+ if (qe(g)) {
215
+ let v = o.value;
216
+ const F = [];
217
+ if (g.forEach((D) => {
218
+ const Z = v.find((K) => K[y.value.value] === D);
219
+ F.push(Z ? Z[y.value.label] : D);
220
+ const j = Z[y.value.children] ?? o.value;
221
+ v = Z ? j : [];
222
+ }), (i = e == null ? void 0 : e.props) != null && i.multiple) {
223
+ const j = oe(F[0]) + 42;
224
+ return g.length > 1 ? j + 26 + oe("+ " + (g.length - 1)) + "px" : j + "px";
225
+ }
226
+ return oe(F.join(" / ")) + "px";
227
+ }
228
+ let P = o.value.find((v) => v[y.value.value] === g);
229
+ const T = P ? P[y.value.label] : g;
230
+ return oe(T) + "px";
231
+ } else return b ? oe(b) + "px" : ["date-picker", "time-picker", "time-select"].includes(_ || "") ? "210px" : "100px";
232
+ }), x = O(() => {
233
+ var e, g, _, b, r;
234
+ return (_ = (g = (e = a.column) == null ? void 0 : e.search) == null ? void 0 : g.props) != null && _.multiple && ((r = (b = a.column) == null ? void 0 : b.search) == null ? void 0 : r.el) === "select" ? {
235
+ collapseTags: !0,
236
+ collapseTagsTooltip: !0
237
+ } : {};
238
+ }), H = O(() => {
239
+ var g;
240
+ const e = a.column.search;
241
+ return ((g = e == null ? void 0 : e.props) == null ? void 0 : g.clearable) ?? ((e == null ? void 0 : e.defaultValue) == null || !1);
242
+ }), U = (e) => {
243
+ var g, _, b, r, i, P, T, v, F;
244
+ if (((b = (_ = (g = a.column) == null ? void 0 : g.search) == null ? void 0 : _.props) == null ? void 0 : b.type) === "daterange") {
245
+ const { searchParam: D } = Ae(a);
246
+ if (e != null && e.length) {
247
+ const Z = ((P = (i = (r = a.column) == null ? void 0 : r.search) == null ? void 0 : i.props) == null ? void 0 : P.beginTime) || "beginTime", j = ((F = (v = (T = a.column) == null ? void 0 : T.search) == null ? void 0 : v.props) == null ? void 0 : F.endTime) || "endTime";
248
+ D.value[Z] = e[0], D.value[j] = e[1];
249
+ } else
250
+ delete D.value.beginTime, delete D.value.endTime;
251
+ }
252
+ (e == null || e === "") && h("search"), e instanceof Array && !e.length && h("search");
253
+ }, E = () => {
254
+ var e;
255
+ ["input", "input-number"].includes(((e = a.column.search) == null ? void 0 : e.el) || "") && h("search");
256
+ };
257
+ return (e, g) => {
258
+ var _, b, r, i, P, T, v, F, D, Z, j;
259
+ return S(), I("div", aa, [
260
+ ((_ = e.column.search) == null ? void 0 : _.type) !== "custom" ? (S(), L(fe(((b = e.column.search) == null ? void 0 : b.render) ?? `el-${(r = e.column.search) == null ? void 0 : r.el}`), G({ key: 0 }, { ...p.value, ...V.value, searchParam: f.value, clearable: H.value, ...x.value }, {
261
+ modelValue: f.value[((i = e.column.search) == null ? void 0 : i.key) ?? u(A)(e.column.prop)],
262
+ "onUpdate:modelValue": g[0] || (g[0] = (K) => {
263
+ var N;
264
+ return f.value[((N = e.column.search) == null ? void 0 : N.key) ?? u(A)(e.column.prop)] = K;
265
+ }),
266
+ modelModifiers: { trim: !0 },
267
+ data: ((P = e.column.search) == null ? void 0 : P.el) === "tree-select" ? C.value : [],
268
+ options: o.value,
269
+ "prefix-icon": (v = (T = e.column.search) == null ? void 0 : T.props) == null ? void 0 : v.prefixIcon,
270
+ onChange: U,
271
+ onKeyup: pt(E, ["enter"])
272
+ }), me({
273
+ default: w(() => {
274
+ var K;
275
+ return [
276
+ ((K = e.column.search) == null ? void 0 : K.el) === "select" ? (S(!0), I(Y, { key: 0 }, ge(C.value, (N, ue) => (S(), L(fe("el-option"), {
277
+ key: ue,
278
+ label: N[y.value.label] ?? "",
279
+ value: N[y.value.value]
280
+ }, null, 8, ["label", "value"]))), 128)) : W(e.$slots, "default", { key: 1 }, void 0, !0)
281
+ ];
282
+ }),
283
+ _: 2
284
+ }, [
285
+ ((F = e.column.search) == null ? void 0 : F.el) === "cascader" ? {
286
+ name: "default",
287
+ fn: w(({ data: K }) => [
288
+ B("span", null, X(K[y.value.label]), 1)
289
+ ]),
290
+ key: "0"
291
+ } : void 0
292
+ ]), 1040, ["modelValue", "data", "options", "prefix-icon"])) : (S(), I(Y, { key: 1 }, [
293
+ ((D = e.column.search) == null ? void 0 : D.el) === "zhCascaderLoadMore" ? (S(), L(u(Nt), G({
294
+ key: 0,
295
+ modelValue: f.value[((Z = e.column.search) == null ? void 0 : Z.key) ?? u(A)(e.column.prop)],
296
+ "onUpdate:modelValue": g[1] || (g[1] = (K) => {
297
+ var N;
298
+ return f.value[((N = e.column.search) == null ? void 0 : N.key) ?? u(A)(e.column.prop)] = K;
299
+ }),
300
+ modelModifiers: { trim: !0 }
301
+ }, (j = e.column.search) == null ? void 0 : j.props), null, 16, ["modelValue"])) : M("", !0)
302
+ ], 64))
303
+ ]);
304
+ };
305
+ }
306
+ }), oa = /* @__PURE__ */ se(na, [["__scopeId", "data-v-5c18e8bc"]]), la = { class: "table-search" }, ra = { key: 0 }, sa = {
307
+ key: 0,
308
+ class: "operation"
309
+ }, ua = /* @__PURE__ */ le({
310
+ name: "SearchForm",
311
+ __name: "SearchForm",
312
+ props: {
313
+ columns: { default: () => [] },
314
+ searchParam: { default: () => ({}) },
315
+ search: {},
316
+ reset: {},
317
+ isShowResetBtn: { type: Boolean, default: !0 },
318
+ isShowSearchBtn: { type: Boolean, default: !0 }
319
+ },
320
+ setup(m) {
321
+ const d = m;
322
+ return (a, h) => (S(), I("div", la, [
323
+ k(u(Et), {
324
+ ref: "formRef",
325
+ model: a.searchParam,
326
+ class: "table-search--left",
327
+ onSubmit: h[0] || (h[0] = ht(() => {
328
+ }, ["prevent"]))
329
+ }, {
330
+ default: w(() => [
331
+ W(a.$slots, "default", {}, void 0, !0),
332
+ a.columns.length ? (S(), I(Y, { key: 0 }, [
333
+ (S(!0), I(Y, null, ge(a.columns, (f) => {
334
+ var y, t, C;
335
+ return S(), I(Y, {
336
+ key: f.prop
337
+ }, [
338
+ !u($t)((y = f.search) == null ? void 0 : y.isShow) || (t = f.search) != null && t.isShow ? (S(), I("div", ra, [
339
+ k(u(Bt), null, me({
340
+ default: w(() => [
341
+ k(oa, {
342
+ column: f,
343
+ "search-param": a.searchParam,
344
+ onSearch: a.search
345
+ }, null, 8, ["column", "search-param", "onSearch"])
346
+ ]),
347
+ _: 2
348
+ }, [
349
+ (C = f.search) != null && C.label ? {
350
+ name: "label",
351
+ fn: w(() => [
352
+ k(u(zt), { size: 4 }, {
353
+ default: w(() => {
354
+ var o, p;
355
+ return [
356
+ B("span", null, X(`${f.search.label}`), 1),
357
+ (o = f.search) != null && o.tooltip ? (S(), L(u(Ce), {
358
+ key: 0,
359
+ effect: "dark",
360
+ content: (p = f.search) == null ? void 0 : p.tooltip,
361
+ placement: "top"
362
+ }, {
363
+ default: w(() => h[1] || (h[1] = [
364
+ B("i", {
365
+ class: Ze("iconfont icon-yiwen")
366
+ }, null, -1)
367
+ ])),
368
+ _: 2
369
+ }, 1032, ["content"])) : M("", !0)
370
+ ];
371
+ }),
372
+ _: 2
373
+ }, 1024),
374
+ h[2] || (h[2] = B("span", null, ":", -1))
375
+ ]),
376
+ key: "0"
377
+ } : void 0
378
+ ]), 1024)
379
+ ])) : M("", !0)
380
+ ], 64);
381
+ }), 128)),
382
+ d.isShowSearchBtn ? (S(), L(u(Te), {
383
+ key: 0,
384
+ type: "primary",
385
+ class: "table-search--search-btn",
386
+ onClick: a.search
387
+ }, {
388
+ icon: w(() => h[3] || (h[3] = [
389
+ B("i", { class: "ztable-iconfont icon-zhihao-table-search" }, null, -1)
390
+ ])),
391
+ default: w(() => [
392
+ h[4] || (h[4] = Q(" 搜索 "))
393
+ ]),
394
+ _: 1
395
+ }, 8, ["onClick"])) : M("", !0)
396
+ ], 64)) : M("", !0)
397
+ ]),
398
+ _: 3
399
+ }, 8, ["model"]),
400
+ d.isShowResetBtn && a.columns.length ? (S(), I("div", sa, [
401
+ k(u(Ce), {
402
+ class: "box-item",
403
+ effect: "light",
404
+ content: "重置",
405
+ placement: "top"
406
+ }, {
407
+ default: w(() => [
408
+ k(u(Te), {
409
+ class: "table-search--reset-btn",
410
+ onClick: a.reset
411
+ }, {
412
+ icon: w(() => [
413
+ k(u(be), { size: 14 }, {
414
+ default: w(() => [
415
+ k(u(Mt))
416
+ ]),
417
+ _: 1
418
+ })
419
+ ]),
420
+ _: 1
421
+ }, 8, ["onClick"])
422
+ ]),
423
+ _: 1
424
+ })
425
+ ])) : M("", !0)
426
+ ]));
427
+ }
428
+ }), ia = /* @__PURE__ */ se(ua, [["__scopeId", "data-v-e524e82e"]]), ca = { class: "el-pagination__total zh-page-total" }, da = /* @__PURE__ */ le({
429
+ name: "Pagination",
430
+ __name: "tablePagination",
431
+ props: {
432
+ pageable: {},
433
+ handleSizeChange: { type: Function },
434
+ handleCurrentChange: { type: Function }
435
+ },
436
+ setup(m) {
437
+ return (d, a) => d.pageable.total ? (S(), L(u(It), {
438
+ key: 0,
439
+ class: "zh-pagination",
440
+ background: !0,
441
+ "current-page": d.pageable.page,
442
+ "page-size": d.pageable.size,
443
+ total: d.pageable.total,
444
+ teleported: !1,
445
+ layout: "slot, sizes, prev, pager, next, jumper",
446
+ onSizeChange: d.handleSizeChange,
447
+ onCurrentChange: d.handleCurrentChange
448
+ }, {
449
+ default: w(() => [
450
+ W(d.$slots, "zhPaginationLeftSlot", { pageable: d.pageable }, () => [
451
+ B("div", ca, "共" + X(d.pageable.total) + "条数据", 1)
452
+ ], !0)
453
+ ]),
454
+ _: 3
455
+ }, 8, ["current-page", "page-size", "total", "onSizeChange", "onCurrentChange"])) : M("", !0);
456
+ }
457
+ }), pa = /* @__PURE__ */ se(da, [["__scopeId", "data-v-5965b30c"]]);
458
+ function Pe(m) {
459
+ return typeof m == "function" || Object.prototype.toString.call(m) === "[object Object]" && !ft(m);
460
+ }
461
+ const ha = /* @__PURE__ */ le({
462
+ name: "TableColumn",
463
+ __name: "TableColumn",
464
+ props: {
465
+ column: {},
466
+ customColumn: {
467
+ type: Boolean
468
+ }
469
+ },
470
+ setup(m) {
471
+ const d = m, a = z(d.column), h = Ke(), f = Ue("enumMap", z(/* @__PURE__ */ new Map())), y = (o, p) => f.value.get(o.prop) && o.isFilterEnum ? Oe(he(p.row, o.prop), f.value.get(o.prop), o.fieldNames) : Gt(he(p.row, o.prop)), t = (o, p) => Oe(he(p.row, o.prop), f.value.get(o.prop), o.fieldNames, "tag"), C = (o) => k(Y, null, [o.isShow && k(re, G(o, {
472
+ "class-name": o.wrap && "table-column--wrap",
473
+ showOverflowTooltip: o.showOverflowTooltip ?? o.prop !== "operation"
474
+ }), {
475
+ default: (p) => {
476
+ var R, x, H;
477
+ let V;
478
+ if (o._children) return o._children.map((U) => C(U));
479
+ if (o.render) return o.render(p);
480
+ if (o.prop === "operation") {
481
+ if (!h[A(o.prop)]) {
482
+ a.value.width = 0;
483
+ return;
484
+ }
485
+ const U = ((x = (R = h[A(o.prop)](p)) == null ? void 0 : R.at(0)) == null ? void 0 : x.children) || [], E = (T) => Array.from(T).map((v) => {
486
+ var F, D;
487
+ return ((F = v.type) == null ? void 0 : F.name) === "ElButton" && v.children !== "v-if" ? v : (D = v.children) != null && D.length ? E(v.children) : null;
488
+ }).filter(Boolean).flat(), e = E(U), g = (T) => {
489
+ let v = "";
490
+ return T.forEach((F) => {
491
+ v += F.children.default()[0].children;
492
+ }), oe(v, 14) + 16 * (T.length > 0 ? T.length - 1 : 0);
493
+ }, _ = (T) => {
494
+ a.value.hasOperationMaxWidth || (a.value.width = 0, a.value.hasOperationMaxWidth = !0);
495
+ const v = a.value.width;
496
+ let F = 0;
497
+ T > 0 && (F = Math.round(T) + 32), F > Number.parseInt((v == null ? void 0 : v.toString()) || "0") && (a.value.width = F, a.value.hasOperationMaxWidth = !0);
498
+ };
499
+ if (e.length <= 3 || o.expandOperationButtons) {
500
+ const T = Math.ceil(g(e));
501
+ let v = T;
502
+ return d.customColumn && (v = e.length ? e.length === 1 ? T + 30 : T : 50), _(v), k("div", {
503
+ class: "operation-container all-action"
504
+ }, [h[A(o.prop)](p)]);
505
+ }
506
+ const b = [], r = e.slice(0, 2), i = k(Te, {
507
+ link: !0,
508
+ type: "primary"
509
+ }, {
510
+ default: () => [Q("更多")]
511
+ });
512
+ b.push(...r), b[3] = k(Ft, null, {
513
+ default: () => i,
514
+ dropdown: () => {
515
+ let T;
516
+ return k(Lt, null, Pe(T = e.slice(2).map((v) => k(Dt, null, Pe(v) ? v : {
517
+ default: () => [v]
518
+ }))) ? T : {
519
+ default: () => [T]
520
+ });
521
+ }
522
+ });
523
+ const P = g([...r, i]);
524
+ return _(P), k("div", {
525
+ class: "operation-container"
526
+ }, [b]);
527
+ }
528
+ return h[A(o.prop)] ? h[A(o.prop)](p) : o.tag ? k(xe, {
529
+ type: t(o, p)
530
+ }, Pe(V = y(o, p)) ? V : {
531
+ default: () => [V]
532
+ }) : o.click && y(o, p) !== ae ? k("span", {
533
+ class: "el-link el-link--primary scan-link",
534
+ onClick: function() {
535
+ o.click(p == null ? void 0 : p.row, p == null ? void 0 : p.$index);
536
+ }
537
+ }, [o.formatter ? o.formatter(p.row, p.column, p.row[o.prop], p.$index) : y(o, p)]) : k("span", {
538
+ class: ((H = Yt(he(p.row, o.prop), f.value.get(o.prop))) == null ? void 0 : H.state) || "text"
539
+ }, [o.formatter ? o.formatter(p.row, p.column, p.row[o.prop], p.$index) : y(o, p)]);
540
+ },
541
+ header: (p) => o.headerRender ? o.headerRender(p) : h[`${A(o.prop)}Header`] ? h[`${A(o.prop)}Header`](p) : o.label
542
+ })]);
543
+ return (o, p) => (S(), L(C, We(je(a.value)), null, 16));
544
+ }
545
+ }), fa = { class: "custom-column-dialog" }, ma = { class: "table-body" }, ga = { class: "name" }, va = {
546
+ key: 0,
547
+ class: "ml-10"
548
+ }, Ca = { class: "custom-width-label text" }, ba = {
549
+ key: 0,
550
+ class: "custom-width-input-box"
551
+ }, ya = { class: "custom-column-footer" }, Sa = { class: "flex-1" }, wa = /* @__PURE__ */ le({
552
+ name: "ColSetting",
553
+ __name: "ColSetting",
554
+ props: {
555
+ originTableColumns: { default: () => [] }
556
+ },
557
+ emits: ["close", "submit", "dragSort"],
558
+ setup(m, { expose: d, emit: a }) {
559
+ const h = z(), f = z(!1), y = m, t = z([]), C = z((/* @__PURE__ */ new Date()).getTime()), o = z(!1), p = z();
560
+ let V = z([]), R = z([]);
561
+ const x = (b) => {
562
+ R.value = b, V.value = [], t.value = b.filter((r) => (r.hideInCustomColumn && V.value.push(r), !r.hideInCustomColumn)), o.value = !0, ve(() => {
563
+ e();
564
+ });
565
+ }, H = (b) => {
566
+ f.value = b;
567
+ }, U = a, E = async () => {
568
+ R.value = J([...V.value, ...t.value]), U("submit", R.value), o.value = !1;
569
+ }, e = () => {
570
+ p.value && (p.value.destroy(), C.value = (/* @__PURE__ */ new Date()).getTime(), h.value.doLayout()), ve(() => {
571
+ const b = document.querySelector(".custom-column-dialog tbody");
572
+ p.value = He.create(b, {
573
+ handle: ".move",
574
+ animation: 300,
575
+ filter: ".operation",
576
+ onEnd({ newIndex: r, oldIndex: i }) {
577
+ if (!r && r !== 0 || !i && i !== 0) return;
578
+ let P = J(t.value);
579
+ const T = P[i];
580
+ if (r < i)
581
+ for (let v = r; v < i; v++)
582
+ P[v].order = String(Number(v) + 1);
583
+ else
584
+ for (let v = i + 1; v <= r; v++)
585
+ P[v].order = String(Number(v) - 1);
586
+ T.order = String(r), t.value = J(P);
587
+ }
588
+ });
589
+ });
590
+ }, g = () => {
591
+ const b = J(y.originTableColumns);
592
+ f.value ? (t.value = b, V.value = []) : t.value = t.value.map((r) => {
593
+ const i = t.value.find((P) => P.prop === r.prop);
594
+ return !(i != null && i.isShow) || i.prop === "operation" ? r : b.find((P) => P.prop === r.prop);
595
+ }), e();
596
+ }, _ = () => {
597
+ o.value = !1;
598
+ };
599
+ return d({
600
+ openColSetting: x
601
+ }), (b, r) => (S(), I("div", fa, [
602
+ k(qt, {
603
+ modelValue: o.value,
604
+ "onUpdate:modelValue": r[1] || (r[1] = (i) => o.value = i),
605
+ size: "middle"
606
+ }, {
607
+ header: w(() => r[2] || (r[2] = [
608
+ B("div", { class: "title" }, "自定义列", -1),
609
+ B("div", { class: "sub-title" }, "勾选需要展示的列,拖动列名进行排序", -1)
610
+ ])),
611
+ footer: w(() => [
612
+ B("div", ya, [
613
+ k(u(Le), {
614
+ modelValue: f.value,
615
+ "onUpdate:modelValue": r[0] || (r[0] = (i) => f.value = i),
616
+ class: "checkbox",
617
+ label: "全局",
618
+ onChange: H
619
+ }, null, 8, ["modelValue"]),
620
+ B("div", Sa, [
621
+ k(_e, { onClick: _ }, {
622
+ default: w(() => r[4] || (r[4] = [
623
+ Q("取消")
624
+ ])),
625
+ _: 1
626
+ }),
627
+ k(_e, {
628
+ class: "w-auto",
629
+ onClick: g
630
+ }, {
631
+ default: w(() => [
632
+ Q(X(f.value ? "全局恢复默认" : "恢复默认"), 1)
633
+ ]),
634
+ _: 1
635
+ }),
636
+ k(_e, {
637
+ type: "primary",
638
+ onClick: E
639
+ }, {
640
+ default: w(() => r[5] || (r[5] = [
641
+ Q("保存")
642
+ ])),
643
+ _: 1
644
+ })
645
+ ])
646
+ ])
647
+ ]),
648
+ default: w(() => [
649
+ B("div", ma, [
650
+ (S(), L(u(Je), {
651
+ ref_key: "tableRef",
652
+ ref: h,
653
+ class: "custom-colum-table",
654
+ key: C.value,
655
+ data: t.value.filter((i) => !i.hideInCustomColumn),
656
+ "row-class-name": (i) => i.row.prop === "operation" ? "operation" : ""
657
+ }, {
658
+ default: w(() => [
659
+ k(u(re), {
660
+ width: "100",
661
+ label: "选择"
662
+ }, {
663
+ default: w(({ row: i }) => [
664
+ k(u(Le), {
665
+ class: "custom-column-check",
666
+ modelValue: i.isShow,
667
+ "onUpdate:modelValue": (P) => i.isShow = P,
668
+ disabled: i.readonly
669
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
670
+ ]),
671
+ _: 1
672
+ }),
673
+ k(u(re), {
674
+ prop: "label",
675
+ label: "名称"
676
+ }, {
677
+ default: w(({ row: i }) => [
678
+ B("div", ga, [
679
+ Q(X(i.label) + " ", 1),
680
+ i.readonly ? (S(), I("span", va, "(必选)")) : M("", !0),
681
+ i.prop !== "operation" ? (S(), L(u(be), {
682
+ key: 1,
683
+ class: "move move-icon"
684
+ }, {
685
+ default: w(() => [
686
+ k(u(Vt))
687
+ ]),
688
+ _: 1
689
+ })) : M("", !0)
690
+ ])
691
+ ]),
692
+ _: 1
693
+ }),
694
+ k(u(re), {
695
+ prop: "width",
696
+ label: "宽度",
697
+ width: "180"
698
+ }, {
699
+ default: w(({ row: i }) => [
700
+ B("div", {
701
+ class: Ze(`custom-width-box ${i.readonly && "readonly"}`)
702
+ }, [
703
+ r[3] || (r[3] = B("span", { class: "text" }, "宽度", -1)),
704
+ B("span", Ca, X(i.width) + " px", 1),
705
+ i.readonly ? M("", !0) : (S(), I("div", ba, [
706
+ k(u(Ye), {
707
+ modelValue: i.width,
708
+ "onUpdate:modelValue": (P) => i.width = P,
709
+ class: "custom-width-input",
710
+ min: 10,
711
+ max: 1e3,
712
+ controls: !1
713
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
714
+ ]))
715
+ ], 2)
716
+ ]),
717
+ _: 1
718
+ })
719
+ ]),
720
+ _: 1
721
+ }, 8, ["data", "row-class-name"]))
722
+ ])
723
+ ]),
724
+ _: 1
725
+ }, 8, ["modelValue"])
726
+ ]));
727
+ }
728
+ }), ka = /* @__PURE__ */ se(wa, [["__scopeId", "data-v-282b9e9e"]]), _a = { class: "no-card table-main zh-table" }, Pa = { class: "table-title-container" }, Ta = {
729
+ key: 0,
730
+ class: "table-title"
731
+ }, Ea = {
732
+ key: 1,
733
+ class: "table-header-tip"
734
+ }, $a = { class: "table-header-container" }, Ba = {
735
+ key: 0,
736
+ class: "table-header"
737
+ }, za = { class: "header-button-ri" }, Ma = { key: 0 }, Ia = { class: "table-body-container" }, Fa = { class: "text d-flex inline-input-text pointer" }, La = {
738
+ key: 1,
739
+ class: "inline-input-box d-flex"
740
+ }, Da = { class: "table-empty" }, Va = ["src"], Ra = /* @__PURE__ */ le({
741
+ name: "ZhTable",
742
+ __name: "Table",
743
+ props: {
744
+ columns: { default: () => [] },
745
+ data: {},
746
+ requestApi: {},
747
+ requestAuto: { type: Boolean, default: !0 },
748
+ requestError: { type: Function, default: (m) => {
749
+ console.error("protable中请求数据错误", m);
750
+ } },
751
+ handleParam: {},
752
+ dataCallback: {},
753
+ selectChangeCallback: {},
754
+ title: {},
755
+ pagination: { type: Boolean, default: !0 },
756
+ initParam: { default: {} },
757
+ border: { type: Boolean, default: !1 },
758
+ rowKey: { type: [String, Function], default: "id" },
759
+ isShowSearch: { type: Boolean, default: !0 },
760
+ maxHeight: {},
761
+ isShowSearchBtn: { type: Boolean, default: !0 },
762
+ isShowResetBtn: { type: Boolean, default: !0 },
763
+ customColumn: { type: Boolean, default: !1 },
764
+ onSortChange: {},
765
+ offset: {},
766
+ customColumnCacheKey: {},
767
+ customColumnPageCacheKey: {},
768
+ beforeReset: {},
769
+ searchClearSelection: { type: Boolean, default: !0 }
770
+ },
771
+ emits: ["search", "reset", "dargSort"],
772
+ setup(m, { expose: d, emit: a }) {
773
+ var Fe;
774
+ const h = z((/* @__PURE__ */ new Date()).getTime()), f = {
775
+ mounted(n) {
776
+ var s;
777
+ (s = n.querySelector("input")) == null || s.focus();
778
+ }
779
+ }, y = Ke(), t = m, C = z(), o = ["selection", "radio", "index", "expand", "sort", "input"], p = z(t.isShowSearch), V = z(""), R = z({}), x = z(t.maxHeight), { selectionChange: H, selectedList: U, selectedListIds: E, isSelected: e } = ta(t.rowKey, t.selectChangeCallback), {
780
+ loading: g,
781
+ tableData: _,
782
+ pageable: b,
783
+ searchParam: r,
784
+ searchInitParam: i,
785
+ getTableList: P,
786
+ search: T,
787
+ reset: v,
788
+ handleSizeChange: F,
789
+ handleCurrentChange: D
790
+ } = ea(t.requestApi, t.initParam, t.pagination, t.dataCallback, t.requestError, t.handleParam), Z = (n) => {
791
+ function s(it) {
792
+ return it.replace(/[A-Z]/g, (ct) => "_" + ct.toLowerCase());
793
+ }
794
+ const c = {
795
+ ascending: "asc",
796
+ descending: "desc"
797
+ }, { prop: l, order: $ } = n, q = s(A(l)), pe = c[$];
798
+ r.value = {
799
+ ...r.value,
800
+ sortKey: q,
801
+ sortOrder: pe
802
+ }, b.value.page = 1, T();
803
+ }, j = () => C.value.clearSelection(), K = () => C.value.clearSort(), N = z(!1), ue = () => {
804
+ at(), t.customColumn && st(), t.requestAuto && P(), t.data && (b.value.total = t.data.length);
805
+ };
806
+ mt(() => {
807
+ ue(), ve(() => {
808
+ N.value = !0;
809
+ });
810
+ }), gt(() => {
811
+ N.value && ue();
812
+ }), vt(() => {
813
+ }), Ct(() => {
814
+ });
815
+ const ie = O(() => t.data ? t.pagination ? t.data.slice((b.value.page - 1) * b.value.size, b.value.size * b.value.page) : t.data : _.value), Ge = (n) => {
816
+ b.value.total = n;
817
+ };
818
+ bt(() => t.initParam, P, { deep: !0 });
819
+ let ne = te(t.columns);
820
+ const Qe = O(() => $e(ne)), ee = z(/* @__PURE__ */ new Map()), Xe = async ({ prop: n, enum: s }) => {
821
+ if (!s || ee.value.has(n) && (typeof s == "function" || ee.value.get(n) === s)) return;
822
+ if (typeof s != "function") return ee.value.set(n, u(s));
823
+ ee.value.set(n, []);
824
+ const { data: c } = await s();
825
+ ee.value.set(n, c);
826
+ };
827
+ yt("enumMap", ee);
828
+ const $e = (n, s = []) => (n.forEach(async (c) => {
829
+ var l;
830
+ (l = c._children) != null && l.length && s.push(...$e(c._children)), s.push(c), c.isShow = c.isShow ?? !0, c.isFilterEnum = c.isFilterEnum ?? !0, await Xe(c);
831
+ }), s.filter((c) => {
832
+ var l;
833
+ return !((l = c._children) != null && l.length);
834
+ })), Be = O(() => {
835
+ var n;
836
+ return (n = Qe.value) == null ? void 0 : n.filter((s) => {
837
+ var c, l;
838
+ return ((c = s.search) == null ? void 0 : c.el) || ((l = s.search) == null ? void 0 : l.render);
839
+ }).sort((s, c) => s.search.order - c.search.order);
840
+ });
841
+ (Fe = Be.value) == null || Fe.forEach((n, s) => {
842
+ var $, q, pe;
843
+ n.search.order = (($ = n.search) == null ? void 0 : $.order) ?? s + 2;
844
+ const c = ((q = n.search) == null ? void 0 : q.key) ?? A(n.prop), l = (pe = n.search) == null ? void 0 : pe.defaultValue;
845
+ l != null && (i.value[c] = l, r.value[c] = l);
846
+ });
847
+ const ye = a, et = () => {
848
+ var n;
849
+ t.searchClearSelection && ((n = C.value) == null || n.clearSelection()), T(), ye("search");
850
+ }, tt = () => {
851
+ t.beforeReset && t.beforeReset(), v(), K(), ye("reset");
852
+ }, at = () => {
853
+ const n = document.querySelector(".el-table__body-wrapper tbody");
854
+ n && He.create(n, {
855
+ handle: ".move",
856
+ animation: 300,
857
+ onEnd({ newIndex: s, oldIndex: c }) {
858
+ const [l] = ie.value.splice(c, 1);
859
+ ie.value.splice(s, 0, l), ye("dargSort", { newIndex: s, oldIndex: c });
860
+ }
861
+ });
862
+ }, ce = z(0), nt = (n, s) => {
863
+ const c = _.value.findIndex((l) => l.$showInput);
864
+ c > -1 && (_.value[c] = J(R.value), _.value[c].$showInput = !1), ce.value = Re(n, String(s)), n.$showInput = !0, R.value = J(n);
865
+ }, ot = async (n, s, c) => {
866
+ Zt(n, s, ce.value), c && await c(n), n.$showInput = !1, Kt.success("更新成功"), await P();
867
+ }, lt = async (n) => {
868
+ const s = _.value.findIndex((c) => Wt(De(c, Ve), De(n, Ve)));
869
+ s > -1 && (_.value[s] = J(R.value), _.value[s].$showInput = !1);
870
+ }, ze = Qt(t.customColumnCacheKey), Me = z(null), Se = () => ne.map(
871
+ (n, s) => ({
872
+ readonly: n.isCustomDisable || ["id", "operation"].includes(String(n.prop)),
873
+ hideInCustomColumn: n.hideInCustomColumn || n.type === "selection",
874
+ order: s,
875
+ // originIndex: index,
876
+ width: n.width || n.minWidth,
877
+ ...n
878
+ })
879
+ ).sort((n, s) => {
880
+ const c = Number(n.order), l = Number(s.order);
881
+ return c - l;
882
+ }), rt = () => {
883
+ de = te(Se()), ve(() => {
884
+ Me.value.openColSetting(J(de));
885
+ });
886
+ }, st = () => {
887
+ if (!t.customColumnPageCacheKey) return;
888
+ const n = ze.getColumnCache(t.customColumnPageCacheKey);
889
+ if (n != null && n.length) {
890
+ const s = ne.map((c) => {
891
+ const l = n.find(($) => $.prop === c.prop);
892
+ if (l) {
893
+ const $ = {
894
+ ...c,
895
+ order: l.order || c.order,
896
+ isShow: l.isShow !== void 0 ? l.isShow : c.isShow,
897
+ readonly: l.readonly !== void 0 ? l.readonly : c.readonly,
898
+ prop: l.prop || c.prop,
899
+ index: l.index || c.index
900
+ };
901
+ return c.minWidth && ($.minWidth = l.minWidth || c.minWidth), c.width && ($.width = l.width || c.width), $;
902
+ }
903
+ return c;
904
+ });
905
+ de = te(s), ne = te(de);
906
+ }
907
+ };
908
+ let de = te(Se());
909
+ const Ie = J(Se()), ut = (n) => {
910
+ if (!t.customColumnPageCacheKey) return console.error("请添加自定义列缓存配置项:customColumnPageCacheKey");
911
+ n = n.map((s) => {
912
+ const c = Ie.find((l) => l.prop === s.prop);
913
+ return c && c.minWidth && (s.minWidth = s.width, delete s.width), s;
914
+ }), ne = te(J(n)), ze.setColumnCache(t.customColumnPageCacheKey, n), h.value = (/* @__PURE__ */ new Date()).getTime(), C.value.doLayout();
915
+ };
916
+ return d({
917
+ element: C,
918
+ tableData: ie,
919
+ radio: V,
920
+ pageable: b,
921
+ searchParam: r,
922
+ searchInitParam: i,
923
+ setPageTotal: Ge,
924
+ getTableList: P,
925
+ search: T,
926
+ reset: v,
927
+ handleSizeChange: F,
928
+ handleCurrentChange: D,
929
+ clearSelection: j,
930
+ enumMap: ee,
931
+ isSelected: e,
932
+ selectedList: U,
933
+ selectedListIds: E
934
+ }), (n, s) => {
935
+ const c = St("loading");
936
+ return S(), L(u(Rt), { locale: u(Ot) }, {
937
+ default: w(() => [
938
+ B("div", _a, [
939
+ B("div", Pa, [
940
+ n.title ? (S(), I("div", Ta, X(n.title), 1)) : M("", !0),
941
+ u(y).headerTip ? (S(), I("div", Ea, [
942
+ W(n.$slots, "headerTip", {}, void 0, !0)
943
+ ])) : M("", !0)
944
+ ]),
945
+ B("div", $a, [
946
+ we(k(ia, {
947
+ search: et,
948
+ reset: tt,
949
+ columns: Be.value,
950
+ "search-param": u(r),
951
+ "is-show-reset-btn": t.isShowResetBtn,
952
+ "is-show-search-btn": t.isShowSearchBtn
953
+ }, {
954
+ default: w(() => [
955
+ n.$slots.tableHeader ? (S(), I("div", Ba, [
956
+ B("div", za, [
957
+ W(n.$slots, "tableHeader", {
958
+ selectedList: u(U),
959
+ selectedListIds: u(E),
960
+ isSelected: u(e)
961
+ }, void 0, !0)
962
+ ])
963
+ ])) : M("", !0)
964
+ ]),
965
+ _: 3
966
+ }, 8, ["columns", "search-param", "is-show-reset-btn", "is-show-search-btn"]), [
967
+ [wt, p.value]
968
+ ])
969
+ ]),
970
+ u(y).searchBarBottom ? (S(), I("div", Ma, [
971
+ W(n.$slots, "searchBarBottom", {}, void 0, !0)
972
+ ])) : M("", !0),
973
+ B("div", Ia, [
974
+ t.customColumn ? (S(), I("div", {
975
+ key: 0,
976
+ class: "col-setting-button",
977
+ onClick: rt
978
+ }, [
979
+ k(u(Ce), {
980
+ class: "box-item",
981
+ effect: "dark",
982
+ content: "自定义列",
983
+ placement: "top"
984
+ }, {
985
+ default: w(() => [
986
+ k(u(be), {
987
+ size: 16,
988
+ color: "#000000a6"
989
+ }, {
990
+ default: w(() => [
991
+ k(u(At))
992
+ ]),
993
+ _: 1
994
+ })
995
+ ]),
996
+ _: 1
997
+ })
998
+ ])) : M("", !0),
999
+ we((S(), L(u(Je), G({
1000
+ ref_key: "tableRef",
1001
+ ref: C
1002
+ }, n.$attrs, {
1003
+ key: h.value,
1004
+ data: ie.value,
1005
+ border: n.border,
1006
+ "row-key": n.rowKey,
1007
+ "max-height": x.value,
1008
+ "row-style": { height: "42px" },
1009
+ "tooltip-effect": "light",
1010
+ "tooltip-options": { showArrow: !1, placement: "bottom-start", offset: t.offset ? t.offset : -20 },
1011
+ "element-loading-spinner": u(Xt),
1012
+ "element-loading-svg-view-box": "0 0 64 64"
1013
+ }, kt(n.$attrs), {
1014
+ onSelectionChange: u(H),
1015
+ onSortChange: s[1] || (s[1] = (l) => t.onSortChange ? t.onSortChange(l) : Z(l))
1016
+ }), {
1017
+ append: w(() => [
1018
+ W(n.$slots, "append", {}, void 0, !0)
1019
+ ]),
1020
+ empty: w(() => [
1021
+ B("div", Da, [
1022
+ W(n.$slots, "empty", {}, () => [
1023
+ B("img", {
1024
+ src: `${u(jt)}ghy-components/empty.png`,
1025
+ class: "zh-empty-img",
1026
+ alt: "notData"
1027
+ }, null, 8, Va),
1028
+ s[5] || (s[5] = B("div", null, "暂无数据", -1))
1029
+ ], !0)
1030
+ ])
1031
+ ]),
1032
+ default: w(() => [
1033
+ (S(!0), I(Y, null, ge(u(ne).sort((l, $) => l.order - $.order), (l) => (S(), I(Y, { key: l }, [
1034
+ l.type && o.includes(l.type) && l.isShow ? (S(), L(u(re), G({
1035
+ key: 0,
1036
+ ref_for: !0
1037
+ }, l, {
1038
+ align: l.align ?? "left",
1039
+ "reserve-selection": l.type == "selection"
1040
+ }), me({
1041
+ default: w(($) => [
1042
+ l.type == "expand" ? (S(), I(Y, { key: 0 }, [
1043
+ l.render ? (S(), L(fe(l.render), G({
1044
+ key: 0,
1045
+ ref_for: !0
1046
+ }, $), null, 16)) : W(n.$slots, l.type, G({
1047
+ key: 1,
1048
+ ref_for: !0
1049
+ }, $), void 0, !0)
1050
+ ], 64)) : M("", !0),
1051
+ l.type == "sort" ? (S(), L(u(xe), {
1052
+ key: 1,
1053
+ class: "move"
1054
+ }, {
1055
+ default: w(() => [
1056
+ k(u(be), null, {
1057
+ default: w(() => [
1058
+ k(u(Ut))
1059
+ ]),
1060
+ _: 1
1061
+ })
1062
+ ]),
1063
+ _: 1
1064
+ })) : M("", !0),
1065
+ l.type == "input" ? (S(), I(Y, { key: 2 }, [
1066
+ $.row.$showInput ? (S(), I("div", La, [
1067
+ we(k(u(Ye), {
1068
+ modelValue: ce.value,
1069
+ "onUpdate:modelValue": s[0] || (s[0] = (q) => ce.value = q),
1070
+ min: 0,
1071
+ controls: !1
1072
+ }, null, 8, ["modelValue"]), [
1073
+ [f]
1074
+ ]),
1075
+ k(u(ke), {
1076
+ underline: !1,
1077
+ type: "primary",
1078
+ onClick: (q) => ot($.row, String(l.prop), l.blurCallback),
1079
+ class: "ml-5"
1080
+ }, {
1081
+ default: w(() => s[3] || (s[3] = [
1082
+ Q(" 保存 ")
1083
+ ])),
1084
+ _: 2
1085
+ }, 1032, ["onClick"]),
1086
+ k(u(ke), {
1087
+ type: "primary",
1088
+ underline: !1,
1089
+ onClick: (q) => lt($.row),
1090
+ class: "ml-5"
1091
+ }, {
1092
+ default: w(() => s[4] || (s[4] = [
1093
+ Q(" 取消 ")
1094
+ ])),
1095
+ _: 2
1096
+ }, 1032, ["onClick"])
1097
+ ])) : (S(), L(u(Ce), {
1098
+ key: 0,
1099
+ content: "编辑",
1100
+ placement: "top"
1101
+ }, {
1102
+ default: w(() => [
1103
+ B("span", Fa, [
1104
+ Q(X(u(Re)($.row, String(l.prop))) + " ", 1),
1105
+ k(u(ke), {
1106
+ underline: !1,
1107
+ class: "text d-flex inline-input-text pointer",
1108
+ onClick: (q) => nt($.row, l.prop)
1109
+ }, {
1110
+ default: w(() => s[2] || (s[2] = [
1111
+ B("i", { class: "iconfont icon-edit" }, null, -1)
1112
+ ])),
1113
+ _: 2
1114
+ }, 1032, ["onClick"])
1115
+ ])
1116
+ ]),
1117
+ _: 2
1118
+ }, 1024))
1119
+ ], 64)) : M("", !0)
1120
+ ]),
1121
+ _: 2
1122
+ }, [
1123
+ l.headerRender ? {
1124
+ name: "header",
1125
+ fn: w(($) => [
1126
+ (S(), L(fe(l.headerRender), G({ ref_for: !0 }, $), null, 16))
1127
+ ]),
1128
+ key: "0"
1129
+ } : void 0
1130
+ ]), 1040, ["align", "reserve-selection"])) : M("", !0),
1131
+ !l.type && l.prop && l.isShow ? (S(), L(ha, {
1132
+ key: 1,
1133
+ column: l,
1134
+ "custom-column": n.customColumn
1135
+ }, me({ _: 2 }, [
1136
+ ge(Object.keys(n.$slots), ($) => ({
1137
+ name: $,
1138
+ fn: w((q) => [
1139
+ W(n.$slots, $, G({ ref_for: !0 }, q), void 0, !0)
1140
+ ])
1141
+ }))
1142
+ ]), 1032, ["column", "custom-column"])) : M("", !0)
1143
+ ], 64))), 128))
1144
+ ]),
1145
+ _: 3
1146
+ }, 16, ["data", "border", "row-key", "max-height", "tooltip-options", "element-loading-spinner", "onSelectionChange"])), [
1147
+ [c, u(g)]
1148
+ ])
1149
+ ]),
1150
+ W(n.$slots, "pagination", {}, () => [
1151
+ n.pagination ? (S(), L(pa, {
1152
+ key: 0,
1153
+ pageable: u(b),
1154
+ "handle-size-change": u(F),
1155
+ "handle-current-change": u(D)
1156
+ }, {
1157
+ zhPaginationLeftSlot: w((l) => [
1158
+ W(n.$slots, "zhPaginationLeft", We(je(l)), void 0, !0)
1159
+ ]),
1160
+ _: 3
1161
+ }, 8, ["pageable", "handle-size-change", "handle-current-change"])) : M("", !0)
1162
+ ], !0)
1163
+ ]),
1164
+ t.customColumn ? (S(), L(ka, {
1165
+ key: 0,
1166
+ ref_key: "colRef",
1167
+ ref: Me,
1168
+ "origin-table-columns": u(Ie),
1169
+ onSubmit: ut
1170
+ }, null, 8, ["origin-table-columns"])) : M("", !0)
1171
+ ]),
1172
+ _: 3
1173
+ }, 8, ["locale"]);
1174
+ };
1175
+ }
1176
+ }), Oa = /* @__PURE__ */ se(Ra, [["__scopeId", "data-v-0e17ca20"]]), qa = xt(Oa);
1177
+ export {
1178
+ qa as Z,
1179
+ oe as g
1180
+ };