dpot-ui 0.1.0 → 0.1.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  var x = function() {
2
- var e = this, r = e.$createElement, o = e._self._c || r;
3
- return o("div", {
2
+ var e = this, o = e.$createElement, r = e._self._c || o;
3
+ return r("div", {
4
4
  class: ["dp-check_view_", e.value.includes(e.data.code) && "dp-check_view_checked_"],
5
5
  attrs: {
6
6
  disabled: e.disabled
@@ -10,15 +10,15 @@ var x = function() {
10
10
  return t.stopPropagation(), e.handleChange.apply(null, arguments);
11
11
  }
12
12
  }
13
- }, [o("span", {
13
+ }, [r("span", {
14
14
  staticClass: "dp-check_tag_"
15
- }), o("span", {
15
+ }), r("span", {
16
16
  staticClass: "dp-check_name_"
17
17
  }, [e._v(e._s(e.data.name))])]);
18
18
  }, S = [];
19
- function h(e, r, o, t, n, s, a, l) {
19
+ function h(e, o, r, t, n, s, a, l) {
20
20
  var i = typeof e == "function" ? e.options : e;
21
- r && (i.render = r, i.staticRenderFns = o, i._compiled = !0), t && (i.functional = !0), s && (i._scopeId = "data-v-" + s);
21
+ o && (i.render = o, i.staticRenderFns = r, i._compiled = !0), t && (i.functional = !0), s && (i._scopeId = "data-v-" + s);
22
22
  var d;
23
23
  if (a ? (d = function(c) {
24
24
  c = c || // cached call
@@ -62,7 +62,7 @@ const w = {
62
62
  handleChange() {
63
63
  if (this.disabled)
64
64
  return;
65
- const e = this.value.includes(this.data.code) ? this.value.filter((r) => r !== this.data.code) : [...this.value, this.data.code];
65
+ const e = this.value.includes(this.data.code) ? this.value.filter((o) => o !== this.data.code) : [...this.value, this.data.code];
66
66
  this.$emit("change", e, this.data.key);
67
67
  }
68
68
  }
@@ -78,15 +78,15 @@ var k = /* @__PURE__ */ h(
78
78
  null
79
79
  );
80
80
  function D(e) {
81
- for (let r in g)
82
- this[r] = g[r];
81
+ for (let o in g)
82
+ this[o] = g[o];
83
83
  }
84
84
  const H = /* @__PURE__ */ function() {
85
85
  return k.exports;
86
86
  }();
87
87
  var F = function() {
88
- var e = this, r = e.$createElement, o = e._self._c || r;
89
- return o("div", {
88
+ var e = this, o = e.$createElement, r = e._self._c || o;
89
+ return r("div", {
90
90
  class: ["dp-radio_view_", e.value === e.data.code && "dp-radio_view_checked_"],
91
91
  attrs: {
92
92
  disabled: e.disabled
@@ -96,9 +96,9 @@ var F = function() {
96
96
  return t.stopPropagation(), e.handleChange.apply(null, arguments);
97
97
  }
98
98
  }
99
- }, [o("span", {
99
+ }, [r("span", {
100
100
  staticClass: "dp-radio_tag_"
101
- }), o("span", {
101
+ }), r("span", {
102
102
  staticClass: "dp-radio_name_"
103
103
  }, [e._v(e._s(e.data.name))])]);
104
104
  }, j = [];
@@ -128,32 +128,32 @@ var R = /* @__PURE__ */ h(
128
128
  F,
129
129
  j,
130
130
  !1,
131
- M,
131
+ E,
132
132
  "e7bf9628",
133
133
  null,
134
134
  null
135
135
  );
136
- function M(e) {
137
- for (let r in b)
138
- this[r] = b[r];
136
+ function E(e) {
137
+ for (let o in b)
138
+ this[o] = b[o];
139
139
  }
140
- const T = /* @__PURE__ */ function() {
140
+ const M = /* @__PURE__ */ function() {
141
141
  return R.exports;
142
142
  }();
143
- var E = function() {
144
- var e = this, r = e.$createElement, o = e._self._c || r;
145
- return o("div", {
143
+ var T = function() {
144
+ var e = this, o = e.$createElement, r = e._self._c || o;
145
+ return r("div", {
146
146
  staticClass: "dp-checkfilter_view_"
147
- }, [o("span", {
147
+ }, [r("span", {
148
148
  class: [e.value.length && "dp-checkfilter_title_checked_"]
149
- }, [e._v(e._s(e.title))]), o("span", {
149
+ }, [e._v(e._s(e.title))]), r("span", {
150
150
  staticClass: "dp-checkfilter_arrow_"
151
- }), o("div", {
151
+ }), r("div", {
152
152
  staticClass: "dp-checkfilter_option_view_"
153
- }, [o("div", {
153
+ }, [r("div", {
154
154
  staticClass: "dp-checkfilter_option_list_"
155
155
  }, [e.type === "check" ? e._l(e.option, function(t) {
156
- return o("dp-check", {
156
+ return r("dp-check", {
157
157
  key: t.code,
158
158
  attrs: {
159
159
  data: Object.assign({}, t, {
@@ -166,7 +166,7 @@ var E = function() {
166
166
  }
167
167
  });
168
168
  }) : e.type === "radio" ? e._l(e.option, function(t) {
169
- return o("dp-radio", {
169
+ return r("dp-radio", {
170
170
  key: t.code,
171
171
  attrs: {
172
172
  data: Object.assign({}, t, {
@@ -184,7 +184,7 @@ const z = {
184
184
  name: "dp-checkfilter",
185
185
  components: {
186
186
  DpCheck: H,
187
- DpRadio: T
187
+ DpRadio: M
188
188
  },
189
189
  props: {
190
190
  title: {
@@ -209,14 +209,14 @@ const z = {
209
209
  }
210
210
  },
211
211
  methods: {
212
- handleChange(e, r) {
213
- this.$emit("change", { key: r, value: [e].flat() });
212
+ handleChange(e, o) {
213
+ this.$emit("change", { key: o, value: [e].flat() });
214
214
  }
215
215
  }
216
216
  }, v = {};
217
217
  var L = /* @__PURE__ */ h(
218
218
  z,
219
- E,
219
+ T,
220
220
  W,
221
221
  !1,
222
222
  P,
@@ -225,15 +225,15 @@ var L = /* @__PURE__ */ h(
225
225
  null
226
226
  );
227
227
  function P(e) {
228
- for (let r in v)
229
- this[r] = v[r];
228
+ for (let o in v)
229
+ this[o] = v[o];
230
230
  }
231
231
  const B = /* @__PURE__ */ function() {
232
232
  return L.exports;
233
233
  }();
234
234
  var K = function() {
235
- var e = this, r = e.$createElement, o = e._self._c || r;
236
- return o("li", {
235
+ var e = this, o = e.$createElement, r = e._self._c || o;
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_"],
238
238
  style: Object.assign({
239
239
  borderColor: e.borderColor,
@@ -245,19 +245,19 @@ var K = function() {
245
245
  }
246
246
  }
247
247
  }, [e._t(e.item.slot || e.item.code, function() {
248
- return [e.item.children ? [o("div", {
248
+ return [e.item.children ? [r("div", {
249
249
  staticClass: "dp-table_header_item_border_ dp-table_header_item_group_title_ dp-table_header_item_height_",
250
250
  style: {
251
251
  borderColor: e.borderColor,
252
252
  justifyContent: e.align
253
253
  }
254
- }, [e._v(e._s(e.item.name))]), e.item.children ? o("ul", {
254
+ }, [e._v(e._s(e.item.name))]), e.item.children ? r("ul", {
255
255
  staticClass: "dp-table_header_item_child_",
256
256
  style: {
257
257
  borderColor: e.borderColor
258
258
  }
259
259
  }, e._l(e.item.children, function(t) {
260
- return o("dp-table-header-item", {
260
+ return r("dp-table-header-item", {
261
261
  key: t.code,
262
262
  attrs: {
263
263
  align: e.align,
@@ -282,7 +282,7 @@ var K = function() {
282
282
  };
283
283
  })], null, !0)
284
284
  });
285
- }), 1) : e._e()] : e.item.type && e.item.option ? [o("dp-checkfilter", {
285
+ }), 1) : e._e()] : e.item.type && e.item.option ? [r("dp-checkfilter", {
286
286
  staticClass: "dp-table_header_filter_view_",
287
287
  style: {
288
288
  justifyContent: e.align
@@ -297,7 +297,7 @@ var K = function() {
297
297
  on: {
298
298
  change: e.handleChangeFilter
299
299
  }
300
- })] : [e._v(" " + e._s(e.item.name) + " "), e.item.sortKey ? o("span", {
300
+ })] : [e._v(" " + e._s(e.item.name) + " "), e.item.sortKey ? r("span", {
301
301
  class: ["dp-table_header_item_sort_", e.sortInfo.target.join("_") === e.fullCode.join("_") && e.sortInfo.value === "up" && "dp-table_header_item_sort_up_", e.sortInfo.target.join("_") === e.fullCode.join("_") && e.sortInfo.value === "down" && "dp-table_header_item_sort_down_"]
302
302
  }) : e._e()]];
303
303
  })], 2);
@@ -340,8 +340,8 @@ const N = {
340
340
  handleChildResize(e) {
341
341
  this.widthObj = { ...this.widthObj, ...e }, this.$emit("changeWidth", e);
342
342
  },
343
- handleItemClick(e, r) {
344
- this.$emit("changeSort", { ...e }, r);
343
+ handleItemClick(e, o) {
344
+ 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 } });
@@ -365,31 +365,31 @@ var U = /* @__PURE__ */ h(
365
365
  null
366
366
  );
367
367
  function q(e) {
368
- for (let r in y)
369
- this[r] = y[r];
368
+ for (let o in y)
369
+ this[o] = y[o];
370
370
  }
371
371
  const V = /* @__PURE__ */ function() {
372
372
  return U.exports;
373
- }(), u = (e, r, o) => {
374
- const t = e[o];
375
- if (!t.isFixed || !r[t.code])
373
+ }(), u = (e, o, r) => {
374
+ const t = e[r];
375
+ if (!t.isFixed || !o[t.code])
376
376
  return {};
377
377
  const n = (a) => typeof a == "number" ? [a] : Object.values(a).map((l) => n(l)).flat();
378
- return { position: "sticky", left: `${e.filter((a, l) => l < o && a.isFixed).map((a) => n(r[a.code])).reduce((a, l) => parseFloat(a) + parseFloat(l), 0)}px` };
379
- }, _ = (e, r) => {
380
- const o = e[r[0]];
381
- return r.length > 1 ? _(o, r.slice(1)) : o;
378
+ return { position: "sticky", left: `${e.filter((a, l) => l < r && a.isFixed).map((a) => n(o[a.code])).reduce((a, l) => parseFloat(a) + parseFloat(l), 0)}px` };
379
+ }, _ = (e, o) => {
380
+ const r = e[o[0]];
381
+ return o.length > 1 ? _(r, o.slice(1)) : r;
382
382
  };
383
383
  var X = function() {
384
- var e = this, r = e.$createElement, o = e._self._c || r;
385
- return o("ul", {
384
+ var e = this, o = e.$createElement, r = e._self._c || o;
385
+ return r("ul", {
386
386
  staticClass: "dp-table_header_view_",
387
387
  style: {
388
388
  borderColor: e.borderColor,
389
389
  backgroundColor: e.bgColor
390
390
  }
391
391
  }, e._l(e.data, function(t, n) {
392
- return o("dp-item", {
392
+ return r("dp-item", {
393
393
  key: t.code,
394
394
  class: [t.isFixed && "dp-table_fixed_bg_", e.isLeftScroll && "dp-table_fixed_shadow_"],
395
395
  style: Object.assign({}, e.fixedStyle[n]),
@@ -455,7 +455,7 @@ const J = {
455
455
  },
456
456
  computed: {
457
457
  fixedStyle() {
458
- return this.data.map((e, r) => ({ ...u(this.data, this.widthInfo, r), backgroundColor: this.bgColor }));
458
+ return this.data.map((e, o) => ({ ...u(this.data, this.widthInfo, o), backgroundColor: this.bgColor }));
459
459
  }
460
460
  },
461
461
  data() {
@@ -471,8 +471,8 @@ const J = {
471
471
  this.$emit("changeWidth", this.widthInfo);
472
472
  }, 300);
473
473
  },
474
- handleChangeSort(e, r) {
475
- this.$emit("changeSort", e, r);
474
+ handleChangeSort(e, o) {
475
+ this.$emit("changeSort", e, o);
476
476
  },
477
477
  handleChangeFilter(e) {
478
478
  this.$emit("changeFilter", e);
@@ -490,20 +490,20 @@ var Q = /* @__PURE__ */ h(
490
490
  null
491
491
  );
492
492
  function Y(e) {
493
- for (let r in m)
494
- this[r] = m[r];
493
+ for (let o in m)
494
+ this[o] = m[o];
495
495
  }
496
496
  const Z = /* @__PURE__ */ function() {
497
497
  return Q.exports;
498
498
  }();
499
499
  var ee = function() {
500
- var e = this, r = e.$createElement, o = e._self._c || r;
501
- return o("div", {
500
+ var e = this, o = e.$createElement, r = e._self._c || o;
501
+ return r("div", {
502
502
  staticClass: "dp-table_view_border_",
503
503
  style: {
504
504
  borderColor: e.borderColor
505
505
  }
506
- }, [o("div", {
506
+ }, [r("div", {
507
507
  ref: "table",
508
508
  staticClass: "dp-table_view_",
509
509
  on: {
@@ -511,7 +511,7 @@ var ee = function() {
511
511
  return e.handleScroll.apply(null, arguments);
512
512
  }
513
513
  }
514
- }, [o("dp-header", {
514
+ }, [r("dp-header", {
515
515
  ref: "header",
516
516
  attrs: {
517
517
  data: e.resultHeadData,
@@ -536,19 +536,17 @@ var ee = function() {
536
536
  proxy: !0
537
537
  };
538
538
  })], null, !0)
539
- }), o("div"), o("div", {
539
+ }), r("div"), r("div", {
540
540
  staticClass: "dp-table_body_view_",
541
541
  style: {
542
542
  height: e.fullHeight + "px",
543
543
  paddingTop: e.beforeHeight + "px"
544
544
  }
545
545
  }, e._l(e.resultData, function(t) {
546
- return o("div", {
546
+ return r("div", {
547
547
  key: t.__key,
548
548
  class: ["dp-table_body_item_", t.__isTotalData && "dp-table_total_view_"],
549
- style: Object.assign({
550
- background: e.evenColor
551
- }, t.style, e.hoverStyle, {
549
+ style: Object.assign({}, t.style, e.hoverStyle, e.computEvenColor(t.__sub), {
552
550
  height: `${e.fullHeightInfo[t.__key]}px`
553
551
  }),
554
552
  on: {
@@ -560,15 +558,13 @@ var ee = function() {
560
558
  }
561
559
  }
562
560
  }, [e._l(e.deepHeadData, function(n, s) {
563
- return [t[n.code] instanceof Object ? [t[n.code].slot ? o("div", {
561
+ return [t[n.code] instanceof Object ? [t[n.code].slot ? r("div", {
564
562
  class: ["dp-table_body_item_group_col_", n.isFixed && "dp-table_fixed_bg_", !!e.scrollLeft && "dp-table_fixed_shadow_"],
565
563
  style: Object.assign({
566
564
  borderColor: e.borderColor
567
- }, n.style, n.colStyle, {
568
- background: e.evenColor
569
- }, e.fixedStyle[s], e.computWidth(t[n.code]))
565
+ }, n.style, n.colStyle, e.computEvenColor(t.__sub), e.fixedStyle[s], e.computWidth(t[n.code]))
570
566
  }, e._l([t[n.code].slot].flat(), function(a) {
571
- return o("div", {
567
+ return r("div", {
572
568
  key: a,
573
569
  staticClass: "dp-table_body_item_child_",
574
570
  style: Object.assign({
@@ -581,15 +577,13 @@ var ee = function() {
581
577
  }, [e._t(a, null, {
582
578
  item: t
583
579
  })], 2);
584
- }), 0) : t[n.code].raw ? o("div", {
580
+ }), 0) : t[n.code].raw ? r("div", {
585
581
  class: ["dp-table_body_item_group_col_", n.isFixed && "dp-table_fixed_bg_", !!e.scrollLeft && "dp-table_fixed_shadow_"],
586
582
  style: Object.assign({
587
583
  borderColor: e.borderColor
588
- }, n.style, n.colStyle, {
589
- background: e.evenColor
590
- }, e.fixedStyle[s], e.computWidth(t[n.code]))
584
+ }, n.style, n.colStyle, e.computEvenColor(t.__sub), e.fixedStyle[s], e.computWidth(t[n.code]))
591
585
  }, e._l([t[n.code].raw].flat(), function(a, l) {
592
- return o("div", {
586
+ return r("div", {
593
587
  key: l,
594
588
  staticClass: "dp-table_body_item_child_",
595
589
  style: Object.assign({
@@ -603,15 +597,13 @@ var ee = function() {
603
597
  innerHTML: e._s(a)
604
598
  }
605
599
  });
606
- }), 0) : t[n.code].value ? o("div", {
600
+ }), 0) : t[n.code].value ? r("div", {
607
601
  class: ["dp-table_body_item_group_col_", n.isFixed && "dp-table_fixed_bg_", !!e.scrollLeft && "dp-table_fixed_shadow_"],
608
602
  style: Object.assign({
609
603
  borderColor: e.borderColor
610
- }, n.style, n.colStyle, {
611
- background: e.evenColor
612
- }, e.fixedStyle[s], e.computWidth(t[n.code]))
604
+ }, n.style, n.colStyle, e.computEvenColor(t.__sub), e.fixedStyle[s], e.computWidth(t[n.code]))
613
605
  }, e._l([t[n.code].value].flat(), function(a, l) {
614
- return o("div", {
606
+ return r("div", {
615
607
  key: l,
616
608
  staticClass: "dp-table_body_item_child_",
617
609
  style: Object.assign({
@@ -622,17 +614,15 @@ var ee = function() {
622
614
  width: "100%"
623
615
  })
624
616
  }, [e._v(e._s(a))]);
625
- }), 0) : e._e()] : o("div", {
617
+ }), 0) : e._e()] : r("div", {
626
618
  class: ["dp-table_body_item_child_", n.isFixed && "dp-table_fixed_bg_", !!e.scrollLeft && "dp-table_fixed_shadow_"],
627
619
  style: Object.assign({
628
620
  borderColor: e.borderColor,
629
621
  padding: e.itemPadding,
630
622
  justifyContent: e.dir
631
- }, n.style, n.colStyle, {
632
- background: e.evenColor
633
- }, e.fixedStyle[s])
623
+ }, n.style, n.colStyle, e.computEvenColor(t.__sub), e.fixedStyle[s])
634
624
  }, [e._v(e._s(t[n.code]))])];
635
- }), t.__isTotalData ? o("span", {
625
+ }), t.__isTotalData ? r("span", {
636
626
  staticClass: "dp-table_total_border_",
637
627
  style: {
638
628
  borderColor: e.borderColor
@@ -640,7 +630,7 @@ var ee = function() {
640
630
  }) : e._e()], 2);
641
631
  }), 0)], 1)]);
642
632
  }, te = [];
643
- const re = {
633
+ const oe = {
644
634
  name: "dp-table",
645
635
  components: {
646
636
  DpHeader: Z
@@ -725,47 +715,47 @@ const re = {
725
715
  },
726
716
  // 平铺表头
727
717
  deepHeadData() {
728
- const e = [], r = (o) => {
729
- o.children ? o.children.forEach((t) => r({ ...t, code: `${o.code}_${t.code}` })) : e.push(o);
718
+ const e = [], o = (r) => {
719
+ r.children ? r.children.forEach((t) => o({ ...t, code: `${r.code}_${t.code}` })) : e.push(r);
730
720
  };
731
- return this.resultHeadData.forEach((o) => r(o)), e;
721
+ return this.resultHeadData.forEach((r) => o(r)), e;
732
722
  },
733
723
  // 筛选后的表体数据
734
724
  filterBodyData() {
735
- const e = Object.values(this.filterInfo).filter((r) => r.value.length);
736
- return e.length ? [...this.bodyData].filter((r) => {
737
- let o = !0;
725
+ const e = Object.values(this.filterInfo).filter((o) => o.value.length);
726
+ return e.length ? [...this.bodyData].filter((o) => {
727
+ let r = !0;
738
728
  return e.some((t) => {
739
- if (!t.value.includes(_(r, t.target)))
740
- return o = !1, !0;
741
- }), o;
729
+ if (!t.value.includes(_(o, t.target)))
730
+ return r = !1, !0;
731
+ }), r;
742
732
  }) : this.bodyData;
743
733
  },
744
734
  // 表体各行高度数据
745
735
  fullHeightInfo() {
746
- return this.filterBodyData.concat(this.totalData ? [this.totalData] : []).map((e, r) => {
747
- let o = 0;
736
+ return this.filterBodyData.concat(this.totalData ? [this.totalData] : []).map((e, o) => {
737
+ let r = 0;
748
738
  if (this.rowHeight)
749
- o = this.rowHeight;
739
+ r = this.rowHeight;
750
740
  else if (this.rowItemHeight) {
751
741
  const t = {}, n = (a, l) => {
752
742
  l.children ? l.children.forEach((i) => n((a || {})[i.code], { ...i, code: `${l.code}_${i.code}` })) : t[l.code] = a;
753
743
  };
754
- this.headData.filter((a) => a.children).forEach((a) => n(e[a.code], a)), o = 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;
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;
755
745
  }
756
- return o;
746
+ return r;
757
747
  });
758
748
  },
759
749
  // 表体渲染数据
760
750
  resultData() {
761
- return Object.keys(this.widthInfo).length < this.headData.length || !this.headData.length ? [] : (this.sortInfo.value ? [...this.filterBodyData].sort((r, o) => {
762
- const t = _(r, this.sortInfo.target), n = _(o, this.sortInfo.target);
751
+ 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.target), n = _(r, this.sortInfo.target);
763
753
  return this.sortInfo.value === "up" ? t - n : n - t;
764
- }) : this.filterBodyData).slice(this.beforeIndex, this.currentIndex).concat(this.totalData ? [{ ...this.totalData, __sub: "", __isTotalData: !0 }] : []).map((r, o) => {
754
+ }) : this.filterBodyData).slice(this.beforeIndex, this.currentIndex).concat(this.totalData ? [{ ...this.totalData, __sub: "", __isTotalData: !0 }] : []).map((o, r) => {
765
755
  const t = {}, n = (s, a) => {
766
756
  a.children ? a.children.forEach((l) => n((s || {})[l.code], { ...l, code: `${a.code}_${l.code}` })) : t[a.code] = s;
767
757
  };
768
- return this.headData.filter((s) => s.children).forEach((s) => n(r[s.code], s)), Object.keys(t).forEach((s) => {
758
+ return this.headData.filter((s) => s.children).forEach((s) => n(o[s.code], s)), Object.keys(t).forEach((s) => {
769
759
  if (t[s] instanceof Object && (t[s].merge || 0) > 1) {
770
760
  const a = this.deepHeadData.findIndex((i) => i.code === s), l = this.deepHeadData.slice(a, a + t[s].merge);
771
761
  l.forEach((i) => {
@@ -774,16 +764,16 @@ const re = {
774
764
  }), t[s].isMerge = !0, t[s].width = l.map((i) => this.widthInfo[i.code]).reduce((i, d) => i + d, 0);
775
765
  }
776
766
  }), {
777
- __sub: o + parseInt(this.basicSub) + this.beforeIndex,
778
- ...r,
767
+ __sub: r + parseInt(this.basicSub) + this.beforeIndex,
768
+ ...o,
779
769
  ...t,
780
- __key: o + this.beforeIndex
770
+ __key: r + this.beforeIndex
781
771
  };
782
772
  });
783
773
  },
784
774
  // 冻结列样式
785
775
  fixedStyle() {
786
- return this.headData.map((e, r) => u(this.resultHeadData, this.widthInfo, r));
776
+ return this.headData.map((e, o) => u(this.resultHeadData, this.widthInfo, o));
787
777
  },
788
778
  // 行hover样式
789
779
  hoverStyle() {
@@ -791,7 +781,7 @@ const re = {
791
781
  },
792
782
  // 表体总高度
793
783
  fullHeight() {
794
- return this.fullHeightInfo.reduce((e, r) => e + r, 0);
784
+ return this.fullHeightInfo.reduce((e, o) => e + o, 0);
795
785
  },
796
786
  // 计算单行高度
797
787
  resultRowHeight() {
@@ -799,7 +789,7 @@ const re = {
799
789
  },
800
790
  // 前置填充高度
801
791
  beforeHeight() {
802
- return Math.max(this.resultRowHeight ? this.beforeIndex * this.resultRowHeight : this.fullHeightInfo.slice(0, this.beforeIndex).reduce((e, r) => e + r, 0), 0);
792
+ return Math.max(this.resultRowHeight ? this.beforeIndex * this.resultRowHeight : this.fullHeightInfo.slice(0, this.beforeIndex).reduce((e, o) => e + o, 0), 0);
803
793
  }
804
794
  },
805
795
  watch: {
@@ -827,6 +817,10 @@ const re = {
827
817
  computWidth(e) {
828
818
  return e instanceof Object && e.isMerge ? { width: `${e.width}px` } : {};
829
819
  },
820
+ // 计算隔行变色
821
+ computEvenColor(e) {
822
+ return this.evenColor ? e % 2 ? {} : { background: this.evenColor } : {};
823
+ },
830
824
  // 收集表头各单元格宽度数据
831
825
  handleSetWidthInfo(e) {
832
826
  this.widthInfo = e;
@@ -837,11 +831,11 @@ const re = {
837
831
  if (this.resultRowHeight)
838
832
  this.beforeIndex = Math.max(Math.floor((e.target.scrollTop - this.$el.offsetHeight / 2) / this.resultRowHeight), 0), this.currentIndex = Math.max(this.beforeIndex + Math.ceil(this.$el.offsetHeight / this.resultRowHeight) * 2, 30);
839
833
  else {
840
- let r = 0, o = 0;
834
+ let o = 0, r = 0;
841
835
  this.beforeIndex = this.fullHeightInfo.findIndex((t) => {
842
- const n = r + t >= e.target.scrollTop - this.$el.offsetHeight / 2;
843
- return n || (r += t), n;
844
- }), o = r, this.currentIndex = Math.max(this.beforeIndex + this.fullHeightInfo.slice(this.beforeIndex).findIndex((t) => (o += t, o >= r + this.$el.offsetHeight * 2)), 30);
836
+ const n = o + t >= e.target.scrollTop - this.$el.offsetHeight / 2;
837
+ return n || (o += t), n;
838
+ }), r = o, this.currentIndex = Math.max(this.beforeIndex + this.fullHeightInfo.slice(this.beforeIndex).findIndex((t) => (r += t, r >= o + this.$el.offsetHeight * 2)), 30);
845
839
  }
846
840
  }, 10);
847
841
  },
@@ -850,41 +844,41 @@ const re = {
850
844
  this.hoverFlag = e;
851
845
  },
852
846
  // 操作排序
853
- handleChangeSort(e, r) {
854
- if (this.sortInfo.target.join("_") === r.join("_")) {
855
- const o = ["up", "down", null];
856
- this.sortInfo.value = o[(o.findIndex((t) => t === (this.sortInfo.value || null)) + 1) % o.length];
847
+ handleChangeSort(e, o) {
848
+ if (this.sortInfo.target.join("_") === o.join("_")) {
849
+ const r = ["up", "down", null];
850
+ this.sortInfo.value = r[(r.findIndex((t) => t === (this.sortInfo.value || null)) + 1) % r.length];
857
851
  } else
858
- this.sortInfo = { target: r, value: "up", sortKey: e.sortKey, sortFn: e.sortFn || null };
852
+ this.sortInfo = { target: o, value: "up", sortKey: e.sortKey, sortFn: e.sortFn || null };
859
853
  this.$emit("changeSort", { key: e.sortKey, value: this.sortInfo.value });
860
854
  },
861
855
  // 操作筛选
862
856
  handleChangeFilter(e) {
863
- this.filterInfo = { ...this.filterInfo, ...e }, this.beforeIndex = 0, this.currentIndex = 30, this.$refs.table.scrollTop = 0, this.$emit("changeFilter", Object.values(this.filterInfo).map((r) => ({ key: r.key, value: r.value })));
857
+ this.filterInfo = { ...this.filterInfo, ...e }, this.beforeIndex = 0, this.currentIndex = 30, this.$refs.table.scrollTop = 0, this.$emit("changeFilter", Object.values(this.filterInfo).map((o) => ({ key: o.key, value: o.value })));
864
858
  }
865
859
  }
866
860
  }, C = {};
867
- var oe = /* @__PURE__ */ h(
868
- re,
861
+ var re = /* @__PURE__ */ h(
862
+ oe,
869
863
  ee,
870
864
  te,
871
865
  !1,
872
866
  ne,
873
- "c60b4a66",
867
+ "14de21f0",
874
868
  null,
875
869
  null
876
870
  );
877
871
  function ne(e) {
878
- for (let r in C)
879
- this[r] = C[r];
872
+ for (let o in C)
873
+ this[o] = C[o];
880
874
  }
881
875
  const ae = /* @__PURE__ */ function() {
882
- return oe.exports;
876
+ return re.exports;
883
877
  }(), ie = [
884
878
  ae
885
879
  ], se = {
886
880
  install: (e) => {
887
- ie.forEach((r) => e.component(r.name, r));
881
+ ie.forEach((o) => e.component(o.name, o));
888
882
  }
889
883
  };
890
884
  export {
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-4272af7c]{min-height:40px}.dp-table_header_item_[data-v-4272af7c]{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-4272af7c]{flex-direction:column;align-items:stretch}.dp-table_header_item_group_title_[data-v-4272af7c]{display:flex;align-items:center;justify-content:center}.dp-table_header_item_border_[data-v-4272af7c]{border-right:1px solid;border-bottom:1px solid;padding:3px 10px}.dp-table_header_item_child_[data-v-4272af7c]{display:flex}.dp-table_header_item_sort_[data-v-4272af7c]{display:inline-flex;flex-direction:column;align-items:center;justify-content:space-between;width:16px;height:12px}.dp-table_header_item_sort_[data-v-4272af7c]:before,.dp-table_header_item_sort_[data-v-4272af7c]:after{content:"";width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent}.dp-table_header_item_sort_[data-v-4272af7c]:before{border-bottom:5px solid #999}.dp-table_header_item_sort_[data-v-4272af7c]:after{border-top:5px solid #999}.dp-table_header_item_sort_up_[data-v-4272af7c]:before{border-bottom-color:#fe8227}.dp-table_header_item_sort_down_[data-v-4272af7c]:after{border-top-color:#fe8227}.dp-table_header_item_cursor_[data-v-4272af7c]{cursor:pointer}.dp-table_header_filter_view_[data-v-4272af7c]{flex:1}.dp-table_header_view_[data-v-2553e3f4]{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-2553e3f4]{background-color:#fff}.dp-table_fixed_bg_.dp-table_fixed_shadow_[data-v-2553e3f4]{box-shadow:5px 0 8px -3px #e3e3e3}.dp-table_view_border_[data-v-c60b4a66]{border:1px solid;border-top:0;display:inline-block;max-width:100%;font-size:0}.dp-table_view_[data-v-c60b4a66]{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-c60b4a66]{display:inline-flex;flex-direction:column;box-sizing:border-box;min-height:50px}.dp-table_body_view_[data-v-c60b4a66]:empty{display:flex;align-items:center;justify-content:center}.dp-table_body_view_[data-v-c60b4a66]:empty:before{content:"\6682\65e0\6570\636e";line-height:2;color:#999}.dp-table_view_>*[data-v-c60b4a66]{font-size:14px}.dp-table_body_item_[data-v-c60b4a66]{display:inline-flex}.dp-table_fixed_bg_[data-v-c60b4a66]{background-color:#fff}.dp-table_fixed_bg_.dp-table_fixed_shadow_[data-v-c60b4a66]{box-shadow:5px 0 8px -3px #e3e3e3}.dp-table_body_item_group_col_[data-v-c60b4a66]{display:flex;flex-direction:column}.dp-table_body_item_group_col_>*[data-v-c60b4a66]{flex:1}.dp-table_body_item_child_[data-v-c60b4a66]{flex-shrink:0;display:flex;align-items:center;justify-content:center;text-align:center;min-height:30px;border-right:1px solid;border-bottom:1px solid;box-sizing:border-box;overflow:hidden}.dp-table_total_view_[data-v-c60b4a66]{position:sticky;bottom:0;display:inline-flex;background-color:#fff;overflow:visible}.dp-table_total_border_[data-v-c60b4a66]{position:absolute;left:0;top:-1px;color:inherit;z-index:4;width:100%;border-top:1px solid}
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-4272af7c]{min-height:40px}.dp-table_header_item_[data-v-4272af7c]{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-4272af7c]{flex-direction:column;align-items:stretch}.dp-table_header_item_group_title_[data-v-4272af7c]{display:flex;align-items:center;justify-content:center}.dp-table_header_item_border_[data-v-4272af7c]{border-right:1px solid;border-bottom:1px solid;padding:3px 10px}.dp-table_header_item_child_[data-v-4272af7c]{display:flex}.dp-table_header_item_sort_[data-v-4272af7c]{display:inline-flex;flex-direction:column;align-items:center;justify-content:space-between;width:16px;height:12px}.dp-table_header_item_sort_[data-v-4272af7c]:before,.dp-table_header_item_sort_[data-v-4272af7c]:after{content:"";width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent}.dp-table_header_item_sort_[data-v-4272af7c]:before{border-bottom:5px solid #999}.dp-table_header_item_sort_[data-v-4272af7c]:after{border-top:5px solid #999}.dp-table_header_item_sort_up_[data-v-4272af7c]:before{border-bottom-color:#fe8227}.dp-table_header_item_sort_down_[data-v-4272af7c]:after{border-top-color:#fe8227}.dp-table_header_item_cursor_[data-v-4272af7c]{cursor:pointer}.dp-table_header_filter_view_[data-v-4272af7c]{flex:1}.dp-table_header_view_[data-v-2553e3f4]{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-2553e3f4]{background-color:#fff}.dp-table_fixed_bg_.dp-table_fixed_shadow_[data-v-2553e3f4]{box-shadow:5px 0 8px -3px #e3e3e3}.dp-table_view_border_[data-v-14de21f0]{border:1px solid;border-top:0;display:inline-block!important;max-width:100%;font-size:0}.dp-table_view_[data-v-14de21f0]{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-14de21f0]{display:inline-flex;flex-direction:column;box-sizing:border-box;min-height:50px}.dp-table_body_view_[data-v-14de21f0]:empty{display:flex;align-items:center;justify-content:center}.dp-table_body_view_[data-v-14de21f0]:empty:before{content:"\6682\65e0\6570\636e";line-height:2;color:#999}.dp-table_view_>*[data-v-14de21f0]{font-size:14px}.dp-table_body_item_[data-v-14de21f0]{display:inline-flex}.dp-table_fixed_bg_[data-v-14de21f0]{background-color:#fff}.dp-table_fixed_bg_.dp-table_fixed_shadow_[data-v-14de21f0]{box-shadow:5px 0 8px -3px #e3e3e3}.dp-table_body_item_group_col_[data-v-14de21f0]{display:flex;flex-direction:column}.dp-table_body_item_group_col_>*[data-v-14de21f0]{flex:1}.dp-table_body_item_child_[data-v-14de21f0]{flex-shrink:0;display:flex;align-items:center;justify-content:center;text-align:center;min-height:30px;border-right:1px solid;border-bottom:1px solid;box-sizing:border-box;overflow:hidden}.dp-table_total_view_[data-v-14de21f0]{position:sticky;bottom:0;display:inline-flex;background-color:#fff;overflow:visible}.dp-table_total_border_[data-v-14de21f0]{position:absolute;left:0;top:-1px;color:inherit;z-index:4;width:100%;border-top:1px solid}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dpot-ui",
3
3
  "private": false,
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "author": "Jeesn",
6
6
  "main": "./dist/index.es.js",
7
7
  "module": "./dist/index.es.js",