dpot-ui 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +122 -117
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -16,33 +16,33 @@ var x = function() {
|
|
|
16
16
|
staticClass: "dp-check_name_"
|
|
17
17
|
}, [e._v(e._s(e.data.name))])]);
|
|
18
18
|
}, S = [];
|
|
19
|
-
function h(e, o, r, t, n,
|
|
20
|
-
var
|
|
21
|
-
o && (
|
|
22
|
-
var
|
|
23
|
-
if (a ? (
|
|
24
|
-
|
|
19
|
+
function h(e, o, r, t, n, l, a, i) {
|
|
20
|
+
var s = typeof e == "function" ? e.options : e;
|
|
21
|
+
o && (s.render = o, s.staticRenderFns = r, s._compiled = !0), t && (s.functional = !0), l && (s._scopeId = "data-v-" + l);
|
|
22
|
+
var c;
|
|
23
|
+
if (a ? (c = function(d) {
|
|
24
|
+
d = d || // cached call
|
|
25
25
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
26
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
27
|
-
},
|
|
26
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !d && typeof __VUE_SSR_CONTEXT__ < "u" && (d = __VUE_SSR_CONTEXT__), n && n.call(this, d), d && d._registeredComponents && d._registeredComponents.add(a);
|
|
27
|
+
}, s._ssrRegister = c) : n && (c = i ? function() {
|
|
28
28
|
n.call(
|
|
29
29
|
this,
|
|
30
|
-
(
|
|
30
|
+
(s.functional ? this.parent : this).$root.$options.shadowRoot
|
|
31
31
|
);
|
|
32
|
-
} : n),
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
var I =
|
|
36
|
-
|
|
37
|
-
return
|
|
32
|
+
} : n), c)
|
|
33
|
+
if (s.functional) {
|
|
34
|
+
s._injectStyles = c;
|
|
35
|
+
var I = s.render;
|
|
36
|
+
s.render = function($, p) {
|
|
37
|
+
return c.call(p), I($, p);
|
|
38
38
|
};
|
|
39
39
|
} else {
|
|
40
|
-
var f =
|
|
41
|
-
|
|
40
|
+
var f = s.beforeCreate;
|
|
41
|
+
s.beforeCreate = f ? [].concat(f, c) : [c];
|
|
42
42
|
}
|
|
43
43
|
return {
|
|
44
44
|
exports: e,
|
|
45
|
-
options:
|
|
45
|
+
options: s
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
const w = {
|
|
@@ -66,7 +66,7 @@ const w = {
|
|
|
66
66
|
this.$emit("change", e, this.data.key);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, b = {};
|
|
70
70
|
var k = /* @__PURE__ */ h(
|
|
71
71
|
w,
|
|
72
72
|
x,
|
|
@@ -78,13 +78,13 @@ var k = /* @__PURE__ */ h(
|
|
|
78
78
|
null
|
|
79
79
|
);
|
|
80
80
|
function D(e) {
|
|
81
|
-
for (let o in
|
|
82
|
-
this[o] =
|
|
81
|
+
for (let o in b)
|
|
82
|
+
this[o] = b[o];
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const F = /* @__PURE__ */ function() {
|
|
85
85
|
return k.exports;
|
|
86
86
|
}();
|
|
87
|
-
var
|
|
87
|
+
var j = function() {
|
|
88
88
|
var e = this, o = e.$createElement, r = e._self._c || o;
|
|
89
89
|
return r("div", {
|
|
90
90
|
class: ["dp-radio_view_", e.value === e.data.code && "dp-radio_view_checked_"],
|
|
@@ -101,7 +101,7 @@ var F = function() {
|
|
|
101
101
|
}), r("span", {
|
|
102
102
|
staticClass: "dp-radio_name_"
|
|
103
103
|
}, [e._v(e._s(e.data.name))])]);
|
|
104
|
-
},
|
|
104
|
+
}, H = [];
|
|
105
105
|
const O = {
|
|
106
106
|
name: "dp-radio",
|
|
107
107
|
props: {
|
|
@@ -122,23 +122,23 @@ const O = {
|
|
|
122
122
|
this.$emit("change", this.data.code, this.data.key);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
},
|
|
126
|
-
var
|
|
125
|
+
}, g = {};
|
|
126
|
+
var E = /* @__PURE__ */ h(
|
|
127
127
|
O,
|
|
128
|
-
F,
|
|
129
128
|
j,
|
|
129
|
+
H,
|
|
130
130
|
!1,
|
|
131
|
-
|
|
131
|
+
M,
|
|
132
132
|
"e7bf9628",
|
|
133
133
|
null,
|
|
134
134
|
null
|
|
135
135
|
);
|
|
136
|
-
function
|
|
137
|
-
for (let o in
|
|
138
|
-
this[o] =
|
|
136
|
+
function M(e) {
|
|
137
|
+
for (let o in g)
|
|
138
|
+
this[o] = g[o];
|
|
139
139
|
}
|
|
140
|
-
const
|
|
141
|
-
return
|
|
140
|
+
const R = /* @__PURE__ */ function() {
|
|
141
|
+
return E.exports;
|
|
142
142
|
}();
|
|
143
143
|
var T = function() {
|
|
144
144
|
var e = this, o = e.$createElement, r = e._self._c || o;
|
|
@@ -183,8 +183,8 @@ var T = function() {
|
|
|
183
183
|
const z = {
|
|
184
184
|
name: "dp-checkfilter",
|
|
185
185
|
components: {
|
|
186
|
-
DpCheck:
|
|
187
|
-
DpRadio:
|
|
186
|
+
DpCheck: F,
|
|
187
|
+
DpRadio: R
|
|
188
188
|
},
|
|
189
189
|
props: {
|
|
190
190
|
title: {
|
|
@@ -213,25 +213,25 @@ const z = {
|
|
|
213
213
|
this.$emit("change", { key: o, value: [e].flat() });
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
},
|
|
217
|
-
var
|
|
216
|
+
}, y = {};
|
|
217
|
+
var K = /* @__PURE__ */ h(
|
|
218
218
|
z,
|
|
219
219
|
T,
|
|
220
220
|
W,
|
|
221
221
|
!1,
|
|
222
|
-
|
|
222
|
+
L,
|
|
223
223
|
"20c78138",
|
|
224
224
|
null,
|
|
225
225
|
null
|
|
226
226
|
);
|
|
227
|
-
function
|
|
228
|
-
for (let o in
|
|
229
|
-
this[o] =
|
|
227
|
+
function L(e) {
|
|
228
|
+
for (let o in y)
|
|
229
|
+
this[o] = y[o];
|
|
230
230
|
}
|
|
231
|
-
const
|
|
232
|
-
return
|
|
231
|
+
const B = /* @__PURE__ */ function() {
|
|
232
|
+
return K.exports;
|
|
233
233
|
}();
|
|
234
|
-
var
|
|
234
|
+
var P = function() {
|
|
235
235
|
var e = this, o = e.$createElement, r = e._self._c || o;
|
|
236
236
|
return r("li", {
|
|
237
237
|
class: ["dp-table_header_item_ dp-table_header_item_height_", e.item.children ? "dp-table_header_item_group_" : "dp-table_header_item_border_", e.item.sortKey && "dp-table_header_item_cursor_"],
|
|
@@ -272,11 +272,11 @@ var B = function() {
|
|
|
272
272
|
changeSort: e.handleItemClick,
|
|
273
273
|
changeFilter: e.handleChangeFilter
|
|
274
274
|
},
|
|
275
|
-
scopedSlots: e._u([e._l(e.$slots, function(n,
|
|
275
|
+
scopedSlots: e._u([e._l(e.$slots, function(n, l) {
|
|
276
276
|
return {
|
|
277
|
-
key:
|
|
277
|
+
key: l,
|
|
278
278
|
fn: function() {
|
|
279
|
-
return [e._t(
|
|
279
|
+
return [e._t(l)];
|
|
280
280
|
},
|
|
281
281
|
proxy: !0
|
|
282
282
|
};
|
|
@@ -305,7 +305,7 @@ var B = function() {
|
|
|
305
305
|
const N = {
|
|
306
306
|
name: "dp-table-header-item",
|
|
307
307
|
components: {
|
|
308
|
-
DpCheckfilter:
|
|
308
|
+
DpCheckfilter: B
|
|
309
309
|
},
|
|
310
310
|
props: {
|
|
311
311
|
item: {
|
|
@@ -341,7 +341,7 @@ const N = {
|
|
|
341
341
|
this.widthObj = { ...this.widthObj, ...e }, this.$emit("changeWidth", e);
|
|
342
342
|
},
|
|
343
343
|
handleItemClick(e, o) {
|
|
344
|
-
this.$emit("changeSort", { ...e }, o);
|
|
344
|
+
e.sortKey && this.$emit("changeSort", { ...e }, o);
|
|
345
345
|
},
|
|
346
346
|
handleChangeFilter(e) {
|
|
347
347
|
this.$emit("changeFilter", { [this.fullCode.join("_")]: { target: this.fullCode, ...e, filterKey: this.item.filterKey || this.item.code, filterFn: this.item.filterFn } });
|
|
@@ -353,20 +353,20 @@ const N = {
|
|
|
353
353
|
beforeUnMounted() {
|
|
354
354
|
this.resizer && this.resizer.unobserve(this.$el);
|
|
355
355
|
}
|
|
356
|
-
},
|
|
356
|
+
}, v = {};
|
|
357
357
|
var U = /* @__PURE__ */ h(
|
|
358
358
|
N,
|
|
359
|
-
|
|
359
|
+
P,
|
|
360
360
|
A,
|
|
361
361
|
!1,
|
|
362
362
|
q,
|
|
363
|
-
"
|
|
363
|
+
"5cf7a766",
|
|
364
364
|
null,
|
|
365
365
|
null
|
|
366
366
|
);
|
|
367
367
|
function q(e) {
|
|
368
|
-
for (let o in
|
|
369
|
-
this[o] =
|
|
368
|
+
for (let o in v)
|
|
369
|
+
this[o] = v[o];
|
|
370
370
|
}
|
|
371
371
|
const V = /* @__PURE__ */ function() {
|
|
372
372
|
return U.exports;
|
|
@@ -374,11 +374,11 @@ const V = /* @__PURE__ */ function() {
|
|
|
374
374
|
const t = e[r];
|
|
375
375
|
if (!t.isFixed || !o[t.code])
|
|
376
376
|
return {};
|
|
377
|
-
const n = (a) => typeof a == "number" ? [a] : Object.values(a).map((
|
|
378
|
-
return { position: "sticky", left: `${e.filter((a,
|
|
379
|
-
}, _ = (e, o) => {
|
|
380
|
-
const
|
|
381
|
-
return o.length > 1 ? _(
|
|
377
|
+
const n = (a) => typeof a == "number" ? [a] : Object.values(a).map((i) => n(i)).flat();
|
|
378
|
+
return { position: "sticky", left: `${e.filter((a, i) => i < r && a.isFixed).map((a) => n(o[a.code])).reduce((a, i) => parseFloat(a) + parseFloat(i), 0)}px` };
|
|
379
|
+
}, _ = (e, o, r) => {
|
|
380
|
+
const t = e[o[0]];
|
|
381
|
+
return o.length > 1 ? _(t, o.slice(1)) : e[r] || t;
|
|
382
382
|
};
|
|
383
383
|
var X = function() {
|
|
384
384
|
var e = this, o = e.$createElement, r = e._self._c || o;
|
|
@@ -406,7 +406,7 @@ var X = function() {
|
|
|
406
406
|
changeSort: e.handleChangeSort,
|
|
407
407
|
changeFilter: e.handleChangeFilter
|
|
408
408
|
},
|
|
409
|
-
scopedSlots: e._u([e._l(e.$slots, function(
|
|
409
|
+
scopedSlots: e._u([e._l(e.$slots, function(l, a) {
|
|
410
410
|
return {
|
|
411
411
|
key: a,
|
|
412
412
|
fn: function() {
|
|
@@ -507,9 +507,7 @@ var ee = function() {
|
|
|
507
507
|
ref: "table",
|
|
508
508
|
staticClass: "dp-table_view_",
|
|
509
509
|
on: {
|
|
510
|
-
|
|
511
|
-
return e.handleScroll.apply(null, arguments);
|
|
512
|
-
}
|
|
510
|
+
scroll: e.handleScroll
|
|
513
511
|
}
|
|
514
512
|
}, [r("dp-header", {
|
|
515
513
|
ref: "header",
|
|
@@ -536,14 +534,14 @@ var ee = function() {
|
|
|
536
534
|
proxy: !0
|
|
537
535
|
};
|
|
538
536
|
})], null, !0)
|
|
539
|
-
}), r("div"), r("
|
|
537
|
+
}), r("div"), r("ul", {
|
|
540
538
|
staticClass: "dp-table_body_view_",
|
|
541
539
|
style: {
|
|
542
|
-
height: e.fullHeight
|
|
540
|
+
height: `${e.fullHeight}px`,
|
|
543
541
|
paddingTop: e.beforeHeight + "px"
|
|
544
542
|
}
|
|
545
543
|
}, e._l(e.resultData, function(t) {
|
|
546
|
-
return r("
|
|
544
|
+
return r("li", {
|
|
547
545
|
key: t.__key,
|
|
548
546
|
class: ["dp-table_body_item_", t.__isTotalData && "dp-table_total_view_"],
|
|
549
547
|
style: Object.assign({}, t.style, e.hoverStyle, e.computEvenColor(t.__sub), {
|
|
@@ -557,12 +555,12 @@ var ee = function() {
|
|
|
557
555
|
return e.handleChangeFlag(!1);
|
|
558
556
|
}
|
|
559
557
|
}
|
|
560
|
-
}, [e._l(e.deepHeadData, function(n,
|
|
558
|
+
}, [e._l(e.deepHeadData, function(n, l) {
|
|
561
559
|
return [t[n.code] instanceof Object ? [t[n.code].slot ? r("div", {
|
|
562
560
|
class: ["dp-table_body_item_group_col_", n.isFixed && "dp-table_fixed_bg_", !!e.scrollLeft && "dp-table_fixed_shadow_"],
|
|
563
561
|
style: Object.assign({
|
|
564
562
|
borderColor: e.borderColor
|
|
565
|
-
}, n.style, n.colStyle, e.computEvenColor(t.__sub), e.fixedStyle[
|
|
563
|
+
}, n.style, n.colStyle, e.computEvenColor(t.__sub), e.fixedStyle[l], e.computWidth(t[n.code]))
|
|
566
564
|
}, e._l([t[n.code].slot].flat(), function(a) {
|
|
567
565
|
return r("div", {
|
|
568
566
|
key: a,
|
|
@@ -581,10 +579,10 @@ var ee = function() {
|
|
|
581
579
|
class: ["dp-table_body_item_group_col_", n.isFixed && "dp-table_fixed_bg_", !!e.scrollLeft && "dp-table_fixed_shadow_"],
|
|
582
580
|
style: Object.assign({
|
|
583
581
|
borderColor: e.borderColor
|
|
584
|
-
}, n.style, n.colStyle, e.computEvenColor(t.__sub), e.fixedStyle[
|
|
585
|
-
}, e._l([t[n.code].raw].flat(), function(a,
|
|
582
|
+
}, n.style, n.colStyle, e.computEvenColor(t.__sub), e.fixedStyle[l], e.computWidth(t[n.code]))
|
|
583
|
+
}, e._l([t[n.code].raw].flat(), function(a, i) {
|
|
586
584
|
return r("div", {
|
|
587
|
-
key:
|
|
585
|
+
key: i,
|
|
588
586
|
staticClass: "dp-table_body_item_child_",
|
|
589
587
|
style: Object.assign({
|
|
590
588
|
borderColor: e.borderColor,
|
|
@@ -601,10 +599,10 @@ var ee = function() {
|
|
|
601
599
|
class: ["dp-table_body_item_group_col_", n.isFixed && "dp-table_fixed_bg_", !!e.scrollLeft && "dp-table_fixed_shadow_"],
|
|
602
600
|
style: Object.assign({
|
|
603
601
|
borderColor: e.borderColor
|
|
604
|
-
}, n.style, n.colStyle, e.computEvenColor(t.__sub), e.fixedStyle[
|
|
605
|
-
}, e._l([t[n.code].value].flat(), function(a,
|
|
602
|
+
}, n.style, n.colStyle, e.computEvenColor(t.__sub), e.fixedStyle[l], e.computWidth(t[n.code]))
|
|
603
|
+
}, e._l([t[n.code].value].flat(), function(a, i) {
|
|
606
604
|
return r("div", {
|
|
607
|
-
key:
|
|
605
|
+
key: i,
|
|
608
606
|
staticClass: "dp-table_body_item_child_",
|
|
609
607
|
style: Object.assign({
|
|
610
608
|
borderColor: e.borderColor,
|
|
@@ -620,7 +618,7 @@ var ee = function() {
|
|
|
620
618
|
borderColor: e.borderColor,
|
|
621
619
|
padding: e.itemPadding,
|
|
622
620
|
justifyContent: e.dir
|
|
623
|
-
}, n.style, n.colStyle, e.computEvenColor(t.__sub), e.fixedStyle[
|
|
621
|
+
}, n.style, n.colStyle, e.computEvenColor(t.__sub), e.fixedStyle[l])
|
|
624
622
|
}, [e._v(e._s(t[n.code]))])];
|
|
625
623
|
}), t.__isTotalData ? r("span", {
|
|
626
624
|
staticClass: "dp-table_total_border_",
|
|
@@ -726,42 +724,29 @@ const oe = {
|
|
|
726
724
|
return e.length ? [...this.bodyData].filter((o) => {
|
|
727
725
|
let r = !0;
|
|
728
726
|
return e.some((t) => {
|
|
729
|
-
if (!t.value.includes(_(o, t.target)))
|
|
727
|
+
if (!t.value.includes(_(o, t.target, t.filterKey)))
|
|
730
728
|
return r = !1, !0;
|
|
731
729
|
}), r;
|
|
732
730
|
}) : this.bodyData;
|
|
733
731
|
},
|
|
734
|
-
//
|
|
735
|
-
|
|
736
|
-
return this.
|
|
737
|
-
let r = 0;
|
|
738
|
-
if (this.rowHeight)
|
|
739
|
-
r = this.rowHeight;
|
|
740
|
-
else if (this.rowItemHeight) {
|
|
741
|
-
const t = {}, n = (a, l) => {
|
|
742
|
-
l.children ? l.children.forEach((i) => n((a || {})[i.code], { ...i, code: `${l.code}_${i.code}` })) : t[l.code] = a;
|
|
743
|
-
};
|
|
744
|
-
this.headData.forEach((a) => n(e[a.code], a)), r = Math.max(...this.deepHeadData.map((a) => t[a.code] instanceof Object ? t[a.code].slot ? [t[a.code].slot].flat().length : t[a.code].raw ? [t[a.code].raw].flat().length : t[a.code].value ? [t[a.code].value].flat().length : 1 : 1)) * this.rowItemHeight;
|
|
745
|
-
}
|
|
746
|
-
return r;
|
|
747
|
-
});
|
|
732
|
+
// 表体总高度
|
|
733
|
+
fullHeight() {
|
|
734
|
+
return this.fullHeightInfo.reduce((e, o) => e + o, 0);
|
|
748
735
|
},
|
|
749
736
|
// 表体渲染数据
|
|
750
737
|
resultData() {
|
|
751
738
|
return Object.keys(this.widthInfo).length < this.headData.length || !this.headData.length ? [] : (this.sortInfo.value ? [...this.filterBodyData].sort((o, r) => {
|
|
752
|
-
const t = _(o, this.sortInfo.
|
|
739
|
+
const t = _(o, this.sortInfo.target, this.sortInfo.sortKey), n = _(r, this.sortInfo.target, this.sortInfo.sortKey);
|
|
753
740
|
return this.sortInfo.value === "up" ? t - n : n - t;
|
|
754
741
|
}) : this.filterBodyData).slice(this.beforeIndex, this.currentIndex).concat(this.totalData ? [{ ...this.totalData, __sub: "", __isTotalData: !0 }] : []).map((o, r) => {
|
|
755
|
-
const t =
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
d instanceof Object || (t[i.code] = { value: d }), t[i.code] = { ...t[i.code], isMergeIgnored: !0 };
|
|
764
|
-
}), t[s].isMerge = !0, t[s].width = l.map((i) => this.widthInfo[i.code]).reduce((i, d) => i + d, 0);
|
|
742
|
+
const t = this.handleComputItem(o);
|
|
743
|
+
return Object.keys(t).forEach((n) => {
|
|
744
|
+
if (t[n] instanceof Object && (t[n].merge || 0) > 1) {
|
|
745
|
+
const l = this.deepHeadData.findIndex((i) => i.code === n), a = this.deepHeadData.slice(l, l + t[n].merge);
|
|
746
|
+
a.forEach((i) => {
|
|
747
|
+
const s = t[i.code];
|
|
748
|
+
s instanceof Object || (t[i.code] = { value: s }), t[i.code] = { ...t[i.code], isMergeIgnored: !0 };
|
|
749
|
+
}), t[n].isMerge = !0, t[n].width = a.map((i) => this.widthInfo[i.code]).reduce((i, s) => i + s, 0);
|
|
765
750
|
}
|
|
766
751
|
}), {
|
|
767
752
|
__sub: r + parseInt(this.basicSub) + this.beforeIndex,
|
|
@@ -779,22 +764,17 @@ const oe = {
|
|
|
779
764
|
hoverStyle() {
|
|
780
765
|
return this.headData.map((e) => this.hoverFlag ? { background: this.hoverColor } : {});
|
|
781
766
|
},
|
|
782
|
-
// 表体总高度
|
|
783
|
-
fullHeight() {
|
|
784
|
-
return this.fullHeightInfo.reduce((e, o) => e + o, 0);
|
|
785
|
-
},
|
|
786
|
-
// 计算单行高度
|
|
787
|
-
resultRowHeight() {
|
|
788
|
-
return this.rowHeight || (this.rowItemHeight * (this.bodyData.length + (this.totalData ? 1 : 0)) === this.fullHeight ? this.rowItemHeight : this.rowHeight);
|
|
789
|
-
},
|
|
790
767
|
// 前置填充高度
|
|
791
768
|
beforeHeight() {
|
|
792
|
-
return Math.max(this.
|
|
769
|
+
return Math.max(this.rowHeight ? this.beforeIndex * this.rowHeight : this.fullHeightInfo.slice(0, this.beforeIndex).reduce((e, o) => e + o, 0), 0);
|
|
793
770
|
}
|
|
794
771
|
},
|
|
795
772
|
watch: {
|
|
796
773
|
bodyData() {
|
|
797
774
|
this.$refs.table.scrollTop = 0, this.$refs.table.scrollLeft = 0, this.scrollLeft = 0, this.beforeIndex = 0, this.currentIndex = 30;
|
|
775
|
+
},
|
|
776
|
+
filterBodyData() {
|
|
777
|
+
this.handleComputItemHeight();
|
|
798
778
|
}
|
|
799
779
|
},
|
|
800
780
|
data() {
|
|
@@ -805,6 +785,7 @@ const oe = {
|
|
|
805
785
|
beforeIndex: 0,
|
|
806
786
|
timer: null,
|
|
807
787
|
hoverFlag: !1,
|
|
788
|
+
fullHeightInfo: [],
|
|
808
789
|
sortInfo: {
|
|
809
790
|
target: [],
|
|
810
791
|
value: null
|
|
@@ -821,21 +802,45 @@ const oe = {
|
|
|
821
802
|
computEvenColor(e) {
|
|
822
803
|
return this.evenColor ? e % 2 ? {} : { background: this.evenColor } : {};
|
|
823
804
|
},
|
|
805
|
+
// 计算单行高度
|
|
806
|
+
handleComputItemHeight() {
|
|
807
|
+
this.fullHeightInfo = this.filterBodyData.concat(this.totalData ? [this.totalData] : []).map((e, o) => {
|
|
808
|
+
let r = 0;
|
|
809
|
+
if (this.rowHeight)
|
|
810
|
+
r = this.rowHeight;
|
|
811
|
+
else if (this.rowItemHeight) {
|
|
812
|
+
const t = {}, n = (a, i) => {
|
|
813
|
+
i.children ? i.children.forEach((s) => n((a || {})[s.code], { ...s, code: `${i.code}_${s.code}` })) : t[i.code] = a;
|
|
814
|
+
};
|
|
815
|
+
this.headData.forEach((a) => n(e[a.code], a)), r = Math.max(...this.deepHeadData.map((a) => t[a.code] instanceof Object ? t[a.code].slot ? [t[a.code].slot].flat().length : t[a.code].raw ? [t[a.code].raw].flat().length : t[a.code].value ? [t[a.code].value].flat().length : 1 : 1)) * this.rowItemHeight;
|
|
816
|
+
}
|
|
817
|
+
return r;
|
|
818
|
+
});
|
|
819
|
+
},
|
|
824
820
|
// 收集表头各单元格宽度数据
|
|
825
821
|
handleSetWidthInfo(e) {
|
|
826
822
|
this.widthInfo = e;
|
|
827
823
|
},
|
|
824
|
+
// 递归铺开数据
|
|
825
|
+
handleComputItem(e) {
|
|
826
|
+
let o = {};
|
|
827
|
+
const r = (t, n) => {
|
|
828
|
+
n.children ? n.children.forEach((l) => r((t || {})[l.code], { ...l, code: `${n.code}_${l.code}` })) : o[n.code] = t;
|
|
829
|
+
};
|
|
830
|
+
return this.headData.filter((t) => t.children).forEach((t) => r(e[t.code], t)), o;
|
|
831
|
+
},
|
|
828
832
|
// 滚动事件
|
|
829
833
|
handleScroll(e) {
|
|
830
834
|
this.scrollLeft = e.target.scrollLeft, clearTimeout(this.timer), this.timer = setTimeout(() => {
|
|
831
|
-
|
|
832
|
-
|
|
835
|
+
const o = e.target.scrollTop - this.$el.offsetHeight / 2;
|
|
836
|
+
if (this.rowHeight)
|
|
837
|
+
this.beforeIndex = Math.max(Math.floor(o / this.rowHeight), 0), this.currentIndex = Math.max(this.beforeIndex + Math.ceil(this.$el.offsetHeight / this.rowHeight) * 2, 30);
|
|
833
838
|
else {
|
|
834
|
-
let
|
|
839
|
+
let r = 0;
|
|
835
840
|
this.beforeIndex = this.fullHeightInfo.findIndex((t) => {
|
|
836
|
-
const n =
|
|
837
|
-
return n || (
|
|
838
|
-
}),
|
|
841
|
+
const n = r + t >= o;
|
|
842
|
+
return n || (r += t), n;
|
|
843
|
+
}), this.currentIndex = Math.min(this.beforeIndex + 30, this.filterBodyData.length);
|
|
839
844
|
}
|
|
840
845
|
}, 10);
|
|
841
846
|
},
|
|
@@ -864,7 +869,7 @@ var re = /* @__PURE__ */ h(
|
|
|
864
869
|
te,
|
|
865
870
|
!1,
|
|
866
871
|
ne,
|
|
867
|
-
"
|
|
872
|
+
"1473e8c5",
|
|
868
873
|
null,
|
|
869
874
|
null
|
|
870
875
|
);
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.dp-check_view_[data-v-1b8ae42a]{font-size:14px;padding:5px 10px;min-width:60px;display:flex;cursor:pointer}.dp-check_view_[data-v-1b8ae42a]:hover{background-color:#e8e8e8}.dp-check_view_[disabled][data-v-1b8ae42a]{pointer-events:none}.dp-check_tag_[data-v-1b8ae42a]{width:14px;height:14px;flex-shrink:0;display:flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid #999;margin-right:10px;transform:translateY(1px)}.dp-check_name_[data-v-1b8ae42a]{white-space:break-spaces}.dp-check_view_checked_ .dp-check_tag_[data-v-1b8ae42a]{border-color:#fe8227;background-color:#fe8227}.dp-check_view_checked_ .dp-check_tag_[data-v-1b8ae42a]:before{content:"";width:9px;height:5px;border-bottom:1px solid #fff;border-left:1px solid #fff;transform:rotate(-45deg) translate(1px,-1px)}.dp-check_view_checked_ .dp-check_name_[data-v-1b8ae42a]{color:#fe8227}.dp-radio_view_[data-v-e7bf9628]{font-size:14px;padding:5px 10px;min-width:60px;display:flex;cursor:pointer}.dp-radio_view_[data-v-e7bf9628]:hover{background-color:#e8e8e8}.dp-radio_view_[disabled][data-v-e7bf9628]{pointer-events:none}.dp-radio_tag_[data-v-e7bf9628]{width:14px;height:14px;flex-shrink:0;display:flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid #999;margin-right:10px;transform:translateY(1px)}.dp-radio_name_[data-v-e7bf9628]{white-space:break-spaces}.dp-radio_view_checked_ .dp-radio_tag_[data-v-e7bf9628]{border-color:#fe8227}.dp-radio_view_checked_ .dp-radio_tag_[data-v-e7bf9628]:before{content:"";width:10px;height:10px;border-radius:50%;background-color:#fe8227}.dp-radio_view_checked_ .dp-radio_name_[data-v-e7bf9628]{color:#fe8227}.dp-checkfilter_view_[data-v-20c78138]{display:flex;align-items:center;justify-content:center;padding:10px 0;position:relative;cursor:pointer}.dp-checkfilter_arrow_[data-v-20c78138]{position:relative;width:6px;height:6px;margin:0 10px;border-bottom:2px solid #999;border-left:2px solid #999;transform:rotate(-45deg) translateY(-2px);transition:all .1s}.dp-checkfilter_option_view_[data-v-20c78138]{overflow:hidden;visibility:hidden;position:absolute;z-index:1000;left:0;top:100%;width:100%;border-radius:5px;box-shadow:3px 3px 10px #c3c3c3;transform:scaleY(0);transform-origin:top;transition:all .1s}.dp-checkfilter_title_checked_[data-v-20c78138]{color:#fe8227}.dp-checkfilter_view_:hover .dp-checkfilter_arrow_[data-v-20c78138]{transform:rotate(135deg) translate(3px,-3px)}.dp-checkfilter_view_:hover .dp-checkfilter_option_view_[data-v-20c78138]{transform:scale(1);overflow:visible;visibility:inherit}.dp-checkfilter_option_view_[data-v-20c78138]:before{content:"";position:absolute;left:calc(50% - 4px);top:-4px;width:8px;height:8px;background-color:#fff;box-shadow:3px 3px 10px #c3c3c3;transform:rotate(45deg)}.dp-checkfilter_option_list_[data-v-20c78138]{max-height:400px;overflow:auto;border-radius:5px;background-color:#fff;position:relative;z-index:2}.dp-table_header_item_height_[data-v-
|
|
1
|
+
.dp-check_view_[data-v-1b8ae42a]{font-size:14px;padding:5px 10px;min-width:60px;display:flex;cursor:pointer}.dp-check_view_[data-v-1b8ae42a]:hover{background-color:#e8e8e8}.dp-check_view_[disabled][data-v-1b8ae42a]{pointer-events:none}.dp-check_tag_[data-v-1b8ae42a]{width:14px;height:14px;flex-shrink:0;display:flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid #999;margin-right:10px;transform:translateY(1px)}.dp-check_name_[data-v-1b8ae42a]{white-space:break-spaces}.dp-check_view_checked_ .dp-check_tag_[data-v-1b8ae42a]{border-color:#fe8227;background-color:#fe8227}.dp-check_view_checked_ .dp-check_tag_[data-v-1b8ae42a]:before{content:"";width:9px;height:5px;border-bottom:1px solid #fff;border-left:1px solid #fff;transform:rotate(-45deg) translate(1px,-1px)}.dp-check_view_checked_ .dp-check_name_[data-v-1b8ae42a]{color:#fe8227}.dp-radio_view_[data-v-e7bf9628]{font-size:14px;padding:5px 10px;min-width:60px;display:flex;cursor:pointer}.dp-radio_view_[data-v-e7bf9628]:hover{background-color:#e8e8e8}.dp-radio_view_[disabled][data-v-e7bf9628]{pointer-events:none}.dp-radio_tag_[data-v-e7bf9628]{width:14px;height:14px;flex-shrink:0;display:flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid #999;margin-right:10px;transform:translateY(1px)}.dp-radio_name_[data-v-e7bf9628]{white-space:break-spaces}.dp-radio_view_checked_ .dp-radio_tag_[data-v-e7bf9628]{border-color:#fe8227}.dp-radio_view_checked_ .dp-radio_tag_[data-v-e7bf9628]:before{content:"";width:10px;height:10px;border-radius:50%;background-color:#fe8227}.dp-radio_view_checked_ .dp-radio_name_[data-v-e7bf9628]{color:#fe8227}.dp-checkfilter_view_[data-v-20c78138]{display:flex;align-items:center;justify-content:center;padding:10px 0;position:relative;cursor:pointer}.dp-checkfilter_arrow_[data-v-20c78138]{position:relative;width:6px;height:6px;margin:0 10px;border-bottom:2px solid #999;border-left:2px solid #999;transform:rotate(-45deg) translateY(-2px);transition:all .1s}.dp-checkfilter_option_view_[data-v-20c78138]{overflow:hidden;visibility:hidden;position:absolute;z-index:1000;left:0;top:100%;width:100%;border-radius:5px;box-shadow:3px 3px 10px #c3c3c3;transform:scaleY(0);transform-origin:top;transition:all .1s}.dp-checkfilter_title_checked_[data-v-20c78138]{color:#fe8227}.dp-checkfilter_view_:hover .dp-checkfilter_arrow_[data-v-20c78138]{transform:rotate(135deg) translate(3px,-3px)}.dp-checkfilter_view_:hover .dp-checkfilter_option_view_[data-v-20c78138]{transform:scale(1);overflow:visible;visibility:inherit}.dp-checkfilter_option_view_[data-v-20c78138]:before{content:"";position:absolute;left:calc(50% - 4px);top:-4px;width:8px;height:8px;background-color:#fff;box-shadow:3px 3px 10px #c3c3c3;transform:rotate(45deg)}.dp-checkfilter_option_list_[data-v-20c78138]{max-height:400px;overflow:auto;border-radius:5px;background-color:#fff;position:relative;z-index:2}.dp-table_header_item_height_[data-v-5cf7a766]{min-height:40px}.dp-table_header_item_[data-v-5cf7a766]{white-space:nowrap;text-overflow:ellipsis;display:flex;align-items:center;justify-content:center;box-sizing:border-box;text-align:center;flex-shrink:0}.dp-table_header_item_group_[data-v-5cf7a766]{flex-direction:column;align-items:stretch}.dp-table_header_item_group_title_[data-v-5cf7a766]{display:flex;align-items:center;justify-content:center}.dp-table_header_item_border_[data-v-5cf7a766]{border-right:1px solid;border-bottom:1px solid;padding:3px 10px}.dp-table_header_item_child_[data-v-5cf7a766]{display:flex}.dp-table_header_item_sort_[data-v-5cf7a766]{display:inline-flex;flex-direction:column;align-items:center;justify-content:space-between;width:16px;height:12px}.dp-table_header_item_sort_[data-v-5cf7a766]:before,.dp-table_header_item_sort_[data-v-5cf7a766]:after{content:"";width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent}.dp-table_header_item_sort_[data-v-5cf7a766]:before{border-bottom:5px solid #999}.dp-table_header_item_sort_[data-v-5cf7a766]:after{border-top:5px solid #999}.dp-table_header_item_sort_up_[data-v-5cf7a766]:before{border-bottom-color:#fe8227}.dp-table_header_item_sort_down_[data-v-5cf7a766]:after{border-top-color:#fe8227}.dp-table_header_item_cursor_[data-v-5cf7a766]{cursor:pointer}.dp-table_header_filter_view_[data-v-5cf7a766]{flex:1}.dp-table_header_view_[data-v-2293b374]{flex-shrink:0;display:inline-flex;border-top:1px solid;position:sticky;z-index:3;top:0;user-select:none}.dp-table_fixed_bg_[data-v-2293b374]{background-color:#fff}.dp-table_fixed_bg_.dp-table_fixed_shadow_[data-v-2293b374]{box-shadow:5px 0 8px -3px #e3e3e3}.dp-table_view_border_[data-v-1473e8c5]{border:1px solid;border-top:0;display:inline-block!important;max-width:100%;font-size:0}.dp-table_view_[data-v-1473e8c5]{display:inline-block;max-width:100%;overflow:auto;max-height:80vh;font-size:0;position:relative;box-sizing:border-box}.dp-table_body_view_[data-v-1473e8c5]{display:inline-flex;flex-direction:column;box-sizing:border-box;min-height:50px}.dp-table_body_view_[data-v-1473e8c5]:empty{display:flex;align-items:center;justify-content:center}.dp-table_body_view_[data-v-1473e8c5]:empty:before{content:"\6682\65e0\6570\636e";line-height:2;color:#999}.dp-table_view_>*[data-v-1473e8c5]{font-size:14px}.dp-table_body_item_[data-v-1473e8c5]{display:inline-flex}.dp-table_fixed_bg_[data-v-1473e8c5]{background-color:#fff}.dp-table_fixed_bg_.dp-table_fixed_shadow_[data-v-1473e8c5]{box-shadow:5px 0 8px -3px #e3e3e3}.dp-table_body_item_group_col_[data-v-1473e8c5]{display:flex;flex-direction:column}.dp-table_body_item_group_col_>*[data-v-1473e8c5]{flex:1}.dp-table_body_item_child_[data-v-1473e8c5]{flex-shrink:0;display:flex;align-items:center;justify-content:center;text-align:center;border-right:1px solid;border-bottom:1px solid;box-sizing:border-box;overflow:hidden}.dp-table_total_view_[data-v-1473e8c5]{position:sticky;bottom:0;display:inline-flex;background-color:#fff;overflow:visible}.dp-table_total_border_[data-v-1473e8c5]{position:absolute;left:0;top:-1px;color:inherit;z-index:4;width:100%;border-top:1px solid}
|