ele-scroll-table-vue3 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,891 @@
|
|
|
1
|
+
import { resolveComponent as f, openBlock as s, createBlock as $, mergeProps as te, createSlots as he, withCtx as c, createElementBlock as u, Fragment as _, renderList as z, renderSlot as g, createTextVNode as P, toDisplayString as U, createCommentVNode as p, isRef as ge, useTemplateRef as fe, useSlots as Ne, computed as O, ref as Q, watch as re, getCurrentInstance as xe, onMounted as Oe, onBeforeUnmount as Re, createStaticVNode as je, createElementVNode as T, createVNode as L, normalizeClass as ie, unref as Y, toHandlers as Ee, withDirectives as Ve } from "vue";
|
|
2
|
+
import { ElMessage as me } from "element-plus";
|
|
3
|
+
import { useStorage as Fe } from "@vueuse/core";
|
|
4
|
+
import { EPlusResizeDialog as Ue } from "e-plus-dialog-vue3";
|
|
5
|
+
const Me = (a, v = {}) => {
|
|
6
|
+
const { onStart: w } = v;
|
|
7
|
+
let o = null;
|
|
8
|
+
const d = () => {
|
|
9
|
+
var K;
|
|
10
|
+
const D = (K = a.value) == null ? void 0 : K.$el;
|
|
11
|
+
if (!D) return null;
|
|
12
|
+
const k = D.querySelector(".el-table__body-wrapper .el-scrollbar__wrap") || D.querySelector(".el-table__body-wrapper");
|
|
13
|
+
if (!k) return null;
|
|
14
|
+
let C = !1, V = 0, j = 0;
|
|
15
|
+
const A = (B) => {
|
|
16
|
+
B.button === 1 && (B.preventDefault(), w == null || w(), C = !0, V = B.clientX, j = k.scrollLeft, D.style.cursor = "grabbing", document.body.style.userSelect = "none");
|
|
17
|
+
}, E = () => {
|
|
18
|
+
C && (C = !1, D.style.cursor = "", document.body.style.userSelect = "");
|
|
19
|
+
}, F = (B) => {
|
|
20
|
+
if (!C) return;
|
|
21
|
+
B.preventDefault();
|
|
22
|
+
const l = B.clientX - V;
|
|
23
|
+
k.scrollLeft = j - l;
|
|
24
|
+
}, H = () => {
|
|
25
|
+
E();
|
|
26
|
+
}, I = D.querySelector(".el-table__body-wrapper");
|
|
27
|
+
return I && I.addEventListener("mousedown", A), window.addEventListener("mousemove", F), window.addEventListener("mouseup", H), window.addEventListener("blur", E), window.addEventListener("mouseleave", E), () => {
|
|
28
|
+
I && I.removeEventListener("mousedown", A), window.removeEventListener("mousemove", F), window.removeEventListener("mouseup", H), window.removeEventListener("blur", E), window.removeEventListener("mouseleave", E);
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
return { start: () => {
|
|
32
|
+
o = d();
|
|
33
|
+
}, stop: () => {
|
|
34
|
+
o && o(), o = null;
|
|
35
|
+
} };
|
|
36
|
+
}, Pe = {
|
|
37
|
+
__name: "TableColumn",
|
|
38
|
+
props: {
|
|
39
|
+
item: {
|
|
40
|
+
type: Object,
|
|
41
|
+
default: () => {
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
align: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: "center"
|
|
47
|
+
},
|
|
48
|
+
hideItems: {
|
|
49
|
+
type: [Array, Object],
|
|
50
|
+
default: () => ({})
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
setup(a) {
|
|
54
|
+
const v = a, w = (d) => {
|
|
55
|
+
let b = !1;
|
|
56
|
+
return ge(v.hideItems) ? v.hideItems.value.includes(d.prop) && (b = !0) : Array.isArray(v.hideItems) && v.hideItems.includes(d.prop) && (b = !0), b;
|
|
57
|
+
}, o = (d) => d.charAt(0).toUpperCase() + d.slice(1);
|
|
58
|
+
return (d, b) => {
|
|
59
|
+
const R = f("TableColumn", !0), D = f("el-table-column");
|
|
60
|
+
return !w(a.item) && !a.item.hide ? (s(), $(D, te({
|
|
61
|
+
key: 0,
|
|
62
|
+
border: "",
|
|
63
|
+
align: a.align
|
|
64
|
+
}, a.item), he({
|
|
65
|
+
header: c(({ column: k, index: C }) => [
|
|
66
|
+
g(d.$slots, `${a.item.slotName}Header`, {
|
|
67
|
+
backData: { column: k, index: C }
|
|
68
|
+
}, () => [
|
|
69
|
+
P(U(a.item.label), 1)
|
|
70
|
+
])
|
|
71
|
+
]),
|
|
72
|
+
default: c((k) => [
|
|
73
|
+
a.item.merges ? (s(!0), u(_, { key: 0 }, z(a.item.merges, (C) => (s(), $(R, {
|
|
74
|
+
item: C,
|
|
75
|
+
hideItems: a.hideItems,
|
|
76
|
+
align: a.align
|
|
77
|
+
}, he({ _: 2 }, [
|
|
78
|
+
z(d.$slots, (V, j) => ({
|
|
79
|
+
name: j,
|
|
80
|
+
fn: c((A) => [
|
|
81
|
+
g(d.$slots, j, te({ ref_for: !0 }, A))
|
|
82
|
+
])
|
|
83
|
+
}))
|
|
84
|
+
]), 1032, ["item", "hideItems", "align"]))), 256)) : g(d.$slots, a.item.slotName, {
|
|
85
|
+
key: 1,
|
|
86
|
+
backData: k.row,
|
|
87
|
+
currentItem: a.item
|
|
88
|
+
}, () => [
|
|
89
|
+
a.item.prop ? (s(), u(_, { key: 0 }, [
|
|
90
|
+
P(U(k.row[a.item.prop]), 1)
|
|
91
|
+
], 64)) : p("", !0)
|
|
92
|
+
])
|
|
93
|
+
]),
|
|
94
|
+
_: 2
|
|
95
|
+
}, [
|
|
96
|
+
z(a.item.slotNames, (k) => ({
|
|
97
|
+
name: k,
|
|
98
|
+
fn: c((C) => [
|
|
99
|
+
g(d.$slots, `${a.item.prop}` + o(k), { backData: C })
|
|
100
|
+
])
|
|
101
|
+
}))
|
|
102
|
+
]), 1040, ["align"])) : p("", !0);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}, ke = (a, v) => {
|
|
106
|
+
const w = a.__vccOpts || a;
|
|
107
|
+
for (const [o, d] of v)
|
|
108
|
+
w[o] = d;
|
|
109
|
+
return w;
|
|
110
|
+
}, Ke = { class: "baseTable" }, qe = { class: "handle" }, We = { class: "handleRight" }, Xe = {
|
|
111
|
+
key: 0,
|
|
112
|
+
class: "table-search-button-group"
|
|
113
|
+
}, Je = { class: "column-setting-body" }, Ge = /* @__PURE__ */ Object.assign({ name: "BaseTable" }, {
|
|
114
|
+
__name: "Table",
|
|
115
|
+
props: {
|
|
116
|
+
border: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
default: !0
|
|
119
|
+
},
|
|
120
|
+
dataList: {
|
|
121
|
+
// 数据
|
|
122
|
+
type: Array,
|
|
123
|
+
default: () => []
|
|
124
|
+
},
|
|
125
|
+
tableItem: {
|
|
126
|
+
// 每列的名字
|
|
127
|
+
type: Array,
|
|
128
|
+
default: () => []
|
|
129
|
+
},
|
|
130
|
+
tableListener: {
|
|
131
|
+
type: Object,
|
|
132
|
+
default: () => ({})
|
|
133
|
+
},
|
|
134
|
+
showChoose: {
|
|
135
|
+
// 是否展示复选框
|
|
136
|
+
type: Boolean,
|
|
137
|
+
default: !1
|
|
138
|
+
},
|
|
139
|
+
showIndex: {
|
|
140
|
+
// 是否展示序号
|
|
141
|
+
type: Boolean,
|
|
142
|
+
default: !1
|
|
143
|
+
},
|
|
144
|
+
pagination: {
|
|
145
|
+
// 是否显示分页
|
|
146
|
+
type: Boolean,
|
|
147
|
+
default: !0
|
|
148
|
+
},
|
|
149
|
+
listCount: {
|
|
150
|
+
//总条数
|
|
151
|
+
type: Number,
|
|
152
|
+
default: 0
|
|
153
|
+
},
|
|
154
|
+
paginationInfo: {
|
|
155
|
+
// 分页的页码和偏移
|
|
156
|
+
type: Object,
|
|
157
|
+
default: () => ({ pageNum: 1, pageSize: 50 })
|
|
158
|
+
},
|
|
159
|
+
elTableConfig: {
|
|
160
|
+
type: Object,
|
|
161
|
+
default: () => ({})
|
|
162
|
+
},
|
|
163
|
+
showExpand: {
|
|
164
|
+
type: Boolean,
|
|
165
|
+
default: !1
|
|
166
|
+
},
|
|
167
|
+
align: {
|
|
168
|
+
type: String,
|
|
169
|
+
default: "center"
|
|
170
|
+
},
|
|
171
|
+
paginationLayout: {
|
|
172
|
+
type: String,
|
|
173
|
+
default: "total, sizes, prev, pager, next, jumper"
|
|
174
|
+
},
|
|
175
|
+
hideItems: {
|
|
176
|
+
type: [Array, Object],
|
|
177
|
+
default: () => ({})
|
|
178
|
+
},
|
|
179
|
+
maxHeight: {
|
|
180
|
+
type: [Number, String]
|
|
181
|
+
},
|
|
182
|
+
selectionConfig: {
|
|
183
|
+
type: Object,
|
|
184
|
+
default: () => ({})
|
|
185
|
+
},
|
|
186
|
+
autoResize: {
|
|
187
|
+
type: Boolean,
|
|
188
|
+
default: !0
|
|
189
|
+
},
|
|
190
|
+
dragTipScope: {
|
|
191
|
+
type: String,
|
|
192
|
+
default: "global"
|
|
193
|
+
},
|
|
194
|
+
dragTipStorageKey: {
|
|
195
|
+
type: String
|
|
196
|
+
},
|
|
197
|
+
headerButtons: {
|
|
198
|
+
type: Array,
|
|
199
|
+
default: () => ["columnDisplay", "comSearch"]
|
|
200
|
+
},
|
|
201
|
+
columnDisplayThreshold: {
|
|
202
|
+
type: Number,
|
|
203
|
+
default: 12
|
|
204
|
+
},
|
|
205
|
+
enableDblclickCopy: {
|
|
206
|
+
type: Boolean,
|
|
207
|
+
default: !0
|
|
208
|
+
},
|
|
209
|
+
copyFeedback: {
|
|
210
|
+
type: Boolean,
|
|
211
|
+
default: !0
|
|
212
|
+
},
|
|
213
|
+
copyLocale: {
|
|
214
|
+
type: Object,
|
|
215
|
+
default: () => ({
|
|
216
|
+
success: "已复制",
|
|
217
|
+
failed: "复制失败",
|
|
218
|
+
empty: "无可复制内容"
|
|
219
|
+
})
|
|
220
|
+
},
|
|
221
|
+
persistenceColumn: {
|
|
222
|
+
type: Boolean,
|
|
223
|
+
default: !0
|
|
224
|
+
},
|
|
225
|
+
persistenceKey: {
|
|
226
|
+
type: String,
|
|
227
|
+
default: ""
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
emits: ["update:paginationInfo", "sortChange", "toggleSearch"],
|
|
231
|
+
setup(a, { expose: v, emit: w }) {
|
|
232
|
+
const o = a, d = w, b = fe("elTableRef"), R = fe("headerRef"), D = fe("footerRef"), k = Ne(), C = (e) => {
|
|
233
|
+
b.value.setScrollTop(0), d("update:paginationInfo", { ...o.paginationInfo, pageNum: e });
|
|
234
|
+
}, V = (e) => {
|
|
235
|
+
b.value.setScrollTop(0), d("sortChange", e);
|
|
236
|
+
}, j = (e) => {
|
|
237
|
+
b.value.setScrollTop(0), d("update:paginationInfo", {
|
|
238
|
+
...o.paginationInfo,
|
|
239
|
+
pageSize: e
|
|
240
|
+
});
|
|
241
|
+
}, A = (e) => e.charAt(0).toUpperCase() + e.slice(1), E = (e, t) => t.some((n) => e.hasOwnProperty(n)), F = O(() => {
|
|
242
|
+
var n;
|
|
243
|
+
let e = 0;
|
|
244
|
+
const t = ((n = D.value) == null ? void 0 : n.clientHeight) ?? 0;
|
|
245
|
+
return R.value && (e = R.value.clientHeight), o.maxHeight ? o.maxHeight - e - t : o.autoResize ? window.innerHeight - 260 - e - t : void 0;
|
|
246
|
+
});
|
|
247
|
+
let H = !1;
|
|
248
|
+
const I = (e, t) => {
|
|
249
|
+
for (const n in e)
|
|
250
|
+
b.value.toggleRowExpansion(e[n], t), e[n].children && I(e[n].children, t);
|
|
251
|
+
}, K = (...e) => {
|
|
252
|
+
e ? (H = e[0], I(o.dataList, H)) : (H = !H, I(o.dataList, H));
|
|
253
|
+
}, B = window.isSmallScreen, l = O(() => B ? "total, prev, pager, next" : o.paginationLayout), S = Q([]), Z = () => {
|
|
254
|
+
const e = ["handleLeft", "handleRight"], t = Object.keys(k);
|
|
255
|
+
S.value = t.filter((n) => !e.includes(n));
|
|
256
|
+
}, ae = (e) => {
|
|
257
|
+
let t = e;
|
|
258
|
+
return ge(t) && (t = t.value), Array.isArray(t) ? t.filter(Boolean) : t && typeof t == "object" ? Object.keys(t).filter((n) => t[n]) : [];
|
|
259
|
+
}, oe = O(() => new Set(ae(o.hideItems))), q = O(() => o.persistenceKey && o.persistenceKey.trim() || null), N = Q([]), W = Q(!1), X = Q(!1), ue = O(() => {
|
|
260
|
+
var e;
|
|
261
|
+
return E(k, ["handleLeft", "handleRight"]) || (((e = o.headerButtons) == null ? void 0 : e.length) ?? 0) > 0;
|
|
262
|
+
}), m = () => {
|
|
263
|
+
const e = (o.tableItem || []).filter((i) => (i == null ? void 0 : i.prop) && !i.hide), t = e.filter((i) => !oe.value.has(i.prop)).map((i) => i.prop);
|
|
264
|
+
let n = null;
|
|
265
|
+
if (o.persistenceColumn && q.value)
|
|
266
|
+
try {
|
|
267
|
+
const i = localStorage.getItem(q.value);
|
|
268
|
+
i && (n = JSON.parse(i));
|
|
269
|
+
} catch (i) {
|
|
270
|
+
console.warn("EleScrollTable: Failed to read column settings", i);
|
|
271
|
+
}
|
|
272
|
+
if (n && Array.isArray(n)) {
|
|
273
|
+
const i = new Set(e.map((x) => x.prop)), y = n.filter((x) => i.has(x));
|
|
274
|
+
N.value = y;
|
|
275
|
+
} else
|
|
276
|
+
N.value = t;
|
|
277
|
+
};
|
|
278
|
+
re(
|
|
279
|
+
N,
|
|
280
|
+
(e) => {
|
|
281
|
+
if (o.persistenceColumn && q.value)
|
|
282
|
+
try {
|
|
283
|
+
localStorage.setItem(q.value, JSON.stringify(e));
|
|
284
|
+
} catch (t) {
|
|
285
|
+
console.warn("EleScrollTable: Failed to save column settings", t);
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
{ deep: !0 }
|
|
289
|
+
);
|
|
290
|
+
const r = (e) => oe.value.has(e), be = O(() => {
|
|
291
|
+
const e = (o.tableItem || []).filter((y) => (y == null ? void 0 : y.prop) && !y.hide).map((y) => y.prop), t = new Set(N.value), n = e.filter((y) => !t.has(y)), i = ae(o.hideItems);
|
|
292
|
+
return Array.from(/* @__PURE__ */ new Set([...i, ...n]));
|
|
293
|
+
}), ye = O(() => (o.tableItem || []).filter((t) => (t == null ? void 0 : t.prop) && !t.hide).length > o.columnDisplayThreshold), Se = O(() => (o.tableItem || []).filter((e) => (e == null ? void 0 : e.prop) && !e.hide).map((e) => ({
|
|
294
|
+
key: e.prop,
|
|
295
|
+
label: e.label ?? e.prop,
|
|
296
|
+
disabled: r(e.prop)
|
|
297
|
+
}))), ce = xe(), we = O(() => {
|
|
298
|
+
var t;
|
|
299
|
+
const e = (t = o.dragTipStorageKey) == null ? void 0 : t.trim();
|
|
300
|
+
return e || (o.dragTipScope === "instance" ? `baseTableDragTipSeen_v2_${(ce == null ? void 0 : ce.uid) ?? "default"}` : "baseTableDragTipSeen_v2");
|
|
301
|
+
}), de = Fe(we, !1), J = Q(!1), Ce = () => {
|
|
302
|
+
var n;
|
|
303
|
+
const e = (n = b.value) == null ? void 0 : n.$el;
|
|
304
|
+
if (!e) return !1;
|
|
305
|
+
const t = e.querySelector(".el-table__body-wrapper .el-scrollbar__wrap") || e.querySelector(".el-table__body-wrapper");
|
|
306
|
+
return t ? t.scrollWidth > t.clientWidth + 2 : !1;
|
|
307
|
+
}, Ie = () => {
|
|
308
|
+
!de.value && Ce() && (J.value = !0, setTimeout(() => {
|
|
309
|
+
J.value && (de.value = !0, J.value = !1);
|
|
310
|
+
}, 6e3));
|
|
311
|
+
}, ve = () => {
|
|
312
|
+
J.value && (J.value = !1), de.value = !0;
|
|
313
|
+
}, Te = (e, t, n) => {
|
|
314
|
+
var x, le, G, ne;
|
|
315
|
+
const i = t == null ? void 0 : t.property;
|
|
316
|
+
if (i) {
|
|
317
|
+
const ee = e == null ? void 0 : e[i];
|
|
318
|
+
return ee == null ? "" : String(ee);
|
|
319
|
+
}
|
|
320
|
+
const y = (le = (x = n == null ? void 0 : n.target) == null ? void 0 : x.closest) == null ? void 0 : le.call(x, ".cell");
|
|
321
|
+
return y ? ((ne = (G = y.innerText) == null ? void 0 : G.trim) == null ? void 0 : ne.call(G)) ?? "" : "";
|
|
322
|
+
}, Le = async (e) => {
|
|
323
|
+
var t;
|
|
324
|
+
if (!e) return !1;
|
|
325
|
+
try {
|
|
326
|
+
if ((t = navigator == null ? void 0 : navigator.clipboard) != null && t.writeText)
|
|
327
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
328
|
+
const n = document.createElement("textarea");
|
|
329
|
+
n.value = e, n.setAttribute("readonly", ""), n.style.position = "fixed", n.style.opacity = "0", document.body.appendChild(n), n.select();
|
|
330
|
+
const i = document.execCommand("copy");
|
|
331
|
+
return document.body.removeChild(n), i;
|
|
332
|
+
} catch {
|
|
333
|
+
return !1;
|
|
334
|
+
}
|
|
335
|
+
}, De = async (e, t, n) => {
|
|
336
|
+
if (!o.enableDblclickCopy) return;
|
|
337
|
+
const i = Te(e, t, n);
|
|
338
|
+
if (!i) {
|
|
339
|
+
o.copyFeedback && me.warning(o.copyLocale.empty);
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
const y = await Le(i);
|
|
343
|
+
o.copyFeedback && (y ? me.success(o.copyLocale.success) : me.error(o.copyLocale.failed));
|
|
344
|
+
}, _e = () => {
|
|
345
|
+
W.value = !W.value, d("toggleSearch", W.value);
|
|
346
|
+
};
|
|
347
|
+
re(
|
|
348
|
+
() => o.tableItem,
|
|
349
|
+
() => {
|
|
350
|
+
Z(), m();
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
immediate: !0
|
|
354
|
+
}
|
|
355
|
+
), re(
|
|
356
|
+
() => o.hideItems,
|
|
357
|
+
() => {
|
|
358
|
+
m();
|
|
359
|
+
}
|
|
360
|
+
);
|
|
361
|
+
const { start: $e, stop: Be } = Me(
|
|
362
|
+
b,
|
|
363
|
+
{
|
|
364
|
+
onStart: ve
|
|
365
|
+
}
|
|
366
|
+
);
|
|
367
|
+
return Oe(() => {
|
|
368
|
+
setTimeout(() => {
|
|
369
|
+
$e(), Ie();
|
|
370
|
+
}, 100);
|
|
371
|
+
}), Re(() => {
|
|
372
|
+
Be();
|
|
373
|
+
}), v({
|
|
374
|
+
elTableRef: b,
|
|
375
|
+
unFoldAll: K
|
|
376
|
+
}), (e, t) => {
|
|
377
|
+
const n = f("el-button"), i = f("el-checkbox"), y = f("el-dropdown-item"), x = f("el-checkbox-group"), le = f("el-dropdown-menu"), G = f("el-dropdown"), ne = f("el-transfer"), ee = f("el-tooltip"), pe = f("el-table-column"), ze = f("el-table"), Ae = f("el-pagination");
|
|
378
|
+
return s(), u("div", Ke, [
|
|
379
|
+
J.value ? (s(), u("div", {
|
|
380
|
+
key: 0,
|
|
381
|
+
class: "drag-tip-overlay",
|
|
382
|
+
onClick: ve
|
|
383
|
+
}, [...t[5] || (t[5] = [
|
|
384
|
+
je('<div class="tip-content" data-v-d2dc3afc><svg class="tip-icon" viewBox="0 0 1024 1024" width="24" height="24" data-v-d2dc3afc><path d="M512 64C335.264 64 192 207.264 192 384v256c0 176.736 143.264 320 320 320s320-143.264 320-320V384c0-176.736-143.264-320-320-320z m0 72c136.992 0 248 111.008 248 248v256c0 136.992-111.008 248-248 248s-248-111.008-248-248V384c0-136.992 111.008-248 248-248z m0 144c-19.872 0-36 16.128-36 36v128c0 19.872 16.128 36 36 36s36-16.128 36-36V316c0-19.872-16.128-36-36-36z" fill="currentColor" data-v-d2dc3afc></path></svg><span class="tip-text" data-v-d2dc3afc>按住鼠标中键可横向拖动</span></div><div class="tip-close" data-v-d2dc3afc><svg viewBox="0 0 1024 1024" width="14" height="14" data-v-d2dc3afc><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" fill="currentColor" data-v-d2dc3afc></path></svg></div>', 2)
|
|
385
|
+
])])) : p("", !0),
|
|
386
|
+
ue.value ? (s(), u("div", {
|
|
387
|
+
key: 1,
|
|
388
|
+
class: "header",
|
|
389
|
+
ref_key: "headerRef",
|
|
390
|
+
ref: R
|
|
391
|
+
}, [
|
|
392
|
+
g(e.$slots, "header", {}, () => [
|
|
393
|
+
T("div", qe, [
|
|
394
|
+
g(e.$slots, "handleLeft", {}, void 0, !0)
|
|
395
|
+
]),
|
|
396
|
+
T("div", We, [
|
|
397
|
+
o.headerButtons.length !== 0 ? (s(), u(_, { key: 0 }, [
|
|
398
|
+
o.headerButtons.includes("columnDisplay") || o.headerButtons.includes("comSearch") ? (s(), u("div", Xe, [
|
|
399
|
+
o.headerButtons.includes("columnDisplay") && !ye.value ? (s(), $(G, {
|
|
400
|
+
key: 0,
|
|
401
|
+
"max-height": 380,
|
|
402
|
+
"hide-on-click": !1,
|
|
403
|
+
"popper-class": "columnDisplay"
|
|
404
|
+
}, {
|
|
405
|
+
dropdown: c(() => [
|
|
406
|
+
L(le, null, {
|
|
407
|
+
default: c(() => [
|
|
408
|
+
L(x, {
|
|
409
|
+
modelValue: N.value,
|
|
410
|
+
"onUpdate:modelValue": t[0] || (t[0] = (h) => N.value = h)
|
|
411
|
+
}, {
|
|
412
|
+
default: c(() => [
|
|
413
|
+
(s(!0), u(_, null, z(a.tableItem, (h, M) => (s(), $(y, { key: M }, {
|
|
414
|
+
default: c(() => [
|
|
415
|
+
h.prop ? (s(), $(i, {
|
|
416
|
+
key: 0,
|
|
417
|
+
disabled: r(h.prop),
|
|
418
|
+
size: "small",
|
|
419
|
+
value: h.prop
|
|
420
|
+
}, {
|
|
421
|
+
default: c(() => [
|
|
422
|
+
P(U(h.label), 1)
|
|
423
|
+
]),
|
|
424
|
+
_: 2
|
|
425
|
+
}, 1032, ["disabled", "value"])) : p("", !0)
|
|
426
|
+
]),
|
|
427
|
+
_: 2
|
|
428
|
+
}, 1024))), 128))
|
|
429
|
+
]),
|
|
430
|
+
_: 1
|
|
431
|
+
}, 8, ["modelValue"])
|
|
432
|
+
]),
|
|
433
|
+
_: 1
|
|
434
|
+
})
|
|
435
|
+
]),
|
|
436
|
+
default: c(() => [
|
|
437
|
+
L(n, {
|
|
438
|
+
class: ie([
|
|
439
|
+
"table-search-button-item",
|
|
440
|
+
o.headerButtons.includes("columnDisplay") ? "right-border" : ""
|
|
441
|
+
]),
|
|
442
|
+
plain: ""
|
|
443
|
+
}, {
|
|
444
|
+
default: c(() => [...t[6] || (t[6] = [
|
|
445
|
+
P(" 列设置 ", -1)
|
|
446
|
+
])]),
|
|
447
|
+
_: 1
|
|
448
|
+
}, 8, ["class"])
|
|
449
|
+
]),
|
|
450
|
+
_: 1
|
|
451
|
+
})) : p("", !0),
|
|
452
|
+
o.headerButtons.includes("columnDisplay") && ye.value ? (s(), u(_, { key: 1 }, [
|
|
453
|
+
L(n, {
|
|
454
|
+
class: ie([
|
|
455
|
+
"table-search-button-item",
|
|
456
|
+
o.headerButtons.includes("comSearch") ? "right-border" : ""
|
|
457
|
+
]),
|
|
458
|
+
plain: "",
|
|
459
|
+
onClick: t[1] || (t[1] = (h) => X.value = !0)
|
|
460
|
+
}, {
|
|
461
|
+
default: c(() => [...t[7] || (t[7] = [
|
|
462
|
+
P(" 列设置 ", -1)
|
|
463
|
+
])]),
|
|
464
|
+
_: 1
|
|
465
|
+
}, 8, ["class"]),
|
|
466
|
+
L(Y(Ue), {
|
|
467
|
+
modelValue: X.value,
|
|
468
|
+
"onUpdate:modelValue": t[4] || (t[4] = (h) => X.value = h),
|
|
469
|
+
title: "列设置",
|
|
470
|
+
resizable: !0,
|
|
471
|
+
"min-width": 560,
|
|
472
|
+
"min-height": 380,
|
|
473
|
+
class: "column-setting-dialog"
|
|
474
|
+
}, {
|
|
475
|
+
footer: c(() => [
|
|
476
|
+
L(n, {
|
|
477
|
+
onClick: t[3] || (t[3] = (h) => X.value = !1)
|
|
478
|
+
}, {
|
|
479
|
+
default: c(() => [...t[8] || (t[8] = [
|
|
480
|
+
P("关闭", -1)
|
|
481
|
+
])]),
|
|
482
|
+
_: 1
|
|
483
|
+
})
|
|
484
|
+
]),
|
|
485
|
+
default: c(() => [
|
|
486
|
+
T("div", Je, [
|
|
487
|
+
L(ne, {
|
|
488
|
+
modelValue: N.value,
|
|
489
|
+
"onUpdate:modelValue": t[2] || (t[2] = (h) => N.value = h),
|
|
490
|
+
filterable: "",
|
|
491
|
+
data: Se.value,
|
|
492
|
+
titles: ["隐藏列", "显示列"]
|
|
493
|
+
}, null, 8, ["modelValue", "data"])
|
|
494
|
+
])
|
|
495
|
+
]),
|
|
496
|
+
_: 1
|
|
497
|
+
}, 8, ["modelValue"])
|
|
498
|
+
], 64)) : p("", !0),
|
|
499
|
+
o.headerButtons.includes("comSearch") ? (s(), $(ee, {
|
|
500
|
+
key: 2,
|
|
501
|
+
content: W.value ? "关闭搜索" : "展开搜索",
|
|
502
|
+
placement: "top"
|
|
503
|
+
}, {
|
|
504
|
+
default: c(() => [
|
|
505
|
+
L(n, {
|
|
506
|
+
class: "table-search-button-item",
|
|
507
|
+
onClick: _e,
|
|
508
|
+
plain: ""
|
|
509
|
+
}, {
|
|
510
|
+
default: c(() => [...t[9] || (t[9] = [
|
|
511
|
+
P(" 搜索 ", -1)
|
|
512
|
+
])]),
|
|
513
|
+
_: 1
|
|
514
|
+
})
|
|
515
|
+
]),
|
|
516
|
+
_: 1
|
|
517
|
+
}, 8, ["content"])) : p("", !0)
|
|
518
|
+
])) : p("", !0)
|
|
519
|
+
], 64)) : p("", !0),
|
|
520
|
+
g(e.$slots, "handleRight", {}, void 0, !0)
|
|
521
|
+
])
|
|
522
|
+
], !0)
|
|
523
|
+
], 512)) : p("", !0),
|
|
524
|
+
L(ze, te({
|
|
525
|
+
class: "elTable",
|
|
526
|
+
ref_key: "elTableRef",
|
|
527
|
+
ref: b,
|
|
528
|
+
data: a.dataList,
|
|
529
|
+
border: a.border,
|
|
530
|
+
maxHeight: F.value ? F.value > 300 ? F.value : 300 : void 0,
|
|
531
|
+
"show-overflow-tooltip": !0,
|
|
532
|
+
style: { width: "100%" },
|
|
533
|
+
stripe: "",
|
|
534
|
+
onSortChange: V,
|
|
535
|
+
onRowDblclick: De
|
|
536
|
+
}, Ee(a.tableListener), a.elTableConfig), {
|
|
537
|
+
default: c(() => [
|
|
538
|
+
a.showExpand ? (s(), $(pe, {
|
|
539
|
+
key: 0,
|
|
540
|
+
type: "expand"
|
|
541
|
+
}, {
|
|
542
|
+
default: c(({ row: h }) => [
|
|
543
|
+
g(e.$slots, "expand", { backData: h }, void 0, !0)
|
|
544
|
+
]),
|
|
545
|
+
_: 3
|
|
546
|
+
})) : p("", !0),
|
|
547
|
+
a.showChoose ? (s(), $(pe, te({
|
|
548
|
+
key: 1,
|
|
549
|
+
type: "selection",
|
|
550
|
+
width: "55",
|
|
551
|
+
align: a.align
|
|
552
|
+
}, a.selectionConfig), null, 16, ["align"])) : p("", !0),
|
|
553
|
+
a.showIndex ? (s(), $(pe, {
|
|
554
|
+
key: 2,
|
|
555
|
+
width: "55",
|
|
556
|
+
align: a.align,
|
|
557
|
+
label: "序号",
|
|
558
|
+
type: "index"
|
|
559
|
+
}, null, 8, ["align"])) : p("", !0),
|
|
560
|
+
(s(!0), u(_, null, z(a.tableItem, (h) => (s(), $(Pe, {
|
|
561
|
+
key: h.prop,
|
|
562
|
+
item: h,
|
|
563
|
+
align: a.align,
|
|
564
|
+
hideItems: be.value
|
|
565
|
+
}, he({ _: 2 }, [
|
|
566
|
+
z(S.value, (M) => ({
|
|
567
|
+
name: M,
|
|
568
|
+
fn: c(({ backData: se, currentItem: He }) => [
|
|
569
|
+
g(e.$slots, M, {
|
|
570
|
+
backData: se,
|
|
571
|
+
row: se,
|
|
572
|
+
currentItem: He
|
|
573
|
+
}, void 0, !0)
|
|
574
|
+
])
|
|
575
|
+
})),
|
|
576
|
+
z(h.slotNames, (M) => ({
|
|
577
|
+
name: M,
|
|
578
|
+
fn: c((se) => [
|
|
579
|
+
g(e.$slots, `${h.prop}` + A(M), { backData: se }, void 0, !0)
|
|
580
|
+
])
|
|
581
|
+
}))
|
|
582
|
+
]), 1032, ["item", "align", "hideItems"]))), 128))
|
|
583
|
+
]),
|
|
584
|
+
_: 3
|
|
585
|
+
}, 16, ["data", "border", "maxHeight"]),
|
|
586
|
+
a.pagination ? (s(), u("div", {
|
|
587
|
+
key: 2,
|
|
588
|
+
class: ie(["footer lmw-pagination-footer", {
|
|
589
|
+
isSmall: Y(B)
|
|
590
|
+
}]),
|
|
591
|
+
ref_key: "footerRef",
|
|
592
|
+
ref: D
|
|
593
|
+
}, [
|
|
594
|
+
g(e.$slots, "footer", {}, () => [
|
|
595
|
+
L(Ae, {
|
|
596
|
+
onSizeChange: j,
|
|
597
|
+
onCurrentChange: C,
|
|
598
|
+
"current-page": a.paginationInfo.pageNum,
|
|
599
|
+
"page-size": a.paginationInfo.pageSize,
|
|
600
|
+
"page-sizes": [20, 50, 100, 200, 300],
|
|
601
|
+
layout: l.value,
|
|
602
|
+
total: a.listCount,
|
|
603
|
+
"pager-count": Y(B) ? 5 : 7,
|
|
604
|
+
background: "",
|
|
605
|
+
"hide-on-single-page": ""
|
|
606
|
+
}, null, 8, ["current-page", "page-size", "layout", "total", "pager-count"])
|
|
607
|
+
], !0)
|
|
608
|
+
], 2)) : p("", !0)
|
|
609
|
+
]);
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
}), Qe = /* @__PURE__ */ ke(Ge, [["__scopeId", "data-v-d2dc3afc"]]), Ye = { class: "mobileContent" }, Ze = {
|
|
613
|
+
key: 0,
|
|
614
|
+
class: "mb12 header"
|
|
615
|
+
}, et = { class: "headerContent" }, tt = { class: "handleRight" }, at = { class: "handleRight" }, ot = {
|
|
616
|
+
key: 1,
|
|
617
|
+
class: "dataList"
|
|
618
|
+
}, lt = { class: "data-card overlayColor" }, nt = {
|
|
619
|
+
key: 0,
|
|
620
|
+
class: "card-header"
|
|
621
|
+
}, st = { class: "order-number" }, rt = { class: "label" }, it = ["onClick"], ut = { class: "info-list" }, ct = { class: "info-row" }, dt = { class: "label" }, pt = { class: "value" }, ft = { class: "card-footer mobileFooter" }, mt = {
|
|
622
|
+
key: 3,
|
|
623
|
+
class: "footer lmw-pagination-footer"
|
|
624
|
+
}, ht = { class: "mr2" }, gt = /* @__PURE__ */ Object.assign({ name: "BaseMobileTable" }, {
|
|
625
|
+
__name: "MoblieTable",
|
|
626
|
+
props: {
|
|
627
|
+
dataList: {
|
|
628
|
+
// 数据
|
|
629
|
+
type: Array,
|
|
630
|
+
default: () => []
|
|
631
|
+
},
|
|
632
|
+
tableItem: {
|
|
633
|
+
// 每列的名字
|
|
634
|
+
type: Array,
|
|
635
|
+
default: () => []
|
|
636
|
+
},
|
|
637
|
+
tableListener: {
|
|
638
|
+
type: Object,
|
|
639
|
+
default: () => ({})
|
|
640
|
+
},
|
|
641
|
+
showChoose: {
|
|
642
|
+
// 是否展示复选框
|
|
643
|
+
type: Boolean,
|
|
644
|
+
default: !1
|
|
645
|
+
},
|
|
646
|
+
pagination: {
|
|
647
|
+
// 是否显示分页
|
|
648
|
+
type: Boolean,
|
|
649
|
+
default: !0
|
|
650
|
+
},
|
|
651
|
+
listCount: {
|
|
652
|
+
//总条数
|
|
653
|
+
type: Number,
|
|
654
|
+
default: 0
|
|
655
|
+
},
|
|
656
|
+
paginationInfo: {
|
|
657
|
+
// 分页的页码和偏移
|
|
658
|
+
type: Object,
|
|
659
|
+
default: () => ({ pageNum: 1, pageSize: 10 })
|
|
660
|
+
},
|
|
661
|
+
paginationLayout: {
|
|
662
|
+
type: String,
|
|
663
|
+
default: "prev, pager, next"
|
|
664
|
+
},
|
|
665
|
+
hideItems: {
|
|
666
|
+
type: [Array, Object],
|
|
667
|
+
default: () => ({})
|
|
668
|
+
},
|
|
669
|
+
showBacktop: {
|
|
670
|
+
type: Boolean,
|
|
671
|
+
default: !0
|
|
672
|
+
},
|
|
673
|
+
visibilityHeight: {
|
|
674
|
+
type: Number,
|
|
675
|
+
default: 100
|
|
676
|
+
},
|
|
677
|
+
selectionConfig: {
|
|
678
|
+
type: Object,
|
|
679
|
+
default: () => ({})
|
|
680
|
+
},
|
|
681
|
+
tableLayout: {
|
|
682
|
+
type: Object,
|
|
683
|
+
default: () => ({
|
|
684
|
+
xl: 6,
|
|
685
|
+
lg: 8,
|
|
686
|
+
md: 12,
|
|
687
|
+
sm: 12,
|
|
688
|
+
xs: 24
|
|
689
|
+
})
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
emits: [
|
|
693
|
+
"cardHeaderClick",
|
|
694
|
+
"selectionChange",
|
|
695
|
+
"update:paginationInfo"
|
|
696
|
+
],
|
|
697
|
+
setup(a, { expose: v, emit: w }) {
|
|
698
|
+
const o = a, d = w;
|
|
699
|
+
let b = [], R = [], D = [];
|
|
700
|
+
const k = () => {
|
|
701
|
+
o.tableItem.forEach((l) => {
|
|
702
|
+
l.mobileSlot === "header" && b.push({
|
|
703
|
+
...l,
|
|
704
|
+
slotName: l.slotName ?? l.prop + "Header"
|
|
705
|
+
}), (l.mobileSlot === "footer" || l.prop === "todo") && D.push({
|
|
706
|
+
...l,
|
|
707
|
+
slotName: l.slotName ?? l.prop + "Slot"
|
|
708
|
+
}), l.mobileSlot || R.push({
|
|
709
|
+
...l,
|
|
710
|
+
slotName: l.slotName ?? l.prop + "Content"
|
|
711
|
+
});
|
|
712
|
+
});
|
|
713
|
+
};
|
|
714
|
+
re(
|
|
715
|
+
() => o.tableItem,
|
|
716
|
+
() => {
|
|
717
|
+
k();
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
immediate: !0
|
|
721
|
+
}
|
|
722
|
+
);
|
|
723
|
+
const C = () => {
|
|
724
|
+
const l = document.querySelector(".el-main");
|
|
725
|
+
l == null || l.scrollTo(0, 0);
|
|
726
|
+
}, V = (l) => {
|
|
727
|
+
l.querySelectorAll("*").length <= 1 ? l.setAttribute("hiden", "") : l.removeAttribute("hiden");
|
|
728
|
+
}, j = {
|
|
729
|
+
mounted: (l) => {
|
|
730
|
+
V(l);
|
|
731
|
+
},
|
|
732
|
+
updated: (l) => {
|
|
733
|
+
V(l);
|
|
734
|
+
}
|
|
735
|
+
}, A = (l) => {
|
|
736
|
+
let S = !1;
|
|
737
|
+
return ge(o.hideItems) ? o.hideItems.value.includes(l.prop) && (S = !0) : Array.isArray(o.hideItems) && o.hideItems.includes(l.prop) && (S = !0), S;
|
|
738
|
+
}, E = (l) => {
|
|
739
|
+
d("cardHeaderClick", l);
|
|
740
|
+
}, F = () => {
|
|
741
|
+
d("selectionChange", I.value);
|
|
742
|
+
}, H = (l, S) => S.some((Z) => l.hasOwnProperty(Z)), I = Q([]), K = O(() => I.value.length === o.dataList.length);
|
|
743
|
+
return v({
|
|
744
|
+
checkAll: () => {
|
|
745
|
+
K.value ? I.value = [] : I.value = o.dataList;
|
|
746
|
+
}
|
|
747
|
+
}), (l, S) => {
|
|
748
|
+
const Z = f("el-scrollbar"), ae = f("el-checkbox"), oe = f("el-col"), q = f("el-row"), N = f("el-checkbox-group"), W = f("el-empty"), X = f("el-pagination"), ue = f("el-backtop");
|
|
749
|
+
return s(), u("div", Ye, [
|
|
750
|
+
H(l.$slots, ["handleLeft", "handleRight"]) ? (s(), u("div", Ze, [
|
|
751
|
+
L(Z, null, {
|
|
752
|
+
default: c(() => [
|
|
753
|
+
T("div", et, [
|
|
754
|
+
g(l.$slots, "header", {}, () => [
|
|
755
|
+
T("div", tt, [
|
|
756
|
+
g(l.$slots, "handleLeft", {}, void 0, !0)
|
|
757
|
+
]),
|
|
758
|
+
T("div", at, [
|
|
759
|
+
g(l.$slots, "handleRight", {}, void 0, !0)
|
|
760
|
+
])
|
|
761
|
+
], !0)
|
|
762
|
+
])
|
|
763
|
+
]),
|
|
764
|
+
_: 3
|
|
765
|
+
})
|
|
766
|
+
])) : p("", !0),
|
|
767
|
+
a.dataList.length !== 0 ? (s(), u("div", ot, [
|
|
768
|
+
L(N, {
|
|
769
|
+
modelValue: I.value,
|
|
770
|
+
"onUpdate:modelValue": S[0] || (S[0] = (m) => I.value = m),
|
|
771
|
+
onChange: F
|
|
772
|
+
}, {
|
|
773
|
+
default: c(() => [
|
|
774
|
+
L(q, { gutter: 12 }, {
|
|
775
|
+
default: c(() => [
|
|
776
|
+
(s(!0), u(_, null, z(a.dataList, (m) => (s(), $(oe, te({ ref_for: !0 }, a.tableLayout, { class: "mb12" }), {
|
|
777
|
+
default: c(() => [
|
|
778
|
+
T("div", lt, [
|
|
779
|
+
(s(!0), u(_, null, z(Y(b), (r) => (s(), u(_, null, [
|
|
780
|
+
!A(r) && !r.hide ? (s(), u("div", nt, [
|
|
781
|
+
T("div", st, [
|
|
782
|
+
g(l.$slots, r.slotName + "Header", {
|
|
783
|
+
backData: Object.assign(m, { column: r })
|
|
784
|
+
}, () => [
|
|
785
|
+
T("div", rt, U(r.label) + ":", 1)
|
|
786
|
+
], !0),
|
|
787
|
+
g(l.$slots, r.slotName, {
|
|
788
|
+
backData: Object.assign(m, { column: r })
|
|
789
|
+
}, () => [
|
|
790
|
+
T("div", {
|
|
791
|
+
class: "value",
|
|
792
|
+
onClick: (be) => E(m)
|
|
793
|
+
}, U(m[r.prop]), 9, it)
|
|
794
|
+
], !0)
|
|
795
|
+
]),
|
|
796
|
+
a.showChoose ? (s(), $(ae, {
|
|
797
|
+
key: 0,
|
|
798
|
+
class: "checkSize",
|
|
799
|
+
value: m,
|
|
800
|
+
disabled: a.selectionConfig.selectable && !a.selectionConfig.selectable(m)
|
|
801
|
+
}, null, 8, ["value", "disabled"])) : p("", !0)
|
|
802
|
+
])) : p("", !0)
|
|
803
|
+
], 64))), 256)),
|
|
804
|
+
T("div", ut, [
|
|
805
|
+
T("div", ct, [
|
|
806
|
+
(s(!0), u(_, null, z(Y(R), (r) => (s(), u(_, {
|
|
807
|
+
key: r.prop
|
|
808
|
+
}, [
|
|
809
|
+
!A(r) && !r.hide ? (s(), u("div", {
|
|
810
|
+
key: 0,
|
|
811
|
+
class: ie(["info-item", {
|
|
812
|
+
"full-width": r.width >= 160 || r.minWidth >= 160
|
|
813
|
+
}])
|
|
814
|
+
}, [
|
|
815
|
+
r.prop !== "todo" ? (s(), u(_, { key: 0 }, [
|
|
816
|
+
g(l.$slots, r.slotName + "Header", {
|
|
817
|
+
backData: Object.assign(m, { column: r })
|
|
818
|
+
}, () => [
|
|
819
|
+
T("span", dt, U(r.label) + ": ", 1)
|
|
820
|
+
], !0),
|
|
821
|
+
g(l.$slots, r.slotName, {
|
|
822
|
+
backData: Object.assign(m, { column: r })
|
|
823
|
+
}, () => [
|
|
824
|
+
T("span", pt, U(m[r.prop]), 1)
|
|
825
|
+
], !0)
|
|
826
|
+
], 64)) : p("", !0)
|
|
827
|
+
], 2)) : p("", !0)
|
|
828
|
+
], 64))), 128))
|
|
829
|
+
])
|
|
830
|
+
]),
|
|
831
|
+
Ve((s(), u("div", ft, [
|
|
832
|
+
(s(!0), u(_, null, z(Y(D), (r) => (s(), u(_, null, [
|
|
833
|
+
A(r) ? p("", !0) : g(l.$slots, r.slotName, {
|
|
834
|
+
key: 0,
|
|
835
|
+
backData: Object.assign(m, { column: r })
|
|
836
|
+
}, void 0, !0)
|
|
837
|
+
], 64))), 256))
|
|
838
|
+
])), [
|
|
839
|
+
[j]
|
|
840
|
+
])
|
|
841
|
+
])
|
|
842
|
+
]),
|
|
843
|
+
_: 2
|
|
844
|
+
}, 1040))), 256))
|
|
845
|
+
]),
|
|
846
|
+
_: 3
|
|
847
|
+
})
|
|
848
|
+
]),
|
|
849
|
+
_: 3
|
|
850
|
+
}, 8, ["modelValue"])
|
|
851
|
+
])) : (s(), $(W, {
|
|
852
|
+
key: 2,
|
|
853
|
+
class: "overlayColor",
|
|
854
|
+
description: "暂无数据"
|
|
855
|
+
})),
|
|
856
|
+
a.pagination && a.listCount > a.paginationInfo.pageSize ? (s(), u("div", mt, [
|
|
857
|
+
T("span", ht, U(a.listCount) + "条 ", 1),
|
|
858
|
+
L(X, {
|
|
859
|
+
onSizeChange: C,
|
|
860
|
+
onCurrentChange: C,
|
|
861
|
+
"current-page": a.paginationInfo.pageNum,
|
|
862
|
+
"onUpdate:currentPage": S[1] || (S[1] = (m) => a.paginationInfo.pageNum = m),
|
|
863
|
+
"page-size": a.paginationInfo.pageSize,
|
|
864
|
+
"onUpdate:pageSize": S[2] || (S[2] = (m) => a.paginationInfo.pageSize = m),
|
|
865
|
+
layout: a.paginationLayout,
|
|
866
|
+
total: a.listCount,
|
|
867
|
+
"pager-count": 5,
|
|
868
|
+
background: "",
|
|
869
|
+
"hide-on-single-page": ""
|
|
870
|
+
}, null, 8, ["current-page", "page-size", "layout", "total"])
|
|
871
|
+
])) : p("", !0),
|
|
872
|
+
L(ue, {
|
|
873
|
+
target: ".el-main",
|
|
874
|
+
right: 10,
|
|
875
|
+
bottom: 100,
|
|
876
|
+
"visibility-height": a.visibilityHeight
|
|
877
|
+
}, null, 8, ["visibility-height"])
|
|
878
|
+
]);
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
}), bt = /* @__PURE__ */ ke(gt, [["__scopeId", "data-v-4277cdf1"]]), yt = [Qe, bt], vt = (a) => {
|
|
882
|
+
yt.forEach((v) => {
|
|
883
|
+
const w = v.name || v.__name;
|
|
884
|
+
w && a.component(w, v);
|
|
885
|
+
});
|
|
886
|
+
}, It = { install: vt };
|
|
887
|
+
export {
|
|
888
|
+
bt as MoblieTable,
|
|
889
|
+
Qe as Table,
|
|
890
|
+
It as default
|
|
891
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(S,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus"),require("@vueuse/core"),require("e-plus-dialog-vue3")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","@vueuse/core","e-plus-dialog-vue3"],e):(S=typeof globalThis<"u"?globalThis:S||self,e(S.EleScrollTableVue3={},S.Vue,S.ElementPlus,S.VueUse,S.EPlusDialog))})(this,function(S,e,W,ne,le){"use strict";const ae=(n,u={})=>{const{onStart:y}=u;let l=null;const i=()=>{var $;const C=($=n.value)==null?void 0:$.$el;if(!C)return null;const h=C.querySelector(".el-table__body-wrapper .el-scrollbar__wrap")||C.querySelector(".el-table__body-wrapper");if(!h)return null;let b=!1,x=0,I=0;const B=w=>{w.button===1&&(w.preventDefault(),y==null||y(),b=!0,x=w.clientX,I=h.scrollLeft,C.style.cursor="grabbing",document.body.style.userSelect="none")},L=()=>{b&&(b=!1,C.style.cursor="",document.body.style.userSelect="")},D=w=>{if(!b)return;w.preventDefault();const a=w.clientX-x;h.scrollLeft=I-a},N=()=>{L()},k=C.querySelector(".el-table__body-wrapper");return k&&k.addEventListener("mousedown",B),window.addEventListener("mousemove",D),window.addEventListener("mouseup",N),window.addEventListener("blur",L),window.addEventListener("mouseleave",L),()=>{k&&k.removeEventListener("mousedown",B),window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",N),window.removeEventListener("blur",L),window.removeEventListener("mouseleave",L)}};return{start:()=>{l=i()},stop:()=>{l&&l(),l=null}}},re={__name:"TableColumn",props:{item:{type:Object,default:()=>{}},align:{type:String,default:"center"},hideItems:{type:[Array,Object],default:()=>({})}},setup(n){const u=n,y=i=>{let m=!1;return e.isRef(u.hideItems)?u.hideItems.value.includes(i.prop)&&(m=!0):Array.isArray(u.hideItems)&&u.hideItems.includes(i.prop)&&(m=!0),m},l=i=>i.charAt(0).toUpperCase()+i.slice(1);return(i,m)=>{const T=e.resolveComponent("TableColumn",!0),C=e.resolveComponent("el-table-column");return!y(n.item)&&!n.item.hide?(e.openBlock(),e.createBlock(C,e.mergeProps({key:0,border:"",align:n.align},n.item),e.createSlots({header:e.withCtx(({column:h,index:b})=>[e.renderSlot(i.$slots,`${n.item.slotName}Header`,{backData:{column:h,index:b}},()=>[e.createTextVNode(e.toDisplayString(n.item.label),1)])]),default:e.withCtx(h=>[n.item.merges?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.item.merges,b=>(e.openBlock(),e.createBlock(T,{item:b,hideItems:n.hideItems,align:n.align},e.createSlots({_:2},[e.renderList(i.$slots,(x,I)=>({name:I,fn:e.withCtx(B=>[e.renderSlot(i.$slots,I,e.mergeProps({ref_for:!0},B))])}))]),1032,["item","hideItems","align"]))),256)):e.renderSlot(i.$slots,n.item.slotName,{key:1,backData:h.row,currentItem:n.item},()=>[n.item.prop?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(h.row[n.item.prop]),1)],64)):e.createCommentVNode("",!0)])]),_:2},[e.renderList(n.item.slotNames,h=>({name:h,fn:e.withCtx(b=>[e.renderSlot(i.$slots,`${n.item.prop}`+l(h),{backData:b})])}))]),1040,["align"])):e.createCommentVNode("",!0)}}},Y=(n,u)=>{const y=n.__vccOpts||n;for(const[l,i]of u)y[l]=i;return y},se={class:"baseTable"},ce={class:"handle"},ie={class:"handleRight"},de={key:0,class:"table-search-button-group"},pe={class:"column-setting-body"},Z=Y(Object.assign({name:"BaseTable"},{__name:"Table",props:{border:{type:Boolean,default:!0},dataList:{type:Array,default:()=>[]},tableItem:{type:Array,default:()=>[]},tableListener:{type:Object,default:()=>({})},showChoose:{type:Boolean,default:!1},showIndex:{type:Boolean,default:!1},pagination:{type:Boolean,default:!0},listCount:{type:Number,default:0},paginationInfo:{type:Object,default:()=>({pageNum:1,pageSize:50})},elTableConfig:{type:Object,default:()=>({})},showExpand:{type:Boolean,default:!1},align:{type:String,default:"center"},paginationLayout:{type:String,default:"total, sizes, prev, pager, next, jumper"},hideItems:{type:[Array,Object],default:()=>({})},maxHeight:{type:[Number,String]},selectionConfig:{type:Object,default:()=>({})},autoResize:{type:Boolean,default:!0},dragTipScope:{type:String,default:"global"},dragTipStorageKey:{type:String},headerButtons:{type:Array,default:()=>["columnDisplay","comSearch"]},columnDisplayThreshold:{type:Number,default:12},enableDblclickCopy:{type:Boolean,default:!0},copyFeedback:{type:Boolean,default:!0},copyLocale:{type:Object,default:()=>({success:"已复制",failed:"复制失败",empty:"无可复制内容"})},persistenceColumn:{type:Boolean,default:!0},persistenceKey:{type:String,default:""}},emits:["update:paginationInfo","sortChange","toggleSearch"],setup(n,{expose:u,emit:y}){const l=n,i=y,m=e.useTemplateRef("elTableRef"),T=e.useTemplateRef("headerRef"),C=e.useTemplateRef("footerRef"),h=e.useSlots(),b=t=>{m.value.setScrollTop(0),i("update:paginationInfo",{...l.paginationInfo,pageNum:t})},x=t=>{m.value.setScrollTop(0),i("sortChange",t)},I=t=>{m.value.setScrollTop(0),i("update:paginationInfo",{...l.paginationInfo,pageSize:t})},B=t=>t.charAt(0).toUpperCase()+t.slice(1),L=(t,o)=>o.some(r=>t.hasOwnProperty(r)),D=e.computed(()=>{var r;let t=0;const o=((r=C.value)==null?void 0:r.clientHeight)??0;return T.value&&(t=T.value.clientHeight),l.maxHeight?l.maxHeight-t-o:l.autoResize?window.innerHeight-260-t-o:void 0});let N=!1;const k=(t,o)=>{for(const r in t)m.value.toggleRowExpansion(t[r],o),t[r].children&&k(t[r].children,o)},$=(...t)=>{t?(N=t[0],k(l.dataList,N)):(N=!N,k(l.dataList,N))},w=window.isSmallScreen,a=e.computed(()=>w?"total, prev, pager, next":l.paginationLayout),g=e.ref([]),F=()=>{const t=["handleLeft","handleRight"],o=Object.keys(h);g.value=o.filter(r=>!t.includes(r))},M=t=>{let o=t;return e.isRef(o)&&(o=o.value),Array.isArray(o)?o.filter(Boolean):o&&typeof o=="object"?Object.keys(o).filter(r=>o[r]):[]},P=e.computed(()=>new Set(M(l.hideItems))),z=e.computed(()=>l.persistenceKey&&l.persistenceKey.trim()||null),V=e.ref([]),A=e.ref(!1),H=e.ref(!1),X=e.computed(()=>{var t;return L(h,["handleLeft","handleRight"])||(((t=l.headerButtons)==null?void 0:t.length)??0)>0}),d=()=>{const t=(l.tableItem||[]).filter(c=>(c==null?void 0:c.prop)&&!c.hide),o=t.filter(c=>!P.value.has(c.prop)).map(c=>c.prop);let r=null;if(l.persistenceColumn&&z.value)try{const c=localStorage.getItem(z.value);c&&(r=JSON.parse(c))}catch(c){console.warn("EleScrollTable: Failed to read column settings",c)}if(r&&Array.isArray(r)){const c=new Set(t.map(E=>E.prop)),f=r.filter(E=>c.has(E));V.value=f}else V.value=o};e.watch(V,t=>{if(l.persistenceColumn&&z.value)try{localStorage.setItem(z.value,JSON.stringify(t))}catch(o){console.warn("EleScrollTable: Failed to save column settings",o)}},{deep:!0});const s=t=>P.value.has(t),ee=e.computed(()=>{const t=(l.tableItem||[]).filter(f=>(f==null?void 0:f.prop)&&!f.hide).map(f=>f.prop),o=new Set(V.value),r=t.filter(f=>!o.has(f)),c=M(l.hideItems);return Array.from(new Set([...c,...r]))}),te=e.computed(()=>(l.tableItem||[]).filter(o=>(o==null?void 0:o.prop)&&!o.hide).length>l.columnDisplayThreshold),_e=e.computed(()=>(l.tableItem||[]).filter(t=>(t==null?void 0:t.prop)&&!t.hide).map(t=>({key:t.prop,label:t.label??t.prop,disabled:s(t.prop)}))),J=e.getCurrentInstance(),$e=e.computed(()=>{var o;const t=(o=l.dragTipStorageKey)==null?void 0:o.trim();return t||(l.dragTipScope==="instance"?`baseTableDragTipSeen_v2_${(J==null?void 0:J.uid)??"default"}`:"baseTableDragTipSeen_v2")}),G=ne.useStorage($e,!1),O=e.ref(!1),ze=()=>{var r;const t=(r=m.value)==null?void 0:r.$el;if(!t)return!1;const o=t.querySelector(".el-table__body-wrapper .el-scrollbar__wrap")||t.querySelector(".el-table__body-wrapper");return o?o.scrollWidth>o.clientWidth+2:!1},Ae=()=>{!G.value&&ze()&&(O.value=!0,setTimeout(()=>{O.value&&(G.value=!0,O.value=!1)},6e3))},oe=()=>{O.value&&(O.value=!1),G.value=!0},He=(t,o,r)=>{var E,U,R,q;const c=o==null?void 0:o.property;if(c){const j=t==null?void 0:t[c];return j==null?"":String(j)}const f=(U=(E=r==null?void 0:r.target)==null?void 0:E.closest)==null?void 0:U.call(E,".cell");return f?((q=(R=f.innerText)==null?void 0:R.trim)==null?void 0:q.call(R))??"":""},Oe=async t=>{var o;if(!t)return!1;try{if((o=navigator==null?void 0:navigator.clipboard)!=null&&o.writeText)return await navigator.clipboard.writeText(t),!0;const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();const c=document.execCommand("copy");return document.body.removeChild(r),c}catch{return!1}},Re=async(t,o,r)=>{if(!l.enableDblclickCopy)return;const c=He(t,o,r);if(!c){l.copyFeedback&&W.ElMessage.warning(l.copyLocale.empty);return}const f=await Oe(c);l.copyFeedback&&(f?W.ElMessage.success(l.copyLocale.success):W.ElMessage.error(l.copyLocale.failed))},Fe=()=>{A.value=!A.value,i("toggleSearch",A.value)};e.watch(()=>l.tableItem,()=>{F(),d()},{immediate:!0}),e.watch(()=>l.hideItems,()=>{d()});const{start:je,stop:Me}=ae(m,{onStart:oe});return e.onMounted(()=>{setTimeout(()=>{je(),Ae()},100)}),e.onBeforeUnmount(()=>{Me()}),u({elTableRef:m,unFoldAll:$}),(t,o)=>{const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-checkbox"),f=e.resolveComponent("el-dropdown-item"),E=e.resolveComponent("el-checkbox-group"),U=e.resolveComponent("el-dropdown-menu"),R=e.resolveComponent("el-dropdown"),q=e.resolveComponent("el-transfer"),j=e.resolveComponent("el-tooltip"),Q=e.resolveComponent("el-table-column"),Pe=e.resolveComponent("el-table"),Ue=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",se,[O.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"drag-tip-overlay",onClick:oe},[...o[5]||(o[5]=[e.createStaticVNode('<div class="tip-content" data-v-d2dc3afc><svg class="tip-icon" viewBox="0 0 1024 1024" width="24" height="24" data-v-d2dc3afc><path d="M512 64C335.264 64 192 207.264 192 384v256c0 176.736 143.264 320 320 320s320-143.264 320-320V384c0-176.736-143.264-320-320-320z m0 72c136.992 0 248 111.008 248 248v256c0 136.992-111.008 248-248 248s-248-111.008-248-248V384c0-136.992 111.008-248 248-248z m0 144c-19.872 0-36 16.128-36 36v128c0 19.872 16.128 36 36 36s36-16.128 36-36V316c0-19.872-16.128-36-36-36z" fill="currentColor" data-v-d2dc3afc></path></svg><span class="tip-text" data-v-d2dc3afc>按住鼠标中键可横向拖动</span></div><div class="tip-close" data-v-d2dc3afc><svg viewBox="0 0 1024 1024" width="14" height="14" data-v-d2dc3afc><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" fill="currentColor" data-v-d2dc3afc></path></svg></div>',2)])])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"header",ref_key:"headerRef",ref:T},[e.renderSlot(t.$slots,"header",{},()=>[e.createElementVNode("div",ce,[e.renderSlot(t.$slots,"handleLeft",{},void 0,!0)]),e.createElementVNode("div",ie,[l.headerButtons.length!==0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l.headerButtons.includes("columnDisplay")||l.headerButtons.includes("comSearch")?(e.openBlock(),e.createElementBlock("div",de,[l.headerButtons.includes("columnDisplay")&&!te.value?(e.openBlock(),e.createBlock(R,{key:0,"max-height":380,"hide-on-click":!1,"popper-class":"columnDisplay"},{dropdown:e.withCtx(()=>[e.createVNode(U,null,{default:e.withCtx(()=>[e.createVNode(E,{modelValue:V.value,"onUpdate:modelValue":o[0]||(o[0]=p=>V.value=p)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tableItem,(p,_)=>(e.openBlock(),e.createBlock(f,{key:_},{default:e.withCtx(()=>[p.prop?(e.openBlock(),e.createBlock(c,{key:0,disabled:s(p.prop),size:"small",value:p.prop},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.label),1)]),_:2},1032,["disabled","value"])):e.createCommentVNode("",!0)]),_:2},1024))),128))]),_:1},8,["modelValue"])]),_:1})]),default:e.withCtx(()=>[e.createVNode(r,{class:e.normalizeClass(["table-search-button-item",l.headerButtons.includes("columnDisplay")?"right-border":""]),plain:""},{default:e.withCtx(()=>[...o[6]||(o[6]=[e.createTextVNode(" 列设置 ",-1)])]),_:1},8,["class"])]),_:1})):e.createCommentVNode("",!0),l.headerButtons.includes("columnDisplay")&&te.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(r,{class:e.normalizeClass(["table-search-button-item",l.headerButtons.includes("comSearch")?"right-border":""]),plain:"",onClick:o[1]||(o[1]=p=>H.value=!0)},{default:e.withCtx(()=>[...o[7]||(o[7]=[e.createTextVNode(" 列设置 ",-1)])]),_:1},8,["class"]),e.createVNode(e.unref(le.EPlusResizeDialog),{modelValue:H.value,"onUpdate:modelValue":o[4]||(o[4]=p=>H.value=p),title:"列设置",resizable:!0,"min-width":560,"min-height":380,class:"column-setting-dialog"},{footer:e.withCtx(()=>[e.createVNode(r,{onClick:o[3]||(o[3]=p=>H.value=!1)},{default:e.withCtx(()=>[...o[8]||(o[8]=[e.createTextVNode("关闭",-1)])]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",pe,[e.createVNode(q,{modelValue:V.value,"onUpdate:modelValue":o[2]||(o[2]=p=>V.value=p),filterable:"",data:_e.value,titles:["隐藏列","显示列"]},null,8,["modelValue","data"])])]),_:1},8,["modelValue"])],64)):e.createCommentVNode("",!0),l.headerButtons.includes("comSearch")?(e.openBlock(),e.createBlock(j,{key:2,content:A.value?"关闭搜索":"展开搜索",placement:"top"},{default:e.withCtx(()=>[e.createVNode(r,{class:"table-search-button-item",onClick:Fe,plain:""},{default:e.withCtx(()=>[...o[9]||(o[9]=[e.createTextVNode(" 搜索 ",-1)])]),_:1})]),_:1},8,["content"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"handleRight",{},void 0,!0)])],!0)],512)):e.createCommentVNode("",!0),e.createVNode(Pe,e.mergeProps({class:"elTable",ref_key:"elTableRef",ref:m,data:n.dataList,border:n.border,maxHeight:D.value?D.value>300?D.value:300:void 0,"show-overflow-tooltip":!0,style:{width:"100%"},stripe:"",onSortChange:x,onRowDblclick:Re},e.toHandlers(n.tableListener),n.elTableConfig),{default:e.withCtx(()=>[n.showExpand?(e.openBlock(),e.createBlock(Q,{key:0,type:"expand"},{default:e.withCtx(({row:p})=>[e.renderSlot(t.$slots,"expand",{backData:p},void 0,!0)]),_:3})):e.createCommentVNode("",!0),n.showChoose?(e.openBlock(),e.createBlock(Q,e.mergeProps({key:1,type:"selection",width:"55",align:n.align},n.selectionConfig),null,16,["align"])):e.createCommentVNode("",!0),n.showIndex?(e.openBlock(),e.createBlock(Q,{key:2,width:"55",align:n.align,label:"序号",type:"index"},null,8,["align"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tableItem,p=>(e.openBlock(),e.createBlock(re,{key:p.prop,item:p,align:n.align,hideItems:ee.value},e.createSlots({_:2},[e.renderList(g.value,_=>({name:_,fn:e.withCtx(({backData:K,currentItem:qe})=>[e.renderSlot(t.$slots,_,{backData:K,row:K,currentItem:qe},void 0,!0)])})),e.renderList(p.slotNames,_=>({name:_,fn:e.withCtx(K=>[e.renderSlot(t.$slots,`${p.prop}`+B(_),{backData:K},void 0,!0)])}))]),1032,["item","align","hideItems"]))),128))]),_:3},16,["data","border","maxHeight"]),n.pagination?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["footer lmw-pagination-footer",{isSmall:e.unref(w)}]),ref_key:"footerRef",ref:C},[e.renderSlot(t.$slots,"footer",{},()=>[e.createVNode(Ue,{onSizeChange:I,onCurrentChange:b,"current-page":n.paginationInfo.pageNum,"page-size":n.paginationInfo.pageSize,"page-sizes":[20,50,100,200,300],layout:a.value,total:n.listCount,"pager-count":e.unref(w)?5:7,background:"","hide-on-single-page":""},null,8,["current-page","page-size","layout","total","pager-count"])],!0)],2)):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-d2dc3afc"]]),me={class:"mobileContent"},fe={key:0,class:"mb12 header"},ue={class:"headerContent"},he={class:"handleRight"},ge={class:"handleRight"},ye={key:1,class:"dataList"},be={class:"data-card overlayColor"},ke={key:0,class:"card-header"},Ce={class:"order-number"},Se={class:"label"},we=["onClick"],Be={class:"info-list"},Ne={class:"info-row"},Ve={class:"label"},Ee={class:"value"},Te={class:"card-footer mobileFooter"},Ie={key:3,class:"footer lmw-pagination-footer"},Le={class:"mr2"},v=Y(Object.assign({name:"BaseMobileTable"},{__name:"MoblieTable",props:{dataList:{type:Array,default:()=>[]},tableItem:{type:Array,default:()=>[]},tableListener:{type:Object,default:()=>({})},showChoose:{type:Boolean,default:!1},pagination:{type:Boolean,default:!0},listCount:{type:Number,default:0},paginationInfo:{type:Object,default:()=>({pageNum:1,pageSize:10})},paginationLayout:{type:String,default:"prev, pager, next"},hideItems:{type:[Array,Object],default:()=>({})},showBacktop:{type:Boolean,default:!0},visibilityHeight:{type:Number,default:100},selectionConfig:{type:Object,default:()=>({})},tableLayout:{type:Object,default:()=>({xl:6,lg:8,md:12,sm:12,xs:24})}},emits:["cardHeaderClick","selectionChange","update:paginationInfo"],setup(n,{expose:u,emit:y}){const l=n,i=y;let m=[],T=[],C=[];const h=()=>{l.tableItem.forEach(a=>{a.mobileSlot==="header"&&m.push({...a,slotName:a.slotName??a.prop+"Header"}),(a.mobileSlot==="footer"||a.prop==="todo")&&C.push({...a,slotName:a.slotName??a.prop+"Slot"}),a.mobileSlot||T.push({...a,slotName:a.slotName??a.prop+"Content"})})};e.watch(()=>l.tableItem,()=>{h()},{immediate:!0});const b=()=>{const a=document.querySelector(".el-main");a==null||a.scrollTo(0,0)},x=a=>{a.querySelectorAll("*").length<=1?a.setAttribute("hiden",""):a.removeAttribute("hiden")},I={mounted:a=>{x(a)},updated:a=>{x(a)}},B=a=>{let g=!1;return e.isRef(l.hideItems)?l.hideItems.value.includes(a.prop)&&(g=!0):Array.isArray(l.hideItems)&&l.hideItems.includes(a.prop)&&(g=!0),g},L=a=>{i("cardHeaderClick",a)},D=()=>{i("selectionChange",k.value)},N=(a,g)=>g.some(F=>a.hasOwnProperty(F)),k=e.ref([]),$=e.computed(()=>k.value.length===l.dataList.length);return u({checkAll:()=>{$.value?k.value=[]:k.value=l.dataList}}),(a,g)=>{const F=e.resolveComponent("el-scrollbar"),M=e.resolveComponent("el-checkbox"),P=e.resolveComponent("el-col"),z=e.resolveComponent("el-row"),V=e.resolveComponent("el-checkbox-group"),A=e.resolveComponent("el-empty"),H=e.resolveComponent("el-pagination"),X=e.resolveComponent("el-backtop");return e.openBlock(),e.createElementBlock("div",me,[N(a.$slots,["handleLeft","handleRight"])?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(F,null,{default:e.withCtx(()=>[e.createElementVNode("div",ue,[e.renderSlot(a.$slots,"header",{},()=>[e.createElementVNode("div",he,[e.renderSlot(a.$slots,"handleLeft",{},void 0,!0)]),e.createElementVNode("div",ge,[e.renderSlot(a.$slots,"handleRight",{},void 0,!0)])],!0)])]),_:3})])):e.createCommentVNode("",!0),n.dataList.length!==0?(e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(V,{modelValue:k.value,"onUpdate:modelValue":g[0]||(g[0]=d=>k.value=d),onChange:D},{default:e.withCtx(()=>[e.createVNode(z,{gutter:12},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataList,d=>(e.openBlock(),e.createBlock(P,e.mergeProps({ref_for:!0},n.tableLayout,{class:"mb12"}),{default:e.withCtx(()=>[e.createElementVNode("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),s=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!B(s)&&!s.hide?(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",Ce,[e.renderSlot(a.$slots,s.slotName+"Header",{backData:Object.assign(d,{column:s})},()=>[e.createElementVNode("div",Se,e.toDisplayString(s.label)+":",1)],!0),e.renderSlot(a.$slots,s.slotName,{backData:Object.assign(d,{column:s})},()=>[e.createElementVNode("div",{class:"value",onClick:ee=>L(d)},e.toDisplayString(d[s.prop]),9,we)],!0)]),n.showChoose?(e.openBlock(),e.createBlock(M,{key:0,class:"checkSize",value:d,disabled:n.selectionConfig.selectable&&!n.selectionConfig.selectable(d)},null,8,["value","disabled"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),256)),e.createElementVNode("div",Be,[e.createElementVNode("div",Ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(T),s=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s.prop},[!B(s)&&!s.hide?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["info-item",{"full-width":s.width>=160||s.minWidth>=160}])},[s.prop!=="todo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(a.$slots,s.slotName+"Header",{backData:Object.assign(d,{column:s})},()=>[e.createElementVNode("span",Ve,e.toDisplayString(s.label)+": ",1)],!0),e.renderSlot(a.$slots,s.slotName,{backData:Object.assign(d,{column:s})},()=>[e.createElementVNode("span",Ee,e.toDisplayString(d[s.prop]),1)],!0)],64)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],64))),128))])]),e.withDirectives((e.openBlock(),e.createElementBlock("div",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(C),s=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[B(s)?e.createCommentVNode("",!0):e.renderSlot(a.$slots,s.slotName,{key:0,backData:Object.assign(d,{column:s})},void 0,!0)],64))),256))])),[[I]])])]),_:2},1040))),256))]),_:3})]),_:3},8,["modelValue"])])):(e.openBlock(),e.createBlock(A,{key:2,class:"overlayColor",description:"暂无数据"})),n.pagination&&n.listCount>n.paginationInfo.pageSize?(e.openBlock(),e.createElementBlock("div",Ie,[e.createElementVNode("span",Le,e.toDisplayString(n.listCount)+"条 ",1),e.createVNode(H,{onSizeChange:b,onCurrentChange:b,"current-page":n.paginationInfo.pageNum,"onUpdate:currentPage":g[1]||(g[1]=d=>n.paginationInfo.pageNum=d),"page-size":n.paginationInfo.pageSize,"onUpdate:pageSize":g[2]||(g[2]=d=>n.paginationInfo.pageSize=d),layout:n.paginationLayout,total:n.listCount,"pager-count":5,background:"","hide-on-single-page":""},null,8,["current-page","page-size","layout","total"])])):e.createCommentVNode("",!0),e.createVNode(X,{target:".el-main",right:10,bottom:100,"visibility-height":n.visibilityHeight},null,8,["visibility-height"])])}}}),[["__scopeId","data-v-4277cdf1"]]),xe=[Z,v],De={install:n=>{xe.forEach(u=>{const y=u.name||u.__name;y&&n.component(y,u)})}};S.MoblieTable=v,S.Table=Z,S.default=De,Object.defineProperties(S,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.resize-handle{-webkit-user-select:none;user-select:none}.custom-dialog-actions{display:flex;align-items:center}.custom-dialog-header{display:flex;justify-content:space-between;align-items:center;width:100%}.custom-dialog-actions .custom-header-btn{position:static;margin-left:10px;font-size:16px;width:20px;height:20px;line-height:1;border:none;background:transparent;cursor:pointer;padding:0;color:var(--el-color-info)}.custom-dialog-actions .custom-header-btn:hover{color:var(--el-color-primary)}.custom-dialog-actions .custom-header-btn svg{width:100%;height:100%;vertical-align:middle}.e-plus-resize-dialog{display:flex;flex-direction:column;max-height:85vh;overflow:hidden;margin-bottom:0}.e-plus-resize-dialog.is-fullscreen{max-height:100vh;height:100vh!important;margin:0!important}.e-plus-resize-dialog .el-dialog__header,.e-plus-resize-dialog .el-dialog__footer{flex-shrink:0}.e-plus-resize-dialog .el-dialog__body{flex:1;overflow:auto;min-height:0}.e-plus-resize-dialog.is-modal-hidden{pointer-events:auto!important}.drag-tip-overlay[data-v-d2dc3afc]{position:absolute;top:20px;right:20px;z-index:2000;display:flex;align-items:center;gap:16px;background:#000000d9;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:1px solid rgba(255,255,255,.25);box-shadow:0 8px 24px #0000004d;border-radius:30px;padding:12px 20px;cursor:pointer;transition:all .3s ease;-webkit-user-select:none;user-select:none}.drag-tip-overlay[data-v-d2dc3afc]:hover{background:#000000f2;border-color:#fff6;transform:scale(1.05)}.tip-content[data-v-d2dc3afc]{display:flex;align-items:center;gap:12px;color:#fff;font-size:16px;font-weight:600;letter-spacing:.5px}.tip-icon[data-v-d2dc3afc]{color:var(--el-color-primary);animation:scrollIconAnim-d2dc3afc 2s ease-in-out infinite;display:block}.tip-close[data-v-d2dc3afc]{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:#fff3;color:#ddd;transition:all .2s}.tip-close[data-v-d2dc3afc]:hover{background:#fff6;color:#fff}@keyframes scrollIconAnim-d2dc3afc{0%,to{transform:translateY(0)}50%{transform:translateY(2px)}}.header[data-v-d2dc3afc]{position:relative;overflow-x:auto;box-sizing:border-box;display:flex;justify-content:space-between;align-items:center;width:100%;max-width:100%;background-color:var(--ba-bg-color-overlay);border:1px solid var(--ba-border-color);border-bottom:none;padding:13px 15px;font-size:14px}.header .table-header-operate-text[data-v-d2dc3afc]{margin-left:6px}.handleRight[data-v-d2dc3afc]{display:flex;align-items:center;gap:8px}.table-search-button-group[data-v-d2dc3afc]{display:flex;align-items:center}.table-search-button-item[data-v-d2dc3afc]{height:30px;padding:0 12px}.right-border[data-v-d2dc3afc]{border-top-right-radius:0;border-bottom-right-radius:0;border-right:1px solid var(--el-border-color)}.footer[data-v-d2dc3afc]{background-color:var(--ba-bg-color-overlay)}.footer[data-v-d2dc3afc] .el-pagination{display:flex;flex-wrap:wrap;flex-direction:row;justify-content:flex-end;box-sizing:border-box;padding:13px 15px}.isSmall[data-v-d2dc3afc] .btn-prev{margin:0 2px}.isSmall[data-v-d2dc3afc] .btn-next{margin:0 0 0 2px}.isSmall[data-v-d2dc3afc] .el-pager li{margin:0 1px}.isSmall[data-v-d2dc3afc] .el-pagination{padding:10px}.baseTable[data-v-d2dc3afc]{position:relative}.baseTable[data-v-d2dc3afc] .el-table__body-wrapper .el-table-column--selection>.cell{display:block}.column-setting-dialog[data-v-d2dc3afc] .el-dialog{display:flex;flex-direction:column;height:100%}.column-setting-dialog[data-v-d2dc3afc] .el-dialog__body{flex:1;min-height:0;overflow:hidden}.column-setting-body[data-v-d2dc3afc]{height:100%}.column-setting-body[data-v-d2dc3afc] .el-transfer{height:100%;display:flex;justify-content:center;align-items:center}.column-setting-body[data-v-d2dc3afc] .el-transfer-panel{flex:1;width:auto;display:flex;flex-direction:column;overflow:hidden}.column-setting-body[data-v-d2dc3afc] .el-transfer__buttons{display:flex;flex-direction:column;padding:0 10px}.column-setting-body[data-v-d2dc3afc] .el-transfer__buttons .el-button{margin-left:0;margin-bottom:10px;display:flex;justify-content:center;align-items:center}.column-setting-body[data-v-d2dc3afc] .el-transfer__buttons .el-button:last-child{margin-bottom:0}.column-setting-body[data-v-d2dc3afc] .el-transfer__buttons .el-button+.el-button{margin-left:0}.column-setting-body[data-v-d2dc3afc] .el-transfer-panel__body{flex:1;height:auto!important;display:flex;flex-direction:column;overflow:hidden}.column-setting-body[data-v-d2dc3afc] .el-transfer-panel__list{flex:1;height:auto!important;overflow-y:auto}.column-setting-body[data-v-d2dc3afc] .el-transfer-panel__filter{margin:10px 15px}.header[data-v-4277cdf1]{border:1px solid var(--ba-border-color);background-color:var(--ba-bg-color-overlay);font-size:14px;padding:12px 12px 0}.headerContent[data-v-4277cdf1]{padding-bottom:12px}.data-card[data-v-4277cdf1]{border-radius:12px;line-height:32px;border:1px solid var(--ba-border-color);overflow:hidden;height:100%}.checkSize[data-v-4277cdf1] .el-checkbox__inner{height:18px;width:18px}.checkSize[data-v-4277cdf1] .el-checkbox__inner:after{left:5px;width:5px;height:10px}.card-header[data-v-4277cdf1]{display:flex;justify-content:space-between;align-items:center;padding:12px;border-bottom:1px solid var(--el-border-color)}.card-header .order-number[data-v-4277cdf1]{display:flex;font-size:15px;overflow:hidden}.card-header .order-number .label[data-v-4277cdf1]{max-width:90px;color:var(--el-text-color-primary);font-weight:500}.card-header .order-number .value[data-v-4277cdf1]{color:var(--el-color-primary);font-weight:500;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px;cursor:pointer}.info-list[data-v-4277cdf1]{padding:16px}.info-list .info-row[data-v-4277cdf1]{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px 24px}.info-list .info-item[data-v-4277cdf1]{display:flex;align-items:center;font-size:14px;line-height:1.5;white-space:nowrap;overflow:hidden}.info-list .info-item.full-width[data-v-4277cdf1]{grid-column:1/-1}.info-list .info-item .label[data-v-4277cdf1]{color:#666;margin-right:4px}.info-list .info-item .value[data-v-4277cdf1]{color:var(--el-text-color-primary);flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.card-footer[data-v-4277cdf1]{display:flex;justify-content:flex-end;flex-wrap:wrap;padding:10px 12px}.card-footer[data-v-4277cdf1] .el-button{margin:4px!important}@media screen and (max-width: 768px){.info-list[data-v-4277cdf1]{padding:12px}.info-list .info-row[data-v-4277cdf1]{grid-template-columns:repeat(2,1fr);gap:8px}.info-item[data-v-4277cdf1]{font-size:13px}.card-footer[data-v-4277cdf1]{padding:8px 12px;flex-wrap:wrap}}@media screen and (max-width: 375px){.info-list .info-row[data-v-4277cdf1]{grid-template-columns:1fr}}.footer[data-v-4277cdf1]{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap}.footer[data-v-4277cdf1] .el-pager li{margin:0 1px}.footer[data-v-4277cdf1] .btn-prev{margin:0 2px}.footer[data-v-4277cdf1] .btn-next{margin:0 0 0 2px}.footer[data-v-4277cdf1] .el-pagination{padding:0;--el-pagination-button-height: 28px;--el-pagination-button-width: 28px}.footer[data-v-4277cdf1]{background-color:var(--ba-bg-color-overlay);padding:8px}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ele-scroll-table-vue3",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/ele-scroll-table-vue3.umd.cjs",
|
|
6
|
+
"module": "./dist/ele-scroll-table-vue3.mjs",
|
|
7
|
+
"style": "./dist/style.css",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/ele-scroll-table-vue3.mjs",
|
|
11
|
+
"require": "./dist/ele-scroll-table-vue3.umd.cjs"
|
|
12
|
+
},
|
|
13
|
+
"./style.css": "./dist/style.css"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "vite --host 0.0.0.0 --port 5173",
|
|
20
|
+
"build": "vite build",
|
|
21
|
+
"prepublishOnly": "npm run build",
|
|
22
|
+
"release": "npm version patch && npm publish"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"vue": ">=3.5.0",
|
|
26
|
+
"element-plus": ">=2.0.0",
|
|
27
|
+
"@vueuse/core": ">=10.0.0",
|
|
28
|
+
"e-plus-dialog-vue3": ">=1.0.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@vitejs/plugin-vue": "^5.0.0",
|
|
32
|
+
"vite": "^5.0.0",
|
|
33
|
+
"vue": "^3.5.0",
|
|
34
|
+
"element-plus": "^2.0.0",
|
|
35
|
+
"@vueuse/core": "^10.0.0",
|
|
36
|
+
"e-plus-dialog-vue3": "^1.0.23",
|
|
37
|
+
"sass": "^1.70.0"
|
|
38
|
+
}
|
|
39
|
+
}
|