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