@web-utils/component 1.2.5 → 1.2.7
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/README.md +27 -27
- package/dist/chunks/163eed3b.js +16 -1
- package/dist/chunks/2bd4e340.js +184 -0
- package/dist/chunks/6499de3a.js +30 -1
- package/dist/chunks/7af3ceb1.js +75 -0
- package/dist/chunks/86bcadec.js +24 -0
- package/dist/chunks/8bbde9bf.js +81 -1
- package/dist/chunks/90bd3d52.js +26 -1
- package/dist/chunks/92404ceb.js +126 -0
- package/dist/chunks/a73fe8ee.js +11 -0
- package/dist/chunks/df803484.js +60 -0
- package/dist/components/address-input/index.js +113 -1
- package/dist/components/aside-menu/index.js +58 -1
- package/dist/components/awesome-button/index.js +82 -1
- package/dist/components/capsule-tab/index.js +52 -1
- package/dist/components/chunk-file-uploader/index.js +119 -1
- package/dist/components/chunk-file-uploader-button/index.js +60 -1
- package/dist/components/chunk-file-uploader-drop/index.js +65 -1
- package/dist/components/chunk-file-uploader-file/index.js +311 -1
- package/dist/components/chunk-file-uploader-files/index.js +49 -1
- package/dist/components/chunk-file-uploader-list/index.js +50 -1
- package/dist/components/chunk-file-uploader-un-support/index.js +51 -1
- package/dist/components/code-mirror-editor/index.js +310 -6
- package/dist/components/color-picker/index.js +110 -1
- package/dist/components/confirm-button/index.js +57 -1
- package/dist/components/confirmable/index.js +28 -1
- package/dist/components/context-menu/index.js +236 -1
- package/dist/components/custom-scrollbar/index.js +150 -1
- package/dist/components/data-table-picker/index.js +137 -1
- package/dist/components/dynamic-table/index.js +195 -1
- package/dist/components/e-charts/index.js +229 -1
- package/dist/components/editable-progress/index.js +141 -1
- package/dist/components/editable-tree/index.js +789 -1
- package/dist/components/egd-collapse/index.js +79 -1
- package/dist/components/egd-collapse-item/index.js +132 -1
- package/dist/components/element-dialog/index.js +242 -1
- package/dist/components/empty-view/index.js +69 -1
- package/dist/components/error-view/index.js +61 -1
- package/dist/components/flex-column/index.js +50 -1
- package/dist/components/flex-item/index.js +66 -1
- package/dist/components/flex-row/index.js +50 -1
- package/dist/components/flex-scroller/index.js +47 -1
- package/dist/components/form-button/index.js +80 -1
- package/dist/components/form-cascader/index.js +151 -1
- package/dist/components/form-checkbox-group/index.js +192 -1
- package/dist/components/form-date-picker/index.js +182 -1
- package/dist/components/form-holder/index.js +90 -1
- package/dist/components/form-input/index.js +106 -1
- package/dist/components/form-input-email/index.js +97 -1
- package/dist/components/form-input-id-card/index.js +104 -1
- package/dist/components/form-input-number/index.js +123 -1
- package/dist/components/form-input-phone-number/index.js +98 -1
- package/dist/components/form-input-time/index.js +124 -1
- package/dist/components/form-item/index.js +120 -1
- package/dist/components/form-item-config-provider/index.js +63 -1
- package/dist/components/form-item-group/index.js +169 -1
- package/dist/components/form-radio-group/index.js +170 -1
- package/dist/components/form-select/index.js +154 -1
- package/dist/components/form-switch/index.js +97 -1
- package/dist/components/form-textarea/index.js +102 -1
- package/dist/components/form-view/index.js +343 -1
- package/dist/components/guide-steps/index.js +94 -1
- package/dist/components/icon-card/index.js +62 -1
- package/dist/components/iframe-window/index.js +99 -1
- package/dist/components/input-number/index.js +274 -1
- package/dist/components/input-number-range/index.js +110 -1
- package/dist/components/j-s-x-component/index.js +16 -1
- package/dist/components/keep-view-alive/index.js +119 -1
- package/dist/components/loading-view/index.js +61 -1
- package/dist/components/nav-bar/index.js +52 -1
- package/dist/components/not-implement/index.js +35 -1
- package/dist/components/page/index.js +40 -1
- package/dist/components/page-header/index.js +56 -1
- package/dist/components/page-index/index.js +151 -1
- package/dist/components/page-index-top/index.js +119 -1
- package/dist/components/page-skeleton/index.js +56 -1
- package/dist/components/page-skeleton-new/index.js +98 -1
- package/dist/components/pageable-table/index.js +429 -1
- package/dist/components/pageable-view/index.js +328 -2
- package/dist/components/photo-swipe/index.js +187 -1
- package/dist/components/resize-observer/index.js +62 -1
- package/dist/components/search-popover/index.js +391 -2
- package/dist/components/sign-panel/index.js +242 -1
- package/dist/components/split-pane/index.js +209 -1
- package/dist/components/stateful/index.js +84 -1
- package/dist/components/static-pageable-table/index.js +92 -1
- package/dist/components/swiper/index.js +158 -1
- package/dist/components/tab/index.js +145 -1
- package/dist/components/tab-item/index.js +73 -1
- package/dist/components/table-column/index.js +89 -1
- package/dist/components/table-view/index.js +363 -1
- package/dist/components/tag-render/index.js +97 -1
- package/dist/components/tinymce-editor/index.js +173 -1
- package/dist/components/tinymce-wrapper/index.js +618 -1
- package/dist/components/toolbar/index.js +217 -1
- package/dist/components/toolbar-button/index.js +90 -1
- package/dist/components/trigger/index.js +71 -1
- package/dist/components/vue-tags-input/index.js +439 -1
- package/dist/components/watermark/index.js +63 -1
- package/dist/components/x-dialog/index.js +173 -1
- package/dist/index.css +2102 -1
- package/dist/index.es.js +3097 -2347
- package/package.json +29 -29
- package/web-types.json +22 -55
- package/dist/chunks/23bd3525.js +0 -1
- package/dist/chunks/65f4f4f2.js +0 -1
- package/dist/chunks/8473fc69.js +0 -1
- package/dist/chunks/a125d16c.js +0 -1
- package/dist/chunks/addb6ed5.js +0 -1
- package/dist/chunks/f15477c7.js +0 -1
- package/dist/components/el-color-picker-dropdown/index.js +0 -1
|
@@ -1 +1,429 @@
|
|
|
1
|
-
|
|
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/2bd4e340.js";
|
|
3
|
+
import { n as m } from "../../chunks/6499de3a.js";
|
|
4
|
+
var y = function() {
|
|
5
|
+
var e = this, t = e.$createElement, a = e._self._c || t;
|
|
6
|
+
return a("div", {
|
|
7
|
+
class: ["pageable-table", {
|
|
8
|
+
"auto-height": e.autoHeight
|
|
9
|
+
}]
|
|
10
|
+
}, [a("div", {
|
|
11
|
+
staticClass: "pageable-table-wrapper"
|
|
12
|
+
}, [e._t("toolbar"), a("ElTable", e._g(e._b({
|
|
13
|
+
ref: "table",
|
|
14
|
+
class: ["flex-item", {
|
|
15
|
+
"header-bold": e.headerBold
|
|
16
|
+
}],
|
|
17
|
+
attrs: {
|
|
18
|
+
data: e.records,
|
|
19
|
+
border: e.border
|
|
20
|
+
},
|
|
21
|
+
on: {
|
|
22
|
+
"hook:updated": e.updateTableScrollPosition,
|
|
23
|
+
"sort-change": e.onSortChange,
|
|
24
|
+
"row-dblclick": e.rowDbClick,
|
|
25
|
+
"current-change": e.onCurrentChange
|
|
26
|
+
},
|
|
27
|
+
scopedSlots: e._u([{
|
|
28
|
+
key: "empty",
|
|
29
|
+
fn: function() {
|
|
30
|
+
return [e._t("empty", function() {
|
|
31
|
+
return [e.tableStatus === e.TABLE_STATUS.loading ? [a("span", {
|
|
32
|
+
staticClass: "pageable-table-loading"
|
|
33
|
+
}, [a("i", {
|
|
34
|
+
staticClass: "table-status-icon el-icon-loading"
|
|
35
|
+
}), e._v(" \u52A0\u8F7D\u4E2D...")])] : e.tableStatus === e.TABLE_STATUS.error ? [a("ElButton", {
|
|
36
|
+
staticClass: "pageable-table-error",
|
|
37
|
+
attrs: {
|
|
38
|
+
icon: "table-status-icon fa fa-frown-o"
|
|
39
|
+
},
|
|
40
|
+
on: {
|
|
41
|
+
click: e.refresh
|
|
42
|
+
}
|
|
43
|
+
}, [e._v(" \u52A0\u8F7D\u5931\u8D25\uFF0C\u70B9\u51FB\u91CD\u8BD5\uFF01 ")])] : [e._v(" \u6682\u65E0\u6570\u636E ")]];
|
|
44
|
+
})];
|
|
45
|
+
},
|
|
46
|
+
proxy: !0
|
|
47
|
+
}, {
|
|
48
|
+
key: "append",
|
|
49
|
+
fn: function() {
|
|
50
|
+
return [e._t("append")];
|
|
51
|
+
},
|
|
52
|
+
proxy: !0
|
|
53
|
+
}], null, !0)
|
|
54
|
+
}, "ElTable", e.filterTableProperties(e.mergeAttrs), !1), e.filterTableEvents(e.$listeners)), [e.multiple && e.selection ? a("TableColumn", {
|
|
55
|
+
key: "multiple",
|
|
56
|
+
attrs: {
|
|
57
|
+
type: "selection",
|
|
58
|
+
width: "45",
|
|
59
|
+
align: "center"
|
|
60
|
+
}
|
|
61
|
+
}) : e._e(), !e.multiple && e.selection ? a("TableColumn", {
|
|
62
|
+
key: "single",
|
|
63
|
+
attrs: {
|
|
64
|
+
type: "single-selection",
|
|
65
|
+
"class-name": "single-select-column",
|
|
66
|
+
width: "45",
|
|
67
|
+
align: "center"
|
|
68
|
+
},
|
|
69
|
+
scopedSlots: e._u([{
|
|
70
|
+
key: "header",
|
|
71
|
+
fn: function() {
|
|
72
|
+
return [a("ElRadio", {
|
|
73
|
+
attrs: {
|
|
74
|
+
value: !!e.currentRow,
|
|
75
|
+
label: !0
|
|
76
|
+
}
|
|
77
|
+
}, [a("span")])];
|
|
78
|
+
},
|
|
79
|
+
proxy: !0
|
|
80
|
+
}, {
|
|
81
|
+
key: "default",
|
|
82
|
+
fn: function(s) {
|
|
83
|
+
var l = s.row;
|
|
84
|
+
return [a("ElRadio", {
|
|
85
|
+
attrs: {
|
|
86
|
+
label: !0,
|
|
87
|
+
value: e.currentRow && e.currentRow[e.$attrs["row-key"] || "id"] === l[e.$attrs["row-key"] || "id"]
|
|
88
|
+
}
|
|
89
|
+
}, [a("span")])];
|
|
90
|
+
}
|
|
91
|
+
}], null, !1, 307797321)
|
|
92
|
+
}) : e._e(), e.index ? a("TableColumn", {
|
|
93
|
+
key: "order",
|
|
94
|
+
attrs: {
|
|
95
|
+
type: "index",
|
|
96
|
+
label: "\u5E8F\u53F7",
|
|
97
|
+
width: e.indexWidth,
|
|
98
|
+
align: "center"
|
|
99
|
+
},
|
|
100
|
+
scopedSlots: e._u([{
|
|
101
|
+
key: "default",
|
|
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) + " ")];
|
|
105
|
+
}
|
|
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", {
|
|
113
|
+
attrs: {
|
|
114
|
+
label: "\u70B9\u51FB\u8868\u683C\u884C\u590D\u5236\u6A21\u677F"
|
|
115
|
+
},
|
|
116
|
+
scopedSlots: e._u([{
|
|
117
|
+
key: "default",
|
|
118
|
+
fn: function(s) {
|
|
119
|
+
var l = s.row;
|
|
120
|
+
return [a("pre", {
|
|
121
|
+
staticClass: "pointer"
|
|
122
|
+
}, [e._v(e._s(JSON.stringify(l, null, " ")))])];
|
|
123
|
+
}
|
|
124
|
+
}])
|
|
125
|
+
})];
|
|
126
|
+
})], 2), a("ElPagination", {
|
|
127
|
+
staticClass: "flex-not-shrink",
|
|
128
|
+
attrs: {
|
|
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"
|
|
135
|
+
},
|
|
136
|
+
on: {
|
|
137
|
+
"current-change": function(s) {
|
|
138
|
+
e.page.page = s;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
})], 2)]);
|
|
142
|
+
}, _ = [];
|
|
143
|
+
const r = {
|
|
144
|
+
loading: 1,
|
|
145
|
+
error: -1,
|
|
146
|
+
empty: 2,
|
|
147
|
+
success: 0
|
|
148
|
+
}, S = {
|
|
149
|
+
name: "PageableTable",
|
|
150
|
+
bus: {
|
|
151
|
+
reloadTableView(e) {
|
|
152
|
+
e === this.viewId && this.getPage();
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
inheritAttrs: !1,
|
|
156
|
+
props: {
|
|
157
|
+
viewId: {
|
|
158
|
+
type: String
|
|
159
|
+
},
|
|
160
|
+
url: {
|
|
161
|
+
type: String
|
|
162
|
+
},
|
|
163
|
+
httpGet: Boolean,
|
|
164
|
+
hideOnSinglePage: Boolean,
|
|
165
|
+
api: {
|
|
166
|
+
type: Function
|
|
167
|
+
},
|
|
168
|
+
filters: {
|
|
169
|
+
type: Object
|
|
170
|
+
},
|
|
171
|
+
filter: {
|
|
172
|
+
type: Object
|
|
173
|
+
},
|
|
174
|
+
rules: {
|
|
175
|
+
type: Array,
|
|
176
|
+
default: () => []
|
|
177
|
+
},
|
|
178
|
+
model: {
|
|
179
|
+
type: Object
|
|
180
|
+
},
|
|
181
|
+
ascs: {
|
|
182
|
+
type: String,
|
|
183
|
+
default: ""
|
|
184
|
+
},
|
|
185
|
+
descs: {
|
|
186
|
+
type: String,
|
|
187
|
+
default: ""
|
|
188
|
+
},
|
|
189
|
+
headerBold: Boolean,
|
|
190
|
+
autoHeight: Boolean,
|
|
191
|
+
immediate: {
|
|
192
|
+
type: Boolean,
|
|
193
|
+
default: !0
|
|
194
|
+
},
|
|
195
|
+
index: {
|
|
196
|
+
type: Boolean,
|
|
197
|
+
default: !0
|
|
198
|
+
},
|
|
199
|
+
multiple: {
|
|
200
|
+
type: Boolean,
|
|
201
|
+
default: !0
|
|
202
|
+
},
|
|
203
|
+
selection: {
|
|
204
|
+
type: Boolean,
|
|
205
|
+
default: !0
|
|
206
|
+
},
|
|
207
|
+
border: {
|
|
208
|
+
type: Boolean,
|
|
209
|
+
default: !0
|
|
210
|
+
},
|
|
211
|
+
reloadOnModelChange: {
|
|
212
|
+
type: Boolean,
|
|
213
|
+
default: !1
|
|
214
|
+
},
|
|
215
|
+
columns: {
|
|
216
|
+
type: Array
|
|
217
|
+
},
|
|
218
|
+
pageSize: {
|
|
219
|
+
type: Number,
|
|
220
|
+
default: 25
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
data() {
|
|
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;
|
|
229
|
+
return {
|
|
230
|
+
TABLE_STATUS: Object.freeze(r),
|
|
231
|
+
tableStatus: r.empty,
|
|
232
|
+
records: [],
|
|
233
|
+
currentRow: null,
|
|
234
|
+
page: {
|
|
235
|
+
total: 0,
|
|
236
|
+
page: 1,
|
|
237
|
+
limit: a,
|
|
238
|
+
ascs: this.ascs,
|
|
239
|
+
descs: this.descs,
|
|
240
|
+
model: t,
|
|
241
|
+
filters: e
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
},
|
|
245
|
+
computed: {
|
|
246
|
+
guard() {
|
|
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
|
+
};
|
|
259
|
+
},
|
|
260
|
+
method() {
|
|
261
|
+
return this.httpGet ? httpGet : httpPost;
|
|
262
|
+
},
|
|
263
|
+
indexWidth() {
|
|
264
|
+
const e = `${(this.page.page - 1) * this.page.limit + this.records.length}`;
|
|
265
|
+
return e.length > 3 ? 50 + (e.length - 3) * 10 : 50;
|
|
266
|
+
},
|
|
267
|
+
mergeAttrs() {
|
|
268
|
+
return c({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
|
|
269
|
+
},
|
|
270
|
+
headers() {
|
|
271
|
+
var e;
|
|
272
|
+
return ((e = this.columns) == null ? void 0 : e.map(d)) || [];
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
watch: {
|
|
276
|
+
url: { handler: "reload" },
|
|
277
|
+
api: { handler: "reload" },
|
|
278
|
+
"$attrs.data"() {
|
|
279
|
+
this.getPage();
|
|
280
|
+
},
|
|
281
|
+
model: {
|
|
282
|
+
deep: !0,
|
|
283
|
+
handler(e) {
|
|
284
|
+
this.setModel(e);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
created() {
|
|
289
|
+
this.$watch(() => this.guard, this.getPage, {
|
|
290
|
+
deep: !0,
|
|
291
|
+
immediate: this.immediate
|
|
292
|
+
});
|
|
293
|
+
},
|
|
294
|
+
mounted() {
|
|
295
|
+
this.$refs.table.bodyWrapper.addEventListener("scroll", this.onTableScroll);
|
|
296
|
+
},
|
|
297
|
+
beforeDestroy() {
|
|
298
|
+
this.$refs.table.bodyWrapper.removeEventListener("scroll", this.onTableScroll);
|
|
299
|
+
},
|
|
300
|
+
methods: {
|
|
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";
|
|
306
|
+
});
|
|
307
|
+
t && ((a = t.$refs.tooltip) == null || a.hide()), this.$emit("row-dblclick", ...e);
|
|
308
|
+
},
|
|
309
|
+
async updateTableScrollPosition() {
|
|
310
|
+
this.$refs.table.bodyWrapper && this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
|
|
311
|
+
},
|
|
312
|
+
filterTableProperties: f,
|
|
313
|
+
filterTableEvents: b,
|
|
314
|
+
filterTableColumnProperties: d,
|
|
315
|
+
onTableScroll() {
|
|
316
|
+
this.tableScrollTop = this.$refs.table.bodyWrapper.scrollTop, this.tableScrollLeft = this.$refs.table.bodyWrapper.scrollLeft;
|
|
317
|
+
},
|
|
318
|
+
onSortChange({
|
|
319
|
+
prop: e,
|
|
320
|
+
order: t
|
|
321
|
+
}) {
|
|
322
|
+
this.page.ascs = t === "ascending" ? e : "", this.page.descs = t === "descending" ? e : "";
|
|
323
|
+
},
|
|
324
|
+
onCurrentChange(e) {
|
|
325
|
+
this.currentRow = e;
|
|
326
|
+
},
|
|
327
|
+
addRule(e) {
|
|
328
|
+
this.removeRule(e.field), this.page.filters.rules.push(e);
|
|
329
|
+
},
|
|
330
|
+
addRules(e) {
|
|
331
|
+
e.forEach((t) => this.addRule(t));
|
|
332
|
+
},
|
|
333
|
+
setModelField(e, t) {
|
|
334
|
+
this.$set(this.page.model, e, t);
|
|
335
|
+
},
|
|
336
|
+
setModel(e) {
|
|
337
|
+
this.page.page = 1, this.page.model = n(e);
|
|
338
|
+
},
|
|
339
|
+
deleteModelField(e) {
|
|
340
|
+
delete this.page.model[e];
|
|
341
|
+
},
|
|
342
|
+
removeRule(e) {
|
|
343
|
+
const t = this.page.filters.rules, a = t.findIndex((s) => s.field === e);
|
|
344
|
+
a > -1 && t.splice(a, 1);
|
|
345
|
+
},
|
|
346
|
+
addFilter({
|
|
347
|
+
field: e,
|
|
348
|
+
op: t,
|
|
349
|
+
value: a
|
|
350
|
+
}) {
|
|
351
|
+
this.page.filters = Object.assign({}, this.page.filters, {
|
|
352
|
+
rules: [{
|
|
353
|
+
field: e,
|
|
354
|
+
op: t,
|
|
355
|
+
value: a
|
|
356
|
+
}],
|
|
357
|
+
op: "and"
|
|
358
|
+
});
|
|
359
|
+
},
|
|
360
|
+
clearFilters() {
|
|
361
|
+
this.page.filters = {};
|
|
362
|
+
},
|
|
363
|
+
clearSelection() {
|
|
364
|
+
this.$refs.table.clearSelection();
|
|
365
|
+
},
|
|
366
|
+
search() {
|
|
367
|
+
this.setModel(this.model), this.getPage();
|
|
368
|
+
},
|
|
369
|
+
async getPage() {
|
|
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;
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
this.records = [];
|
|
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;
|
|
380
|
+
try {
|
|
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);
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
} else {
|
|
387
|
+
this.$notify.warning({
|
|
388
|
+
title: "\u5F00\u53D1\u63D0\u793A\uFF01",
|
|
389
|
+
message: "PageableTable \u8BF7\u63D0\u4F9B url(String) \u6216 api(Function) \u5C5E\u6027"
|
|
390
|
+
});
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
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);
|
|
395
|
+
},
|
|
396
|
+
async refresh() {
|
|
397
|
+
await this.getPage();
|
|
398
|
+
},
|
|
399
|
+
async reload() {
|
|
400
|
+
this.page = {
|
|
401
|
+
...this.$options.data.call(this).page,
|
|
402
|
+
total: this.page.total
|
|
403
|
+
};
|
|
404
|
+
},
|
|
405
|
+
scrollTo(e, t) {
|
|
406
|
+
e && (this.$refs.table.bodyWrapper.scrollTop = e), t && (this.$refs.table.bodyWrapper.scrollLeft = t);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}, h = {};
|
|
410
|
+
var T = /* @__PURE__ */ m(
|
|
411
|
+
S,
|
|
412
|
+
y,
|
|
413
|
+
_,
|
|
414
|
+
!1,
|
|
415
|
+
v,
|
|
416
|
+
null,
|
|
417
|
+
null,
|
|
418
|
+
null
|
|
419
|
+
);
|
|
420
|
+
function v(e) {
|
|
421
|
+
for (let t in h)
|
|
422
|
+
this[t] = h[t];
|
|
423
|
+
}
|
|
424
|
+
const k = /* @__PURE__ */ function() {
|
|
425
|
+
return T.exports;
|
|
426
|
+
}();
|
|
427
|
+
export {
|
|
428
|
+
k as default
|
|
429
|
+
};
|