holyes-table 1.0.9 → 1.0.11
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 +9 -3
- package/dist/index.mjs +742 -642
- package/dist/lib/pretextTable/config.d.ts +12 -0
- package/dist/lib/pretextTable/hook/useCheckbox.d.ts +12 -5
- package/dist/lib/pretextTable/hook/useExpand.d.ts +1 -2
- package/dist/lib/pretextTable/hook/useFilter.d.ts +1 -3
- package/dist/lib/pretextTable/hook/useSort.d.ts +1 -2
- package/dist/lib/pretextTable/hook/useTree.d.ts +2 -14
- package/dist/lib/pretextTable/pretextTable.vue.d.ts +1 -1
- package/dist/lib/pretextTable/type.d.ts +7 -1
- package/dist/lib/pretextTable/useHolyesTable.d.ts +6 -17
- package/package.json +4 -2
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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
|
|
2
|
-
import { VxeButton as
|
|
3
|
-
import
|
|
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 te, VxeCheckboxGroup as ne, VxeIcon as k, VxeInput as re, VxeLoading as ie, VxeNumberInput as A, VxeRadioGroup as ae, VxeSwitch as oe, VxeTag as se } from "vxe-pc-ui";
|
|
3
|
+
import j, { debounce as ce, isNaN as M, orderBy as le, toArrayTree as ue } from "xe-utils";
|
|
4
4
|
//#region lib/pretextTable/worker/pretextTableGetItemHeight.ts?worker&inline
|
|
5
|
-
var
|
|
5
|
+
var N = "(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);return Math.ceil(r/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()}})();", P = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", N], { type: "text/javascript;charset=utf-8" });
|
|
6
6
|
function de(e) {
|
|
7
7
|
let t;
|
|
8
8
|
try {
|
|
@@ -12,7 +12,7 @@ function de(e) {
|
|
|
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(N), { name: e?.name });
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
@@ -93,109 +93,212 @@ var pe = (e) => {
|
|
|
93
93
|
a.value = o, t.value = s, n.value = c, r.value = l, i.value = u;
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
+
}, F = {
|
|
97
|
+
id: "pretextId",
|
|
98
|
+
seq: "pretextSeq",
|
|
99
|
+
stripe: "pretextStripe",
|
|
100
|
+
height: "pretextHeight",
|
|
101
|
+
isCollapsed: "pretextIsCollapsed",
|
|
102
|
+
level: "pretextLevel",
|
|
103
|
+
lazyLoading: "pretextLazyLoading",
|
|
104
|
+
index: "pretextIndex",
|
|
105
|
+
filterChildren: "pretextFilterChildren",
|
|
106
|
+
isRowExpanded: "pretextIsRowExpanded",
|
|
107
|
+
isExpandRow: "pretextIsExpandRow",
|
|
108
|
+
expandChildren: "pretextExpandChildren",
|
|
109
|
+
parentRow: "pretextParentRow",
|
|
110
|
+
checkedIndeterminate: "pretextCheckedIndeterminate_"
|
|
111
|
+
}, I = {
|
|
112
|
+
isOpenTree: !1,
|
|
113
|
+
transform: !0,
|
|
114
|
+
idField: "",
|
|
115
|
+
parentField: "parentId",
|
|
116
|
+
childrenField: "children",
|
|
117
|
+
indent: 20,
|
|
118
|
+
trigger: "default",
|
|
119
|
+
lazy: !1,
|
|
120
|
+
hasChildField: "hasChild",
|
|
121
|
+
showIcon: !0,
|
|
122
|
+
checkStrictly: !0
|
|
96
123
|
};
|
|
97
124
|
//#endregion
|
|
98
125
|
//#region lib/pretextTable/hook/useCheckbox.ts
|
|
99
126
|
function me(e) {
|
|
100
|
-
let { columns: t, blurAnyElement: n, nowDataSource: r, baseDataSource: i, emits: a } = e, o = "checkbox",
|
|
101
|
-
|
|
102
|
-
|
|
127
|
+
let { columns: t, blurAnyElement: n, nowDataSource: r, baseDataSource: i, emits: a, treeConfig: o } = e, s = o?.isOpenTree ?? I.isOpenTree, c = F.filterChildren, l = o?.childrenField ?? I.childrenField, u = o?.checkStrictly ?? I.checkStrictly, d = "checkbox", f = [], p = () => {
|
|
128
|
+
f = [];
|
|
129
|
+
for (let e of t.value) e.type == "checkbox" && (f.push(e.field), d = e.field);
|
|
130
|
+
return f;
|
|
131
|
+
}, m = g({}), h = g({}), _ = (e) => {
|
|
103
132
|
switch (n(), !0) {
|
|
104
|
-
case
|
|
105
|
-
case !
|
|
106
|
-
|
|
107
|
-
for (let e of r.value) e[o] = !0;
|
|
133
|
+
case h.value[e] == 1:
|
|
134
|
+
case !m.value[e]:
|
|
135
|
+
m.value[e] = !0, h.value[e] = !1, u ? b(r.value, !0, e) : x(r.value, !0, e);
|
|
108
136
|
break;
|
|
109
137
|
default:
|
|
110
|
-
|
|
111
|
-
for (let e of r.value) e[o] = !1;
|
|
138
|
+
m.value[e] = !1, h.value[e] = !1, u ? b(r.value, !1, e) : x(r.value, !1, e);
|
|
112
139
|
break;
|
|
113
140
|
}
|
|
114
141
|
a("checkboxAll");
|
|
115
|
-
},
|
|
116
|
-
let
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
142
|
+
}, v = (e) => {
|
|
143
|
+
let t = {}, n = [];
|
|
144
|
+
if (e ? n.push(e) : n = p(), u) {
|
|
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
|
+
for (let e of n) {
|
|
147
|
+
let n = t[e + "checkedCount"] || 0, i = t[e + "indeterminateCount"] || 0;
|
|
148
|
+
switch (!0) {
|
|
149
|
+
case n == 0 && i == 0:
|
|
150
|
+
h.value[e] = !1, m.value[e] = !1;
|
|
151
|
+
break;
|
|
152
|
+
case n == r.value.length && i == 0:
|
|
153
|
+
h.value[e] = !1, m.value[e] = !0;
|
|
154
|
+
break;
|
|
155
|
+
default:
|
|
156
|
+
h.value[e] = !0, m.value[e] = !1;
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
} else {
|
|
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?.[c]?.length) for (let t of n[c]) e(t, r);
|
|
163
|
+
else if (n?.[l]?.length) for (let t of n[l]) e(t, r);
|
|
164
|
+
};
|
|
165
|
+
for (let t of r.value) for (let r of n) e(t, r);
|
|
166
|
+
for (let e of n) {
|
|
167
|
+
let n = t[e + "checkedCount"] || 0, r = t[e + "allCount"] || 0;
|
|
168
|
+
switch (!0) {
|
|
169
|
+
case n == 0:
|
|
170
|
+
h.value[e] = !1, m.value[e] = !1;
|
|
171
|
+
break;
|
|
172
|
+
case n == r:
|
|
173
|
+
h.value[e] = !1, m.value[e] = !0;
|
|
174
|
+
break;
|
|
175
|
+
default:
|
|
176
|
+
h.value[e] = !0, m.value[e] = !1;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
129
180
|
}
|
|
181
|
+
}, y = (e, t) => {
|
|
182
|
+
if (!s || !u) return;
|
|
183
|
+
let n = t ?? f[0];
|
|
184
|
+
if (!e) return;
|
|
185
|
+
let r = e?.[F.parentRow], i = [];
|
|
186
|
+
e?.[c]?.length ? i = e[c] : e?.[l]?.length && (i = e[l]);
|
|
187
|
+
let a = 0, o = 0;
|
|
188
|
+
if (i.length) {
|
|
189
|
+
for (let e of i) e[n] && a++, e[F.checkedIndeterminate + n] && o++;
|
|
190
|
+
switch (!0) {
|
|
191
|
+
case a == 0 && o == 0:
|
|
192
|
+
e[n] = !1, e[F.checkedIndeterminate + n] = !1;
|
|
193
|
+
break;
|
|
194
|
+
case a == i.length && o == 0:
|
|
195
|
+
e[n] = !0, e[F.checkedIndeterminate + n] = !1;
|
|
196
|
+
break;
|
|
197
|
+
default:
|
|
198
|
+
e[n] = !1, e[F.checkedIndeterminate + n] = !0;
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
y(r, n);
|
|
203
|
+
}, b = (e, t, n) => {
|
|
204
|
+
let r = n ?? f[0];
|
|
205
|
+
for (let n of e) n[r] = t, n[F.checkedIndeterminate + r] = !1, s && u && (n[c]?.length ? b(n[c], t, r) : n[l]?.length && b(n[l], 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, s && (n[c]?.length ? x(n[c], t, r) : n[l]?.length && x(n[l], t, r));
|
|
130
209
|
};
|
|
131
210
|
return {
|
|
132
|
-
getCheckField:
|
|
133
|
-
headerChecked:
|
|
134
|
-
headerCheckedIndeterminate:
|
|
135
|
-
onHeaderChecked:
|
|
136
|
-
|
|
137
|
-
|
|
211
|
+
getCheckField: p,
|
|
212
|
+
headerChecked: m,
|
|
213
|
+
headerCheckedIndeterminate: h,
|
|
214
|
+
onHeaderChecked: _,
|
|
215
|
+
upDataHeaderChecked: v,
|
|
216
|
+
upDataAllRowCheckedDeep: () => {
|
|
217
|
+
if (u) {
|
|
218
|
+
let e = /* @__PURE__ */ new Map(), t = (n) => {
|
|
219
|
+
let r = [];
|
|
220
|
+
if (n?.[c]?.length ? r = n[c] : n?.[l]?.length && (r = n[l]), r.length) for (let e of r) t(e);
|
|
221
|
+
else {
|
|
222
|
+
let t = n?.[F.parentRow];
|
|
223
|
+
t && e.set(t[F.id], t);
|
|
224
|
+
}
|
|
225
|
+
}, n = r.value;
|
|
226
|
+
for (let e of n) t(e);
|
|
227
|
+
e.forEach((e) => {
|
|
228
|
+
for (let t of f) y(e, t);
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
v(void 0);
|
|
232
|
+
},
|
|
233
|
+
onCellChecked: (t, n) => {
|
|
234
|
+
e.blurAnyElement();
|
|
235
|
+
let r = n ?? f[0];
|
|
236
|
+
t[r] ? b([t], !1, r) : b([t], !0, r), y(t, r), v(r), a("checkboxChange", {
|
|
237
|
+
row: t,
|
|
238
|
+
checked: t[r],
|
|
239
|
+
field: r
|
|
240
|
+
});
|
|
138
241
|
},
|
|
139
242
|
getCheckboxRecords: (e) => {
|
|
140
243
|
let t = [];
|
|
141
|
-
return t = e ? i.value : r.value, t.filter((e) => e[
|
|
244
|
+
return t = e ? i.value : r.value, t.filter((e) => e[d]);
|
|
142
245
|
},
|
|
143
246
|
clearCheckboxRowInit: () => {
|
|
144
|
-
|
|
247
|
+
m.value = {}, h.value = {};
|
|
145
248
|
}
|
|
146
249
|
};
|
|
147
250
|
}
|
|
148
251
|
//#endregion
|
|
149
252
|
//#region lib/pretextTable/hook/useSort.ts
|
|
150
253
|
function he(e) {
|
|
151
|
-
let {
|
|
254
|
+
let { nowDataSource: t, getVisibleData: n, setNowDataSource: r, treeConfig: i, defaultTreeConfig: a } = e, o = g(""), s = g(null), c = (e, t) => {
|
|
152
255
|
if (t === "auto") switch (!0) {
|
|
153
|
-
case e !==
|
|
154
|
-
case
|
|
155
|
-
|
|
256
|
+
case e !== o.value:
|
|
257
|
+
case s.value === null:
|
|
258
|
+
s.value = "asc", o.value = e;
|
|
156
259
|
break;
|
|
157
|
-
case
|
|
158
|
-
|
|
260
|
+
case s.value === "asc":
|
|
261
|
+
s.value = "desc", o.value = e;
|
|
159
262
|
break;
|
|
160
|
-
case
|
|
161
|
-
|
|
263
|
+
case s.value === "desc":
|
|
264
|
+
s.value = null, o.value = "";
|
|
162
265
|
break;
|
|
163
266
|
default:
|
|
164
|
-
|
|
267
|
+
s.value = "asc", o.value = e;
|
|
165
268
|
break;
|
|
166
269
|
}
|
|
167
|
-
else t ===
|
|
168
|
-
|
|
169
|
-
},
|
|
170
|
-
let r =
|
|
171
|
-
if (
|
|
172
|
-
let e =
|
|
270
|
+
else t === s.value && e === o.value ? (s.value = null, o.value = "") : (s.value = t, o.value = e);
|
|
271
|
+
u();
|
|
272
|
+
}, l = (e, t, n) => {
|
|
273
|
+
let r = le(e, [[(e) => M(Number(e[t])) ? e[t] || "" : Number(e[t]), n]]);
|
|
274
|
+
if (i?.isOpenTree) {
|
|
275
|
+
let e = i?.childrenField || a?.childrenField;
|
|
173
276
|
for (let i of r) {
|
|
174
277
|
let r = i[e] || [];
|
|
175
|
-
r?.length && (i[e] =
|
|
278
|
+
r?.length && (i[e] = l(r, t, n));
|
|
176
279
|
}
|
|
177
280
|
}
|
|
178
281
|
return r;
|
|
179
|
-
},
|
|
180
|
-
|
|
282
|
+
}, u = () => {
|
|
283
|
+
s.value === null ? r(l(t.value, F.index, "asc")) : r(l(t.value, o.value, s.value)), n();
|
|
181
284
|
};
|
|
182
285
|
return {
|
|
183
|
-
sortField:
|
|
184
|
-
sortOrder:
|
|
185
|
-
sort:
|
|
186
|
-
handleSort:
|
|
286
|
+
sortField: o,
|
|
287
|
+
sortOrder: s,
|
|
288
|
+
sort: c,
|
|
289
|
+
handleSort: u
|
|
187
290
|
};
|
|
188
291
|
}
|
|
189
292
|
//#endregion
|
|
190
293
|
//#region lib/pretextTable/hook/useFilter.ts
|
|
191
294
|
function ge(e) {
|
|
192
|
-
let {
|
|
295
|
+
let { columns: t, baseDataSource: n, setNowDataSource: r, scrollTo: i, refresh: a, afterFilter: o, treeConfig: s, defaultTreeConfig: c } = e, l = [{
|
|
193
296
|
label: "模糊搜索",
|
|
194
297
|
value: "模糊"
|
|
195
298
|
}, {
|
|
196
299
|
label: "精确搜索",
|
|
197
300
|
value: "精确"
|
|
198
|
-
}],
|
|
301
|
+
}], u = [
|
|
199
302
|
{
|
|
200
303
|
label: ">",
|
|
201
304
|
value: ">"
|
|
@@ -216,9 +319,9 @@ function ge(e) {
|
|
|
216
319
|
label: "≤",
|
|
217
320
|
value: "≤"
|
|
218
321
|
}
|
|
219
|
-
],
|
|
220
|
-
|
|
221
|
-
for (let e of
|
|
322
|
+
], d = g([]), f = /* @__PURE__ */ new Map(), p = !1, h = () => {
|
|
323
|
+
d.value = [], f.clear(), p = !1;
|
|
324
|
+
for (let e of t.value) if (e.isFilter?.type) {
|
|
222
325
|
let t = {
|
|
223
326
|
field: e.field,
|
|
224
327
|
type: e.isFilter.type,
|
|
@@ -228,7 +331,7 @@ function ge(e) {
|
|
|
228
331
|
isActive: !1,
|
|
229
332
|
value: null
|
|
230
333
|
};
|
|
231
|
-
switch (
|
|
334
|
+
switch (f.set(e.field, t), d.value.push(t), !0) {
|
|
232
335
|
case e.isFilter.type == "inputFilter":
|
|
233
336
|
t.inputFilter = { type: "模糊" };
|
|
234
337
|
break;
|
|
@@ -254,34 +357,34 @@ function ge(e) {
|
|
|
254
357
|
isActive: !1,
|
|
255
358
|
value: null
|
|
256
359
|
};
|
|
257
|
-
|
|
360
|
+
d.value.push(t);
|
|
258
361
|
}
|
|
259
|
-
document.addEventListener("click",
|
|
260
|
-
},
|
|
362
|
+
document.addEventListener("click", b);
|
|
363
|
+
}, _ = !1, v = "pretextTable-filterPopup-", y = (e) => {
|
|
261
364
|
if (!e || e == document.body) return !1;
|
|
262
|
-
if (e.id?.startsWith(
|
|
365
|
+
if (e.id?.startsWith(v)) return !0;
|
|
263
366
|
let t = e.parentElement;
|
|
264
|
-
return
|
|
265
|
-
},
|
|
266
|
-
if (!
|
|
367
|
+
return y(t);
|
|
368
|
+
}, b = (e) => {
|
|
369
|
+
if (!_) return;
|
|
267
370
|
let t = e.target;
|
|
268
|
-
|
|
371
|
+
y(t) || (_ = !1, x(-1));
|
|
269
372
|
};
|
|
270
373
|
m(() => {
|
|
271
|
-
document.removeEventListener("click",
|
|
374
|
+
document.removeEventListener("click", b);
|
|
272
375
|
});
|
|
273
|
-
let
|
|
274
|
-
for (let t = 0; t <
|
|
275
|
-
let n =
|
|
376
|
+
let x = (e) => {
|
|
377
|
+
for (let t = 0; t < d.value.length; t++) {
|
|
378
|
+
let n = d.value[t];
|
|
276
379
|
t != e && (n.isShow &&= !1);
|
|
277
380
|
}
|
|
278
|
-
},
|
|
381
|
+
}, S = (e, t) => {
|
|
279
382
|
let n = t.$event;
|
|
280
|
-
|
|
281
|
-
},
|
|
282
|
-
let n =
|
|
383
|
+
x(e), d.value[e].isShow ? d.value[e].isShow = !1 : (d.value[e].clientX = n.clientX - 250 / 2, d.value[e].clientY = n.clientY + 20, d.value[e].clientX + 250 > window.innerWidth && (d.value[e].clientX = window.innerWidth - 250 - 20), d.value[e].isShow = !0), _ = d.value[e].isShow;
|
|
384
|
+
}, C = async (e, t) => {
|
|
385
|
+
let n = f.get(e);
|
|
283
386
|
if (!n) return Promise.resolve();
|
|
284
|
-
switch (n.isShow = !1,
|
|
387
|
+
switch (n.isShow = !1, a(), !0) {
|
|
285
388
|
case n.type == "listFilter":
|
|
286
389
|
if (t !== void 0 && (Array.isArray(t) ? n.listFilter.selectedValue = t : (console.error("listFilter的筛选值,必须是数组"), n.listFilter.selectedValue = [])), n.listFilter.selectedValue.length) n.isActive = !0;
|
|
287
390
|
else {
|
|
@@ -297,87 +400,87 @@ function ge(e) {
|
|
|
297
400
|
}
|
|
298
401
|
break;
|
|
299
402
|
}
|
|
300
|
-
return
|
|
301
|
-
},
|
|
302
|
-
let
|
|
403
|
+
return E(), Promise.resolve();
|
|
404
|
+
}, w = (e, t) => {
|
|
405
|
+
let n = !0, r = e, i = [], a = e[t.field]?.toString().trim() || "", o = t.value?.toString().trim() || "", l = s.childrenField || c.childrenField;
|
|
303
406
|
switch (!0) {
|
|
304
|
-
case
|
|
305
|
-
|
|
407
|
+
case t.type == "inputFilter" && t.inputFilter?.type == "模糊":
|
|
408
|
+
a.includes(o) || (n = !1);
|
|
306
409
|
break;
|
|
307
|
-
case
|
|
308
|
-
|
|
410
|
+
case t.type == "inputFilter" && t.inputFilter?.type == "精确":
|
|
411
|
+
a != o && (n = !1);
|
|
309
412
|
break;
|
|
310
|
-
case
|
|
311
|
-
case
|
|
312
|
-
let e = Number(
|
|
313
|
-
switch (
|
|
413
|
+
case t.type == "numberFilter":
|
|
414
|
+
case t.type == "numberFilter%":
|
|
415
|
+
let e = Number(a), r = Number(o);
|
|
416
|
+
switch (t.numberFilter?.type) {
|
|
314
417
|
case "=":
|
|
315
|
-
e !=
|
|
418
|
+
e != r && (n = !1);
|
|
316
419
|
break;
|
|
317
420
|
case ">":
|
|
318
|
-
e <=
|
|
421
|
+
e <= r && (n = !1);
|
|
319
422
|
break;
|
|
320
423
|
case "<":
|
|
321
|
-
e >=
|
|
424
|
+
e >= r && (n = !1);
|
|
322
425
|
break;
|
|
323
426
|
case "≥":
|
|
324
|
-
e <
|
|
427
|
+
e < r && (n = !1);
|
|
325
428
|
break;
|
|
326
429
|
case "≤":
|
|
327
|
-
e >
|
|
430
|
+
e > r && (n = !1);
|
|
328
431
|
break;
|
|
329
432
|
default: break;
|
|
330
433
|
}
|
|
331
434
|
break;
|
|
332
|
-
case
|
|
333
|
-
let i =
|
|
334
|
-
selectedValuesFor: for (let e of i) if ((e?.toString().trim() || "") ==
|
|
335
|
-
|
|
435
|
+
case t.type == "listFilter":
|
|
436
|
+
let i = t.listFilter?.selectedValue || [], s = !1;
|
|
437
|
+
selectedValuesFor: for (let e of i) if ((e?.toString().trim() || "") == a) {
|
|
438
|
+
s = !0;
|
|
336
439
|
break selectedValuesFor;
|
|
337
440
|
}
|
|
338
|
-
|
|
441
|
+
s || (n = !1);
|
|
339
442
|
break;
|
|
340
443
|
default: break;
|
|
341
444
|
}
|
|
342
|
-
if (e[
|
|
343
|
-
let e =
|
|
344
|
-
e.isFind && (
|
|
445
|
+
if (e[l]?.length) for (let r of e[l]) {
|
|
446
|
+
let e = w(r, t);
|
|
447
|
+
e.isFind && (i.push(e.newRow), n = !0);
|
|
345
448
|
}
|
|
346
|
-
return
|
|
347
|
-
isFind:
|
|
348
|
-
newRow:
|
|
449
|
+
return r[F.filterChildren] = i, {
|
|
450
|
+
isFind: n,
|
|
451
|
+
newRow: r
|
|
349
452
|
};
|
|
350
|
-
},
|
|
351
|
-
let
|
|
352
|
-
if (e[
|
|
353
|
-
e[
|
|
354
|
-
},
|
|
453
|
+
}, T = (e) => {
|
|
454
|
+
let t = s.childrenField || c.childrenField;
|
|
455
|
+
if (e[t]?.length) for (let n of e[t]) T(n);
|
|
456
|
+
e[F.filterChildren] = [];
|
|
457
|
+
}, E = () => {
|
|
355
458
|
let e = [];
|
|
356
|
-
baseDataSourceFor: for (let t of
|
|
357
|
-
|
|
358
|
-
filterFieldsMapFor: for (let e of
|
|
459
|
+
baseDataSourceFor: for (let t of n.value) {
|
|
460
|
+
T(t);
|
|
461
|
+
filterFieldsMapFor: for (let e of f.values()) if (e.isActive && (p = !0, !w(t, e).isFind)) continue baseDataSourceFor;
|
|
359
462
|
e.push(t);
|
|
360
463
|
}
|
|
361
|
-
e.length ? (
|
|
464
|
+
e.length ? (r(e), i({ top: 0 }), o()) : (r([]), o());
|
|
362
465
|
};
|
|
363
466
|
return {
|
|
364
467
|
filterPopupWidth: 250,
|
|
365
|
-
filterPopupId:
|
|
366
|
-
inputFilterOptions:
|
|
367
|
-
numberFilterOptions:
|
|
368
|
-
filterFields:
|
|
369
|
-
getFilterFields:
|
|
370
|
-
filterClick:
|
|
371
|
-
setFilter:
|
|
468
|
+
filterPopupId: v,
|
|
469
|
+
inputFilterOptions: l,
|
|
470
|
+
numberFilterOptions: u,
|
|
471
|
+
filterFields: d,
|
|
472
|
+
getFilterFields: h,
|
|
473
|
+
filterClick: S,
|
|
474
|
+
setFilter: C,
|
|
372
475
|
clearFilter: async (e) => {
|
|
373
476
|
if (e) {
|
|
374
|
-
let t =
|
|
375
|
-
if (t && (t.value = "", t.type == "listFilter" && (t.listFilter.selectedValue = []), t.isActive = !1),
|
|
376
|
-
|
|
477
|
+
let t = f.get(e);
|
|
478
|
+
if (t && (t.value = "", t.type == "listFilter" && (t.listFilter.selectedValue = []), t.isActive = !1), a(), !p) return;
|
|
479
|
+
p = !1, E();
|
|
377
480
|
} else {
|
|
378
|
-
for (let e of
|
|
379
|
-
if (
|
|
380
|
-
|
|
481
|
+
for (let e of d.value) e.value = "", e.type == "listFilter" && (e.listFilter.selectedValue = []), e.isActive = !1;
|
|
482
|
+
if (a(), !p) return;
|
|
483
|
+
p = !1, E();
|
|
381
484
|
}
|
|
382
485
|
return Promise.resolve();
|
|
383
486
|
}
|
|
@@ -464,15 +567,15 @@ var _e = (e) => {
|
|
|
464
567
|
case i?.type === "合计":
|
|
465
568
|
let n = t[e], r = 0;
|
|
466
569
|
if (o.get(e) || []) {
|
|
467
|
-
switch (r = Number(i.data) +
|
|
570
|
+
switch (r = Number(i.data) + j.toNumber(n), i?.dataType) {
|
|
468
571
|
case "number0":
|
|
469
|
-
r =
|
|
572
|
+
r = j.toFixed(r, 0);
|
|
470
573
|
break;
|
|
471
574
|
case "number1":
|
|
472
|
-
r =
|
|
575
|
+
r = j.toFixed(r, 1);
|
|
473
576
|
break;
|
|
474
577
|
case "number2":
|
|
475
|
-
r =
|
|
578
|
+
r = j.toFixed(r, 2);
|
|
476
579
|
break;
|
|
477
580
|
default: break;
|
|
478
581
|
}
|
|
@@ -507,58 +610,53 @@ var _e = (e) => {
|
|
|
507
610
|
}
|
|
508
611
|
};
|
|
509
612
|
}, ye = (e) => {
|
|
510
|
-
let { treeConfig: t,
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
idField: "",
|
|
514
|
-
parentField: "parentId",
|
|
515
|
-
childrenField: "children",
|
|
516
|
-
indent: 20,
|
|
517
|
-
trigger: "default",
|
|
518
|
-
lazy: !1,
|
|
519
|
-
hasChildField: "hasChild",
|
|
520
|
-
showIcon: !0
|
|
521
|
-
}, o = /* @__PURE__ */ new Map(), s = (e, r = !1) => {
|
|
522
|
-
let i = t?.childrenField || a.childrenField, c = t?.idField || n.id || "";
|
|
523
|
-
for (let t of e) o.get(t[c]) && (t[n.isCollapsed] = !0), r && t[i]?.length && s(t[i], !0);
|
|
613
|
+
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) => {
|
|
614
|
+
let r = t?.childrenField || I.childrenField, i = t?.idField || F.id || "";
|
|
615
|
+
for (let t of e) s.get(t[i]) && (t[F.isCollapsed] = !0), n && t[r]?.length && c(t[r], !0);
|
|
524
616
|
};
|
|
525
617
|
return {
|
|
526
|
-
defaultTreeConfig:
|
|
527
|
-
treeExpandMap:
|
|
618
|
+
defaultTreeConfig: I,
|
|
619
|
+
treeExpandMap: s,
|
|
528
620
|
handleTree: (e) => {
|
|
529
|
-
if (t?.reserve ? t?.idField || (console.error("当前设置了treeConfig.reserve, 请设置idField, 用于保留展开状态"),
|
|
621
|
+
if (t?.reserve ? t?.idField || (console.error("当前设置了treeConfig.reserve, 请设置idField, 用于保留展开状态"), s.clear()) : s.clear(), !t?.isOpenTree) return e;
|
|
530
622
|
let n = e;
|
|
531
|
-
if (t?.transform) t?.reserve &&
|
|
532
|
-
else return t?.reserve &&
|
|
533
|
-
|
|
534
|
-
key:
|
|
535
|
-
parentKey:
|
|
536
|
-
children:
|
|
537
|
-
})
|
|
623
|
+
if (t?.transform) t?.reserve && c(n, !1);
|
|
624
|
+
else return t?.reserve && c(n, !0), n;
|
|
625
|
+
n = ue(n, {
|
|
626
|
+
key: i,
|
|
627
|
+
parentKey: a,
|
|
628
|
+
children: o
|
|
629
|
+
});
|
|
630
|
+
let r = (e) => {
|
|
631
|
+
let t = e?.[o] || [];
|
|
632
|
+
for (let n of t) n[F.parentRow] = e, r(n);
|
|
633
|
+
};
|
|
634
|
+
for (let e of n) r(e);
|
|
635
|
+
return n;
|
|
538
636
|
},
|
|
539
|
-
setTreeExpand: async (e,
|
|
540
|
-
let
|
|
541
|
-
for (let
|
|
542
|
-
if (
|
|
543
|
-
|
|
637
|
+
setTreeExpand: async (e, i) => {
|
|
638
|
+
let a = t?.hasChildField || I.hasChildField, o = t?.childrenField || I.childrenField, c = t?.idField || F.id;
|
|
639
|
+
for (let n of e) if (n[F.isCollapsed] = i, i) {
|
|
640
|
+
if (s.set(n[c], n), t?.lazy && n[a] && !n[o]?.length) {
|
|
641
|
+
n[F.lazyLoading] = !0;
|
|
544
642
|
try {
|
|
545
|
-
let e = await t?.loadMethod?.({ row:
|
|
546
|
-
Array.isArray(e) || (console.warn("懒加载loadMethod 返回的不是数组", e), e = []), await
|
|
643
|
+
let e = await t?.loadMethod?.({ row: n }) || [];
|
|
644
|
+
Array.isArray(e) || (console.warn("懒加载loadMethod 返回的不是数组", e), e = []), await r(e, n);
|
|
547
645
|
} catch (e) {
|
|
548
|
-
console.error("加载子节点失败",
|
|
646
|
+
console.error("加载子节点失败", n, e);
|
|
549
647
|
} finally {
|
|
550
|
-
|
|
648
|
+
n[F.lazyLoading] = !1;
|
|
551
649
|
}
|
|
552
650
|
}
|
|
553
|
-
} else
|
|
554
|
-
|
|
651
|
+
} else s.delete(n[c]);
|
|
652
|
+
n(e, i);
|
|
555
653
|
}
|
|
556
654
|
};
|
|
557
|
-
},
|
|
655
|
+
}, L = () => {
|
|
558
656
|
let e = document.activeElement;
|
|
559
657
|
e?.blur && e.blur();
|
|
560
|
-
},
|
|
561
|
-
let {
|
|
658
|
+
}, be = (e) => {
|
|
659
|
+
let { expandConfig: t, afterRowExpand: n, insertExpandRow: r } = e, i = {
|
|
562
660
|
transform: !0,
|
|
563
661
|
parentField: "parentId",
|
|
564
662
|
childrenField: "children",
|
|
@@ -567,70 +665,57 @@ var _e = (e) => {
|
|
|
567
665
|
lazy: !1,
|
|
568
666
|
hasChildField: "hasChild",
|
|
569
667
|
showIcon: !0
|
|
570
|
-
},
|
|
668
|
+
}, a = /* @__PURE__ */ new Map();
|
|
571
669
|
return {
|
|
572
|
-
defaultExpandConfig:
|
|
670
|
+
defaultExpandConfig: i,
|
|
573
671
|
handleExpand: () => {
|
|
574
|
-
if (
|
|
575
|
-
if (!
|
|
672
|
+
if (t.isExpand) {
|
|
673
|
+
if (!t.height) {
|
|
576
674
|
console.error("开启了展开行, 高度参数expandConfig.height不能为空");
|
|
577
675
|
return;
|
|
578
676
|
}
|
|
579
|
-
|
|
677
|
+
a.clear();
|
|
580
678
|
}
|
|
581
679
|
},
|
|
582
|
-
setRowExpand: (e,
|
|
583
|
-
for (let
|
|
584
|
-
|
|
680
|
+
setRowExpand: (e, t) => {
|
|
681
|
+
for (let n of e) n[F.isRowExpanded] = t, t ? (a.set(n[F.id], n), r(n)) : a.delete(n[F.id]);
|
|
682
|
+
n(e, t);
|
|
585
683
|
}
|
|
586
684
|
};
|
|
587
|
-
},
|
|
588
|
-
let t =
|
|
589
|
-
id: "pretextId",
|
|
590
|
-
seq: "pretextSeq",
|
|
591
|
-
stripe: "pretextStripe",
|
|
592
|
-
height: "pretextHeight",
|
|
593
|
-
isCollapsed: "pretextIsCollapsed",
|
|
594
|
-
level: "pretextLevel",
|
|
595
|
-
lazyLoading: "pretextLazyLoading",
|
|
596
|
-
index: "pretextIndex",
|
|
597
|
-
filterChildren: "pretextFilterChildren",
|
|
598
|
-
isRowExpanded: "pretextIsRowExpanded",
|
|
599
|
-
isExpandRow: "pretextIsExpandRow",
|
|
600
|
-
expandChildren: "pretextExpandChildren"
|
|
601
|
-
}, n = y([]), r = y([]), i = g(), a = g(), o = g(0), s = g(0), c = g(!1);
|
|
685
|
+
}, R = (e) => {
|
|
686
|
+
let t = y([]), n = y([]), r = g(), i = g(), a = g(0), o = g(0), s = g(!1);
|
|
602
687
|
w(() => e.props.loading, (e) => {
|
|
603
|
-
|
|
688
|
+
s.value = e;
|
|
604
689
|
});
|
|
605
|
-
let
|
|
606
|
-
|
|
607
|
-
|
|
690
|
+
let c = g(!1), l = () => {
|
|
691
|
+
c.value = !0, setTimeout(() => {
|
|
692
|
+
c.value = !1;
|
|
608
693
|
}, 0);
|
|
609
|
-
},
|
|
610
|
-
|
|
611
|
-
},
|
|
612
|
-
|
|
613
|
-
let
|
|
614
|
-
if (
|
|
615
|
-
let e =
|
|
616
|
-
if (
|
|
617
|
-
let
|
|
618
|
-
for (let
|
|
694
|
+
}, u = (e) => {
|
|
695
|
+
i.value?.scrollTo(e);
|
|
696
|
+
}, m = y([]), h = y([]), _ = [], v = /* @__PURE__ */ new Map(), b = (t) => {
|
|
697
|
+
v.clear(), h.value = t, _ = [], re();
|
|
698
|
+
let n = 1, r = !1, i = 0, a = e.props.treeConfig?.childrenField || J.childrenField, o = (t, n, r) => {
|
|
699
|
+
if (_.push(t), t[F.level] = r, e.props.treeConfig?.isOpenTree) {
|
|
700
|
+
let e = t?.[a] || [];
|
|
701
|
+
if (t?.[F.filterChildren]?.length > 0 && (e = t[F.filterChildren]), e.length > 0 && t[F.isCollapsed]) {
|
|
702
|
+
let t = 1;
|
|
703
|
+
for (let i of e) i[F.stripe] = !1, i[F.seq] = n + "." + t, t++, o(i, i[F.seq], r + 1);
|
|
619
704
|
}
|
|
620
705
|
}
|
|
621
|
-
if (e.props.expandConfig?.isExpand &&
|
|
706
|
+
if (e.props.expandConfig?.isExpand && t[F.expandChildren]?.length > 0 && t[F.isRowExpanded]) for (let e of t[F.expandChildren]) _.push(e);
|
|
622
707
|
};
|
|
623
|
-
for (let e of
|
|
624
|
-
let
|
|
625
|
-
for (let e of
|
|
626
|
-
totalHeight:
|
|
708
|
+
for (let e of h.value) e[F.seq] = n, o(e, `${n}`, 1), n++, e[F.stripe] = r, r = !r;
|
|
709
|
+
let s = 1;
|
|
710
|
+
for (let e of _) i += e[F.height] || 0, v.set(s, {
|
|
711
|
+
totalHeight: i,
|
|
627
712
|
row: e
|
|
628
|
-
}),
|
|
629
|
-
},
|
|
713
|
+
}), s++;
|
|
714
|
+
}, S = async (n, r) => {
|
|
630
715
|
let i = null;
|
|
631
|
-
i = typeof r == "string" ?
|
|
716
|
+
i = typeof r == "string" ? X.get(r) : r, Z(n);
|
|
632
717
|
let a = [];
|
|
633
|
-
for (let e of
|
|
718
|
+
for (let e of t.value) {
|
|
634
719
|
let t = x(e);
|
|
635
720
|
a.push({
|
|
636
721
|
title: t.title || "",
|
|
@@ -646,84 +731,84 @@ var _e = (e) => {
|
|
|
646
731
|
treeNode: t.treeNode || !1
|
|
647
732
|
});
|
|
648
733
|
}
|
|
649
|
-
let o = await
|
|
650
|
-
tempData:
|
|
734
|
+
let o = await N({
|
|
735
|
+
tempData: n,
|
|
651
736
|
index: 0,
|
|
652
737
|
columns: a
|
|
653
738
|
});
|
|
654
739
|
if (o) {
|
|
655
|
-
|
|
656
|
-
let
|
|
657
|
-
i[
|
|
740
|
+
P(o.heightDatas);
|
|
741
|
+
let t = e.props.treeConfig?.childrenField || J.childrenField;
|
|
742
|
+
i[t] = n;
|
|
658
743
|
}
|
|
659
|
-
},
|
|
660
|
-
let
|
|
661
|
-
if (
|
|
662
|
-
let
|
|
663
|
-
[
|
|
664
|
-
[
|
|
744
|
+
}, C = (t) => {
|
|
745
|
+
let n = null;
|
|
746
|
+
if (n = typeof t == "string" ? X.get(t) : t, n[F.expandChildren]?.length) return;
|
|
747
|
+
let r = {
|
|
748
|
+
[F.isExpandRow]: !0,
|
|
749
|
+
[F.height]: e.props.expandConfig?.height || 0
|
|
665
750
|
};
|
|
666
|
-
|
|
667
|
-
}, { headerHeight:
|
|
751
|
+
Z([r]), n[F.expandChildren] = [r];
|
|
752
|
+
}, { headerHeight: T, headerStyles: E, createHeader: ee, headerRef: D, getHeaderRefHeight: O } = fe({ pretextTableRef: r }), { footerHeight: te, footerColumns: ne, getFooterHeight: k, updateFooter: re, updateFooterCellLabel: ie } = ve({
|
|
668
753
|
showFooter: e.props.showFooter,
|
|
669
|
-
nowDataSource:
|
|
670
|
-
columns:
|
|
671
|
-
}),
|
|
672
|
-
e == -1 && (e = ae.value),
|
|
673
|
-
},
|
|
754
|
+
nowDataSource: h,
|
|
755
|
+
columns: t
|
|
756
|
+
}), A = g(0), ae = g(0), oe = (e) => {
|
|
757
|
+
e == -1 && (e = ae.value), A.value = e;
|
|
758
|
+
}, se = (e) => {
|
|
674
759
|
ae.value = e;
|
|
675
|
-
},
|
|
760
|
+
}, j = () => {
|
|
676
761
|
let e = 0;
|
|
677
|
-
for (let
|
|
678
|
-
|
|
679
|
-
},
|
|
762
|
+
for (let t of _) e += t[F.height] || 0;
|
|
763
|
+
A.value = e;
|
|
764
|
+
}, M = {
|
|
680
765
|
fontWeight: "400",
|
|
681
766
|
fontSize: "14px"
|
|
682
|
-
}, le = !!e.props.showOverflow, ue = e.props.cellMinHeight || 22,
|
|
683
|
-
let
|
|
684
|
-
tempData:
|
|
685
|
-
index:
|
|
686
|
-
columns:
|
|
767
|
+
}, le = !!e.props.showOverflow, ue = e.props.cellMinHeight || 22, N = (t) => new Promise((n, r) => {
|
|
768
|
+
let i = new de(), a = {
|
|
769
|
+
tempData: t.tempData,
|
|
770
|
+
index: t.index,
|
|
771
|
+
columns: t.columns,
|
|
687
772
|
commonStyles: " \"Microsoft YaHei\", \"微软雅黑\", sans-serif",
|
|
688
|
-
itemStyles:
|
|
773
|
+
itemStyles: M,
|
|
689
774
|
divLineHeight: 22,
|
|
690
|
-
keyNames:
|
|
775
|
+
keyNames: F,
|
|
691
776
|
isNoAutoWrap: le,
|
|
692
777
|
cellMinHeight: ue,
|
|
693
778
|
treeConfig: {
|
|
694
779
|
...e.props.treeConfig,
|
|
695
780
|
loadMethod: void 0
|
|
696
781
|
},
|
|
697
|
-
defaultTreeConfig: { ...
|
|
782
|
+
defaultTreeConfig: { ...J }
|
|
698
783
|
};
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
},
|
|
702
|
-
|
|
784
|
+
i.postMessage(a), i.onmessage = (e) => {
|
|
785
|
+
n(e.data), i.terminate();
|
|
786
|
+
}, i.onerror = (e) => {
|
|
787
|
+
r(e), i.terminate();
|
|
703
788
|
};
|
|
704
|
-
}),
|
|
705
|
-
for (let
|
|
706
|
-
let e =
|
|
707
|
-
e && (e[
|
|
789
|
+
}), P = (e) => {
|
|
790
|
+
for (let t of e) {
|
|
791
|
+
let e = X.get(t.id);
|
|
792
|
+
e && (e[F.height] = t.pretextHeight);
|
|
708
793
|
}
|
|
709
|
-
},
|
|
710
|
-
if (
|
|
711
|
-
if (
|
|
794
|
+
}, I = 0, R = !1, xe = async (e) => {
|
|
795
|
+
if (t.value?.length === 0) {
|
|
796
|
+
if (I++, I > 50) {
|
|
712
797
|
console.error("表格没有设置 columns.value");
|
|
713
798
|
return;
|
|
714
799
|
}
|
|
715
800
|
setTimeout(() => {
|
|
716
|
-
|
|
801
|
+
xe(e);
|
|
717
802
|
}, 100);
|
|
718
803
|
return;
|
|
719
804
|
}
|
|
720
|
-
let
|
|
805
|
+
let n = 0;
|
|
721
806
|
if (e.length === 0) {
|
|
722
|
-
|
|
807
|
+
b(e), j(), Ee.value = [];
|
|
723
808
|
return;
|
|
724
809
|
}
|
|
725
810
|
let r = [];
|
|
726
|
-
for (let e of
|
|
811
|
+
for (let e of t.value) {
|
|
727
812
|
let t = x(e);
|
|
728
813
|
r.push({
|
|
729
814
|
title: t.title || "",
|
|
@@ -739,371 +824,377 @@ var _e = (e) => {
|
|
|
739
824
|
treeNode: t.treeNode || !1
|
|
740
825
|
});
|
|
741
826
|
}
|
|
742
|
-
if (e.length *
|
|
743
|
-
let
|
|
744
|
-
|
|
745
|
-
let i = await
|
|
827
|
+
if (e.length * Se >= Ce) {
|
|
828
|
+
let t = 5e3;
|
|
829
|
+
R = !0;
|
|
830
|
+
let i = await N({
|
|
746
831
|
tempData: e.slice(0, 100),
|
|
747
832
|
index: 0,
|
|
748
833
|
columns: r
|
|
749
834
|
});
|
|
750
|
-
i && (
|
|
751
|
-
let a = [], o = Math.ceil((e.length - 100) /
|
|
752
|
-
for (let
|
|
835
|
+
i && (n += i.tempItemHeights, P(i.heightDatas), b(e), j(), U());
|
|
836
|
+
let a = [], o = Math.ceil((e.length - 100) / t / 2), s = o * 2, c = 0, l = 100;
|
|
837
|
+
for (let n = 1; n <= o; n++) for (let n = 0; n < 2; n++) a[n] || (a[n] = []), a[n].push({
|
|
753
838
|
tempI: l,
|
|
754
|
-
tempData: e.slice(l, l +
|
|
755
|
-
}), l +=
|
|
839
|
+
tempData: e.slice(l, l + t)
|
|
840
|
+
}), l += t;
|
|
756
841
|
{
|
|
757
|
-
let
|
|
758
|
-
for (let i of
|
|
842
|
+
let t = async (t) => {
|
|
843
|
+
for (let i of t) {
|
|
759
844
|
if (i.tempData?.length === 0) {
|
|
760
845
|
c++;
|
|
761
846
|
continue;
|
|
762
847
|
}
|
|
763
|
-
let
|
|
848
|
+
let t = await N({
|
|
764
849
|
tempData: i.tempData,
|
|
765
850
|
index: i.tempI,
|
|
766
851
|
columns: r
|
|
767
852
|
});
|
|
768
|
-
|
|
853
|
+
t && (n += t.tempItemHeights, se(n), oe(n), c++, P(t.heightDatas), c == s && (b(e), j(), R = !1));
|
|
769
854
|
}
|
|
770
855
|
};
|
|
771
|
-
for (let e of a)
|
|
856
|
+
for (let e of a) t(e);
|
|
772
857
|
}
|
|
773
858
|
} else {
|
|
774
|
-
|
|
775
|
-
let t = await
|
|
859
|
+
R = !0;
|
|
860
|
+
let t = await N({
|
|
776
861
|
tempData: e,
|
|
777
862
|
index: 0,
|
|
778
863
|
columns: r
|
|
779
864
|
});
|
|
780
|
-
|
|
865
|
+
R = !1, t && (P(t.heightDatas), b(e), j(), U());
|
|
781
866
|
}
|
|
782
|
-
},
|
|
783
|
-
if (
|
|
784
|
-
|
|
785
|
-
|
|
867
|
+
}, Se = 0, Ce = 1e4, z = 0, B = 0, V = g(0), H = !1, we = (e) => {
|
|
868
|
+
if (B = i.value?.scrollLeft || 0, z == i.value?.scrollTop) {
|
|
869
|
+
H ||= (window.requestAnimationFrame(() => {
|
|
870
|
+
je(), H = !1;
|
|
786
871
|
}), !0);
|
|
787
872
|
return;
|
|
788
873
|
}
|
|
789
|
-
|
|
790
|
-
|
|
874
|
+
z = i.value?.scrollTop || 0, e.preventDefault(), H ||= (window.requestAnimationFrame(() => {
|
|
875
|
+
U(), H = !1;
|
|
791
876
|
}), !0);
|
|
792
|
-
},
|
|
877
|
+
}, Te = (e) => {
|
|
793
878
|
if (e.shiftKey) {
|
|
794
|
-
e.preventDefault(), e.stopPropagation(), e.deltaY > 0 || e.deltaX > 0 ?
|
|
879
|
+
e.preventDefault(), e.stopPropagation(), e.deltaY > 0 || e.deltaX > 0 ? i.value?.scrollBy({ left: 100 }) : i.value?.scrollBy({ left: -100 });
|
|
795
880
|
return;
|
|
796
881
|
}
|
|
797
|
-
e.preventDefault(), e.stopPropagation(), e.deltaY > 0 ?
|
|
798
|
-
},
|
|
882
|
+
e.preventDefault(), e.stopPropagation(), e.deltaY > 0 ? i.value?.scrollBy({ top: 150 }) : i.value?.scrollBy({ top: -150 });
|
|
883
|
+
}, Ee = g([]), De = g(0), Oe = ce((e, t) => {
|
|
799
884
|
setTimeout(() => {
|
|
800
|
-
|
|
885
|
+
De.value = t, e.forEach((e) => {
|
|
801
886
|
e.slotShowTimestamp = t;
|
|
802
|
-
}),
|
|
887
|
+
}), l();
|
|
803
888
|
}, 0);
|
|
804
|
-
}, 100),
|
|
805
|
-
if (!
|
|
806
|
-
let e =
|
|
889
|
+
}, 100), U = () => {
|
|
890
|
+
if (!i.value) return;
|
|
891
|
+
let e = i.value.scrollTop, t = a.value, n = 0, r = 0, o = [], s = "遍历";
|
|
807
892
|
switch (!0) {
|
|
808
|
-
case e > 500 &&
|
|
809
|
-
|
|
893
|
+
case e > 500 && _.length > 10:
|
|
894
|
+
s = "二分查找";
|
|
810
895
|
break;
|
|
811
896
|
default: break;
|
|
812
897
|
}
|
|
813
|
-
let
|
|
814
|
-
if (
|
|
815
|
-
let
|
|
898
|
+
let c = !1;
|
|
899
|
+
if (s == "二分查找") {
|
|
900
|
+
let i = 0, a = _.length - 1, s = {
|
|
816
901
|
totalHeight: 0,
|
|
817
902
|
row: {}
|
|
818
|
-
},
|
|
819
|
-
BinarySearchWhile: for (;
|
|
820
|
-
if (
|
|
821
|
-
|
|
903
|
+
}, l = 0;
|
|
904
|
+
BinarySearchWhile: for (; i <= a && a != -1;) {
|
|
905
|
+
if (l++, l > 25) {
|
|
906
|
+
c = !0;
|
|
822
907
|
break BinarySearchWhile;
|
|
823
908
|
}
|
|
824
|
-
let t = Math.floor((
|
|
825
|
-
!n || n <= 1 || (n <= e ?
|
|
909
|
+
let t = Math.floor((i + a) / 2), n = v.get(t + 1)?.totalHeight || 0;
|
|
910
|
+
!n || n <= 1 || (n <= e ? i = t + 1 : a = t - 1);
|
|
826
911
|
}
|
|
827
|
-
|
|
912
|
+
s = v.get(i) || {
|
|
828
913
|
totalHeight: 0,
|
|
829
914
|
row: {}
|
|
830
|
-
},
|
|
831
|
-
getHeightFor: for (let e =
|
|
832
|
-
let
|
|
833
|
-
if (
|
|
915
|
+
}, r = s.totalHeight, V.value = r - s.row[F.height], o.push(s.row), n = e + t;
|
|
916
|
+
getHeightFor: for (let e = i; e < _.length; e++) {
|
|
917
|
+
let t = _[e];
|
|
918
|
+
if (r += t[F.height], n) if (r <= n) o.push(t);
|
|
834
919
|
else break getHeightFor;
|
|
835
920
|
}
|
|
836
921
|
}
|
|
837
|
-
if (
|
|
838
|
-
let
|
|
839
|
-
if (
|
|
840
|
-
if (
|
|
841
|
-
|
|
922
|
+
if (s == "遍历" || c) getHeightFor: for (let i = 0; i < _.length; i++) {
|
|
923
|
+
let a = _[i];
|
|
924
|
+
if (a) {
|
|
925
|
+
if (r += a[F.height], e <= r && n == 0) {
|
|
926
|
+
V.value = r - a[F.height], o.push(a), n = e + t;
|
|
842
927
|
continue;
|
|
843
928
|
}
|
|
844
|
-
if (
|
|
929
|
+
if (n) if (r <= n) o.push(a);
|
|
845
930
|
else break getHeightFor;
|
|
846
931
|
}
|
|
847
932
|
}
|
|
848
|
-
|
|
849
|
-
},
|
|
850
|
-
if (!
|
|
851
|
-
let e =
|
|
852
|
-
for (let e of
|
|
853
|
-
let r = 0,
|
|
854
|
-
for (let
|
|
855
|
-
let c =
|
|
933
|
+
Ee.value = o, je(), Oe(o, Math.floor(performance.now()));
|
|
934
|
+
}, ke = g(0), Ae = g(0), je = () => {
|
|
935
|
+
if (!i.value) return;
|
|
936
|
+
let e = i.value.scrollLeft, n = i.value.clientWidth;
|
|
937
|
+
for (let e of t.value) (e.fixed == "left" || e.fixed == "right") && (n -= e.width || e.minWidth || 0);
|
|
938
|
+
let r = 0, a = t.value.length - 1, o = !1, s = 0;
|
|
939
|
+
for (let i = 0; i < t.value.length; i++) {
|
|
940
|
+
let c = t.value[i];
|
|
856
941
|
if (!(c.fixed == "left" || c.fixed == "right")) {
|
|
857
942
|
if (s += c.width || c.minWidth || 0, !o && e <= s) {
|
|
858
|
-
r =
|
|
943
|
+
r = i, o = !0;
|
|
859
944
|
continue;
|
|
860
945
|
}
|
|
861
|
-
if (e +
|
|
862
|
-
|
|
946
|
+
if (e + n < s) {
|
|
947
|
+
a = i;
|
|
863
948
|
break;
|
|
864
949
|
}
|
|
865
950
|
}
|
|
866
951
|
}
|
|
867
|
-
r <
|
|
868
|
-
},
|
|
869
|
-
if (e.props.rowConfig?.isCurrent &&
|
|
870
|
-
newValue:
|
|
871
|
-
column:
|
|
952
|
+
r < a && (ke.value = r, Ae.value = a);
|
|
953
|
+
}, Me = ce(U, 200), { fixedColumnsLeft: Ne, fixedColumnsRight: Pe, fixedLeftIndex: Fe, fixedRightIndex: Ie, reflashGridTemplateColumns: Le, gridTemplateColumns: W, getGridStyles: G } = pe({ columns: t }), K = y({}), q = (t, n) => {
|
|
954
|
+
if (e.props.rowConfig?.isCurrent && K.value != t && (K.value = t, e.emits("currentChange", {
|
|
955
|
+
newValue: t,
|
|
956
|
+
column: n
|
|
872
957
|
})), e.props.treeConfig?.isOpenTree) {
|
|
873
|
-
let
|
|
958
|
+
let r = e.props.treeConfig.childrenField || J.childrenField;
|
|
874
959
|
switch (!0) {
|
|
875
|
-
case
|
|
876
|
-
case e.props.treeConfig?.trigger == "cell" &&
|
|
960
|
+
case t?.[r]?.length == 0: break;
|
|
961
|
+
case e.props.treeConfig?.trigger == "cell" && n.treeNode:
|
|
877
962
|
case e.props.treeConfig?.trigger == "row":
|
|
878
|
-
|
|
963
|
+
Y([t], !t[F.isCollapsed]);
|
|
879
964
|
break;
|
|
880
965
|
default: break;
|
|
881
966
|
}
|
|
882
967
|
}
|
|
883
968
|
if (e.props.expandConfig?.isExpand) switch (!0) {
|
|
884
|
-
case e.props.expandConfig?.trigger == "cell" &&
|
|
969
|
+
case e.props.expandConfig?.trigger == "cell" && n.type == "expand":
|
|
885
970
|
case e.props.expandConfig?.trigger == "row":
|
|
886
|
-
|
|
971
|
+
ot([t], !t[F.isRowExpanded]);
|
|
887
972
|
break;
|
|
888
973
|
default: break;
|
|
889
974
|
}
|
|
890
975
|
e.emits && e.emits("cellClick", {
|
|
891
|
-
row:
|
|
892
|
-
column:
|
|
976
|
+
row: t,
|
|
977
|
+
column: n
|
|
893
978
|
});
|
|
894
|
-
},
|
|
895
|
-
e.emits && e.emits("headerCellClick", { column: t }), e.props.sortConfig?.trigger == "cell" && t.sortable &&
|
|
896
|
-
},
|
|
897
|
-
e.props.rowConfig?.isHover && (
|
|
898
|
-
}, { getCheckField:
|
|
899
|
-
pretextId:
|
|
900
|
-
columns:
|
|
901
|
-
blurAnyElement:
|
|
902
|
-
nowDataSource:
|
|
903
|
-
baseDataSource:
|
|
904
|
-
emits: e.emits
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
979
|
+
}, Re = (t) => {
|
|
980
|
+
e.emits && e.emits("headerCellClick", { column: t }), e.props.sortConfig?.trigger == "cell" && t.sortable && $(t.field, "auto"), e.emits && e.emits("cellClick", { column: t });
|
|
981
|
+
}, ze = y({}), Be = (t) => {
|
|
982
|
+
e.props.rowConfig?.isHover && (ze.value = t);
|
|
983
|
+
}, { getCheckField: Ve, headerChecked: He, headerCheckedIndeterminate: Ue, onHeaderChecked: We, upDataHeaderChecked: Ge, upDataAllRowCheckedDeep: Ke, onCellChecked: qe, getCheckboxRecords: Je, clearCheckboxRowInit: Ye } = me({
|
|
984
|
+
pretextId: F.id,
|
|
985
|
+
columns: t,
|
|
986
|
+
blurAnyElement: L,
|
|
987
|
+
nowDataSource: h,
|
|
988
|
+
baseDataSource: m,
|
|
989
|
+
emits: e.emits,
|
|
990
|
+
treeConfig: e.props.treeConfig
|
|
991
|
+
}), Xe = (e) => {
|
|
992
|
+
Ye();
|
|
993
|
+
let t = [];
|
|
994
|
+
if (t = e ? [e] : Ve(), t) for (let e of h.value) for (let n of t) e[n] = !1;
|
|
995
|
+
}, { isDragging: Ze, dragLineLeft: Qe, startResize: $e } = _e({
|
|
996
|
+
pretextTableRef: r,
|
|
911
997
|
afterResize: (t) => {
|
|
912
|
-
|
|
998
|
+
Le(), e.emits("resizableChange", {
|
|
913
999
|
column: { ...t.column },
|
|
914
1000
|
resizeWidth: t.column.width
|
|
915
1001
|
});
|
|
916
1002
|
}
|
|
917
|
-
}),
|
|
918
|
-
|
|
919
|
-
},
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1003
|
+
}), et = () => {
|
|
1004
|
+
b(h.value), j(), U();
|
|
1005
|
+
}, tt = (t) => {
|
|
1006
|
+
if (t) {
|
|
1007
|
+
let t = e.props.treeConfig?.childrenField || J.childrenField, n = [], r = (e) => {
|
|
1008
|
+
if (e[t]?.length) {
|
|
1009
|
+
n.push(e);
|
|
1010
|
+
for (let n of e[t]) r(n);
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
for (let e of h.value) r(e);
|
|
1014
|
+
Y(n, !0);
|
|
1015
|
+
} else nt();
|
|
1016
|
+
}, nt = () => {
|
|
1017
|
+
rt.forEach((e) => {
|
|
1018
|
+
e[F.isCollapsed] = !1;
|
|
1019
|
+
}), rt.clear(), b(h.value), j(), U();
|
|
1020
|
+
}, { defaultTreeConfig: J, treeExpandMap: rt, handleTree: it, setTreeExpand: Y } = ye({
|
|
926
1021
|
treeConfig: e.props.treeConfig,
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
}), { handleExpand: ot, setRowExpand: q } = xe({
|
|
931
|
-
keyNames: t,
|
|
1022
|
+
afterTreeExpand: et,
|
|
1023
|
+
insertChild: S
|
|
1024
|
+
}), { handleExpand: at, setRowExpand: ot } = be({
|
|
932
1025
|
expandConfig: e.props.expandConfig,
|
|
933
1026
|
afterRowExpand: (t, n) => {
|
|
934
|
-
|
|
1027
|
+
b(h.value), j(), U(), e.emits("toggleRowExpand", {
|
|
935
1028
|
expanded: n,
|
|
936
1029
|
rows: t
|
|
937
1030
|
});
|
|
938
1031
|
},
|
|
939
|
-
insertExpandRow:
|
|
940
|
-
}),
|
|
941
|
-
|
|
942
|
-
},
|
|
943
|
-
let
|
|
944
|
-
for (let
|
|
945
|
-
|
|
946
|
-
let
|
|
947
|
-
e.props.treeConfig?.isOpenTree &&
|
|
1032
|
+
insertExpandRow: C
|
|
1033
|
+
}), st = 0, ct = () => {
|
|
1034
|
+
m.value = [], b([]), X.clear(), K.value = {}, ze.value = {}, Ye(), ft.value = "", pt.value = null, Ct(), st = 0, I = 0;
|
|
1035
|
+
}, X = /* @__PURE__ */ new Map(), Z = (t) => {
|
|
1036
|
+
let n = st;
|
|
1037
|
+
for (let r of t) {
|
|
1038
|
+
r[F.id] = Math.random().toString(36).substring(2), r[F.index] = n, n++, st++, X.set(r[F.id], r);
|
|
1039
|
+
let t = e.props.treeConfig?.childrenField || J.childrenField;
|
|
1040
|
+
e.props.treeConfig?.isOpenTree && r?.[t]?.length > 0 && Z(r[t]);
|
|
948
1041
|
}
|
|
949
|
-
},
|
|
950
|
-
|
|
951
|
-
n >= 50 ||
|
|
952
|
-
}, 100) :
|
|
1042
|
+
}, lt = (e, t, n = 0) => {
|
|
1043
|
+
R ? setTimeout(() => {
|
|
1044
|
+
n >= 50 || lt(e, t, n + 1);
|
|
1045
|
+
}, 100) : u({
|
|
953
1046
|
top: e,
|
|
954
1047
|
left: t
|
|
955
1048
|
});
|
|
956
|
-
}, lt = async (e) => {
|
|
957
|
-
let t = L, n = R;
|
|
958
|
-
await ut(e), ct(t, n);
|
|
959
1049
|
}, ut = async (e) => {
|
|
1050
|
+
let t = z, n = B;
|
|
1051
|
+
await Q(e), lt(t, n);
|
|
1052
|
+
}, Q = async (e) => {
|
|
960
1053
|
try {
|
|
961
|
-
|
|
962
|
-
let t =
|
|
963
|
-
|
|
1054
|
+
u({ top: 0 }), ct();
|
|
1055
|
+
let t = it(e || []);
|
|
1056
|
+
Z(t || []), m.value = t || [], xe(m.value);
|
|
964
1057
|
} catch (e) {
|
|
965
1058
|
console.error(e);
|
|
966
1059
|
}
|
|
967
1060
|
}, dt = () => {
|
|
968
|
-
let e =
|
|
1061
|
+
let e = _.filter((e) => !e[F.isExpandRow]);
|
|
969
1062
|
return {
|
|
970
|
-
fullData:
|
|
1063
|
+
fullData: m.value,
|
|
971
1064
|
visibleData: e
|
|
972
1065
|
};
|
|
973
|
-
}, { sortField:
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
setNowDataSource: S,
|
|
1066
|
+
}, { sortField: ft, sortOrder: pt, sort: $, handleSort: mt } = he({
|
|
1067
|
+
nowDataSource: h,
|
|
1068
|
+
getVisibleData: U,
|
|
1069
|
+
setNowDataSource: b,
|
|
978
1070
|
treeConfig: e.props.treeConfig,
|
|
979
|
-
defaultTreeConfig:
|
|
980
|
-
}), { filterPopupWidth:
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
refresh: u,
|
|
1071
|
+
defaultTreeConfig: J
|
|
1072
|
+
}), { filterPopupWidth: ht, filterPopupId: gt, inputFilterOptions: _t, numberFilterOptions: vt, filterFields: yt, getFilterFields: bt, filterClick: xt, setFilter: St, clearFilter: Ct } = ge({
|
|
1073
|
+
columns: t,
|
|
1074
|
+
baseDataSource: m,
|
|
1075
|
+
setNowDataSource: b,
|
|
1076
|
+
scrollTo: u,
|
|
1077
|
+
refresh: l,
|
|
987
1078
|
afterFilter: () => {
|
|
988
|
-
|
|
1079
|
+
j(), mt(), Ke();
|
|
989
1080
|
},
|
|
990
1081
|
treeConfig: e.props.treeConfig,
|
|
991
|
-
defaultTreeConfig:
|
|
992
|
-
}),
|
|
993
|
-
|
|
994
|
-
},
|
|
995
|
-
if (!
|
|
1082
|
+
defaultTreeConfig: J
|
|
1083
|
+
}), wt = (e) => {
|
|
1084
|
+
L(), e.listFilter.selectedValue.length == e.listFilter.listOptions.length ? e.listFilter.selectedValue = [] : e.listFilter.selectedValue = e.listFilter.listOptions.map((e) => e.value);
|
|
1085
|
+
}, Tt = (i) => {
|
|
1086
|
+
if (!r.value) {
|
|
996
1087
|
setTimeout(() => {
|
|
997
|
-
|
|
1088
|
+
Tt(i);
|
|
998
1089
|
}, 100);
|
|
999
1090
|
return;
|
|
1000
1091
|
}
|
|
1001
|
-
let a =
|
|
1002
|
-
a.finalColumns.length == 0 || a.realColumns.length == 0 || (
|
|
1003
|
-
|
|
1004
|
-
}, 0),
|
|
1092
|
+
let a = ee(i) || [];
|
|
1093
|
+
a.finalColumns.length == 0 || a.realColumns.length == 0 || (at(), Se = a.finalColumns.length, j(), t.value = a.finalColumns, n.value = a.realColumns, setTimeout(() => {
|
|
1094
|
+
O();
|
|
1095
|
+
}, 0), k(e.props.footerProps), Ve(), G(), bt(), l());
|
|
1005
1096
|
};
|
|
1006
1097
|
w(() => e.props.columns, (e) => {
|
|
1007
|
-
|
|
1098
|
+
Tt(e);
|
|
1008
1099
|
}, { immediate: !0 }), w(() => e.props.footerProps, (e) => {
|
|
1009
|
-
|
|
1100
|
+
k(e);
|
|
1010
1101
|
}), w(() => e.props.height, (e) => {
|
|
1011
|
-
|
|
1102
|
+
a.value = e, Me();
|
|
1012
1103
|
}, { immediate: !0 });
|
|
1013
|
-
let
|
|
1014
|
-
|
|
1015
|
-
},
|
|
1016
|
-
if (!
|
|
1104
|
+
let Et = () => {
|
|
1105
|
+
r.value && (o.value = r.value.clientWidth);
|
|
1106
|
+
}, Dt = ce(Et, 100), Ot = () => {
|
|
1107
|
+
if (!r.value) {
|
|
1017
1108
|
setTimeout(() => {
|
|
1018
|
-
|
|
1109
|
+
Ot();
|
|
1019
1110
|
}, 100);
|
|
1020
1111
|
return;
|
|
1021
1112
|
}
|
|
1022
|
-
window.addEventListener("resize",
|
|
1113
|
+
window.addEventListener("resize", Dt), Et();
|
|
1023
1114
|
};
|
|
1024
1115
|
return p(() => {
|
|
1025
|
-
|
|
1116
|
+
Ot();
|
|
1026
1117
|
}), d(() => {
|
|
1027
|
-
|
|
1028
|
-
top:
|
|
1029
|
-
left:
|
|
1030
|
-
}),
|
|
1118
|
+
u({
|
|
1119
|
+
top: z,
|
|
1120
|
+
left: B
|
|
1121
|
+
}), U();
|
|
1031
1122
|
}), f(() => {}), {
|
|
1032
|
-
keyNames:
|
|
1033
|
-
nowDataSource:
|
|
1034
|
-
pretextTableRef:
|
|
1035
|
-
tableRef:
|
|
1036
|
-
isLoading:
|
|
1037
|
-
visibleData:
|
|
1038
|
-
visibleWidthStartColumnIndex:
|
|
1039
|
-
visibleWidthEndColumnIndex:
|
|
1040
|
-
gridTemplateColumns:
|
|
1041
|
-
blurAnyElement:
|
|
1042
|
-
columns:
|
|
1043
|
-
onScroll:
|
|
1044
|
-
onWheel:
|
|
1045
|
-
topEmptyHeight:
|
|
1046
|
-
scrollbarHeight:
|
|
1047
|
-
headerHeight:
|
|
1048
|
-
headerStyles:
|
|
1049
|
-
realColumns:
|
|
1050
|
-
headerRef:
|
|
1123
|
+
keyNames: F,
|
|
1124
|
+
nowDataSource: h,
|
|
1125
|
+
pretextTableRef: r,
|
|
1126
|
+
tableRef: i,
|
|
1127
|
+
isLoading: s,
|
|
1128
|
+
visibleData: Ee,
|
|
1129
|
+
visibleWidthStartColumnIndex: ke,
|
|
1130
|
+
visibleWidthEndColumnIndex: Ae,
|
|
1131
|
+
gridTemplateColumns: W,
|
|
1132
|
+
blurAnyElement: L,
|
|
1133
|
+
columns: t,
|
|
1134
|
+
onScroll: we,
|
|
1135
|
+
onWheel: Te,
|
|
1136
|
+
topEmptyHeight: V,
|
|
1137
|
+
scrollbarHeight: A,
|
|
1138
|
+
headerHeight: T,
|
|
1139
|
+
headerStyles: E,
|
|
1140
|
+
realColumns: n,
|
|
1141
|
+
headerRef: D,
|
|
1051
1142
|
updateFooter: re,
|
|
1052
1143
|
updateFooterCellLabel: ie,
|
|
1053
1144
|
footerHeight: te,
|
|
1054
|
-
footerColumns:
|
|
1055
|
-
getFooterHeight:
|
|
1056
|
-
itemStyles:
|
|
1057
|
-
fixedLeftIndex:
|
|
1058
|
-
fixedRightIndex:
|
|
1059
|
-
fixedColumnsLeft:
|
|
1060
|
-
fixedColumnsRight:
|
|
1061
|
-
getGridStyles:
|
|
1145
|
+
footerColumns: ne,
|
|
1146
|
+
getFooterHeight: k,
|
|
1147
|
+
itemStyles: M,
|
|
1148
|
+
fixedLeftIndex: Fe,
|
|
1149
|
+
fixedRightIndex: Ie,
|
|
1150
|
+
fixedColumnsLeft: Ne,
|
|
1151
|
+
fixedColumnsRight: Pe,
|
|
1152
|
+
getGridStyles: G,
|
|
1062
1153
|
divLineHeightOffset: 20,
|
|
1063
|
-
currentRow:
|
|
1064
|
-
cellClick:
|
|
1065
|
-
headerClick:
|
|
1066
|
-
hoverRow:
|
|
1067
|
-
cellMousemove:
|
|
1068
|
-
headerChecked:
|
|
1069
|
-
headerCheckedIndeterminate:
|
|
1070
|
-
onHeaderChecked:
|
|
1071
|
-
onCellChecked:
|
|
1072
|
-
getCheckboxRecords:
|
|
1073
|
-
clearCheckboxRow:
|
|
1074
|
-
sortField:
|
|
1075
|
-
sortOrder:
|
|
1076
|
-
sort:
|
|
1077
|
-
filterPopupWidth:
|
|
1078
|
-
filterPopupId:
|
|
1079
|
-
inputFilterOptions:
|
|
1080
|
-
numberFilterOptions:
|
|
1081
|
-
filterFields:
|
|
1082
|
-
getFilterFields:
|
|
1083
|
-
filterClick:
|
|
1084
|
-
setFilter:
|
|
1085
|
-
clearFilter:
|
|
1086
|
-
setListFilterAll:
|
|
1087
|
-
isDragging:
|
|
1088
|
-
dragLineLeft:
|
|
1089
|
-
startResize:
|
|
1090
|
-
setTreeExpand:
|
|
1091
|
-
setAllTreeExpand:
|
|
1092
|
-
clearTreeExpand:
|
|
1093
|
-
defaultTreeConfig:
|
|
1094
|
-
setRowExpand:
|
|
1095
|
-
slotShowTimestamp:
|
|
1096
|
-
isRefresh:
|
|
1097
|
-
realTableHeight:
|
|
1098
|
-
realTableWidth:
|
|
1099
|
-
loadData:
|
|
1100
|
-
reloadData:
|
|
1154
|
+
currentRow: K,
|
|
1155
|
+
cellClick: q,
|
|
1156
|
+
headerClick: Re,
|
|
1157
|
+
hoverRow: ze,
|
|
1158
|
+
cellMousemove: Be,
|
|
1159
|
+
headerChecked: He,
|
|
1160
|
+
headerCheckedIndeterminate: Ue,
|
|
1161
|
+
onHeaderChecked: We,
|
|
1162
|
+
onCellChecked: qe,
|
|
1163
|
+
getCheckboxRecords: Je,
|
|
1164
|
+
clearCheckboxRow: Xe,
|
|
1165
|
+
sortField: ft,
|
|
1166
|
+
sortOrder: pt,
|
|
1167
|
+
sort: $,
|
|
1168
|
+
filterPopupWidth: ht,
|
|
1169
|
+
filterPopupId: gt,
|
|
1170
|
+
inputFilterOptions: _t,
|
|
1171
|
+
numberFilterOptions: vt,
|
|
1172
|
+
filterFields: yt,
|
|
1173
|
+
getFilterFields: bt,
|
|
1174
|
+
filterClick: xt,
|
|
1175
|
+
setFilter: St,
|
|
1176
|
+
clearFilter: Ct,
|
|
1177
|
+
setListFilterAll: wt,
|
|
1178
|
+
isDragging: Ze,
|
|
1179
|
+
dragLineLeft: Qe,
|
|
1180
|
+
startResize: $e,
|
|
1181
|
+
setTreeExpand: Y,
|
|
1182
|
+
setAllTreeExpand: tt,
|
|
1183
|
+
clearTreeExpand: nt,
|
|
1184
|
+
defaultTreeConfig: J,
|
|
1185
|
+
setRowExpand: ot,
|
|
1186
|
+
slotShowTimestamp: De,
|
|
1187
|
+
isRefresh: c,
|
|
1188
|
+
realTableHeight: a,
|
|
1189
|
+
realTableWidth: o,
|
|
1190
|
+
loadData: ut,
|
|
1191
|
+
reloadData: Q,
|
|
1101
1192
|
getTableData: dt
|
|
1102
1193
|
};
|
|
1103
|
-
},
|
|
1194
|
+
}, xe = ["onClick"], Se = { key: 0 }, Ce = { key: 1 }, z = { key: 2 }, B = {
|
|
1104
1195
|
key: 3,
|
|
1105
1196
|
style: { "text-align": "center" }
|
|
1106
|
-
},
|
|
1197
|
+
}, V = {
|
|
1107
1198
|
key: 0,
|
|
1108
1199
|
style: {
|
|
1109
1200
|
display: "inline-flex",
|
|
@@ -1114,30 +1205,30 @@ var _e = (e) => {
|
|
|
1114
1205
|
padding: "0px",
|
|
1115
1206
|
width: "14px"
|
|
1116
1207
|
}
|
|
1117
|
-
},
|
|
1208
|
+
}, H = { key: 1 }, we = ["id"], Te = { style: {
|
|
1118
1209
|
"text-align": "center",
|
|
1119
1210
|
"font-weight": "bold"
|
|
1120
|
-
} },
|
|
1211
|
+
} }, Ee = { style: {
|
|
1121
1212
|
display: "flex",
|
|
1122
1213
|
"justify-content": "center",
|
|
1123
1214
|
"margin-top": "5px"
|
|
1124
|
-
} },
|
|
1215
|
+
} }, De = { style: {
|
|
1125
1216
|
display: "flex",
|
|
1126
1217
|
"justify-content": "center",
|
|
1127
1218
|
"margin-top": "5px"
|
|
1128
|
-
} },
|
|
1219
|
+
} }, Oe = { style: { margin: "0 0 4px" } }, U = { style: {
|
|
1129
1220
|
display: "flex",
|
|
1130
1221
|
"justify-content": "center",
|
|
1131
1222
|
"margin-top": "5px",
|
|
1132
1223
|
padding: "5px 0",
|
|
1133
1224
|
"border-top": "1px solid #e0e0e0"
|
|
1134
|
-
} },
|
|
1225
|
+
} }, ke = ["onMousedown"], Ae = ["onClick", "onMouseenter"], je = {
|
|
1135
1226
|
key: 3,
|
|
1136
1227
|
style: { "margin-left": "6px" }
|
|
1137
|
-
},
|
|
1228
|
+
}, Me = { key: 4 }, Ne = { key: 5 }, Pe = { style: {
|
|
1138
1229
|
display: "flex",
|
|
1139
1230
|
gap: "4px"
|
|
1140
|
-
} },
|
|
1231
|
+
} }, Fe = ["title"], Ie = ["title"], Le = { key: 1 }, W = /* @__PURE__ */ c({
|
|
1141
1232
|
inheritAttrs: !1,
|
|
1142
1233
|
name: "pretextTable",
|
|
1143
1234
|
props: {
|
|
@@ -1205,30 +1296,30 @@ var _e = (e) => {
|
|
|
1205
1296
|
"toggleRowExpand"
|
|
1206
1297
|
],
|
|
1207
1298
|
setup(c, { expose: d, emit: f }) {
|
|
1208
|
-
let p = c, { keyNames: m, pretextTableRef: g, nowDataSource: y, tableRef: x, isLoading: w, headerHeight:
|
|
1299
|
+
let p = c, { keyNames: m, pretextTableRef: g, nowDataSource: y, tableRef: x, isLoading: w, headerHeight: j, topEmptyHeight: ce, visibleData: M, visibleWidthStartColumnIndex: le, visibleWidthEndColumnIndex: ue, columns: N, realColumns: P, 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: W, fixedLeftIndex: G, fixedRightIndex: K, fixedColumnsLeft: q, fixedColumnsRight: Re, currentRow: ze, cellClick: Be, headerClick: Ve, hoverRow: He, cellMousemove: Ue, headerChecked: We, headerCheckedIndeterminate: Ge, onHeaderChecked: Ke, onCellChecked: qe, getCheckboxRecords: Je, clearCheckboxRow: Ye, sortField: Xe, sortOrder: Ze, sort: Qe, filterPopupWidth: $e, filterPopupId: et, inputFilterOptions: tt, numberFilterOptions: nt, filterFields: J, getFilterFields: rt, filterClick: it, setFilter: Y, clearFilter: at, setListFilterAll: ot, isDragging: st, dragLineLeft: ct, startResize: X, setTreeExpand: Z, setAllTreeExpand: lt, clearTreeExpand: ut, defaultTreeConfig: Q, setRowExpand: dt, slotShowTimestamp: ft, isRefresh: pt, realTableHeight: $, realTableWidth: mt, loadData: ht, reloadData: gt, getTableData: _t } = R({
|
|
1209
1300
|
props: p,
|
|
1210
1301
|
emits: f
|
|
1211
1302
|
});
|
|
1212
1303
|
return d({
|
|
1213
1304
|
loadData: ht,
|
|
1214
1305
|
reloadData: gt,
|
|
1215
|
-
getCheckboxRecords:
|
|
1216
|
-
clearCheckboxRow:
|
|
1217
|
-
updateFooter:
|
|
1218
|
-
updateFooterCellLabel:
|
|
1219
|
-
getFooterHeight:
|
|
1306
|
+
getCheckboxRecords: Je,
|
|
1307
|
+
clearCheckboxRow: Ye,
|
|
1308
|
+
updateFooter: _e,
|
|
1309
|
+
updateFooterCellLabel: ve,
|
|
1310
|
+
getFooterHeight: be,
|
|
1220
1311
|
getTableData: _t,
|
|
1221
|
-
setTreeExpand:
|
|
1222
|
-
setAllTreeExpand:
|
|
1223
|
-
clearTreeExpand:
|
|
1224
|
-
setRowExpand:
|
|
1312
|
+
setTreeExpand: Z,
|
|
1313
|
+
setAllTreeExpand: lt,
|
|
1314
|
+
clearTreeExpand: ut,
|
|
1315
|
+
setRowExpand: dt
|
|
1225
1316
|
}), (c, d) => (h(), i("div", {
|
|
1226
1317
|
class: "cName-pretextTable",
|
|
1227
1318
|
style: { position: "relative" },
|
|
1228
1319
|
ref_key: "pretextTableRef",
|
|
1229
1320
|
ref: g
|
|
1230
1321
|
}, [
|
|
1231
|
-
s(S(
|
|
1322
|
+
s(S(ie), {
|
|
1232
1323
|
modelValue: S(w),
|
|
1233
1324
|
text: p.loadingConfig?.text || "加载中..."
|
|
1234
1325
|
}, null, 8, ["modelValue", "text"]),
|
|
@@ -1242,8 +1333,8 @@ var _e = (e) => {
|
|
|
1242
1333
|
}, { height: `${S($)}px` }]),
|
|
1243
1334
|
ref_key: "tableRef",
|
|
1244
1335
|
ref: x,
|
|
1245
|
-
onScroll: d[
|
|
1246
|
-
onWheel: d[
|
|
1336
|
+
onScroll: d[1] ||= (...e) => S(fe) && S(fe)(...e),
|
|
1337
|
+
onWheel: d[2] ||= (...e) => S(pe) && S(pe)(...e)
|
|
1247
1338
|
}, [
|
|
1248
1339
|
a("div", {
|
|
1249
1340
|
ref_key: "headerRef",
|
|
@@ -1258,61 +1349,65 @@ var _e = (e) => {
|
|
|
1258
1349
|
top: "0",
|
|
1259
1350
|
left: "0",
|
|
1260
1351
|
"z-index": "1"
|
|
1261
|
-
}, { gridTemplateColumns: S(
|
|
1352
|
+
}, { gridTemplateColumns: S(F) }])
|
|
1262
1353
|
}, [(h(!0), i(e, null, _(S(P), (f, p) => (h(), i(e, { key: "headerRow_" + p }, [(h(!0), i(e, null, _(f, (f, m) => (h(), i("div", {
|
|
1263
1354
|
key: "header_" + (f?.field || "null") + "_" + m,
|
|
1264
1355
|
class: "pretextTable-grid-header",
|
|
1265
1356
|
style: u(f ? {
|
|
1266
|
-
fontWeight: S(
|
|
1267
|
-
fontSize: S(
|
|
1357
|
+
fontWeight: S(he).fontWeight,
|
|
1358
|
+
fontSize: S(he).fontSize,
|
|
1268
1359
|
gridRow: f?.style?.gridRow || "",
|
|
1269
1360
|
gridColumn: f?.style?.gridColumn || "",
|
|
1270
1361
|
zIndex: m == 0 ? 3 : f.fixed == "left" || f.fixed == "right" ? 2 : 1,
|
|
1271
|
-
left: f.fixed == "left" ? S(
|
|
1272
|
-
right: f.fixed == "right" ? S(
|
|
1362
|
+
left: f.fixed == "left" ? S(q)[m] : "",
|
|
1363
|
+
right: f.fixed == "right" ? S(Re)[m] : "",
|
|
1273
1364
|
borderLeft: f.fixed == "right" ? "1px solid var(--pretextTable-border-color)" : "",
|
|
1274
|
-
boxShadow: f.fixed == "left" && m == S(
|
|
1365
|
+
boxShadow: f.fixed == "left" && m == S(G) ? "var(--pretextTable-shadow-color) 2px 0px 5px -1px" : f.fixed == "right" && m == S(K) ? "var(--pretextTable-shadow-color) -2px 0px 5px -1px" : "",
|
|
1275
1366
|
borderBottom: f ? "1px solid var(--pretextTable-border-color)" : "",
|
|
1276
1367
|
minHeight: "30px"
|
|
1277
1368
|
} : {}),
|
|
1278
|
-
onClick: (e) => S(
|
|
1279
|
-
}, [f ? f.type == "checkbox" && p == 0 ? (h(), i("span", Ce, [s(S(
|
|
1280
|
-
modelValue: S(
|
|
1281
|
-
indeterminate: S(
|
|
1369
|
+
onClick: (e) => S(Ve)(f)
|
|
1370
|
+
}, [f ? f.type == "checkbox" && p == 0 ? (h(), i("span", Ce, [s(S(te), {
|
|
1371
|
+
modelValue: S(We)[f.field],
|
|
1372
|
+
indeterminate: S(Ge)[f.field],
|
|
1282
1373
|
content: "",
|
|
1283
|
-
onChange:
|
|
1284
|
-
}, null, 8, [
|
|
1374
|
+
onChange: (e) => S(Ke)(f.field)
|
|
1375
|
+
}, null, 8, [
|
|
1376
|
+
"modelValue",
|
|
1377
|
+
"indeterminate",
|
|
1378
|
+
"onChange"
|
|
1379
|
+
])])) : f?.type == "seq" && p == 0 ? (h(), i("div", z, b(f.title || "序号"), 1)) : (h(), i("span", B, [
|
|
1285
1380
|
a("span", null, [f.slots?.header ? v(c.$slots, f.slots?.header, {
|
|
1286
1381
|
key: 0,
|
|
1287
1382
|
column: f,
|
|
1288
1383
|
text: f.title
|
|
1289
1384
|
}, () => [o(b(f.title), 1)]) : (h(), i(e, { key: 1 }, [o(b(f.title), 1)], 64))]),
|
|
1290
|
-
f.sortable && !f.children?.length ? (h(), i("span",
|
|
1385
|
+
f.sortable && !f.children?.length ? (h(), i("span", V, [s(S(k), {
|
|
1291
1386
|
name: "caret-up",
|
|
1292
1387
|
style: {
|
|
1293
1388
|
position: "absolute",
|
|
1294
1389
|
top: "-0.8em"
|
|
1295
1390
|
},
|
|
1296
|
-
class: l(["pretextTable-sort-icon", { "pretextTable-sort-icon-active": S(
|
|
1297
|
-
onClick:
|
|
1298
|
-
}, null, 8, ["class", "onClick"]), s(S(
|
|
1391
|
+
class: l(["pretextTable-sort-icon", { "pretextTable-sort-icon-active": S(Xe) == f.field && S(Ze) == "asc" }]),
|
|
1392
|
+
onClick: D((e) => S(Qe)(f.field, "asc"), ["stop"])
|
|
1393
|
+
}, null, 8, ["class", "onClick"]), s(S(k), {
|
|
1299
1394
|
name: "caret-down",
|
|
1300
1395
|
style: {
|
|
1301
1396
|
position: "absolute",
|
|
1302
1397
|
top: "-0.2em"
|
|
1303
1398
|
},
|
|
1304
|
-
class: l(["pretextTable-sort-icon", { "pretextTable-sort-icon-active": S(
|
|
1305
|
-
onClick:
|
|
1399
|
+
class: l(["pretextTable-sort-icon", { "pretextTable-sort-icon-active": S(Xe) == f.field && S(Ze) == "desc" }]),
|
|
1400
|
+
onClick: D((e) => S(Qe)(f.field, "desc"), ["stop"])
|
|
1306
1401
|
}, null, 8, ["class", "onClick"])])) : r("", !0),
|
|
1307
|
-
S(
|
|
1402
|
+
S(J)[m]?.type && !f.children?.length ? (h(), i("span", H, [s(S(k), {
|
|
1308
1403
|
name: "funnel",
|
|
1309
|
-
class: l(["pretextTable-filter-icon", { "pretextTable-filter-icon-active": S(
|
|
1310
|
-
onClick:
|
|
1311
|
-
}, null, 8, ["class", "onClick"]), S(
|
|
1404
|
+
class: l(["pretextTable-filter-icon", { "pretextTable-filter-icon-active": S(J)[m].isActive }]),
|
|
1405
|
+
onClick: D((e) => S(it)(m, e), ["stop"])
|
|
1406
|
+
}, null, 8, ["class", "onClick"]), S(J)[m].isShow ? (h(), n(t, {
|
|
1312
1407
|
key: 0,
|
|
1313
1408
|
to: "body"
|
|
1314
1409
|
}, [a("div", {
|
|
1315
|
-
id: S(
|
|
1410
|
+
id: S(et) + f.field,
|
|
1316
1411
|
class: "pretextTable-filter-popup",
|
|
1317
1412
|
style: u([{
|
|
1318
1413
|
"background-color": "#fff",
|
|
@@ -1322,114 +1417,114 @@ var _e = (e) => {
|
|
|
1322
1417
|
"z-index": "99999"
|
|
1323
1418
|
}, {
|
|
1324
1419
|
position: "absolute",
|
|
1325
|
-
top: S(
|
|
1326
|
-
left: S(
|
|
1420
|
+
top: S(J)[m].clientY + "px",
|
|
1421
|
+
left: S(J)[m].clientX + "px"
|
|
1327
1422
|
}])
|
|
1328
1423
|
}, [
|
|
1329
|
-
a("div",
|
|
1330
|
-
S(
|
|
1424
|
+
a("div", Te, b(f.title), 1),
|
|
1425
|
+
S(J)[m].type == "inputFilter" ? (h(), i("div", {
|
|
1331
1426
|
key: 0,
|
|
1332
|
-
style: u({ width: S(
|
|
1333
|
-
}, [a("div", null, [s(S(
|
|
1334
|
-
modelValue: S(
|
|
1335
|
-
"onUpdate:modelValue": (e) => S(
|
|
1427
|
+
style: u({ width: S($e) + "px" })
|
|
1428
|
+
}, [a("div", null, [s(S(re), {
|
|
1429
|
+
modelValue: S(J)[m].value,
|
|
1430
|
+
"onUpdate:modelValue": (e) => S(J)[m].value = e,
|
|
1336
1431
|
placeholder: "按回车筛选",
|
|
1337
1432
|
trim: !0,
|
|
1338
1433
|
style: { width: "100%" },
|
|
1339
|
-
onKeyup:
|
|
1434
|
+
onKeyup: ee((e) => S(Y)(f.field), ["enter"])
|
|
1340
1435
|
}, null, 8, [
|
|
1341
1436
|
"modelValue",
|
|
1342
1437
|
"onUpdate:modelValue",
|
|
1343
1438
|
"onKeyup"
|
|
1344
|
-
])]), a("div",
|
|
1345
|
-
modelValue: S(
|
|
1346
|
-
"onUpdate:modelValue": (e) => S(
|
|
1347
|
-
options: S(
|
|
1439
|
+
])]), a("div", Ee, [s(S(ae), {
|
|
1440
|
+
modelValue: S(J)[m].inputFilter.type,
|
|
1441
|
+
"onUpdate:modelValue": (e) => S(J)[m].inputFilter.type = e,
|
|
1442
|
+
options: S(tt)
|
|
1348
1443
|
}, null, 8, [
|
|
1349
1444
|
"modelValue",
|
|
1350
1445
|
"onUpdate:modelValue",
|
|
1351
1446
|
"options"
|
|
1352
1447
|
])])], 4)) : r("", !0),
|
|
1353
|
-
S(
|
|
1448
|
+
S(J)[m].type == "numberFilter" || S(J)[m].type == "numberFilter%" ? (h(), i("div", {
|
|
1354
1449
|
key: 1,
|
|
1355
|
-
style: u({ width: S(
|
|
1356
|
-
}, [a("div",
|
|
1357
|
-
modelValue: S(
|
|
1358
|
-
"onUpdate:modelValue": (e) => S(
|
|
1359
|
-
options: S(
|
|
1450
|
+
style: u({ width: S($e) + "px" })
|
|
1451
|
+
}, [a("div", De, [s(S(ae), {
|
|
1452
|
+
modelValue: S(J)[m].numberFilter.type,
|
|
1453
|
+
"onUpdate:modelValue": (e) => S(J)[m].numberFilter.type = e,
|
|
1454
|
+
options: S(nt)
|
|
1360
1455
|
}, null, 8, [
|
|
1361
1456
|
"modelValue",
|
|
1362
1457
|
"onUpdate:modelValue",
|
|
1363
1458
|
"options"
|
|
1364
|
-
])]), a("div", null, [s(S(
|
|
1365
|
-
modelValue: S(
|
|
1366
|
-
"onUpdate:modelValue": (e) => S(
|
|
1459
|
+
])]), a("div", null, [s(S(A), {
|
|
1460
|
+
modelValue: S(J)[m].value,
|
|
1461
|
+
"onUpdate:modelValue": (e) => S(J)[m].value = e,
|
|
1367
1462
|
placeholder: "按回车筛选",
|
|
1368
1463
|
controlConfig: { showButton: !1 },
|
|
1369
1464
|
style: { width: "100%" },
|
|
1370
|
-
onKeyup:
|
|
1465
|
+
onKeyup: ee((e) => S(Y)(f.field), ["enter"])
|
|
1371
1466
|
}, {
|
|
1372
|
-
suffix: T(() => [...d[
|
|
1467
|
+
suffix: T(() => [...d[3] ||= [o("%", -1)]]),
|
|
1373
1468
|
_: 1
|
|
1374
1469
|
}, 8, [
|
|
1375
1470
|
"modelValue",
|
|
1376
1471
|
"onUpdate:modelValue",
|
|
1377
1472
|
"onKeyup"
|
|
1378
1473
|
])])], 4)) : r("", !0),
|
|
1379
|
-
S(
|
|
1474
|
+
S(J)[m].type == "listFilter" ? (h(), i("div", {
|
|
1380
1475
|
key: 2,
|
|
1381
|
-
style: u({ maxWidth: S(
|
|
1382
|
-
}, [a("div",
|
|
1383
|
-
modelValue: S(
|
|
1384
|
-
indeterminate: S(
|
|
1476
|
+
style: u({ maxWidth: S($e) + "px" })
|
|
1477
|
+
}, [a("div", Oe, [s(S(te), {
|
|
1478
|
+
modelValue: S(J)[m].listFilter.selectedValue.length == S(J)[m].listFilter.listOptions.length,
|
|
1479
|
+
indeterminate: S(J)[m].listFilter.selectedValue.length > 0 && S(J)[m].listFilter.selectedValue.length < S(J)[m].listFilter.listOptions.length,
|
|
1385
1480
|
content: "全部",
|
|
1386
|
-
onChange: (e) => S(
|
|
1481
|
+
onChange: (e) => S(ot)(S(J)[m])
|
|
1387
1482
|
}, null, 8, [
|
|
1388
1483
|
"modelValue",
|
|
1389
1484
|
"indeterminate",
|
|
1390
1485
|
"onChange"
|
|
1391
|
-
])]), s(S(
|
|
1392
|
-
modelValue: S(
|
|
1393
|
-
"onUpdate:modelValue": (e) => S(
|
|
1394
|
-
options: S(
|
|
1395
|
-
onChange: S(
|
|
1486
|
+
])]), s(S(ne), {
|
|
1487
|
+
modelValue: S(J)[m].listFilter.selectedValue,
|
|
1488
|
+
"onUpdate:modelValue": (e) => S(J)[m].listFilter.selectedValue = e,
|
|
1489
|
+
options: S(J)[m].listFilter.listOptions,
|
|
1490
|
+
onChange: S(I)
|
|
1396
1491
|
}, null, 8, [
|
|
1397
1492
|
"modelValue",
|
|
1398
1493
|
"onUpdate:modelValue",
|
|
1399
1494
|
"options",
|
|
1400
1495
|
"onChange"
|
|
1401
1496
|
])], 4)) : r("", !0),
|
|
1402
|
-
a("div",
|
|
1403
|
-
s(S(
|
|
1497
|
+
a("div", U, [
|
|
1498
|
+
s(S(O), {
|
|
1404
1499
|
type: "primary",
|
|
1405
1500
|
size: "small",
|
|
1406
1501
|
mode: "text",
|
|
1407
|
-
onClick: (e) => S(
|
|
1502
|
+
onClick: (e) => S(Y)(f.field)
|
|
1408
1503
|
}, {
|
|
1409
|
-
default: T(() => [...d[
|
|
1504
|
+
default: T(() => [...d[4] ||= [o(" 筛选 ", -1)]]),
|
|
1410
1505
|
_: 1
|
|
1411
1506
|
}, 8, ["onClick"]),
|
|
1412
|
-
s(S(
|
|
1507
|
+
s(S(O), {
|
|
1413
1508
|
type: "primary",
|
|
1414
1509
|
size: "small",
|
|
1415
1510
|
mode: "text",
|
|
1416
|
-
onClick: (e) => S(
|
|
1511
|
+
onClick: (e) => S(at)(f.field)
|
|
1417
1512
|
}, {
|
|
1418
|
-
default: T(() => [...d[
|
|
1513
|
+
default: T(() => [...d[5] ||= [o(" 重置 ", -1)]]),
|
|
1419
1514
|
_: 1
|
|
1420
1515
|
}, 8, ["onClick"]),
|
|
1421
|
-
s(S(
|
|
1516
|
+
s(S(O), {
|
|
1422
1517
|
type: "primary",
|
|
1423
1518
|
size: "small",
|
|
1424
1519
|
mode: "text",
|
|
1425
|
-
onClick: d[
|
|
1520
|
+
onClick: d[0] ||= (e) => S(at)()
|
|
1426
1521
|
}, {
|
|
1427
|
-
default: T(() => [...d[
|
|
1522
|
+
default: T(() => [...d[6] ||= [o(" 重置所有 ", -1)]]),
|
|
1428
1523
|
_: 1
|
|
1429
1524
|
})
|
|
1430
1525
|
])
|
|
1431
|
-
], 12,
|
|
1432
|
-
])) : (h(), i("span",
|
|
1526
|
+
], 12, we)])) : r("", !0)])) : r("", !0)
|
|
1527
|
+
])) : (h(), i("span", Se)), f?.resizable && !f.children?.length ? (h(), i("div", {
|
|
1433
1528
|
key: 4,
|
|
1434
1529
|
style: {
|
|
1435
1530
|
position: "absolute",
|
|
@@ -1439,16 +1534,16 @@ var _e = (e) => {
|
|
|
1439
1534
|
height: "100%",
|
|
1440
1535
|
cursor: "col-resize"
|
|
1441
1536
|
},
|
|
1442
|
-
onMousedown:
|
|
1443
|
-
}, null, 40,
|
|
1444
|
-
S(
|
|
1537
|
+
onMousedown: D((e) => S(X)(e, f), ["prevent", "stop"])
|
|
1538
|
+
}, null, 40, ke)) : r("", !0)], 12, xe))), 128))], 64))), 128))], 4),
|
|
1539
|
+
S(M).length == 0 ? (h(), i("div", {
|
|
1445
1540
|
key: 0,
|
|
1446
1541
|
style: u([{
|
|
1447
1542
|
display: "flex",
|
|
1448
1543
|
"align-items": "center",
|
|
1449
1544
|
position: "absolute",
|
|
1450
1545
|
left: "calc(50% - 35px)"
|
|
1451
|
-
}, { minHeight: `${S($) - S(
|
|
1546
|
+
}, { minHeight: `${S($) - S(j) - S(ye) - 30}px` }])
|
|
1452
1547
|
}, " 暂无数据 ", 4)) : r("", !0),
|
|
1453
1548
|
a("div", {
|
|
1454
1549
|
class: "pretextTable-grid",
|
|
@@ -1459,13 +1554,13 @@ var _e = (e) => {
|
|
|
1459
1554
|
contain: "layout paint style",
|
|
1460
1555
|
position: "relative"
|
|
1461
1556
|
}, {
|
|
1462
|
-
minHeight: `${S($) - S(
|
|
1463
|
-
height: `${S(
|
|
1557
|
+
minHeight: `${S($) - S(j) - S(ye) - S(ge)}px`,
|
|
1558
|
+
height: `${S(me)}px`
|
|
1464
1559
|
}])
|
|
1465
1560
|
}, [a("div", {
|
|
1466
1561
|
class: "pretextTable-grid-empty",
|
|
1467
|
-
style: u({ height: `${S(
|
|
1468
|
-
}, null, 4), (h(!0), i(e, null, _(S(
|
|
1562
|
+
style: u({ height: `${S(ce)}px` })
|
|
1563
|
+
}, null, 4), (h(!0), i(e, null, _(S(M), (t, d) => (h(), i(e, { key: t[S(m).id] }, [p.expandConfig?.isExpand && t[S(m).isExpandRow] ? (h(), i("div", {
|
|
1469
1564
|
key: 0,
|
|
1470
1565
|
class: "pretextTable-grid-item",
|
|
1471
1566
|
style: u([{
|
|
@@ -1487,63 +1582,68 @@ var _e = (e) => {
|
|
|
1487
1582
|
"min-width": "100%",
|
|
1488
1583
|
"align-content": "start",
|
|
1489
1584
|
contain: "layout style paint"
|
|
1490
|
-
}, { gridTemplateColumns: S(
|
|
1491
|
-
}, [(h(!0), i(e, null, _(S(
|
|
1585
|
+
}, { gridTemplateColumns: S(F) }])
|
|
1586
|
+
}, [(h(!0), i(e, null, _(S(N), (f, g) => (h(), i("div", {
|
|
1492
1587
|
key: "item_" + f.field,
|
|
1493
1588
|
class: l(["pretextTable-grid-item pretextTable-flex-align-items-center", {
|
|
1494
|
-
"pretextTable-grid-item-hover": p.rowConfig?.isHover && S(
|
|
1495
|
-
"pretextTable-grid-item-current": p.rowConfig?.isCurrent && S(
|
|
1589
|
+
"pretextTable-grid-item-hover": p.rowConfig?.isHover && S(He)[S(m).id] == t[S(m).id],
|
|
1590
|
+
"pretextTable-grid-item-current": p.rowConfig?.isCurrent && S(ze)[S(m).id] == t[S(m).id],
|
|
1496
1591
|
"pretextTable-grid-item-stripe": p.stripe && t[S(m).stripe]
|
|
1497
1592
|
}]),
|
|
1498
1593
|
style: u({
|
|
1499
|
-
fontWeight: S(
|
|
1500
|
-
fontSize: S(
|
|
1594
|
+
fontWeight: S(W).fontWeight,
|
|
1595
|
+
fontSize: S(W).fontSize,
|
|
1501
1596
|
zIndex: +(f.fixed == "left" || f.fixed == "right"),
|
|
1502
1597
|
position: f.fixed == "left" || f.fixed == "right" ? "sticky" : "static",
|
|
1503
|
-
left: f.fixed == "left" ? S(
|
|
1504
|
-
right: f.fixed == "right" ? S(
|
|
1598
|
+
left: f.fixed == "left" ? S(q)[g] : "",
|
|
1599
|
+
right: f.fixed == "right" ? S(Re)[g] : "",
|
|
1505
1600
|
borderLeft: f.fixed == "right" ? "1px solid var(--pretextTable-border-color)" : "",
|
|
1506
|
-
boxShadow: f.fixed == "left" && g == S(
|
|
1601
|
+
boxShadow: f.fixed == "left" && g == S(G) ? "var(--pretextTable-shadow-color) 2px 0px 5px -1px" : f.fixed == "right" && g == S(K) ? "var(--pretextTable-shadow-color) -2px 0px 5px -1px" : "",
|
|
1507
1602
|
height: `${t[S(m).height]}px`,
|
|
1508
1603
|
justifyContent: f.type == "checkbox" ? "center" : ""
|
|
1509
1604
|
}),
|
|
1510
|
-
onClick: (e) => S(
|
|
1511
|
-
onMouseenter: (e) => S(
|
|
1512
|
-
}, [f.fixed == "left" || f.fixed == "right" || g >= S(
|
|
1513
|
-
E(s(S(
|
|
1605
|
+
onClick: (e) => S(Be)(t, f),
|
|
1606
|
+
onMouseenter: (e) => S(Ue)(t)
|
|
1607
|
+
}, [f.fixed == "left" || f.fixed == "right" || g >= S(le) && g <= S(ue) ? (h(), i(e, { key: 0 }, [p.treeConfig?.isOpenTree && f.treeNode ? (h(), i(e, { key: 0 }, [a("span", { style: u({ marginLeft: (Number(t[S(m).level]) - 1) * (p.treeConfig?.indent || S(Q).indent) + "px" }) }, null, 4), p.treeConfig?.showIcon === !1 ? r("", !0) : (h(), i(e, { key: 0 }, [t[p.treeConfig?.childrenField || S(Q).childrenField]?.length > 0 || p.treeConfig?.lazy && t[p.treeConfig?.hasChildField || S(Q).hasChildField] ? (h(), i(e, { key: 0 }, [
|
|
1608
|
+
E(s(S(k), {
|
|
1514
1609
|
name: "spinner",
|
|
1515
1610
|
roll: ""
|
|
1516
1611
|
}, null, 512), [[C, t[S(m).lazyLoading]]]),
|
|
1517
|
-
E(s(S(
|
|
1612
|
+
E(s(S(k), {
|
|
1518
1613
|
name: "caret-right",
|
|
1519
1614
|
style: {},
|
|
1520
1615
|
class: "pretextTable-icon",
|
|
1521
|
-
onClick:
|
|
1616
|
+
onClick: D((e) => S(Z)([t], !0), ["stop"])
|
|
1522
1617
|
}, null, 8, ["onClick"]), [[C, !t[S(m).isCollapsed] && !t[S(m).lazyLoading]]]),
|
|
1523
|
-
E(s(S(
|
|
1618
|
+
E(s(S(k), {
|
|
1524
1619
|
name: "caret-down",
|
|
1525
1620
|
style: {},
|
|
1526
1621
|
class: "pretextTable-icon",
|
|
1527
|
-
onClick:
|
|
1622
|
+
onClick: D((e) => S(Z)([t], !1), ["stop"])
|
|
1528
1623
|
}, null, 8, ["onClick"]), [[C, t[S(m).isCollapsed] && !t[S(m).lazyLoading]]])
|
|
1529
|
-
], 64)) : r("", !0)], 64))], 64)) : r("", !0), f.type == "checkbox" ? (h(), n(S(
|
|
1624
|
+
], 64)) : r("", !0)], 64))], 64)) : r("", !0), f.type == "checkbox" ? (h(), n(S(te), {
|
|
1530
1625
|
key: 1,
|
|
1531
1626
|
modelValue: t[f.field],
|
|
1532
|
-
|
|
1533
|
-
|
|
1627
|
+
indeterminate: t[S(m).checkedIndeterminate + f.field],
|
|
1628
|
+
onChange: (e) => S(qe)(t, f.field)
|
|
1629
|
+
}, null, 8, [
|
|
1630
|
+
"modelValue",
|
|
1631
|
+
"indeterminate",
|
|
1632
|
+
"onChange"
|
|
1633
|
+
])) : f.type == "seq" ? (h(), i(e, { key: 2 }, [p.treeConfig?.isOpenTree ? (h(), i("span", {
|
|
1534
1634
|
key: 0,
|
|
1535
1635
|
style: u({ marginLeft: `${(Number(t[S(m).level]) - 1) * (p.treeConfig?.indent || 20)}px` })
|
|
1536
|
-
}, null, 4)) : r("", !0), o(" " + b(t.pretextSeq), 1)], 64)) : f.type == "expand" ? (h(), i("span",
|
|
1636
|
+
}, null, 4)) : r("", !0), o(" " + b(t.pretextSeq), 1)], 64)) : f.type == "expand" ? (h(), i("span", je, [E(s(S(k), {
|
|
1537
1637
|
name: "arrow-right",
|
|
1538
1638
|
style: {},
|
|
1539
1639
|
class: "pretextTable-icon",
|
|
1540
|
-
onClick:
|
|
1541
|
-
}, null, 8, ["onClick"]), [[C, !t[S(m).isRowExpanded]]]), E(s(S(
|
|
1640
|
+
onClick: D((e) => S(dt)([t], !0), ["stop"])
|
|
1641
|
+
}, null, 8, ["onClick"]), [[C, !t[S(m).isRowExpanded]]]), E(s(S(k), {
|
|
1542
1642
|
name: "arrow-down",
|
|
1543
1643
|
style: {},
|
|
1544
1644
|
class: "pretextTable-icon",
|
|
1545
|
-
onClick:
|
|
1546
|
-
}, null, 8, ["onClick"]), [[C, t[S(m).isRowExpanded]]])])) : f.slots?.defaultType == "a" ? (h(), i("a",
|
|
1645
|
+
onClick: D((e) => S(dt)([t], !1), ["stop"])
|
|
1646
|
+
}, null, 8, ["onClick"]), [[C, t[S(m).isRowExpanded]]])])) : f.slots?.defaultType == "a" ? (h(), i("a", Me, b(t[f.field] || ""), 1)) : f.slots?.defaultType == "tag" ? (h(), i("span", Ne, [(h(!0), i(e, null, _(f.slots?.defaultProps?.tag?.options || [], (a) => (h(), i(e, null, [a.value == t[f.field] ? (h(), n(S(se), {
|
|
1547
1647
|
key: 0,
|
|
1548
1648
|
size: "mini",
|
|
1549
1649
|
border: !0,
|
|
@@ -1557,14 +1657,14 @@ var _e = (e) => {
|
|
|
1557
1657
|
"status",
|
|
1558
1658
|
"color",
|
|
1559
1659
|
"style"
|
|
1560
|
-
])) : r("", !0)], 64))), 256))])) : f.slots?.defaultType == "icon" ? E((h(), n(S(
|
|
1660
|
+
])) : r("", !0)], 64))), 256))])) : f.slots?.defaultType == "icon" ? E((h(), n(S(k), {
|
|
1561
1661
|
key: 6,
|
|
1562
1662
|
name: f.slots?.defaultProps?.icon?.name,
|
|
1563
1663
|
style: u(f.slots?.defaultProps?.icon?.style || {})
|
|
1564
|
-
}, null, 8, ["name", "style"])), [[C, t[f.field]]]) : f.slots?.defaultType == "buttons" ? (h(), i(e, { key: 7 }, [f.slots?.defaultProps?.buttons?.options?.length ? (h(!0), i(e, { key: 0 }, _(f.slots?.defaultProps?.buttons?.options || [], (n) => (h(), i("div",
|
|
1664
|
+
}, null, 8, ["name", "style"])), [[C, t[f.field]]]) : f.slots?.defaultType == "buttons" ? (h(), i(e, { key: 7 }, [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", {
|
|
1565
1665
|
key: 0,
|
|
1566
1666
|
title: n.tip || ""
|
|
1567
|
-
}, [s(S(
|
|
1667
|
+
}, [s(S(O), {
|
|
1568
1668
|
size: n.size || "mini",
|
|
1569
1669
|
status: n.type == "primary" ? "success" : n.type == "danger" ? "error" : void 0,
|
|
1570
1670
|
mode: n.mode || "button",
|
|
@@ -1583,7 +1683,7 @@ var _e = (e) => {
|
|
|
1583
1683
|
"disabled",
|
|
1584
1684
|
"loading",
|
|
1585
1685
|
"onClick"
|
|
1586
|
-
])], 8,
|
|
1686
|
+
])], 8, Fe)) : r("", !0)], 64))), 256))]))), 256)) : r("", !0)], 64)) : f.slots?.defaultType == "switch" ? (h(), i(e, { key: 8 }, [!f.slots?.defaultProps?.switch?.showField || t[f.slots?.defaultProps?.switch?.showField] ? (h(), n(S(oe), {
|
|
1587
1687
|
key: 0,
|
|
1588
1688
|
size: "mini",
|
|
1589
1689
|
modelValue: t[f.field],
|
|
@@ -1612,8 +1712,8 @@ var _e = (e) => {
|
|
|
1612
1712
|
row: t,
|
|
1613
1713
|
column: f,
|
|
1614
1714
|
rowIndex: d
|
|
1615
|
-
}, () => [o(b(t[f.field] ?? ""), 1)]) : r("", !0)], 64)) : (h(), i(e, { key: 1 }, [o(b(t[f.field] ?? ""), 1)], 64))], 10,
|
|
1616
|
-
p.showFooter && S(
|
|
1715
|
+
}, () => [o(b(t[f.field] ?? ""), 1)]) : r("", !0)], 64)) : (h(), i(e, { key: 1 }, [o(b(t[f.field] ?? ""), 1)], 64))], 10, Ie))], 64)) : r("", !0)], 46, Ae))), 128))], 4))], 64))), 128))], 4),
|
|
1716
|
+
p.showFooter && S(L).length > 0 ? (h(), i("div", {
|
|
1617
1717
|
key: 1,
|
|
1618
1718
|
style: u([{
|
|
1619
1719
|
display: "grid",
|
|
@@ -1624,17 +1724,17 @@ var _e = (e) => {
|
|
|
1624
1724
|
contain: "layout paint style",
|
|
1625
1725
|
bottom: "0",
|
|
1626
1726
|
"z-index": "1"
|
|
1627
|
-
}, { gridTemplateColumns: S(
|
|
1628
|
-
}, [(h(!0), i(e, null, _(S(
|
|
1727
|
+
}, { gridTemplateColumns: S(F) }])
|
|
1728
|
+
}, [(h(!0), i(e, null, _(S(L), (t) => (h(), i(e, null, [(h(!0), i(e, null, _(t, (e, t) => (h(), i("div", {
|
|
1629
1729
|
key: "footer_" + e.field,
|
|
1630
1730
|
class: "pretextTable-grid-footer",
|
|
1631
1731
|
style: u({
|
|
1632
|
-
fontSize: S(
|
|
1732
|
+
fontSize: S(he).fontSize,
|
|
1633
1733
|
zIndex: t == 0 ? 3 : e.fixed == "left" || e.fixed == "right" ? 2 : 1,
|
|
1634
|
-
left: e.fixed == "left" ? S(
|
|
1635
|
-
right: e.fixed == "right" ? S(
|
|
1734
|
+
left: e.fixed == "left" ? S(q)[t] : "",
|
|
1735
|
+
right: e.fixed == "right" ? S(Re)[t] : "",
|
|
1636
1736
|
borderLeft: e.fixed == "right" ? "1px solid var(--pretextTable-border-color)" : "",
|
|
1637
|
-
boxShadow: e.fixed == "left" && t == S(
|
|
1737
|
+
boxShadow: e.fixed == "left" && t == S(G) ? "var(--pretextTable-shadow-color) 2px 0px 5px -1px" : e.fixed == "right" && t == S(K) ? "var(--pretextTable-shadow-color) -2px 0px 5px -1px" : "",
|
|
1638
1738
|
height: `${e.height}px`,
|
|
1639
1739
|
maxHeight: `${e.height}px`
|
|
1640
1740
|
})
|
|
@@ -1643,7 +1743,7 @@ var _e = (e) => {
|
|
|
1643
1743
|
footerColumn: e,
|
|
1644
1744
|
footerData: e.data,
|
|
1645
1745
|
footerRowIndex: t
|
|
1646
|
-
}, () => [o(b(e.data ?? ""), 1)]) : (h(), i("span",
|
|
1746
|
+
}, () => [o(b(e.data ?? ""), 1)]) : (h(), i("span", Le, b(e.data ?? ""), 1))], 4))), 128))], 64))), 256))], 4)) : r("", !0)
|
|
1647
1747
|
], 36),
|
|
1648
1748
|
E(a("div", { style: u([{
|
|
1649
1749
|
position: "absolute",
|
|
@@ -1654,15 +1754,15 @@ var _e = (e) => {
|
|
|
1654
1754
|
"z-index": "99999",
|
|
1655
1755
|
"box-shadow": "0 0 2px rgba(64, 158, 255, 0.5)"
|
|
1656
1756
|
}, {
|
|
1657
|
-
transform: `translateX(${S(
|
|
1757
|
+
transform: `translateX(${S(ct)}px)`,
|
|
1658
1758
|
height: S($) + "px"
|
|
1659
|
-
}]) }, null, 4), [[C, S(
|
|
1759
|
+
}]) }, null, 4), [[C, S(st)]]),
|
|
1660
1760
|
a("div", { style: u({ backgroundColor: S(pt) ? "red" : "" }) }, null, 4)
|
|
1661
1761
|
], 512));
|
|
1662
1762
|
}
|
|
1663
|
-
}),
|
|
1664
|
-
|
|
1665
|
-
e.component("HolyesTable",
|
|
1763
|
+
}), G = W;
|
|
1764
|
+
G.install = (e) => {
|
|
1765
|
+
e.component("HolyesTable", G);
|
|
1666
1766
|
};
|
|
1667
1767
|
//#endregion
|
|
1668
|
-
export {
|
|
1768
|
+
export { G as default, W as pretextTable };
|