@web-utils/component 4.0.15 → 4.0.16
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/address-input/index.mjs +13 -15
- package/card/index.mjs +18 -20
- package/carousel/index.mjs +10 -12
- package/chat/index.mjs +45 -56
- package/chunk-file-uploader/index.mjs +36 -378
- package/chunk-file-uploader/style.css +1 -1
- package/chunks/ElementBaseInfo.ZADwixb5.mjs +125 -0
- package/chunks/ElementForm.CQ3PN5qj.mjs +223 -0
- package/chunks/ElementListeners.De_PRuIm.mjs +215 -0
- package/chunks/ElementMultiInstance.DQo2wuAQ.mjs +181 -0
- package/chunks/ElementOtherConfig.B1NfMTYh.mjs +60 -0
- package/chunks/ElementProperties.CosfDrlW.mjs +112 -0
- package/chunks/{ElementTaskConfig.AvBOzAni.mjs → ElementTaskConfig.Bko0kgTp.mjs} +55 -63
- package/chunks/FlowCondition.Y6qEYi1T.mjs +102 -0
- package/chunks/FormTemp.BQxO5IQq.mjs +123 -0
- package/chunks/SignalAndMessage.Bb5PFX0N.mjs +85 -0
- package/chunks/UserTaskListeners.Bv3BDfEI.mjs +169 -0
- package/chunks/{confirmable-mixin.BFZb6pcK.mjs → confirmable-mixin.B2TtLAdk.mjs} +1 -1
- package/chunks/core.0Exl13Mz.mjs +54 -0
- package/chunks/{dataformat.DJoNBlmI.mjs → dataformat.CpqOeGBl.mjs} +6 -6
- package/chunks/{dic.BinnDitI.mjs → dic.Dkl-leRW.mjs} +9 -9
- package/chunks/dictionary.DGt59Ir7.mjs +68 -0
- package/chunks/{event.DSlcqYHL.mjs → event.9aDS6jcw.mjs} +2 -2
- package/chunks/{form-input.BtS_J5a2.mjs → form-input.CvFdwlEV.mjs} +2 -2
- package/chunks/form-item.LWjePsPa.mjs +233 -0
- package/chunks/{index.CIfe3UB3.mjs → index.9OxHjTIE.mjs} +2 -2
- package/chunks/{index.Cn7aq-Et.mjs → index.B2TRddqf.mjs} +8 -8
- package/chunks/{init.xOlFpTyZ.mjs → init.DAsXSoLW.mjs} +2 -2
- package/chunks/sub-table-plus-props.BVsD71hT.mjs +30 -0
- package/chunks/{util.DI42t5GU.mjs → util.DqFv_pWg.mjs} +22 -22
- package/chunks/utilSelf.Csq1766E.mjs +48 -0
- package/chunks/utils.DRcxC1Fb.mjs +60 -0
- package/color-picker/index.mjs +22 -101
- package/confirm-button/index.mjs +1 -1
- package/confirmable/index.mjs +1 -1
- package/data-box/index.mjs +12 -15
- package/data-card/index.mjs +10 -12
- package/data-card-text/index.mjs +10 -12
- package/data-display/index.mjs +15 -17
- package/data-icons/index.mjs +13 -16
- package/data-imgtext/index.mjs +15 -18
- package/data-operatext/index.mjs +14 -16
- package/data-panel/index.mjs +13 -16
- package/data-pay/index.mjs +16 -20
- package/data-price/index.mjs +14 -16
- package/data-progress/index.mjs +13 -17
- package/data-rotate/index.mjs +12 -15
- package/data-table-picker/index.mjs +15 -18
- package/data-tabs/index.mjs +12 -15
- package/dialog-form/index.mjs +16 -18
- package/dynamic-table/index.mjs +25 -30
- package/editable-progress/index.mjs +9 -11
- package/editable-tree/index.mjs +52 -56
- package/egd-collapse-item/index.mjs +9 -9
- package/element-dialog/index.mjs +22 -23
- package/element-listeners/style.css +1 -0
- package/element-multi-instance/style.css +1 -0
- package/flex-column/index.mjs +1 -1
- package/flex-item/index.mjs +1 -1
- package/flex-row/index.mjs +1 -1
- package/flow/index.mjs +10 -11
- package/flow-designer/index.mjs +699 -1973
- package/flow-designer/style.css +1 -1
- package/flow-node/index.mjs +1 -1
- package/flow-viewer/index.mjs +9 -9
- package/form-block/index.mjs +32 -34
- package/form-cascader/index.mjs +23 -24
- package/form-checkbox/index.mjs +16 -17
- package/form-checkbox-group/index.mjs +20 -23
- package/form-date-picker/index.mjs +18 -20
- package/form-holder/index.mjs +13 -14
- package/form-input/index.mjs +14 -15
- package/form-input-cron-expression/index.mjs +19 -22
- package/form-input-email/index.mjs +15 -16
- package/form-input-id-card/index.mjs +12 -13
- package/form-input-number/index.mjs +16 -17
- package/form-input-phone-number/index.mjs +21 -22
- package/form-input-tag/index.mjs +14 -15
- package/form-input-time/index.mjs +14 -15
- package/form-item/index.mjs +140 -3
- package/form-item-group/index.mjs +28 -31
- package/form-radio-group/index.mjs +27 -28
- package/form-select/index.mjs +21 -23
- package/form-switch/index.mjs +16 -17
- package/form-table/index.mjs +16 -17
- package/form-table-plus/index.mjs +21 -22
- package/form-textarea/index.mjs +15 -16
- package/form-tree-select/index.mjs +14 -15
- package/form-tree-select-multiple/index.mjs +14 -15
- package/form-view/index.mjs +35 -39
- package/fy-array/index.mjs +33 -37
- package/fy-cascader/index.mjs +16 -17
- package/fy-checkbox/index.mjs +11 -13
- package/fy-code/index.mjs +10 -10
- package/fy-curd/index.mjs +1128 -1152
- package/fy-date/index.mjs +10 -11
- package/fy-draggable/index.mjs +9 -10
- package/fy-dynamic/index.mjs +22 -25
- package/fy-empty/index.mjs +1 -1
- package/fy-form/index.mjs +638 -15
- package/fy-form-design/index.mjs +1307 -1345
- package/fy-from/crud/zh.d.ts +6 -6
- package/fy-input/index.mjs +12 -14
- package/fy-input-color/index.mjs +13 -15
- package/fy-input-icon/index.mjs +20 -23
- package/fy-input-map/index.mjs +28 -31
- package/fy-input-number/index.mjs +9 -10
- package/fy-input-table/index.mjs +18 -22
- package/fy-input-tree/index.mjs +33 -37
- package/fy-progress/index.mjs +9 -10
- package/fy-radio/index.mjs +15 -16
- package/fy-rate/index.mjs +10 -11
- package/fy-select/index.mjs +25 -29
- package/fy-slider/index.mjs +11 -12
- package/fy-switch/index.mjs +9 -10
- package/fy-tabs/index.mjs +15 -17
- package/fy-time/index.mjs +1 -1
- package/fy-title/index.mjs +1 -1
- package/fy-tree/index.mjs +18 -24
- package/fy-u-editor/index.mjs +1 -1
- package/fy-upload/index.mjs +74 -76
- package/guide-steps/index.mjs +11 -13
- package/iframe-window/index.mjs +9 -10
- package/image-cropper/index.mjs +28 -30
- package/image-preview/index.mjs +12 -14
- package/index.mjs +72 -72
- package/input-number/index.mjs +13 -14
- package/input-number-range/index.mjs +11 -12
- package/license/index.mjs +1 -1
- package/login/index.mjs +21 -26
- package/nav-bar/index.mjs +9 -10
- package/notice/index.mjs +9 -10
- package/package.json +1 -1
- package/page-index/index.mjs +12 -13
- package/page-index-top/index.mjs +23 -28
- package/page-skeleton/index.mjs +14 -14
- package/page-skeleton-new/index.mjs +8 -9
- package/pageable-table/index.mjs +172 -182
- package/pageable-view/index.mjs +15 -16
- package/picker-table-view/index.mjs +49 -58
- package/present-view/index.mjs +35 -39
- package/record-video/index.mjs +1 -1
- package/resize-observer/index.mjs +1 -1
- package/search/index.mjs +20 -22
- package/search-popover/index.mjs +1 -1
- package/sign/index.mjs +1 -1
- package/skeleton-panel/index.mjs +9 -10
- package/split-pane/index.mjs +36 -37
- package/static-pageable-table/index.mjs +11 -13
- package/sub-table/index.mjs +36 -49
- package/sub-table-plus/index.mjs +229 -18
- package/swiper/index.mjs +11 -12
- package/table-column/index.mjs +223 -3
- package/table-view/index.mjs +52 -60
- package/tabs-view/index.mjs +17 -19
- package/tag-render/index.mjs +16 -18
- package/text-ellipsis/index.mjs +9 -10
- package/toolbar/index.mjs +13 -14
- package/toolbar-button/index.mjs +13 -14
- package/verify/index.mjs +1 -1
- package/vue-cron/index.mjs +259 -267
- package/watermark/index.mjs +1 -1
- package/web-types.json +1 -1
- package/x-input-tag/index.mjs +21 -24
- package/chunks/FormItem.Bhsy_O2B.mjs +0 -372
- package/chunks/FyForm.DriwCJ7b.mjs +0 -765
- package/chunks/SignalAndMessage.BpjOoKhK.mjs +0 -92
- package/chunks/SubTablePlus.BH0IIv3X.mjs +0 -270
- package/chunks/TableColumn.BzivvXMF.mjs +0 -337
package/pageable-table/index.mjs
CHANGED
|
@@ -1,61 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import F from "element-ui/lib/pagination";
|
|
8
|
-
import { T as f, g as V } from "../chunks/TableColumn.BzivvXMF.mjs";
|
|
9
|
-
import { _ as w } from "../chunks/helper.BiMLcEEk.mjs";
|
|
1
|
+
import { copy as v, hasOwn as P } from "@web-utils/core";
|
|
2
|
+
import S from "element-ui/lib/message";
|
|
3
|
+
import { g as _, f as C, i as B, j as A } from "../chunks/index.B2TRddqf.mjs";
|
|
4
|
+
import { merge as f } from "@web-utils/integrations/lodash";
|
|
5
|
+
import { g as K } from "../chunks/dictionary.DGt59Ir7.mjs";
|
|
6
|
+
import { _ as T } from "../chunks/helper.BiMLcEEk.mjs";
|
|
10
7
|
import "vue";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
props: {
|
|
22
|
-
columns: {
|
|
23
|
-
type: Array,
|
|
24
|
-
default: () => []
|
|
25
|
-
},
|
|
26
|
-
visible: Boolean
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var I = function() {
|
|
30
|
-
var e = this, l = e._self._c;
|
|
31
|
-
return l(W, { staticClass: "table-column-filter", attrs: { visible: e.visible, title: "表格设置", "append-to-body": "" }, on: { "update:visible": (s) => e.$emit("update:visible", s) } }, [l(v, { attrs: { data: e.columns, border: "" } }, [l(d, { attrs: { label: "列名" }, scopedSlots: e._u([{ key: "default", fn: function({ row: s }) {
|
|
32
|
-
return [e._v(" " + e._s(s.label) + " ")];
|
|
33
|
-
} }]) }), l(d, { attrs: { label: "隐藏", align: "center" }, scopedSlots: e._u([{ key: "default", fn: function({ row: s }) {
|
|
34
|
-
return [l(b, { model: { value: s.hide, callback: function(i) {
|
|
35
|
-
e.$set(s, "hide", i);
|
|
36
|
-
}, expression: "row.hide" } })];
|
|
37
|
-
} }]) }), l(d, { attrs: { label: "冻结", align: "center" }, scopedSlots: e._u([{ key: "default", fn: function({ row: s }) {
|
|
38
|
-
return [l(b, { model: { value: s.fixed, callback: function(i) {
|
|
39
|
-
e.$set(s, "fixed", i);
|
|
40
|
-
}, expression: "row.fixed" } })];
|
|
41
|
-
} }]) }), l(d, { attrs: { label: "过滤", align: "center" }, scopedSlots: e._u([{ key: "default", fn: function({ row: s }) {
|
|
42
|
-
return [l(b, { model: { value: s.filterable, callback: function(i) {
|
|
43
|
-
e.$set(s, "filterable", i);
|
|
44
|
-
}, expression: "row.filterable" } })];
|
|
45
|
-
} }]) }), l(d, { attrs: { label: "排序", align: "center" }, scopedSlots: e._u([{ key: "default", fn: function({ row: s }) {
|
|
46
|
-
return [l(b, { attrs: { title: s.allowSort ? null : "该列不支持排序!", disabled: !s.allowSort }, model: { value: s.sortable, callback: function(i) {
|
|
47
|
-
e.$set(s, "sortable", i);
|
|
48
|
-
}, expression: "row.sortable" } })];
|
|
49
|
-
} }]) })], 1)], 1);
|
|
50
|
-
}, J = [], X = /* @__PURE__ */ _(
|
|
51
|
-
q,
|
|
52
|
-
I,
|
|
53
|
-
J,
|
|
54
|
-
!1,
|
|
55
|
-
null,
|
|
56
|
-
null
|
|
57
|
-
);
|
|
58
|
-
const P = X.exports, G = {
|
|
8
|
+
import { n as b } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
9
|
+
import { isEqual as L } from "lodash-es";
|
|
10
|
+
function F(t) {
|
|
11
|
+
v(
|
|
12
|
+
t,
|
|
13
|
+
() => _(S).success({ duration: 1e3, message: "复制成功!", type: "success" }),
|
|
14
|
+
() => _(S).error({ duration: 1e3, message: "复制失败!", type: "error" })
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
const z = {
|
|
59
18
|
name: "TableColumnFilterable",
|
|
60
19
|
functional: !0,
|
|
61
20
|
/**
|
|
@@ -67,9 +26,9 @@ const P = X.exports, G = {
|
|
|
67
26
|
render(t, e) {
|
|
68
27
|
const {
|
|
69
28
|
data: {
|
|
70
|
-
key:
|
|
29
|
+
key: s
|
|
71
30
|
},
|
|
72
|
-
props:
|
|
31
|
+
props: l,
|
|
73
32
|
parent: {
|
|
74
33
|
records: i
|
|
75
34
|
},
|
|
@@ -78,53 +37,84 @@ const P = X.exports, G = {
|
|
|
78
37
|
hide: o,
|
|
79
38
|
isVNode: n,
|
|
80
39
|
filterable: r,
|
|
81
|
-
allowSort:
|
|
82
|
-
autoUpdate:
|
|
83
|
-
scopedSlots:
|
|
84
|
-
prop:
|
|
85
|
-
|
|
86
|
-
} =
|
|
40
|
+
allowSort: g,
|
|
41
|
+
autoUpdate: d,
|
|
42
|
+
scopedSlots: x,
|
|
43
|
+
prop: m,
|
|
44
|
+
...$
|
|
45
|
+
} = l, y = `${s}-${r}${d ? `-${Math.random()}`.replace("0.", "") : ""}`, u = {
|
|
87
46
|
props: {
|
|
88
|
-
prop:
|
|
89
|
-
|
|
47
|
+
prop: m,
|
|
48
|
+
...$
|
|
90
49
|
}
|
|
91
50
|
};
|
|
92
51
|
if (r) {
|
|
93
|
-
const
|
|
94
|
-
text:
|
|
95
|
-
value:
|
|
52
|
+
const w = [...new Set(i.map((c) => c[m]).filter((c) => c))].map((c) => ({
|
|
53
|
+
text: c,
|
|
54
|
+
value: c
|
|
96
55
|
}));
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
return
|
|
100
|
-
},
|
|
56
|
+
u.props.filterMethod = (c, k, E) => {
|
|
57
|
+
const R = E.property;
|
|
58
|
+
return k[R] === c;
|
|
59
|
+
}, u.props.filters = w;
|
|
101
60
|
}
|
|
102
|
-
const
|
|
103
|
-
return
|
|
104
|
-
scopedSlots:
|
|
105
|
-
key:
|
|
106
|
-
}])) : t(
|
|
107
|
-
key:
|
|
61
|
+
const h = x || a;
|
|
62
|
+
return h != null && h.default ? t("ElTableColumn", T([{}, u, {
|
|
63
|
+
scopedSlots: h,
|
|
64
|
+
key: y
|
|
65
|
+
}])) : t("TableColumn", T([{}, u, {
|
|
66
|
+
key: y
|
|
108
67
|
}]));
|
|
109
68
|
}
|
|
110
|
-
},
|
|
111
|
-
var
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
69
|
+
}, O = null, W = null;
|
|
70
|
+
var V = /* @__PURE__ */ b(
|
|
71
|
+
z,
|
|
72
|
+
O,
|
|
73
|
+
W,
|
|
115
74
|
!1,
|
|
116
75
|
null,
|
|
117
76
|
null
|
|
118
77
|
);
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
78
|
+
const D = V.exports, M = {
|
|
79
|
+
name: "TableColumnFilter",
|
|
80
|
+
props: {
|
|
81
|
+
columns: {
|
|
82
|
+
type: Array,
|
|
83
|
+
default: () => []
|
|
84
|
+
},
|
|
85
|
+
visible: Boolean
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
var U = function() {
|
|
89
|
+
var e = this, s = e._self._c;
|
|
90
|
+
return s("ElDrawer", { staticClass: "table-column-filter", attrs: { visible: e.visible, title: "表格设置", "append-to-body": "" }, on: { "update:visible": (l) => e.$emit("update:visible", l) } }, [s("ElTable", { attrs: { data: e.columns, border: "" } }, [s("ElTableColumn", { attrs: { label: "列名" }, scopedSlots: e._u([{ key: "default", fn: function({ row: l }) {
|
|
91
|
+
return [e._v(" " + e._s(l.label) + " ")];
|
|
92
|
+
} }]) }), s("ElTableColumn", { attrs: { label: "隐藏", align: "center" }, scopedSlots: e._u([{ key: "default", fn: function({ row: l }) {
|
|
93
|
+
return [s("ElCheckbox", { model: { value: l.hide, callback: function(i) {
|
|
94
|
+
e.$set(l, "hide", i);
|
|
95
|
+
}, expression: "row.hide" } })];
|
|
96
|
+
} }]) }), s("ElTableColumn", { attrs: { label: "冻结", align: "center" }, scopedSlots: e._u([{ key: "default", fn: function({ row: l }) {
|
|
97
|
+
return [s("ElCheckbox", { model: { value: l.fixed, callback: function(i) {
|
|
98
|
+
e.$set(l, "fixed", i);
|
|
99
|
+
}, expression: "row.fixed" } })];
|
|
100
|
+
} }]) }), s("ElTableColumn", { attrs: { label: "过滤", align: "center" }, scopedSlots: e._u([{ key: "default", fn: function({ row: l }) {
|
|
101
|
+
return [s("ElCheckbox", { model: { value: l.filterable, callback: function(i) {
|
|
102
|
+
e.$set(l, "filterable", i);
|
|
103
|
+
}, expression: "row.filterable" } })];
|
|
104
|
+
} }]) }), s("ElTableColumn", { attrs: { label: "排序", align: "center" }, scopedSlots: e._u([{ key: "default", fn: function({ row: l }) {
|
|
105
|
+
return [s("ElCheckbox", { attrs: { title: l.allowSort ? null : "该列不支持排序!", disabled: !l.allowSort }, model: { value: l.sortable, callback: function(i) {
|
|
106
|
+
e.$set(l, "sortable", i);
|
|
107
|
+
}, expression: "row.sortable" } })];
|
|
108
|
+
} }]) })], 1)], 1);
|
|
109
|
+
}, N = [], j = /* @__PURE__ */ b(
|
|
110
|
+
M,
|
|
111
|
+
U,
|
|
112
|
+
N,
|
|
113
|
+
!1,
|
|
114
|
+
null,
|
|
115
|
+
null
|
|
116
|
+
);
|
|
117
|
+
const H = j.exports, Q = {
|
|
128
118
|
props: {
|
|
129
119
|
useVisibilityChange: Boolean
|
|
130
120
|
},
|
|
@@ -141,32 +131,32 @@ const se = {
|
|
|
141
131
|
}
|
|
142
132
|
}
|
|
143
133
|
};
|
|
144
|
-
function
|
|
145
|
-
const
|
|
146
|
-
const { hide: a, filterable: o, allowSort: n, sortable: r, fixed:
|
|
147
|
-
return
|
|
148
|
-
}),
|
|
149
|
-
const { hide: a, filterable: o, allowSort: n, sortable: r, fixed:
|
|
150
|
-
return
|
|
134
|
+
function q(t, e) {
|
|
135
|
+
const s = t.map((i) => {
|
|
136
|
+
const { hide: a, filterable: o, allowSort: n, sortable: r, fixed: g, ...d } = i;
|
|
137
|
+
return d;
|
|
138
|
+
}), l = e.map((i) => {
|
|
139
|
+
const { hide: a, filterable: o, allowSort: n, sortable: r, fixed: g, ...d } = i;
|
|
140
|
+
return d;
|
|
151
141
|
});
|
|
152
|
-
return
|
|
142
|
+
return L(s, l);
|
|
153
143
|
}
|
|
154
|
-
function
|
|
144
|
+
function I(t) {
|
|
155
145
|
let e = "";
|
|
156
|
-
for (const
|
|
157
|
-
e += `<TableColumn prop="${
|
|
146
|
+
for (const s in t)
|
|
147
|
+
e += `<TableColumn prop="${s}" label="${s}"/>
|
|
158
148
|
`;
|
|
159
149
|
return e;
|
|
160
150
|
}
|
|
161
|
-
const
|
|
151
|
+
const p = {
|
|
162
152
|
loading: 1,
|
|
163
153
|
error: -1,
|
|
164
154
|
empty: 2,
|
|
165
155
|
success: 0
|
|
166
|
-
},
|
|
156
|
+
}, J = {
|
|
167
157
|
name: "PageableTable",
|
|
168
|
-
components: { TableColumnFilter:
|
|
169
|
-
mixins: [
|
|
158
|
+
components: { TableColumnFilter: H, TableColumnFilterable: D },
|
|
159
|
+
mixins: [Q],
|
|
170
160
|
emits: ["page-loaded", "row-dblclick"],
|
|
171
161
|
bus: {
|
|
172
162
|
reloadTableView(t) {
|
|
@@ -243,8 +233,8 @@ const c = {
|
|
|
243
233
|
data() {
|
|
244
234
|
const t = this.pageSize;
|
|
245
235
|
return {
|
|
246
|
-
TABLE_STATUS: Object.freeze(
|
|
247
|
-
tableStatus:
|
|
236
|
+
TABLE_STATUS: Object.freeze(p),
|
|
237
|
+
tableStatus: p.empty,
|
|
248
238
|
records: [],
|
|
249
239
|
currentRow: null,
|
|
250
240
|
showSettings: !1,
|
|
@@ -271,11 +261,11 @@ const c = {
|
|
|
271
261
|
return t.length > 3 ? 60 + (t.length - 3) * 10 : 60;
|
|
272
262
|
},
|
|
273
263
|
mergeAttrs() {
|
|
274
|
-
return
|
|
264
|
+
return f({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
|
|
275
265
|
},
|
|
276
266
|
headers() {
|
|
277
267
|
var t;
|
|
278
|
-
return ((t = this.columns) == null ? void 0 : t.map(
|
|
268
|
+
return ((t = this.columns) == null ? void 0 : t.map(C)) || [];
|
|
279
269
|
}
|
|
280
270
|
},
|
|
281
271
|
watch: {
|
|
@@ -288,13 +278,13 @@ const c = {
|
|
|
288
278
|
() => ({ columns: this.columns, renderKey: this.renderKey }),
|
|
289
279
|
(t) => {
|
|
290
280
|
const e = [];
|
|
291
|
-
let
|
|
281
|
+
let s = null;
|
|
292
282
|
if (t) {
|
|
293
|
-
const
|
|
294
|
-
|
|
283
|
+
const l = this.$slots.default, { columns: i } = t;
|
|
284
|
+
l ? l.forEach((a) => {
|
|
295
285
|
if (!a.isComment && a.data) {
|
|
296
286
|
const { attrs: o, props: n, scopedSlots: r } = a.data;
|
|
297
|
-
a.data.props = a.data.props || {}, a.data.props.type === "expand" ?
|
|
287
|
+
a.data.props = a.data.props || {}, a.data.props.type === "expand" ? s = {
|
|
298
288
|
...o,
|
|
299
289
|
...n,
|
|
300
290
|
scopedSlots: r,
|
|
@@ -316,7 +306,7 @@ const c = {
|
|
|
316
306
|
});
|
|
317
307
|
}
|
|
318
308
|
}) : i && i.forEach((a) => {
|
|
319
|
-
a.type === "expand" ?
|
|
309
|
+
a.type === "expand" ? s = {
|
|
320
310
|
...a,
|
|
321
311
|
props: a,
|
|
322
312
|
hide: !1,
|
|
@@ -333,7 +323,7 @@ const c = {
|
|
|
333
323
|
sortable: !1,
|
|
334
324
|
fixed: a.fixed
|
|
335
325
|
});
|
|
336
|
-
}), this.updateExpandColumn(
|
|
326
|
+
}), this.updateExpandColumn(s), this.updateColumns(e);
|
|
337
327
|
}
|
|
338
328
|
},
|
|
339
329
|
{ immediate: !0 }
|
|
@@ -352,34 +342,34 @@ const c = {
|
|
|
352
342
|
rowDbClick(...t) {
|
|
353
343
|
this.hideTooltip(), this.$emit("row-dblclick", ...t);
|
|
354
344
|
},
|
|
355
|
-
rowClick(t, e,
|
|
345
|
+
rowClick(t, e, s) {
|
|
356
346
|
if (this.clickRowSelect && this.selectable(t)) {
|
|
357
|
-
const
|
|
347
|
+
const l = this.$refs.table;
|
|
358
348
|
if (this.selectedRows.find((a) => a[this.rowKey] === t[this.rowKey])) {
|
|
359
|
-
|
|
349
|
+
l.toggleRowSelection(t, !1);
|
|
360
350
|
return;
|
|
361
351
|
}
|
|
362
|
-
|
|
352
|
+
l.toggleRowSelection(t);
|
|
363
353
|
}
|
|
364
354
|
},
|
|
365
355
|
hideTooltip() {
|
|
366
356
|
var e;
|
|
367
|
-
const t = this.$refs.table.$children.find((
|
|
368
|
-
var
|
|
369
|
-
return ((
|
|
357
|
+
const t = this.$refs.table.$children.find((s) => {
|
|
358
|
+
var l;
|
|
359
|
+
return ((l = s.$options) == null ? void 0 : l.name) === "ElTableBody";
|
|
370
360
|
});
|
|
371
361
|
(e = t == null ? void 0 : t.$refs.tooltip) == null || e.hide();
|
|
372
362
|
},
|
|
373
363
|
updateTableScrollPosition() {
|
|
374
364
|
this.$refs.table.bodyWrapper && this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
|
|
375
365
|
},
|
|
376
|
-
filterTableProperties:
|
|
377
|
-
filterTableEvents:
|
|
378
|
-
filterTableColumnProperties:
|
|
366
|
+
filterTableProperties: A,
|
|
367
|
+
filterTableEvents: B,
|
|
368
|
+
filterTableColumnProperties: C,
|
|
379
369
|
onTableScroll() {
|
|
380
370
|
this.tableScrollTop = this.$refs.table.bodyWrapper.scrollTop, this.tableScrollLeft = this.$refs.table.bodyWrapper.scrollLeft;
|
|
381
371
|
},
|
|
382
|
-
copy: (t) =>
|
|
372
|
+
copy: (t) => F(I(t)),
|
|
383
373
|
onSortChange({ prop: t, order: e }) {
|
|
384
374
|
this.payloadStyle !== "body" ? (this.page.ascs = e === "ascending" ? t : "", this.page.descs = e === "descending" ? t : "") : (this.page.ascs = e === "ascending" ? [t] : this.ascs, this.page.descs = e === "descending" ? [t] : this.descs);
|
|
385
375
|
},
|
|
@@ -398,19 +388,19 @@ const c = {
|
|
|
398
388
|
},
|
|
399
389
|
async getPage(t) {
|
|
400
390
|
var o;
|
|
401
|
-
if (
|
|
391
|
+
if (P(this.$attrs, "data") && this.$attrs.data !== !1) {
|
|
402
392
|
this.records = this.$attrs.data, this.page.page = 1, this.page.total = (o = this.records) == null ? void 0 : o.length, this.page.limit = this.page.total;
|
|
403
393
|
return;
|
|
404
394
|
}
|
|
405
395
|
t !== !1 && (this.records = []);
|
|
406
396
|
let e;
|
|
407
|
-
const
|
|
397
|
+
const s = this.getPageQuery();
|
|
408
398
|
if (this.api || this.url) {
|
|
409
|
-
t !== !1 && (this.tableStatus =
|
|
399
|
+
t !== !1 && (this.tableStatus = p.loading);
|
|
410
400
|
try {
|
|
411
|
-
this.api && (e = await this.api(
|
|
401
|
+
this.api && (e = await this.api(s));
|
|
412
402
|
} catch {
|
|
413
|
-
this.tableStatus =
|
|
403
|
+
this.tableStatus = p.error;
|
|
414
404
|
return;
|
|
415
405
|
}
|
|
416
406
|
} else {
|
|
@@ -421,9 +411,9 @@ const c = {
|
|
|
421
411
|
return;
|
|
422
412
|
}
|
|
423
413
|
const {
|
|
424
|
-
data: { data:
|
|
425
|
-
} = e || {}, { total: i, records: a } =
|
|
426
|
-
this.page.total = Number(i), this.records = await this.mapRow(a), !a || !a.length ? this.tableStatus =
|
|
414
|
+
data: { data: l }
|
|
415
|
+
} = e || {}, { total: i, records: a } = l || {};
|
|
416
|
+
this.page.total = Number(i), this.records = await this.mapRow(a), !a || !a.length ? this.tableStatus = p.empty : this.tableStatus = p.success, this.doLayout(), this.$emit("page-loaded", l);
|
|
427
417
|
},
|
|
428
418
|
doLayout() {
|
|
429
419
|
var t;
|
|
@@ -442,9 +432,9 @@ const c = {
|
|
|
442
432
|
this.$refs.table.toggleRowSelection(t, e);
|
|
443
433
|
},
|
|
444
434
|
mapRow(t) {
|
|
445
|
-
return t.map((e) => (this.dicOptions.forEach(async (
|
|
446
|
-
var
|
|
447
|
-
e[`$${
|
|
435
|
+
return t.map((e) => (this.dicOptions.forEach(async (s) => {
|
|
436
|
+
var l;
|
|
437
|
+
e[`$${s.prop}`] = e[s.prop], s.dicData ? e[s.prop] = ((l = s.dicData.find((i) => i.value === e[s.prop])) == null ? void 0 : l.label) || e[s.prop] : e[s.prop] = await K(s.dicType, e[s.prop]);
|
|
448
438
|
}), e));
|
|
449
439
|
},
|
|
450
440
|
toggleSettings() {
|
|
@@ -455,20 +445,20 @@ const c = {
|
|
|
455
445
|
return !(t != null && t.disabled) && !((e = this.disabledRowKeys) != null && e.includes(t == null ? void 0 : t[this.rowKey]));
|
|
456
446
|
},
|
|
457
447
|
updateExpandColumn(t) {
|
|
458
|
-
t && this.expandColumn ?
|
|
448
|
+
t && this.expandColumn ? f(this.expandColumn, t) : this.expandColumn = t;
|
|
459
449
|
},
|
|
460
450
|
updateColumns(t) {
|
|
461
|
-
if (!
|
|
451
|
+
if (!q(this.tableColumns, t)) {
|
|
462
452
|
const e = {};
|
|
463
|
-
this.tableColumns.forEach((
|
|
464
|
-
e[
|
|
465
|
-
}), t.map((
|
|
466
|
-
const
|
|
467
|
-
if (
|
|
468
|
-
const { hide: i, filterable: a, allowSort: o, sortable: n, fixed: r } =
|
|
469
|
-
return
|
|
453
|
+
this.tableColumns.forEach((s) => {
|
|
454
|
+
e[s.prop] = s;
|
|
455
|
+
}), t.map((s) => {
|
|
456
|
+
const l = e[s.prop];
|
|
457
|
+
if (l) {
|
|
458
|
+
const { hide: i, filterable: a, allowSort: o, sortable: n, fixed: r } = l;
|
|
459
|
+
return f(l, s), l.hide = i, l.filterable = a, l.allowSort = o, l.sortable = n, l.fixed = r, l;
|
|
470
460
|
}
|
|
471
|
-
return
|
|
461
|
+
return s;
|
|
472
462
|
}), this.tableColumns = t;
|
|
473
463
|
}
|
|
474
464
|
},
|
|
@@ -477,46 +467,46 @@ const c = {
|
|
|
477
467
|
}
|
|
478
468
|
}
|
|
479
469
|
};
|
|
480
|
-
var
|
|
481
|
-
var e = this,
|
|
482
|
-
return
|
|
470
|
+
var X = function() {
|
|
471
|
+
var e = this, s = e._self._c;
|
|
472
|
+
return s("div", { class: ["pageable-table", { "auto-height": e.autoHeight }] }, [s("div", { staticClass: "pageable-table-wrapper" }, [e._t("toolbar", null, { selectedRows: e.selectedRows }), s("ElTable", e._g(e._b({ ref: "table", class: ["flex-item", { "header-bold": e.headerBold }], attrs: { data: e.records, border: e.border, stripe: "", size: "medium" }, on: { "hook:updated": e.updateTableScrollPosition, "sort-change": e.onSortChange, "row-dblclick": e.rowDbClick, "row-click": e.rowClick, "cell-click": e.hideTooltip, "current-change": e.onCurrentChange, "selection-change": e.handleSelectionChange }, scopedSlots: e._u([{ key: "empty", fn: function() {
|
|
483
473
|
return [e._t("empty", function() {
|
|
484
|
-
return [e.tableStatus === e.TABLE_STATUS.loading ? [
|
|
474
|
+
return [e.tableStatus === e.TABLE_STATUS.loading ? [s("span", { staticClass: "pageable-table-loading" }, [s("i", { staticClass: "table-status-icon el-icon-loading" }), e._v(" 加载中... ")])] : e.tableStatus === e.TABLE_STATUS.error ? [s("ElButton", { staticClass: "pageable-table-error", attrs: { icon: "table-status-icon el-icon-error" }, on: { click: e.refresh } }, [e._v("加载失败,点击重试!")])] : s("ElEmpty")];
|
|
485
475
|
})];
|
|
486
476
|
}, proxy: !0 }, { key: "append", fn: function() {
|
|
487
477
|
return [e._t("append")];
|
|
488
|
-
}, proxy: !0 }], null, !0) }, "ElTable", e.filterTableProperties(e.mergeAttrs), !1), e.filterTableEvents(e.$listeners)), [e.expandColumn ?
|
|
489
|
-
return [
|
|
490
|
-
}, proxy: !0 }, { key: "default", fn: function({ row:
|
|
491
|
-
return [
|
|
492
|
-
} }], null, !1, 1270221895) }) : e._e(), e.index ?
|
|
493
|
-
return [e._v(" " + e._s((e.page.page - 1) * e.page.limit +
|
|
494
|
-
} }], null, !1, 4238275121) }) : e._e(), e.tableColumns ? e._l(e.tableColumns.filter((
|
|
478
|
+
}, proxy: !0 }], null, !0) }, "ElTable", e.filterTableProperties(e.mergeAttrs), !1), e.filterTableEvents(e.$listeners)), [e.expandColumn ? s("TableColumnFilterable", e._b({}, "TableColumnFilterable", e.expandColumn, !1)) : e._e(), e.multiple && e.selection ? s("TableColumn", { key: "multiple", attrs: { type: "selection", selectable: e.selectable, width: e.selectionWidth, align: "center" } }) : e._e(), !e.multiple && e.selection ? s("TableColumn", { key: "single", attrs: { sortable: !1, type: "single-selection", "class-name": "single-select-column", width: e.selectionWidth, align: "center" }, scopedSlots: e._u([{ key: "header", fn: function() {
|
|
479
|
+
return [s("ElRadio", { attrs: { value: !!e.currentRow, label: !0 } }, [s("span")])];
|
|
480
|
+
}, proxy: !0 }, { key: "default", fn: function({ row: l }) {
|
|
481
|
+
return [s("ElRadio", { attrs: { label: !0, disabled: !e.selectable(l), value: e.currentRow && e.currentRow[e.$attrs["row-key"] || e.rowKey || "id"] === l[e.$attrs["row-key"] || e.rowKey || "id"] } }, [s("span")])];
|
|
482
|
+
} }], null, !1, 1270221895) }) : e._e(), e.index ? s("TableColumn", { key: "order", attrs: { type: "index", label: "序号", width: e.indexWidth, align: "center" }, scopedSlots: e._u([{ key: "default", fn: function({ $index: l }) {
|
|
483
|
+
return [e._v(" " + e._s((e.page.page - 1) * e.page.limit + l + 1 || l + 1) + " ")];
|
|
484
|
+
} }], null, !1, 4238275121) }) : e._e(), e.tableColumns ? e._l(e.tableColumns.filter((l) => !l.hide), function(l, i) {
|
|
495
485
|
var a, o;
|
|
496
|
-
return
|
|
486
|
+
return s("TableColumnFilterable", e._b({ key: `${((a = l.props) == null ? void 0 : a.prop) || l.prop}-${i}`, scopedSlots: e._u([e.$scopedSlots[((o = l.props) == null ? void 0 : o.prop) || l.prop] ? { key: "default", fn: function({ row: n }) {
|
|
497
487
|
var r;
|
|
498
|
-
return [e._t(((r =
|
|
499
|
-
} } : null], null, !0) }, "TableColumnFilterable",
|
|
500
|
-
}) : [
|
|
501
|
-
return [
|
|
502
|
-
return e.copy(
|
|
503
|
-
} } }, [e._v(e._s(JSON.stringify(
|
|
504
|
-
} }]) })]], 2), e.paging ?
|
|
505
|
-
e.page.limit =
|
|
506
|
-
}, "current-change": (
|
|
507
|
-
e.page.page =
|
|
508
|
-
} } }) : e._e(),
|
|
509
|
-
e.showSettings =
|
|
510
|
-
} } })], 2),
|
|
511
|
-
},
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
488
|
+
return [e._t(((r = l.props) == null ? void 0 : r.prop) || l.prop, null, { row: n })];
|
|
489
|
+
} } : null], null, !0) }, "TableColumnFilterable", l, !1));
|
|
490
|
+
}) : [s("TableColumn", { attrs: { label: "点击表格行复制模板" }, scopedSlots: e._u([{ key: "default", fn: function({ row: l }) {
|
|
491
|
+
return [s("pre", { staticClass: "pointer", on: { click: function(i) {
|
|
492
|
+
return e.copy(l);
|
|
493
|
+
} } }, [e._v(e._s(JSON.stringify(l, null, " ")))])];
|
|
494
|
+
} }]) })]], 2), e.paging ? s("ElPagination", { staticClass: "flex-not-shrink", attrs: { "current-page": e.page.page, "hide-on-single-page": e.hideOnSinglePage, "page-size": e.page.limit, total: e.page.total, "page-sizes": [10, 25, 50, 100, 500, 1e3, 2e3], background: "", layout: "total, sizes, prev, pager, next, jumper" }, on: { "size-change": (l) => {
|
|
495
|
+
e.page.limit = l;
|
|
496
|
+
}, "current-change": (l) => {
|
|
497
|
+
e.page.page = l;
|
|
498
|
+
} } }) : e._e(), s("TableColumnFilter", { attrs: { visible: e.showSettings, columns: e.tableColumns }, on: { "update:visible": function(l) {
|
|
499
|
+
e.showSettings = l;
|
|
500
|
+
} } })], 2), s("ResizeObserver", { on: { notify: e.doLayout } })], 1);
|
|
501
|
+
}, G = [], Y = /* @__PURE__ */ b(
|
|
502
|
+
J,
|
|
503
|
+
X,
|
|
504
|
+
G,
|
|
515
505
|
!1,
|
|
516
506
|
null,
|
|
517
507
|
null
|
|
518
508
|
);
|
|
519
|
-
const
|
|
509
|
+
const ne = Y.exports;
|
|
520
510
|
export {
|
|
521
|
-
|
|
511
|
+
ne as default
|
|
522
512
|
};
|
package/pageable-view/index.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import p from "element-ui/lib/pagination";
|
|
2
1
|
import { cloneDeep as n, merge as g } from "@web-utils/integrations/lodash";
|
|
3
|
-
import { hasOwn as
|
|
4
|
-
import { f as h,
|
|
5
|
-
import { n as
|
|
6
|
-
function
|
|
2
|
+
import { hasOwn as p, copy as f } from "@web-utils/core";
|
|
3
|
+
import { f as h, i as u, j as m } from "../chunks/index.B2TRddqf.mjs";
|
|
4
|
+
import { n as b } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
5
|
+
function S(e) {
|
|
7
6
|
let t = "";
|
|
8
7
|
for (const s in e)
|
|
9
8
|
t += `<ElTableColumn prop="${s}" label="${s}"/>
|
|
@@ -15,7 +14,7 @@ const i = {
|
|
|
15
14
|
error: -1,
|
|
16
15
|
empty: 2,
|
|
17
16
|
success: 0
|
|
18
|
-
},
|
|
17
|
+
}, y = {
|
|
19
18
|
name: "PageableView",
|
|
20
19
|
bus: {
|
|
21
20
|
reloadTableView(e) {
|
|
@@ -156,13 +155,13 @@ const i = {
|
|
|
156
155
|
updateTableScrollPosition() {
|
|
157
156
|
this.$refs.scroller && this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
|
|
158
157
|
},
|
|
159
|
-
filterTableProperties:
|
|
160
|
-
filterTableEvents:
|
|
158
|
+
filterTableProperties: m,
|
|
159
|
+
filterTableEvents: u,
|
|
161
160
|
filterTableColumnProperties: h,
|
|
162
161
|
onTableScroll() {
|
|
163
162
|
this.tableScrollTop = this.$refs.scroller.scrollTop, this.tableScrollLeft = this.$refs.scroller.scrollLeft;
|
|
164
163
|
},
|
|
165
|
-
copy: (e) =>
|
|
164
|
+
copy: (e) => f(S(e)),
|
|
166
165
|
onSortChange({ prop: e, order: t }) {
|
|
167
166
|
this.page.ascs = t === "ascending" ? e : "", this.page.descs = t === "descending" ? e : "";
|
|
168
167
|
},
|
|
@@ -216,7 +215,7 @@ const i = {
|
|
|
216
215
|
},
|
|
217
216
|
async getPage() {
|
|
218
217
|
var o;
|
|
219
|
-
if (
|
|
218
|
+
if (p(this.$attrs, "data")) {
|
|
220
219
|
this.records = this.$attrs.data, this.page.page = 1, this.page.total = this.records.length, this.page.limit = this.page.total;
|
|
221
220
|
return;
|
|
222
221
|
}
|
|
@@ -255,22 +254,22 @@ const i = {
|
|
|
255
254
|
}
|
|
256
255
|
}
|
|
257
256
|
};
|
|
258
|
-
var
|
|
257
|
+
var v = function() {
|
|
259
258
|
var t = this, s = t._self._c;
|
|
260
259
|
return s("div", { staticClass: "work", staticStyle: { height: "100%", "background-color": "#fff" } }, [s("div", { staticClass: "flex-column list-content", staticStyle: { height: "100%" } }, [s("div", { directives: [{ name: "loading", rawName: "v-loading", value: t.loading, expression: "loading" }], staticClass: "flex-item-relative", attrs: { "element-loading-text": "加载中...", "element-loading-background": "#fff" } }, [s("div", { ref: "scroller", staticClass: "scroll-wrapper" }, [s("div", { staticClass: "cards-block" }, [t._t("prepend"), t._l(t.records, function(l) {
|
|
261
260
|
return [t._t("default", null, { item: l })];
|
|
262
|
-
}), t._t("append")], 2)])]), s(
|
|
261
|
+
}), t._t("append")], 2)])]), s("ElPagination", { staticClass: "flex-not-shrink", staticStyle: { "border-top": "1px solid #ebeef5" }, attrs: { "current-page": t.page.page, "hide-on-single-page": t.hideOnSinglePage, "page-size": t.page.limit, total: t.page.total, background: "", layout: "total, prev, pager, next, jumper" }, on: { "current-change": (l) => {
|
|
263
262
|
t.page.page = l;
|
|
264
263
|
} } })], 1)]);
|
|
265
|
-
}, $ = [], T = /* @__PURE__ */
|
|
264
|
+
}, $ = [], T = /* @__PURE__ */ b(
|
|
265
|
+
y,
|
|
266
266
|
v,
|
|
267
|
-
_,
|
|
268
267
|
$,
|
|
269
268
|
!1,
|
|
270
269
|
null,
|
|
271
270
|
null
|
|
272
271
|
);
|
|
273
|
-
const
|
|
272
|
+
const x = T.exports;
|
|
274
273
|
export {
|
|
275
|
-
|
|
274
|
+
x as default
|
|
276
275
|
};
|