holyes-table 1.0.23 → 1.0.25
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 +2 -1
- package/dist/index.mjs +363 -348
- package/dist/lib/pretextTable/hook/useCheckbox.d.ts +1 -0
- package/dist/lib/pretextTable/pretextTable.vue.d.ts +1 -0
- package/dist/lib/pretextTable/type.d.ts +14 -1
- package/dist/lib/pretextTable/useHolyesTable.d.ts +7 -0
- package/package.json +1 -1
- package/skills/holyes-table/SKILL.md +8 -1
- package//346/233/264/346/226/260/346/227/245/345/277/227.md +8 -0
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Fragment as e, Teleport as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, normalizeStyle as u, onActivated as d, onDeactivated as f, onMounted as p, onUnmounted as m, openBlock as h, ref as g, renderList as _, renderSlot as v, shallowRef as y, toDisplayString as b, toRaw as x, unref as S, vShow as C, watch as w, withCtx as T, withDirectives as E, withKeys as ee, withModifiers as D } from "vue";
|
|
2
|
-
import { VxeButton as O, VxeCheckbox as k, VxeCheckboxGroup as te, VxeIcon as A, VxeInput as
|
|
3
|
-
import
|
|
2
|
+
import { VxeButton as O, VxeCheckbox as k, VxeCheckboxGroup as te, VxeIcon as A, VxeInput as j, VxeLoading as ne, VxeNumberInput as re, VxeRadioGroup as M, VxeSwitch as ie, VxeTag as ae } from "vxe-pc-ui";
|
|
3
|
+
import N, { debounce as oe, isNaN as P, orderBy as se, toArrayTree as ce } from "xe-utils";
|
|
4
4
|
//#region lib/pretextTable/worker/pretextTableGetItemHeight.ts?worker&inline
|
|
5
|
-
var
|
|
5
|
+
var le = "(function(){let e=e=>{let t=0;switch(!0){case!e:case typeof e!=`string`:return t;default:break}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r==64||r>=19968&&r<=40959||r>=12352&&r<=12543||r>=44032&&r<=55215?t+=2:t+=1}return t};self.onmessage=t=>{let{tempData:n,commonStyles:r,itemStyles:i,divLineHeight:a,cellMinHeight:o,keyNames:s,isNoAutoWrap:c,columns:l,treeConfig:u,defaultTreeConfig:d}=t.data,f=0;performance.mark(`start`);let p=new OffscreenCanvas(1,1).getContext(`2d`);p.font=`${i.fontWeight} ${i.fontSize}/${a} ${r?.fontFamily}`;function m(e){return p.measureText(e).width}function h(e,t,n){let r=m(e),o=i.paddingLeft.replace(`px`,``);return o=Number(o||0),Math.ceil((r+o)/t)*a+n}let g=[],_=new Map,v=e=>{e.slots?.default&&!e.slots?.defaultHeight&&(_.has(e.field)||(console.error(`表格设置了插槽,插槽高度defaultHeight不能为空,否则会导致高度计算错误`,e.field),_.set(e.field,1))),(e.slots.defaultType==`tag`||e.slots.defaultType==`buttons`)&&(e.slots.defaultHeight||(e.slots.defaultHeight=30))},y=u?.childrenField||d.childrenField,b=(t,n)=>{t[y]?.length&&t[y].forEach(e=>{b(e,n+1)});let r=o,i=[],p=0;if(c)for(let e of l)v(e),p=Math.max(p,e.slots?.defaultHeight||0),r=Math.max(r,a);else{for(let r of l){(r.slots?.default||r.slots?.defaultType)&&(v(r),p=Math.max(p,r.slots?.defaultHeight||0));let a=Math.max(r.minWidth||30,r.width||0),o=t[r.field]||``;r.treeNode&&u?.isOpenTree&&(u?.showIcon&&(o+=`图`),u?.indent&&(a-=(u?.indent||d.indent||20)*n));let s=e(o)/a;testLength:for(let e=0;e<3;e++)if((i[e]?.density||0)<s){i[e]={field:r.field,tempWidth:a,density:s,tempText:o};break testLength}}for(let e of i){let t=e.tempWidth,n=h(e.tempText,t,0);r=Math.max(r,n)}}g.push({pretextHeight:Math.max(r,p)+1,id:t[s.id]}),n==0&&(f+=Math.max(r,p)+1)};for(let e of n)b(e,0);performance.mark(`end`),self.postMessage({tempItemHeights:f,heightDatas:g}),self.close()}})();", ue = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", le], { type: "text/javascript;charset=utf-8" });
|
|
6
6
|
function de(e) {
|
|
7
7
|
let t;
|
|
8
8
|
try {
|
|
9
|
-
if (t =
|
|
9
|
+
if (t = ue && (self.URL || self.webkitURL).createObjectURL(ue), !t) throw "";
|
|
10
10
|
let n = new Worker(t, { name: e?.name });
|
|
11
11
|
return n.addEventListener("error", () => {
|
|
12
12
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
13
13
|
}), n;
|
|
14
14
|
} catch {
|
|
15
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
15
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(le), { name: e?.name });
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
@@ -124,74 +124,74 @@ var pe = (e) => {
|
|
|
124
124
|
//#endregion
|
|
125
125
|
//#region lib/pretextTable/hook/useCheckbox.ts
|
|
126
126
|
function me(e) {
|
|
127
|
-
let { columns: t, blurAnyElement: n, nowDataSource: r, baseDataSource: i,
|
|
128
|
-
|
|
129
|
-
for (let e of t.value) e.type == "checkbox" &&
|
|
130
|
-
return
|
|
131
|
-
},
|
|
127
|
+
let { columns: t, blurAnyElement: n, nowDataSource: r, baseDataSource: i, baseDataMap: a, emits: o, treeConfig: s } = e, c = s?.isOpenTree ?? I.isOpenTree, l = F.filterChildren, u = s?.childrenField ?? I.childrenField, d = s?.checkStrictly ?? I.checkStrictly, f = [], p = () => {
|
|
128
|
+
f = [];
|
|
129
|
+
for (let e of t.value) e.type == "checkbox" && f.push(e.field);
|
|
130
|
+
return f;
|
|
131
|
+
}, m = g({}), h = g({}), _ = (e) => {
|
|
132
132
|
switch (n(), !0) {
|
|
133
|
-
case
|
|
134
|
-
case !
|
|
135
|
-
|
|
133
|
+
case h.value[e] == 1:
|
|
134
|
+
case !m.value[e]:
|
|
135
|
+
m.value[e] = !0, h.value[e] = !1, d ? b(r.value, !0, e) : x(r.value, !0, e);
|
|
136
136
|
break;
|
|
137
137
|
default:
|
|
138
|
-
|
|
138
|
+
m.value[e] = !1, h.value[e] = !1, d ? b(r.value, !1, e) : x(r.value, !1, e);
|
|
139
139
|
break;
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
},
|
|
141
|
+
o("checkboxAll");
|
|
142
|
+
}, v = (e) => {
|
|
143
143
|
let t = {}, n = [];
|
|
144
|
-
if (e ? n.push(e) : n =
|
|
144
|
+
if (e ? n.push(e) : n = p(), d) {
|
|
145
145
|
for (let e of r.value) for (let r of n) e[F.checkedIndeterminate + r] && (t[r + "indeterminateCount"] = (t[r + "indeterminateCount"] || 0) + 1), e[r] && (t[r + "checkedCount"] = (t[r + "checkedCount"] || 0) + 1);
|
|
146
146
|
for (let e of n) {
|
|
147
147
|
let n = t[e + "checkedCount"] || 0, i = t[e + "indeterminateCount"] || 0;
|
|
148
148
|
switch (!0) {
|
|
149
149
|
case n == 0 && i == 0:
|
|
150
|
-
|
|
150
|
+
h.value[e] = !1, m.value[e] = !1;
|
|
151
151
|
break;
|
|
152
152
|
case n == r.value.length && i == 0:
|
|
153
|
-
|
|
153
|
+
h.value[e] = !1, m.value[e] = !0;
|
|
154
154
|
break;
|
|
155
155
|
default:
|
|
156
|
-
|
|
156
|
+
h.value[e] = !0, m.value[e] = !1;
|
|
157
157
|
break;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
} else {
|
|
161
161
|
let e = (n, r) => {
|
|
162
|
-
if (t[r + "allCount"] = (t[r + "allCount"] || 0) + 1, n[r] && (t[r + "checkedCount"] = (t[r + "checkedCount"] || 0) + 1), n?.[
|
|
163
|
-
else if (n?.[
|
|
162
|
+
if (t[r + "allCount"] = (t[r + "allCount"] || 0) + 1, n[r] && (t[r + "checkedCount"] = (t[r + "checkedCount"] || 0) + 1), n?.[l]?.length) for (let t of n[l]) e(t, r);
|
|
163
|
+
else if (n?.[u]?.length) for (let t of n[u]) e(t, r);
|
|
164
164
|
};
|
|
165
165
|
for (let t of r.value) for (let r of n) e(t, r);
|
|
166
166
|
for (let e of n) {
|
|
167
167
|
let n = t[e + "checkedCount"] || 0, r = t[e + "allCount"] || 0;
|
|
168
168
|
switch (!0) {
|
|
169
169
|
case n == 0:
|
|
170
|
-
|
|
170
|
+
h.value[e] = !1, m.value[e] = !1;
|
|
171
171
|
break;
|
|
172
172
|
case n == r:
|
|
173
|
-
|
|
173
|
+
h.value[e] = !1, m.value[e] = !0;
|
|
174
174
|
break;
|
|
175
175
|
default:
|
|
176
|
-
|
|
176
|
+
h.value[e] = !0, m.value[e] = !1;
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
},
|
|
182
|
-
if (!
|
|
183
|
-
let n = t ??
|
|
181
|
+
}, y = (e, t) => {
|
|
182
|
+
if (!c || !d) return;
|
|
183
|
+
let n = t ?? f[0];
|
|
184
184
|
if (!e) return;
|
|
185
|
-
let r = e?.[F.parentRow], i = [];
|
|
186
|
-
e?.[
|
|
187
|
-
let
|
|
185
|
+
let r = a.get(e?.[F.parentRow]) || null, i = [];
|
|
186
|
+
e?.[l]?.length ? i = e[l] : e?.[u]?.length && (i = e[u]);
|
|
187
|
+
let o = 0, s = 0;
|
|
188
188
|
if (i.length) {
|
|
189
|
-
for (let e of i) e[n] &&
|
|
189
|
+
for (let e of i) e[n] && o++, e[F.checkedIndeterminate + n] && s++;
|
|
190
190
|
switch (!0) {
|
|
191
|
-
case
|
|
191
|
+
case o == 0 && s == 0:
|
|
192
192
|
e[n] = !1, e[F.checkedIndeterminate + n] = !1;
|
|
193
193
|
break;
|
|
194
|
-
case
|
|
194
|
+
case o == i.length && s == 0:
|
|
195
195
|
e[n] = !0, e[F.checkedIndeterminate + n] = !1;
|
|
196
196
|
break;
|
|
197
197
|
default:
|
|
@@ -199,65 +199,65 @@ function me(e) {
|
|
|
199
199
|
break;
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
|
|
203
|
-
}, y = (e, t, n) => {
|
|
204
|
-
let r = n ?? d[0];
|
|
205
|
-
for (let n of e) n[r] = t, n[F.checkedIndeterminate + r] = !1, s && u && (n[c]?.length ? y(n[c], t, r) : n[l]?.length && y(n[l], t, r));
|
|
202
|
+
y(r, n);
|
|
206
203
|
}, b = (e, t, n) => {
|
|
207
|
-
let r = n ??
|
|
208
|
-
for (let n of e) n[r] = t, n[F.checkedIndeterminate + r] = !1,
|
|
204
|
+
let r = n ?? f[0];
|
|
205
|
+
for (let n of e) n[r] = t, n[F.checkedIndeterminate + r] = !1, c && d && (n[l]?.length ? b(n[l], t, r) : n[u]?.length && b(n[u], t, r));
|
|
206
|
+
}, x = (e, t, n) => {
|
|
207
|
+
let r = n ?? f[0];
|
|
208
|
+
for (let n of e) n[r] = t, n[F.checkedIndeterminate + r] = !1, c && (n[l]?.length ? x(n[l], t, r) : n[u]?.length && x(n[u], t, r));
|
|
209
209
|
};
|
|
210
210
|
return {
|
|
211
|
-
getCheckField:
|
|
212
|
-
headerChecked:
|
|
213
|
-
headerCheckedIndeterminate:
|
|
214
|
-
onHeaderChecked:
|
|
215
|
-
upDataHeaderChecked:
|
|
211
|
+
getCheckField: p,
|
|
212
|
+
headerChecked: m,
|
|
213
|
+
headerCheckedIndeterminate: h,
|
|
214
|
+
onHeaderChecked: _,
|
|
215
|
+
upDataHeaderChecked: v,
|
|
216
216
|
upDataAllRowCheckedDeep: () => {
|
|
217
|
-
if (
|
|
217
|
+
if (d) {
|
|
218
218
|
let e = /* @__PURE__ */ new Map(), t = (n) => {
|
|
219
219
|
let r = [];
|
|
220
|
-
if (n?.[
|
|
220
|
+
if (n?.[l]?.length ? r = n[l] : n?.[u]?.length && (r = n[u]), r.length) for (let e of r) t(e);
|
|
221
221
|
else {
|
|
222
|
-
let t = n?.[F.parentRow];
|
|
222
|
+
let t = a.get(n?.[F.parentRow]) || null;
|
|
223
223
|
t && e.set(t[F.id], t);
|
|
224
224
|
}
|
|
225
225
|
}, n = r.value;
|
|
226
226
|
for (let e of n) t(e);
|
|
227
227
|
e.forEach((e) => {
|
|
228
|
-
for (let t of
|
|
228
|
+
for (let t of f) y(e, t);
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
|
-
|
|
231
|
+
v(void 0);
|
|
232
232
|
},
|
|
233
233
|
onCellChecked: (t, n) => {
|
|
234
234
|
e.blurAnyElement();
|
|
235
|
-
let r = n ??
|
|
236
|
-
t[r] ?
|
|
235
|
+
let r = n ?? f[0];
|
|
236
|
+
t[r] ? b([t], !1, r) : b([t], !0, r), y(t, r), v(r), o("checkboxChange", {
|
|
237
237
|
row: t,
|
|
238
238
|
checked: t[r],
|
|
239
239
|
field: r
|
|
240
240
|
});
|
|
241
241
|
},
|
|
242
242
|
getCheckboxRecords: (e, t) => {
|
|
243
|
-
let n = t ??
|
|
244
|
-
if (a = e ? i.value : r.value, !
|
|
245
|
-
let o = [],
|
|
243
|
+
let n = t ?? f[0], a = [];
|
|
244
|
+
if (a = e ? i.value : r.value, !c) return a.filter((e) => e[n]);
|
|
245
|
+
let o = [], s = (t) => {
|
|
246
246
|
if (t[n] && o.push(t), e) {
|
|
247
|
-
if (t[
|
|
248
|
-
} else if (t[
|
|
247
|
+
if (t[u]?.length) for (let e of t[u]) s(e);
|
|
248
|
+
} else if (t[l]?.length) for (let e of t[l]) s(e);
|
|
249
249
|
};
|
|
250
|
-
for (let e of a)
|
|
250
|
+
for (let e of a) s(e);
|
|
251
251
|
return o;
|
|
252
252
|
},
|
|
253
253
|
clearCheckboxRowInit: () => {
|
|
254
|
-
|
|
254
|
+
m.value = {}, h.value = {};
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
258
|
//#endregion
|
|
259
259
|
//#region lib/pretextTable/hook/useSort.ts
|
|
260
|
-
function
|
|
260
|
+
function he(e) {
|
|
261
261
|
let { nowDataSource: t, getVisibleData: n, setNowDataSource: r, treeConfig: i, defaultTreeConfig: a, columns: o } = e, s = g(""), c = "", l = g(null), u = (e, t) => {
|
|
262
262
|
let n = o?.value || [];
|
|
263
263
|
c = "";
|
|
@@ -283,7 +283,7 @@ function L(e) {
|
|
|
283
283
|
else t === l.value && e === s.value ? (l.value = null, s.value = "", c = "") : (l.value = t, s.value = e);
|
|
284
284
|
f();
|
|
285
285
|
}, d = (e, t, n) => {
|
|
286
|
-
let r =
|
|
286
|
+
let r = se(e, [[(e) => P(Number(e[t])) ? e[t] || "" : Number(e[t]), n]]);
|
|
287
287
|
if (i?.isOpenTree) {
|
|
288
288
|
let e = i?.childrenField || a?.childrenField;
|
|
289
289
|
for (let i of r) {
|
|
@@ -304,7 +304,7 @@ function L(e) {
|
|
|
304
304
|
}
|
|
305
305
|
//#endregion
|
|
306
306
|
//#region lib/pretextTable/hook/useFilter.ts
|
|
307
|
-
function
|
|
307
|
+
function ge(e) {
|
|
308
308
|
let { columns: t, baseDataSource: n, setNowDataSource: r, scrollTo: i, refresh: a, afterFilter: o, treeConfig: s, defaultTreeConfig: c } = e, l = [{
|
|
309
309
|
label: "模糊搜索",
|
|
310
310
|
value: "模糊"
|
|
@@ -501,7 +501,7 @@ function he(e) {
|
|
|
501
501
|
}
|
|
502
502
|
//#endregion
|
|
503
503
|
//#region lib/pretextTable/hook/useHeaderResize.ts
|
|
504
|
-
var
|
|
504
|
+
var _e = (e) => {
|
|
505
505
|
let { pretextTableRef: t, afterResize: n } = e, r = g(!1), i = 0, a = g(0), o = 0, s = 0, c = null, l = (e, n) => {
|
|
506
506
|
e.preventDefault(), e.stopPropagation(), e.target && (c = n, o = t.value?.getBoundingClientRect().left || 0, r.value = !0, i = e.clientX - o - 0, a.value = i, s = e.clientX - o - 0 - (n.width || n.minWidth || 0) + (n.minWidth || 100), document.body.classList.add("pretextTable-resize-dragging"), document.addEventListener("mousemove", d), document.addEventListener("mouseup", f));
|
|
507
507
|
}, u = null, d = (e) => {
|
|
@@ -523,7 +523,7 @@ var ge = (e) => {
|
|
|
523
523
|
dragLineLeft: a,
|
|
524
524
|
startResize: l
|
|
525
525
|
};
|
|
526
|
-
},
|
|
526
|
+
}, ve = (e) => {
|
|
527
527
|
let { showFooter: t, nowDataSource: n, columns: r } = e, i = g(0), a = g([]), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = (e) => {
|
|
528
528
|
if (s.clear(), !t) {
|
|
529
529
|
i.value = 0;
|
|
@@ -580,15 +580,15 @@ var ge = (e) => {
|
|
|
580
580
|
case i?.type === "合计":
|
|
581
581
|
let n = t[e], r = 0;
|
|
582
582
|
if (o.get(e) || []) {
|
|
583
|
-
switch (r = Number(i.data) +
|
|
583
|
+
switch (r = Number(i.data) + N.toNumber(n), i?.dataType) {
|
|
584
584
|
case "number0":
|
|
585
|
-
r =
|
|
585
|
+
r = N.toFixed(r, 0);
|
|
586
586
|
break;
|
|
587
587
|
case "number1":
|
|
588
|
-
r =
|
|
588
|
+
r = N.toFixed(r, 1);
|
|
589
589
|
break;
|
|
590
590
|
case "number2":
|
|
591
|
-
r =
|
|
591
|
+
r = N.toFixed(r, 2);
|
|
592
592
|
break;
|
|
593
593
|
default: break;
|
|
594
594
|
}
|
|
@@ -622,7 +622,7 @@ var ge = (e) => {
|
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
624
|
};
|
|
625
|
-
},
|
|
625
|
+
}, ye = (e) => {
|
|
626
626
|
let { treeConfig: t, afterTreeExpand: n, insertChild: r } = e, i = t?.idField || I.idField, a = t?.parentField || I.parentField, o = t?.childrenField || I.childrenField, s = /* @__PURE__ */ new Map(), c = (e, n = !1) => {
|
|
627
627
|
let r = t?.childrenField || I.childrenField, i = t?.idField || F.id || "";
|
|
628
628
|
for (let t of e) s.get(t[i]) && (t[F.isCollapsed] = !0), n && t[r]?.length && c(t[r], !0);
|
|
@@ -635,14 +635,14 @@ var ge = (e) => {
|
|
|
635
635
|
let n = e;
|
|
636
636
|
if (t?.transform) t?.reserve && c(n, !1);
|
|
637
637
|
else return t?.reserve && c(n, !0), n;
|
|
638
|
-
n =
|
|
638
|
+
n = ce(n, {
|
|
639
639
|
key: i,
|
|
640
640
|
parentKey: a,
|
|
641
641
|
children: o
|
|
642
642
|
});
|
|
643
643
|
let r = (e) => {
|
|
644
644
|
let t = e?.[o] || [];
|
|
645
|
-
for (let n of t) n[F.parentRow] = e, r(n);
|
|
645
|
+
for (let n of t) n[F.parentRow] = e[F.id], r(n);
|
|
646
646
|
};
|
|
647
647
|
for (let e of n) r(e);
|
|
648
648
|
return n;
|
|
@@ -665,10 +665,10 @@ var ge = (e) => {
|
|
|
665
665
|
n(e, i);
|
|
666
666
|
}
|
|
667
667
|
};
|
|
668
|
-
},
|
|
668
|
+
}, L = () => {
|
|
669
669
|
let e = document.activeElement;
|
|
670
670
|
e?.blur && e.blur();
|
|
671
|
-
},
|
|
671
|
+
}, be = (e) => {
|
|
672
672
|
let { expandConfig: t, afterRowExpand: n, insertExpandRow: r } = e, i = {
|
|
673
673
|
transform: !0,
|
|
674
674
|
parentField: "parentId",
|
|
@@ -695,7 +695,7 @@ var ge = (e) => {
|
|
|
695
695
|
n(e, t);
|
|
696
696
|
}
|
|
697
697
|
};
|
|
698
|
-
},
|
|
698
|
+
}, R = (e) => {
|
|
699
699
|
let t = y([]), n = y([]), r = g(), i = g(), a = g(0), o = g(0), s = g(!1);
|
|
700
700
|
w(() => e.props.loading, (e) => {
|
|
701
701
|
s.value = e;
|
|
@@ -706,27 +706,27 @@ var ge = (e) => {
|
|
|
706
706
|
}, 0);
|
|
707
707
|
}, u = (e) => {
|
|
708
708
|
i.value?.scrollTo(e);
|
|
709
|
-
}, m =
|
|
710
|
-
|
|
709
|
+
}, m = /* @__PURE__ */ new Map(), h = y([]), _ = y([]), v = [], b = /* @__PURE__ */ new Map(), S = (t) => {
|
|
710
|
+
b.clear(), _.value = t, v = [], ne();
|
|
711
711
|
let n = 1, r = !1, i = 0, a = e.props.treeConfig?.childrenField || J.childrenField, o = (t, n, r) => {
|
|
712
|
-
if (
|
|
712
|
+
if (v.push(t), t[F.level] = r, e.props.treeConfig?.isOpenTree) {
|
|
713
713
|
let e = t?.[a] || [];
|
|
714
714
|
if (t?.[F.filterChildren]?.length > 0 && (e = t[F.filterChildren]), e.length > 0 && t[F.isCollapsed]) {
|
|
715
715
|
let t = 1;
|
|
716
716
|
for (let i of e) i[F.stripe] = !1, i[F.seq] = n + "." + t, t++, o(i, i[F.seq], r + 1);
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
|
-
if (e.props.expandConfig?.isExpand && t[F.expandChildren]?.length > 0 && t[F.isRowExpanded]) for (let e of t[F.expandChildren])
|
|
719
|
+
if (e.props.expandConfig?.isExpand && t[F.expandChildren]?.length > 0 && t[F.isRowExpanded]) for (let e of t[F.expandChildren]) v.push(e);
|
|
720
720
|
};
|
|
721
|
-
for (let e of
|
|
721
|
+
for (let e of _.value) e[F.seq] = n, o(e, `${n}`, 1), n++, e[F.stripe] = r, r = !r;
|
|
722
722
|
let s = 1;
|
|
723
|
-
for (let e of
|
|
723
|
+
for (let e of v) i += e[F.height] || 0, b.set(s, {
|
|
724
724
|
totalHeight: i,
|
|
725
725
|
row: e
|
|
726
726
|
}), s++;
|
|
727
|
-
},
|
|
727
|
+
}, C = async (n, r) => {
|
|
728
728
|
let i = null;
|
|
729
|
-
i = typeof r == "string" ?
|
|
729
|
+
i = typeof r == "string" ? m.get(r) : r, Z(n);
|
|
730
730
|
let a = [];
|
|
731
731
|
for (let e of t.value) {
|
|
732
732
|
let t = x(e);
|
|
@@ -744,41 +744,41 @@ var ge = (e) => {
|
|
|
744
744
|
treeNode: t.treeNode || !1
|
|
745
745
|
});
|
|
746
746
|
}
|
|
747
|
-
let o = await
|
|
747
|
+
let o = await I({
|
|
748
748
|
tempData: n,
|
|
749
749
|
index: 0,
|
|
750
750
|
columns: a
|
|
751
751
|
});
|
|
752
752
|
if (o) {
|
|
753
|
-
|
|
753
|
+
R(o.heightDatas);
|
|
754
754
|
let t = e.props.treeConfig?.childrenField || J.childrenField;
|
|
755
755
|
i[t] = n;
|
|
756
756
|
}
|
|
757
|
-
},
|
|
757
|
+
}, T = (t) => {
|
|
758
758
|
let n = null;
|
|
759
|
-
if (n = typeof t == "string" ?
|
|
759
|
+
if (n = typeof t == "string" ? m.get(t) : t, n[F.expandChildren]?.length) return;
|
|
760
760
|
let r = {
|
|
761
761
|
[F.isExpandRow]: !0,
|
|
762
762
|
[F.height]: e.props.expandConfig?.height || 0
|
|
763
763
|
};
|
|
764
764
|
Z([r]), n[F.expandChildren] = [r];
|
|
765
|
-
}, { headerHeight:
|
|
765
|
+
}, { headerHeight: E, headerStyles: ee, createHeader: D, headerRef: O, getHeaderRefHeight: k } = fe({ pretextTableRef: r }), { footerHeight: te, footerColumns: A, getFooterHeight: j, updateFooter: ne, updateFooterCellLabel: re } = ve({
|
|
766
766
|
showFooter: e.props.showFooter,
|
|
767
|
-
nowDataSource:
|
|
767
|
+
nowDataSource: _,
|
|
768
768
|
columns: t
|
|
769
|
-
}),
|
|
770
|
-
e == -1 && (e = ie.value),
|
|
771
|
-
},
|
|
769
|
+
}), M = g(0), ie = g(0), ae = (e) => {
|
|
770
|
+
e == -1 && (e = ie.value), M.value = e;
|
|
771
|
+
}, N = (e) => {
|
|
772
772
|
ie.value = e;
|
|
773
|
-
},
|
|
773
|
+
}, P = () => {
|
|
774
774
|
let e = 0;
|
|
775
|
-
for (let t of
|
|
776
|
-
|
|
777
|
-
},
|
|
775
|
+
for (let t of v) e += t[F.height] || 0;
|
|
776
|
+
M.value = e;
|
|
777
|
+
}, se = (e, t) => e ? isNaN(Number(e)) ? /^\d+px$/.test(e) ? e : t : e + "px" : t, ce = {
|
|
778
778
|
fontWeight: "400",
|
|
779
|
-
fontSize:
|
|
780
|
-
paddingLeft:
|
|
781
|
-
}, le = !!e.props.showOverflow, ue = e.props.cellMinHeight || 22,
|
|
779
|
+
fontSize: se(e.props.cellStyle?.fontSize, "14px"),
|
|
780
|
+
paddingLeft: se(e.props.cellStyle?.paddingLeft, "0px")
|
|
781
|
+
}, le = !!e.props.showOverflow, ue = e.props.cellMinHeight || 22, I = (t) => new Promise((n, r) => {
|
|
782
782
|
let i = new de(), a = {
|
|
783
783
|
tempData: t.tempData,
|
|
784
784
|
index: t.index,
|
|
@@ -800,25 +800,25 @@ var ge = (e) => {
|
|
|
800
800
|
}, i.onerror = (e) => {
|
|
801
801
|
r(e), i.terminate();
|
|
802
802
|
};
|
|
803
|
-
}),
|
|
803
|
+
}), R = (e) => {
|
|
804
804
|
for (let t of e) {
|
|
805
|
-
let e =
|
|
805
|
+
let e = m.get(t.id);
|
|
806
806
|
e && (e[F.height] = t.pretextHeight);
|
|
807
807
|
}
|
|
808
|
-
},
|
|
808
|
+
}, xe = 0, z = !1, Se = async (e) => {
|
|
809
809
|
if (t.value?.length === 0) {
|
|
810
|
-
if (
|
|
810
|
+
if (xe++, xe > 50) {
|
|
811
811
|
console.error("表格没有设置 columns.value");
|
|
812
812
|
return;
|
|
813
813
|
}
|
|
814
814
|
setTimeout(() => {
|
|
815
|
-
|
|
815
|
+
Se(e);
|
|
816
816
|
}, 100);
|
|
817
817
|
return;
|
|
818
818
|
}
|
|
819
819
|
let n = 0;
|
|
820
820
|
if (e.length === 0) {
|
|
821
|
-
|
|
821
|
+
S(e), P(), ke.value = [];
|
|
822
822
|
return;
|
|
823
823
|
}
|
|
824
824
|
let r = [];
|
|
@@ -838,15 +838,15 @@ var ge = (e) => {
|
|
|
838
838
|
treeNode: t.treeNode || !1
|
|
839
839
|
});
|
|
840
840
|
}
|
|
841
|
-
if (e.length *
|
|
841
|
+
if (e.length * Ce >= we) {
|
|
842
842
|
let t = 5e3;
|
|
843
843
|
z = !0;
|
|
844
|
-
let i = await
|
|
844
|
+
let i = await I({
|
|
845
845
|
tempData: e.slice(0, 100),
|
|
846
846
|
index: 0,
|
|
847
847
|
columns: r
|
|
848
848
|
});
|
|
849
|
-
i && (n += i.tempItemHeights,
|
|
849
|
+
i && (n += i.tempItemHeights, R(i.heightDatas), S(e), P(), H());
|
|
850
850
|
let a = [], o = Math.ceil((e.length - 100) / t / 2), s = o * 2, c = 0, l = 100;
|
|
851
851
|
for (let n = 1; n <= o; n++) for (let n = 0; n < 2; n++) a[n] || (a[n] = []), a[n].push({
|
|
852
852
|
tempI: l,
|
|
@@ -859,44 +859,44 @@ var ge = (e) => {
|
|
|
859
859
|
c++;
|
|
860
860
|
continue;
|
|
861
861
|
}
|
|
862
|
-
let t = await
|
|
862
|
+
let t = await I({
|
|
863
863
|
tempData: i.tempData,
|
|
864
864
|
index: i.tempI,
|
|
865
865
|
columns: r
|
|
866
866
|
});
|
|
867
|
-
t && (n += t.tempItemHeights,
|
|
867
|
+
t && (n += t.tempItemHeights, N(n), ae(n), c++, R(t.heightDatas), c == s && (S(e), P(), z = !1));
|
|
868
868
|
}
|
|
869
869
|
};
|
|
870
870
|
for (let e of a) t(e);
|
|
871
871
|
}
|
|
872
872
|
} else {
|
|
873
873
|
z = !0;
|
|
874
|
-
let t = await
|
|
874
|
+
let t = await I({
|
|
875
875
|
tempData: e,
|
|
876
876
|
index: 0,
|
|
877
877
|
columns: r
|
|
878
878
|
});
|
|
879
|
-
z = !1, t && (
|
|
879
|
+
z = !1, t && (R(t.heightDatas), S(e), P(), H());
|
|
880
880
|
}
|
|
881
|
-
},
|
|
882
|
-
if (
|
|
881
|
+
}, Ce = 0, we = 1e4, B = 0, Te = 0, Ee = g(0), V = !1, De = (e) => {
|
|
882
|
+
if (Te = i.value?.scrollLeft || 0, B == i.value?.scrollTop) {
|
|
883
883
|
V ||= (window.requestAnimationFrame(() => {
|
|
884
|
-
|
|
884
|
+
Pe(), V = !1;
|
|
885
885
|
}), !0);
|
|
886
886
|
return;
|
|
887
887
|
}
|
|
888
888
|
B = i.value?.scrollTop || 0, e.preventDefault(), V ||= (window.requestAnimationFrame(() => {
|
|
889
889
|
H(), V = !1;
|
|
890
890
|
}), !0);
|
|
891
|
-
},
|
|
891
|
+
}, Oe = (e) => {
|
|
892
892
|
if (e.shiftKey) {
|
|
893
893
|
e.preventDefault(), e.stopPropagation(), e.deltaY > 0 || e.deltaX > 0 ? i.value?.scrollBy({ left: 100 }) : i.value?.scrollBy({ left: -100 });
|
|
894
894
|
return;
|
|
895
895
|
}
|
|
896
896
|
e.preventDefault(), e.stopPropagation(), e.deltaY > 0 ? i.value?.scrollBy({ top: 150 }) : i.value?.scrollBy({ top: -150 });
|
|
897
|
-
},
|
|
897
|
+
}, ke = g([]), Ae = g(0), je = oe((e, t) => {
|
|
898
898
|
setTimeout(() => {
|
|
899
|
-
|
|
899
|
+
Ae.value = t, e.forEach((e) => {
|
|
900
900
|
e.slotShowTimestamp = t;
|
|
901
901
|
}), l();
|
|
902
902
|
}, 0);
|
|
@@ -904,14 +904,14 @@ var ge = (e) => {
|
|
|
904
904
|
if (!i.value) return;
|
|
905
905
|
let e = i.value.scrollTop, t = a.value, n = 0, r = 0, o = [], s = "遍历";
|
|
906
906
|
switch (!0) {
|
|
907
|
-
case e > 500 &&
|
|
907
|
+
case e > 500 && v.length > 10:
|
|
908
908
|
s = "二分查找";
|
|
909
909
|
break;
|
|
910
910
|
default: break;
|
|
911
911
|
}
|
|
912
912
|
let c = !1;
|
|
913
913
|
if (s == "二分查找") {
|
|
914
|
-
let i = 0, a =
|
|
914
|
+
let i = 0, a = v.length - 1, s = {
|
|
915
915
|
totalHeight: 0,
|
|
916
916
|
row: {}
|
|
917
917
|
}, l = 0;
|
|
@@ -920,32 +920,32 @@ var ge = (e) => {
|
|
|
920
920
|
c = !0;
|
|
921
921
|
break BinarySearchWhile;
|
|
922
922
|
}
|
|
923
|
-
let t = Math.floor((i + a) / 2), n =
|
|
923
|
+
let t = Math.floor((i + a) / 2), n = b.get(t + 1)?.totalHeight || 0;
|
|
924
924
|
!n || n <= 1 || (n <= e ? i = t + 1 : a = t - 1);
|
|
925
925
|
}
|
|
926
|
-
s =
|
|
926
|
+
s = b.get(i) || {
|
|
927
927
|
totalHeight: 0,
|
|
928
928
|
row: {}
|
|
929
|
-
}, r = s.totalHeight,
|
|
930
|
-
getHeightFor: for (let e = i; e <
|
|
931
|
-
let t =
|
|
929
|
+
}, r = s.totalHeight, Ee.value = r - s.row[F.height], o.push(s.row), n = e + t;
|
|
930
|
+
getHeightFor: for (let e = i; e < v.length; e++) {
|
|
931
|
+
let t = v[e];
|
|
932
932
|
if (r += t[F.height], n) if (r <= n) o.push(t);
|
|
933
933
|
else break getHeightFor;
|
|
934
934
|
}
|
|
935
935
|
}
|
|
936
|
-
if (s == "遍历" || c) getHeightFor: for (let i = 0; i <
|
|
937
|
-
let a =
|
|
936
|
+
if (s == "遍历" || c) getHeightFor: for (let i = 0; i < v.length; i++) {
|
|
937
|
+
let a = v[i];
|
|
938
938
|
if (a) {
|
|
939
939
|
if (r += a[F.height], e <= r && n == 0) {
|
|
940
|
-
|
|
940
|
+
Ee.value = r - a[F.height], o.push(a), n = e + t;
|
|
941
941
|
continue;
|
|
942
942
|
}
|
|
943
943
|
if (n) if (r <= n) o.push(a);
|
|
944
944
|
else break getHeightFor;
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
|
-
|
|
948
|
-
},
|
|
947
|
+
ke.value = o, Pe(), je(o, Math.floor(performance.now()));
|
|
948
|
+
}, Me = g(0), Ne = g(0), Pe = () => {
|
|
949
949
|
if (!i.value) return;
|
|
950
950
|
let e = i.value.scrollLeft, n = i.value.clientWidth;
|
|
951
951
|
for (let e of t.value) (e.fixed == "left" || e.fixed == "right") && (n -= e.width || e.minWidth || 0);
|
|
@@ -963,17 +963,17 @@ var ge = (e) => {
|
|
|
963
963
|
}
|
|
964
964
|
}
|
|
965
965
|
}
|
|
966
|
-
r <= a && (
|
|
967
|
-
},
|
|
966
|
+
r <= a && (Me.value = r, Ne.value = a);
|
|
967
|
+
}, Fe = oe(H, 200), { fixedColumnsLeft: Ie, fixedColumnsRight: Le, fixedLeftIndex: Re, fixedRightIndex: U, reflashGridTemplateColumns: W, gridTemplateColumns: ze, getGridStyles: G } = pe({ columns: t }), K = y({}), Be = (t, n = !0) => {
|
|
968
968
|
e.props.rowConfig?.isCurrent && K.value != t && (K.value = t, n && e.emits("currentChange", { newValue: t }));
|
|
969
|
-
},
|
|
970
|
-
if (
|
|
969
|
+
}, Ve = (t, n) => {
|
|
970
|
+
if (Be(t), e.props.treeConfig?.isOpenTree) {
|
|
971
971
|
let r = e.props.treeConfig.childrenField || J.childrenField;
|
|
972
972
|
switch (!0) {
|
|
973
973
|
case t?.[r]?.length == 0: break;
|
|
974
974
|
case e.props.treeConfig?.trigger == "cell" && n.treeNode:
|
|
975
975
|
case e.props.treeConfig?.trigger == "row":
|
|
976
|
-
|
|
976
|
+
ct([t], !t[F.isCollapsed]);
|
|
977
977
|
break;
|
|
978
978
|
default: break;
|
|
979
979
|
}
|
|
@@ -981,7 +981,7 @@ var ge = (e) => {
|
|
|
981
981
|
if (e.props.expandConfig?.isExpand) switch (!0) {
|
|
982
982
|
case e.props.expandConfig?.trigger == "cell" && n.type == "expand":
|
|
983
983
|
case e.props.expandConfig?.trigger == "row":
|
|
984
|
-
|
|
984
|
+
ut([t], !t[F.isRowExpanded]);
|
|
985
985
|
break;
|
|
986
986
|
default: break;
|
|
987
987
|
}
|
|
@@ -989,23 +989,27 @@ var ge = (e) => {
|
|
|
989
989
|
row: t,
|
|
990
990
|
column: n
|
|
991
991
|
});
|
|
992
|
-
},
|
|
993
|
-
e.emits && e.emits("headerCellClick", { column: t }), e.props.sortConfig?.trigger == "cell" && t.sortable &&
|
|
994
|
-
},
|
|
995
|
-
e.props.rowConfig?.isHover && (
|
|
996
|
-
},
|
|
992
|
+
}, He = (t) => {
|
|
993
|
+
e.emits && e.emits("headerCellClick", { column: t }), e.props.sortConfig?.trigger == "cell" && t.sortable && gt(t.field, "auto"), e.emits && e.emits("cellClick", { column: t });
|
|
994
|
+
}, Ue = y({}), We = (t) => {
|
|
995
|
+
e.props.rowConfig?.isHover && (Ue.value = t);
|
|
996
|
+
}, Ge = (e) => {
|
|
997
|
+
let { cellClassName: t } = e.column;
|
|
998
|
+
return typeof t == "function" ? t(e) : t || "";
|
|
999
|
+
}, { getCheckField: Ke, headerChecked: qe, headerCheckedIndeterminate: Je, onHeaderChecked: Ye, upDataHeaderChecked: Xe, upDataAllRowCheckedDeep: Ze, onCellChecked: Qe, getCheckboxRecords: $e, clearCheckboxRowInit: et } = me({
|
|
997
1000
|
pretextId: F.id,
|
|
998
1001
|
columns: t,
|
|
999
|
-
blurAnyElement:
|
|
1000
|
-
nowDataSource:
|
|
1001
|
-
baseDataSource:
|
|
1002
|
+
blurAnyElement: L,
|
|
1003
|
+
nowDataSource: _,
|
|
1004
|
+
baseDataSource: h,
|
|
1005
|
+
baseDataMap: m,
|
|
1002
1006
|
emits: e.emits,
|
|
1003
1007
|
treeConfig: e.props.treeConfig
|
|
1004
|
-
}),
|
|
1005
|
-
|
|
1008
|
+
}), tt = (e) => {
|
|
1009
|
+
et();
|
|
1006
1010
|
let t = [];
|
|
1007
|
-
if (t = e ? [e] :
|
|
1008
|
-
}, { isDragging:
|
|
1011
|
+
if (t = e ? [e] : Ke(), t) for (let e of _.value) for (let n of t) e[n] = !1;
|
|
1012
|
+
}, { isDragging: nt, dragLineLeft: rt, startResize: it } = _e({
|
|
1009
1013
|
pretextTableRef: r,
|
|
1010
1014
|
afterResize: (t) => {
|
|
1011
1015
|
W(), e.emits("resizableChange", {
|
|
@@ -1013,8 +1017,8 @@ var ge = (e) => {
|
|
|
1013
1017
|
resizeWidth: t.column.width
|
|
1014
1018
|
});
|
|
1015
1019
|
}
|
|
1016
|
-
}),
|
|
1017
|
-
|
|
1020
|
+
}), at = () => {
|
|
1021
|
+
S(_.value), P(), H();
|
|
1018
1022
|
}, q = (t) => {
|
|
1019
1023
|
if (t) {
|
|
1020
1024
|
let t = e.props.treeConfig?.childrenField || J.childrenField, n = [], r = (e) => {
|
|
@@ -1023,193 +1027,193 @@ var ge = (e) => {
|
|
|
1023
1027
|
for (let n of e[t]) r(n);
|
|
1024
1028
|
}
|
|
1025
1029
|
};
|
|
1026
|
-
for (let e of
|
|
1027
|
-
|
|
1028
|
-
} else
|
|
1029
|
-
},
|
|
1030
|
+
for (let e of _.value) r(e);
|
|
1031
|
+
ct(n, !0);
|
|
1032
|
+
} else ot();
|
|
1033
|
+
}, ot = () => {
|
|
1030
1034
|
Y.forEach((e) => {
|
|
1031
1035
|
e[F.isCollapsed] = !1;
|
|
1032
|
-
}), Y.clear(),
|
|
1033
|
-
}, { defaultTreeConfig: J, treeExpandMap: Y, handleTree:
|
|
1036
|
+
}), Y.clear(), S(_.value), P(), H();
|
|
1037
|
+
}, { defaultTreeConfig: J, treeExpandMap: Y, handleTree: st, setTreeExpand: ct } = ye({
|
|
1034
1038
|
treeConfig: e.props.treeConfig,
|
|
1035
|
-
afterTreeExpand:
|
|
1036
|
-
insertChild:
|
|
1037
|
-
}), { handleExpand:
|
|
1039
|
+
afterTreeExpand: at,
|
|
1040
|
+
insertChild: C
|
|
1041
|
+
}), { handleExpand: lt, setRowExpand: ut } = be({
|
|
1038
1042
|
expandConfig: e.props.expandConfig,
|
|
1039
1043
|
afterRowExpand: (t, n) => {
|
|
1040
|
-
|
|
1044
|
+
S(_.value), P(), H(), e.emits("toggleRowExpand", {
|
|
1041
1045
|
expanded: n,
|
|
1042
1046
|
rows: t
|
|
1043
1047
|
});
|
|
1044
1048
|
},
|
|
1045
|
-
insertExpandRow:
|
|
1046
|
-
}),
|
|
1047
|
-
|
|
1048
|
-
},
|
|
1049
|
-
let n =
|
|
1049
|
+
insertExpandRow: T
|
|
1050
|
+
}), dt = 0, X = () => {
|
|
1051
|
+
h.value = [], S([]), m.clear(), K.value = {}, Ue.value = {}, et(), ht.value = "", $.value = null, Et(), dt = 0, xe = 0;
|
|
1052
|
+
}, Z = (t) => {
|
|
1053
|
+
let n = dt;
|
|
1050
1054
|
for (let r of t) {
|
|
1051
|
-
r[F.id] = Math.random().toString(36).substring(2), r[F.index] = n, n++,
|
|
1055
|
+
r[F.id] = Math.random().toString(36).substring(2), r[F.index] = n, n++, dt++, m.set(r[F.id], r);
|
|
1052
1056
|
let t = e.props.treeConfig?.childrenField || J.childrenField;
|
|
1053
1057
|
e.props.treeConfig?.isOpenTree && r?.[t]?.length > 0 && Z(r[t]);
|
|
1054
1058
|
}
|
|
1055
|
-
},
|
|
1059
|
+
}, ft = (e, t, n = 0) => {
|
|
1056
1060
|
z ? setTimeout(() => {
|
|
1057
|
-
n >= 50 ||
|
|
1061
|
+
n >= 50 || ft(e, t, n + 1);
|
|
1058
1062
|
}, 100) : u({
|
|
1059
1063
|
top: e,
|
|
1060
1064
|
left: t
|
|
1061
1065
|
});
|
|
1062
|
-
},
|
|
1063
|
-
let t = B, n =
|
|
1064
|
-
await
|
|
1065
|
-
},
|
|
1066
|
+
}, pt = async (e) => {
|
|
1067
|
+
let t = B, n = Te;
|
|
1068
|
+
await Q(e), ft(t, n);
|
|
1069
|
+
}, Q = async (e) => {
|
|
1066
1070
|
try {
|
|
1067
|
-
u({ top: 0 }),
|
|
1068
|
-
let t = at(e || []);
|
|
1069
|
-
Z(t || []), m.value = t || [], xe(m.value);
|
|
1071
|
+
u({ top: 0 }), X(), Z(e || []), h.value = st(e || []) || [], Se(h.value);
|
|
1070
1072
|
} catch (e) {
|
|
1071
1073
|
console.error(e);
|
|
1072
1074
|
}
|
|
1073
|
-
},
|
|
1074
|
-
let e =
|
|
1075
|
+
}, mt = () => {
|
|
1076
|
+
let e = v.filter((e) => !e[F.isExpandRow]);
|
|
1075
1077
|
return {
|
|
1076
|
-
fullData:
|
|
1077
|
-
visibleData: e
|
|
1078
|
+
fullData: h.value,
|
|
1079
|
+
visibleData: e,
|
|
1080
|
+
baseDataMap: m
|
|
1078
1081
|
};
|
|
1079
|
-
}, { sortField:
|
|
1080
|
-
nowDataSource:
|
|
1082
|
+
}, { sortField: ht, sortOrder: $, sort: gt, handleSort: _t } = he({
|
|
1083
|
+
nowDataSource: _,
|
|
1081
1084
|
getVisibleData: H,
|
|
1082
|
-
setNowDataSource:
|
|
1085
|
+
setNowDataSource: S,
|
|
1083
1086
|
treeConfig: e.props.treeConfig,
|
|
1084
1087
|
defaultTreeConfig: J,
|
|
1085
1088
|
columns: t
|
|
1086
|
-
}), { filterPopupWidth:
|
|
1089
|
+
}), { filterPopupWidth: vt, filterPopupId: yt, inputFilterOptions: bt, numberFilterOptions: xt, filterFields: St, getFilterFields: Ct, filterClick: wt, setFilter: Tt, clearFilter: Et } = ge({
|
|
1087
1090
|
columns: t,
|
|
1088
|
-
baseDataSource:
|
|
1089
|
-
setNowDataSource:
|
|
1091
|
+
baseDataSource: h,
|
|
1092
|
+
setNowDataSource: S,
|
|
1090
1093
|
scrollTo: u,
|
|
1091
1094
|
refresh: l,
|
|
1092
1095
|
afterFilter: () => {
|
|
1093
|
-
|
|
1096
|
+
P(), _t(), Ze();
|
|
1094
1097
|
},
|
|
1095
1098
|
treeConfig: e.props.treeConfig,
|
|
1096
1099
|
defaultTreeConfig: J
|
|
1097
|
-
}),
|
|
1098
|
-
|
|
1099
|
-
},
|
|
1100
|
+
}), Dt = (e) => {
|
|
1101
|
+
L(), e.listFilter.selectedValue.length == e.listFilter.listOptions.length ? e.listFilter.selectedValue = [] : e.listFilter.selectedValue = e.listFilter.listOptions.map((e) => e.value);
|
|
1102
|
+
}, Ot = (i) => {
|
|
1100
1103
|
if (!r.value) {
|
|
1101
1104
|
setTimeout(() => {
|
|
1102
|
-
|
|
1105
|
+
Ot(i);
|
|
1103
1106
|
}, 100);
|
|
1104
1107
|
return;
|
|
1105
1108
|
}
|
|
1106
|
-
let a =
|
|
1107
|
-
a.finalColumns.length == 0 || a.realColumns.length == 0 || (
|
|
1108
|
-
|
|
1109
|
-
}, 0),
|
|
1109
|
+
let a = D(i) || [];
|
|
1110
|
+
a.finalColumns.length == 0 || a.realColumns.length == 0 || (lt(), Ce = a.finalColumns.length, P(), t.value = a.finalColumns, n.value = a.realColumns, setTimeout(() => {
|
|
1111
|
+
k();
|
|
1112
|
+
}, 0), j(e.props.footerProps), Ke(), G(), Ct(), l());
|
|
1110
1113
|
};
|
|
1111
1114
|
w(() => e.props.columns, (e) => {
|
|
1112
|
-
|
|
1115
|
+
Ot(e);
|
|
1113
1116
|
}, { immediate: !0 }), w(() => e.props.footerProps, (e) => {
|
|
1114
|
-
|
|
1117
|
+
j(e);
|
|
1115
1118
|
}), w(() => e.props.height, (e) => {
|
|
1116
|
-
a.value = e,
|
|
1119
|
+
a.value = e, Fe();
|
|
1117
1120
|
}, { immediate: !0 });
|
|
1118
|
-
let
|
|
1121
|
+
let kt = () => {
|
|
1119
1122
|
r.value && (o.value = r.value.clientWidth);
|
|
1120
|
-
},
|
|
1123
|
+
}, At = oe(kt, 100), jt = () => {
|
|
1121
1124
|
if (!r.value) {
|
|
1122
1125
|
setTimeout(() => {
|
|
1123
|
-
|
|
1126
|
+
jt();
|
|
1124
1127
|
}, 100);
|
|
1125
1128
|
return;
|
|
1126
1129
|
}
|
|
1127
|
-
window.addEventListener("resize",
|
|
1130
|
+
window.addEventListener("resize", At), kt();
|
|
1128
1131
|
};
|
|
1129
1132
|
return p(() => {
|
|
1130
|
-
|
|
1133
|
+
jt();
|
|
1131
1134
|
}), d(() => {
|
|
1132
1135
|
u({
|
|
1133
1136
|
top: B,
|
|
1134
|
-
left:
|
|
1137
|
+
left: Te
|
|
1135
1138
|
}), H();
|
|
1136
1139
|
}), f(() => {}), {
|
|
1137
1140
|
keyNames: F,
|
|
1138
|
-
nowDataSource:
|
|
1141
|
+
nowDataSource: _,
|
|
1139
1142
|
pretextTableRef: r,
|
|
1140
1143
|
tableRef: i,
|
|
1141
1144
|
isLoading: s,
|
|
1142
|
-
visibleData:
|
|
1143
|
-
visibleWidthStartColumnIndex:
|
|
1144
|
-
visibleWidthEndColumnIndex:
|
|
1145
|
-
gridTemplateColumns:
|
|
1146
|
-
blurAnyElement:
|
|
1145
|
+
visibleData: ke,
|
|
1146
|
+
visibleWidthStartColumnIndex: Me,
|
|
1147
|
+
visibleWidthEndColumnIndex: Ne,
|
|
1148
|
+
gridTemplateColumns: ze,
|
|
1149
|
+
blurAnyElement: L,
|
|
1147
1150
|
columns: t,
|
|
1148
|
-
onScroll:
|
|
1149
|
-
onWheel:
|
|
1150
|
-
topEmptyHeight:
|
|
1151
|
-
scrollbarHeight:
|
|
1152
|
-
headerHeight:
|
|
1153
|
-
headerStyles:
|
|
1151
|
+
onScroll: De,
|
|
1152
|
+
onWheel: Oe,
|
|
1153
|
+
topEmptyHeight: Ee,
|
|
1154
|
+
scrollbarHeight: M,
|
|
1155
|
+
headerHeight: E,
|
|
1156
|
+
headerStyles: ee,
|
|
1154
1157
|
realColumns: n,
|
|
1155
|
-
headerRef:
|
|
1158
|
+
headerRef: O,
|
|
1156
1159
|
updateFooter: ne,
|
|
1157
1160
|
updateFooterCellLabel: re,
|
|
1158
|
-
footerHeight:
|
|
1159
|
-
footerColumns:
|
|
1160
|
-
getFooterHeight:
|
|
1161
|
+
footerHeight: te,
|
|
1162
|
+
footerColumns: A,
|
|
1163
|
+
getFooterHeight: j,
|
|
1161
1164
|
itemStyles: ce,
|
|
1162
|
-
fixedLeftIndex:
|
|
1165
|
+
fixedLeftIndex: Re,
|
|
1163
1166
|
fixedRightIndex: U,
|
|
1164
|
-
fixedColumnsLeft:
|
|
1165
|
-
fixedColumnsRight:
|
|
1167
|
+
fixedColumnsLeft: Ie,
|
|
1168
|
+
fixedColumnsRight: Le,
|
|
1166
1169
|
getGridStyles: G,
|
|
1167
1170
|
divLineHeightOffset: 20,
|
|
1168
1171
|
currentRow: K,
|
|
1169
|
-
setCurrentRow:
|
|
1170
|
-
cellClick:
|
|
1171
|
-
headerClick:
|
|
1172
|
-
hoverRow:
|
|
1173
|
-
cellMousemove:
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1172
|
+
setCurrentRow: Be,
|
|
1173
|
+
cellClick: Ve,
|
|
1174
|
+
headerClick: He,
|
|
1175
|
+
hoverRow: Ue,
|
|
1176
|
+
cellMousemove: We,
|
|
1177
|
+
resolveCellClassName: Ge,
|
|
1178
|
+
headerChecked: qe,
|
|
1179
|
+
headerCheckedIndeterminate: Je,
|
|
1180
|
+
onHeaderChecked: Ye,
|
|
1181
|
+
onCellChecked: Qe,
|
|
1182
|
+
getCheckboxRecords: $e,
|
|
1183
|
+
clearCheckboxRow: tt,
|
|
1184
|
+
sortField: ht,
|
|
1185
|
+
sortOrder: $,
|
|
1186
|
+
sort: gt,
|
|
1187
|
+
filterPopupWidth: vt,
|
|
1188
|
+
filterPopupId: yt,
|
|
1189
|
+
inputFilterOptions: bt,
|
|
1190
|
+
numberFilterOptions: xt,
|
|
1191
|
+
filterFields: St,
|
|
1192
|
+
getFilterFields: Ct,
|
|
1193
|
+
filterClick: wt,
|
|
1194
|
+
setFilter: Tt,
|
|
1195
|
+
clearFilter: Et,
|
|
1196
|
+
setListFilterAll: Dt,
|
|
1197
|
+
isDragging: nt,
|
|
1198
|
+
dragLineLeft: rt,
|
|
1199
|
+
startResize: it,
|
|
1200
|
+
setTreeExpand: ct,
|
|
1197
1201
|
setAllTreeExpand: q,
|
|
1198
|
-
clearTreeExpand:
|
|
1202
|
+
clearTreeExpand: ot,
|
|
1199
1203
|
defaultTreeConfig: J,
|
|
1200
|
-
setRowExpand:
|
|
1201
|
-
slotShowTimestamp:
|
|
1204
|
+
setRowExpand: ut,
|
|
1205
|
+
slotShowTimestamp: Ae,
|
|
1202
1206
|
isRefresh: c,
|
|
1203
1207
|
realTableHeight: a,
|
|
1204
1208
|
realTableWidth: o,
|
|
1205
|
-
loadData:
|
|
1206
|
-
reloadData:
|
|
1207
|
-
getTableData:
|
|
1209
|
+
loadData: pt,
|
|
1210
|
+
reloadData: Q,
|
|
1211
|
+
getTableData: mt
|
|
1208
1212
|
};
|
|
1209
|
-
},
|
|
1213
|
+
}, xe = ["onClick"], z = { key: 0 }, Se = { key: 1 }, Ce = { key: 2 }, we = {
|
|
1210
1214
|
key: 3,
|
|
1211
1215
|
style: { "text-align": "center" }
|
|
1212
|
-
},
|
|
1216
|
+
}, B = {
|
|
1213
1217
|
key: 0,
|
|
1214
1218
|
style: {
|
|
1215
1219
|
display: "inline-flex",
|
|
@@ -1220,7 +1224,7 @@ var ge = (e) => {
|
|
|
1220
1224
|
padding: "0px",
|
|
1221
1225
|
width: "14px"
|
|
1222
1226
|
}
|
|
1223
|
-
}, Te = { key: 1 },
|
|
1227
|
+
}, Te = { key: 1 }, Ee = ["id"], V = { style: {
|
|
1224
1228
|
"text-align": "center",
|
|
1225
1229
|
"font-weight": "bold"
|
|
1226
1230
|
} }, De = { style: {
|
|
@@ -1237,19 +1241,19 @@ var ge = (e) => {
|
|
|
1237
1241
|
"margin-top": "5px",
|
|
1238
1242
|
padding: "5px 0",
|
|
1239
1243
|
"border-top": "1px solid #e0e0e0"
|
|
1240
|
-
} },
|
|
1244
|
+
} }, je = ["onMousedown"], H = ["onClick", "onMouseenter"], Me = {
|
|
1241
1245
|
key: 3,
|
|
1242
1246
|
style: { "margin-left": "6px" }
|
|
1243
|
-
}, Ne = { style: {
|
|
1247
|
+
}, Ne = ["onClick"], Pe = { style: {
|
|
1244
1248
|
display: "flex",
|
|
1245
1249
|
gap: "4px"
|
|
1246
|
-
} },
|
|
1250
|
+
} }, Fe = ["title"], Ie = {
|
|
1247
1251
|
key: 9,
|
|
1248
1252
|
style: {
|
|
1249
1253
|
width: "100%",
|
|
1250
1254
|
"text-align": "center"
|
|
1251
1255
|
}
|
|
1252
|
-
},
|
|
1256
|
+
}, Le = ["title"], Re = { key: 1 }, U = /* @__PURE__ */ c({
|
|
1253
1257
|
inheritAttrs: !1,
|
|
1254
1258
|
name: "pretextTable",
|
|
1255
1259
|
props: {
|
|
@@ -1325,31 +1329,31 @@ var ge = (e) => {
|
|
|
1325
1329
|
"toggleRowExpand"
|
|
1326
1330
|
],
|
|
1327
1331
|
setup(c, { expose: d, emit: f }) {
|
|
1328
|
-
let p = c, { keyNames: m, pretextTableRef: g, nowDataSource: y, tableRef: x, isLoading: w, headerHeight:
|
|
1332
|
+
let p = c, { keyNames: m, pretextTableRef: g, nowDataSource: y, tableRef: x, isLoading: w, headerHeight: N, topEmptyHeight: oe, visibleData: P, visibleWidthStartColumnIndex: se, visibleWidthEndColumnIndex: ce, columns: le, realColumns: ue, headerRef: de, onScroll: fe, onWheel: pe, gridTemplateColumns: F, blurAnyElement: I, scrollbarHeight: me, headerStyles: he, divLineHeightOffset: ge, updateFooter: _e, updateFooterCellLabel: ve, footerHeight: ye, footerColumns: L, getFooterHeight: be, itemStyles: U, fixedLeftIndex: W, fixedRightIndex: ze, fixedColumnsLeft: G, fixedColumnsRight: K, currentRow: Be, setCurrentRow: Ve, cellClick: He, headerClick: Ue, hoverRow: We, cellMousemove: Ge, resolveCellClassName: Ke, headerChecked: qe, headerCheckedIndeterminate: Je, onHeaderChecked: Ye, onCellChecked: Xe, getCheckboxRecords: Ze, clearCheckboxRow: Qe, sortField: $e, sortOrder: et, sort: tt, filterPopupWidth: nt, filterPopupId: rt, inputFilterOptions: it, numberFilterOptions: at, filterFields: q, getFilterFields: ot, filterClick: J, setFilter: Y, clearFilter: st, setListFilterAll: ct, isDragging: lt, dragLineLeft: ut, startResize: dt, setTreeExpand: X, setAllTreeExpand: Z, clearTreeExpand: ft, defaultTreeConfig: pt, setRowExpand: Q, slotShowTimestamp: mt, isRefresh: ht, realTableHeight: $, realTableWidth: gt, loadData: _t, reloadData: vt, getTableData: yt } = R({
|
|
1329
1333
|
props: p,
|
|
1330
1334
|
emits: f
|
|
1331
1335
|
});
|
|
1332
1336
|
return d({
|
|
1333
|
-
loadData:
|
|
1334
|
-
reloadData:
|
|
1335
|
-
setCurrentRow:
|
|
1336
|
-
getCheckboxRecords:
|
|
1337
|
-
clearCheckboxRow:
|
|
1338
|
-
updateFooter:
|
|
1339
|
-
updateFooterCellLabel:
|
|
1340
|
-
getFooterHeight:
|
|
1341
|
-
getTableData:
|
|
1342
|
-
setTreeExpand:
|
|
1343
|
-
setAllTreeExpand:
|
|
1344
|
-
clearTreeExpand:
|
|
1345
|
-
setRowExpand:
|
|
1337
|
+
loadData: _t,
|
|
1338
|
+
reloadData: vt,
|
|
1339
|
+
setCurrentRow: Ve,
|
|
1340
|
+
getCheckboxRecords: Ze,
|
|
1341
|
+
clearCheckboxRow: Qe,
|
|
1342
|
+
updateFooter: _e,
|
|
1343
|
+
updateFooterCellLabel: ve,
|
|
1344
|
+
getFooterHeight: be,
|
|
1345
|
+
getTableData: yt,
|
|
1346
|
+
setTreeExpand: X,
|
|
1347
|
+
setAllTreeExpand: Z,
|
|
1348
|
+
clearTreeExpand: ft,
|
|
1349
|
+
setRowExpand: Q
|
|
1346
1350
|
}), (c, d) => (h(), i("div", {
|
|
1347
1351
|
class: "cName-pretextTable",
|
|
1348
1352
|
style: { position: "relative" },
|
|
1349
1353
|
ref_key: "pretextTableRef",
|
|
1350
1354
|
ref: g
|
|
1351
1355
|
}, [
|
|
1352
|
-
s(S(
|
|
1356
|
+
s(S(ne), {
|
|
1353
1357
|
modelValue: S(w),
|
|
1354
1358
|
text: p.loadingConfig?.text || "加载中..."
|
|
1355
1359
|
}, null, 8, ["modelValue", "text"]),
|
|
@@ -1380,54 +1384,54 @@ var ge = (e) => {
|
|
|
1380
1384
|
left: "0",
|
|
1381
1385
|
"z-index": "1"
|
|
1382
1386
|
}, { gridTemplateColumns: S(F) }])
|
|
1383
|
-
}, [(h(!0), i(e, null, _(S(
|
|
1387
|
+
}, [(h(!0), i(e, null, _(S(ue), (f, p) => (h(), i(e, { key: "headerRow_" + p }, [(h(!0), i(e, null, _(f, (f, m) => (h(), i("div", {
|
|
1384
1388
|
key: "header_" + (f?.field || "null") + "_" + m,
|
|
1385
|
-
class: "pretextTable-grid-header",
|
|
1389
|
+
class: l(["pretextTable-grid-header", "pretextTable-grid-header" + (f?.field || "") + "_" + p]),
|
|
1386
1390
|
style: u(f ? {
|
|
1387
|
-
fontWeight: S(
|
|
1388
|
-
fontSize: S(
|
|
1391
|
+
fontWeight: S(he).fontWeight,
|
|
1392
|
+
fontSize: S(he).fontSize,
|
|
1389
1393
|
gridRow: f?.style?.gridRow || "",
|
|
1390
1394
|
gridColumn: f?.style?.gridColumn || "",
|
|
1391
1395
|
zIndex: m == 0 ? 3 : f.fixed == "left" || f.fixed == "right" ? 2 : 1,
|
|
1392
1396
|
left: f.fixed == "left" ? S(G)[m] : "",
|
|
1393
1397
|
right: f.fixed == "right" ? S(K)[m] : "",
|
|
1394
1398
|
borderLeft: f.fixed == "right" ? "1px solid var(--pretextTable-border-color)" : "",
|
|
1395
|
-
boxShadow: f.fixed == "left" && m == S(W) ? "var(--pretextTable-shadow-color) 2px 0px 5px -1px" : f.fixed == "right" && m == S(
|
|
1399
|
+
boxShadow: f.fixed == "left" && m == S(W) ? "var(--pretextTable-shadow-color) 2px 0px 5px -1px" : f.fixed == "right" && m == S(ze) ? "var(--pretextTable-shadow-color) -2px 0px 5px -1px" : "",
|
|
1396
1400
|
borderBottom: f ? "1px solid var(--pretextTable-border-color)" : "",
|
|
1397
1401
|
minHeight: "30px"
|
|
1398
1402
|
} : {}),
|
|
1399
|
-
onClick: (e) => S(
|
|
1403
|
+
onClick: (e) => S(Ue)(f)
|
|
1400
1404
|
}, [f ? f.type == "checkbox" && p == 0 ? (h(), i("span", Se, [s(S(k), {
|
|
1401
|
-
modelValue: S(
|
|
1402
|
-
indeterminate: S(
|
|
1405
|
+
modelValue: S(qe)[f.field],
|
|
1406
|
+
indeterminate: S(Je)[f.field],
|
|
1403
1407
|
content: "",
|
|
1404
|
-
onChange: (e) => S(
|
|
1408
|
+
onChange: (e) => S(Ye)(f.field)
|
|
1405
1409
|
}, null, 8, [
|
|
1406
1410
|
"modelValue",
|
|
1407
1411
|
"indeterminate",
|
|
1408
1412
|
"onChange"
|
|
1409
|
-
])])) : f?.type == "seq" && p == 0 ? (h(), i("div", Ce, b(f.title || "序号"), 1)) : (h(), i("span",
|
|
1413
|
+
])])) : f?.type == "seq" && p == 0 ? (h(), i("div", Ce, b(f.title || "序号"), 1)) : (h(), i("span", we, [
|
|
1410
1414
|
a("span", null, [f.slots?.header ? v(c.$slots, f.slots?.header, {
|
|
1411
1415
|
key: 0,
|
|
1412
1416
|
column: f,
|
|
1413
1417
|
text: f.title
|
|
1414
1418
|
}, () => [o(b(f.title), 1)]) : (h(), i(e, { key: 1 }, [o(b(f.title), 1)], 64))]),
|
|
1415
|
-
f.sortable && !f.children?.length ? (h(), i("span",
|
|
1419
|
+
f.sortable && !f.children?.length ? (h(), i("span", B, [s(S(A), {
|
|
1416
1420
|
name: "caret-up",
|
|
1417
1421
|
style: {
|
|
1418
1422
|
position: "absolute",
|
|
1419
1423
|
top: "-0.8em"
|
|
1420
1424
|
},
|
|
1421
|
-
class: l(["pretextTable-sort-icon", { "pretextTable-sort-icon-active": S(
|
|
1422
|
-
onClick: D((e) => S(
|
|
1425
|
+
class: l(["pretextTable-sort-icon", { "pretextTable-sort-icon-active": S($e) == f.field && S(et) == "asc" }]),
|
|
1426
|
+
onClick: D((e) => S(tt)(f.field, "asc"), ["stop"])
|
|
1423
1427
|
}, null, 8, ["class", "onClick"]), s(S(A), {
|
|
1424
1428
|
name: "caret-down",
|
|
1425
1429
|
style: {
|
|
1426
1430
|
position: "absolute",
|
|
1427
1431
|
top: "-0.2em"
|
|
1428
1432
|
},
|
|
1429
|
-
class: l(["pretextTable-sort-icon", { "pretextTable-sort-icon-active": S(
|
|
1430
|
-
onClick: D((e) => S(
|
|
1433
|
+
class: l(["pretextTable-sort-icon", { "pretextTable-sort-icon-active": S($e) == f.field && S(et) == "desc" }]),
|
|
1434
|
+
onClick: D((e) => S(tt)(f.field, "desc"), ["stop"])
|
|
1431
1435
|
}, null, 8, ["class", "onClick"])])) : r("", !0),
|
|
1432
1436
|
S(q)[m]?.type && !f.children?.length ? (h(), i("span", Te, [s(S(A), {
|
|
1433
1437
|
name: "funnel",
|
|
@@ -1437,7 +1441,7 @@ var ge = (e) => {
|
|
|
1437
1441
|
key: 0,
|
|
1438
1442
|
to: "body"
|
|
1439
1443
|
}, [a("div", {
|
|
1440
|
-
id: S(
|
|
1444
|
+
id: S(rt) + f.field,
|
|
1441
1445
|
class: "pretextTable-filter-popup",
|
|
1442
1446
|
style: u([{
|
|
1443
1447
|
"background-color": "#fff",
|
|
@@ -1451,11 +1455,11 @@ var ge = (e) => {
|
|
|
1451
1455
|
left: S(q)[m].clientX + "px"
|
|
1452
1456
|
}])
|
|
1453
1457
|
}, [
|
|
1454
|
-
a("div",
|
|
1458
|
+
a("div", V, b(f.title), 1),
|
|
1455
1459
|
S(q)[m].type == "inputFilter" ? (h(), i("div", {
|
|
1456
1460
|
key: 0,
|
|
1457
|
-
style: u({ width: S(
|
|
1458
|
-
}, [a("div", null, [s(S(
|
|
1461
|
+
style: u({ width: S(nt) + "px" })
|
|
1462
|
+
}, [a("div", null, [s(S(j), {
|
|
1459
1463
|
modelValue: S(q)[m].value,
|
|
1460
1464
|
"onUpdate:modelValue": (e) => S(q)[m].value = e,
|
|
1461
1465
|
placeholder: "按回车筛选",
|
|
@@ -1466,10 +1470,10 @@ var ge = (e) => {
|
|
|
1466
1470
|
"modelValue",
|
|
1467
1471
|
"onUpdate:modelValue",
|
|
1468
1472
|
"onKeyup"
|
|
1469
|
-
])]), a("div", De, [s(S(
|
|
1473
|
+
])]), a("div", De, [s(S(M), {
|
|
1470
1474
|
modelValue: S(q)[m].inputFilter.type,
|
|
1471
1475
|
"onUpdate:modelValue": (e) => S(q)[m].inputFilter.type = e,
|
|
1472
|
-
options: S(
|
|
1476
|
+
options: S(it)
|
|
1473
1477
|
}, null, 8, [
|
|
1474
1478
|
"modelValue",
|
|
1475
1479
|
"onUpdate:modelValue",
|
|
@@ -1477,16 +1481,16 @@ var ge = (e) => {
|
|
|
1477
1481
|
])])], 4)) : r("", !0),
|
|
1478
1482
|
S(q)[m].type == "numberFilter" || S(q)[m].type == "numberFilter%" ? (h(), i("div", {
|
|
1479
1483
|
key: 1,
|
|
1480
|
-
style: u({ width: S(
|
|
1481
|
-
}, [a("div", Oe, [s(S(
|
|
1484
|
+
style: u({ width: S(nt) + "px" })
|
|
1485
|
+
}, [a("div", Oe, [s(S(M), {
|
|
1482
1486
|
modelValue: S(q)[m].numberFilter.type,
|
|
1483
1487
|
"onUpdate:modelValue": (e) => S(q)[m].numberFilter.type = e,
|
|
1484
|
-
options: S(
|
|
1488
|
+
options: S(at)
|
|
1485
1489
|
}, null, 8, [
|
|
1486
1490
|
"modelValue",
|
|
1487
1491
|
"onUpdate:modelValue",
|
|
1488
1492
|
"options"
|
|
1489
|
-
])]), a("div", null, [s(S(
|
|
1493
|
+
])]), a("div", null, [s(S(re), {
|
|
1490
1494
|
modelValue: S(q)[m].value,
|
|
1491
1495
|
"onUpdate:modelValue": (e) => S(q)[m].value = e,
|
|
1492
1496
|
placeholder: "按回车筛选",
|
|
@@ -1503,12 +1507,12 @@ var ge = (e) => {
|
|
|
1503
1507
|
])])], 4)) : r("", !0),
|
|
1504
1508
|
S(q)[m].type == "listFilter" ? (h(), i("div", {
|
|
1505
1509
|
key: 2,
|
|
1506
|
-
style: u({ maxWidth: S(
|
|
1510
|
+
style: u({ maxWidth: S(nt) + "px" })
|
|
1507
1511
|
}, [a("div", ke, [s(S(k), {
|
|
1508
1512
|
modelValue: S(q)[m].listFilter.selectedValue.length == S(q)[m].listFilter.listOptions.length,
|
|
1509
1513
|
indeterminate: S(q)[m].listFilter.selectedValue.length > 0 && S(q)[m].listFilter.selectedValue.length < S(q)[m].listFilter.listOptions.length,
|
|
1510
1514
|
content: "全部",
|
|
1511
|
-
onChange: (e) => S(
|
|
1515
|
+
onChange: (e) => S(ct)(S(q)[m])
|
|
1512
1516
|
}, null, 8, [
|
|
1513
1517
|
"modelValue",
|
|
1514
1518
|
"indeterminate",
|
|
@@ -1538,7 +1542,7 @@ var ge = (e) => {
|
|
|
1538
1542
|
type: "primary",
|
|
1539
1543
|
size: "small",
|
|
1540
1544
|
mode: "text",
|
|
1541
|
-
onClick: (e) => S(
|
|
1545
|
+
onClick: (e) => S(st)(f.field)
|
|
1542
1546
|
}, {
|
|
1543
1547
|
default: T(() => [...d[5] ||= [o(" 重置 ", -1)]]),
|
|
1544
1548
|
_: 1
|
|
@@ -1547,14 +1551,14 @@ var ge = (e) => {
|
|
|
1547
1551
|
type: "primary",
|
|
1548
1552
|
size: "small",
|
|
1549
1553
|
mode: "text",
|
|
1550
|
-
onClick: d[0] ||= (e) => S(
|
|
1554
|
+
onClick: d[0] ||= (e) => S(st)()
|
|
1551
1555
|
}, {
|
|
1552
1556
|
default: T(() => [...d[6] ||= [o(" 重置所有 ", -1)]]),
|
|
1553
1557
|
_: 1
|
|
1554
1558
|
})
|
|
1555
1559
|
])
|
|
1556
|
-
], 12,
|
|
1557
|
-
])) : (h(), i("span",
|
|
1560
|
+
], 12, Ee)])) : r("", !0)])) : r("", !0)
|
|
1561
|
+
])) : (h(), i("span", z)), f?.resizable && !f.children?.length ? (h(), i("div", {
|
|
1558
1562
|
key: 4,
|
|
1559
1563
|
style: {
|
|
1560
1564
|
position: "absolute",
|
|
@@ -1564,16 +1568,16 @@ var ge = (e) => {
|
|
|
1564
1568
|
height: "100%",
|
|
1565
1569
|
cursor: "col-resize"
|
|
1566
1570
|
},
|
|
1567
|
-
onMousedown: D((e) => S(
|
|
1568
|
-
}, null, 40,
|
|
1569
|
-
S(
|
|
1571
|
+
onMousedown: D((e) => S(dt)(e, f), ["prevent", "stop"])
|
|
1572
|
+
}, null, 40, je)) : r("", !0)], 14, xe))), 128))], 64))), 128))], 4),
|
|
1573
|
+
S(P).length == 0 ? (h(), i("div", {
|
|
1570
1574
|
key: 0,
|
|
1571
1575
|
style: u([{
|
|
1572
1576
|
display: "flex",
|
|
1573
1577
|
"align-items": "center",
|
|
1574
1578
|
position: "absolute",
|
|
1575
1579
|
left: "calc(50% - 35px)"
|
|
1576
|
-
}, { minHeight: `${S($) - S(
|
|
1580
|
+
}, { minHeight: `${S($) - S(N) - S(ye) - 30}px` }])
|
|
1577
1581
|
}, " 暂无数据 ", 4)) : r("", !0),
|
|
1578
1582
|
a("div", {
|
|
1579
1583
|
class: "pretextTable-grid",
|
|
@@ -1584,13 +1588,13 @@ var ge = (e) => {
|
|
|
1584
1588
|
contain: "layout paint style",
|
|
1585
1589
|
position: "relative"
|
|
1586
1590
|
}, {
|
|
1587
|
-
minHeight: S($) - S(
|
|
1591
|
+
minHeight: S($) - S(N) - S(ye) - S(ge) - p.heightOffset + "px",
|
|
1588
1592
|
height: `${S(me)}px`
|
|
1589
1593
|
}])
|
|
1590
1594
|
}, [a("div", {
|
|
1591
1595
|
class: "pretextTable-grid-empty",
|
|
1592
|
-
style: u({ height: `${S(
|
|
1593
|
-
}, null, 4), (h(!0), i(e, null, _(S(
|
|
1596
|
+
style: u({ height: `${S(oe)}px` })
|
|
1597
|
+
}, null, 4), (h(!0), i(e, null, _(S(P), (t, d) => (h(), i(e, { key: t[S(m).id] }, [p.expandConfig?.isExpand && t[S(m).isExpandRow] ? (h(), i("div", {
|
|
1594
1598
|
key: 0,
|
|
1595
1599
|
class: "pretextTable-grid-item",
|
|
1596
1600
|
style: u([{
|
|
@@ -1600,7 +1604,7 @@ var ge = (e) => {
|
|
|
1600
1604
|
}, [a("div", { style: u({
|
|
1601
1605
|
position: "sticky",
|
|
1602
1606
|
left: p.expandConfig?.mode == "inside" ? "0px" : void 0,
|
|
1603
|
-
width: p.expandConfig?.mode == "inside" ? `${S(
|
|
1607
|
+
width: p.expandConfig?.mode == "inside" ? `${S(gt) - 15}px` : "100%"
|
|
1604
1608
|
}) }, [v(c.$slots, p.expandConfig?.slotName, {
|
|
1605
1609
|
row: t,
|
|
1606
1610
|
rowIndex: d
|
|
@@ -1613,11 +1617,11 @@ var ge = (e) => {
|
|
|
1613
1617
|
"align-content": "start",
|
|
1614
1618
|
contain: "layout style paint"
|
|
1615
1619
|
}, { gridTemplateColumns: S(F) }])
|
|
1616
|
-
}, [(h(!0), i(e, null, _(S(
|
|
1620
|
+
}, [(h(!0), i(e, null, _(S(le), (f, g) => (h(), i("div", {
|
|
1617
1621
|
key: "item_" + f.field,
|
|
1618
1622
|
class: l(["pretextTable-grid-item pretextTable-flex-align-items-center", {
|
|
1619
|
-
"pretextTable-grid-item-hover": p.rowConfig?.isHover && S(
|
|
1620
|
-
"pretextTable-grid-item-current": p.rowConfig?.isCurrent && S(
|
|
1623
|
+
"pretextTable-grid-item-hover": p.rowConfig?.isHover && S(We)[S(m).id] == t[S(m).id],
|
|
1624
|
+
"pretextTable-grid-item-current": p.rowConfig?.isCurrent && S(Be)[S(m).id] == t[S(m).id],
|
|
1621
1625
|
"pretextTable-grid-item-stripe": p.stripe && t[S(m).stripe]
|
|
1622
1626
|
}]),
|
|
1623
1627
|
style: u({
|
|
@@ -1628,16 +1632,27 @@ var ge = (e) => {
|
|
|
1628
1632
|
left: f.fixed == "left" ? S(G)[g] : "",
|
|
1629
1633
|
right: f.fixed == "right" ? S(K)[g] : "",
|
|
1630
1634
|
borderLeft: f.fixed == "right" ? "1px solid var(--pretextTable-border-color)" : "",
|
|
1631
|
-
boxShadow: f.fixed == "left" && g == S(W) ? "var(--pretextTable-shadow-color) 2px 0px 5px -1px" : f.fixed == "right" && g == S(
|
|
1635
|
+
boxShadow: f.fixed == "left" && g == S(W) ? "var(--pretextTable-shadow-color) 2px 0px 5px -1px" : f.fixed == "right" && g == S(ze) ? "var(--pretextTable-shadow-color) -2px 0px 5px -1px" : "",
|
|
1632
1636
|
height: `${t[S(m).height]}px`,
|
|
1633
|
-
justifyContent: f.type == "checkbox" ? "center" : ""
|
|
1637
|
+
justifyContent: f.type == "checkbox" || f.slots?.defaultType == "checkbox" ? "center" : ""
|
|
1634
1638
|
}),
|
|
1635
|
-
onClick: (e) => S(
|
|
1636
|
-
onMouseenter: (e) => S(
|
|
1637
|
-
}, [f.fixed == "left" || f.fixed == "right" || g >= S(
|
|
1638
|
-
|
|
1639
|
+
onClick: (e) => S(He)(t, f),
|
|
1640
|
+
onMouseenter: (e) => S(Ge)(t)
|
|
1641
|
+
}, [f.fixed == "left" || f.fixed == "right" || g >= S(se) && g <= S(ce) ? (h(), i("div", {
|
|
1642
|
+
key: 0,
|
|
1643
|
+
class: l([
|
|
1644
|
+
"pretextTable-grid-cell",
|
|
1645
|
+
"pretextTable-grid-cell" + f.field,
|
|
1646
|
+
f.cellClassName ? S(Ke)({
|
|
1647
|
+
column: f,
|
|
1648
|
+
row: t,
|
|
1649
|
+
index: g
|
|
1650
|
+
}) : ""
|
|
1651
|
+
])
|
|
1652
|
+
}, [p.treeConfig?.isOpenTree && f.treeNode ? (h(), i(e, { key: 0 }, [a("span", { style: u({
|
|
1653
|
+
marginLeft: (Number(t[S(m).level]) - 1) * (p.treeConfig?.indent || S(pt).indent) + "px",
|
|
1639
1654
|
paddingLeft: S(U).paddingLeft
|
|
1640
|
-
}) }, null, 4), p.treeConfig?.showIcon === !1 ? r("", !0) : (h(), i(e, { key: 0 }, [t[p.treeConfig?.childrenField || S(
|
|
1655
|
+
}) }, null, 4), p.treeConfig?.showIcon === !1 ? r("", !0) : (h(), i(e, { key: 0 }, [t[p.treeConfig?.childrenField || S(pt).childrenField]?.length > 0 || p.treeConfig?.lazy && t[p.treeConfig?.hasChildField || S(pt).hasChildField] ? (h(), i(e, { key: 0 }, [
|
|
1641
1656
|
E(s(S(A), {
|
|
1642
1657
|
name: "spinner",
|
|
1643
1658
|
roll: ""
|
|
@@ -1646,19 +1661,19 @@ var ge = (e) => {
|
|
|
1646
1661
|
name: "caret-right",
|
|
1647
1662
|
style: {},
|
|
1648
1663
|
class: "pretextTable-icon",
|
|
1649
|
-
onClick: D((e) => S(
|
|
1664
|
+
onClick: D((e) => S(X)([t], !0), ["stop"])
|
|
1650
1665
|
}, null, 8, ["onClick"]), [[C, !t[S(m).isCollapsed] && !t[S(m).lazyLoading]]]),
|
|
1651
1666
|
E(s(S(A), {
|
|
1652
1667
|
name: "caret-down",
|
|
1653
1668
|
style: {},
|
|
1654
1669
|
class: "pretextTable-icon",
|
|
1655
|
-
onClick: D((e) => S(
|
|
1670
|
+
onClick: D((e) => S(X)([t], !1), ["stop"])
|
|
1656
1671
|
}, null, 8, ["onClick"]), [[C, t[S(m).isCollapsed] && !t[S(m).lazyLoading]]])
|
|
1657
1672
|
], 64)) : r("", !0)], 64))], 64)) : r("", !0), f.type == "checkbox" ? (h(), n(S(k), {
|
|
1658
1673
|
key: 1,
|
|
1659
1674
|
modelValue: t[f.field],
|
|
1660
1675
|
indeterminate: t[S(m).checkedIndeterminate + f.field],
|
|
1661
|
-
onChange: (e) => S(
|
|
1676
|
+
onChange: (e) => S(Xe)(t, f.field)
|
|
1662
1677
|
}, null, 8, [
|
|
1663
1678
|
"modelValue",
|
|
1664
1679
|
"indeterminate",
|
|
@@ -1673,19 +1688,19 @@ var ge = (e) => {
|
|
|
1673
1688
|
name: "arrow-right",
|
|
1674
1689
|
style: {},
|
|
1675
1690
|
class: "pretextTable-icon",
|
|
1676
|
-
onClick: D((e) => S(
|
|
1691
|
+
onClick: D((e) => S(Q)([t], !0), ["stop"])
|
|
1677
1692
|
}, null, 8, ["onClick"]), [[C, !t[S(m).isRowExpanded]]]), E(s(S(A), {
|
|
1678
1693
|
name: "arrow-down",
|
|
1679
1694
|
style: {},
|
|
1680
1695
|
class: "pretextTable-icon",
|
|
1681
|
-
onClick: D((e) => S(
|
|
1696
|
+
onClick: D((e) => S(Q)([t], !1), ["stop"])
|
|
1682
1697
|
}, null, 8, ["onClick"]), [[C, t[S(m).isRowExpanded]]])])) : f.slots?.defaultType == "a" ? (h(), i("span", {
|
|
1683
1698
|
key: 4,
|
|
1684
1699
|
style: u({ paddingLeft: S(U).paddingLeft })
|
|
1685
|
-
}, [a("a",
|
|
1700
|
+
}, [a("a", { onClick: D((e) => f.slots?.defaultProps?.a?.onClick?.(t, g), ["stop"]) }, b(t[f.field] || ""), 9, Ne)], 4)) : f.slots?.defaultType == "tag" ? (h(), i("span", {
|
|
1686
1701
|
key: 5,
|
|
1687
1702
|
style: u({ paddingLeft: S(U).paddingLeft })
|
|
1688
|
-
}, [(h(!0), i(e, null, _(f.slots?.defaultProps?.tag?.options || [], (a) => (h(), i(e, null, [a.value == t[f.field] ? (h(), n(S(
|
|
1703
|
+
}, [(h(!0), i(e, null, _(f.slots?.defaultProps?.tag?.options || [], (a) => (h(), i(e, null, [a.value == t[f.field] ? (h(), n(S(ae), {
|
|
1689
1704
|
key: 0,
|
|
1690
1705
|
size: "mini",
|
|
1691
1706
|
border: !0,
|
|
@@ -1708,7 +1723,7 @@ var ge = (e) => {
|
|
|
1708
1723
|
}, null, 8, ["name", "style"]), [[C, t[f.field]]])], 4)) : f.slots?.defaultType == "buttons" ? (h(), i("span", {
|
|
1709
1724
|
key: 7,
|
|
1710
1725
|
style: u({ paddingLeft: S(U).paddingLeft })
|
|
1711
|
-
}, [f.slots?.defaultProps?.buttons?.options?.length ? (h(!0), i(e, { key: 0 }, _(f.slots?.defaultProps?.buttons?.options || [], (n) => (h(), i("div",
|
|
1726
|
+
}, [f.slots?.defaultProps?.buttons?.options?.length ? (h(!0), i(e, { key: 0 }, _(f.slots?.defaultProps?.buttons?.options || [], (n) => (h(), i("div", Pe, [(h(!0), i(e, null, _(n, (n) => (h(), i(e, null, [!n.showField || t[n.showField] ? (h(), i("span", {
|
|
1712
1727
|
key: 0,
|
|
1713
1728
|
title: n.tip || ""
|
|
1714
1729
|
}, [s(S(O), {
|
|
@@ -1730,10 +1745,10 @@ var ge = (e) => {
|
|
|
1730
1745
|
"disabled",
|
|
1731
1746
|
"loading",
|
|
1732
1747
|
"onClick"
|
|
1733
|
-
])], 8,
|
|
1748
|
+
])], 8, Fe)) : r("", !0)], 64))), 256))]))), 256)) : r("", !0)], 4)) : f.slots?.defaultType == "switch" ? (h(), i("span", {
|
|
1734
1749
|
key: 8,
|
|
1735
1750
|
style: u({ paddingLeft: S(U).paddingLeft })
|
|
1736
|
-
}, [!f.slots?.defaultProps?.switch?.showField || t[f.slots?.defaultProps?.switch?.showField] ? (h(), n(S(
|
|
1751
|
+
}, [!f.slots?.defaultProps?.switch?.showField || t[f.slots?.defaultProps?.switch?.showField] ? (h(), n(S(ie), {
|
|
1737
1752
|
key: 0,
|
|
1738
1753
|
size: "mini",
|
|
1739
1754
|
modelValue: t[f.field],
|
|
@@ -1751,7 +1766,7 @@ var ge = (e) => {
|
|
|
1751
1766
|
"closeValue",
|
|
1752
1767
|
"disabled",
|
|
1753
1768
|
"onChange"
|
|
1754
|
-
])) : r("", !0)], 4)) : f.slots?.defaultType == "checkbox" ? (h(), i("span",
|
|
1769
|
+
])) : r("", !0)], 4)) : f.slots?.defaultType == "checkbox" ? (h(), i("span", Ie, [s(S(k), {
|
|
1755
1770
|
modelValue: t[f.field],
|
|
1756
1771
|
indeterminate: f.slots?.defaultProps?.checkbox?.checkedIndeterminateField ? t[f.slots?.defaultProps?.checkbox?.checkedIndeterminateField] : !1,
|
|
1757
1772
|
disabled: f.slots?.defaultProps?.checkbox?.disabledField && t[f.slots?.defaultProps?.checkbox?.disabledField],
|
|
@@ -1766,13 +1781,13 @@ var ge = (e) => {
|
|
|
1766
1781
|
class: l({ "pretextTable-text-ellipsis": !!p.showOverflow }),
|
|
1767
1782
|
style: u({ paddingLeft: S(U).paddingLeft }),
|
|
1768
1783
|
title: p.showOverflow && t[f.field] || ""
|
|
1769
|
-
}, [f.slots?.default ? (h(), i(e, { key: 0 }, [!p.lazyLoadSlot || t.slotShowTimestamp == S(
|
|
1784
|
+
}, [f.slots?.default ? (h(), i(e, { key: 0 }, [!p.lazyLoadSlot || t.slotShowTimestamp == S(mt) ? v(c.$slots, f.slots?.default, {
|
|
1770
1785
|
key: 0,
|
|
1771
1786
|
row: t,
|
|
1772
1787
|
column: f,
|
|
1773
1788
|
rowIndex: d
|
|
1774
|
-
}, () => [o(b(t[f.field] ?? ""), 1)]) : r("", !0)], 64)) : (h(), i(e, { key: 1 }, [o(b(t[f.field] ?? ""), 1)], 64))], 14,
|
|
1775
|
-
p.showFooter && S(
|
|
1789
|
+
}, () => [o(b(t[f.field] ?? ""), 1)]) : r("", !0)], 64)) : (h(), i(e, { key: 1 }, [o(b(t[f.field] ?? ""), 1)], 64))], 14, Le))], 2)) : r("", !0)], 46, H))), 128))], 4))], 64))), 128))], 4),
|
|
1790
|
+
p.showFooter && S(L).length > 0 ? (h(), i("div", {
|
|
1776
1791
|
key: 1,
|
|
1777
1792
|
style: u([{
|
|
1778
1793
|
display: "grid",
|
|
@@ -1784,16 +1799,16 @@ var ge = (e) => {
|
|
|
1784
1799
|
bottom: "0",
|
|
1785
1800
|
"z-index": "1"
|
|
1786
1801
|
}, { gridTemplateColumns: S(F) }])
|
|
1787
|
-
}, [(h(!0), i(e, null, _(S(
|
|
1802
|
+
}, [(h(!0), i(e, null, _(S(L), (t) => (h(), i(e, null, [(h(!0), i(e, null, _(t, (e, t) => (h(), i("div", {
|
|
1788
1803
|
key: "footer_" + e.field,
|
|
1789
|
-
class: "pretextTable-grid-footer",
|
|
1804
|
+
class: l(["pretextTable-grid-footer", "pretextTable-grid-footer" + e.field]),
|
|
1790
1805
|
style: u({
|
|
1791
|
-
fontSize: S(
|
|
1806
|
+
fontSize: S(he).fontSize,
|
|
1792
1807
|
zIndex: t == 0 ? 3 : e.fixed == "left" || e.fixed == "right" ? 2 : 1,
|
|
1793
1808
|
left: e.fixed == "left" ? S(G)[t] : "",
|
|
1794
1809
|
right: e.fixed == "right" ? S(K)[t] : "",
|
|
1795
1810
|
borderLeft: e.fixed == "right" ? "1px solid var(--pretextTable-border-color)" : "",
|
|
1796
|
-
boxShadow: e.fixed == "left" && t == S(W) ? "var(--pretextTable-shadow-color) 2px 0px 5px -1px" : e.fixed == "right" && t == S(
|
|
1811
|
+
boxShadow: e.fixed == "left" && t == S(W) ? "var(--pretextTable-shadow-color) 2px 0px 5px -1px" : e.fixed == "right" && t == S(ze) ? "var(--pretextTable-shadow-color) -2px 0px 5px -1px" : "",
|
|
1797
1812
|
height: `${e.height}px`,
|
|
1798
1813
|
maxHeight: `${e.height}px`
|
|
1799
1814
|
})
|
|
@@ -1802,7 +1817,7 @@ var ge = (e) => {
|
|
|
1802
1817
|
footerColumn: e,
|
|
1803
1818
|
footerData: e.data,
|
|
1804
1819
|
footerRowIndex: t
|
|
1805
|
-
}, () => [o(b(e.data ?? ""), 1)]) : (h(), i("span",
|
|
1820
|
+
}, () => [o(b(e.data ?? ""), 1)]) : (h(), i("span", Re, b(e.data ?? ""), 1))], 6))), 128))], 64))), 256))], 4)) : r("", !0)
|
|
1806
1821
|
], 36),
|
|
1807
1822
|
E(a("div", { style: u([{
|
|
1808
1823
|
position: "absolute",
|
|
@@ -1813,10 +1828,10 @@ var ge = (e) => {
|
|
|
1813
1828
|
"z-index": "99999",
|
|
1814
1829
|
"box-shadow": "0 0 2px rgba(64, 158, 255, 0.5)"
|
|
1815
1830
|
}, {
|
|
1816
|
-
transform: `translateX(${S(
|
|
1831
|
+
transform: `translateX(${S(ut)}px)`,
|
|
1817
1832
|
height: S($) + "px"
|
|
1818
|
-
}]) }, null, 4), [[C, S(
|
|
1819
|
-
a("div", { style: u({ backgroundColor: S(
|
|
1833
|
+
}]) }, null, 4), [[C, S(lt)]]),
|
|
1834
|
+
a("div", { style: u({ backgroundColor: S(ht) ? "red" : "" }) }, null, 4)
|
|
1820
1835
|
], 512));
|
|
1821
1836
|
}
|
|
1822
1837
|
}), W = U;
|