@web-utils/component 2.0.12 → 2.0.14
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/chunks/3a79781b.js +75 -0
- package/dist/chunks/{44b78389.js → 41a066be.js} +8 -8
- package/dist/chunks/{e1939731.js → 5a78e0db.js} +5 -6
- package/dist/chunks/5d4282fb.js +30 -0
- package/dist/chunks/{822300f3.js → 61ad06b2.js} +3 -3
- package/dist/chunks/76680a03.js +24 -0
- package/dist/chunks/8c0142e0.js +81 -0
- package/dist/chunks/97652d86.js +26 -0
- package/dist/chunks/b4acd3a6.js +126 -0
- package/dist/chunks/f71045fc.js +184 -0
- package/dist/components/address-input/index.js +43 -56
- package/dist/components/address-input/style.css +1 -15
- package/dist/components/aside-menu/index.js +30 -36
- package/dist/components/aside-menu/style.css +1 -9
- package/dist/components/awesome-button/index.js +32 -35
- package/dist/components/base.css +1 -66
- package/dist/components/capsule-tab/index.js +27 -33
- package/dist/components/capsule-tab/style.css +1 -32
- package/dist/components/chunk-file-uploader/index.js +54 -88
- package/dist/components/chunk-file-uploader/style.css +1 -4
- package/dist/components/chunk-file-uploader-button/index.js +25 -31
- package/dist/components/chunk-file-uploader-button/style.css +1 -17
- package/dist/components/chunk-file-uploader-drop/index.js +28 -42
- package/dist/components/chunk-file-uploader-drop/style.css +1 -12
- package/dist/components/chunk-file-uploader-file/index.js +134 -212
- package/dist/components/chunk-file-uploader-file/style.css +1 -125
- package/dist/components/chunk-file-uploader-files/index.js +28 -34
- package/dist/components/chunk-file-uploader-files/style.css +1 -9
- package/dist/components/chunk-file-uploader-list/index.js +29 -35
- package/dist/components/chunk-file-uploader-list/style.css +1 -9
- package/dist/components/chunk-file-uploader-un-support/index.js +30 -38
- package/dist/components/chunk-file-uploader-un-support/style.css +1 -6
- package/dist/components/code-mirror-editor/index.js +153 -181
- package/dist/components/code-mirror-editor/style.css +1 -17
- package/dist/components/color-picker/index.js +49 -68
- package/dist/components/confirm-button/index.js +19 -21
- package/dist/components/confirmable/index.js +18 -19
- package/dist/components/context-menu/index.js +108 -130
- package/dist/components/context-menu/style.css +1 -88
- package/dist/components/custom-scrollbar/index.js +49 -67
- package/dist/components/data-table-picker/index.js +62 -81
- package/dist/components/dynamic-table/index.js +89 -113
- package/dist/components/dynamic-table/style.css +1 -30
- package/dist/components/e-charts/index.js +120 -201
- package/dist/components/e-charts/style.css +1 -10
- package/dist/components/editable-progress/index.js +60 -93
- package/dist/components/editable-progress/style.css +1 -37
- package/dist/components/editable-tree/index.js +423 -638
- package/dist/components/editable-tree/style.css +1 -82
- package/dist/components/egd-collapse/index.js +33 -46
- package/dist/components/egd-collapse-item/index.js +60 -76
- package/dist/components/element-dialog/index.js +95 -147
- package/dist/components/element-dialog/style.css +1 -102
- package/dist/components/empty-view/index.js +28 -34
- package/dist/components/empty-view/style.css +1 -17
- package/dist/components/error-view/index.js +26 -32
- package/dist/components/error-view/style.css +1 -17
- package/dist/components/flex-column/index.js +25 -40
- package/dist/components/flex-item/index.js +29 -57
- package/dist/components/flex-row/index.js +25 -40
- package/dist/components/flex-scroller/index.js +26 -32
- package/dist/components/flex-scroller/style.css +1 -20
- package/dist/components/form-button/index.js +34 -38
- package/dist/components/form-cascader/index.js +71 -81
- package/dist/components/form-checkbox-group/index.js +88 -113
- package/dist/components/form-checkbox-group/style.css +1 -51
- package/dist/components/form-date-picker/index.js +70 -132
- package/dist/components/form-holder/index.js +32 -39
- package/dist/components/form-input/index.js +56 -62
- package/dist/components/form-input-email/index.js +48 -60
- package/dist/components/form-input-id-card/index.js +53 -59
- package/dist/components/form-input-number/index.js +61 -68
- package/dist/components/form-input-number/style.css +1 -12
- package/dist/components/form-input-phone-number/index.js +49 -55
- package/dist/components/form-input-time/index.js +53 -59
- package/dist/components/form-item/index.js +80 -123
- package/dist/components/form-item/style.css +1 -11
- package/dist/components/form-item-config-provider/index.js +25 -26
- package/dist/components/form-item-group/index.js +85 -111
- package/dist/components/form-item-group/style.css +1 -30
- package/dist/components/form-radio-group/index.js +85 -104
- package/dist/components/form-radio-group/style.css +1 -53
- package/dist/components/form-select/index.js +76 -91
- package/dist/components/form-switch/index.js +51 -57
- package/dist/components/form-textarea/index.js +51 -57
- package/dist/components/form-view/index.js +165 -232
- package/dist/components/form-view/style.css +1 -158
- package/dist/components/guide-steps/index.js +44 -58
- package/dist/components/guide-steps/style.css +1 -34
- package/dist/components/icon-card/index.js +29 -35
- package/dist/components/icon-card/style.css +1 -56
- package/dist/components/iframe-window/index.js +29 -35
- package/dist/components/iframe-window/style.css +1 -20
- package/dist/components/image-viewer/index.js +48 -66
- package/dist/components/image-viewer/style.css +1 -21
- package/dist/components/input-number/index.js +127 -193
- package/dist/components/input-number/style.css +1 -15
- package/dist/components/input-number-range/index.js +45 -57
- package/dist/components/input-number-range/style.css +1 -12
- package/dist/components/j-s-x-component/index.js +4 -4
- package/dist/components/keep-view-alive/index.js +73 -120
- package/dist/components/loading-view/index.js +26 -32
- package/dist/components/loading-view/style.css +1 -17
- package/dist/components/nav-bar/index.js +27 -37
- package/dist/components/nav-bar/style.css +1 -17
- package/dist/components/not-implement/index.js +23 -31
- package/dist/components/not-implement/style.css +1 -15
- package/dist/components/page/index.js +22 -28
- package/dist/components/page/style.css +1 -12
- package/dist/components/page-header/index.js +30 -36
- package/dist/components/page-header/style.css +1 -14
- package/dist/components/page-index/index.js +62 -83
- package/dist/components/page-index/style.css +1 -23
- package/dist/components/page-index-top/index.js +53 -68
- package/dist/components/page-skeleton/index.js +31 -37
- package/dist/components/page-skeleton/style.css +1 -23
- package/dist/components/page-skeleton-new/index.js +42 -48
- package/dist/components/page-skeleton-new/style.css +1 -42
- package/dist/components/pageable-table/index.js +186 -253
- package/dist/components/pageable-table/style.css +1 -72
- package/dist/components/pageable-view/index.js +129 -199
- package/dist/components/pageable-view/style.css +1 -69
- package/dist/components/photo-swipe/index.js +110 -151
- package/dist/components/photo-swipe/style.css +1 -20
- package/dist/components/resize-observer/index.js +34 -68
- package/dist/components/resize-observer/style.css +1 -31
- package/dist/components/search-popover/index.js +153 -211
- package/dist/components/search-popover/style.css +1 -93
- package/dist/components/sign-panel/index.js +92 -142
- package/dist/components/sign-panel/style.css +1 -97
- package/dist/components/split-pane/index.js +101 -162
- package/dist/components/split-pane/style.css +1 -100
- package/dist/components/stateful/index.js +31 -34
- package/dist/components/stateful/style.css +1 -33
- package/dist/components/static-pageable-table/index.js +37 -44
- package/dist/components/static-pageable-table/style.css +1 -9
- package/dist/components/swiper/index.js +85 -150
- package/dist/components/swiper/style.css +1 -43
- package/dist/components/tab/index.js +54 -72
- package/dist/components/tab/style.css +1 -122
- package/dist/components/tab-item/index.js +30 -35
- package/dist/components/table-column/index.js +30 -32
- package/dist/components/table-view/index.js +156 -227
- package/dist/components/table-view/style.css +1 -95
- package/dist/components/tag-render/index.js +44 -58
- package/dist/components/tag-render/style.css +1 -33
- package/dist/components/tinymce-editor/index.js +79 -95
- package/dist/components/tinymce-editor/style.css +1 -43
- package/dist/components/tinymce-wrapper/index.js +92 -121
- package/dist/components/tinymce-wrapper/style.css +1 -36
- package/dist/components/toolbar/index.js +63 -84
- package/dist/components/toolbar/style.css +1 -39
- package/dist/components/toolbar-button/index.js +41 -48
- package/dist/components/toolbar-button/style.css +1 -21
- package/dist/components/trigger/index.js +29 -36
- package/dist/components/vue-tags-input/index.js +188 -308
- package/dist/components/vue-tags-input/style.css +1 -682
- package/dist/components/watermark/index.js +25 -37
- package/dist/components/watermark/style.css +1 -11
- package/dist/components/x-dialog/index.js +67 -93
- package/dist/components/x-dialog/style.css +1 -15
- package/dist/index.css +193 -1105
- package/dist/index.es.js +4790 -7243
- package/package.json +1 -2
- package/web-types.json +1 -1
- package/dist/chunks/3d28cc08.js +0 -57
- package/dist/chunks/5d33812d.js +0 -147
- package/dist/chunks/9d848bf6.js +0 -99
- package/dist/chunks/a0bb327b.js +0 -96
- package/dist/chunks/a8891d2c.js +0 -30
- package/dist/chunks/c69d5628.js +0 -248
- package/dist/chunks/de9fe802.js +0 -24
|
@@ -1,165 +1,158 @@
|
|
|
1
|
-
import { cloneDeep, merge, hasOwn } from "@web-utils/core";
|
|
2
|
-
import { f as
|
|
3
|
-
import { n as
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var _c = _vm._self._c || _h;
|
|
8
|
-
return _c("div", {
|
|
1
|
+
import { cloneDeep as n, merge as c, hasOwn as g } from "@web-utils/core";
|
|
2
|
+
import { f as d, d as f, e as b } from "../../chunks/f71045fc.js";
|
|
3
|
+
import { n as m } from "../../chunks/5d4282fb.js";
|
|
4
|
+
var y = function() {
|
|
5
|
+
var e = this, t = e.$createElement, a = e._self._c || t;
|
|
6
|
+
return a("div", {
|
|
9
7
|
class: ["pageable-table", {
|
|
10
|
-
"auto-height":
|
|
8
|
+
"auto-height": e.autoHeight
|
|
11
9
|
}]
|
|
12
|
-
}, [
|
|
10
|
+
}, [a("div", {
|
|
13
11
|
staticClass: "pageable-table-wrapper"
|
|
14
|
-
}, [
|
|
12
|
+
}, [e._t("toolbar"), a("ElTable", e._g(e._b({
|
|
15
13
|
ref: "table",
|
|
16
14
|
class: ["flex-item", {
|
|
17
|
-
"header-bold":
|
|
15
|
+
"header-bold": e.headerBold
|
|
18
16
|
}],
|
|
19
17
|
attrs: {
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
data: e.records,
|
|
19
|
+
border: e.border
|
|
22
20
|
},
|
|
23
21
|
on: {
|
|
24
|
-
"hook:updated":
|
|
25
|
-
"sort-change":
|
|
26
|
-
"row-dblclick":
|
|
27
|
-
"current-change":
|
|
22
|
+
"hook:updated": e.updateTableScrollPosition,
|
|
23
|
+
"sort-change": e.onSortChange,
|
|
24
|
+
"row-dblclick": e.rowDbClick,
|
|
25
|
+
"current-change": e.onCurrentChange
|
|
28
26
|
},
|
|
29
|
-
scopedSlots:
|
|
27
|
+
scopedSlots: e._u([{
|
|
30
28
|
key: "empty",
|
|
31
29
|
fn: function() {
|
|
32
|
-
return [
|
|
33
|
-
return [
|
|
30
|
+
return [e._t("empty", function() {
|
|
31
|
+
return [e.tableStatus === e.TABLE_STATUS.loading ? [a("span", {
|
|
34
32
|
staticClass: "pageable-table-loading"
|
|
35
|
-
}, [
|
|
33
|
+
}, [a("i", {
|
|
36
34
|
staticClass: "table-status-icon el-icon-loading"
|
|
37
|
-
}),
|
|
35
|
+
}), e._v(" 加载中...")])] : e.tableStatus === e.TABLE_STATUS.error ? [a("ElButton", {
|
|
38
36
|
staticClass: "pageable-table-error",
|
|
39
37
|
attrs: {
|
|
40
|
-
|
|
38
|
+
icon: "table-status-icon fa fa-frown-o"
|
|
41
39
|
},
|
|
42
40
|
on: {
|
|
43
|
-
|
|
41
|
+
click: e.refresh
|
|
44
42
|
}
|
|
45
|
-
}, [
|
|
43
|
+
}, [e._v(" 加载失败,点击重试! ")])] : [e._v(" 暂无数据 ")]];
|
|
46
44
|
})];
|
|
47
45
|
},
|
|
48
|
-
proxy:
|
|
46
|
+
proxy: !0
|
|
49
47
|
}, {
|
|
50
48
|
key: "append",
|
|
51
49
|
fn: function() {
|
|
52
|
-
return [
|
|
50
|
+
return [e._t("append")];
|
|
53
51
|
},
|
|
54
|
-
proxy:
|
|
55
|
-
}], null,
|
|
56
|
-
}, "ElTable",
|
|
52
|
+
proxy: !0
|
|
53
|
+
}], null, !0)
|
|
54
|
+
}, "ElTable", e.filterTableProperties(e.mergeAttrs), !1), e.filterTableEvents(e.$listeners)), [e.multiple && e.selection ? a("TableColumn", {
|
|
57
55
|
key: "multiple",
|
|
58
56
|
attrs: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
type: "selection",
|
|
58
|
+
width: "45",
|
|
59
|
+
align: "center"
|
|
62
60
|
}
|
|
63
|
-
}) :
|
|
61
|
+
}) : e._e(), !e.multiple && e.selection ? a("TableColumn", {
|
|
64
62
|
key: "single",
|
|
65
63
|
attrs: {
|
|
66
|
-
|
|
64
|
+
type: "single-selection",
|
|
67
65
|
"class-name": "single-select-column",
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
width: "45",
|
|
67
|
+
align: "center"
|
|
70
68
|
},
|
|
71
|
-
scopedSlots:
|
|
69
|
+
scopedSlots: e._u([{
|
|
72
70
|
key: "header",
|
|
73
71
|
fn: function() {
|
|
74
|
-
return [
|
|
72
|
+
return [a("ElRadio", {
|
|
75
73
|
attrs: {
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
value: !!e.currentRow,
|
|
75
|
+
label: !0
|
|
78
76
|
}
|
|
79
|
-
}, [
|
|
77
|
+
}, [a("span")])];
|
|
80
78
|
},
|
|
81
|
-
proxy:
|
|
79
|
+
proxy: !0
|
|
82
80
|
}, {
|
|
83
81
|
key: "default",
|
|
84
|
-
fn: function(
|
|
85
|
-
var
|
|
86
|
-
return [
|
|
82
|
+
fn: function(s) {
|
|
83
|
+
var l = s.row;
|
|
84
|
+
return [a("ElRadio", {
|
|
87
85
|
attrs: {
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
label: !0,
|
|
87
|
+
value: e.currentRow && e.currentRow[e.$attrs["row-key"] || "id"] === l[e.$attrs["row-key"] || "id"]
|
|
90
88
|
}
|
|
91
|
-
}, [
|
|
89
|
+
}, [a("span")])];
|
|
92
90
|
}
|
|
93
|
-
}], null,
|
|
94
|
-
}) :
|
|
91
|
+
}], null, !1, 307797321)
|
|
92
|
+
}) : e._e(), e.index ? a("TableColumn", {
|
|
95
93
|
key: "order",
|
|
96
94
|
attrs: {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
type: "index",
|
|
96
|
+
label: "序号",
|
|
97
|
+
width: e.indexWidth,
|
|
98
|
+
align: "center"
|
|
101
99
|
},
|
|
102
|
-
scopedSlots:
|
|
100
|
+
scopedSlots: e._u([{
|
|
103
101
|
key: "default",
|
|
104
|
-
fn: function(
|
|
105
|
-
var
|
|
106
|
-
return [
|
|
102
|
+
fn: function(s) {
|
|
103
|
+
var l = s.$index;
|
|
104
|
+
return [e._v(" " + e._s((e.page.page - 1) * e.page.limit + l + 1 || l + 1) + " ")];
|
|
107
105
|
}
|
|
108
|
-
}], null,
|
|
109
|
-
}) :
|
|
110
|
-
return [
|
|
111
|
-
return
|
|
112
|
-
key: `${
|
|
113
|
-
}, "TableColumn",
|
|
114
|
-
}) :
|
|
106
|
+
}], null, !1, 4238275121)
|
|
107
|
+
}) : e._e(), e._t("default", function() {
|
|
108
|
+
return [e.columns && e.columns.length ? e._l(e.headers, function(s, l) {
|
|
109
|
+
return a("TableColumn", e._b({
|
|
110
|
+
key: `${s.prop}-${l}`
|
|
111
|
+
}, "TableColumn", s, !1));
|
|
112
|
+
}) : a("TableColumn", {
|
|
115
113
|
attrs: {
|
|
116
|
-
|
|
114
|
+
label: "点击表格行复制模板"
|
|
117
115
|
},
|
|
118
|
-
scopedSlots:
|
|
116
|
+
scopedSlots: e._u([{
|
|
119
117
|
key: "default",
|
|
120
|
-
fn: function(
|
|
121
|
-
var
|
|
122
|
-
return [
|
|
118
|
+
fn: function(s) {
|
|
119
|
+
var l = s.row;
|
|
120
|
+
return [a("pre", {
|
|
123
121
|
staticClass: "pointer"
|
|
124
|
-
}, [
|
|
122
|
+
}, [e._v(e._s(JSON.stringify(l, null, " ")))])];
|
|
125
123
|
}
|
|
126
124
|
}])
|
|
127
125
|
})];
|
|
128
|
-
})], 2),
|
|
126
|
+
})], 2), a("ElPagination", {
|
|
129
127
|
staticClass: "flex-not-shrink",
|
|
130
128
|
attrs: {
|
|
131
|
-
"current-page":
|
|
132
|
-
"hide-on-single-page":
|
|
133
|
-
"page-size":
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
129
|
+
"current-page": e.page.page,
|
|
130
|
+
"hide-on-single-page": e.hideOnSinglePage,
|
|
131
|
+
"page-size": e.page.limit,
|
|
132
|
+
total: e.page.total,
|
|
133
|
+
background: "",
|
|
134
|
+
layout: "total, prev, pager, next, jumper"
|
|
137
135
|
},
|
|
138
136
|
on: {
|
|
139
|
-
"current-change": function(
|
|
140
|
-
|
|
137
|
+
"current-change": function(s) {
|
|
138
|
+
e.page.page = s;
|
|
141
139
|
}
|
|
142
140
|
}
|
|
143
141
|
})], 2)]);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const PageableTable_vue_vue_type_style_index_0_lang = "";
|
|
147
|
-
const TABLE_STATUS = {
|
|
142
|
+
}, _ = [];
|
|
143
|
+
const r = {
|
|
148
144
|
loading: 1,
|
|
149
145
|
error: -1,
|
|
150
146
|
empty: 2,
|
|
151
147
|
success: 0
|
|
152
|
-
}
|
|
153
|
-
const __vue2_script = {
|
|
148
|
+
}, S = {
|
|
154
149
|
name: "PageableTable",
|
|
155
150
|
bus: {
|
|
156
|
-
reloadTableView(
|
|
157
|
-
|
|
158
|
-
this.getPage();
|
|
159
|
-
}
|
|
151
|
+
reloadTableView(e) {
|
|
152
|
+
e === this.viewId && this.getPage();
|
|
160
153
|
}
|
|
161
154
|
},
|
|
162
|
-
inheritAttrs:
|
|
155
|
+
inheritAttrs: !1,
|
|
163
156
|
props: {
|
|
164
157
|
viewId: {
|
|
165
158
|
type: String
|
|
@@ -197,27 +190,27 @@ const __vue2_script = {
|
|
|
197
190
|
autoHeight: Boolean,
|
|
198
191
|
immediate: {
|
|
199
192
|
type: Boolean,
|
|
200
|
-
default:
|
|
193
|
+
default: !0
|
|
201
194
|
},
|
|
202
195
|
index: {
|
|
203
196
|
type: Boolean,
|
|
204
|
-
default:
|
|
197
|
+
default: !0
|
|
205
198
|
},
|
|
206
199
|
multiple: {
|
|
207
200
|
type: Boolean,
|
|
208
|
-
default:
|
|
201
|
+
default: !0
|
|
209
202
|
},
|
|
210
203
|
selection: {
|
|
211
204
|
type: Boolean,
|
|
212
|
-
default:
|
|
205
|
+
default: !0
|
|
213
206
|
},
|
|
214
207
|
border: {
|
|
215
208
|
type: Boolean,
|
|
216
|
-
default:
|
|
209
|
+
default: !0
|
|
217
210
|
},
|
|
218
211
|
reloadOnModelChange: {
|
|
219
212
|
type: Boolean,
|
|
220
|
-
default:
|
|
213
|
+
default: !1
|
|
221
214
|
},
|
|
222
215
|
columns: {
|
|
223
216
|
type: Array
|
|
@@ -228,73 +221,55 @@ const __vue2_script = {
|
|
|
228
221
|
}
|
|
229
222
|
},
|
|
230
223
|
data() {
|
|
231
|
-
let
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
filters = this.filters;
|
|
237
|
-
}
|
|
238
|
-
if (this.filter) {
|
|
239
|
-
filters = Object.assign({}, filters, this.filter);
|
|
240
|
-
}
|
|
241
|
-
let model = {};
|
|
242
|
-
if (this.model) {
|
|
243
|
-
model = cloneDeep(this.model);
|
|
244
|
-
}
|
|
245
|
-
const limit = this.pageSize;
|
|
224
|
+
let e = { rules: [] };
|
|
225
|
+
this.rules && this.rules.length > 0 && (e.rules = this.rules), this.filters && (e = this.filters), this.filter && (e = Object.assign({}, e, this.filter));
|
|
226
|
+
let t = {};
|
|
227
|
+
this.model && (t = n(this.model));
|
|
228
|
+
const a = this.pageSize;
|
|
246
229
|
return {
|
|
247
|
-
TABLE_STATUS: Object.freeze(
|
|
248
|
-
tableStatus:
|
|
230
|
+
TABLE_STATUS: Object.freeze(r),
|
|
231
|
+
tableStatus: r.empty,
|
|
249
232
|
records: [],
|
|
250
233
|
currentRow: null,
|
|
251
234
|
page: {
|
|
252
235
|
total: 0,
|
|
253
236
|
page: 1,
|
|
254
|
-
limit,
|
|
237
|
+
limit: a,
|
|
255
238
|
ascs: this.ascs,
|
|
256
239
|
descs: this.descs,
|
|
257
|
-
model,
|
|
258
|
-
filters
|
|
240
|
+
model: t,
|
|
241
|
+
filters: e
|
|
259
242
|
}
|
|
260
243
|
};
|
|
261
244
|
},
|
|
262
245
|
computed: {
|
|
263
246
|
guard() {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
page: this.page.page,
|
|
277
|
-
filters: this.page.filters
|
|
278
|
-
};
|
|
279
|
-
}
|
|
247
|
+
return this.reloadOnModelChange ? {
|
|
248
|
+
asc: this.page.ascs,
|
|
249
|
+
desc: this.page.descs,
|
|
250
|
+
page: this.page.page,
|
|
251
|
+
model: this.page.model,
|
|
252
|
+
filters: this.page.filters
|
|
253
|
+
} : {
|
|
254
|
+
asc: this.page.ascs,
|
|
255
|
+
desc: this.page.descs,
|
|
256
|
+
page: this.page.page,
|
|
257
|
+
filters: this.page.filters
|
|
258
|
+
};
|
|
280
259
|
},
|
|
281
260
|
method() {
|
|
282
261
|
return this.httpGet ? httpGet : httpPost;
|
|
283
262
|
},
|
|
284
263
|
indexWidth() {
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
return 50 + (indexStr.length - 3) * 10;
|
|
288
|
-
} else {
|
|
289
|
-
return 50;
|
|
290
|
-
}
|
|
264
|
+
const e = `${(this.page.page - 1) * this.page.limit + this.records.length}`;
|
|
265
|
+
return e.length > 3 ? 50 + (e.length - 3) * 10 : 50;
|
|
291
266
|
},
|
|
292
267
|
mergeAttrs() {
|
|
293
|
-
return
|
|
268
|
+
return c({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
|
|
294
269
|
},
|
|
295
270
|
headers() {
|
|
296
|
-
var
|
|
297
|
-
return ((
|
|
271
|
+
var e;
|
|
272
|
+
return ((e = this.columns) == null ? void 0 : e.map(d)) || [];
|
|
298
273
|
}
|
|
299
274
|
},
|
|
300
275
|
watch: {
|
|
@@ -304,15 +279,15 @@ const __vue2_script = {
|
|
|
304
279
|
this.getPage();
|
|
305
280
|
},
|
|
306
281
|
model: {
|
|
307
|
-
deep:
|
|
308
|
-
handler(
|
|
309
|
-
this.setModel(
|
|
282
|
+
deep: !0,
|
|
283
|
+
handler(e) {
|
|
284
|
+
this.setModel(e);
|
|
310
285
|
}
|
|
311
286
|
}
|
|
312
287
|
},
|
|
313
288
|
created() {
|
|
314
289
|
this.$watch(() => this.guard, this.getPage, {
|
|
315
|
-
deep:
|
|
290
|
+
deep: !0,
|
|
316
291
|
immediate: this.immediate
|
|
317
292
|
});
|
|
318
293
|
},
|
|
@@ -323,73 +298,61 @@ const __vue2_script = {
|
|
|
323
298
|
this.$refs.table.bodyWrapper.removeEventListener("scroll", this.onTableScroll);
|
|
324
299
|
},
|
|
325
300
|
methods: {
|
|
326
|
-
rowDbClick(...
|
|
327
|
-
var
|
|
328
|
-
const
|
|
329
|
-
var
|
|
330
|
-
return ((
|
|
301
|
+
rowDbClick(...e) {
|
|
302
|
+
var a;
|
|
303
|
+
const t = this.$refs.table.$children.find((s) => {
|
|
304
|
+
var l;
|
|
305
|
+
return ((l = s.$options) == null ? void 0 : l.name) === "ElTableBody";
|
|
331
306
|
});
|
|
332
|
-
|
|
333
|
-
(_a = body.$refs.tooltip) == null ? void 0 : _a.hide();
|
|
334
|
-
}
|
|
335
|
-
this.$emit("row-dblclick", ...args);
|
|
307
|
+
t && ((a = t.$refs.tooltip) == null || a.hide()), this.$emit("row-dblclick", ...e);
|
|
336
308
|
},
|
|
337
309
|
async updateTableScrollPosition() {
|
|
338
|
-
|
|
339
|
-
this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
|
|
340
|
-
}
|
|
310
|
+
this.$refs.table.bodyWrapper && this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
|
|
341
311
|
},
|
|
342
|
-
filterTableProperties,
|
|
343
|
-
filterTableEvents,
|
|
344
|
-
filterTableColumnProperties,
|
|
312
|
+
filterTableProperties: f,
|
|
313
|
+
filterTableEvents: b,
|
|
314
|
+
filterTableColumnProperties: d,
|
|
345
315
|
onTableScroll() {
|
|
346
|
-
this.tableScrollTop = this.$refs.table.bodyWrapper.scrollTop;
|
|
347
|
-
this.tableScrollLeft = this.$refs.table.bodyWrapper.scrollLeft;
|
|
316
|
+
this.tableScrollTop = this.$refs.table.bodyWrapper.scrollTop, this.tableScrollLeft = this.$refs.table.bodyWrapper.scrollLeft;
|
|
348
317
|
},
|
|
349
318
|
onSortChange({
|
|
350
|
-
prop,
|
|
351
|
-
order
|
|
319
|
+
prop: e,
|
|
320
|
+
order: t
|
|
352
321
|
}) {
|
|
353
|
-
this.page.ascs =
|
|
354
|
-
this.page.descs = order === "descending" ? prop : "";
|
|
322
|
+
this.page.ascs = t === "ascending" ? e : "", this.page.descs = t === "descending" ? e : "";
|
|
355
323
|
},
|
|
356
|
-
onCurrentChange(
|
|
357
|
-
this.currentRow =
|
|
324
|
+
onCurrentChange(e) {
|
|
325
|
+
this.currentRow = e;
|
|
358
326
|
},
|
|
359
|
-
addRule(
|
|
360
|
-
this.removeRule(
|
|
361
|
-
this.page.filters.rules.push(rule);
|
|
327
|
+
addRule(e) {
|
|
328
|
+
this.removeRule(e.field), this.page.filters.rules.push(e);
|
|
362
329
|
},
|
|
363
|
-
addRules(
|
|
364
|
-
|
|
330
|
+
addRules(e) {
|
|
331
|
+
e.forEach((t) => this.addRule(t));
|
|
365
332
|
},
|
|
366
|
-
setModelField(
|
|
367
|
-
this.$set(this.page.model,
|
|
333
|
+
setModelField(e, t) {
|
|
334
|
+
this.$set(this.page.model, e, t);
|
|
368
335
|
},
|
|
369
|
-
setModel(
|
|
370
|
-
this.page.page = 1;
|
|
371
|
-
this.page.model = cloneDeep(model);
|
|
336
|
+
setModel(e) {
|
|
337
|
+
this.page.page = 1, this.page.model = n(e);
|
|
372
338
|
},
|
|
373
|
-
deleteModelField(
|
|
374
|
-
delete this.page.model[
|
|
339
|
+
deleteModelField(e) {
|
|
340
|
+
delete this.page.model[e];
|
|
375
341
|
},
|
|
376
|
-
removeRule(
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
if (index > -1) {
|
|
380
|
-
rules.splice(index, 1);
|
|
381
|
-
}
|
|
342
|
+
removeRule(e) {
|
|
343
|
+
const t = this.page.filters.rules, a = t.findIndex((s) => s.field === e);
|
|
344
|
+
a > -1 && t.splice(a, 1);
|
|
382
345
|
},
|
|
383
346
|
addFilter({
|
|
384
|
-
field,
|
|
385
|
-
op,
|
|
386
|
-
value
|
|
347
|
+
field: e,
|
|
348
|
+
op: t,
|
|
349
|
+
value: a
|
|
387
350
|
}) {
|
|
388
351
|
this.page.filters = Object.assign({}, this.page.filters, {
|
|
389
352
|
rules: [{
|
|
390
|
-
field,
|
|
391
|
-
op,
|
|
392
|
-
value
|
|
353
|
+
field: e,
|
|
354
|
+
op: t,
|
|
355
|
+
value: a
|
|
393
356
|
}],
|
|
394
357
|
op: "and"
|
|
395
358
|
});
|
|
@@ -401,37 +364,23 @@ const __vue2_script = {
|
|
|
401
364
|
this.$refs.table.clearSelection();
|
|
402
365
|
},
|
|
403
366
|
search() {
|
|
404
|
-
this.setModel(this.model);
|
|
405
|
-
this.getPage();
|
|
367
|
+
this.setModel(this.model), this.getPage();
|
|
406
368
|
},
|
|
407
369
|
async getPage() {
|
|
408
|
-
var
|
|
409
|
-
if (
|
|
410
|
-
this.records = this.$attrs.data;
|
|
411
|
-
this.page.page = 1;
|
|
412
|
-
this.page.total = this.records.length;
|
|
413
|
-
this.page.limit = this.page.total;
|
|
370
|
+
var o;
|
|
371
|
+
if (g(this.$attrs, "data")) {
|
|
372
|
+
this.records = this.$attrs.data, this.page.page = 1, this.page.total = this.records.length, this.page.limit = this.page.total;
|
|
414
373
|
return;
|
|
415
374
|
}
|
|
416
375
|
this.records = [];
|
|
417
|
-
let
|
|
418
|
-
const { filters, ...
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
page.filters = { rules: filters.rules };
|
|
422
|
-
}
|
|
423
|
-
if (this.api || this.url) {
|
|
424
|
-
this.tableStatus = TABLE_STATUS.loading;
|
|
376
|
+
let e;
|
|
377
|
+
const { filters: t, ...a } = this.page, s = { ...a };
|
|
378
|
+
if ((o = t == null ? void 0 : t.rules) != null && o.length && (s.filters = { rules: t.rules }), this.api || this.url) {
|
|
379
|
+
this.tableStatus = r.loading;
|
|
425
380
|
try {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
if (this.url) {
|
|
430
|
-
res = await this.method(this.url, page);
|
|
431
|
-
}
|
|
432
|
-
} catch (e) {
|
|
433
|
-
this.tableStatus = TABLE_STATUS.error;
|
|
434
|
-
console.error(e);
|
|
381
|
+
this.api && (e = await this.api(s)), this.url && (e = await this.method(this.url, s));
|
|
382
|
+
} catch (p) {
|
|
383
|
+
this.tableStatus = r.error, console.error(p);
|
|
435
384
|
return;
|
|
436
385
|
}
|
|
437
386
|
} else {
|
|
@@ -441,17 +390,8 @@ const __vue2_script = {
|
|
|
441
390
|
});
|
|
442
391
|
return;
|
|
443
392
|
}
|
|
444
|
-
const { data } =
|
|
445
|
-
|
|
446
|
-
this.page.total = Number(total);
|
|
447
|
-
this.records = records;
|
|
448
|
-
if (!records || !records.length) {
|
|
449
|
-
this.tableStatus = TABLE_STATUS.empty;
|
|
450
|
-
} else {
|
|
451
|
-
this.tableStatus = TABLE_STATUS.success;
|
|
452
|
-
}
|
|
453
|
-
this.$refs.table.doLayout();
|
|
454
|
-
this.$emit("page-loaded", data);
|
|
393
|
+
const { data: l } = e || {}, { total: u, records: i } = l || {};
|
|
394
|
+
this.page.total = Number(u), this.records = i, !i || !i.length ? this.tableStatus = r.empty : this.tableStatus = r.success, this.$refs.table.doLayout(), this.$emit("page-loaded", l);
|
|
455
395
|
},
|
|
456
396
|
async refresh() {
|
|
457
397
|
await this.getPage();
|
|
@@ -462,35 +402,28 @@ const __vue2_script = {
|
|
|
462
402
|
total: this.page.total
|
|
463
403
|
};
|
|
464
404
|
},
|
|
465
|
-
scrollTo(
|
|
466
|
-
|
|
467
|
-
this.$refs.table.bodyWrapper.scrollTop = top;
|
|
468
|
-
}
|
|
469
|
-
if (left) {
|
|
470
|
-
this.$refs.table.bodyWrapper.scrollLeft = left;
|
|
471
|
-
}
|
|
405
|
+
scrollTo(e, t) {
|
|
406
|
+
e && (this.$refs.table.bodyWrapper.scrollTop = e), t && (this.$refs.table.bodyWrapper.scrollLeft = t);
|
|
472
407
|
}
|
|
473
408
|
}
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
__vue2_injectStyles,
|
|
409
|
+
}, h = {};
|
|
410
|
+
var T = /* @__PURE__ */ m(
|
|
411
|
+
S,
|
|
412
|
+
y,
|
|
413
|
+
_,
|
|
414
|
+
!1,
|
|
415
|
+
v,
|
|
482
416
|
null,
|
|
483
417
|
null,
|
|
484
418
|
null
|
|
485
419
|
);
|
|
486
|
-
function
|
|
487
|
-
for (let
|
|
488
|
-
this[
|
|
489
|
-
}
|
|
420
|
+
function v(e) {
|
|
421
|
+
for (let t in h)
|
|
422
|
+
this[t] = h[t];
|
|
490
423
|
}
|
|
491
|
-
const
|
|
492
|
-
return
|
|
424
|
+
const k = /* @__PURE__ */ function() {
|
|
425
|
+
return T.exports;
|
|
493
426
|
}();
|
|
494
427
|
export {
|
|
495
|
-
|
|
428
|
+
k as default
|
|
496
429
|
};
|