@web-utils/component 3.0.3 → 3.0.5
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 +22 -24
- package/awesome-button/index.mjs +29 -30
- package/card/index.mjs +40 -42
- package/carousel/index.mjs +25 -27
- package/chat/index.mjs +57 -67
- package/chunks/FormTemp.7f91629d.mjs +165 -0
- package/chunks/confirmable-mixin.817b542f.mjs +116 -0
- package/chunks/{dataformat.e655611c.mjs → dataformat.f995e2f9.mjs} +3 -3
- package/chunks/{event.10295951.mjs → event.b5d855dd.mjs} +1 -1
- package/chunks/{form-input-mixin.78a567bc.mjs → form-input-mixin.4632ad36.mjs} +1 -1
- package/chunks/{form-item-mixin.57cb2019.mjs → form-item-mixin.ad148e7b.mjs} +13 -13
- package/color-picker/index.mjs +128 -0
- package/confirm-button/index.mjs +1 -1
- package/confirmable/index.mjs +1 -1
- package/data-box/index.mjs +32 -34
- package/data-card/index.mjs +33 -35
- package/data-cardtext/index.mjs +27 -29
- package/data-display/index.mjs +33 -35
- package/data-icons/index.mjs +28 -30
- package/data-imgtext/index.mjs +27 -30
- package/data-operatext/index.mjs +39 -41
- package/data-panel/index.mjs +36 -38
- package/data-pay/index.mjs +20 -23
- package/data-price/index.mjs +32 -34
- package/data-progress/index.mjs +27 -30
- package/data-rotate/index.mjs +17 -19
- package/data-table-picker/index.mjs +22 -23
- package/data-tabs/index.mjs +31 -33
- package/dialog-form/index.mjs +31 -39
- package/dynamic-table/index.mjs +36 -40
- package/editable-progress/index.mjs +14 -16
- package/editable-tree/index.mjs +139 -143
- package/egd-collapse-item/index.mjs +2 -1
- package/element-dialog/index.mjs +24 -25
- package/flow-designer/index.mjs +1095 -1111
- package/form-block/index.mjs +22 -24
- package/form-cascader/index.mjs +20 -20
- package/form-checkbox-group/index.mjs +24 -25
- package/form-date-picker/index.mjs +18 -19
- package/form-holder/index.mjs +14 -15
- package/form-input/index.mjs +23 -23
- package/form-input-email/index.mjs +17 -17
- package/form-input-id-card/index.mjs +24 -24
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.mjs +26 -26
- package/form-input-tag/index.mjs +1 -1
- package/form-input-time/index.mjs +17 -17
- package/form-item/index.mjs +54 -56
- package/form-item-group/index.mjs +31 -33
- package/form-radio-group/index.mjs +51 -52
- package/form-select/index.mjs +31 -32
- package/form-switch/index.mjs +22 -22
- package/form-textarea/index.mjs +20 -20
- package/fy-array/index.mjs +61 -65
- package/fy-cascader/index.mjs +19 -20
- package/fy-checkbox/index.mjs +32 -37
- package/fy-code/index.mjs +13 -10
- package/fy-curd/index.mjs +638 -663
- package/fy-date/index.mjs +20 -21
- package/fy-draggable/index.mjs +19 -20
- package/fy-dynamic/index.mjs +26 -27
- package/fy-form/index.mjs +111 -122
- package/fy-form-design/index.mjs +1238 -1270
- package/fy-input/index.mjs +15 -17
- package/fy-input-color/index.mjs +25 -27
- package/fy-input-icon/index.mjs +20 -21
- package/fy-input-map/index.mjs +22 -24
- package/fy-input-number/index.mjs +22 -23
- package/fy-input-table/index.mjs +15 -17
- package/fy-input-tree/index.mjs +28 -32
- package/fy-progress/index.mjs +23 -24
- package/fy-radio/index.mjs +18 -23
- package/fy-rate/index.mjs +12 -13
- package/fy-select/index.mjs +40 -44
- package/fy-slider/index.mjs +17 -18
- package/fy-switch/index.mjs +20 -21
- package/fy-tabs/index.mjs +19 -21
- package/fy-time/index.mjs +14 -20
- package/fy-title/index.mjs +1 -1
- package/fy-tree/index.mjs +17 -21
- package/fy-upload/index.mjs +74 -76
- package/guide-steps/index.mjs +22 -24
- package/image-cropper/index.mjs +50 -51
- package/image-preview/index.mjs +24 -26
- package/index.mjs +480 -477
- package/input-number/index.mjs +13 -14
- package/input-number-range/index.mjs +23 -24
- package/login/index.mjs +35 -40
- package/nav-bar/index.mjs +13 -14
- package/notice/index.mjs +18 -19
- package/package.json +3 -3
- package/page-index/index.mjs +33 -34
- package/page-index-top/index.mjs +22 -24
- package/pageable-table/index.mjs +92 -96
- package/pageable-view/index.mjs +33 -34
- package/search/index.mjs +21 -23
- package/static-pageable-table/index.mjs +18 -20
- package/swiper/index.mjs +22 -23
- package/table-view/index.mjs +49 -53
- package/tag-render/index.mjs +19 -21
- package/text-ellipsis/index.mjs +11 -12
- package/tinymce-editor/index.mjs +50 -51
- package/toolbar-button/index.mjs +18 -19
- package/vue-cron/index.mjs +104 -112
- package/web-types.json +85 -1
- package/x-input-tag/index.mjs +47 -50
- package/chunks/FormTemp.d079292b.mjs +0 -139
- package/chunks/confirmable-mixin.26e1d0e0.mjs +0 -197
- package/chunks/detail.d6f8e347.mjs +0 -29
package/page-index-top/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var i = (t, a, e) => new Promise((n, r) => {
|
|
2
|
-
var
|
|
2
|
+
var p = (s) => {
|
|
3
3
|
try {
|
|
4
4
|
u(e.next(s));
|
|
5
5
|
} catch (o) {
|
|
@@ -11,14 +11,12 @@ var i = (t, a, e) => new Promise((n, r) => {
|
|
|
11
11
|
} catch (o) {
|
|
12
12
|
r(o);
|
|
13
13
|
}
|
|
14
|
-
}, u = (s) => s.done ? n(s.value) : Promise.resolve(s.value).then(
|
|
14
|
+
}, u = (s) => s.done ? n(s.value) : Promise.resolve(s.value).then(p, h);
|
|
15
15
|
u((e = e.apply(t, a)).next());
|
|
16
16
|
});
|
|
17
|
-
import { treeToArray as m, findFirstMatchNode as
|
|
18
|
-
import f from "
|
|
19
|
-
|
|
20
|
-
import { n as d } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
21
|
-
var y = function() {
|
|
17
|
+
import { treeToArray as m, findFirstMatchNode as c } from "@web-utils/core";
|
|
18
|
+
import { n as f } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
19
|
+
var d = function() {
|
|
22
20
|
var t = this, a = t.$createElement, e = t._self._c || a;
|
|
23
21
|
return t.menus && t.menus.length ? e("PageSkeleton", {
|
|
24
22
|
scopedSlots: t._u([{
|
|
@@ -28,7 +26,7 @@ var y = function() {
|
|
|
28
26
|
scopedSlots: t._u([{
|
|
29
27
|
key: "section-title",
|
|
30
28
|
fn: function() {
|
|
31
|
-
return [e(
|
|
29
|
+
return [e("ElTabs", {
|
|
32
30
|
on: {
|
|
33
31
|
"tab-click": t.tabClick
|
|
34
32
|
},
|
|
@@ -40,7 +38,7 @@ var y = function() {
|
|
|
40
38
|
expression: "activeTab"
|
|
41
39
|
}
|
|
42
40
|
}, t._l(t.menus, function(n) {
|
|
43
|
-
return e(
|
|
41
|
+
return e("ElTabPane", {
|
|
44
42
|
key: n.path,
|
|
45
43
|
attrs: {
|
|
46
44
|
label: n.label,
|
|
@@ -66,8 +64,8 @@ var y = function() {
|
|
|
66
64
|
"empty-tips": "暂无权限!"
|
|
67
65
|
}
|
|
68
66
|
});
|
|
69
|
-
},
|
|
70
|
-
const
|
|
67
|
+
}, y = [];
|
|
68
|
+
const _ = {
|
|
71
69
|
name: "PageIndexTop",
|
|
72
70
|
props: {
|
|
73
71
|
menus: {
|
|
@@ -100,7 +98,7 @@ const b = {
|
|
|
100
98
|
if (m(this.menus).map((a) => a.path).filter((a) => a).includes(this.$route.path))
|
|
101
99
|
this.activeTab = this.$route.path;
|
|
102
100
|
else {
|
|
103
|
-
const a =
|
|
101
|
+
const a = c(this.menus, (e) => e.path);
|
|
104
102
|
a && (this.activeTab = a.path, yield this.$router.push({ path: a.path, query: a.query }));
|
|
105
103
|
}
|
|
106
104
|
});
|
|
@@ -113,31 +111,31 @@ const b = {
|
|
|
113
111
|
beforeRouteUpdate(t, a, e) {
|
|
114
112
|
return i(this, null, function* () {
|
|
115
113
|
if (t.path === this.schema) {
|
|
116
|
-
const n =
|
|
114
|
+
const n = c(this.menus, (r) => r.path);
|
|
117
115
|
n ? (yield e({ path: n.path, query: n.query }), this.activeTab = n.path) : yield e(!1);
|
|
118
116
|
} else
|
|
119
117
|
yield e();
|
|
120
118
|
});
|
|
121
119
|
}
|
|
122
120
|
}
|
|
123
|
-
},
|
|
124
|
-
var
|
|
125
|
-
|
|
121
|
+
}, l = {};
|
|
122
|
+
var v = /* @__PURE__ */ f(
|
|
123
|
+
_,
|
|
124
|
+
d,
|
|
126
125
|
y,
|
|
127
|
-
v,
|
|
128
126
|
!1,
|
|
129
|
-
|
|
127
|
+
b,
|
|
130
128
|
null,
|
|
131
129
|
null,
|
|
132
130
|
null
|
|
133
131
|
);
|
|
134
|
-
function
|
|
135
|
-
for (let a in
|
|
136
|
-
this[a] =
|
|
132
|
+
function b(t) {
|
|
133
|
+
for (let a in l)
|
|
134
|
+
this[a] = l[a];
|
|
137
135
|
}
|
|
138
|
-
const
|
|
139
|
-
return
|
|
136
|
+
const g = /* @__PURE__ */ function() {
|
|
137
|
+
return v.exports;
|
|
140
138
|
}();
|
|
141
139
|
export {
|
|
142
|
-
|
|
140
|
+
g as default
|
|
143
141
|
};
|
package/pageable-table/index.mjs
CHANGED
|
@@ -1,57 +1,53 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var v = Object.defineProperty, $ = Object.defineProperties;
|
|
2
|
+
var w = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var p = Object.getOwnPropertySymbols;
|
|
4
4
|
var f = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var g = (e,
|
|
6
|
-
for (var t in
|
|
7
|
-
f.call(
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
b.call(
|
|
5
|
+
var g = (e, a, t) => a in e ? v(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t, c = (e, a) => {
|
|
6
|
+
for (var t in a || (a = {}))
|
|
7
|
+
f.call(a, t) && g(e, t, a[t]);
|
|
8
|
+
if (p)
|
|
9
|
+
for (var t of p(a))
|
|
10
|
+
b.call(a, t) && g(e, t, a[t]);
|
|
11
11
|
return e;
|
|
12
|
-
}, m = (e,
|
|
13
|
-
var
|
|
12
|
+
}, m = (e, a) => $(e, w(a));
|
|
13
|
+
var y = (e, a) => {
|
|
14
14
|
var t = {};
|
|
15
|
-
for (var
|
|
16
|
-
f.call(e,
|
|
17
|
-
if (e != null &&
|
|
18
|
-
for (var
|
|
19
|
-
|
|
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]);
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
23
|
-
var
|
|
22
|
+
var h = (e, a, t) => new Promise((s, l) => {
|
|
23
|
+
var u = (r) => {
|
|
24
24
|
try {
|
|
25
25
|
i(t.next(r));
|
|
26
|
-
} catch (
|
|
27
|
-
l(
|
|
26
|
+
} catch (d) {
|
|
27
|
+
l(d);
|
|
28
28
|
}
|
|
29
29
|
}, n = (r) => {
|
|
30
30
|
try {
|
|
31
31
|
i(t.throw(r));
|
|
32
|
-
} catch (
|
|
33
|
-
l(
|
|
32
|
+
} catch (d) {
|
|
33
|
+
l(d);
|
|
34
34
|
}
|
|
35
|
-
}, i = (r) => r.done ?
|
|
36
|
-
i((t = t.apply(e,
|
|
35
|
+
}, i = (r) => r.done ? s(r.value) : Promise.resolve(r.value).then(u, n);
|
|
36
|
+
i((t = t.apply(e, a)).next());
|
|
37
37
|
});
|
|
38
|
-
import { hasOwn as
|
|
39
|
-
import { cloneDeep as
|
|
40
|
-
import { f as S, h as
|
|
41
|
-
import
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
import O from "element-ui/lib/table";
|
|
45
|
-
import { n as L } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
46
|
-
var R = function() {
|
|
47
|
-
var e = this, s = e.$createElement, t = e._self._c || s;
|
|
38
|
+
import { hasOwn as C } from "@web-utils/core";
|
|
39
|
+
import { cloneDeep as _, merge as k } from "@web-utils/integrations/lodash";
|
|
40
|
+
import { f as S, h as x, i as P } from "../chunks/index.57f871af.mjs";
|
|
41
|
+
import { n as B } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
42
|
+
var E = function() {
|
|
43
|
+
var e = this, a = e.$createElement, t = e._self._c || a;
|
|
48
44
|
return t("div", {
|
|
49
45
|
class: ["pageable-table", {
|
|
50
46
|
"auto-height": e.autoHeight
|
|
51
47
|
}]
|
|
52
48
|
}, [t("div", {
|
|
53
49
|
staticClass: "pageable-table-wrapper"
|
|
54
|
-
}, [e._t("toolbar"), t(
|
|
50
|
+
}, [e._t("toolbar"), t("ElTable", e._g(e._b({
|
|
55
51
|
ref: "table",
|
|
56
52
|
class: ["flex-item", {
|
|
57
53
|
"header-bold": e.headerBold
|
|
@@ -74,7 +70,7 @@ var R = function() {
|
|
|
74
70
|
staticClass: "pageable-table-loading"
|
|
75
71
|
}, [t("i", {
|
|
76
72
|
staticClass: "table-status-icon el-icon-loading"
|
|
77
|
-
}), e._v(" 加载中...")])] : e.tableStatus === e.TABLE_STATUS.error ? [t(
|
|
73
|
+
}), e._v(" 加载中...")])] : e.tableStatus === e.TABLE_STATUS.error ? [t("ElButton", {
|
|
78
74
|
staticClass: "pageable-table-error",
|
|
79
75
|
attrs: {
|
|
80
76
|
icon: "table-status-icon fa fa-frown-o"
|
|
@@ -111,7 +107,7 @@ var R = function() {
|
|
|
111
107
|
scopedSlots: e._u([{
|
|
112
108
|
key: "header",
|
|
113
109
|
fn: function() {
|
|
114
|
-
return [t(
|
|
110
|
+
return [t("ElRadio", {
|
|
115
111
|
attrs: {
|
|
116
112
|
value: !!e.currentRow,
|
|
117
113
|
label: !0
|
|
@@ -121,9 +117,9 @@ var R = function() {
|
|
|
121
117
|
proxy: !0
|
|
122
118
|
}, {
|
|
123
119
|
key: "default",
|
|
124
|
-
fn: function(
|
|
125
|
-
var l =
|
|
126
|
-
return [t(
|
|
120
|
+
fn: function(s) {
|
|
121
|
+
var l = s.row;
|
|
122
|
+
return [t("ElRadio", {
|
|
127
123
|
attrs: {
|
|
128
124
|
label: !0,
|
|
129
125
|
value: e.currentRow && e.currentRow[e.$attrs["row-key"] || "id"] === l[e.$attrs["row-key"] || "id"]
|
|
@@ -141,31 +137,31 @@ var R = function() {
|
|
|
141
137
|
},
|
|
142
138
|
scopedSlots: e._u([{
|
|
143
139
|
key: "default",
|
|
144
|
-
fn: function(
|
|
145
|
-
var l =
|
|
140
|
+
fn: function(s) {
|
|
141
|
+
var l = s.$index;
|
|
146
142
|
return [e._v(" " + e._s((e.page.page - 1) * e.page.limit + l + 1 || l + 1) + " ")];
|
|
147
143
|
}
|
|
148
144
|
}], null, !1, 4238275121)
|
|
149
145
|
}) : e._e(), e._t("default", function() {
|
|
150
|
-
return [e.columns && e.columns.length ? e._l(e.headers, function(
|
|
146
|
+
return [e.columns && e.columns.length ? e._l(e.headers, function(s, l) {
|
|
151
147
|
return t("TableColumn", e._b({
|
|
152
|
-
key: `${
|
|
153
|
-
}, "TableColumn",
|
|
148
|
+
key: `${s.prop}-${l}`
|
|
149
|
+
}, "TableColumn", s, !1));
|
|
154
150
|
}) : t("TableColumn", {
|
|
155
151
|
attrs: {
|
|
156
152
|
label: "点击表格行复制模板"
|
|
157
153
|
},
|
|
158
154
|
scopedSlots: e._u([{
|
|
159
155
|
key: "default",
|
|
160
|
-
fn: function(
|
|
161
|
-
var l =
|
|
156
|
+
fn: function(s) {
|
|
157
|
+
var l = s.row;
|
|
162
158
|
return [t("pre", {
|
|
163
159
|
staticClass: "pointer"
|
|
164
160
|
}, [e._v(e._s(JSON.stringify(l, null, " ")))])];
|
|
165
161
|
}
|
|
166
162
|
}])
|
|
167
163
|
})];
|
|
168
|
-
})], 2), t(
|
|
164
|
+
})], 2), t("ElPagination", {
|
|
169
165
|
staticClass: "flex-not-shrink",
|
|
170
166
|
attrs: {
|
|
171
167
|
"current-page": e.page.page,
|
|
@@ -176,18 +172,18 @@ var R = function() {
|
|
|
176
172
|
layout: "total, prev, pager, next, jumper"
|
|
177
173
|
},
|
|
178
174
|
on: {
|
|
179
|
-
"current-change": function(
|
|
180
|
-
e.page.page =
|
|
175
|
+
"current-change": function(s) {
|
|
176
|
+
e.page.page = s;
|
|
181
177
|
}
|
|
182
178
|
}
|
|
183
179
|
})], 2)]);
|
|
184
|
-
},
|
|
180
|
+
}, A = [];
|
|
185
181
|
const o = {
|
|
186
182
|
loading: 1,
|
|
187
183
|
error: -1,
|
|
188
184
|
empty: 2,
|
|
189
185
|
success: 0
|
|
190
|
-
},
|
|
186
|
+
}, R = {
|
|
191
187
|
name: "PageableTable",
|
|
192
188
|
bus: {
|
|
193
189
|
reloadTableView(e) {
|
|
@@ -265,8 +261,8 @@ const o = {
|
|
|
265
261
|
data() {
|
|
266
262
|
let e = { rules: [] };
|
|
267
263
|
this.rules && this.rules.length > 0 && (e.rules = this.rules), this.filters && (e = this.filters), this.filter && (e = Object.assign({}, e, this.filter));
|
|
268
|
-
let
|
|
269
|
-
this.model && (
|
|
264
|
+
let a = {};
|
|
265
|
+
this.model && (a = _(this.model));
|
|
270
266
|
const t = this.pageSize;
|
|
271
267
|
return {
|
|
272
268
|
TABLE_STATUS: Object.freeze(o),
|
|
@@ -279,7 +275,7 @@ const o = {
|
|
|
279
275
|
limit: t,
|
|
280
276
|
ascs: this.ascs,
|
|
281
277
|
descs: this.descs,
|
|
282
|
-
model:
|
|
278
|
+
model: a,
|
|
283
279
|
filters: e
|
|
284
280
|
}
|
|
285
281
|
};
|
|
@@ -307,7 +303,7 @@ const o = {
|
|
|
307
303
|
return e.length > 3 ? 50 + (e.length - 3) * 10 : 50;
|
|
308
304
|
},
|
|
309
305
|
mergeAttrs() {
|
|
310
|
-
return
|
|
306
|
+
return k({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
|
|
311
307
|
},
|
|
312
308
|
headers() {
|
|
313
309
|
var e;
|
|
@@ -342,25 +338,25 @@ const o = {
|
|
|
342
338
|
methods: {
|
|
343
339
|
rowDbClick(...e) {
|
|
344
340
|
var t;
|
|
345
|
-
const
|
|
341
|
+
const a = this.$refs.table.$children.find((s) => {
|
|
346
342
|
var l;
|
|
347
|
-
return ((l =
|
|
343
|
+
return ((l = s.$options) == null ? void 0 : l.name) === "ElTableBody";
|
|
348
344
|
});
|
|
349
|
-
|
|
345
|
+
a && ((t = a.$refs.tooltip) == null || t.hide()), this.$emit("row-dblclick", ...e);
|
|
350
346
|
},
|
|
351
347
|
updateTableScrollPosition() {
|
|
352
|
-
return
|
|
348
|
+
return h(this, null, function* () {
|
|
353
349
|
this.$refs.table.bodyWrapper && this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
|
|
354
350
|
});
|
|
355
351
|
},
|
|
356
|
-
filterTableProperties:
|
|
357
|
-
filterTableEvents:
|
|
352
|
+
filterTableProperties: x,
|
|
353
|
+
filterTableEvents: P,
|
|
358
354
|
filterTableColumnProperties: S,
|
|
359
355
|
onTableScroll() {
|
|
360
356
|
this.tableScrollTop = this.$refs.table.bodyWrapper.scrollTop, this.tableScrollLeft = this.$refs.table.bodyWrapper.scrollLeft;
|
|
361
357
|
},
|
|
362
|
-
onSortChange({ prop: e, order:
|
|
363
|
-
this.page.ascs =
|
|
358
|
+
onSortChange({ prop: e, order: a }) {
|
|
359
|
+
this.page.ascs = a === "ascending" ? e : "", this.page.descs = a === "descending" ? e : "";
|
|
364
360
|
},
|
|
365
361
|
onCurrentChange(e) {
|
|
366
362
|
this.currentRow = e;
|
|
@@ -373,27 +369,27 @@ const o = {
|
|
|
373
369
|
this.removeRule(e.field), this.page.filters.rules.push(e);
|
|
374
370
|
},
|
|
375
371
|
addRules(e) {
|
|
376
|
-
e.forEach((
|
|
372
|
+
e.forEach((a) => this.addRule(a));
|
|
377
373
|
},
|
|
378
|
-
setModelField(e,
|
|
379
|
-
this.$set(this.page.model, e,
|
|
374
|
+
setModelField(e, a) {
|
|
375
|
+
this.$set(this.page.model, e, a);
|
|
380
376
|
},
|
|
381
377
|
setModel(e) {
|
|
382
|
-
this.page.page = 1, this.page.model =
|
|
378
|
+
this.page.page = 1, this.page.model = _(e);
|
|
383
379
|
},
|
|
384
380
|
deleteModelField(e) {
|
|
385
381
|
delete this.page.model[e];
|
|
386
382
|
},
|
|
387
383
|
removeRule(e) {
|
|
388
|
-
const
|
|
389
|
-
t > -1 &&
|
|
384
|
+
const a = this.page.filters.rules, t = a.findIndex((s) => s.field === e);
|
|
385
|
+
t > -1 && a.splice(t, 1);
|
|
390
386
|
},
|
|
391
|
-
addFilter({ field: e, op:
|
|
387
|
+
addFilter({ field: e, op: a, value: t }) {
|
|
392
388
|
this.page.filters = Object.assign({}, this.page.filters, {
|
|
393
389
|
rules: [
|
|
394
390
|
{
|
|
395
391
|
field: e,
|
|
396
|
-
op:
|
|
392
|
+
op: a,
|
|
397
393
|
value: t
|
|
398
394
|
}
|
|
399
395
|
],
|
|
@@ -410,21 +406,21 @@ const o = {
|
|
|
410
406
|
this.setModel(this.model), this.getPage();
|
|
411
407
|
},
|
|
412
408
|
getPage() {
|
|
413
|
-
return
|
|
409
|
+
return h(this, null, function* () {
|
|
414
410
|
var r;
|
|
415
|
-
if (
|
|
411
|
+
if (C(this.$attrs, "data")) {
|
|
416
412
|
this.records = this.$attrs.data, this.page.page = 1, this.page.total = this.records.length, this.page.limit = this.page.total;
|
|
417
413
|
return;
|
|
418
414
|
}
|
|
419
415
|
this.records = [];
|
|
420
416
|
let e;
|
|
421
|
-
const i = this.page, { filters:
|
|
422
|
-
if ((r =
|
|
417
|
+
const i = this.page, { filters: a } = i, t = y(i, ["filters"]), s = c({}, t);
|
|
418
|
+
if ((r = a == null ? void 0 : a.rules) != null && r.length && (s.filters = { rules: a.rules }), this.api || this.url) {
|
|
423
419
|
this.tableStatus = o.loading;
|
|
424
420
|
try {
|
|
425
|
-
this.api && (e = yield this.api(
|
|
426
|
-
} catch (
|
|
427
|
-
this.tableStatus = o.error, console.error(
|
|
421
|
+
this.api && (e = yield this.api(s)), this.url && (e = yield this.method(this.url, s));
|
|
422
|
+
} catch (d) {
|
|
423
|
+
this.tableStatus = o.error, console.error(d);
|
|
428
424
|
return;
|
|
429
425
|
}
|
|
430
426
|
} else {
|
|
@@ -434,44 +430,44 @@ const o = {
|
|
|
434
430
|
});
|
|
435
431
|
return;
|
|
436
432
|
}
|
|
437
|
-
const { data: l } = e || {}, { total:
|
|
438
|
-
this.page.total = Number(
|
|
433
|
+
const { data: l } = e || {}, { total: u, records: n } = l || {};
|
|
434
|
+
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);
|
|
439
435
|
});
|
|
440
436
|
},
|
|
441
437
|
refresh() {
|
|
442
|
-
return
|
|
438
|
+
return h(this, null, function* () {
|
|
443
439
|
yield this.getPage();
|
|
444
440
|
});
|
|
445
441
|
},
|
|
446
442
|
reload() {
|
|
447
|
-
return
|
|
443
|
+
return h(this, null, function* () {
|
|
448
444
|
this.page = m(c({}, this.$options.data.call(this).page), {
|
|
449
445
|
total: this.page.total
|
|
450
446
|
});
|
|
451
447
|
});
|
|
452
448
|
},
|
|
453
|
-
scrollTo(e,
|
|
454
|
-
e && (this.$refs.table.bodyWrapper.scrollTop = e),
|
|
449
|
+
scrollTo(e, a) {
|
|
450
|
+
e && (this.$refs.table.bodyWrapper.scrollTop = e), a && (this.$refs.table.bodyWrapper.scrollLeft = a);
|
|
455
451
|
}
|
|
456
452
|
}
|
|
457
|
-
},
|
|
458
|
-
var
|
|
459
|
-
j,
|
|
453
|
+
}, T = {};
|
|
454
|
+
var O = /* @__PURE__ */ B(
|
|
460
455
|
R,
|
|
461
|
-
|
|
456
|
+
E,
|
|
457
|
+
A,
|
|
462
458
|
!1,
|
|
463
|
-
|
|
459
|
+
L,
|
|
464
460
|
null,
|
|
465
461
|
null,
|
|
466
462
|
null
|
|
467
463
|
);
|
|
468
|
-
function
|
|
469
|
-
for (let
|
|
470
|
-
this[
|
|
464
|
+
function L(e) {
|
|
465
|
+
for (let a in T)
|
|
466
|
+
this[a] = T[a];
|
|
471
467
|
}
|
|
472
|
-
const
|
|
473
|
-
return
|
|
468
|
+
const D = /* @__PURE__ */ function() {
|
|
469
|
+
return O.exports;
|
|
474
470
|
}();
|
|
475
471
|
export {
|
|
476
|
-
|
|
472
|
+
D as default
|
|
477
473
|
};
|
package/pageable-view/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ var $ = Object.defineProperty, T = Object.defineProperties;
|
|
|
2
2
|
var w = 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 ? $(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s,
|
|
5
|
+
var u = (e, t, s) => t in e ? $(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)
|
|
@@ -20,7 +20,7 @@ var y = (e, t) => {
|
|
|
20
20
|
return s;
|
|
21
21
|
};
|
|
22
22
|
var h = (e, t, s) => new Promise((l, r) => {
|
|
23
|
-
var
|
|
23
|
+
var g = (i) => {
|
|
24
24
|
try {
|
|
25
25
|
a(s.next(i));
|
|
26
26
|
} catch (n) {
|
|
@@ -32,15 +32,14 @@ var h = (e, t, s) => new Promise((l, r) => {
|
|
|
32
32
|
} catch (n) {
|
|
33
33
|
r(n);
|
|
34
34
|
}
|
|
35
|
-
}, a = (i) => i.done ? l(i.value) : Promise.resolve(i.value).then(
|
|
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
|
|
38
|
+
import { cloneDeep as S, merge as P } from "@web-utils/integrations/lodash";
|
|
39
39
|
import { copy as x, hasOwn as C } from "@web-utils/core";
|
|
40
|
-
import { f as
|
|
41
|
-
import
|
|
42
|
-
|
|
43
|
-
var k = function() {
|
|
40
|
+
import { f as v, h as O, i as E } from "../chunks/index.57f871af.mjs";
|
|
41
|
+
import { n as M } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
42
|
+
var R = function() {
|
|
44
43
|
var e = this, t = e.$createElement, s = e._self._c || t;
|
|
45
44
|
return s("div", {
|
|
46
45
|
staticClass: "work",
|
|
@@ -74,7 +73,7 @@ var k = function() {
|
|
|
74
73
|
return [e._t("default", null, {
|
|
75
74
|
item: l
|
|
76
75
|
})];
|
|
77
|
-
}), e._t("append")], 2)])]), s(
|
|
76
|
+
}), e._t("append")], 2)])]), s("ElPagination", {
|
|
78
77
|
staticClass: "flex-not-shrink",
|
|
79
78
|
staticStyle: {
|
|
80
79
|
"border-top": "1px solid #ebeef5"
|
|
@@ -93,8 +92,8 @@ var k = function() {
|
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
94
|
})], 1)]);
|
|
96
|
-
},
|
|
97
|
-
function
|
|
95
|
+
}, j = [];
|
|
96
|
+
function k(e) {
|
|
98
97
|
let t = "";
|
|
99
98
|
for (const s in e)
|
|
100
99
|
t += `<ElTableColumn prop="${s}" label="${s}"/>
|
|
@@ -106,7 +105,7 @@ const c = {
|
|
|
106
105
|
error: -1,
|
|
107
106
|
empty: 2,
|
|
108
107
|
success: 0
|
|
109
|
-
},
|
|
108
|
+
}, F = {
|
|
110
109
|
name: "PageableView",
|
|
111
110
|
bus: {
|
|
112
111
|
reloadTableView(e) {
|
|
@@ -168,7 +167,7 @@ const c = {
|
|
|
168
167
|
let e = { rules: [] };
|
|
169
168
|
this.rules && this.rules.length > 0 && (e.rules = this.rules), this.filters && (e = this.filters), this.filter && (e = Object.assign({}, e, this.filter));
|
|
170
169
|
let t = {};
|
|
171
|
-
this.model && (t =
|
|
170
|
+
this.model && (t = S(this.model));
|
|
172
171
|
const s = this.pageSize;
|
|
173
172
|
return {
|
|
174
173
|
// TABLE_STATUS: Object.freeze(TABLE_STATUS),
|
|
@@ -214,7 +213,7 @@ const c = {
|
|
|
214
213
|
},
|
|
215
214
|
headers() {
|
|
216
215
|
var e;
|
|
217
|
-
return ((e = this.columns) == null ? void 0 : e.map(
|
|
216
|
+
return ((e = this.columns) == null ? void 0 : e.map(v)) || [];
|
|
218
217
|
}
|
|
219
218
|
},
|
|
220
219
|
watch: {
|
|
@@ -250,12 +249,12 @@ const c = {
|
|
|
250
249
|
});
|
|
251
250
|
},
|
|
252
251
|
filterTableProperties: O,
|
|
253
|
-
filterTableEvents:
|
|
254
|
-
filterTableColumnProperties:
|
|
252
|
+
filterTableEvents: E,
|
|
253
|
+
filterTableColumnProperties: v,
|
|
255
254
|
onTableScroll() {
|
|
256
255
|
this.tableScrollTop = this.$refs.scroller.scrollTop, this.tableScrollLeft = this.$refs.scroller.scrollLeft;
|
|
257
256
|
},
|
|
258
|
-
copy: (e) => x(
|
|
257
|
+
copy: (e) => x(k(e)),
|
|
259
258
|
onSortChange({ prop: e, order: t }) {
|
|
260
259
|
this.page.ascs = t === "ascending" ? e : "", this.page.descs = t === "descending" ? e : "";
|
|
261
260
|
},
|
|
@@ -276,7 +275,7 @@ const c = {
|
|
|
276
275
|
this.$set(this.page.model, e, t);
|
|
277
276
|
},
|
|
278
277
|
setModel(e) {
|
|
279
|
-
this.page.page = 1, this.page.model =
|
|
278
|
+
this.page.page = 1, this.page.model = S(e);
|
|
280
279
|
},
|
|
281
280
|
deleteModelField(e) {
|
|
282
281
|
delete this.page.model[e];
|
|
@@ -315,7 +314,7 @@ const c = {
|
|
|
315
314
|
}
|
|
316
315
|
this.records = [];
|
|
317
316
|
let e;
|
|
318
|
-
const a = this.page, { filters: t } = a, s = y(a, ["filters"]), l =
|
|
317
|
+
const a = this.page, { filters: t } = a, s = y(a, ["filters"]), l = p({}, s);
|
|
319
318
|
if ((i = t == null ? void 0 : t.rules) != null && i.length && (l.filters = { rules: t.rules }), this.api || this.url) {
|
|
320
319
|
this.tableStatus = c.loading;
|
|
321
320
|
try {
|
|
@@ -331,8 +330,8 @@ const c = {
|
|
|
331
330
|
});
|
|
332
331
|
return;
|
|
333
332
|
}
|
|
334
|
-
const { data: r } = e || {}, { total:
|
|
335
|
-
this.page.total = Number(
|
|
333
|
+
const { data: r } = e || {}, { total: g, records: o } = r || {};
|
|
334
|
+
this.page.total = Number(g), this.records = o, !o || !o.length ? this.tableStatus = c.empty : this.tableStatus = c.success, this.$refs.table && (this.$refs.scroller.scrollTop = 0), this.$emit("page-loaded", r);
|
|
336
335
|
});
|
|
337
336
|
},
|
|
338
337
|
refresh() {
|
|
@@ -342,7 +341,7 @@ const c = {
|
|
|
342
341
|
},
|
|
343
342
|
reload() {
|
|
344
343
|
return h(this, null, function* () {
|
|
345
|
-
this.page = b(
|
|
344
|
+
this.page = b(p({}, this.$options.data.call(this).page), {
|
|
346
345
|
total: this.page.total
|
|
347
346
|
});
|
|
348
347
|
});
|
|
@@ -351,24 +350,24 @@ const c = {
|
|
|
351
350
|
e && (this.$refs.scroller.scrollTop = e), t && (this.$refs.scroller.scrollLeft = t);
|
|
352
351
|
}
|
|
353
352
|
}
|
|
354
|
-
},
|
|
355
|
-
var
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
353
|
+
}, _ = {};
|
|
354
|
+
var L = /* @__PURE__ */ M(
|
|
355
|
+
F,
|
|
356
|
+
R,
|
|
357
|
+
j,
|
|
359
358
|
!1,
|
|
360
|
-
|
|
359
|
+
A,
|
|
361
360
|
null,
|
|
362
361
|
null,
|
|
363
362
|
null
|
|
364
363
|
);
|
|
365
|
-
function
|
|
366
|
-
for (let t in
|
|
367
|
-
this[t] =
|
|
364
|
+
function A(e) {
|
|
365
|
+
for (let t in _)
|
|
366
|
+
this[t] = _[t];
|
|
368
367
|
}
|
|
369
|
-
const
|
|
370
|
-
return
|
|
368
|
+
const N = /* @__PURE__ */ function() {
|
|
369
|
+
return L.exports;
|
|
371
370
|
}();
|
|
372
371
|
export {
|
|
373
|
-
|
|
372
|
+
N as default
|
|
374
373
|
};
|