@web-utils/component 2.0.9 → 2.0.11
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/3d28cc08.js +57 -0
- package/dist/chunks/{41a066be.js → 44b78389.js} +8 -8
- package/dist/chunks/5d33812d.js +147 -0
- package/dist/chunks/{61ad06b2.js → 822300f3.js} +3 -3
- package/dist/chunks/9d848bf6.js +99 -0
- package/dist/chunks/a0bb327b.js +96 -0
- package/dist/chunks/a8891d2c.js +30 -0
- package/dist/chunks/c69d5628.js +248 -0
- package/dist/chunks/de9fe802.js +24 -0
- package/dist/chunks/{5a78e0db.js → e1939731.js} +6 -5
- package/dist/components/address-input/index.js +56 -43
- package/dist/components/address-input/style.css +15 -1
- package/dist/components/aside-menu/index.js +36 -30
- package/dist/components/aside-menu/style.css +9 -1
- package/dist/components/awesome-button/index.js +35 -32
- package/dist/components/base.css +66 -1
- package/dist/components/capsule-tab/index.js +33 -27
- package/dist/components/capsule-tab/style.css +32 -1
- package/dist/components/chunk-file-uploader/index.js +88 -54
- package/dist/components/chunk-file-uploader/style.css +4 -1
- package/dist/components/chunk-file-uploader-button/index.js +31 -25
- package/dist/components/chunk-file-uploader-button/style.css +17 -1
- package/dist/components/chunk-file-uploader-drop/index.js +42 -28
- package/dist/components/chunk-file-uploader-drop/style.css +12 -1
- package/dist/components/chunk-file-uploader-file/index.js +212 -134
- package/dist/components/chunk-file-uploader-file/style.css +125 -1
- package/dist/components/chunk-file-uploader-files/index.js +34 -28
- package/dist/components/chunk-file-uploader-files/style.css +9 -1
- package/dist/components/chunk-file-uploader-list/index.js +35 -29
- package/dist/components/chunk-file-uploader-list/style.css +9 -1
- package/dist/components/chunk-file-uploader-un-support/index.js +38 -30
- package/dist/components/chunk-file-uploader-un-support/style.css +6 -1
- package/dist/components/code-mirror-editor/index.js +181 -153
- package/dist/components/code-mirror-editor/style.css +17 -1
- package/dist/components/color-picker/index.js +68 -49
- package/dist/components/confirm-button/index.js +21 -19
- package/dist/components/confirmable/index.js +19 -18
- package/dist/components/context-menu/index.js +130 -108
- package/dist/components/context-menu/style.css +88 -1
- package/dist/components/custom-scrollbar/index.js +67 -49
- package/dist/components/data-table-picker/index.js +81 -62
- package/dist/components/dynamic-table/index.js +113 -89
- package/dist/components/dynamic-table/style.css +30 -1
- package/dist/components/e-charts/index.js +201 -120
- package/dist/components/e-charts/style.css +10 -1
- package/dist/components/editable-progress/index.js +93 -60
- package/dist/components/editable-progress/style.css +37 -1
- package/dist/components/editable-tree/index.js +638 -423
- package/dist/components/editable-tree/style.css +82 -1
- package/dist/components/egd-collapse/index.js +46 -33
- package/dist/components/egd-collapse-item/index.js +76 -60
- package/dist/components/element-dialog/index.js +147 -95
- package/dist/components/element-dialog/style.css +102 -1
- package/dist/components/empty-view/index.js +34 -28
- package/dist/components/empty-view/style.css +17 -1
- package/dist/components/error-view/index.js +32 -26
- package/dist/components/error-view/style.css +17 -1
- package/dist/components/flex-column/index.js +40 -25
- package/dist/components/flex-item/index.js +57 -29
- package/dist/components/flex-row/index.js +40 -25
- package/dist/components/flex-scroller/index.js +32 -26
- package/dist/components/flex-scroller/style.css +20 -1
- package/dist/components/form-button/index.js +38 -34
- package/dist/components/form-cascader/index.js +81 -71
- package/dist/components/form-checkbox-group/index.js +113 -88
- package/dist/components/form-checkbox-group/style.css +51 -1
- package/dist/components/form-date-picker/index.js +132 -70
- package/dist/components/form-holder/index.js +39 -32
- package/dist/components/form-input/index.js +62 -56
- package/dist/components/form-input-email/index.js +60 -48
- package/dist/components/form-input-id-card/index.js +59 -53
- package/dist/components/form-input-number/index.js +68 -61
- package/dist/components/form-input-number/style.css +12 -1
- package/dist/components/form-input-phone-number/index.js +55 -49
- package/dist/components/form-input-time/index.js +59 -53
- package/dist/components/form-item/index.js +123 -80
- package/dist/components/form-item/style.css +11 -1
- package/dist/components/form-item-config-provider/index.js +26 -25
- package/dist/components/form-item-group/index.js +111 -85
- package/dist/components/form-item-group/style.css +30 -1
- package/dist/components/form-radio-group/index.js +104 -85
- package/dist/components/form-radio-group/style.css +53 -1
- package/dist/components/form-select/index.js +91 -76
- package/dist/components/form-switch/index.js +57 -51
- package/dist/components/form-textarea/index.js +57 -51
- package/dist/components/form-view/index.js +232 -165
- package/dist/components/form-view/style.css +158 -1
- package/dist/components/guide-steps/index.js +58 -44
- package/dist/components/guide-steps/style.css +34 -1
- package/dist/components/icon-card/index.js +35 -29
- package/dist/components/icon-card/style.css +56 -1
- package/dist/components/iframe-window/index.js +35 -29
- package/dist/components/iframe-window/style.css +20 -1
- package/dist/components/image-viewer/index.js +66 -48
- package/dist/components/image-viewer/style.css +21 -1
- package/dist/components/input-number/index.js +193 -127
- package/dist/components/input-number/style.css +15 -1
- package/dist/components/input-number-range/index.js +57 -45
- package/dist/components/input-number-range/style.css +12 -1
- package/dist/components/j-s-x-component/index.js +4 -4
- package/dist/components/keep-view-alive/index.js +120 -73
- package/dist/components/loading-view/index.js +32 -26
- package/dist/components/loading-view/style.css +17 -1
- package/dist/components/nav-bar/index.js +37 -27
- package/dist/components/nav-bar/style.css +17 -1
- package/dist/components/not-implement/index.js +31 -23
- package/dist/components/not-implement/style.css +15 -1
- package/dist/components/page/index.js +28 -22
- package/dist/components/page/style.css +12 -1
- package/dist/components/page-header/index.js +36 -30
- package/dist/components/page-header/style.css +14 -1
- package/dist/components/page-index/index.js +83 -62
- package/dist/components/page-index/style.css +23 -1
- package/dist/components/page-index-top/index.js +68 -53
- package/dist/components/page-skeleton/index.js +37 -31
- package/dist/components/page-skeleton/style.css +23 -1
- package/dist/components/page-skeleton-new/index.js +48 -42
- package/dist/components/page-skeleton-new/style.css +42 -1
- package/dist/components/pageable-table/index.js +253 -186
- package/dist/components/pageable-table/style.css +72 -1
- package/dist/components/pageable-view/index.js +199 -129
- package/dist/components/pageable-view/style.css +69 -1
- package/dist/components/photo-swipe/index.js +151 -110
- package/dist/components/photo-swipe/style.css +20 -1
- package/dist/components/resize-observer/index.js +68 -34
- package/dist/components/resize-observer/style.css +31 -1
- package/dist/components/search-popover/index.js +211 -153
- package/dist/components/search-popover/style.css +93 -1
- package/dist/components/sign-panel/index.js +142 -92
- package/dist/components/sign-panel/style.css +97 -1
- package/dist/components/split-pane/index.js +162 -101
- package/dist/components/split-pane/style.css +100 -1
- package/dist/components/stateful/index.js +34 -31
- package/dist/components/stateful/style.css +33 -1
- package/dist/components/static-pageable-table/index.js +44 -37
- package/dist/components/static-pageable-table/style.css +9 -1
- package/dist/components/swiper/index.js +150 -85
- package/dist/components/swiper/style.css +43 -1
- package/dist/components/tab/index.js +72 -54
- package/dist/components/tab/style.css +122 -1
- package/dist/components/tab-item/index.js +35 -30
- package/dist/components/table-column/index.js +32 -30
- package/dist/components/table-view/index.js +227 -156
- package/dist/components/table-view/style.css +95 -1
- package/dist/components/tag-render/index.js +58 -44
- package/dist/components/tag-render/style.css +33 -1
- package/dist/components/tinymce-editor/index.js +95 -79
- package/dist/components/tinymce-editor/style.css +43 -1
- package/dist/components/tinymce-wrapper/index.js +121 -92
- package/dist/components/tinymce-wrapper/style.css +36 -1
- package/dist/components/toolbar/index.js +84 -63
- package/dist/components/toolbar/style.css +39 -1
- package/dist/components/toolbar-button/index.js +48 -41
- package/dist/components/toolbar-button/style.css +21 -1
- package/dist/components/trigger/index.js +36 -29
- package/dist/components/vue-tags-input/index.js +308 -188
- package/dist/components/vue-tags-input/style.css +682 -1
- package/dist/components/watermark/index.js +37 -25
- package/dist/components/watermark/style.css +11 -1
- package/dist/components/x-dialog/index.js +93 -67
- package/dist/components/x-dialog/style.css +15 -1
- package/dist/index.css +1105 -193
- package/dist/index.es.js +7242 -4789
- package/package.json +2 -1
- package/web-types.json +1 -1
- package/dist/chunks/3a79781b.js +0 -75
- package/dist/chunks/5d4282fb.js +0 -30
- package/dist/chunks/76680a03.js +0 -24
- package/dist/chunks/8c0142e0.js +0 -81
- package/dist/chunks/97652d86.js +0 -26
- package/dist/chunks/b4acd3a6.js +0 -126
- package/dist/chunks/f71045fc.js +0 -184
|
@@ -1 +1,72 @@
|
|
|
1
|
-
|
|
1
|
+
/* 全局公共颜色配置 */ /* 全局公共尺寸配置 */
|
|
2
|
+
/* 应用头部高度 */
|
|
3
|
+
/* 页面宽度 */
|
|
4
|
+
/* 侧栏宽度 */
|
|
5
|
+
/* 标签高度 */
|
|
6
|
+
/* 页面头部工具条高度 */
|
|
7
|
+
.pageable-table {
|
|
8
|
+
flex: 1 1 auto;
|
|
9
|
+
position: relative;
|
|
10
|
+
height: 100%;
|
|
11
|
+
}
|
|
12
|
+
.pageable-table .single-select-column .el-radio__label {
|
|
13
|
+
padding: 0;
|
|
14
|
+
}
|
|
15
|
+
.pageable-table.auto-height {
|
|
16
|
+
position: static;
|
|
17
|
+
height: auto;
|
|
18
|
+
}
|
|
19
|
+
.pageable-table.auto-height .el-table {
|
|
20
|
+
position: static;
|
|
21
|
+
min-height: 200px;
|
|
22
|
+
}
|
|
23
|
+
.pageable-table.auto-height .pageable-table-wrapper {
|
|
24
|
+
position: static;
|
|
25
|
+
}
|
|
26
|
+
.pageable-table .pageable-table-wrapper {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 0;
|
|
31
|
+
right: 0;
|
|
32
|
+
bottom: 0;
|
|
33
|
+
left: 0;
|
|
34
|
+
}
|
|
35
|
+
.pageable-table .el-pagination {
|
|
36
|
+
background-color: #fff;
|
|
37
|
+
}
|
|
38
|
+
.pageable-table .table-status-icon {
|
|
39
|
+
font-size: 20px;
|
|
40
|
+
}
|
|
41
|
+
.pageable-table .pageable-table-loading {
|
|
42
|
+
display: inline-flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
}
|
|
45
|
+
.pageable-table .pageable-table-error {
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
color: #f00;
|
|
49
|
+
border: 1px solid #fca4a4;
|
|
50
|
+
}
|
|
51
|
+
.pageable-table .pageable-table-error:hover {
|
|
52
|
+
background-color: #fff0f0;
|
|
53
|
+
}
|
|
54
|
+
.pageable-table .pageable-table-total {
|
|
55
|
+
padding: 0 10px 10px;
|
|
56
|
+
}
|
|
57
|
+
.pageable-table .underline {
|
|
58
|
+
position: relative;
|
|
59
|
+
}
|
|
60
|
+
.pageable-table .underline::after {
|
|
61
|
+
position: absolute;
|
|
62
|
+
bottom: 0;
|
|
63
|
+
left: 0;
|
|
64
|
+
z-index: 1;
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: 1px;
|
|
67
|
+
background-color: #606266;
|
|
68
|
+
content: "";
|
|
69
|
+
}
|
|
70
|
+
.pageable-table .total {
|
|
71
|
+
padding: 10px;
|
|
72
|
+
}
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { cloneDeep
|
|
2
|
-
import { f as
|
|
3
|
-
import { n as
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
1
|
+
import { cloneDeep, merge, hasOwn } from "@web-utils/core";
|
|
2
|
+
import { f as filterTableColumnProperties, d as filterTableProperties, e as filterTableEvents } from "../../chunks/c69d5628.js";
|
|
3
|
+
import { n as normalizeComponent } from "../../chunks/3d28cc08.js";
|
|
4
|
+
var render = function() {
|
|
5
|
+
var _vm = this;
|
|
6
|
+
var _h = _vm.$createElement;
|
|
7
|
+
var _c = _vm._self._c || _h;
|
|
8
|
+
return _c("div", {
|
|
7
9
|
staticClass: "work",
|
|
8
10
|
staticStyle: {
|
|
9
|
-
height: "100%",
|
|
11
|
+
"height": "100%",
|
|
10
12
|
"background-color": "#fff"
|
|
11
13
|
}
|
|
12
|
-
}, [
|
|
14
|
+
}, [_c("div", {
|
|
13
15
|
staticClass: "flex-column list-content",
|
|
14
16
|
staticStyle: {
|
|
15
|
-
height: "100%"
|
|
17
|
+
"height": "100%"
|
|
16
18
|
}
|
|
17
|
-
}, [
|
|
19
|
+
}, [_c("div", {
|
|
18
20
|
directives: [{
|
|
19
21
|
name: "loading",
|
|
20
22
|
rawName: "v-loading",
|
|
21
|
-
value:
|
|
23
|
+
value: _vm.loading,
|
|
22
24
|
expression: "loading"
|
|
23
25
|
}],
|
|
24
26
|
staticClass: "flex-item-relative",
|
|
@@ -26,55 +28,61 @@ var y = function() {
|
|
|
26
28
|
"element-loading-text": "加载中...",
|
|
27
29
|
"element-loading-background": "#fff"
|
|
28
30
|
}
|
|
29
|
-
}, [
|
|
31
|
+
}, [_c("div", {
|
|
30
32
|
ref: "scroller",
|
|
31
33
|
staticClass: "scroll-wrapper"
|
|
32
|
-
}, [
|
|
34
|
+
}, [_c("div", {
|
|
33
35
|
staticClass: "cards-block"
|
|
34
|
-
}, [
|
|
35
|
-
return [
|
|
36
|
-
item:
|
|
36
|
+
}, [_vm._t("prepend"), _vm._l(_vm.records, function(item) {
|
|
37
|
+
return [_vm._t("default", null, {
|
|
38
|
+
"item": item
|
|
37
39
|
})];
|
|
38
|
-
}),
|
|
40
|
+
}), _vm._t("append")], 2)])]), _c("ElPagination", {
|
|
39
41
|
staticClass: "flex-not-shrink",
|
|
40
42
|
staticStyle: {
|
|
41
43
|
"border-top": "1px solid #ebeef5"
|
|
42
44
|
},
|
|
43
45
|
attrs: {
|
|
44
|
-
"current-page":
|
|
45
|
-
"hide-on-single-page":
|
|
46
|
-
"page-size":
|
|
47
|
-
total:
|
|
48
|
-
background: "",
|
|
49
|
-
layout: "total, prev, pager, next, jumper"
|
|
46
|
+
"current-page": _vm.page.page,
|
|
47
|
+
"hide-on-single-page": _vm.hideOnSinglePage,
|
|
48
|
+
"page-size": _vm.page.limit,
|
|
49
|
+
"total": _vm.page.total,
|
|
50
|
+
"background": "",
|
|
51
|
+
"layout": "total, prev, pager, next, jumper"
|
|
50
52
|
},
|
|
51
53
|
on: {
|
|
52
|
-
"current-change": function(
|
|
53
|
-
|
|
54
|
+
"current-change": function(curPage) {
|
|
55
|
+
_vm.page.page = curPage;
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
})], 1)]);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
};
|
|
60
|
+
var staticRenderFns = [];
|
|
61
|
+
const PageableView_vue_vue_type_style_index_0_lang = "";
|
|
62
|
+
function getTemplate(row) {
|
|
63
|
+
let tpl = "";
|
|
64
|
+
for (const key in row) {
|
|
65
|
+
tpl += `<ElTableColumn prop="${key}" label="${key}"/>
|
|
62
66
|
`;
|
|
63
|
-
|
|
67
|
+
}
|
|
68
|
+
return tpl;
|
|
64
69
|
}
|
|
65
|
-
const
|
|
70
|
+
const TABLE_STATUS = {
|
|
66
71
|
loading: 1,
|
|
67
72
|
error: -1,
|
|
68
73
|
empty: 2,
|
|
69
74
|
success: 0
|
|
70
|
-
}
|
|
75
|
+
};
|
|
76
|
+
const __vue2_script = {
|
|
71
77
|
name: "PageableView",
|
|
72
78
|
bus: {
|
|
73
|
-
reloadTableView(
|
|
74
|
-
|
|
79
|
+
reloadTableView(viewId) {
|
|
80
|
+
if (viewId === this.viewId) {
|
|
81
|
+
this.getPage();
|
|
82
|
+
}
|
|
75
83
|
}
|
|
76
84
|
},
|
|
77
|
-
inheritAttrs:
|
|
85
|
+
inheritAttrs: false,
|
|
78
86
|
props: {
|
|
79
87
|
viewId: {
|
|
80
88
|
type: String
|
|
@@ -111,11 +119,11 @@ const a = {
|
|
|
111
119
|
autoHeight: Boolean,
|
|
112
120
|
immediate: {
|
|
113
121
|
type: Boolean,
|
|
114
|
-
default:
|
|
122
|
+
default: true
|
|
115
123
|
},
|
|
116
124
|
reloadOnModelChange: {
|
|
117
125
|
type: Boolean,
|
|
118
|
-
default:
|
|
126
|
+
default: false
|
|
119
127
|
},
|
|
120
128
|
columns: {
|
|
121
129
|
type: Array
|
|
@@ -126,55 +134,73 @@ const a = {
|
|
|
126
134
|
}
|
|
127
135
|
},
|
|
128
136
|
data() {
|
|
129
|
-
let
|
|
130
|
-
this.rules && this.rules.length > 0
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
137
|
+
let filters = { rules: [] };
|
|
138
|
+
if (this.rules && this.rules.length > 0) {
|
|
139
|
+
filters.rules = this.rules;
|
|
140
|
+
}
|
|
141
|
+
if (this.filters) {
|
|
142
|
+
filters = this.filters;
|
|
143
|
+
}
|
|
144
|
+
if (this.filter) {
|
|
145
|
+
filters = Object.assign({}, filters, this.filter);
|
|
146
|
+
}
|
|
147
|
+
let model = {};
|
|
148
|
+
if (this.model) {
|
|
149
|
+
model = cloneDeep(this.model);
|
|
150
|
+
}
|
|
151
|
+
const limit = this.pageSize;
|
|
134
152
|
return {
|
|
135
|
-
tableStatus:
|
|
153
|
+
tableStatus: TABLE_STATUS.empty,
|
|
136
154
|
records: [],
|
|
137
|
-
loading:
|
|
155
|
+
loading: false,
|
|
138
156
|
currentRow: null,
|
|
139
157
|
page: {
|
|
140
158
|
total: 0,
|
|
141
159
|
page: 1,
|
|
142
|
-
limit
|
|
160
|
+
limit,
|
|
143
161
|
ascs: this.ascs,
|
|
144
162
|
descs: this.descs,
|
|
145
|
-
model
|
|
146
|
-
filters
|
|
163
|
+
model,
|
|
164
|
+
filters
|
|
147
165
|
}
|
|
148
166
|
};
|
|
149
167
|
},
|
|
150
168
|
computed: {
|
|
151
169
|
guard() {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
170
|
+
if (this.reloadOnModelChange) {
|
|
171
|
+
return {
|
|
172
|
+
asc: this.page.ascs,
|
|
173
|
+
desc: this.page.descs,
|
|
174
|
+
page: this.page.page,
|
|
175
|
+
model: this.page.model,
|
|
176
|
+
filters: this.page.filters
|
|
177
|
+
};
|
|
178
|
+
} else {
|
|
179
|
+
return {
|
|
180
|
+
asc: this.page.ascs,
|
|
181
|
+
desc: this.page.descs,
|
|
182
|
+
page: this.page.page,
|
|
183
|
+
filters: this.page.filters
|
|
184
|
+
};
|
|
185
|
+
}
|
|
164
186
|
},
|
|
165
187
|
method() {
|
|
166
188
|
return this.httpGet ? httpGet : httpPost;
|
|
167
189
|
},
|
|
168
190
|
indexWidth() {
|
|
169
|
-
const
|
|
170
|
-
|
|
191
|
+
const indexStr = `${(this.page.page - 1) * this.page.limit + this.records.length}`;
|
|
192
|
+
if (indexStr.length > 3) {
|
|
193
|
+
return 50 + (indexStr.length - 3) * 10;
|
|
194
|
+
} else {
|
|
195
|
+
return 50;
|
|
196
|
+
}
|
|
171
197
|
},
|
|
172
198
|
mergeAttrs() {
|
|
173
|
-
return
|
|
199
|
+
return merge({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
|
|
174
200
|
},
|
|
175
201
|
headers() {
|
|
176
|
-
var
|
|
177
|
-
return ((
|
|
202
|
+
var _a;
|
|
203
|
+
return ((_a = this.columns) == null ? void 0 : _a.map(filterTableColumnProperties)) || [];
|
|
178
204
|
}
|
|
179
205
|
},
|
|
180
206
|
watch: {
|
|
@@ -184,15 +210,15 @@ const a = {
|
|
|
184
210
|
this.getPage();
|
|
185
211
|
},
|
|
186
212
|
model: {
|
|
187
|
-
deep:
|
|
188
|
-
handler(
|
|
189
|
-
this.setModel(
|
|
213
|
+
deep: true,
|
|
214
|
+
handler(newVal) {
|
|
215
|
+
this.setModel(newVal);
|
|
190
216
|
}
|
|
191
217
|
}
|
|
192
218
|
},
|
|
193
219
|
created() {
|
|
194
220
|
this.$watch(() => this.guard, this.getPage, {
|
|
195
|
-
deep:
|
|
221
|
+
deep: true,
|
|
196
222
|
immediate: this.immediate
|
|
197
223
|
});
|
|
198
224
|
},
|
|
@@ -200,58 +226,67 @@ const a = {
|
|
|
200
226
|
this.$refs.scroller.addEventListener("scroll", this.onTableScroll);
|
|
201
227
|
},
|
|
202
228
|
beforeDestroy() {
|
|
203
|
-
var
|
|
204
|
-
(
|
|
229
|
+
var _a;
|
|
230
|
+
(_a = this.$refs.scroller) == null ? void 0 : _a.removeEventListener("scroll", this.onTableScroll);
|
|
205
231
|
},
|
|
206
232
|
methods: {
|
|
207
233
|
async updateTableScrollPosition() {
|
|
208
|
-
this.$refs.scroller
|
|
234
|
+
if (this.$refs.scroller) {
|
|
235
|
+
this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
|
|
236
|
+
}
|
|
209
237
|
},
|
|
210
|
-
filterTableProperties
|
|
211
|
-
filterTableEvents
|
|
212
|
-
filterTableColumnProperties
|
|
238
|
+
filterTableProperties,
|
|
239
|
+
filterTableEvents,
|
|
240
|
+
filterTableColumnProperties,
|
|
213
241
|
onTableScroll() {
|
|
214
|
-
this.tableScrollTop = this.$refs.scroller.scrollTop
|
|
242
|
+
this.tableScrollTop = this.$refs.scroller.scrollTop;
|
|
243
|
+
this.tableScrollLeft = this.$refs.scroller.scrollLeft;
|
|
215
244
|
},
|
|
216
|
-
copy: (
|
|
245
|
+
copy: (row) => copyData(getTemplate(row)),
|
|
217
246
|
onSortChange({
|
|
218
|
-
prop
|
|
219
|
-
order
|
|
247
|
+
prop,
|
|
248
|
+
order
|
|
220
249
|
}) {
|
|
221
|
-
this.page.ascs =
|
|
250
|
+
this.page.ascs = order === "ascending" ? prop : "";
|
|
251
|
+
this.page.descs = order === "descending" ? prop : "";
|
|
222
252
|
},
|
|
223
|
-
onCurrentChange(
|
|
224
|
-
this.currentRow =
|
|
253
|
+
onCurrentChange(currentRow) {
|
|
254
|
+
this.currentRow = currentRow;
|
|
225
255
|
},
|
|
226
|
-
addRule(
|
|
227
|
-
this.removeRule(
|
|
256
|
+
addRule(rule) {
|
|
257
|
+
this.removeRule(rule.field);
|
|
258
|
+
this.page.filters.rules.push(rule);
|
|
228
259
|
},
|
|
229
|
-
addRules(
|
|
230
|
-
|
|
260
|
+
addRules(rules) {
|
|
261
|
+
rules.forEach((value) => this.addRule(value));
|
|
231
262
|
},
|
|
232
|
-
setModelField(
|
|
233
|
-
this.$set(this.page.model,
|
|
263
|
+
setModelField(field, value) {
|
|
264
|
+
this.$set(this.page.model, field, value);
|
|
234
265
|
},
|
|
235
|
-
setModel(
|
|
236
|
-
this.page.page = 1
|
|
266
|
+
setModel(model) {
|
|
267
|
+
this.page.page = 1;
|
|
268
|
+
this.page.model = cloneDeep(model);
|
|
237
269
|
},
|
|
238
|
-
deleteModelField(
|
|
239
|
-
delete this.page.model[
|
|
270
|
+
deleteModelField(field) {
|
|
271
|
+
delete this.page.model[field];
|
|
240
272
|
},
|
|
241
|
-
removeRule(
|
|
242
|
-
const
|
|
243
|
-
|
|
273
|
+
removeRule(field) {
|
|
274
|
+
const rules = this.page.filters.rules;
|
|
275
|
+
const index = rules.findIndex((value) => value.field === field);
|
|
276
|
+
if (index > -1) {
|
|
277
|
+
rules.splice(index, 1);
|
|
278
|
+
}
|
|
244
279
|
},
|
|
245
280
|
addFilter({
|
|
246
|
-
field
|
|
247
|
-
op
|
|
248
|
-
value
|
|
281
|
+
field,
|
|
282
|
+
op,
|
|
283
|
+
value
|
|
249
284
|
}) {
|
|
250
285
|
this.page.filters = Object.assign({}, this.page.filters, {
|
|
251
286
|
rules: [{
|
|
252
|
-
field
|
|
253
|
-
op
|
|
254
|
-
value
|
|
287
|
+
field,
|
|
288
|
+
op,
|
|
289
|
+
value
|
|
255
290
|
}],
|
|
256
291
|
op: "and"
|
|
257
292
|
});
|
|
@@ -263,23 +298,40 @@ const a = {
|
|
|
263
298
|
this.$refs.table.clearSelection();
|
|
264
299
|
},
|
|
265
300
|
search() {
|
|
266
|
-
this.setModel(this.model)
|
|
301
|
+
this.setModel(this.model);
|
|
302
|
+
this.getPage();
|
|
267
303
|
},
|
|
268
304
|
async getPage() {
|
|
269
|
-
var
|
|
270
|
-
if (
|
|
271
|
-
this.records = this.$attrs.data
|
|
305
|
+
var _a;
|
|
306
|
+
if (hasOwn(this.$attrs, "data")) {
|
|
307
|
+
this.records = this.$attrs.data;
|
|
308
|
+
this.page.page = 1;
|
|
309
|
+
this.page.total = this.records.length;
|
|
310
|
+
this.page.limit = this.page.total;
|
|
272
311
|
return;
|
|
273
312
|
}
|
|
274
313
|
this.records = [];
|
|
275
|
-
let
|
|
276
|
-
const { filters
|
|
277
|
-
|
|
278
|
-
|
|
314
|
+
let res;
|
|
315
|
+
const { filters, ...rest } = this.page;
|
|
316
|
+
const page = { ...rest };
|
|
317
|
+
if ((_a = filters == null ? void 0 : filters.rules) == null ? void 0 : _a.length) {
|
|
318
|
+
page.filters = { rules: filters.rules };
|
|
319
|
+
}
|
|
320
|
+
if (this.api || this.url) {
|
|
321
|
+
this.tableStatus = TABLE_STATUS.loading;
|
|
279
322
|
try {
|
|
280
|
-
this.loading =
|
|
281
|
-
|
|
282
|
-
|
|
323
|
+
this.loading = true;
|
|
324
|
+
if (this.api) {
|
|
325
|
+
res = await this.api(page);
|
|
326
|
+
}
|
|
327
|
+
if (this.url) {
|
|
328
|
+
res = await this.method(this.url, page);
|
|
329
|
+
}
|
|
330
|
+
this.loading = false;
|
|
331
|
+
} catch (e) {
|
|
332
|
+
this.tableStatus = TABLE_STATUS.error;
|
|
333
|
+
console.error(e);
|
|
334
|
+
this.loading = false;
|
|
283
335
|
return;
|
|
284
336
|
}
|
|
285
337
|
} else {
|
|
@@ -289,8 +341,19 @@ const a = {
|
|
|
289
341
|
});
|
|
290
342
|
return;
|
|
291
343
|
}
|
|
292
|
-
const { data
|
|
293
|
-
|
|
344
|
+
const { data } = res || {};
|
|
345
|
+
const { total, records } = data || {};
|
|
346
|
+
this.page.total = Number(total);
|
|
347
|
+
this.records = records;
|
|
348
|
+
if (!records || !records.length) {
|
|
349
|
+
this.tableStatus = TABLE_STATUS.empty;
|
|
350
|
+
} else {
|
|
351
|
+
this.tableStatus = TABLE_STATUS.success;
|
|
352
|
+
}
|
|
353
|
+
if (this.$refs.table) {
|
|
354
|
+
this.$refs.scroller.scrollTop = 0;
|
|
355
|
+
}
|
|
356
|
+
this.$emit("page-loaded", data);
|
|
294
357
|
},
|
|
295
358
|
async refresh() {
|
|
296
359
|
await this.getPage();
|
|
@@ -301,28 +364,35 @@ const a = {
|
|
|
301
364
|
total: this.page.total
|
|
302
365
|
};
|
|
303
366
|
},
|
|
304
|
-
scrollTo(
|
|
305
|
-
|
|
367
|
+
scrollTo(top, left) {
|
|
368
|
+
if (top) {
|
|
369
|
+
this.$refs.scroller.scrollTop = top;
|
|
370
|
+
}
|
|
371
|
+
if (left) {
|
|
372
|
+
this.$refs.scroller.scrollLeft = left;
|
|
373
|
+
}
|
|
306
374
|
}
|
|
307
375
|
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
376
|
+
};
|
|
377
|
+
const __cssModules = {};
|
|
378
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
379
|
+
__vue2_script,
|
|
380
|
+
render,
|
|
381
|
+
staticRenderFns,
|
|
382
|
+
false,
|
|
383
|
+
__vue2_injectStyles,
|
|
315
384
|
null,
|
|
316
385
|
null,
|
|
317
386
|
null
|
|
318
387
|
);
|
|
319
|
-
function
|
|
320
|
-
for (let
|
|
321
|
-
this[
|
|
388
|
+
function __vue2_injectStyles(context) {
|
|
389
|
+
for (let o in __cssModules) {
|
|
390
|
+
this[o] = __cssModules[o];
|
|
391
|
+
}
|
|
322
392
|
}
|
|
323
|
-
const
|
|
324
|
-
return
|
|
393
|
+
const PageableView = /* @__PURE__ */ function() {
|
|
394
|
+
return __component__.exports;
|
|
325
395
|
}();
|
|
326
396
|
export {
|
|
327
|
-
|
|
397
|
+
PageableView as default
|
|
328
398
|
};
|
|
@@ -1 +1,69 @@
|
|
|
1
|
-
|
|
1
|
+
/* 全局公共颜色配置 */ /* 全局公共尺寸配置 */
|
|
2
|
+
/* 应用头部高度 */
|
|
3
|
+
/* 页面宽度 */
|
|
4
|
+
/* 侧栏宽度 */
|
|
5
|
+
/* 标签高度 */
|
|
6
|
+
/* 页面头部工具条高度 */
|
|
7
|
+
.pageable-table {
|
|
8
|
+
flex: 1 1 auto;
|
|
9
|
+
position: relative;
|
|
10
|
+
height: 100%;
|
|
11
|
+
}
|
|
12
|
+
.pageable-table.auto-height {
|
|
13
|
+
position: static;
|
|
14
|
+
height: auto;
|
|
15
|
+
}
|
|
16
|
+
.pageable-table.auto-height .el-table {
|
|
17
|
+
position: static;
|
|
18
|
+
min-height: 200px;
|
|
19
|
+
}
|
|
20
|
+
.pageable-table.auto-height .pageable-table-wrapper {
|
|
21
|
+
position: static;
|
|
22
|
+
}
|
|
23
|
+
.pageable-table .pageable-table-wrapper {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 0;
|
|
28
|
+
right: 0;
|
|
29
|
+
bottom: 0;
|
|
30
|
+
left: 0;
|
|
31
|
+
}
|
|
32
|
+
.pageable-table .el-pagination {
|
|
33
|
+
background-color: #fff;
|
|
34
|
+
}
|
|
35
|
+
.pageable-table .table-status-icon {
|
|
36
|
+
font-size: 20px;
|
|
37
|
+
}
|
|
38
|
+
.pageable-table .pageable-table-loading {
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
}
|
|
42
|
+
.pageable-table .pageable-table-error {
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
color: #f00;
|
|
46
|
+
border: 1px solid #fca4a4;
|
|
47
|
+
}
|
|
48
|
+
.pageable-table .pageable-table-error:hover {
|
|
49
|
+
background-color: #fff0f0;
|
|
50
|
+
}
|
|
51
|
+
.pageable-table .pageable-table-total {
|
|
52
|
+
padding: 0 10px 10px;
|
|
53
|
+
}
|
|
54
|
+
.pageable-table .underline {
|
|
55
|
+
position: relative;
|
|
56
|
+
}
|
|
57
|
+
.pageable-table .underline::after {
|
|
58
|
+
position: absolute;
|
|
59
|
+
bottom: 0;
|
|
60
|
+
left: 0;
|
|
61
|
+
z-index: 1;
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 1px;
|
|
64
|
+
background-color: #606266;
|
|
65
|
+
content: "";
|
|
66
|
+
}
|
|
67
|
+
.pageable-table .total {
|
|
68
|
+
padding: 10px;
|
|
69
|
+
}
|