@lx-frontend/wrap-element-ui 1.0.25 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -40
- package/dist/index.css +1 -0
- package/dist/index.mjs +2097 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/components/EditableTable/features/bizColorSelect.vue.d.ts +31 -0
- package/dist/types/components/EditableTable/features/bizTableHeaderPopover/BizCheckboxFilter.vue.d.ts +23 -0
- package/dist/types/components/EditableTable/features/bizTableHeaderPopover/BizColorRadioFilter.vue.d.ts +23 -0
- package/dist/types/components/EditableTable/features/bizTableHeaderPopover/BizDoubleDatePickerFilter.vue.d.ts +23 -0
- package/dist/types/components/EditableTable/features/bizTableHeaderPopover/BizInputFilter.vue.d.ts +23 -0
- package/dist/types/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.helper.d.ts +48 -0
- package/dist/types/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.vue.d.ts +23 -0
- package/dist/types/components/EditableTable/features/bizTableHeaderPopover/BizRadioFilter.vue.d.ts +23 -0
- package/dist/types/components/EditableTable/features/bizTableHeaderPopover/BizSortFilter.vue.d.ts +25 -0
- package/dist/types/components/EditableTable/features/bizTableHeaderPopover/index.vue.d.ts +77 -0
- package/dist/types/components/EditableTable/features/bizTableOperatePopover.vue.d.ts +36 -0
- package/dist/types/components/EditableTable/features/bizViewSettingDialog.vue.d.ts +35 -0
- package/{src/components/EditableTable/bizHooks/index.ts → dist/types/components/EditableTable/hooks/index.d.ts} +5 -3
- package/dist/types/components/EditableTable/hooks/useCellHover.d.ts +19 -0
- package/dist/types/components/EditableTable/hooks/useColumnHeaderOperation.d.ts +37 -0
- package/dist/types/components/EditableTable/hooks/useDefaultOperation.d.ts +22 -0
- package/dist/types/components/EditableTable/hooks/useDragSort.d.ts +15 -0
- package/dist/types/components/EditableTable/hooks/usePagination.d.ts +12 -0
- package/dist/types/components/EditableTable/hooks/useRowBgColor.d.ts +18 -0
- package/dist/types/components/EditableTable/hooks/useRowEdit.d.ts +14 -0
- package/dist/types/components/EditableTable/hooks/useTableRender.d.ts +41 -0
- package/dist/types/components/EditableTable/hooks/useViewSetting.d.ts +26 -0
- package/dist/types/components/EditableTable/index.vue.d.ts +4502 -0
- package/dist/types/components/EditableTable/types.d.ts +419 -0
- package/dist/types/components/helper.d.ts +8 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/stories/EditableTable.fake.d.ts +33 -0
- package/dist/types/stories/EditableTable.hook.d.ts +12 -0
- package/dist/types/stories/EditableTable.stories.d.ts +18 -0
- package/dist/types/stories/Test.stories.d.ts +6 -0
- package/package.json +66 -73
- package/src/components/AddMembers/index.vue +0 -149
- package/src/components/AuditSteps/index.vue +0 -140
- package/src/components/DemoComponent/index.vue +0 -21
- package/src/components/EditableTable/README.md +0 -147
- package/src/components/EditableTable/bizHooks/useCellHover.ts +0 -72
- package/src/components/EditableTable/bizHooks/useColumnHeaderOperation.ts +0 -339
- package/src/components/EditableTable/bizHooks/useDefaultOperation.ts +0 -96
- package/src/components/EditableTable/bizHooks/useDragSort.ts +0 -291
- package/src/components/EditableTable/bizHooks/usePagination.ts +0 -31
- package/src/components/EditableTable/bizHooks/useRowBgColor.ts +0 -44
- package/src/components/EditableTable/bizHooks/useViewSetting.ts +0 -206
- package/src/components/EditableTable/features/bizColorSelect.vue +0 -63
- package/src/components/EditableTable/features/bizEditCell.vue +0 -44
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizCheckboxFilter.vue +0 -40
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizColorRadioFilter.vue +0 -56
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizDoubleDatePickerFilter.vue +0 -94
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizInputFilter.vue +0 -26
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.helper.ts +0 -131
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.vue +0 -115
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizRadioFilter.vue +0 -39
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizSortFilter.vue +0 -50
- package/src/components/EditableTable/features/bizTableHeaderPopover/index.vue +0 -160
- package/src/components/EditableTable/features/bizTableOperatePopover.vue +0 -67
- package/src/components/EditableTable/features/bizViewSettingDialog.vue +0 -137
- package/src/components/EditableTable/index.less +0 -820
- package/src/components/EditableTable/index.vue +0 -681
- package/src/components/EditableTable/pin-top.png +0 -0
- package/src/components/EditableTable/types/index.ts +0 -212
- package/src/components/Ellipsis/MultilineEllipsis.vue +0 -141
- package/src/components/Ellipsis/index.vue +0 -119
- package/src/components/LxTable/index.vue +0 -296
- package/src/components/PopoverForm/index.vue +0 -66
- package/src/components/SearchForm/index.vue +0 -262
- package/src/components/SearchForm/types/index.ts +0 -81
- package/src/components/SearchSelect/index.vue +0 -153
- package/src/components/helper.ts +0 -37
- package/src/components/index.ts +0 -24
- package/src/components/singleMessage/index.ts +0 -44
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2097 @@
|
|
|
1
|
+
import { defineComponent as te, openBlock as g, createElementBlock as T, createElementVNode as V, ref as M, watch as pe, computed as ae, onMounted as je, onBeforeUnmount as He, nextTick as be, toRefs as Ee, createBlock as G, unref as r, isRef as Se, withCtx as R, createVNode as N, Fragment as q, renderList as re, toDisplayString as Y, createTextVNode as X, normalizeClass as he, resolveComponent as Q, normalizeStyle as we, mergeProps as ie, createCommentVNode as ee, renderSlot as le, resolveDynamicComponent as yt, normalizeProps as ht, guardReactiveProps as _t, useSlots as wt, resolveDirective as St, withDirectives as Ct, createSlots as Fe } from "vue";
|
|
2
|
+
import { ElDialog as xt, ElCheckboxGroup as kt, ElCheckbox as $t, ElInput as Ue, ElIcon as We, ElButton as ye, ElTable as Et, ElTableColumn as fe, ElSelect as Pt, ElOption as Dt, ElDatePicker as Vt, ElPagination as Ft } from "element-plus";
|
|
3
|
+
import se from "dayjs";
|
|
4
|
+
import './index.css';/*! Element Plus Icons Vue v2.3.2 */
|
|
5
|
+
var Rt = /* @__PURE__ */ te({
|
|
6
|
+
name: "Close",
|
|
7
|
+
__name: "close",
|
|
8
|
+
setup(e) {
|
|
9
|
+
return (i, l) => (g(), T("svg", {
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
+
viewBox: "0 0 1024 1024"
|
|
12
|
+
}, [
|
|
13
|
+
V("path", {
|
|
14
|
+
fill: "currentColor",
|
|
15
|
+
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
|
|
16
|
+
})
|
|
17
|
+
]));
|
|
18
|
+
}
|
|
19
|
+
}), Tt = Rt, Ot = /* @__PURE__ */ te({
|
|
20
|
+
name: "Setting",
|
|
21
|
+
__name: "setting",
|
|
22
|
+
setup(e) {
|
|
23
|
+
return (i, l) => (g(), T("svg", {
|
|
24
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
+
viewBox: "0 0 1024 1024"
|
|
26
|
+
}, [
|
|
27
|
+
V("path", {
|
|
28
|
+
fill: "currentColor",
|
|
29
|
+
d: "M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357 357 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a352 352 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357 357 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294 294 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293 293 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294 294 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288 288 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293 293 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a288 288 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256"
|
|
30
|
+
})
|
|
31
|
+
]));
|
|
32
|
+
}
|
|
33
|
+
}), Lt = Ot;
|
|
34
|
+
function It(e, i) {
|
|
35
|
+
const l = M(e.currentPage || 1), o = M(e.pageSize || 10);
|
|
36
|
+
return pe(
|
|
37
|
+
() => e.currentPage,
|
|
38
|
+
(a) => {
|
|
39
|
+
a !== void 0 && (l.value = a);
|
|
40
|
+
}
|
|
41
|
+
), pe(
|
|
42
|
+
() => e.pageSize,
|
|
43
|
+
(a) => {
|
|
44
|
+
a !== void 0 && (o.value = a);
|
|
45
|
+
}
|
|
46
|
+
), {
|
|
47
|
+
currentPage: l,
|
|
48
|
+
pageSize: o,
|
|
49
|
+
handlePageChange: (a) => {
|
|
50
|
+
l.value = a, i("update:currentPage", a), i("page-change", { page: a, size: o.value });
|
|
51
|
+
},
|
|
52
|
+
handleSizeChange: (a) => {
|
|
53
|
+
o.value = a, i("update:pageSize", a), i("page-change", { page: 1, size: a });
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function Mt(e, i, l) {
|
|
58
|
+
return {
|
|
59
|
+
renderedColumns: ae(() => i.value.map((t) => e.columns.find((d) => d.prop === t)).filter(Boolean).map((t, d) => ({
|
|
60
|
+
...t,
|
|
61
|
+
// 设置固定列
|
|
62
|
+
fixed: d < l.value ? "left" : t == null ? void 0 : t.fixed
|
|
63
|
+
}))),
|
|
64
|
+
hasSlot: (t) => !!t.slotName,
|
|
65
|
+
hasEditSlot: (t) => !!t.editSlotName,
|
|
66
|
+
hasHoverSlot: (t) => !!t.hoverSlotName,
|
|
67
|
+
formatCellValue: (t, d, C) => {
|
|
68
|
+
const h = t[d.prop];
|
|
69
|
+
return d.formatter ? d.formatter(t, d, h, C) : h;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
var _e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
74
|
+
function Ge(e) {
|
|
75
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
76
|
+
}
|
|
77
|
+
function At(e) {
|
|
78
|
+
var i = typeof e;
|
|
79
|
+
return e != null && (i == "object" || i == "function");
|
|
80
|
+
}
|
|
81
|
+
var Pe = At, Bt = typeof _e == "object" && _e && _e.Object === Object && _e, zt = Bt, Nt = zt, jt = typeof self == "object" && self && self.Object === Object && self, Ht = Nt || jt || Function("return this")(), Ke = Ht, Ut = Ke, Wt = function() {
|
|
82
|
+
return Ut.Date.now();
|
|
83
|
+
}, Gt = Wt, Kt = /\s/;
|
|
84
|
+
function Xt(e) {
|
|
85
|
+
for (var i = e.length; i-- && Kt.test(e.charAt(i)); )
|
|
86
|
+
;
|
|
87
|
+
return i;
|
|
88
|
+
}
|
|
89
|
+
var Yt = Xt, qt = Yt, Jt = /^\s+/;
|
|
90
|
+
function Qt(e) {
|
|
91
|
+
return e && e.slice(0, qt(e) + 1).replace(Jt, "");
|
|
92
|
+
}
|
|
93
|
+
var Zt = Qt, eo = Ke, to = eo.Symbol, Xe = to, Re = Xe, Ye = Object.prototype, oo = Ye.hasOwnProperty, ao = Ye.toString, me = Re ? Re.toStringTag : void 0;
|
|
94
|
+
function no(e) {
|
|
95
|
+
var i = oo.call(e, me), l = e[me];
|
|
96
|
+
try {
|
|
97
|
+
e[me] = void 0;
|
|
98
|
+
var o = !0;
|
|
99
|
+
} catch {
|
|
100
|
+
}
|
|
101
|
+
var c = ao.call(e);
|
|
102
|
+
return o && (i ? e[me] = l : delete e[me]), c;
|
|
103
|
+
}
|
|
104
|
+
var lo = no, ro = Object.prototype, io = ro.toString;
|
|
105
|
+
function so(e) {
|
|
106
|
+
return io.call(e);
|
|
107
|
+
}
|
|
108
|
+
var uo = so, Te = Xe, co = lo, po = uo, fo = "[object Null]", vo = "[object Undefined]", Oe = Te ? Te.toStringTag : void 0;
|
|
109
|
+
function go(e) {
|
|
110
|
+
return e == null ? e === void 0 ? vo : fo : Oe && Oe in Object(e) ? co(e) : po(e);
|
|
111
|
+
}
|
|
112
|
+
var mo = go;
|
|
113
|
+
function bo(e) {
|
|
114
|
+
return e != null && typeof e == "object";
|
|
115
|
+
}
|
|
116
|
+
var yo = bo, ho = mo, _o = yo, wo = "[object Symbol]";
|
|
117
|
+
function So(e) {
|
|
118
|
+
return typeof e == "symbol" || _o(e) && ho(e) == wo;
|
|
119
|
+
}
|
|
120
|
+
var Co = So, xo = Zt, Le = Pe, ko = Co, Ie = NaN, $o = /^[-+]0x[0-9a-f]+$/i, Eo = /^0b[01]+$/i, Po = /^0o[0-7]+$/i, Do = parseInt;
|
|
121
|
+
function Vo(e) {
|
|
122
|
+
if (typeof e == "number")
|
|
123
|
+
return e;
|
|
124
|
+
if (ko(e))
|
|
125
|
+
return Ie;
|
|
126
|
+
if (Le(e)) {
|
|
127
|
+
var i = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
128
|
+
e = Le(i) ? i + "" : i;
|
|
129
|
+
}
|
|
130
|
+
if (typeof e != "string")
|
|
131
|
+
return e === 0 ? e : +e;
|
|
132
|
+
e = xo(e);
|
|
133
|
+
var l = Eo.test(e);
|
|
134
|
+
return l || Po.test(e) ? Do(e.slice(2), l ? 2 : 8) : $o.test(e) ? Ie : +e;
|
|
135
|
+
}
|
|
136
|
+
var Fo = Vo, Ro = Pe, xe = Gt, Me = Fo, To = "Expected a function", Oo = Math.max, Lo = Math.min;
|
|
137
|
+
function Io(e, i, l) {
|
|
138
|
+
var o, c, b, a, n, t, d = 0, C = !1, h = !1, w = !0;
|
|
139
|
+
if (typeof e != "function")
|
|
140
|
+
throw new TypeError(To);
|
|
141
|
+
i = Me(i) || 0, Ro(l) && (C = !!l.leading, h = "maxWait" in l, b = h ? Oo(Me(l.maxWait) || 0, i) : b, w = "trailing" in l ? !!l.trailing : w);
|
|
142
|
+
function x(A) {
|
|
143
|
+
var p = o, D = c;
|
|
144
|
+
return o = c = void 0, d = A, a = e.apply(D, p), a;
|
|
145
|
+
}
|
|
146
|
+
function z(A) {
|
|
147
|
+
return d = A, n = setTimeout(m, i), C ? x(A) : a;
|
|
148
|
+
}
|
|
149
|
+
function O(A) {
|
|
150
|
+
var p = A - t, D = A - d, S = i - p;
|
|
151
|
+
return h ? Lo(S, b - D) : S;
|
|
152
|
+
}
|
|
153
|
+
function f(A) {
|
|
154
|
+
var p = A - t, D = A - d;
|
|
155
|
+
return t === void 0 || p >= i || p < 0 || h && D >= b;
|
|
156
|
+
}
|
|
157
|
+
function m() {
|
|
158
|
+
var A = xe();
|
|
159
|
+
if (f(A))
|
|
160
|
+
return P(A);
|
|
161
|
+
n = setTimeout(m, O(A));
|
|
162
|
+
}
|
|
163
|
+
function P(A) {
|
|
164
|
+
return n = void 0, w && o ? x(A) : (o = c = void 0, a);
|
|
165
|
+
}
|
|
166
|
+
function H() {
|
|
167
|
+
n !== void 0 && clearTimeout(n), d = 0, o = t = c = n = void 0;
|
|
168
|
+
}
|
|
169
|
+
function U() {
|
|
170
|
+
return n === void 0 ? a : P(xe());
|
|
171
|
+
}
|
|
172
|
+
function K() {
|
|
173
|
+
var A = xe(), p = f(A);
|
|
174
|
+
if (o = arguments, c = this, t = A, p) {
|
|
175
|
+
if (n === void 0)
|
|
176
|
+
return z(t);
|
|
177
|
+
if (h)
|
|
178
|
+
return clearTimeout(n), n = setTimeout(m, i), x(t);
|
|
179
|
+
}
|
|
180
|
+
return n === void 0 && (n = setTimeout(m, i)), a;
|
|
181
|
+
}
|
|
182
|
+
return K.cancel = H, K.flush = U, K;
|
|
183
|
+
}
|
|
184
|
+
var qe = Io;
|
|
185
|
+
const Mo = /* @__PURE__ */ Ge(qe);
|
|
186
|
+
var Ao = qe, Bo = Pe, zo = "Expected a function";
|
|
187
|
+
function No(e, i, l) {
|
|
188
|
+
var o = !0, c = !0;
|
|
189
|
+
if (typeof e != "function")
|
|
190
|
+
throw new TypeError(zo);
|
|
191
|
+
return Bo(l) && (o = "leading" in l ? !!l.leading : o, c = "trailing" in l ? !!l.trailing : c), Ao(e, i, {
|
|
192
|
+
leading: o,
|
|
193
|
+
maxWait: i,
|
|
194
|
+
trailing: c
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
var jo = No;
|
|
198
|
+
const Je = /* @__PURE__ */ Ge(jo);
|
|
199
|
+
function Ho({
|
|
200
|
+
props: e,
|
|
201
|
+
emit: i,
|
|
202
|
+
viewSettingDragSortOptions: l,
|
|
203
|
+
currentPage: o,
|
|
204
|
+
pageSize: c,
|
|
205
|
+
beforeDragStart: b,
|
|
206
|
+
currScope: a,
|
|
207
|
+
tableDomRef: n
|
|
208
|
+
}) {
|
|
209
|
+
const t = M({}), d = M(!1), C = M("row"), h = M(!1);
|
|
210
|
+
je(() => {
|
|
211
|
+
n.value.$el.addEventListener("mousedown", () => {
|
|
212
|
+
h.value = !0;
|
|
213
|
+
}), document.addEventListener("mousedown", w), document.addEventListener("mousemove", x), document.addEventListener("mouseup", z);
|
|
214
|
+
}), He(() => {
|
|
215
|
+
n.value.$el.removeEventListener(
|
|
216
|
+
"mousedown",
|
|
217
|
+
() => h.value = !0
|
|
218
|
+
), document.removeEventListener("mousedown", w), document.removeEventListener("mousemove", x), document.removeEventListener("mouseup", z);
|
|
219
|
+
});
|
|
220
|
+
const w = (p) => {
|
|
221
|
+
var S;
|
|
222
|
+
d.value = !0;
|
|
223
|
+
const D = p.target;
|
|
224
|
+
if (!(typeof ((S = D.dataset) == null ? void 0 : S.index) > "u")) {
|
|
225
|
+
if ([...D.classList].includes("row-drag-target")) {
|
|
226
|
+
if (C.value = "row", !h.value) return;
|
|
227
|
+
O(p, +D.dataset.index);
|
|
228
|
+
}
|
|
229
|
+
[...D.classList].includes("editable-table-view-setting-drag-target") && (C.value = "view-setting", H(p, +D.dataset.index));
|
|
230
|
+
}
|
|
231
|
+
}, x = (p) => {
|
|
232
|
+
!d.value || typeof t.value.draggingIndex > "u" || A(p);
|
|
233
|
+
}, z = (p) => {
|
|
234
|
+
h.value = !1, d.value = !1, !(typeof t.value.draggingIndex > "u") && (C.value === "row" && P(p, a.value), C.value === "view-setting" && K());
|
|
235
|
+
}, O = (p, D) => {
|
|
236
|
+
if (!b()) return;
|
|
237
|
+
const S = [
|
|
238
|
+
...document.getElementsByClassName("custom-row-classname")
|
|
239
|
+
], F = [];
|
|
240
|
+
for (let s = 0; s < S.length; s++) {
|
|
241
|
+
const u = S[s], E = ([...u.classList].find(
|
|
242
|
+
(y) => y.startsWith("custom-row-classname-")
|
|
243
|
+
) ?? "").split("-").pop() ?? "NaN";
|
|
244
|
+
typeof +E == "number" && (F[+E] = F[+E] || [], F[+E].push(u));
|
|
245
|
+
}
|
|
246
|
+
t.value.isDragging = !0, t.value.rowDoms = F, t.value.draggingIndex = +D, t.value.rowsRange = [], t.value.startPosition = {
|
|
247
|
+
x: p.clientX,
|
|
248
|
+
y: p.clientY
|
|
249
|
+
};
|
|
250
|
+
const L = e.dragSemiRange ?? 15;
|
|
251
|
+
for (const s of Object.keys(F).map(Number)) {
|
|
252
|
+
if (s < D - L || s > D + L) {
|
|
253
|
+
t.value.rowsRange[s] = void 0;
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
const u = F[s];
|
|
257
|
+
if (u.forEach((y) => y.style.setProperty("position", "relative")), s !== t.value.draggingIndex)
|
|
258
|
+
u.forEach(
|
|
259
|
+
(y) => y.style.setProperty("transition", "transform 0.25s ease")
|
|
260
|
+
);
|
|
261
|
+
else {
|
|
262
|
+
u.forEach(($) => $.style.setProperty("z-index", "100"));
|
|
263
|
+
const y = u.map(($) => $.querySelectorAll("td")).reduce(($, j) => [...$, ...j], []).filter(($) => $.classList.contains("is-hidden"));
|
|
264
|
+
t.value.hiddenTds = y, y.forEach(($) => $.classList.remove("is-hidden"));
|
|
265
|
+
const I = document.createElement("div");
|
|
266
|
+
I.style.position = "fixed", I.style.top = "0", I.style.left = "0", I.style.right = "0", I.style.bottom = "0", I.style.zIndex = "999", I.style.cursor = "grabbing", document.body.appendChild(I), t.value.fullScreenDiv = I;
|
|
267
|
+
}
|
|
268
|
+
const E = u[0].getBoundingClientRect();
|
|
269
|
+
t.value.rowsRange = t.value.rowsRange || [], t.value.rowsRange[s] = [E.top, E.bottom];
|
|
270
|
+
}
|
|
271
|
+
}, f = (p, D) => {
|
|
272
|
+
if (!t.value.rowsRange || typeof t.value.draggingIndex > "u" || typeof e.dragSemiRange > "u")
|
|
273
|
+
return;
|
|
274
|
+
const S = t.value.draggingIndex - e.dragSemiRange <= 0 ? 0 : t.value.draggingIndex - e.dragSemiRange, F = t.value.draggingIndex + e.dragSemiRange >= t.value.rowsRange.length ? t.value.rowsRange.length - 1 : t.value.draggingIndex + e.dragSemiRange;
|
|
275
|
+
if (!p) return -1;
|
|
276
|
+
if (D <= p[S][0]) return S;
|
|
277
|
+
if (D >= p[F][1]) return F;
|
|
278
|
+
for (let L = S; L <= F; L++) {
|
|
279
|
+
const [s, u] = p[L];
|
|
280
|
+
if (D > s && D < u)
|
|
281
|
+
return L;
|
|
282
|
+
}
|
|
283
|
+
return -1;
|
|
284
|
+
}, m = () => {
|
|
285
|
+
var F, L, s;
|
|
286
|
+
const p = t.value.rowDoms || [], D = t.value.draggingIndex ?? -1, S = e.dragSemiRange ?? 15;
|
|
287
|
+
for (const u of Object.keys(p).map(Number)) {
|
|
288
|
+
if (u < D - S || u > D + S)
|
|
289
|
+
continue;
|
|
290
|
+
p[u].forEach((y) => {
|
|
291
|
+
y.style.removeProperty("position"), y.style.removeProperty("transition"), y.style.removeProperty("transform"), y.style.removeProperty("z-index");
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
(L = (F = t.value.fullScreenDiv) == null ? void 0 : F.parentNode) == null || L.removeChild(
|
|
295
|
+
t.value.fullScreenDiv
|
|
296
|
+
), (s = t.value.hiddenTds) == null || s.forEach(
|
|
297
|
+
(u) => u.classList.add("is-hidden")
|
|
298
|
+
), t.value = {}, a.value = null;
|
|
299
|
+
}, P = (p, D) => {
|
|
300
|
+
if (!D) return;
|
|
301
|
+
const { draggingIndex: S = 0, dropIndex: F = S } = t.value, L = D.store.states.data, s = L[S], u = [
|
|
302
|
+
...L.slice(0, +S),
|
|
303
|
+
...L.slice(S + 1)
|
|
304
|
+
];
|
|
305
|
+
u.splice(F, 0, s), D.store.states.data = u, i("row-drag-drop", {
|
|
306
|
+
row: s,
|
|
307
|
+
fromIndex: S,
|
|
308
|
+
toIndex: F,
|
|
309
|
+
page: o.value,
|
|
310
|
+
size: c.value
|
|
311
|
+
}), m();
|
|
312
|
+
}, H = (p, D) => {
|
|
313
|
+
const S = [
|
|
314
|
+
...document.getElementsByClassName(
|
|
315
|
+
"editable-table-view-setting-draggable-item"
|
|
316
|
+
)
|
|
317
|
+
].reduce((F, L, s) => ({ ...F, [s]: [L] }), {});
|
|
318
|
+
t.value.isDragging = !0, t.value.rowDoms = S, t.value.draggingIndex = +D, t.value.startPosition = {
|
|
319
|
+
x: p.clientX,
|
|
320
|
+
y: p.clientY
|
|
321
|
+
};
|
|
322
|
+
for (const F of Object.keys(S).map(Number)) {
|
|
323
|
+
const L = S[F];
|
|
324
|
+
L.forEach((u) => {
|
|
325
|
+
u.style.setProperty("position", "relative");
|
|
326
|
+
}), F !== t.value.draggingIndex && L.forEach(
|
|
327
|
+
(u) => u.style.setProperty("transition", "transform 0.25s ease")
|
|
328
|
+
);
|
|
329
|
+
const s = L[0].getBoundingClientRect();
|
|
330
|
+
t.value.rowsRange = t.value.rowsRange || [], t.value.rowsRange.push([s.top, s.bottom]);
|
|
331
|
+
}
|
|
332
|
+
}, U = (p) => {
|
|
333
|
+
if (!t.value.isDragging) return;
|
|
334
|
+
const { y: D = 0 } = t.value.startPosition || {}, { draggingIndex: S = -1, rowDoms: F = {} } = t.value, L = F == null ? void 0 : F[S ?? 0];
|
|
335
|
+
for (let $ = 0; $ < L.length; $++) {
|
|
336
|
+
const j = L[$];
|
|
337
|
+
j == null || j.style.setProperty("transform", `translateY(${p.clientY - D}px)`);
|
|
338
|
+
}
|
|
339
|
+
const s = f(
|
|
340
|
+
t.value.rowsRange,
|
|
341
|
+
p.clientY
|
|
342
|
+
);
|
|
343
|
+
if (typeof s != "number") return;
|
|
344
|
+
const [u, E] = t.value.rowsRange[S];
|
|
345
|
+
t.value.dropIndex = s;
|
|
346
|
+
const y = E - u, I = e.dragSemiRange ?? 15;
|
|
347
|
+
for (const $ of Object.keys(F).map(Number)) {
|
|
348
|
+
if ($ < S - I || $ > S + I || S === $)
|
|
349
|
+
continue;
|
|
350
|
+
const j = F[$];
|
|
351
|
+
s < S ? $ >= s && $ < S ? j.forEach(
|
|
352
|
+
(Z) => Z.style.setProperty("transform", `translateY(${y}px)`)
|
|
353
|
+
) : j.forEach((Z) => Z.style.removeProperty("transform")) : s > S ? $ <= s && $ > S ? j.forEach(
|
|
354
|
+
(Z) => Z.style.setProperty("transform", `translateY(${-y}px)`)
|
|
355
|
+
) : j.forEach((Z) => Z.style.removeProperty("transform")) : j.forEach((Z) => Z.style.removeProperty("transform"));
|
|
356
|
+
}
|
|
357
|
+
}, K = () => {
|
|
358
|
+
const { draggingIndex: p = 0, dropIndex: D = p } = t.value, S = l.value[p], F = [
|
|
359
|
+
...l.value.slice(0, p),
|
|
360
|
+
...l.value.slice(p + 1)
|
|
361
|
+
];
|
|
362
|
+
F.splice(D, 0, S), l.value = F, m();
|
|
363
|
+
}, A = Je(U, 10);
|
|
364
|
+
}
|
|
365
|
+
function Qe({ colorList: e, emit: i }) {
|
|
366
|
+
const l = (a) => {
|
|
367
|
+
var n;
|
|
368
|
+
return a ? (n = e.find((t) => +t.id == +a)) == null ? void 0 : n.default : !0;
|
|
369
|
+
}, o = (a, n = "bg") => {
|
|
370
|
+
var t;
|
|
371
|
+
return ((t = e.find((d) => +d.id == +a)) == null ? void 0 : t[`${n}Color`]) || "";
|
|
372
|
+
};
|
|
373
|
+
return {
|
|
374
|
+
isDefaultColor: l,
|
|
375
|
+
getColorById: o,
|
|
376
|
+
setRowStyle: (a) => {
|
|
377
|
+
const n = a.row;
|
|
378
|
+
return {
|
|
379
|
+
backgroundColor: n.__static_bg_color__ ?? (n.colorId ? o(n.colorId) : "")
|
|
380
|
+
};
|
|
381
|
+
},
|
|
382
|
+
handleColorChange: async (a, n) => {
|
|
383
|
+
const { row: t, $index: d } = n;
|
|
384
|
+
t && (t.colorId = +a), i("row-bg-change", {
|
|
385
|
+
colorId: +a,
|
|
386
|
+
row: t,
|
|
387
|
+
rowIndex: d
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
function Uo(e) {
|
|
393
|
+
const i = M({ rowIndex: -1, columnProperty: "" }), l = M(!1);
|
|
394
|
+
je(() => {
|
|
395
|
+
e.value.$el.addEventListener("mouseleave", c), document.addEventListener("wheel", n);
|
|
396
|
+
}), He(() => {
|
|
397
|
+
e.value.$el.removeEventListener("mouseleave", c), document.removeEventListener("wheel", n);
|
|
398
|
+
});
|
|
399
|
+
const o = ({ column: C, rowIndex: h }) => C.property ? `hoving-cell-(${C.property})-(${h})` : "", c = () => {
|
|
400
|
+
i.value = {
|
|
401
|
+
rowIndex: -1,
|
|
402
|
+
columnProperty: ""
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
let b = null;
|
|
406
|
+
const n = Je(() => {
|
|
407
|
+
l.value = !0, clearTimeout(b), b = setTimeout(() => {
|
|
408
|
+
l.value = !1;
|
|
409
|
+
}, 100);
|
|
410
|
+
}, 50), d = Mo((C, h, w, x) => {
|
|
411
|
+
var m;
|
|
412
|
+
if (l.value) return;
|
|
413
|
+
let z = x.target, O = "";
|
|
414
|
+
for (; z && z !== ((m = e.value) == null ? void 0 : m.$el); ) {
|
|
415
|
+
const P = [...z.classList].find((H) => /hoving-cell-\(\w+\)-\(\d+\)/.test(H));
|
|
416
|
+
if (P) {
|
|
417
|
+
O = P;
|
|
418
|
+
break;
|
|
419
|
+
}
|
|
420
|
+
z = z.parentElement;
|
|
421
|
+
}
|
|
422
|
+
if (!O) return;
|
|
423
|
+
const f = O.match(/hoving-cell-\((\w+)\)-\((\d+)\)/);
|
|
424
|
+
!f || f.length < 3 || (i.value = {
|
|
425
|
+
rowIndex: +f[2],
|
|
426
|
+
columnProperty: f[1]
|
|
427
|
+
});
|
|
428
|
+
}, 10);
|
|
429
|
+
return {
|
|
430
|
+
hoveringCellInfo: i,
|
|
431
|
+
setCellClassName: o,
|
|
432
|
+
debouncedHoverHandler: d
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
function Wo({ emit: e, pageSize: i, props: l, tableDomRef: o, hasExpandRow: c }) {
|
|
436
|
+
const b = M(null), a = M({}), n = M(-1), t = (O, f) => {
|
|
437
|
+
e("row-delete", {
|
|
438
|
+
row: O,
|
|
439
|
+
index: f,
|
|
440
|
+
page: l.currentPage,
|
|
441
|
+
size: i.value
|
|
442
|
+
}), d();
|
|
443
|
+
}, d = () => {
|
|
444
|
+
var O;
|
|
445
|
+
(O = b.value) == null || O.forEach((f) => f == null ? void 0 : f.doClose());
|
|
446
|
+
}, C = () => {
|
|
447
|
+
var O;
|
|
448
|
+
c && ((O = o.value) == null || O.data.forEach((f) => {
|
|
449
|
+
var m;
|
|
450
|
+
(m = o.value) == null || m.toggleRowExpansion(f, !1);
|
|
451
|
+
}));
|
|
452
|
+
};
|
|
453
|
+
return {
|
|
454
|
+
operationPopoverRef: b,
|
|
455
|
+
editingRowData: a,
|
|
456
|
+
editingRowIndex: n,
|
|
457
|
+
handleDelete: t,
|
|
458
|
+
closeAllExpandedRows: C,
|
|
459
|
+
handleEdit: (O) => {
|
|
460
|
+
C();
|
|
461
|
+
const { row: f, $index: m } = O;
|
|
462
|
+
a.value = { ...f }, n.value = m, e("row-edit", { row: f, index: m, page: l.currentPage, size: i.value }), d();
|
|
463
|
+
},
|
|
464
|
+
handleEditSave: (O) => {
|
|
465
|
+
n.value = -1;
|
|
466
|
+
const f = {};
|
|
467
|
+
for (const m of Object.keys(O))
|
|
468
|
+
O[m] !== a.value[m] && (f[m] = a.value[m]);
|
|
469
|
+
e("row-edit-save", {
|
|
470
|
+
page: l.currentPage,
|
|
471
|
+
size: i.value,
|
|
472
|
+
row: O,
|
|
473
|
+
changedData: f
|
|
474
|
+
}), a.value = {};
|
|
475
|
+
},
|
|
476
|
+
handleEditCancel: (O) => {
|
|
477
|
+
n.value = -1, a.value = {}, e("row-edit-cancel", { row: O, page: l.currentPage, size: i.value });
|
|
478
|
+
},
|
|
479
|
+
handleRowPinToTop: (O) => {
|
|
480
|
+
const { row: f, $index: m, store: P } = O, H = P.states.data, U = [
|
|
481
|
+
...H.slice(0, m),
|
|
482
|
+
...H.slice(m + 1)
|
|
483
|
+
];
|
|
484
|
+
U.unshift({ ...f, isPinned: !0 }), P.states.data = U, e("row-pin-to-top", { row: f, rawIndex: m, page: l.currentPage, size: i.value }), d();
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
function Go({
|
|
489
|
+
props: e,
|
|
490
|
+
tableDomRef: i,
|
|
491
|
+
emit: l,
|
|
492
|
+
showingColumns: o
|
|
493
|
+
}) {
|
|
494
|
+
const c = M(!1), b = M(null), a = M(""), n = M(""), t = M(""), d = M({}), C = M({}), h = M([]), w = M([]), x = ae(() => Object.keys(C.value).some((s) => {
|
|
495
|
+
const u = C.value[s];
|
|
496
|
+
return Array.isArray(u) ? u.length : u;
|
|
497
|
+
})), z = ({
|
|
498
|
+
isColumnSortable: s,
|
|
499
|
+
filters: u
|
|
500
|
+
}) => s || u && Array.isArray(u) && u.length > 0;
|
|
501
|
+
pe(
|
|
502
|
+
() => e.columnConfig,
|
|
503
|
+
(s) => {
|
|
504
|
+
s == null || s.forEach((u) => S(u)), C.value = { ...d.value };
|
|
505
|
+
},
|
|
506
|
+
{ immediate: !0 }
|
|
507
|
+
);
|
|
508
|
+
const O = (s) => {
|
|
509
|
+
const { columns: u, data: E } = s, y = [];
|
|
510
|
+
return u.forEach((I, $) => {
|
|
511
|
+
var j;
|
|
512
|
+
if ($ === 0) {
|
|
513
|
+
y[$] = "合计";
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
if (!w.value.includes(I.property))
|
|
517
|
+
y[$] = "";
|
|
518
|
+
else {
|
|
519
|
+
const Z = E.map((de) => de[I.property]), ve = ((j = e.columnConfig.find((de) => de.prop === I.property)) == null ? void 0 : j.summaryMethod) ?? (() => "");
|
|
520
|
+
y[$] = ve(Z);
|
|
521
|
+
}
|
|
522
|
+
}), y;
|
|
523
|
+
}, f = ({ prop: s, filters: u, _sortable: E }) => {
|
|
524
|
+
const I = u && Array.isArray(u) && u.length > 0 && (u == null ? void 0 : u.some((j) => {
|
|
525
|
+
if (j.type === "doubleDatePicker" || j.type === "monthDayPicker") {
|
|
526
|
+
const [Z, ve] = j.prop;
|
|
527
|
+
return !!(d.value[Z] || d.value[ve]);
|
|
528
|
+
}
|
|
529
|
+
return j.type === "checkbox" ? !!d.value[j.prop].length : j.type === "slot" ? j.active() : !!d.value[j.prop];
|
|
530
|
+
})), $ = Array.isArray(E) ? E.some((j) => j.prop === a.value) : a.value === s;
|
|
531
|
+
return I || $ || w.value.includes(s);
|
|
532
|
+
}, m = (s) => {
|
|
533
|
+
P(s.prop), C.value = { ...d.value }, n.value = b.value || "", t.value = a.value || "", h.value = [...w.value];
|
|
534
|
+
}, P = (s) => {
|
|
535
|
+
document.querySelectorAll("span[data-popper-name]").forEach((u) => {
|
|
536
|
+
var E, y;
|
|
537
|
+
(!s || s !== u.dataset.prop) && ((y = (E = u == null ? void 0 : u.__vue__) == null ? void 0 : E.doClose) == null || y.call(E));
|
|
538
|
+
});
|
|
539
|
+
}, H = (s, u) => {
|
|
540
|
+
n.value = s, t.value = u;
|
|
541
|
+
}, U = ae(() => {
|
|
542
|
+
const s = {};
|
|
543
|
+
return e.columnConfig.forEach((u) => {
|
|
544
|
+
s[u.prop] = u;
|
|
545
|
+
}), s;
|
|
546
|
+
}), K = () => {
|
|
547
|
+
const s = {}, u = (E) => {
|
|
548
|
+
E.filter(
|
|
549
|
+
(y) => y.type !== "slot"
|
|
550
|
+
).forEach((y) => {
|
|
551
|
+
if (y.type === "doubleDatePicker" || y.type === "monthDayPicker") {
|
|
552
|
+
const [I, $] = y.prop;
|
|
553
|
+
s[I] = d.value[I], s[$] = d.value[$];
|
|
554
|
+
} else
|
|
555
|
+
s[y.prop] = d.value[y.prop];
|
|
556
|
+
});
|
|
557
|
+
};
|
|
558
|
+
if (o.value.forEach((E) => {
|
|
559
|
+
const { filters: y = [] } = U.value[E];
|
|
560
|
+
u(y);
|
|
561
|
+
}), e.colorFilterConfig) {
|
|
562
|
+
const { filters: E = [] } = e.colorFilterConfig;
|
|
563
|
+
u(E);
|
|
564
|
+
}
|
|
565
|
+
Object.keys(s).forEach((E) => {
|
|
566
|
+
s[E] === void 0 && delete s[E];
|
|
567
|
+
}), l("search", {
|
|
568
|
+
...s,
|
|
569
|
+
page: 1
|
|
570
|
+
});
|
|
571
|
+
}, A = async (s) => {
|
|
572
|
+
var y, I;
|
|
573
|
+
const u = (s.filters ?? []).filter(
|
|
574
|
+
($) => $.type === "input"
|
|
575
|
+
);
|
|
576
|
+
u.some(
|
|
577
|
+
($) => $.validator && !$.validator(C.value[$.prop].trim())
|
|
578
|
+
) || (u.forEach(($) => {
|
|
579
|
+
C.value[$.prop] || (C.value[$.prop] = "");
|
|
580
|
+
}), w.value = [...h.value], a.value = t.value || "", b.value = n.value || null, a.value && (e.localSort ? (c.value = !0, await be(), (y = i.value) == null || y.sort(a.value, b.value), c.value = !1) : l("sort-change", { order: b.value, prop: a.value })), d.value = { ...C.value }, K(), P(), await be(), (I = i.value) == null || I.doLayout());
|
|
581
|
+
}, p = () => {
|
|
582
|
+
var s;
|
|
583
|
+
a.value = "", b.value = null, e.localSort ? (s = i.value) == null || s.clearSort() : l("sort-change", { order: null, prop: "" });
|
|
584
|
+
}, D = (s) => {
|
|
585
|
+
var E;
|
|
586
|
+
e.columnConfig.find(
|
|
587
|
+
(y) => Array.isArray(y.sortable) ? y.sortable.some((I) => I.prop === s.prop) : y.prop === s.prop
|
|
588
|
+
) && (a.value = s.prop, b.value = s.order, e.localSort && ((E = i.value) == null || E.sort(s.prop, s.order)));
|
|
589
|
+
};
|
|
590
|
+
function S(s) {
|
|
591
|
+
(s.filters || []).filter(
|
|
592
|
+
(u) => u.type !== "slot"
|
|
593
|
+
).forEach((u) => {
|
|
594
|
+
if (u.type === "radio" || u.type === "checkbox")
|
|
595
|
+
u.defaultValue ? d.value[u.prop] = u.defaultValue : d.value[u.prop] = u.type === "radio" ? "" : [];
|
|
596
|
+
else if (u.type === "doubleDatePicker" || u.type === "monthDayPicker") {
|
|
597
|
+
const [E, y] = u.prop;
|
|
598
|
+
d.value[E] = "", d.value[y] = "";
|
|
599
|
+
} else
|
|
600
|
+
d.value[u.prop] = "";
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
return {
|
|
604
|
+
setSort: D,
|
|
605
|
+
clearSort: p,
|
|
606
|
+
setSearchParams: (s) => {
|
|
607
|
+
const u = {};
|
|
608
|
+
[e.colorFilterConfig, ...e.columnConfig].forEach((E) => {
|
|
609
|
+
((E == null ? void 0 : E.filters) ?? []).filter(
|
|
610
|
+
(y) => y.type !== "slot"
|
|
611
|
+
).forEach((y) => {
|
|
612
|
+
if (y.type === "doubleDatePicker" || y.type === "monthDayPicker") {
|
|
613
|
+
const [I, $] = y.prop;
|
|
614
|
+
u[I] = s[I], u[$] = s[$];
|
|
615
|
+
} else y.type === "checkbox" ? u[y.prop] = s[y.prop] ?? y.defaultValue ?? [] : u[y.prop] = s[y.prop] ?? "";
|
|
616
|
+
});
|
|
617
|
+
}), d.value = { ...d.value, ...u };
|
|
618
|
+
},
|
|
619
|
+
isColumnHeadActive: f,
|
|
620
|
+
handleHeaderPopoverShow: m,
|
|
621
|
+
handleSort: H,
|
|
622
|
+
handleHeaderOperationConfirm: A,
|
|
623
|
+
handleHeaderOperationReset: async (s) => {
|
|
624
|
+
var u;
|
|
625
|
+
a.value && (Array.isArray(s._sortable) ? s._sortable.some((E) => E.prop === a.value) : a.value === s.prop) && p(), w.value = w.value.filter(
|
|
626
|
+
(E) => E !== s.prop
|
|
627
|
+
), S(s), K(), P(), await be(), (u = i.value) == null || u.doLayout();
|
|
628
|
+
},
|
|
629
|
+
summaryList: w,
|
|
630
|
+
tableSummaryMethod: O,
|
|
631
|
+
filteredValue: d,
|
|
632
|
+
showColumnHeadSortIcon: z,
|
|
633
|
+
tempSortProp: t,
|
|
634
|
+
tempFilteredValue: C,
|
|
635
|
+
tempSummaryList: h,
|
|
636
|
+
tempSortType: n,
|
|
637
|
+
sortProp: a,
|
|
638
|
+
isColumnFiltering: x,
|
|
639
|
+
inSorting: c
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
const ke = {
|
|
643
|
+
0: {
|
|
644
|
+
migration: (e, i) => ({
|
|
645
|
+
config: {
|
|
646
|
+
fields: i.reduce((l, o) => (l[o.prop] = {
|
|
647
|
+
hidden: !e.showingColumns.find((c) => c === o.prop),
|
|
648
|
+
order: e.showingColumns.findIndex((c) => c === o.prop) ?? 0
|
|
649
|
+
}, l), {}),
|
|
650
|
+
leftFixedColumnCount: e.leftFixedColumnCount
|
|
651
|
+
},
|
|
652
|
+
schemaVersion: 1
|
|
653
|
+
}),
|
|
654
|
+
nextSchemaVersion: 1
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
function Ze({
|
|
658
|
+
showingColumns: e,
|
|
659
|
+
actualColumns: i,
|
|
660
|
+
props: l,
|
|
661
|
+
viewSettingDragSortOptions: o,
|
|
662
|
+
emit: c
|
|
663
|
+
}) {
|
|
664
|
+
const b = M([]), a = M(!1), n = M(0), t = M(0), d = (f) => c("update:showingColumns", f), C = ae(
|
|
665
|
+
() => `@lx-frontend/wrap-element-ui/table_setting_cloumns/${l.settingStorgeKey || (location.pathname === "/" ? location.hash : location.pathname)}`
|
|
666
|
+
), h = async () => {
|
|
667
|
+
await be();
|
|
668
|
+
const f = l.settingStorgeMigrationConfigs ?? [], m = f.length, P = m ? f[m - 1].version.to : void 0;
|
|
669
|
+
localStorage.setItem(
|
|
670
|
+
C.value,
|
|
671
|
+
JSON.stringify({
|
|
672
|
+
config: {
|
|
673
|
+
fields: l.columnConfig.reduce((H, U, K) => {
|
|
674
|
+
const A = e.value.findIndex(
|
|
675
|
+
(p) => p === U.prop
|
|
676
|
+
);
|
|
677
|
+
return H[U.prop] = {
|
|
678
|
+
hidden: !e.value.find((p) => p === U.prop),
|
|
679
|
+
order: A === -1 ? K : A
|
|
680
|
+
}, H;
|
|
681
|
+
}, {}),
|
|
682
|
+
leftFixedColumnCount: n.value
|
|
683
|
+
},
|
|
684
|
+
version: P,
|
|
685
|
+
schemaVersion: 1
|
|
686
|
+
})
|
|
687
|
+
);
|
|
688
|
+
}, w = () => {
|
|
689
|
+
c("update:viewSettingDragSortOptions", [
|
|
690
|
+
...i.value.filter((f) => (f == null ? void 0 : f.prop) !== "$$operation")
|
|
691
|
+
]), t.value = n.value, a.value = !0, b.value = [...e.value];
|
|
692
|
+
}, x = () => {
|
|
693
|
+
a.value = !1;
|
|
694
|
+
}, z = async () => {
|
|
695
|
+
a.value = !1, d(o.value.map((f) => f.prop)), n.value = t.value, await h(), c("tableDoLayout");
|
|
696
|
+
}, O = (f) => {
|
|
697
|
+
const m = Number(f);
|
|
698
|
+
isNaN(m) || (t.value = Math.max(
|
|
699
|
+
0,
|
|
700
|
+
Math.min(b.value.length, Math.floor(m))
|
|
701
|
+
));
|
|
702
|
+
};
|
|
703
|
+
return pe(
|
|
704
|
+
() => l.columnConfig,
|
|
705
|
+
async (f) => {
|
|
706
|
+
var H;
|
|
707
|
+
const m = localStorage.getItem(C.value), P = () => d(
|
|
708
|
+
f.filter((U) => !U.defaultHide).map((U) => U.prop)
|
|
709
|
+
);
|
|
710
|
+
if (!m)
|
|
711
|
+
P(), n.value = l.leftFixedCount;
|
|
712
|
+
else
|
|
713
|
+
try {
|
|
714
|
+
const U = (p) => {
|
|
715
|
+
const D = (p == null ? void 0 : p.schemaVersion) ?? 0;
|
|
716
|
+
if (ke[D]) {
|
|
717
|
+
let S = ke[D].migration(p, f);
|
|
718
|
+
const F = (l.settingStorgeMigrationConfigs ?? []).filter((L) => (L.schemaVersion ?? 1) === S.schemaVersion);
|
|
719
|
+
return F.length && (S = F.reduce(
|
|
720
|
+
(L, s) => ({
|
|
721
|
+
...s.migration(L.config, f),
|
|
722
|
+
schemaVersion: S.schemaVersion
|
|
723
|
+
}),
|
|
724
|
+
S
|
|
725
|
+
)), ke[D].nextSchemaVersion ? U(S) : S;
|
|
726
|
+
} else {
|
|
727
|
+
const S = (l.settingStorgeMigrationConfigs ?? []).filter((L) => (L.schemaVersion ?? 1) === p.schemaVersion), F = S.findIndex(
|
|
728
|
+
(L) => L.version.form === p.version
|
|
729
|
+
);
|
|
730
|
+
if (F > -1)
|
|
731
|
+
for (let L = F; L < S.length; L++)
|
|
732
|
+
p = S[L].migration(p.config, f);
|
|
733
|
+
return p;
|
|
734
|
+
}
|
|
735
|
+
}, K = U(
|
|
736
|
+
JSON.parse(m)
|
|
737
|
+
);
|
|
738
|
+
d(
|
|
739
|
+
f.filter((p) => K.config.fields[p.prop] ? !K.config.fields[p.prop].hidden : !p.defaultHide).sort((p, D) => {
|
|
740
|
+
var S, F;
|
|
741
|
+
return (((S = K.config.fields[p.prop]) == null ? void 0 : S.order) ?? 0) - (((F = K.config.fields[D.prop]) == null ? void 0 : F.order) ?? 0);
|
|
742
|
+
}).map((p) => p.prop)
|
|
743
|
+
);
|
|
744
|
+
const A = Number(
|
|
745
|
+
(H = K == null ? void 0 : K.config) == null ? void 0 : H.leftFixedColumnCount
|
|
746
|
+
);
|
|
747
|
+
n.value = isNaN(A) ? l.leftFixedCount : A, h();
|
|
748
|
+
} catch (U) {
|
|
749
|
+
console.error(U), localStorage.removeItem(C.value), P();
|
|
750
|
+
}
|
|
751
|
+
},
|
|
752
|
+
{ immediate: !0 }
|
|
753
|
+
), pe(
|
|
754
|
+
b,
|
|
755
|
+
(f, m) => {
|
|
756
|
+
if (f.length === (m == null ? void 0 : m.length)) return;
|
|
757
|
+
const P = /* @__PURE__ */ new Map();
|
|
758
|
+
l.columnConfig.forEach((H) => P.set(H.prop, H)), c(
|
|
759
|
+
"update:viewSettingDragSortOptions",
|
|
760
|
+
f.map((H) => P.get(H))
|
|
761
|
+
), t.value > f.length && (t.value = f.length);
|
|
762
|
+
},
|
|
763
|
+
{ immediate: !0 }
|
|
764
|
+
), pe(
|
|
765
|
+
o,
|
|
766
|
+
(f, m) => {
|
|
767
|
+
!f.length || f.length !== (m == null ? void 0 : m.length) || (b.value = f.map((P) => P.prop));
|
|
768
|
+
},
|
|
769
|
+
{ deep: !0 }
|
|
770
|
+
), pe(
|
|
771
|
+
n,
|
|
772
|
+
(f) => c("update:leftFixedColumnCount", f),
|
|
773
|
+
{ immediate: !0 }
|
|
774
|
+
), {
|
|
775
|
+
columnsToBeShown: b,
|
|
776
|
+
viewSettingVisible: a,
|
|
777
|
+
leftFixedColumnCount: n,
|
|
778
|
+
tempLeftFixedColumnCount: t,
|
|
779
|
+
handleInputTempLeftFixedColumnCount: O,
|
|
780
|
+
handleViewSettingShow: w,
|
|
781
|
+
handleViewSettingClose: x,
|
|
782
|
+
handleViewSettingConfirm: z
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
const Ko = { class: "editable-table-view-setting__content" }, Xo = { class: "editable-table-view-setting__content-left" }, Yo = { class: "editable-table-view-setting__checkbox-wrapper" }, qo = { class: "editable-table-view-setting__content-left-item" }, Jo = { class: "editable-table-view-setting__content-right" }, Qo = { class: "editable-table-view-setting__content-right-title" }, Zo = { class: "editable-table-view-setting__selected-count" }, ea = { class: "editable-table-view-setting__content-right-frize" }, ta = { class: "editable-table-view-setting__content-right-selected" }, oa = { class: "editable-table-view-setting__selected-item-left" }, aa = ["data-index"], na = ["data-index"], la = { class: "editable-table-view-setting__selected-item-name" }, ra = ["onClick"], ia = /* @__PURE__ */ te({
|
|
786
|
+
__name: "bizViewSettingDialog",
|
|
787
|
+
props: {
|
|
788
|
+
actualColumns: {},
|
|
789
|
+
viewSettingDragSortOptions: {},
|
|
790
|
+
showingColumns: {},
|
|
791
|
+
props: {}
|
|
792
|
+
},
|
|
793
|
+
emits: ["update:leftFixedColumnCount", "update:showingColumns", "update:viewSettingDragSortOptions", "tableDoLayout"],
|
|
794
|
+
setup(e, { expose: i, emit: l }) {
|
|
795
|
+
const o = l, c = e, { actualColumns: b, showingColumns: a, viewSettingDragSortOptions: n } = Ee(c), {
|
|
796
|
+
columnsToBeShown: t,
|
|
797
|
+
viewSettingVisible: d,
|
|
798
|
+
tempLeftFixedColumnCount: C,
|
|
799
|
+
handleInputTempLeftFixedColumnCount: h,
|
|
800
|
+
handleViewSettingShow: w,
|
|
801
|
+
handleViewSettingClose: x,
|
|
802
|
+
handleViewSettingConfirm: z
|
|
803
|
+
} = Ze({
|
|
804
|
+
showingColumns: a,
|
|
805
|
+
actualColumns: b,
|
|
806
|
+
viewSettingDragSortOptions: n,
|
|
807
|
+
props: c.props,
|
|
808
|
+
emit: o
|
|
809
|
+
}), O = (f) => {
|
|
810
|
+
f.alwaysShow || f.isAlwaysShow || (t.value = t.value.filter(
|
|
811
|
+
(m) => m !== f.prop
|
|
812
|
+
));
|
|
813
|
+
};
|
|
814
|
+
return i({
|
|
815
|
+
open: w
|
|
816
|
+
}), (f, m) => (g(), G(r(xt), {
|
|
817
|
+
title: "显示设置",
|
|
818
|
+
modelValue: r(d),
|
|
819
|
+
"onUpdate:modelValue": m[1] || (m[1] = (P) => Se(d) ? d.value = P : null),
|
|
820
|
+
width: "750px",
|
|
821
|
+
top: "12vh",
|
|
822
|
+
"close-on-click-modal": !1,
|
|
823
|
+
modal: !0,
|
|
824
|
+
"modal-append-to-body": !0,
|
|
825
|
+
"append-to-body": "",
|
|
826
|
+
"destroy-on-close": "",
|
|
827
|
+
"custom-class": "editable-table-view-setting__dialog"
|
|
828
|
+
}, {
|
|
829
|
+
footer: R(() => [
|
|
830
|
+
N(r(ye), { onClick: r(x) }, {
|
|
831
|
+
default: R(() => [...m[5] || (m[5] = [
|
|
832
|
+
X(" 取消 ", -1)
|
|
833
|
+
])]),
|
|
834
|
+
_: 1
|
|
835
|
+
}, 8, ["onClick"]),
|
|
836
|
+
N(r(ye), {
|
|
837
|
+
type: "primary",
|
|
838
|
+
onClick: r(z)
|
|
839
|
+
}, {
|
|
840
|
+
default: R(() => [...m[6] || (m[6] = [
|
|
841
|
+
X(" 确认 ", -1)
|
|
842
|
+
])]),
|
|
843
|
+
_: 1
|
|
844
|
+
}, 8, ["onClick"])
|
|
845
|
+
]),
|
|
846
|
+
default: R(() => [
|
|
847
|
+
V("div", Ko, [
|
|
848
|
+
V("div", Xo, [
|
|
849
|
+
V("div", Yo, [
|
|
850
|
+
N(r(kt), {
|
|
851
|
+
modelValue: r(t),
|
|
852
|
+
"onUpdate:modelValue": m[0] || (m[0] = (P) => Se(t) ? t.value = P : null)
|
|
853
|
+
}, {
|
|
854
|
+
default: R(() => [
|
|
855
|
+
(g(!0), T(q, null, re(e.props.columnConfig, (P) => (g(), G(r($t), {
|
|
856
|
+
key: P.label,
|
|
857
|
+
label: P.prop,
|
|
858
|
+
disabled: P.alwaysShow || P.isAlwaysShow
|
|
859
|
+
}, {
|
|
860
|
+
default: R(() => [
|
|
861
|
+
V("div", qo, Y(P.label), 1)
|
|
862
|
+
]),
|
|
863
|
+
_: 2
|
|
864
|
+
}, 1032, ["label", "disabled"]))), 128))
|
|
865
|
+
]),
|
|
866
|
+
_: 1
|
|
867
|
+
}, 8, ["modelValue"])
|
|
868
|
+
])
|
|
869
|
+
]),
|
|
870
|
+
V("div", Jo, [
|
|
871
|
+
V("div", Qo, [
|
|
872
|
+
m[2] || (m[2] = X(" 已选择 ", -1)),
|
|
873
|
+
V("div", Zo, Y(r(t).length), 1)
|
|
874
|
+
]),
|
|
875
|
+
V("div", ea, [
|
|
876
|
+
m[3] || (m[3] = X(" 冻结前 ", -1)),
|
|
877
|
+
N(r(Ue), {
|
|
878
|
+
class: "editable-table-view-setting__content-right-input",
|
|
879
|
+
value: r(C),
|
|
880
|
+
onInput: r(h)
|
|
881
|
+
}, null, 8, ["value", "onInput"]),
|
|
882
|
+
m[4] || (m[4] = X(" 列 ", -1))
|
|
883
|
+
]),
|
|
884
|
+
V("div", ta, [
|
|
885
|
+
(g(!0), T(q, null, re(r(n), (P, H) => (g(), T("div", {
|
|
886
|
+
key: P.prop,
|
|
887
|
+
class: "editable-table-view-setting__selected-item editable-table-view-setting-draggable-item"
|
|
888
|
+
}, [
|
|
889
|
+
V("div", oa, [
|
|
890
|
+
V("div", {
|
|
891
|
+
class: "editable-table-view-setting-drag-target editable-table-view-setting__icon-wrapper",
|
|
892
|
+
"data-index": H
|
|
893
|
+
}, [
|
|
894
|
+
V("div", {
|
|
895
|
+
class: "editable-table-view-setting-drag-target editable-table-drag-icon",
|
|
896
|
+
"data-index": H
|
|
897
|
+
}, null, 8, na)
|
|
898
|
+
], 8, aa),
|
|
899
|
+
V("div", la, Y(P.label), 1)
|
|
900
|
+
]),
|
|
901
|
+
V("div", {
|
|
902
|
+
class: he([
|
|
903
|
+
"editable-table-view-setting__selected-item-close",
|
|
904
|
+
P.alwaysShow || P.isAlwaysShow ? "editable-table-view-setting__selected-item-close--disabled" : ""
|
|
905
|
+
]),
|
|
906
|
+
onClick: (U) => O(P)
|
|
907
|
+
}, [
|
|
908
|
+
N(r(We), null, {
|
|
909
|
+
default: R(() => [
|
|
910
|
+
N(r(Tt))
|
|
911
|
+
]),
|
|
912
|
+
_: 1
|
|
913
|
+
})
|
|
914
|
+
], 10, ra)
|
|
915
|
+
]))), 128))
|
|
916
|
+
])
|
|
917
|
+
])
|
|
918
|
+
])
|
|
919
|
+
]),
|
|
920
|
+
_: 1
|
|
921
|
+
}, 8, ["modelValue"]));
|
|
922
|
+
}
|
|
923
|
+
}), sa = { class: "color-list" }, da = ["onClick"], ua = {
|
|
924
|
+
key: 0,
|
|
925
|
+
class: "editable-table__color-icon"
|
|
926
|
+
}, ca = /* @__PURE__ */ te({
|
|
927
|
+
__name: "bizColorSelect",
|
|
928
|
+
props: {
|
|
929
|
+
colorList: {},
|
|
930
|
+
scope: {}
|
|
931
|
+
},
|
|
932
|
+
emits: ["row-bg-change"],
|
|
933
|
+
setup(e, { emit: i }) {
|
|
934
|
+
const l = e, o = i, { getColorById: c, isDefaultColor: b, handleColorChange: a } = Qe({
|
|
935
|
+
colorList: l.colorList,
|
|
936
|
+
emit: o
|
|
937
|
+
}), n = M(!1), t = (d) => {
|
|
938
|
+
n.value = !1, a(d, l.scope);
|
|
939
|
+
};
|
|
940
|
+
return (d, C) => {
|
|
941
|
+
const h = Q("el-popover");
|
|
942
|
+
return g(), G(h, {
|
|
943
|
+
visible: n.value,
|
|
944
|
+
placement: "right",
|
|
945
|
+
trigger: "click",
|
|
946
|
+
"popper-class": "editable-table-color-popover",
|
|
947
|
+
"onUpdate:visible": C[0] || (C[0] = (w) => n.value = w)
|
|
948
|
+
}, {
|
|
949
|
+
reference: R(() => [
|
|
950
|
+
r(b)(e.scope.row.colorId) ? (g(), T("div", ua)) : (g(), T("div", {
|
|
951
|
+
key: 1,
|
|
952
|
+
class: "editable-table__selected-color",
|
|
953
|
+
style: we({ backgroundColor: r(c)(e.scope.row.colorId, "sample") })
|
|
954
|
+
}, null, 4))
|
|
955
|
+
]),
|
|
956
|
+
default: R(() => [
|
|
957
|
+
V("div", sa, [
|
|
958
|
+
(g(!0), T(q, null, re(e.colorList, (w) => (g(), T("div", {
|
|
959
|
+
key: w.id,
|
|
960
|
+
class: "color-list__item",
|
|
961
|
+
style: we({ backgroundColor: w.sampleColor }),
|
|
962
|
+
onClick: (x) => t(w.id)
|
|
963
|
+
}, [
|
|
964
|
+
V("span", {
|
|
965
|
+
style: we({ color: w.textColor })
|
|
966
|
+
}, Y(w.name), 5)
|
|
967
|
+
], 12, da))), 128))
|
|
968
|
+
])
|
|
969
|
+
]),
|
|
970
|
+
_: 1
|
|
971
|
+
}, 8, ["visible"]);
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
}), pa = { class: "editable-table-sort-filter__filter" }, fa = { class: "editable-table-sort-filter__filter-title" }, va = /* @__PURE__ */ te({
|
|
975
|
+
__name: "BizCheckboxFilter",
|
|
976
|
+
props: {
|
|
977
|
+
config: {},
|
|
978
|
+
tempFilteredValue: {}
|
|
979
|
+
},
|
|
980
|
+
emits: ["update:tempFilteredValue"],
|
|
981
|
+
setup(e, { emit: i }) {
|
|
982
|
+
const l = i;
|
|
983
|
+
return (o, c) => {
|
|
984
|
+
const b = Q("el-checkbox"), a = Q("el-checkbox-group");
|
|
985
|
+
return g(), T("div", pa, [
|
|
986
|
+
V("div", fa, Y(e.config.label || "筛选"), 1),
|
|
987
|
+
N(a, {
|
|
988
|
+
class: "editable-table-sort-filter__filter-checkbox-group",
|
|
989
|
+
value: e.tempFilteredValue[e.config.prop],
|
|
990
|
+
onInput: c[0] || (c[0] = (n) => l("update:tempFilteredValue", e.config.prop, n))
|
|
991
|
+
}, {
|
|
992
|
+
default: R(() => [
|
|
993
|
+
(g(!0), T(q, null, re(e.config.options, (n) => (g(), G(b, {
|
|
994
|
+
key: n.value,
|
|
995
|
+
label: n.value,
|
|
996
|
+
title: n.text,
|
|
997
|
+
class: "editable-table-sort-filter__filter-checkbox"
|
|
998
|
+
}, {
|
|
999
|
+
default: R(() => [
|
|
1000
|
+
X(Y(n.text), 1)
|
|
1001
|
+
]),
|
|
1002
|
+
_: 2
|
|
1003
|
+
}, 1032, ["label", "title"]))), 128))
|
|
1004
|
+
]),
|
|
1005
|
+
_: 1
|
|
1006
|
+
}, 8, ["value"])
|
|
1007
|
+
]);
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
}), ga = { class: "editable-table-sort-filter__filter" }, ma = { class: "editable-table-sort-filter__filter-title" }, ba = { class: "color-option" }, ya = /* @__PURE__ */ te({
|
|
1011
|
+
__name: "BizColorRadioFilter",
|
|
1012
|
+
props: {
|
|
1013
|
+
config: {},
|
|
1014
|
+
tempFilteredValue: {}
|
|
1015
|
+
},
|
|
1016
|
+
emits: ["update:tempFilteredValue"],
|
|
1017
|
+
setup(e, { emit: i }) {
|
|
1018
|
+
const l = i;
|
|
1019
|
+
return (o, c) => {
|
|
1020
|
+
const b = Q("el-radio"), a = Q("el-radio-group");
|
|
1021
|
+
return g(), T("div", ga, [
|
|
1022
|
+
V("div", ma, Y(e.config.label || "筛选"), 1),
|
|
1023
|
+
N(a, {
|
|
1024
|
+
style: { display: "flex", "flex-direction": "column", gap: "6px" },
|
|
1025
|
+
value: e.tempFilteredValue[e.config.prop],
|
|
1026
|
+
onInput: c[0] || (c[0] = (n) => l("update:tempFilteredValue", e.config.prop, n))
|
|
1027
|
+
}, {
|
|
1028
|
+
default: R(() => [
|
|
1029
|
+
(g(!0), T(q, null, re(e.config.options, (n) => (g(), G(b, {
|
|
1030
|
+
key: n.value,
|
|
1031
|
+
label: n.value,
|
|
1032
|
+
title: n.text
|
|
1033
|
+
}, {
|
|
1034
|
+
default: R(() => [
|
|
1035
|
+
V("span", ba, [
|
|
1036
|
+
V("span", {
|
|
1037
|
+
class: "icon",
|
|
1038
|
+
style: we({ background: n.color })
|
|
1039
|
+
}, null, 4),
|
|
1040
|
+
V("span", null, Y(n.text), 1)
|
|
1041
|
+
])
|
|
1042
|
+
]),
|
|
1043
|
+
_: 2
|
|
1044
|
+
}, 1032, ["label", "title"]))), 128))
|
|
1045
|
+
]),
|
|
1046
|
+
_: 1
|
|
1047
|
+
}, 8, ["value"])
|
|
1048
|
+
]);
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
1051
|
+
}), et = (e, i) => {
|
|
1052
|
+
const l = e.__vccOpts || e;
|
|
1053
|
+
for (const [o, c] of i)
|
|
1054
|
+
l[o] = c;
|
|
1055
|
+
return l;
|
|
1056
|
+
}, ha = /* @__PURE__ */ et(ya, [["__scopeId", "data-v-575f0346"]]);
|
|
1057
|
+
function Ae(e, i = 0) {
|
|
1058
|
+
return {
|
|
1059
|
+
disabledDate: (l) => {
|
|
1060
|
+
if (!e) return !1;
|
|
1061
|
+
const o = se(l), c = o.isAfter(se(e), "day");
|
|
1062
|
+
return i ? c || o.isBefore(se(e).subtract(i - 1, "day"), "day") : c;
|
|
1063
|
+
}
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
function Be(e, i = 0) {
|
|
1067
|
+
return {
|
|
1068
|
+
disabledDate: (l) => {
|
|
1069
|
+
if (!e) return !1;
|
|
1070
|
+
const o = se(l), c = o.isBefore(se(e), "day");
|
|
1071
|
+
return i ? c || o.isAfter(se(e).add(i - 1, "day"), "day") : c;
|
|
1072
|
+
}
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
const _a = { class: "editable-table-sort-filter__sort" }, wa = { class: "editable-table-sort-filter__search-title" }, Sa = { class: "editable-table-sort-filter__date-picker-content" }, Ca = /* @__PURE__ */ te({
|
|
1076
|
+
__name: "BizDoubleDatePickerFilter",
|
|
1077
|
+
props: {
|
|
1078
|
+
config: {},
|
|
1079
|
+
tempFilteredValue: {}
|
|
1080
|
+
},
|
|
1081
|
+
emits: ["update:tempFilteredValue"],
|
|
1082
|
+
setup(e, { emit: i }) {
|
|
1083
|
+
const l = e, { config: o, tempFilteredValue: c } = Ee(l), b = i, a = {
|
|
1084
|
+
valueFormat: "yyyy-MM-dd",
|
|
1085
|
+
format: "yyyy-MM-dd",
|
|
1086
|
+
type: "date",
|
|
1087
|
+
size: "small",
|
|
1088
|
+
editable: !1
|
|
1089
|
+
}, n = ae(() => {
|
|
1090
|
+
var h;
|
|
1091
|
+
return "pickerOptions" in o.value && ((h = o.value.pickerOptions) != null && h.start) ? o.value.pickerOptions.start : "limit" in o.value ? Ae(
|
|
1092
|
+
c.value[o.value.prop[1]],
|
|
1093
|
+
o.value.limit
|
|
1094
|
+
) : Ae(
|
|
1095
|
+
c.value[o.value.prop[1]]
|
|
1096
|
+
);
|
|
1097
|
+
}), t = ae(() => {
|
|
1098
|
+
var h;
|
|
1099
|
+
return "pickerOptions" in o.value && ((h = o.value.pickerOptions) != null && h.end) ? o.value.pickerOptions.end : "limit" in o.value ? Be(
|
|
1100
|
+
c.value[o.value.prop[0]],
|
|
1101
|
+
o.value.limit
|
|
1102
|
+
) : Be(
|
|
1103
|
+
c.value[o.value.prop[0]]
|
|
1104
|
+
);
|
|
1105
|
+
}), d = (h) => {
|
|
1106
|
+
b("update:tempFilteredValue", o.value.prop[0], h || "");
|
|
1107
|
+
}, C = (h) => {
|
|
1108
|
+
b("update:tempFilteredValue", o.value.prop[1], h || "");
|
|
1109
|
+
};
|
|
1110
|
+
return (h, w) => {
|
|
1111
|
+
const x = Q("el-date-picker");
|
|
1112
|
+
return g(), T("div", _a, [
|
|
1113
|
+
V("div", wa, Y(r(o).label || "筛选"), 1),
|
|
1114
|
+
V("div", Sa, [
|
|
1115
|
+
N(x, ie(a, {
|
|
1116
|
+
placeholder: "开始日期",
|
|
1117
|
+
value: r(c)[r(o).prop[0]],
|
|
1118
|
+
"picker-options": n.value,
|
|
1119
|
+
onInput: d
|
|
1120
|
+
}), null, 16, ["value", "picker-options"]),
|
|
1121
|
+
N(x, ie(a, {
|
|
1122
|
+
placeholder: "结束日期",
|
|
1123
|
+
value: r(c)[r(o).prop[1]],
|
|
1124
|
+
"picker-options": t.value,
|
|
1125
|
+
onInput: C
|
|
1126
|
+
}), null, 16, ["value", "picker-options"])
|
|
1127
|
+
])
|
|
1128
|
+
]);
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
}), xa = { class: "editable-table-sort-filter__search" }, ka = { class: "editable-table-sort-filter__search-title" }, $a = /* @__PURE__ */ te({
|
|
1132
|
+
__name: "BizInputFilter",
|
|
1133
|
+
props: {
|
|
1134
|
+
config: {},
|
|
1135
|
+
tempFilteredValue: {}
|
|
1136
|
+
},
|
|
1137
|
+
emits: ["update:tempFilteredValue"],
|
|
1138
|
+
setup(e, { emit: i }) {
|
|
1139
|
+
const l = i;
|
|
1140
|
+
return (o, c) => {
|
|
1141
|
+
const b = Q("el-input");
|
|
1142
|
+
return g(), T("div", xa, [
|
|
1143
|
+
V("div", ka, Y(e.config.label || "搜索"), 1),
|
|
1144
|
+
N(b, {
|
|
1145
|
+
class: "editable-table-sort-filter__search-input",
|
|
1146
|
+
placeholder: e.config.placeholder || "请输入内容",
|
|
1147
|
+
value: e.tempFilteredValue[e.config.prop],
|
|
1148
|
+
onInput: c[0] || (c[0] = (a) => l("update:tempFilteredValue", e.config.prop, a))
|
|
1149
|
+
}, null, 8, ["placeholder", "value"])
|
|
1150
|
+
]);
|
|
1151
|
+
};
|
|
1152
|
+
}
|
|
1153
|
+
}), Ea = [
|
|
1154
|
+
{ month: 1, day: 31 },
|
|
1155
|
+
{ month: 2, day: 29 },
|
|
1156
|
+
{ month: 3, day: 31 },
|
|
1157
|
+
{ month: 4, day: 30 },
|
|
1158
|
+
{ month: 5, day: 31 },
|
|
1159
|
+
{ month: 6, day: 30 },
|
|
1160
|
+
{ month: 7, day: 31 },
|
|
1161
|
+
{ month: 8, day: 31 },
|
|
1162
|
+
{ month: 9, day: 30 },
|
|
1163
|
+
{ month: 10, day: 31 },
|
|
1164
|
+
{ month: 11, day: 30 },
|
|
1165
|
+
{ month: 12, day: 31 }
|
|
1166
|
+
];
|
|
1167
|
+
function $e() {
|
|
1168
|
+
return Ea.map(
|
|
1169
|
+
(e) => ({
|
|
1170
|
+
value: e.month.toString(),
|
|
1171
|
+
label: `${e.month}月`,
|
|
1172
|
+
children: Array.from(
|
|
1173
|
+
{ length: e.day },
|
|
1174
|
+
(i, l) => ({ value: `${l + 1}`, label: `${l + 1}日` })
|
|
1175
|
+
)
|
|
1176
|
+
})
|
|
1177
|
+
);
|
|
1178
|
+
}
|
|
1179
|
+
function ze({
|
|
1180
|
+
date: e = [],
|
|
1181
|
+
isStartDate: i = !1,
|
|
1182
|
+
digits: l = 3
|
|
1183
|
+
}) {
|
|
1184
|
+
return $e().map(
|
|
1185
|
+
(a) => {
|
|
1186
|
+
const n = a.children.map(
|
|
1187
|
+
(d) => {
|
|
1188
|
+
const C = se([2024, a.value, d.value].join("-"));
|
|
1189
|
+
let h = !1;
|
|
1190
|
+
if (e.length > 0) {
|
|
1191
|
+
const w = se([2024, ...e].join("-"));
|
|
1192
|
+
if (i) {
|
|
1193
|
+
const x = w.add(l * 30 - 1, "day");
|
|
1194
|
+
x.year() > 2024 ? h = C.isAfter(x.subtract(366, "day"), "day") && C.isBefore(w, "day") : h = C.isAfter(x, "day") || C.isBefore(w, "day");
|
|
1195
|
+
} else {
|
|
1196
|
+
const x = w.subtract(l * 30 - 1, "day");
|
|
1197
|
+
x.year() < 2024 ? h = C.isBefore(x.add(366, "day"), "day") && C.isAfter(w, "day") : h = C.isBefore(x, "day") || C.isAfter(w, "day");
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
return {
|
|
1201
|
+
...d,
|
|
1202
|
+
disabled: h
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1205
|
+
), t = n.every((d) => d.disabled);
|
|
1206
|
+
return {
|
|
1207
|
+
...a,
|
|
1208
|
+
disabled: t,
|
|
1209
|
+
children: n
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
);
|
|
1213
|
+
}
|
|
1214
|
+
function Pa(e) {
|
|
1215
|
+
return e.map(
|
|
1216
|
+
(i) => i.padStart(2, "0")
|
|
1217
|
+
).join("-");
|
|
1218
|
+
}
|
|
1219
|
+
const Da = { class: "editable-table-sort-filter__sort" }, Va = { class: "editable-table-sort-filter__search-title" }, Fa = { class: "editable-table-sort-filter__date-picker-content" }, Ra = /* @__PURE__ */ te({
|
|
1220
|
+
__name: "BizMonthDayPicker",
|
|
1221
|
+
props: {
|
|
1222
|
+
config: {},
|
|
1223
|
+
tempFilteredValue: {}
|
|
1224
|
+
},
|
|
1225
|
+
emits: ["update:tempFilteredValue"],
|
|
1226
|
+
setup(e, { emit: i }) {
|
|
1227
|
+
const l = e, { config: o, tempFilteredValue: c } = Ee(l), b = i, a = (w) => w ? w.split("-").map((x) => String(Number(x))) : [], n = ae(() => {
|
|
1228
|
+
const { prop: w } = o.value;
|
|
1229
|
+
return a(c.value[w[0]]);
|
|
1230
|
+
}), t = ae(() => {
|
|
1231
|
+
const { prop: w } = o.value;
|
|
1232
|
+
return a(c.value[w[1]]);
|
|
1233
|
+
}), d = ae(() => t.value.length === 0 ? $e() : ze({
|
|
1234
|
+
date: t.value,
|
|
1235
|
+
isStartDate: !1,
|
|
1236
|
+
digits: o.value.limit
|
|
1237
|
+
})), C = ae(() => n.value.length === 0 ? $e() : ze({
|
|
1238
|
+
date: n.value,
|
|
1239
|
+
isStartDate: !0,
|
|
1240
|
+
digits: o.value.limit
|
|
1241
|
+
})), h = (w, x) => {
|
|
1242
|
+
const z = x.length === 0 ? "" : Pa(x);
|
|
1243
|
+
b("update:tempFilteredValue", w, z);
|
|
1244
|
+
};
|
|
1245
|
+
return (w, x) => {
|
|
1246
|
+
const z = Q("el-cascader");
|
|
1247
|
+
return g(), T("div", Da, [
|
|
1248
|
+
V("div", Va, Y(r(o).label || "筛选"), 1),
|
|
1249
|
+
V("div", Fa, [
|
|
1250
|
+
N(z, {
|
|
1251
|
+
clearable: "",
|
|
1252
|
+
value: n.value,
|
|
1253
|
+
separator: "",
|
|
1254
|
+
size: "small",
|
|
1255
|
+
placeholder: "开始日期",
|
|
1256
|
+
"popper-class": "month-day-picker",
|
|
1257
|
+
options: d.value,
|
|
1258
|
+
onChange: x[0] || (x[0] = (O) => h(r(o).prop[0], O))
|
|
1259
|
+
}, null, 8, ["value", "options"]),
|
|
1260
|
+
N(z, {
|
|
1261
|
+
clearable: "",
|
|
1262
|
+
value: t.value,
|
|
1263
|
+
separator: "",
|
|
1264
|
+
size: "small",
|
|
1265
|
+
placeholder: "结束日期",
|
|
1266
|
+
"popper-class": "month-day-picker",
|
|
1267
|
+
options: C.value,
|
|
1268
|
+
onChange: x[1] || (x[1] = (O) => h(r(o).prop[1], O))
|
|
1269
|
+
}, null, 8, ["value", "options"])
|
|
1270
|
+
])
|
|
1271
|
+
]);
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
}), Ta = { class: "editable-table-sort-filter__sort" }, Oa = { class: "editable-table-sort-filter__sort-title" }, La = { class: "editable-table-sort-filter__sort-btns" }, Ia = /* @__PURE__ */ te({
|
|
1275
|
+
__name: "BizSortFilter",
|
|
1276
|
+
props: {
|
|
1277
|
+
column: {},
|
|
1278
|
+
tempSortType: {},
|
|
1279
|
+
tempSortProp: {}
|
|
1280
|
+
},
|
|
1281
|
+
emits: ["update:sort"],
|
|
1282
|
+
setup(e, { emit: i }) {
|
|
1283
|
+
const l = e, o = i, c = (a, n) => l.tempSortType === a && l.tempSortProp === n, b = ae(() => Array.isArray(l.column._sortable) ? l.column._sortable : [{ ...l.column, label: "排序" }]);
|
|
1284
|
+
return (a, n) => {
|
|
1285
|
+
const t = Q("el-button");
|
|
1286
|
+
return g(), T("div", Ta, [
|
|
1287
|
+
(g(!0), T(q, null, re(b.value, (d) => (g(), T("div", {
|
|
1288
|
+
key: d.prop
|
|
1289
|
+
}, [
|
|
1290
|
+
V("div", Oa, Y(d.label || "排序"), 1),
|
|
1291
|
+
V("div", La, [
|
|
1292
|
+
N(t, {
|
|
1293
|
+
class: he([
|
|
1294
|
+
"editable-table-sort-filter__sort-btn",
|
|
1295
|
+
c("ascending", d.prop) && "editable-table-sort-filter__sort-btn--active"
|
|
1296
|
+
]),
|
|
1297
|
+
onClick: () => o("update:sort", "ascending", d.prop)
|
|
1298
|
+
}, {
|
|
1299
|
+
default: R(() => [...n[0] || (n[0] = [
|
|
1300
|
+
X(" 升序 ", -1)
|
|
1301
|
+
])]),
|
|
1302
|
+
_: 1
|
|
1303
|
+
}, 8, ["class", "onClick"]),
|
|
1304
|
+
N(t, {
|
|
1305
|
+
class: he([
|
|
1306
|
+
"editable-table-sort-filter__sort-btn",
|
|
1307
|
+
c("descending", d.prop) && "editable-table-sort-filter__sort-btn--active"
|
|
1308
|
+
]),
|
|
1309
|
+
onClick: () => o("update:sort", "descending", d.prop)
|
|
1310
|
+
}, {
|
|
1311
|
+
default: R(() => [...n[1] || (n[1] = [
|
|
1312
|
+
X(" 降序 ", -1)
|
|
1313
|
+
])]),
|
|
1314
|
+
_: 1
|
|
1315
|
+
}, 8, ["class", "onClick"])
|
|
1316
|
+
])
|
|
1317
|
+
]))), 128))
|
|
1318
|
+
]);
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
}), Ma = { class: "editable-table-sort-filter__filter" }, Aa = { class: "editable-table-sort-filter__filter-title" }, Ba = /* @__PURE__ */ te({
|
|
1322
|
+
__name: "BizRadioFilter",
|
|
1323
|
+
props: {
|
|
1324
|
+
config: {},
|
|
1325
|
+
tempFilteredValue: {}
|
|
1326
|
+
},
|
|
1327
|
+
emits: ["update:tempFilteredValue"],
|
|
1328
|
+
setup(e, { emit: i }) {
|
|
1329
|
+
const l = i;
|
|
1330
|
+
return (o, c) => {
|
|
1331
|
+
const b = Q("el-radio"), a = Q("el-radio-group");
|
|
1332
|
+
return g(), T("div", Ma, [
|
|
1333
|
+
V("div", Aa, Y(e.config.label || "筛选"), 1),
|
|
1334
|
+
N(a, {
|
|
1335
|
+
style: { display: "flex", "flex-direction": "column", gap: "6px" },
|
|
1336
|
+
value: e.tempFilteredValue[e.config.prop],
|
|
1337
|
+
onInput: c[0] || (c[0] = (n) => l("update:tempFilteredValue", e.config.prop, n))
|
|
1338
|
+
}, {
|
|
1339
|
+
default: R(() => [
|
|
1340
|
+
(g(!0), T(q, null, re(e.config.options, (n) => (g(), G(b, {
|
|
1341
|
+
key: n.value,
|
|
1342
|
+
label: n.value,
|
|
1343
|
+
title: n.text
|
|
1344
|
+
}, {
|
|
1345
|
+
default: R(() => [
|
|
1346
|
+
X(Y(n.text), 1)
|
|
1347
|
+
]),
|
|
1348
|
+
_: 2
|
|
1349
|
+
}, 1032, ["label", "title"]))), 128))
|
|
1350
|
+
]),
|
|
1351
|
+
_: 1
|
|
1352
|
+
}, 8, ["value"])
|
|
1353
|
+
]);
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
}), za = { class: "editable-table-sort-filter" }, Na = { class: "editable-table-sort-filter__column-title" }, ja = { class: "editable-table-sort-filter__item" }, Ha = {
|
|
1357
|
+
key: 1,
|
|
1358
|
+
class: "editable-table-sort-filter__item editable-table-sort-filter__filter"
|
|
1359
|
+
}, Ua = { class: "editable-table-sort-filter__footer" }, Ne = /* @__PURE__ */ te({
|
|
1360
|
+
__name: "index",
|
|
1361
|
+
props: {
|
|
1362
|
+
headActive: { type: Boolean },
|
|
1363
|
+
column: {},
|
|
1364
|
+
tempSummaryList: {},
|
|
1365
|
+
tempSortType: {},
|
|
1366
|
+
tempSortProp: {},
|
|
1367
|
+
tempFilteredValue: {}
|
|
1368
|
+
},
|
|
1369
|
+
emits: ["update:tempFilteredValue", "update:tempSummaryList", "update:sort", "popover-show", "reset", "confirm"],
|
|
1370
|
+
setup(e, { expose: i, emit: l }) {
|
|
1371
|
+
const o = l, c = {
|
|
1372
|
+
/** 输入框 */
|
|
1373
|
+
input: $a,
|
|
1374
|
+
/** 日期范围 */
|
|
1375
|
+
doubleDatePicker: Ca,
|
|
1376
|
+
/** 单选框 */
|
|
1377
|
+
radio: Ba,
|
|
1378
|
+
/** 复选框 */
|
|
1379
|
+
checkbox: va,
|
|
1380
|
+
/** 月日选择器 */
|
|
1381
|
+
monthDayPicker: Ra,
|
|
1382
|
+
/** 颜色选择器 */
|
|
1383
|
+
colorRadio: ha
|
|
1384
|
+
}, b = M(null);
|
|
1385
|
+
function a(n, t) {
|
|
1386
|
+
o("update:tempFilteredValue", n, t);
|
|
1387
|
+
}
|
|
1388
|
+
return i({
|
|
1389
|
+
close: () => {
|
|
1390
|
+
var n;
|
|
1391
|
+
(n = b.value) == null || n.doClose();
|
|
1392
|
+
}
|
|
1393
|
+
}), (n, t) => {
|
|
1394
|
+
const d = Q("el-checkbox"), C = Q("el-checkbox-group"), h = Q("el-button"), w = Q("el-popover");
|
|
1395
|
+
return g(), G(w, {
|
|
1396
|
+
ref_key: "popoverRef",
|
|
1397
|
+
ref: b,
|
|
1398
|
+
placement: "bottom",
|
|
1399
|
+
trigger: "click",
|
|
1400
|
+
"popper-class": "editable-table-sort-filter",
|
|
1401
|
+
"data-popper-name": "editable-table-sort-filter",
|
|
1402
|
+
"data-prop": e.column.prop,
|
|
1403
|
+
onShow: t[4] || (t[4] = () => o("popover-show"))
|
|
1404
|
+
}, {
|
|
1405
|
+
reference: R(() => [
|
|
1406
|
+
le(n.$slots, "custom", {}, () => [
|
|
1407
|
+
V("span", {
|
|
1408
|
+
class: he([
|
|
1409
|
+
"editable-table__sort-reference",
|
|
1410
|
+
e.headActive && "editable-table__sort-reference--active"
|
|
1411
|
+
])
|
|
1412
|
+
}, [
|
|
1413
|
+
X(Y(e.column.label) + " ", 1),
|
|
1414
|
+
V("div", {
|
|
1415
|
+
class: he([
|
|
1416
|
+
"editable-table__sort-icon",
|
|
1417
|
+
e.headActive && "editable-table__sort-icon--active"
|
|
1418
|
+
])
|
|
1419
|
+
}, null, 2)
|
|
1420
|
+
], 2)
|
|
1421
|
+
])
|
|
1422
|
+
]),
|
|
1423
|
+
default: R(() => [
|
|
1424
|
+
V("div", za, [
|
|
1425
|
+
V("div", Na, Y(e.column.label), 1),
|
|
1426
|
+
V("div", ja, [
|
|
1427
|
+
e.column.isColumnSortable ? (g(), G(Ia, {
|
|
1428
|
+
key: 0,
|
|
1429
|
+
column: e.column,
|
|
1430
|
+
"temp-sort-prop": e.tempSortProp,
|
|
1431
|
+
"temp-sort-type": e.tempSortType,
|
|
1432
|
+
"onUpdate:sort": t[0] || (t[0] = (x, z) => o("update:sort", x, z))
|
|
1433
|
+
}, null, 8, ["column", "temp-sort-prop", "temp-sort-type"])) : ee("", !0)
|
|
1434
|
+
]),
|
|
1435
|
+
e.column.filters ? (g(!0), T(q, { key: 0 }, re(e.column.filters, (x, z) => (g(), T("div", {
|
|
1436
|
+
key: z,
|
|
1437
|
+
class: "editable-table-sort-filter__item editable-table__filter-group__filter"
|
|
1438
|
+
}, [
|
|
1439
|
+
x.type === "slot" ? le(n.$slots, x.slotName, { key: 0 }) : (g(), G(yt(c[x.type]), {
|
|
1440
|
+
key: 1,
|
|
1441
|
+
config: x,
|
|
1442
|
+
"temp-filtered-value": e.tempFilteredValue,
|
|
1443
|
+
"onUpdate:tempFilteredValue": a
|
|
1444
|
+
}, null, 40, ["config", "temp-filtered-value"]))
|
|
1445
|
+
]))), 128)) : ee("", !0),
|
|
1446
|
+
e.column.summary ? (g(), T("div", Ha, [
|
|
1447
|
+
t[5] || (t[5] = V("div", { class: "editable-table-sort-filter__filter-title" }, "统计", -1)),
|
|
1448
|
+
N(C, {
|
|
1449
|
+
class: "editable-table-sort-filter__filter-checkbox-group",
|
|
1450
|
+
value: e.tempSummaryList,
|
|
1451
|
+
onInput: t[1] || (t[1] = (x) => o("update:tempSummaryList", x))
|
|
1452
|
+
}, {
|
|
1453
|
+
default: R(() => [
|
|
1454
|
+
N(d, {
|
|
1455
|
+
label: e.column.prop,
|
|
1456
|
+
class: "editable-table-sort-filter__filter-checkbox"
|
|
1457
|
+
}, {
|
|
1458
|
+
default: R(() => [
|
|
1459
|
+
le(n.$slots, "summay-item", ht(_t(e.column)), () => [
|
|
1460
|
+
X(Y(e.column.label), 1)
|
|
1461
|
+
])
|
|
1462
|
+
]),
|
|
1463
|
+
_: 3
|
|
1464
|
+
}, 8, ["label"])
|
|
1465
|
+
]),
|
|
1466
|
+
_: 3
|
|
1467
|
+
}, 8, ["value"])
|
|
1468
|
+
])) : ee("", !0),
|
|
1469
|
+
V("div", Ua, [
|
|
1470
|
+
N(h, {
|
|
1471
|
+
class: "editable-table-sort-filter__reset-btn",
|
|
1472
|
+
onClick: t[2] || (t[2] = () => o("reset"))
|
|
1473
|
+
}, {
|
|
1474
|
+
default: R(() => [...t[6] || (t[6] = [
|
|
1475
|
+
X(" 重置 ", -1)
|
|
1476
|
+
])]),
|
|
1477
|
+
_: 1
|
|
1478
|
+
}),
|
|
1479
|
+
N(h, {
|
|
1480
|
+
class: "editable-table-sort-filter__confirm-btn",
|
|
1481
|
+
type: "primary",
|
|
1482
|
+
onClick: t[3] || (t[3] = () => o("confirm"))
|
|
1483
|
+
}, {
|
|
1484
|
+
default: R(() => [...t[7] || (t[7] = [
|
|
1485
|
+
X(" 确定 ", -1)
|
|
1486
|
+
])]),
|
|
1487
|
+
_: 1
|
|
1488
|
+
})
|
|
1489
|
+
])
|
|
1490
|
+
])
|
|
1491
|
+
]),
|
|
1492
|
+
_: 3
|
|
1493
|
+
}, 8, ["data-prop"]);
|
|
1494
|
+
};
|
|
1495
|
+
}
|
|
1496
|
+
}), Wa = { class: "editable-table-operation-popover__operation-reference btn-pointer" }, Ga = { class: "editable-table-operation-popover__operation" }, Ka = /* @__PURE__ */ te({
|
|
1497
|
+
__name: "bizTableOperatePopover",
|
|
1498
|
+
props: {
|
|
1499
|
+
defaultOperations: {},
|
|
1500
|
+
scope: {}
|
|
1501
|
+
},
|
|
1502
|
+
emits: ["edit", "delete", "rowPinToTop"],
|
|
1503
|
+
setup(e, { expose: i, emit: l }) {
|
|
1504
|
+
const o = l, c = M(null);
|
|
1505
|
+
return i({
|
|
1506
|
+
doClose: () => {
|
|
1507
|
+
var b, a;
|
|
1508
|
+
return (a = (b = c.value) == null ? void 0 : b.doClose) == null ? void 0 : a.call(b);
|
|
1509
|
+
}
|
|
1510
|
+
}), (b, a) => {
|
|
1511
|
+
const n = Q("el-button"), t = Q("el-popover");
|
|
1512
|
+
return g(), G(t, {
|
|
1513
|
+
ref_key: "operationPopoverRef",
|
|
1514
|
+
ref: c,
|
|
1515
|
+
placement: "bottom",
|
|
1516
|
+
trigger: "click",
|
|
1517
|
+
"popper-class": "editable-table-operation-popover"
|
|
1518
|
+
}, {
|
|
1519
|
+
reference: R(() => [
|
|
1520
|
+
V("div", Wa, [
|
|
1521
|
+
N(n, { class: "editable-table-operation-popover__operation-btn" }, {
|
|
1522
|
+
default: R(() => [...a[3] || (a[3] = [
|
|
1523
|
+
X(" 操作 ", -1)
|
|
1524
|
+
])]),
|
|
1525
|
+
_: 1
|
|
1526
|
+
})
|
|
1527
|
+
])
|
|
1528
|
+
]),
|
|
1529
|
+
default: R(() => [
|
|
1530
|
+
V("div", Ga, [
|
|
1531
|
+
e.defaultOperations.includes("delete") ? (g(), T("div", {
|
|
1532
|
+
key: 0,
|
|
1533
|
+
class: "editable-table-operation-popover__operation-item btn-pointer",
|
|
1534
|
+
onClick: a[0] || (a[0] = () => o("delete"))
|
|
1535
|
+
}, " 删除 ")) : ee("", !0),
|
|
1536
|
+
e.defaultOperations.includes("edit") ? (g(), T("div", {
|
|
1537
|
+
key: 1,
|
|
1538
|
+
class: "editable-table-operation-popover__operation-item btn-pointer",
|
|
1539
|
+
onClick: a[1] || (a[1] = () => o("edit"))
|
|
1540
|
+
}, " 编辑 ")) : ee("", !0),
|
|
1541
|
+
e.defaultOperations.includes("top") ? (g(), T("div", {
|
|
1542
|
+
key: 2,
|
|
1543
|
+
class: "editable-table-operation-popover__operation-item btn-pointer",
|
|
1544
|
+
onClick: a[2] || (a[2] = () => o("rowPinToTop"))
|
|
1545
|
+
}, " 置顶 ")) : ee("", !0),
|
|
1546
|
+
le(b.$slots, "default")
|
|
1547
|
+
])
|
|
1548
|
+
]),
|
|
1549
|
+
_: 3
|
|
1550
|
+
}, 512);
|
|
1551
|
+
};
|
|
1552
|
+
}
|
|
1553
|
+
}), Xa = { class: "editable-table" }, Ya = {
|
|
1554
|
+
key: 0,
|
|
1555
|
+
class: "editable-table__toolbar"
|
|
1556
|
+
}, qa = ["data-index", "onMousedown"], Ja = ["data-index"], Qa = {
|
|
1557
|
+
key: 1,
|
|
1558
|
+
class: "editable-table__color-icon"
|
|
1559
|
+
}, Za = {
|
|
1560
|
+
key: 1,
|
|
1561
|
+
class: "editable-table-operation-popover__save-cancel"
|
|
1562
|
+
}, en = {
|
|
1563
|
+
key: 1,
|
|
1564
|
+
class: "editable-table__pagination"
|
|
1565
|
+
}, tn = /* @__PURE__ */ te({
|
|
1566
|
+
name: "EditableTable",
|
|
1567
|
+
inheritAttrs: !1,
|
|
1568
|
+
__name: "index",
|
|
1569
|
+
props: {
|
|
1570
|
+
data: { default: () => [] },
|
|
1571
|
+
columns: { default: () => [] },
|
|
1572
|
+
total: { default: 0 },
|
|
1573
|
+
showIndex: { type: Boolean, default: !1 },
|
|
1574
|
+
showSelection: { type: Boolean, default: !1 },
|
|
1575
|
+
showExpand: { type: Boolean, default: !1 },
|
|
1576
|
+
draggable: { type: Boolean, default: !1 },
|
|
1577
|
+
loading: { type: Boolean, default: !1 },
|
|
1578
|
+
operations: { default: () => [] },
|
|
1579
|
+
colorOptions: { default: () => [] },
|
|
1580
|
+
colorFilterConfig: { default: void 0 },
|
|
1581
|
+
hideColumnSetting: { type: Boolean, default: !1 },
|
|
1582
|
+
columnSettingKey: { default: "" },
|
|
1583
|
+
settingStorgeKey: { default: "" },
|
|
1584
|
+
leftFixedCount: { default: 1 },
|
|
1585
|
+
currentPage: { default: 1 },
|
|
1586
|
+
pageSize: { default: 10 },
|
|
1587
|
+
pageSizes: { default: () => [10, 20, 50, 100] },
|
|
1588
|
+
dragRange: { default: 15 },
|
|
1589
|
+
dragSemiRange: {},
|
|
1590
|
+
localSort: { type: Boolean },
|
|
1591
|
+
localFilter: { type: Boolean },
|
|
1592
|
+
columnConfig: { default: () => [] },
|
|
1593
|
+
settingStorgeMigrationConfigs: {},
|
|
1594
|
+
dataList: { default: () => [] },
|
|
1595
|
+
rowDragAble: { type: Boolean, default: !1 },
|
|
1596
|
+
colorList: { default: () => [] },
|
|
1597
|
+
defaultOperations: { default: () => [] },
|
|
1598
|
+
hideViewSettingBtn: { type: Boolean, default: !1 },
|
|
1599
|
+
hasExpandRow: { type: Boolean, default: !1 }
|
|
1600
|
+
},
|
|
1601
|
+
emits: ["selection-change", "update:currentPage", "update:pageSize", "page-change", "sort-change", "filter-change", "search", "row-edit", "row-edit-save", "row-edit-cancel", "row-delete", "row-pin", "row-pin-to-top", "row-drag", "row-drag-drop", "row-color-change", "row-bg-change", "row-dblclick"],
|
|
1602
|
+
setup(e, { expose: i, emit: l }) {
|
|
1603
|
+
const o = e, c = M(
|
|
1604
|
+
null
|
|
1605
|
+
), b = () => {
|
|
1606
|
+
var k;
|
|
1607
|
+
(k = c.value) == null || k.open();
|
|
1608
|
+
}, a = l, n = wt(), t = ae(() => {
|
|
1609
|
+
var k, _, oe, W;
|
|
1610
|
+
return {
|
|
1611
|
+
...o,
|
|
1612
|
+
columnConfig: (k = o.columns) != null && k.length ? o.columns : o.columnConfig || [],
|
|
1613
|
+
settingStorgeKey: o.columnSettingKey || o.settingStorgeKey,
|
|
1614
|
+
dragSemiRange: o.dragRange || o.dragSemiRange,
|
|
1615
|
+
dataList: (_ = o.data) != null && _.length ? o.data : o.dataList || [],
|
|
1616
|
+
rowDragAble: o.draggable || o.rowDragAble,
|
|
1617
|
+
colorList: (oe = o.colorOptions) != null && oe.length ? o.colorOptions : o.colorList || [],
|
|
1618
|
+
defaultOperations: (W = o.operations) != null && W.length ? o.operations : o.defaultOperations || [],
|
|
1619
|
+
hideViewSettingBtn: o.hideColumnSetting || o.hideViewSettingBtn,
|
|
1620
|
+
showExpand: o.showExpand || o.hasExpandRow
|
|
1621
|
+
};
|
|
1622
|
+
}), d = M(), C = M(null), h = M([]), w = M(0), x = M([]), { currentPage: z, pageSize: O, handlePageChange: f, handleSizeChange: m } = It(o, a), P = async () => {
|
|
1623
|
+
var k;
|
|
1624
|
+
await be(), (k = d.value) == null || k.doLayout();
|
|
1625
|
+
}, {
|
|
1626
|
+
setSort: H,
|
|
1627
|
+
setSearchParams: U,
|
|
1628
|
+
isColumnHeadActive: K,
|
|
1629
|
+
handleSort: A,
|
|
1630
|
+
handleHeaderPopoverShow: p,
|
|
1631
|
+
handleHeaderOperationConfirm: D,
|
|
1632
|
+
handleHeaderOperationReset: S,
|
|
1633
|
+
summaryList: F,
|
|
1634
|
+
tableSummaryMethod: L,
|
|
1635
|
+
filteredValue: s,
|
|
1636
|
+
showColumnHeadSortIcon: u,
|
|
1637
|
+
sortProp: E,
|
|
1638
|
+
tempFilteredValue: y,
|
|
1639
|
+
tempSummaryList: I,
|
|
1640
|
+
tempSortType: $,
|
|
1641
|
+
tempSortProp: j,
|
|
1642
|
+
isColumnFiltering: Z,
|
|
1643
|
+
inSorting: ve
|
|
1644
|
+
} = Go({
|
|
1645
|
+
tableDomRef: d,
|
|
1646
|
+
props: t.value,
|
|
1647
|
+
emit: a,
|
|
1648
|
+
showingColumns: h
|
|
1649
|
+
}), de = ae(() => {
|
|
1650
|
+
const k = [];
|
|
1651
|
+
let _ = w.value;
|
|
1652
|
+
for (const oe of h.value) {
|
|
1653
|
+
const W = t.value.columnConfig.find((v) => v.prop === oe);
|
|
1654
|
+
if (!W) continue;
|
|
1655
|
+
const ne = { ...W };
|
|
1656
|
+
ne.isColumnSortable = !!W.sortable, ne.sortable = ve.value ? !!W.sortable : !1, ne._sortable = W.sortable, _ > 0 ? (ne.fixed = "left", _--) : ne.fixed = void 0, k.push(ne);
|
|
1657
|
+
}
|
|
1658
|
+
return t.value.defaultOperations && t.value.defaultOperations.length > 0 && k.push({
|
|
1659
|
+
label: "操作",
|
|
1660
|
+
prop: "$$operation",
|
|
1661
|
+
minWidth: "100px",
|
|
1662
|
+
fixed: "right"
|
|
1663
|
+
}), k;
|
|
1664
|
+
}), ot = (k, _) => {
|
|
1665
|
+
switch (k) {
|
|
1666
|
+
case "update:leftFixedColumnCount":
|
|
1667
|
+
w.value = _;
|
|
1668
|
+
break;
|
|
1669
|
+
case "update:showingColumns":
|
|
1670
|
+
h.value = _;
|
|
1671
|
+
break;
|
|
1672
|
+
case "update:viewSettingDragSortOptions":
|
|
1673
|
+
x.value = _;
|
|
1674
|
+
break;
|
|
1675
|
+
case "tableDoLayout":
|
|
1676
|
+
P();
|
|
1677
|
+
break;
|
|
1678
|
+
}
|
|
1679
|
+
};
|
|
1680
|
+
Ze({
|
|
1681
|
+
showingColumns: h,
|
|
1682
|
+
actualColumns: de,
|
|
1683
|
+
props: t.value,
|
|
1684
|
+
viewSettingDragSortOptions: x,
|
|
1685
|
+
emit: ot
|
|
1686
|
+
});
|
|
1687
|
+
const { formatCellValue: at } = Mt(
|
|
1688
|
+
o,
|
|
1689
|
+
h,
|
|
1690
|
+
w
|
|
1691
|
+
), {
|
|
1692
|
+
operationPopoverRef: nt,
|
|
1693
|
+
editingRowData: ue,
|
|
1694
|
+
editingRowIndex: ge,
|
|
1695
|
+
handleDelete: lt,
|
|
1696
|
+
closeAllExpandedRows: rt,
|
|
1697
|
+
handleEdit: it,
|
|
1698
|
+
handleEditSave: st,
|
|
1699
|
+
handleEditCancel: dt,
|
|
1700
|
+
handleRowPinToTop: ut
|
|
1701
|
+
} = Wo({
|
|
1702
|
+
emit: a,
|
|
1703
|
+
tableDomRef: d,
|
|
1704
|
+
pageSize: O,
|
|
1705
|
+
props: o,
|
|
1706
|
+
hasExpandRow: t.value.showExpand
|
|
1707
|
+
}), { setRowStyle: ct } = Qe({
|
|
1708
|
+
colorList: t.value.colorList || [],
|
|
1709
|
+
emit: a
|
|
1710
|
+
}), pt = ({ row: k, rowIndex: _ }) => [
|
|
1711
|
+
"custom-row-classname",
|
|
1712
|
+
`custom-row-classname-${_}`,
|
|
1713
|
+
k.isPinned ? "custom-row-classname-pinned" : ""
|
|
1714
|
+
].join(" "), { hoveringCellInfo: De, setCellClassName: ft, debouncedHoverHandler: vt } = Uo(d), gt = () => (ge.value = -1, E.value ? (console.warn("已有列正在排序,不允许拖拽。"), !1) : Z.value ? (console.warn("已有列正在筛选,不允许拖拽。"), !1) : !0);
|
|
1715
|
+
Ho({
|
|
1716
|
+
props: t.value,
|
|
1717
|
+
emit: a,
|
|
1718
|
+
viewSettingDragSortOptions: x,
|
|
1719
|
+
beforeDragStart: gt,
|
|
1720
|
+
currScope: C,
|
|
1721
|
+
currentPage: z,
|
|
1722
|
+
pageSize: O,
|
|
1723
|
+
tableDomRef: d
|
|
1724
|
+
});
|
|
1725
|
+
const mt = (k) => {
|
|
1726
|
+
a("selection-change", k);
|
|
1727
|
+
}, bt = (k) => {
|
|
1728
|
+
const {
|
|
1729
|
+
editType: _,
|
|
1730
|
+
editSlotName: oe,
|
|
1731
|
+
editOptions: W,
|
|
1732
|
+
slotName: ne,
|
|
1733
|
+
hoverSlotName: v,
|
|
1734
|
+
formatter: ce,
|
|
1735
|
+
filters: B,
|
|
1736
|
+
showFilterIcon: J,
|
|
1737
|
+
summary: Ve,
|
|
1738
|
+
summaryMethod: an,
|
|
1739
|
+
alwaysShow: nn,
|
|
1740
|
+
defaultHide: ln,
|
|
1741
|
+
isColumnSortable: rn,
|
|
1742
|
+
_sortable: sn,
|
|
1743
|
+
...Ce
|
|
1744
|
+
} = k;
|
|
1745
|
+
return Array.isArray(Ce.sortable) && (Ce.sortable = !1), Ce;
|
|
1746
|
+
};
|
|
1747
|
+
return i({
|
|
1748
|
+
tableRef: d,
|
|
1749
|
+
clearSelection: () => {
|
|
1750
|
+
var k;
|
|
1751
|
+
return (k = d.value) == null ? void 0 : k.clearSelection();
|
|
1752
|
+
},
|
|
1753
|
+
toggleRowSelection: (k, _) => {
|
|
1754
|
+
var oe;
|
|
1755
|
+
return (oe = d.value) == null ? void 0 : oe.toggleRowSelection(k, _);
|
|
1756
|
+
},
|
|
1757
|
+
toggleAllSelection: () => {
|
|
1758
|
+
var k;
|
|
1759
|
+
return (k = d.value) == null ? void 0 : k.toggleAllSelection();
|
|
1760
|
+
},
|
|
1761
|
+
setCurrentRow: (k) => {
|
|
1762
|
+
var _;
|
|
1763
|
+
return (_ = d.value) == null ? void 0 : _.setCurrentRow(k);
|
|
1764
|
+
},
|
|
1765
|
+
clearSort: () => {
|
|
1766
|
+
var k;
|
|
1767
|
+
return (k = d.value) == null ? void 0 : k.clearSort();
|
|
1768
|
+
},
|
|
1769
|
+
clearFilter: (k) => {
|
|
1770
|
+
var _;
|
|
1771
|
+
return (_ = d.value) == null ? void 0 : _.clearFilter(k);
|
|
1772
|
+
},
|
|
1773
|
+
doLayout: () => {
|
|
1774
|
+
var k;
|
|
1775
|
+
return (k = d.value) == null ? void 0 : k.doLayout();
|
|
1776
|
+
},
|
|
1777
|
+
sort: (k, _) => {
|
|
1778
|
+
var oe;
|
|
1779
|
+
return (oe = d.value) == null ? void 0 : oe.sort(k, _);
|
|
1780
|
+
},
|
|
1781
|
+
// 新增暴露方法
|
|
1782
|
+
setSort: H,
|
|
1783
|
+
setSearchParams: U,
|
|
1784
|
+
closeAllExpandedRows: rt
|
|
1785
|
+
}), (k, _) => {
|
|
1786
|
+
const oe = St("loading");
|
|
1787
|
+
return g(), T("div", Xa, [
|
|
1788
|
+
t.value.hideViewSettingBtn ? ee("", !0) : (g(), T("div", Ya, [
|
|
1789
|
+
N(r(ye), { onClick: b }, {
|
|
1790
|
+
default: R(() => [
|
|
1791
|
+
N(r(We), null, {
|
|
1792
|
+
default: R(() => [
|
|
1793
|
+
N(r(Lt))
|
|
1794
|
+
]),
|
|
1795
|
+
_: 1
|
|
1796
|
+
}),
|
|
1797
|
+
_[14] || (_[14] = X(" 显示设置 ", -1))
|
|
1798
|
+
]),
|
|
1799
|
+
_: 1
|
|
1800
|
+
})
|
|
1801
|
+
])),
|
|
1802
|
+
N(ia, {
|
|
1803
|
+
ref_key: "bizViewSettingDialogRef",
|
|
1804
|
+
ref: c,
|
|
1805
|
+
props: t.value,
|
|
1806
|
+
"actual-columns": de.value,
|
|
1807
|
+
"showing-columns": h.value,
|
|
1808
|
+
"view-setting-drag-sort-options": x.value,
|
|
1809
|
+
"onUpdate:leftFixedColumnCount": _[0] || (_[0] = (W) => {
|
|
1810
|
+
w.value = W;
|
|
1811
|
+
}),
|
|
1812
|
+
"onUpdate:showingColumns": _[1] || (_[1] = (W) => {
|
|
1813
|
+
h.value = W;
|
|
1814
|
+
}),
|
|
1815
|
+
"onUpdate:viewSettingDragSortOptions": _[2] || (_[2] = (W) => {
|
|
1816
|
+
x.value = W;
|
|
1817
|
+
}),
|
|
1818
|
+
onTableDoLayout: P
|
|
1819
|
+
}, null, 8, ["props", "actual-columns", "showing-columns", "view-setting-drag-sort-options"]),
|
|
1820
|
+
Ct((g(), G(r(Et), ie({
|
|
1821
|
+
ref_key: "tableRef",
|
|
1822
|
+
ref: d,
|
|
1823
|
+
data: t.value.dataList,
|
|
1824
|
+
"row-style": r(ct),
|
|
1825
|
+
"row-class-name": pt,
|
|
1826
|
+
"cell-class-name": r(ft),
|
|
1827
|
+
"show-summary": r(F).length > 0,
|
|
1828
|
+
"summary-method": r(L)
|
|
1829
|
+
}, k.$attrs, {
|
|
1830
|
+
onSelectionChange: mt,
|
|
1831
|
+
onCellMouseEnter: r(vt),
|
|
1832
|
+
onHeaderDragend: P,
|
|
1833
|
+
onRowDblclick: _[11] || (_[11] = (W, ne, v) => a("row-dblclick", { row: W, column: ne, event: v }))
|
|
1834
|
+
}), {
|
|
1835
|
+
default: R(() => {
|
|
1836
|
+
var W, ne;
|
|
1837
|
+
return [
|
|
1838
|
+
t.value.rowDragAble ? (g(), G(r(fe), {
|
|
1839
|
+
key: 0,
|
|
1840
|
+
width: "30",
|
|
1841
|
+
"class-name": "editable-table__drag-cell",
|
|
1842
|
+
fixed: w.value > 0 ? "left" : !1
|
|
1843
|
+
}, {
|
|
1844
|
+
default: R((v) => [
|
|
1845
|
+
V("div", {
|
|
1846
|
+
class: "row-drag-target editable-table__drag-icon",
|
|
1847
|
+
"data-index": v.$index,
|
|
1848
|
+
onMousedown: (ce) => C.value = v
|
|
1849
|
+
}, [
|
|
1850
|
+
V("div", {
|
|
1851
|
+
"data-index": v.$index,
|
|
1852
|
+
class: "row-drag-target editable-table-drag-icon"
|
|
1853
|
+
}, null, 8, Ja)
|
|
1854
|
+
], 40, qa)
|
|
1855
|
+
]),
|
|
1856
|
+
_: 1
|
|
1857
|
+
}, 8, ["fixed"])) : ee("", !0),
|
|
1858
|
+
t.value.showExpand ? (g(), G(r(fe), {
|
|
1859
|
+
key: 1,
|
|
1860
|
+
type: "expand",
|
|
1861
|
+
fixed: w.value > 0 ? "left" : !1,
|
|
1862
|
+
"class-name": "no-inner-cell-border"
|
|
1863
|
+
}, {
|
|
1864
|
+
default: R((v) => [
|
|
1865
|
+
le(k.$slots, "expand", {
|
|
1866
|
+
row: v.row,
|
|
1867
|
+
$index: v.$index
|
|
1868
|
+
}, void 0, !0)
|
|
1869
|
+
]),
|
|
1870
|
+
_: 3
|
|
1871
|
+
}, 8, ["fixed"])) : ee("", !0),
|
|
1872
|
+
e.showIndex ? (g(), G(r(fe), {
|
|
1873
|
+
key: 2,
|
|
1874
|
+
type: "index",
|
|
1875
|
+
fixed: w.value > 0 ? "left" : !1,
|
|
1876
|
+
width: "60",
|
|
1877
|
+
align: "center"
|
|
1878
|
+
}, null, 8, ["fixed"])) : ee("", !0),
|
|
1879
|
+
t.value.colorList && t.value.colorList.length > 0 ? (g(), G(r(fe), {
|
|
1880
|
+
key: 3,
|
|
1881
|
+
width: "22px",
|
|
1882
|
+
"class-name": "editable-table__color-column no-inner-cell-border",
|
|
1883
|
+
fixed: w.value > 0 ? "left" : !1,
|
|
1884
|
+
"filtered-value": Array.isArray(r(s)[(W = e.colorFilterConfig) == null ? void 0 : W.prop]) ? r(s)[(ne = e.colorFilterConfig) == null ? void 0 : ne.prop] : []
|
|
1885
|
+
}, {
|
|
1886
|
+
header: R(() => [
|
|
1887
|
+
e.colorFilterConfig ? (g(), G(Ne, {
|
|
1888
|
+
key: 0,
|
|
1889
|
+
"head-active": r(K)(e.colorFilterConfig),
|
|
1890
|
+
column: e.colorFilterConfig,
|
|
1891
|
+
"temp-summary-list": r(I),
|
|
1892
|
+
"temp-sort-prop": r(j),
|
|
1893
|
+
"temp-sort-type": r($),
|
|
1894
|
+
"temp-filtered-value": r(y),
|
|
1895
|
+
"onUpdate:tempSummaryList": _[3] || (_[3] = (v) => I.value = v),
|
|
1896
|
+
"onUpdate:tempFilteredValue": _[4] || (_[4] = (v, ce) => r(y)[v] = ce),
|
|
1897
|
+
onPopoverShow: _[5] || (_[5] = () => r(p)(e.colorFilterConfig)),
|
|
1898
|
+
"onUpdate:sort": r(A),
|
|
1899
|
+
onReset: _[6] || (_[6] = () => r(S)(e.colorFilterConfig)),
|
|
1900
|
+
onConfirm: _[7] || (_[7] = () => r(D)(e.colorFilterConfig))
|
|
1901
|
+
}, {
|
|
1902
|
+
custom: R(() => [..._[15] || (_[15] = [
|
|
1903
|
+
V("div", { class: "editable-table__color-icon" }, null, -1)
|
|
1904
|
+
])]),
|
|
1905
|
+
_: 1
|
|
1906
|
+
}, 8, ["head-active", "column", "temp-summary-list", "temp-sort-prop", "temp-sort-type", "temp-filtered-value", "onUpdate:sort"])) : (g(), T("div", Qa))
|
|
1907
|
+
]),
|
|
1908
|
+
default: R((v) => [
|
|
1909
|
+
N(ca, {
|
|
1910
|
+
"color-list": t.value.colorList,
|
|
1911
|
+
scope: v,
|
|
1912
|
+
onRowBgChange: _[8] || (_[8] = (ce) => a("row-bg-change", ce))
|
|
1913
|
+
}, null, 8, ["color-list", "scope"])
|
|
1914
|
+
]),
|
|
1915
|
+
_: 1
|
|
1916
|
+
}, 8, ["fixed", "filtered-value"])) : ee("", !0),
|
|
1917
|
+
e.showSelection ? (g(), G(r(fe), {
|
|
1918
|
+
key: 4,
|
|
1919
|
+
type: "selection",
|
|
1920
|
+
width: "45",
|
|
1921
|
+
align: "center"
|
|
1922
|
+
})) : ee("", !0),
|
|
1923
|
+
(g(!0), T(q, null, re(de.value, (v, ce) => (g(), G(r(fe), ie({
|
|
1924
|
+
key: v.prop + ce,
|
|
1925
|
+
resizable: "",
|
|
1926
|
+
"class-name": "editable-table__data-column",
|
|
1927
|
+
"filtered-value": Array.isArray(r(s)[v.prop]) ? r(s)[v.prop] : []
|
|
1928
|
+
}, { ref_for: !0 }, bt(v)), Fe({
|
|
1929
|
+
default: R((B) => [
|
|
1930
|
+
v.prop === "$$operation" ? (g(), T(q, { key: 0 }, [
|
|
1931
|
+
r(ge) !== B.$index ? (g(), G(Ka, {
|
|
1932
|
+
key: 0,
|
|
1933
|
+
ref_for: !0,
|
|
1934
|
+
ref_key: "operationPopoverRef",
|
|
1935
|
+
ref: nt,
|
|
1936
|
+
"default-operations": t.value.defaultOperations,
|
|
1937
|
+
scope: B,
|
|
1938
|
+
onEdit: () => r(it)(B),
|
|
1939
|
+
onDelete: () => r(lt)(B.row, B.$index),
|
|
1940
|
+
onRowPinToTop: () => r(ut)(B)
|
|
1941
|
+
}, {
|
|
1942
|
+
default: R(() => [
|
|
1943
|
+
le(k.$slots, "custom-operation", ie({ ref_for: !0 }, B), void 0, !0)
|
|
1944
|
+
]),
|
|
1945
|
+
_: 2
|
|
1946
|
+
}, 1032, ["default-operations", "scope", "onEdit", "onDelete", "onRowPinToTop"])) : (g(), T("div", Za, [
|
|
1947
|
+
N(r(ye), {
|
|
1948
|
+
type: "primary",
|
|
1949
|
+
size: "small",
|
|
1950
|
+
onClick: (J) => r(st)(B.row)
|
|
1951
|
+
}, {
|
|
1952
|
+
default: R(() => [..._[16] || (_[16] = [
|
|
1953
|
+
X(" 保存 ", -1)
|
|
1954
|
+
])]),
|
|
1955
|
+
_: 1
|
|
1956
|
+
}, 8, ["onClick"]),
|
|
1957
|
+
N(r(ye), {
|
|
1958
|
+
size: "small",
|
|
1959
|
+
onClick: (J) => r(dt)(B.row)
|
|
1960
|
+
}, {
|
|
1961
|
+
default: R(() => [..._[17] || (_[17] = [
|
|
1962
|
+
X(" 取消 ", -1)
|
|
1963
|
+
])]),
|
|
1964
|
+
_: 1
|
|
1965
|
+
}, 8, ["onClick"])
|
|
1966
|
+
]))
|
|
1967
|
+
], 64)) : r(ge) !== -1 ? (g(), T(q, { key: 1 }, [
|
|
1968
|
+
r(ge) === B.$index && v.editType ? (g(), T(q, { key: 0 }, [
|
|
1969
|
+
v.editType === "input" ? (g(), G(r(Ue), {
|
|
1970
|
+
key: 0,
|
|
1971
|
+
modelValue: r(ue)[v.prop],
|
|
1972
|
+
"onUpdate:modelValue": (J) => r(ue)[v.prop] = J
|
|
1973
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : v.editType === "select" ? (g(), G(r(Pt), {
|
|
1974
|
+
key: 1,
|
|
1975
|
+
modelValue: r(ue)[v.prop],
|
|
1976
|
+
"onUpdate:modelValue": (J) => r(ue)[v.prop] = J
|
|
1977
|
+
}, {
|
|
1978
|
+
default: R(() => [
|
|
1979
|
+
(g(!0), T(q, null, re(v.editOptions, (J) => (g(), G(r(Dt), {
|
|
1980
|
+
key: J.value,
|
|
1981
|
+
label: J.label,
|
|
1982
|
+
value: J.value
|
|
1983
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
1984
|
+
]),
|
|
1985
|
+
_: 2
|
|
1986
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : v.editType === "date" ? (g(), G(r(Vt), {
|
|
1987
|
+
key: 2,
|
|
1988
|
+
modelValue: r(ue)[v.prop],
|
|
1989
|
+
"onUpdate:modelValue": (J) => r(ue)[v.prop] = J,
|
|
1990
|
+
type: "date"
|
|
1991
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : ee("", !0)
|
|
1992
|
+
], 64)) : v.editSlotName && B.$index === r(ge) ? le(k.$slots, v.editSlotName, {
|
|
1993
|
+
key: 1,
|
|
1994
|
+
row: r(ue),
|
|
1995
|
+
column: v,
|
|
1996
|
+
$index: B.$index
|
|
1997
|
+
}, void 0, !0) : (g(), T(q, { key: 2 }, [
|
|
1998
|
+
X(Y(v.formatter ? v.formatter(
|
|
1999
|
+
B.row,
|
|
2000
|
+
v,
|
|
2001
|
+
B.row[v.prop],
|
|
2002
|
+
B.$index
|
|
2003
|
+
) : B.row[v.prop]), 1)
|
|
2004
|
+
], 64))
|
|
2005
|
+
], 64)) : v.hoverSlotName ? (g(), T(q, { key: 2 }, [
|
|
2006
|
+
B.$index === r(De).rowIndex && v.prop === r(De).columnProperty ? le(k.$slots, v.hoverSlotName, ie({
|
|
2007
|
+
key: 0,
|
|
2008
|
+
ref_for: !0
|
|
2009
|
+
}, B), void 0, !0) : v.slotName ? le(k.$slots, v.slotName, ie({
|
|
2010
|
+
key: 1,
|
|
2011
|
+
ref_for: !0
|
|
2012
|
+
}, B), void 0, !0) : (g(), T(q, { key: 2 }, [
|
|
2013
|
+
X(Y(v.formatter ? v.formatter(
|
|
2014
|
+
B.row,
|
|
2015
|
+
v,
|
|
2016
|
+
B.row[v.prop],
|
|
2017
|
+
B.$index
|
|
2018
|
+
) : B.row[v.prop]), 1)
|
|
2019
|
+
], 64))
|
|
2020
|
+
], 64)) : (g(), T(q, { key: 3 }, [
|
|
2021
|
+
v.slotName ? le(k.$slots, v.slotName, ie({
|
|
2022
|
+
key: 0,
|
|
2023
|
+
ref_for: !0
|
|
2024
|
+
}, B), void 0, !0) : (g(), T(q, { key: 1 }, [
|
|
2025
|
+
X(Y(r(at)(B.row, v, B.$index)), 1)
|
|
2026
|
+
], 64))
|
|
2027
|
+
], 64))
|
|
2028
|
+
]),
|
|
2029
|
+
_: 2
|
|
2030
|
+
}, [
|
|
2031
|
+
r(u)(v) ? {
|
|
2032
|
+
name: "header",
|
|
2033
|
+
fn: R(() => [
|
|
2034
|
+
N(Ne, {
|
|
2035
|
+
"head-active": r(K)(v),
|
|
2036
|
+
column: v,
|
|
2037
|
+
"temp-summary-list": r(I),
|
|
2038
|
+
"temp-sort-prop": r(j),
|
|
2039
|
+
"temp-sort-type": r($),
|
|
2040
|
+
"temp-filtered-value": r(y),
|
|
2041
|
+
"onUpdate:tempSummaryList": _[9] || (_[9] = (B) => I.value = B),
|
|
2042
|
+
"onUpdate:tempFilteredValue": _[10] || (_[10] = (B, J) => r(y)[B] = J),
|
|
2043
|
+
onPopoverShow: () => r(p)(v),
|
|
2044
|
+
"onUpdate:sort": r(A),
|
|
2045
|
+
onReset: () => r(S)(v),
|
|
2046
|
+
onConfirm: () => r(D)(v)
|
|
2047
|
+
}, Fe({
|
|
2048
|
+
"summay-item": R(() => [
|
|
2049
|
+
le(k.$slots, v.prop + "-summay-item", ie({ ref_for: !0 }, v), () => [
|
|
2050
|
+
X(Y(v.label), 1)
|
|
2051
|
+
], !0)
|
|
2052
|
+
]),
|
|
2053
|
+
_: 2
|
|
2054
|
+
}, [
|
|
2055
|
+
re(r(n), (B, J) => ({
|
|
2056
|
+
name: J,
|
|
2057
|
+
fn: R((Ve) => [
|
|
2058
|
+
le(k.$slots, J, ie({ ref_for: !0 }, Ve || v), void 0, !0)
|
|
2059
|
+
])
|
|
2060
|
+
}))
|
|
2061
|
+
]), 1032, ["head-active", "column", "temp-summary-list", "temp-sort-prop", "temp-sort-type", "temp-filtered-value", "onPopoverShow", "onUpdate:sort", "onReset", "onConfirm"])
|
|
2062
|
+
]),
|
|
2063
|
+
key: "0"
|
|
2064
|
+
} : void 0
|
|
2065
|
+
]), 1040, ["filtered-value"]))), 128))
|
|
2066
|
+
];
|
|
2067
|
+
}),
|
|
2068
|
+
_: 3
|
|
2069
|
+
}, 16, ["data", "row-style", "cell-class-name", "show-summary", "summary-method", "onCellMouseEnter"])), [
|
|
2070
|
+
[oe, e.loading]
|
|
2071
|
+
]),
|
|
2072
|
+
e.total ? (g(), T("div", en, [
|
|
2073
|
+
N(r(Ft), {
|
|
2074
|
+
"current-page": r(z),
|
|
2075
|
+
"onUpdate:currentPage": _[12] || (_[12] = (W) => Se(z) ? z.value = W : null),
|
|
2076
|
+
"page-size": r(O),
|
|
2077
|
+
"onUpdate:pageSize": _[13] || (_[13] = (W) => Se(O) ? O.value = W : null),
|
|
2078
|
+
total: e.total,
|
|
2079
|
+
"page-sizes": e.pageSizes,
|
|
2080
|
+
layout: k.paginationLayout,
|
|
2081
|
+
onCurrentChange: r(f),
|
|
2082
|
+
onSizeChange: r(m)
|
|
2083
|
+
}, null, 8, ["current-page", "page-size", "total", "page-sizes", "layout", "onCurrentChange", "onSizeChange"])
|
|
2084
|
+
])) : ee("", !0)
|
|
2085
|
+
]);
|
|
2086
|
+
};
|
|
2087
|
+
}
|
|
2088
|
+
}), tt = /* @__PURE__ */ et(tn, [["__scopeId", "data-v-51e47642"]]), on = (e) => {
|
|
2089
|
+
e.component("EditableTable", tt);
|
|
2090
|
+
};
|
|
2091
|
+
tt.install = on;
|
|
2092
|
+
export {
|
|
2093
|
+
tt as EditableTable,
|
|
2094
|
+
tt as default,
|
|
2095
|
+
on as install
|
|
2096
|
+
};
|
|
2097
|
+
//# sourceMappingURL=index.mjs.map
|