@web-utils/component 3.0.6 → 3.1.0
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 +20 -57
- package/affix/index.mjs +26 -47
- package/aside-menu/index.mjs +18 -43
- package/avatar/index.mjs +27 -49
- package/awesome-button/index.mjs +35 -43
- package/capsule-tab/index.mjs +16 -34
- package/card/index.mjs +21 -76
- package/carousel/index.mjs +14 -49
- package/chat/index.mjs +104 -414
- package/chunk-file-uploader/index.mjs +21 -38
- package/chunks/FormTemp.aa57efb4.mjs +125 -0
- package/code-mirror-editor/index.mjs +69 -79
- package/color-picker/index.mjs +29 -60
- package/comment/index.mjs +17 -48
- package/confirm-button/index.mjs +11 -19
- package/confirmable/index.mjs +12 -20
- package/context-menu/index.mjs +42 -144
- package/count-up/index.mjs +18 -25
- package/custom-scrollbar/index.mjs +13 -22
- package/data-box/index.mjs +15 -66
- package/data-card/index.mjs +16 -65
- package/data-cardtext/index.mjs +16 -52
- package/data-display/index.mjs +18 -62
- package/data-icons/index.mjs +16 -68
- package/data-imgtext/index.mjs +18 -79
- package/data-operatext/index.mjs +18 -75
- package/data-panel/index.mjs +16 -63
- package/data-pay/index.mjs +20 -122
- package/data-price/index.mjs +18 -60
- package/data-progress/index.mjs +16 -67
- package/data-rotate/index.mjs +16 -66
- package/data-table-picker/index.mjs +25 -88
- package/data-tabs/index.mjs +16 -64
- package/dialog-form/index.mjs +48 -94
- package/dynamic-table/index.mjs +43 -127
- package/e-charts/index.mjs +21 -34
- package/easy-popup/index.mjs +35 -61
- package/editable-progress/index.mjs +22 -77
- package/editable-tree/index.mjs +235 -546
- package/egd-collapse/index.mjs +13 -26
- package/egd-collapse-item/index.mjs +27 -87
- package/element-dialog/index.mjs +69 -133
- package/empty-view/index.mjs +13 -33
- package/error-view/index.mjs +14 -34
- package/flex-column/index.mjs +15 -23
- package/flex-item/index.mjs +18 -26
- package/flex-row/index.mjs +23 -31
- package/flex-scroller/index.mjs +16 -27
- package/flow/index.mjs +70 -110
- package/flow-designer/index.mjs +1215 -4804
- package/flow-node/index.mjs +15 -51
- package/flow-viewer/index.mjs +64 -89
- package/form-block/index.mjs +43 -62
- package/form-button/index.mjs +10 -18
- package/form-cascader/index.mjs +49 -100
- package/form-checkbox-group/index.mjs +43 -110
- package/form-date-picker/index.mjs +51 -97
- package/form-holder/index.mjs +25 -42
- package/form-input/index.mjs +40 -90
- package/form-input-email/index.mjs +35 -79
- package/form-input-id-card/index.mjs +40 -87
- package/form-input-number/index.mjs +42 -102
- package/form-input-phone-number/index.mjs +34 -75
- package/form-input-tag/index.mjs +31 -73
- package/form-input-time/index.mjs +42 -87
- package/form-item/index.mjs +70 -89
- package/form-item-config-provider/index.mjs +12 -20
- package/form-item-group/index.mjs +46 -65
- package/form-radio-group/index.mjs +50 -108
- package/form-select/index.mjs +44 -95
- package/form-switch/index.mjs +38 -85
- package/form-textarea/index.mjs +31 -75
- package/form-view/index.mjs +112 -260
- package/fy-array/index.mjs +35 -121
- package/fy-article/index.mjs +12 -43
- package/fy-cascader/index.mjs +26 -67
- package/fy-checkbox/index.mjs +27 -77
- package/fy-code/index.mjs +19 -33
- package/fy-curd/index.mjs +810 -2017
- package/fy-date/index.mjs +18 -59
- package/fy-draggable/index.mjs +81 -140
- package/fy-dynamic/index.mjs +85 -204
- package/fy-empty/index.mjs +14 -35
- package/fy-form/index.mjs +254 -571
- package/fy-form-design/index.mjs +1489 -6084
- package/fy-form-design/style.css +1 -1
- package/fy-input/index.mjs +34 -104
- package/fy-input-color/index.mjs +22 -67
- package/fy-input-icon/index.mjs +37 -122
- package/fy-input-map/index.mjs +57 -149
- package/fy-input-number/index.mjs +18 -53
- package/fy-input-table/index.mjs +36 -102
- package/fy-input-tree/index.mjs +51 -138
- package/fy-progress/index.mjs +12 -31
- package/fy-radio/index.mjs +20 -51
- package/fy-rate/index.mjs +18 -51
- package/fy-select/index.mjs +49 -134
- package/fy-slider/index.mjs +19 -52
- package/fy-switch/index.mjs +18 -48
- package/fy-tabs/index.mjs +19 -51
- package/fy-time/index.mjs +22 -62
- package/fy-title/index.mjs +14 -25
- package/fy-tree/index.mjs +74 -216
- package/fy-u-editor/index.mjs +50 -64
- package/fy-upload/index.mjs +167 -338
- package/guide-steps/index.mjs +33 -53
- package/highlight-j-s/index.mjs +13 -27
- package/icon-card/index.mjs +12 -36
- package/icon-temp/index.mjs +12 -34
- package/iframe-window/index.mjs +13 -40
- package/image-cropper/index.mjs +46 -171
- package/image-preview/index.mjs +54 -168
- package/image-viewer/index.mjs +24 -50
- package/index.css +1 -0
- package/index.mjs +3973 -501
- package/input-number/index.mjs +84 -173
- package/input-number-range/index.mjs +20 -70
- package/j-s-x-component/index.mjs +3 -3
- package/keep-view-alive/index.mjs +47 -55
- package/keyboard/index.mjs +100 -113
- package/license/index.mjs +34 -51
- package/loading-view/index.mjs +14 -34
- package/login/index.mjs +33 -161
- package/monaco-editor/index.mjs +13 -21
- package/name-avatar/index.mjs +13 -32
- package/nav-bar/index.mjs +12 -31
- package/not-implement/index.mjs +14 -25
- package/notice/index.mjs +32 -80
- package/package.json +1 -1
- package/page/index.mjs +11 -23
- package/page-header/index.mjs +16 -37
- package/page-index/index.mjs +42 -93
- package/page-index-top/index.mjs +42 -84
- package/page-skeleton/index.mjs +24 -39
- package/page-skeleton-new/index.mjs +21 -68
- package/pageable-table/index.mjs +105 -227
- package/pageable-view/index.mjs +30 -83
- package/photo-swipe/index.mjs +62 -87
- package/present-view/index.mjs +114 -267
- package/queue/index.mjs +14 -29
- package/record-video/index.mjs +29 -66
- package/resize-observer/index.mjs +18 -30
- package/search/index.mjs +47 -81
- package/search-popover/index.mjs +57 -329
- package/sign/index.mjs +43 -60
- package/sign-panel/index.mjs +40 -151
- package/skeleton/index.mjs +18 -44
- package/split-pane/index.mjs +45 -129
- package/stateful/index.mjs +18 -26
- package/static-pageable-table/index.mjs +18 -44
- package/swiper/index.mjs +53 -94
- package/tab/index.mjs +13 -39
- package/tab-item/index.mjs +23 -37
- package/table-column/index.mjs +27 -35
- package/table-view/index.mjs +89 -209
- package/tag-render/index.mjs +34 -69
- package/text-ellipsis/index.mjs +22 -47
- package/tinymce-editor/index.mjs +174 -285
- package/toolbar/index.mjs +21 -42
- package/toolbar-button/index.mjs +25 -54
- package/verify/index.mjs +16 -29
- package/vue-cron/index.mjs +272 -1089
- package/vue-qr-code/index.mjs +19 -27
- package/vue-quill-editor/index.mjs +15 -27
- package/vue-tags-input/index.mjs +104 -224
- package/vue-tree-select/index.mjs +595 -742
- package/vue-video-player/index.mjs +42 -57
- package/watermark/index.mjs +27 -35
- package/web-types.json +1 -1
- package/x-input-tag/index.mjs +50 -112
- package/chunks/FormTemp.7f91629d.mjs +0 -165
- /package/chunks/{vueComponentNormalizer.446f5dc4.mjs → _plugin-vue2_normalizer.446f5dc4.mjs} +0 -0
package/pageable-table/index.mjs
CHANGED
|
@@ -1,193 +1,54 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var T = Object.defineProperty, $ = Object.defineProperties;
|
|
2
|
+
var v = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var p = Object.getOwnPropertySymbols;
|
|
4
4
|
var f = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var g = (e, a
|
|
6
|
-
for (var
|
|
7
|
-
f.call(
|
|
5
|
+
var g = (t, e, a) => e in t ? T(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a, c = (t, e) => {
|
|
6
|
+
for (var a in e || (e = {}))
|
|
7
|
+
f.call(e, a) && g(t, a, e[a]);
|
|
8
8
|
if (p)
|
|
9
|
-
for (var
|
|
10
|
-
b.call(
|
|
11
|
-
return e;
|
|
12
|
-
}, m = (e, a) => $(e, w(a));
|
|
13
|
-
var y = (e, a) => {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var s in e)
|
|
16
|
-
f.call(e, s) && a.indexOf(s) < 0 && (t[s] = e[s]);
|
|
17
|
-
if (e != null && p)
|
|
18
|
-
for (var s of p(e))
|
|
19
|
-
a.indexOf(s) < 0 && b.call(e, s) && (t[s] = e[s]);
|
|
9
|
+
for (var a of p(e))
|
|
10
|
+
b.call(e, a) && g(t, a, e[a]);
|
|
20
11
|
return t;
|
|
12
|
+
}, m = (t, e) => $(t, v(e));
|
|
13
|
+
var y = (t, e) => {
|
|
14
|
+
var a = {};
|
|
15
|
+
for (var s in t)
|
|
16
|
+
f.call(t, s) && e.indexOf(s) < 0 && (a[s] = t[s]);
|
|
17
|
+
if (t != null && p)
|
|
18
|
+
for (var s of p(t))
|
|
19
|
+
e.indexOf(s) < 0 && b.call(t, s) && (a[s] = t[s]);
|
|
20
|
+
return a;
|
|
21
21
|
};
|
|
22
|
-
var h = (e, a
|
|
22
|
+
var h = (t, e, a) => new Promise((s, l) => {
|
|
23
23
|
var u = (r) => {
|
|
24
24
|
try {
|
|
25
|
-
i(
|
|
25
|
+
i(a.next(r));
|
|
26
26
|
} catch (d) {
|
|
27
27
|
l(d);
|
|
28
28
|
}
|
|
29
29
|
}, n = (r) => {
|
|
30
30
|
try {
|
|
31
|
-
i(
|
|
31
|
+
i(a.throw(r));
|
|
32
32
|
} catch (d) {
|
|
33
33
|
l(d);
|
|
34
34
|
}
|
|
35
35
|
}, i = (r) => r.done ? s(r.value) : Promise.resolve(r.value).then(u, n);
|
|
36
|
-
i((
|
|
36
|
+
i((a = a.apply(t, e)).next());
|
|
37
37
|
});
|
|
38
|
-
import { hasOwn as
|
|
39
|
-
import { cloneDeep as _, merge as
|
|
40
|
-
import { f as S, h as
|
|
41
|
-
import { n as B } from "../chunks/
|
|
42
|
-
var E = function() {
|
|
43
|
-
var e = this, a = e.$createElement, t = e._self._c || a;
|
|
44
|
-
return t("div", {
|
|
45
|
-
class: ["pageable-table", {
|
|
46
|
-
"auto-height": e.autoHeight
|
|
47
|
-
}]
|
|
48
|
-
}, [t("div", {
|
|
49
|
-
staticClass: "pageable-table-wrapper"
|
|
50
|
-
}, [e._t("toolbar"), t("ElTable", e._g(e._b({
|
|
51
|
-
ref: "table",
|
|
52
|
-
class: ["flex-item", {
|
|
53
|
-
"header-bold": e.headerBold
|
|
54
|
-
}],
|
|
55
|
-
attrs: {
|
|
56
|
-
data: e.records,
|
|
57
|
-
border: e.border
|
|
58
|
-
},
|
|
59
|
-
on: {
|
|
60
|
-
"hook:updated": e.updateTableScrollPosition,
|
|
61
|
-
"sort-change": e.onSortChange,
|
|
62
|
-
"row-dblclick": e.rowDbClick,
|
|
63
|
-
"current-change": e.onCurrentChange
|
|
64
|
-
},
|
|
65
|
-
scopedSlots: e._u([{
|
|
66
|
-
key: "empty",
|
|
67
|
-
fn: function() {
|
|
68
|
-
return [e._t("empty", function() {
|
|
69
|
-
return [e.tableStatus === e.TABLE_STATUS.loading ? [t("span", {
|
|
70
|
-
staticClass: "pageable-table-loading"
|
|
71
|
-
}, [t("i", {
|
|
72
|
-
staticClass: "table-status-icon el-icon-loading"
|
|
73
|
-
}), e._v(" 加载中...")])] : e.tableStatus === e.TABLE_STATUS.error ? [t("ElButton", {
|
|
74
|
-
staticClass: "pageable-table-error",
|
|
75
|
-
attrs: {
|
|
76
|
-
icon: "table-status-icon fa fa-frown-o"
|
|
77
|
-
},
|
|
78
|
-
on: {
|
|
79
|
-
click: e.refresh
|
|
80
|
-
}
|
|
81
|
-
}, [e._v(" 加载失败,点击重试! ")])] : [e._v(" 暂无数据 ")]];
|
|
82
|
-
})];
|
|
83
|
-
},
|
|
84
|
-
proxy: !0
|
|
85
|
-
}, {
|
|
86
|
-
key: "append",
|
|
87
|
-
fn: function() {
|
|
88
|
-
return [e._t("append")];
|
|
89
|
-
},
|
|
90
|
-
proxy: !0
|
|
91
|
-
}], null, !0)
|
|
92
|
-
}, "ElTable", e.filterTableProperties(e.mergeAttrs), !1), e.filterTableEvents(e.$listeners)), [e.multiple && e.selection ? t("TableColumn", {
|
|
93
|
-
key: "multiple",
|
|
94
|
-
attrs: {
|
|
95
|
-
type: "selection",
|
|
96
|
-
width: "45",
|
|
97
|
-
align: "center"
|
|
98
|
-
}
|
|
99
|
-
}) : e._e(), !e.multiple && e.selection ? t("TableColumn", {
|
|
100
|
-
key: "single",
|
|
101
|
-
attrs: {
|
|
102
|
-
type: "single-selection",
|
|
103
|
-
"class-name": "single-select-column",
|
|
104
|
-
width: "45",
|
|
105
|
-
align: "center"
|
|
106
|
-
},
|
|
107
|
-
scopedSlots: e._u([{
|
|
108
|
-
key: "header",
|
|
109
|
-
fn: function() {
|
|
110
|
-
return [t("ElRadio", {
|
|
111
|
-
attrs: {
|
|
112
|
-
value: !!e.currentRow,
|
|
113
|
-
label: !0
|
|
114
|
-
}
|
|
115
|
-
}, [t("span")])];
|
|
116
|
-
},
|
|
117
|
-
proxy: !0
|
|
118
|
-
}, {
|
|
119
|
-
key: "default",
|
|
120
|
-
fn: function(s) {
|
|
121
|
-
var l = s.row;
|
|
122
|
-
return [t("ElRadio", {
|
|
123
|
-
attrs: {
|
|
124
|
-
label: !0,
|
|
125
|
-
value: e.currentRow && e.currentRow[e.$attrs["row-key"] || "id"] === l[e.$attrs["row-key"] || "id"]
|
|
126
|
-
}
|
|
127
|
-
}, [t("span")])];
|
|
128
|
-
}
|
|
129
|
-
}], null, !1, 307797321)
|
|
130
|
-
}) : e._e(), e.index ? t("TableColumn", {
|
|
131
|
-
key: "order",
|
|
132
|
-
attrs: {
|
|
133
|
-
type: "index",
|
|
134
|
-
label: "序号",
|
|
135
|
-
width: e.indexWidth,
|
|
136
|
-
align: "center"
|
|
137
|
-
},
|
|
138
|
-
scopedSlots: e._u([{
|
|
139
|
-
key: "default",
|
|
140
|
-
fn: function(s) {
|
|
141
|
-
var l = s.$index;
|
|
142
|
-
return [e._v(" " + e._s((e.page.page - 1) * e.page.limit + l + 1 || l + 1) + " ")];
|
|
143
|
-
}
|
|
144
|
-
}], null, !1, 4238275121)
|
|
145
|
-
}) : e._e(), e._t("default", function() {
|
|
146
|
-
return [e.columns && e.columns.length ? e._l(e.headers, function(s, l) {
|
|
147
|
-
return t("TableColumn", e._b({
|
|
148
|
-
key: `${s.prop}-${l}`
|
|
149
|
-
}, "TableColumn", s, !1));
|
|
150
|
-
}) : t("TableColumn", {
|
|
151
|
-
attrs: {
|
|
152
|
-
label: "点击表格行复制模板"
|
|
153
|
-
},
|
|
154
|
-
scopedSlots: e._u([{
|
|
155
|
-
key: "default",
|
|
156
|
-
fn: function(s) {
|
|
157
|
-
var l = s.row;
|
|
158
|
-
return [t("pre", {
|
|
159
|
-
staticClass: "pointer"
|
|
160
|
-
}, [e._v(e._s(JSON.stringify(l, null, " ")))])];
|
|
161
|
-
}
|
|
162
|
-
}])
|
|
163
|
-
})];
|
|
164
|
-
})], 2), t("ElPagination", {
|
|
165
|
-
staticClass: "flex-not-shrink",
|
|
166
|
-
attrs: {
|
|
167
|
-
"current-page": e.page.page,
|
|
168
|
-
"hide-on-single-page": e.hideOnSinglePage,
|
|
169
|
-
"page-size": e.page.limit,
|
|
170
|
-
total: e.page.total,
|
|
171
|
-
background: "",
|
|
172
|
-
layout: "total, prev, pager, next, jumper"
|
|
173
|
-
},
|
|
174
|
-
on: {
|
|
175
|
-
"current-change": function(s) {
|
|
176
|
-
e.page.page = s;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
})], 2)]);
|
|
180
|
-
}, A = [];
|
|
38
|
+
import { hasOwn as w } from "@web-utils/core";
|
|
39
|
+
import { cloneDeep as _, merge as C } from "@web-utils/integrations/lodash";
|
|
40
|
+
import { f as S, h as k, i as P } from "../chunks/index.57f871af.mjs";
|
|
41
|
+
import { n as B } from "../chunks/_plugin-vue2_normalizer.446f5dc4.mjs";
|
|
181
42
|
const o = {
|
|
182
43
|
loading: 1,
|
|
183
44
|
error: -1,
|
|
184
45
|
empty: 2,
|
|
185
46
|
success: 0
|
|
186
|
-
},
|
|
47
|
+
}, x = {
|
|
187
48
|
name: "PageableTable",
|
|
188
49
|
bus: {
|
|
189
|
-
reloadTableView(
|
|
190
|
-
|
|
50
|
+
reloadTableView(t) {
|
|
51
|
+
t === this.viewId && this.getPage();
|
|
191
52
|
}
|
|
192
53
|
},
|
|
193
54
|
inheritAttrs: !1,
|
|
@@ -259,11 +120,11 @@ const o = {
|
|
|
259
120
|
}
|
|
260
121
|
},
|
|
261
122
|
data() {
|
|
262
|
-
let
|
|
263
|
-
this.rules && this.rules.length > 0 && (
|
|
264
|
-
let
|
|
265
|
-
this.model && (
|
|
266
|
-
const
|
|
123
|
+
let t = { rules: [] };
|
|
124
|
+
this.rules && this.rules.length > 0 && (t.rules = this.rules), this.filters && (t = this.filters), this.filter && (t = Object.assign({}, t, this.filter));
|
|
125
|
+
let e = {};
|
|
126
|
+
this.model && (e = _(this.model));
|
|
127
|
+
const a = this.pageSize;
|
|
267
128
|
return {
|
|
268
129
|
TABLE_STATUS: Object.freeze(o),
|
|
269
130
|
tableStatus: o.empty,
|
|
@@ -272,11 +133,11 @@ const o = {
|
|
|
272
133
|
page: {
|
|
273
134
|
total: 0,
|
|
274
135
|
page: 1,
|
|
275
|
-
limit:
|
|
136
|
+
limit: a,
|
|
276
137
|
ascs: this.ascs,
|
|
277
138
|
descs: this.descs,
|
|
278
|
-
model:
|
|
279
|
-
filters:
|
|
139
|
+
model: e,
|
|
140
|
+
filters: t
|
|
280
141
|
}
|
|
281
142
|
};
|
|
282
143
|
},
|
|
@@ -299,15 +160,15 @@ const o = {
|
|
|
299
160
|
return this.httpGet ? this.httpGet : this.httpPost;
|
|
300
161
|
},
|
|
301
162
|
indexWidth() {
|
|
302
|
-
const
|
|
303
|
-
return
|
|
163
|
+
const t = `${(this.page.page - 1) * this.page.limit + this.records.length}`;
|
|
164
|
+
return t.length > 3 ? 50 + (t.length - 3) * 10 : 50;
|
|
304
165
|
},
|
|
305
166
|
mergeAttrs() {
|
|
306
|
-
return
|
|
167
|
+
return C({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
|
|
307
168
|
},
|
|
308
169
|
headers() {
|
|
309
|
-
var
|
|
310
|
-
return ((
|
|
170
|
+
var t;
|
|
171
|
+
return ((t = this.columns) == null ? void 0 : t.map(S)) || [];
|
|
311
172
|
}
|
|
312
173
|
},
|
|
313
174
|
watch: {
|
|
@@ -318,8 +179,8 @@ const o = {
|
|
|
318
179
|
},
|
|
319
180
|
model: {
|
|
320
181
|
deep: !0,
|
|
321
|
-
handler(
|
|
322
|
-
this.setModel(
|
|
182
|
+
handler(t) {
|
|
183
|
+
this.setModel(t);
|
|
323
184
|
}
|
|
324
185
|
}
|
|
325
186
|
},
|
|
@@ -336,61 +197,61 @@ const o = {
|
|
|
336
197
|
this.$refs.table.bodyWrapper.removeEventListener("scroll", this.onTableScroll);
|
|
337
198
|
},
|
|
338
199
|
methods: {
|
|
339
|
-
rowDbClick(...
|
|
340
|
-
var
|
|
341
|
-
const
|
|
200
|
+
rowDbClick(...t) {
|
|
201
|
+
var a;
|
|
202
|
+
const e = this.$refs.table.$children.find((s) => {
|
|
342
203
|
var l;
|
|
343
204
|
return ((l = s.$options) == null ? void 0 : l.name) === "ElTableBody";
|
|
344
205
|
});
|
|
345
|
-
|
|
206
|
+
e && ((a = e.$refs.tooltip) == null || a.hide()), this.$emit("row-dblclick", ...t);
|
|
346
207
|
},
|
|
347
208
|
updateTableScrollPosition() {
|
|
348
209
|
return h(this, null, function* () {
|
|
349
210
|
this.$refs.table.bodyWrapper && this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
|
|
350
211
|
});
|
|
351
212
|
},
|
|
352
|
-
filterTableProperties:
|
|
213
|
+
filterTableProperties: k,
|
|
353
214
|
filterTableEvents: P,
|
|
354
215
|
filterTableColumnProperties: S,
|
|
355
216
|
onTableScroll() {
|
|
356
217
|
this.tableScrollTop = this.$refs.table.bodyWrapper.scrollTop, this.tableScrollLeft = this.$refs.table.bodyWrapper.scrollLeft;
|
|
357
218
|
},
|
|
358
|
-
onSortChange({ prop:
|
|
359
|
-
this.page.ascs =
|
|
219
|
+
onSortChange({ prop: t, order: e }) {
|
|
220
|
+
this.page.ascs = e === "ascending" ? t : "", this.page.descs = e === "descending" ? t : "";
|
|
360
221
|
},
|
|
361
|
-
onCurrentChange(
|
|
362
|
-
this.currentRow =
|
|
222
|
+
onCurrentChange(t) {
|
|
223
|
+
this.currentRow = t;
|
|
363
224
|
},
|
|
364
225
|
/**
|
|
365
226
|
*
|
|
366
227
|
* @param {FilterRule} rule
|
|
367
228
|
*/
|
|
368
|
-
addRule(
|
|
369
|
-
this.removeRule(
|
|
229
|
+
addRule(t) {
|
|
230
|
+
this.removeRule(t.field), this.page.filters.rules.push(t);
|
|
370
231
|
},
|
|
371
|
-
addRules(
|
|
372
|
-
|
|
232
|
+
addRules(t) {
|
|
233
|
+
t.forEach((e) => this.addRule(e));
|
|
373
234
|
},
|
|
374
|
-
setModelField(
|
|
375
|
-
this.$set(this.page.model,
|
|
235
|
+
setModelField(t, e) {
|
|
236
|
+
this.$set(this.page.model, t, e);
|
|
376
237
|
},
|
|
377
|
-
setModel(
|
|
378
|
-
this.page.page = 1, this.page.model = _(
|
|
238
|
+
setModel(t) {
|
|
239
|
+
this.page.page = 1, this.page.model = _(t);
|
|
379
240
|
},
|
|
380
|
-
deleteModelField(
|
|
381
|
-
delete this.page.model[
|
|
241
|
+
deleteModelField(t) {
|
|
242
|
+
delete this.page.model[t];
|
|
382
243
|
},
|
|
383
|
-
removeRule(
|
|
384
|
-
const
|
|
385
|
-
|
|
244
|
+
removeRule(t) {
|
|
245
|
+
const e = this.page.filters.rules, a = e.findIndex((s) => s.field === t);
|
|
246
|
+
a > -1 && e.splice(a, 1);
|
|
386
247
|
},
|
|
387
|
-
addFilter({ field:
|
|
248
|
+
addFilter({ field: t, op: e, value: a }) {
|
|
388
249
|
this.page.filters = Object.assign({}, this.page.filters, {
|
|
389
250
|
rules: [
|
|
390
251
|
{
|
|
391
|
-
field:
|
|
392
|
-
op:
|
|
393
|
-
value:
|
|
252
|
+
field: t,
|
|
253
|
+
op: e,
|
|
254
|
+
value: a
|
|
394
255
|
}
|
|
395
256
|
],
|
|
396
257
|
op: "and"
|
|
@@ -408,17 +269,17 @@ const o = {
|
|
|
408
269
|
getPage() {
|
|
409
270
|
return h(this, null, function* () {
|
|
410
271
|
var r;
|
|
411
|
-
if (
|
|
272
|
+
if (w(this.$attrs, "data")) {
|
|
412
273
|
this.records = this.$attrs.data, this.page.page = 1, this.page.total = this.records.length, this.page.limit = this.page.total;
|
|
413
274
|
return;
|
|
414
275
|
}
|
|
415
276
|
this.records = [];
|
|
416
|
-
let
|
|
417
|
-
const i = this.page, { filters:
|
|
418
|
-
if ((r =
|
|
277
|
+
let t;
|
|
278
|
+
const i = this.page, { filters: e } = i, a = y(i, ["filters"]), s = c({}, a);
|
|
279
|
+
if ((r = e == null ? void 0 : e.rules) != null && r.length && (s.filters = { rules: e.rules }), this.api || this.url) {
|
|
419
280
|
this.tableStatus = o.loading;
|
|
420
281
|
try {
|
|
421
|
-
this.api && (
|
|
282
|
+
this.api && (t = yield this.api(s)), this.url && (t = yield this.method(this.url, s));
|
|
422
283
|
} catch (d) {
|
|
423
284
|
this.tableStatus = o.error, console.error(d);
|
|
424
285
|
return;
|
|
@@ -430,7 +291,7 @@ const o = {
|
|
|
430
291
|
});
|
|
431
292
|
return;
|
|
432
293
|
}
|
|
433
|
-
const { data: l } =
|
|
294
|
+
const { data: l } = t || {}, { total: u, records: n } = l || {};
|
|
434
295
|
this.page.total = Number(u), this.records = n, !n || !n.length ? this.tableStatus = o.empty : this.tableStatus = o.success, this.$refs.table.doLayout(), this.$emit("page-loaded", l);
|
|
435
296
|
});
|
|
436
297
|
},
|
|
@@ -446,28 +307,45 @@ const o = {
|
|
|
446
307
|
});
|
|
447
308
|
});
|
|
448
309
|
},
|
|
449
|
-
scrollTo(
|
|
450
|
-
|
|
310
|
+
scrollTo(t, e) {
|
|
311
|
+
t && (this.$refs.table.bodyWrapper.scrollTop = t), e && (this.$refs.table.bodyWrapper.scrollLeft = e);
|
|
451
312
|
}
|
|
452
313
|
}
|
|
453
|
-
}
|
|
454
|
-
var
|
|
455
|
-
|
|
314
|
+
};
|
|
315
|
+
var E = function() {
|
|
316
|
+
var e = this, a = e._self._c;
|
|
317
|
+
return a("div", { class: ["pageable-table", { "auto-height": e.autoHeight }] }, [a("div", { staticClass: "pageable-table-wrapper" }, [e._t("toolbar"), a("ElTable", e._g(e._b({ ref: "table", class: ["flex-item", { "header-bold": e.headerBold }], attrs: { data: e.records, border: e.border }, on: { "hook:updated": e.updateTableScrollPosition, "sort-change": e.onSortChange, "row-dblclick": e.rowDbClick, "current-change": e.onCurrentChange }, scopedSlots: e._u([{ key: "empty", fn: function() {
|
|
318
|
+
return [e._t("empty", function() {
|
|
319
|
+
return [e.tableStatus === e.TABLE_STATUS.loading ? [a("span", { staticClass: "pageable-table-loading" }, [a("i", { staticClass: "table-status-icon el-icon-loading" }), e._v(" 加载中...")])] : e.tableStatus === e.TABLE_STATUS.error ? [a("ElButton", { staticClass: "pageable-table-error", attrs: { icon: "table-status-icon fa fa-frown-o" }, on: { click: e.refresh } }, [e._v(" 加载失败,点击重试! ")])] : [e._v(" 暂无数据 ")]];
|
|
320
|
+
})];
|
|
321
|
+
}, proxy: !0 }, { key: "append", fn: function() {
|
|
322
|
+
return [e._t("append")];
|
|
323
|
+
}, proxy: !0 }], null, !0) }, "ElTable", e.filterTableProperties(e.mergeAttrs), !1), e.filterTableEvents(e.$listeners)), [e.multiple && e.selection ? a("TableColumn", { key: "multiple", attrs: { type: "selection", width: "45", align: "center" } }) : e._e(), !e.multiple && e.selection ? a("TableColumn", { key: "single", attrs: { type: "single-selection", "class-name": "single-select-column", width: "45", align: "center" }, scopedSlots: e._u([{ key: "header", fn: function() {
|
|
324
|
+
return [a("ElRadio", { attrs: { value: !!e.currentRow, label: !0 } }, [a("span")])];
|
|
325
|
+
}, proxy: !0 }, { key: "default", fn: function({ row: s }) {
|
|
326
|
+
return [a("ElRadio", { attrs: { label: !0, value: e.currentRow && e.currentRow[e.$attrs["row-key"] || "id"] === s[e.$attrs["row-key"] || "id"] } }, [a("span")])];
|
|
327
|
+
} }], null, !1, 307797321) }) : e._e(), e.index ? a("TableColumn", { key: "order", attrs: { type: "index", label: "序号", width: e.indexWidth, align: "center" }, scopedSlots: e._u([{ key: "default", fn: function({ $index: s }) {
|
|
328
|
+
return [e._v(" " + e._s((e.page.page - 1) * e.page.limit + s + 1 || s + 1) + " ")];
|
|
329
|
+
} }], null, !1, 4238275121) }) : e._e(), e._t("default", function() {
|
|
330
|
+
return [e.columns && e.columns.length ? e._l(e.headers, function(s, l) {
|
|
331
|
+
return a("TableColumn", e._b({ key: `${s.prop}-${l}` }, "TableColumn", s, !1));
|
|
332
|
+
}) : a("TableColumn", { attrs: { label: "点击表格行复制模板" }, scopedSlots: e._u([{ key: "default", fn: function({ row: s }) {
|
|
333
|
+
return [a("pre", { staticClass: "pointer" }, [e._v(e._s(JSON.stringify(s, null, " ")))])];
|
|
334
|
+
} }]) })];
|
|
335
|
+
})], 2), a("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, background: "", layout: "total, prev, pager, next, jumper" }, on: { "current-change": (s) => {
|
|
336
|
+
e.page.page = s;
|
|
337
|
+
} } })], 2)]);
|
|
338
|
+
}, A = [], R = /* @__PURE__ */ B(
|
|
339
|
+
x,
|
|
456
340
|
E,
|
|
457
341
|
A,
|
|
458
342
|
!1,
|
|
459
|
-
|
|
343
|
+
null,
|
|
460
344
|
null,
|
|
461
345
|
null,
|
|
462
346
|
null
|
|
463
347
|
);
|
|
464
|
-
|
|
465
|
-
for (let a in T)
|
|
466
|
-
this[a] = T[a];
|
|
467
|
-
}
|
|
468
|
-
const D = /* @__PURE__ */ function() {
|
|
469
|
-
return O.exports;
|
|
470
|
-
}();
|
|
348
|
+
const M = R.exports;
|
|
471
349
|
export {
|
|
472
|
-
|
|
350
|
+
M as default
|
|
473
351
|
};
|
package/pageable-view/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var v = Object.defineProperty, $ = Object.defineProperties;
|
|
2
|
+
var T = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var d = Object.getOwnPropertySymbols;
|
|
4
4
|
var f = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var u = (e, t, s) => t in e ?
|
|
5
|
+
var u = (e, t, s) => t in e ? v(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, p = (e, t) => {
|
|
6
6
|
for (var s in t || (t = {}))
|
|
7
7
|
f.call(t, s) && u(e, s, t[s]);
|
|
8
8
|
if (d)
|
|
9
9
|
for (var s of d(t))
|
|
10
10
|
m.call(t, s) && u(e, s, t[s]);
|
|
11
11
|
return e;
|
|
12
|
-
}, b = (e, t) =>
|
|
12
|
+
}, b = (e, t) => $(e, T(t));
|
|
13
13
|
var y = (e, t) => {
|
|
14
14
|
var s = {};
|
|
15
15
|
for (var l in e)
|
|
@@ -35,64 +35,10 @@ var h = (e, t, s) => new Promise((l, r) => {
|
|
|
35
35
|
}, a = (i) => i.done ? l(i.value) : Promise.resolve(i.value).then(g, o);
|
|
36
36
|
a((s = s.apply(e, t)).next());
|
|
37
37
|
});
|
|
38
|
-
import { cloneDeep as S, merge as
|
|
39
|
-
import { copy as
|
|
40
|
-
import { f as
|
|
41
|
-
import { n as
|
|
42
|
-
var R = function() {
|
|
43
|
-
var e = this, t = e.$createElement, s = e._self._c || t;
|
|
44
|
-
return s("div", {
|
|
45
|
-
staticClass: "work",
|
|
46
|
-
staticStyle: {
|
|
47
|
-
height: "100%",
|
|
48
|
-
"background-color": "#fff"
|
|
49
|
-
}
|
|
50
|
-
}, [s("div", {
|
|
51
|
-
staticClass: "flex-column list-content",
|
|
52
|
-
staticStyle: {
|
|
53
|
-
height: "100%"
|
|
54
|
-
}
|
|
55
|
-
}, [s("div", {
|
|
56
|
-
directives: [{
|
|
57
|
-
name: "loading",
|
|
58
|
-
rawName: "v-loading",
|
|
59
|
-
value: e.loading,
|
|
60
|
-
expression: "loading"
|
|
61
|
-
}],
|
|
62
|
-
staticClass: "flex-item-relative",
|
|
63
|
-
attrs: {
|
|
64
|
-
"element-loading-text": "加载中...",
|
|
65
|
-
"element-loading-background": "#fff"
|
|
66
|
-
}
|
|
67
|
-
}, [s("div", {
|
|
68
|
-
ref: "scroller",
|
|
69
|
-
staticClass: "scroll-wrapper"
|
|
70
|
-
}, [s("div", {
|
|
71
|
-
staticClass: "cards-block"
|
|
72
|
-
}, [e._t("prepend"), e._l(e.records, function(l) {
|
|
73
|
-
return [e._t("default", null, {
|
|
74
|
-
item: l
|
|
75
|
-
})];
|
|
76
|
-
}), e._t("append")], 2)])]), s("ElPagination", {
|
|
77
|
-
staticClass: "flex-not-shrink",
|
|
78
|
-
staticStyle: {
|
|
79
|
-
"border-top": "1px solid #ebeef5"
|
|
80
|
-
},
|
|
81
|
-
attrs: {
|
|
82
|
-
"current-page": e.page.page,
|
|
83
|
-
"hide-on-single-page": e.hideOnSinglePage,
|
|
84
|
-
"page-size": e.page.limit,
|
|
85
|
-
total: e.page.total,
|
|
86
|
-
background: "",
|
|
87
|
-
layout: "total, prev, pager, next, jumper"
|
|
88
|
-
},
|
|
89
|
-
on: {
|
|
90
|
-
"current-change": function(l) {
|
|
91
|
-
e.page.page = l;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
})], 1)]);
|
|
95
|
-
}, j = [];
|
|
38
|
+
import { cloneDeep as S, merge as w } from "@web-utils/integrations/lodash";
|
|
39
|
+
import { copy as P, hasOwn as x } from "@web-utils/core";
|
|
40
|
+
import { f as _, h as C, i as O } from "../chunks/index.57f871af.mjs";
|
|
41
|
+
import { n as R } from "../chunks/_plugin-vue2_normalizer.446f5dc4.mjs";
|
|
96
42
|
function k(e) {
|
|
97
43
|
let t = "";
|
|
98
44
|
for (const s in e)
|
|
@@ -105,7 +51,7 @@ const c = {
|
|
|
105
51
|
error: -1,
|
|
106
52
|
empty: 2,
|
|
107
53
|
success: 0
|
|
108
|
-
},
|
|
54
|
+
}, E = {
|
|
109
55
|
name: "PageableView",
|
|
110
56
|
bus: {
|
|
111
57
|
reloadTableView(e) {
|
|
@@ -209,11 +155,11 @@ const c = {
|
|
|
209
155
|
return e.length > 3 ? 50 + (e.length - 3) * 10 : 50;
|
|
210
156
|
},
|
|
211
157
|
mergeAttrs() {
|
|
212
|
-
return
|
|
158
|
+
return w({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
|
|
213
159
|
},
|
|
214
160
|
headers() {
|
|
215
161
|
var e;
|
|
216
|
-
return ((e = this.columns) == null ? void 0 : e.map(
|
|
162
|
+
return ((e = this.columns) == null ? void 0 : e.map(_)) || [];
|
|
217
163
|
}
|
|
218
164
|
},
|
|
219
165
|
watch: {
|
|
@@ -248,13 +194,13 @@ const c = {
|
|
|
248
194
|
this.$refs.scroller && this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
|
|
249
195
|
});
|
|
250
196
|
},
|
|
251
|
-
filterTableProperties:
|
|
252
|
-
filterTableEvents:
|
|
253
|
-
filterTableColumnProperties:
|
|
197
|
+
filterTableProperties: C,
|
|
198
|
+
filterTableEvents: O,
|
|
199
|
+
filterTableColumnProperties: _,
|
|
254
200
|
onTableScroll() {
|
|
255
201
|
this.tableScrollTop = this.$refs.scroller.scrollTop, this.tableScrollLeft = this.$refs.scroller.scrollLeft;
|
|
256
202
|
},
|
|
257
|
-
copy: (e) =>
|
|
203
|
+
copy: (e) => P(k(e)),
|
|
258
204
|
onSortChange({ prop: e, order: t }) {
|
|
259
205
|
this.page.ascs = t === "ascending" ? e : "", this.page.descs = t === "descending" ? e : "";
|
|
260
206
|
},
|
|
@@ -308,7 +254,7 @@ const c = {
|
|
|
308
254
|
getPage() {
|
|
309
255
|
return h(this, null, function* () {
|
|
310
256
|
var i;
|
|
311
|
-
if (
|
|
257
|
+
if (x(this.$attrs, "data")) {
|
|
312
258
|
this.records = this.$attrs.data, this.page.page = 1, this.page.total = this.records.length, this.page.limit = this.page.total;
|
|
313
259
|
return;
|
|
314
260
|
}
|
|
@@ -350,24 +296,25 @@ const c = {
|
|
|
350
296
|
e && (this.$refs.scroller.scrollTop = e), t && (this.$refs.scroller.scrollLeft = t);
|
|
351
297
|
}
|
|
352
298
|
}
|
|
353
|
-
}
|
|
354
|
-
var
|
|
299
|
+
};
|
|
300
|
+
var F = function() {
|
|
301
|
+
var t = this, s = t._self._c;
|
|
302
|
+
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) {
|
|
303
|
+
return [t._t("default", null, { item: l })];
|
|
304
|
+
}), 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) => {
|
|
305
|
+
t.page.page = l;
|
|
306
|
+
} } })], 1)]);
|
|
307
|
+
}, L = [], M = /* @__PURE__ */ R(
|
|
308
|
+
E,
|
|
355
309
|
F,
|
|
356
|
-
|
|
357
|
-
j,
|
|
310
|
+
L,
|
|
358
311
|
!1,
|
|
359
|
-
|
|
312
|
+
null,
|
|
360
313
|
null,
|
|
361
314
|
null,
|
|
362
315
|
null
|
|
363
316
|
);
|
|
364
|
-
|
|
365
|
-
for (let t in _)
|
|
366
|
-
this[t] = _[t];
|
|
367
|
-
}
|
|
368
|
-
const N = /* @__PURE__ */ function() {
|
|
369
|
-
return L.exports;
|
|
370
|
-
}();
|
|
317
|
+
const G = M.exports;
|
|
371
318
|
export {
|
|
372
|
-
|
|
319
|
+
G as default
|
|
373
320
|
};
|