@done-coding/admin-core 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/bridge/index.mjs +87 -47
- package/es/components/app-layout/AppBody.vue.mjs +7 -0
- package/es/components/app-layout/AppBody.vue2.mjs +89 -0
- package/es/components/app-layout/AppBreadcrumb.vue.mjs +7 -0
- package/es/components/app-layout/AppBreadcrumb.vue2.mjs +58 -0
- package/es/components/app-layout/AppFooter.vue.mjs +7 -0
- package/es/components/app-layout/AppFooter.vue2.mjs +17 -0
- package/es/components/app-layout/AppHeader.vue.mjs +7 -0
- package/es/components/app-layout/AppHeader.vue2.mjs +99 -0
- package/es/components/app-layout/AppLayout.vue.mjs +7 -0
- package/es/components/app-layout/AppLayout.vue2.mjs +130 -0
- package/es/components/app-layout/AppPage.vue.mjs +7 -0
- package/es/components/app-layout/AppPage.vue2.mjs +39 -0
- package/es/components/app-layout/AppSidebar.vue.mjs +7 -0
- package/es/components/app-layout/AppSidebar.vue2.mjs +97 -0
- package/es/components/app-layout/index.mjs +32 -0
- package/es/components/display/ActionBtnGroup.vue.mjs +61 -0
- package/es/components/display/ActionBtnGroup.vue2.mjs +4 -0
- package/es/components/display/HeightProvider.vue.mjs +26 -26
- package/es/components/display/TabsHeader.vue.mjs +7 -0
- package/es/components/display/TabsHeader.vue2.mjs +76 -0
- package/es/components/display/TabsMain.vue.mjs +100 -5
- package/es/components/display/TabsMain.vue2.mjs +2 -95
- package/es/components/display/TabsNaturalFlow.vue.mjs +17 -0
- package/es/components/display/TabsNaturalFlow.vue2.mjs +4 -0
- package/es/components/display/TabsRefineFlow.vue.mjs +62 -0
- package/es/components/display/TabsRefineFlow.vue2.mjs +4 -0
- package/es/components/display/index.mjs +10 -8
- package/es/components/form/FormSearch.vue.mjs +2 -2
- package/es/components/form/FormSearch.vue2.mjs +107 -63
- package/es/components/form/form-search-utils.mjs +25 -0
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +82 -76
- package/es/components/misc/ActionBtn.vue.mjs +84 -65
- package/es/components/misc/ActionConfirm.vue.mjs +1 -1
- package/es/components/misc/ActionConfirm.vue2.mjs +77 -71
- package/es/components/misc/SelectModule.vue.mjs +55 -0
- package/es/components/misc/SelectModule.vue2.mjs +4 -0
- package/es/components/modal/ConfirmModal.vue.mjs +1 -1
- package/es/components/modal/ConfirmModal.vue2.mjs +13 -12
- package/es/components/modal/modal-shelf-hierarchy.mjs +4 -6
- package/es/components/table/TableMain.vue.mjs +3 -3
- package/es/components/table/TableMain.vue2.mjs +103 -102
- package/es/components/table/ToolbarButtons.vue.mjs +10 -40
- package/es/hooks/use-breakpoint.mjs +40 -0
- package/es/hooks/use-channel-viewport-height.mjs +18 -0
- package/es/index.mjs +165 -128
- package/es/inject/key.mjs +18 -8
- package/es/router/guard/index.mjs +31 -0
- package/es/router/guard/login.mjs +4 -0
- package/es/router/guard/permission.mjs +4 -0
- package/es/store/app.mjs +103 -0
- package/es/store/router-permission.mjs +65 -0
- package/es/store/user.mjs +52 -52
- package/es/style.css +1 -1
- package/package.json +3 -2
- package/types/bridge/index.d.ts +193 -89
- package/types/components/app-layout/AppBody.vue.d.ts +45 -0
- package/types/components/app-layout/AppBreadcrumb.vue.d.ts +25 -0
- package/types/components/app-layout/AppFooter.vue.d.ts +2 -0
- package/types/components/app-layout/AppHeader.vue.d.ts +55 -0
- package/types/components/app-layout/AppLayout.vue.d.ts +76 -0
- package/types/components/app-layout/AppPage.vue.d.ts +54 -0
- package/types/components/app-layout/AppSidebar.vue.d.ts +51 -0
- package/types/components/app-layout/index.d.ts +27 -0
- package/types/components/app-layout/types.d.ts +43 -0
- package/types/components/display/ActionBtnGroup.vue.d.ts +16 -0
- package/types/components/display/HeightProvider.vue.d.ts +10 -6
- package/types/components/display/TabsHeader.vue.d.ts +42 -0
- package/types/components/display/TabsMain.vue.d.ts +49 -7
- package/types/components/display/TabsNaturalFlow.vue.d.ts +16 -0
- package/types/components/display/TabsRefineFlow.vue.d.ts +53 -0
- package/types/components/display/index.d.ts +16 -13
- package/types/components/display/types.d.ts +85 -29
- package/types/components/form/form-search-utils.d.ts +24 -0
- package/types/components/form/types.d.ts +7 -1
- package/types/components/list-page/types.d.ts +1 -1
- package/types/components/misc/ActionBtn.vue.d.ts +17 -23
- package/types/components/misc/ActionConfirm.vue.d.ts +56 -27
- package/types/components/misc/SelectModule.vue.d.ts +2 -0
- package/types/components/misc/index.d.ts +11 -1
- package/types/components/misc/types.d.ts +35 -26
- package/types/components/modal/ConfirmModal.vue.d.ts +17 -0
- package/types/components/modal/modal-shelf-hierarchy.d.ts +1 -1
- package/types/components/table/types.d.ts +14 -12
- package/types/helpers/index.d.ts +10 -3
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/use-breakpoint.d.ts +4 -0
- package/types/hooks/use-channel-viewport-height.d.ts +28 -0
- package/types/index.d.ts +4 -1
- package/types/inject/key.d.ts +35 -10
- package/types/router/guard/index.d.ts +21 -0
- package/types/router/guard/login.d.ts +5 -0
- package/types/router/guard/permission.d.ts +5 -0
- package/types/router/guard/types.d.ts +15 -0
- package/types/router/index.d.ts +1 -0
- package/types/store/app.d.ts +149 -0
- package/types/store/index.d.ts +2 -0
- package/types/store/router-permission.d.ts +80 -0
- package/types/store/user.d.ts +11 -9
- /package/es/{helpers → bridge}/route.mjs +0 -0
- /package/es/{helpers → bridge}/state.mjs +0 -0
- /package/es/{helpers → bridge}/storage.mjs +0 -0
- /package/types/{helpers → bridge}/route.d.ts +0 -0
- /package/types/{helpers → bridge}/state.d.ts +0 -0
- /package/types/{helpers → bridge}/storage.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FormSearch.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-996aa2dc"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ElCol as
|
|
1
|
+
import T from "./FormMain.vue.mjs";
|
|
2
|
+
import { ElCol as G, ElButton as H, ElIcon as U } from "element-plus/es";
|
|
3
3
|
import "element-plus/es/components/base/style/css";
|
|
4
4
|
import "element-plus/es/components/col/style/css";
|
|
5
5
|
import "element-plus/es/components/button/style/css";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
6
|
+
import "element-plus/es/components/icon/style/css";
|
|
7
|
+
import { defineComponent as j, useAttrs as q, ref as k, computed as l, shallowRef as J, openBlock as f, createBlock as p, normalizeClass as K, unref as r, withCtx as a, withDirectives as O, createVNode as m, mergeProps as X, createSlots as Y, normalizeProps as R, guardReactiveProps as S, createElementVNode as Z, createTextVNode as y, toDisplayString as ee, createCommentVNode as te, renderList as oe, renderSlot as re, vShow as ae } from "vue";
|
|
8
|
+
import { stringifyFormData as se } from "./utils.mjs";
|
|
9
|
+
import { getCurrentSpan as ne, computeButtonColProps as le, computeItemsPerRow as ie } from "./form-search-utils.mjs";
|
|
10
|
+
import { ArrowDown as ue, ArrowUp as me } from "@element-plus/icons-vue";
|
|
11
|
+
import ce from "../display/WatchSize.vue.mjs";
|
|
12
|
+
import { useBreakpoint as de } from "../../hooks/use-breakpoint.mjs";
|
|
13
|
+
const fe = { class: "btn-box" }, _e = /* @__PURE__ */ j({
|
|
10
14
|
name: "FormSearch",
|
|
11
15
|
inheritAttrs: !1,
|
|
12
16
|
__name: "FormSearch",
|
|
@@ -14,6 +18,7 @@ const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
|
|
|
14
18
|
labelPosition: { default: "right" },
|
|
15
19
|
labelWidth: { default: "auto" },
|
|
16
20
|
staticQuery: {},
|
|
21
|
+
maxRows: { default: 2 },
|
|
17
22
|
list: {},
|
|
18
23
|
data: {},
|
|
19
24
|
layout: { default: () => ({
|
|
@@ -26,82 +31,121 @@ const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
|
|
|
26
31
|
rowGutter: {}
|
|
27
32
|
},
|
|
28
33
|
emits: ["search", "heightChange", "visibleChange"],
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
setup(u, { expose: _, emit: P }) {
|
|
35
|
+
const o = u, c = P, E = q(), h = k(!1), { activeBreakpoint: F } = de(), s = k(!0), B = l(() => o.data), v = l(() => {
|
|
36
|
+
if (o.maxRows <= 0) return 1 / 0;
|
|
37
|
+
const e = ne(o.layout, F.value), t = ie(e), i = t > 1 ? 1 : 0;
|
|
38
|
+
return Math.max(0, o.maxRows * t - i);
|
|
39
|
+
}), M = l(() => o.maxRows <= 0 ? !1 : o.list.filter(
|
|
40
|
+
(t) => t.hide !== !0
|
|
41
|
+
).length > v.value), V = l(() => {
|
|
42
|
+
let e = 0;
|
|
43
|
+
for (let t = 0; t < o.list.length; t++)
|
|
44
|
+
o.list[t].hide !== !0 && (s.value && o.maxRows > 0 && t >= v.value || e++);
|
|
45
|
+
return e;
|
|
46
|
+
}), I = l(() => le(o.layout, V.value)), D = l(() => {
|
|
47
|
+
if (!s.value || o.maxRows <= 0)
|
|
48
|
+
return o.list;
|
|
49
|
+
const e = v.value;
|
|
50
|
+
return o.list.map(
|
|
51
|
+
(t, i) => i >= e ? { ...t, hide: !0 } : t
|
|
52
|
+
);
|
|
53
|
+
}), C = (e = !s.value) => {
|
|
54
|
+
s.value = e;
|
|
55
|
+
}, $ = (e) => {
|
|
56
|
+
c("heightChange", e);
|
|
57
|
+
}, n = J(), b = (e) => ({
|
|
58
|
+
...o.staticQuery || {},
|
|
59
|
+
...se(e, o.list)
|
|
60
|
+
}), x = () => {
|
|
36
61
|
var e;
|
|
37
|
-
(e =
|
|
38
|
-
},
|
|
62
|
+
(e = n.value) == null || e.resetFields(), c("search", b(o.data), "reset");
|
|
63
|
+
}, g = (e = "search") => {
|
|
39
64
|
var t;
|
|
40
|
-
(t =
|
|
41
|
-
|
|
65
|
+
(t = n.value) == null || t.validate().then(() => {
|
|
66
|
+
c("search", b(o.data), e);
|
|
42
67
|
});
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
b({
|
|
68
|
+
}, A = (e) => {
|
|
69
|
+
g(e);
|
|
70
|
+
}, N = {
|
|
47
71
|
validate: () => {
|
|
48
|
-
if (
|
|
49
|
-
return
|
|
72
|
+
if (n.value)
|
|
73
|
+
return n.value.validate();
|
|
50
74
|
throw new Error("实例化未完成");
|
|
51
75
|
},
|
|
52
76
|
resetFields: () => {
|
|
53
77
|
var e;
|
|
54
|
-
return (e =
|
|
78
|
+
return (e = n.value) == null ? void 0 : e.resetFields();
|
|
55
79
|
},
|
|
56
80
|
clearValidate: (e) => {
|
|
57
81
|
var t;
|
|
58
|
-
return (t =
|
|
82
|
+
return (t = n.value) == null ? void 0 : t.clearValidate(e);
|
|
59
83
|
},
|
|
60
|
-
triggerReset:
|
|
61
|
-
triggerSearch: () =>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
84
|
+
triggerReset: x,
|
|
85
|
+
triggerSearch: () => g(),
|
|
86
|
+
toggleCollapse: C,
|
|
87
|
+
isCollapsed: l(() => s.value)
|
|
88
|
+
};
|
|
89
|
+
_(N);
|
|
90
|
+
const W = (e) => {
|
|
91
|
+
h.value = e, c("visibleChange", e);
|
|
65
92
|
};
|
|
66
93
|
return (e, t) => {
|
|
67
|
-
const
|
|
68
|
-
return
|
|
69
|
-
class:
|
|
70
|
-
"form-search_show":
|
|
94
|
+
const i = U, w = H, Q = G, z = T;
|
|
95
|
+
return f(), p(ce, {
|
|
96
|
+
class: K(["form-search", {
|
|
97
|
+
"form-search_show": r(h)
|
|
71
98
|
}]),
|
|
72
|
-
onHeightChange:
|
|
99
|
+
onHeightChange: $
|
|
73
100
|
}, {
|
|
74
|
-
default:
|
|
75
|
-
|
|
101
|
+
default: a(() => [
|
|
102
|
+
O(m(z, X({
|
|
76
103
|
ref_key: "formMain",
|
|
77
|
-
ref:
|
|
78
|
-
list:
|
|
79
|
-
data:
|
|
80
|
-
},
|
|
81
|
-
layout:
|
|
82
|
-
labelPosition:
|
|
83
|
-
labelWidth:
|
|
84
|
-
onSubmit:
|
|
85
|
-
onVisibleChange:
|
|
86
|
-
}),
|
|
87
|
-
default:
|
|
88
|
-
m(
|
|
89
|
-
default:
|
|
90
|
-
|
|
91
|
-
|
|
104
|
+
ref: n,
|
|
105
|
+
list: r(D),
|
|
106
|
+
data: r(B)
|
|
107
|
+
}, r(E), {
|
|
108
|
+
layout: u.layout,
|
|
109
|
+
labelPosition: u.labelPosition,
|
|
110
|
+
labelWidth: u.labelWidth,
|
|
111
|
+
onSubmit: A,
|
|
112
|
+
onVisibleChange: W
|
|
113
|
+
}), Y({
|
|
114
|
+
default: a(() => [
|
|
115
|
+
m(Q, R(S(r(I))), {
|
|
116
|
+
default: a(() => [
|
|
117
|
+
Z("div", fe, [
|
|
118
|
+
r(M) ? (f(), p(w, {
|
|
119
|
+
key: 0,
|
|
120
|
+
type: "primary",
|
|
121
|
+
link: "",
|
|
122
|
+
onMousedown: t[0] || (t[0] = (d) => C())
|
|
123
|
+
}, {
|
|
124
|
+
default: a(() => [
|
|
125
|
+
m(i, { class: "btn-box-expand-icon" }, {
|
|
126
|
+
default: a(() => [
|
|
127
|
+
r(s) ? (f(), p(r(ue), { key: 0 })) : (f(), p(r(me), { key: 1 }))
|
|
128
|
+
]),
|
|
129
|
+
_: 1
|
|
130
|
+
}),
|
|
131
|
+
y(" " + ee(r(s) ? "展开更多" : "收起更多"), 1)
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
})) : te("", !0),
|
|
135
|
+
m(w, {
|
|
92
136
|
type: "primary",
|
|
93
|
-
onMousedown:
|
|
137
|
+
onMousedown: x
|
|
94
138
|
}, {
|
|
95
|
-
default:
|
|
139
|
+
default: a(() => [...t[2] || (t[2] = [
|
|
96
140
|
y("重置", -1)
|
|
97
141
|
])]),
|
|
98
142
|
_: 1
|
|
99
143
|
}),
|
|
100
|
-
m(
|
|
144
|
+
m(w, {
|
|
101
145
|
type: "primary",
|
|
102
|
-
onMousedown: t[
|
|
146
|
+
onMousedown: t[1] || (t[1] = (d) => g())
|
|
103
147
|
}, {
|
|
104
|
-
default:
|
|
148
|
+
default: a(() => [...t[3] || (t[3] = [
|
|
105
149
|
y("查询", -1)
|
|
106
150
|
])]),
|
|
107
151
|
_: 1
|
|
@@ -113,14 +157,14 @@ const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
|
|
|
113
157
|
]),
|
|
114
158
|
_: 2
|
|
115
159
|
}, [
|
|
116
|
-
|
|
117
|
-
name:
|
|
118
|
-
fn:
|
|
119
|
-
|
|
160
|
+
oe(u.list, (d) => ({
|
|
161
|
+
name: d.key,
|
|
162
|
+
fn: a((L) => [
|
|
163
|
+
re(e.$slots, d.key, R(S(L)), void 0, !0)
|
|
120
164
|
])
|
|
121
165
|
}))
|
|
122
166
|
]), 1040, ["list", "data", "layout", "labelPosition", "labelWidth"]), [
|
|
123
|
-
[
|
|
167
|
+
[ae, r(h)]
|
|
124
168
|
])
|
|
125
169
|
]),
|
|
126
170
|
_: 3
|
|
@@ -129,5 +173,5 @@ const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
|
|
|
129
173
|
}
|
|
130
174
|
});
|
|
131
175
|
export {
|
|
132
|
-
|
|
176
|
+
_e as default
|
|
133
177
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { resolveFormLayout as u } from "./utils.mjs";
|
|
2
|
+
const m = ["xs", "sm", "md", "lg", "xl"], f = (o) => Math.max(1, Math.floor(24 / o)), a = (o, t) => {
|
|
3
|
+
if (o <= 0 || t >= 24) return 0;
|
|
4
|
+
const n = f(t), e = o % n;
|
|
5
|
+
return e === 0 ? 24 - t : 24 - e * t - t;
|
|
6
|
+
}, i = (o, t) => {
|
|
7
|
+
const n = u(o), e = {};
|
|
8
|
+
for (const r of m) {
|
|
9
|
+
const s = n[r], c = typeof s == "number" ? s : n.span ?? 6;
|
|
10
|
+
e[r] = {
|
|
11
|
+
span: c,
|
|
12
|
+
offset: a(t, c)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return e;
|
|
16
|
+
}, l = (o, t) => {
|
|
17
|
+
const n = u(o), e = n[t];
|
|
18
|
+
return typeof e == "number" ? e : n.span ?? 6;
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
i as computeButtonColProps,
|
|
22
|
+
a as computeButtonOffset,
|
|
23
|
+
f as computeItemsPerRow,
|
|
24
|
+
l as getCurrentSpan
|
|
25
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ListPage.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d8d188e5"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { ElLoadingDirective as ce } from "element-plus/es";
|
|
2
2
|
import "element-plus/es/components/base/style/css";
|
|
3
3
|
import "element-plus/es/components/loading/style/css";
|
|
4
|
-
import { defineComponent as he, useCssVars as
|
|
5
|
-
import
|
|
6
|
-
import { generateFormData as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
4
|
+
import { defineComponent as he, useCssVars as ge, unref as a, useSlots as fe, computed as o, useModel as de, ref as u, shallowRef as K, watch as me, withDirectives as ve, openBlock as C, createElementBlock as pe, createBlock as O, withCtx as h, renderSlot as g, createCommentVNode as T, createVNode as q, mergeProps as y, createSlots as x, renderList as H, normalizeProps as S, guardReactiveProps as b, mergeModels as E } from "vue";
|
|
5
|
+
import Ce from "../form/FormSearch.vue.mjs";
|
|
6
|
+
import { generateFormData as ye, stringifyFormData as He } from "../form/utils.mjs";
|
|
7
|
+
import L from "../display/WatchSize.vue.mjs";
|
|
8
|
+
import Se from "../table/TableMain.vue.mjs";
|
|
9
|
+
import be from "lodash/pick";
|
|
10
10
|
import we from "lodash/cloneDeep";
|
|
11
|
-
import {
|
|
12
|
-
const
|
|
11
|
+
import { useChannelViewportHeight as Re } from "../../hooks/use-channel-viewport-height.mjs";
|
|
12
|
+
const ke = {
|
|
13
13
|
"element-loading-background": "rgba(122, 122, 122, 0.5)",
|
|
14
14
|
class: "list-page"
|
|
15
|
-
},
|
|
15
|
+
}, Oe = /* @__PURE__ */ he({
|
|
16
16
|
__name: "ListPage",
|
|
17
|
-
props: /* @__PURE__ */
|
|
17
|
+
props: /* @__PURE__ */ E({
|
|
18
18
|
staticQuery: { default: () => ({}) },
|
|
19
19
|
formSearchProps: {},
|
|
20
20
|
columns: {},
|
|
21
21
|
rowKey: {},
|
|
22
22
|
refine: { type: Boolean, default: !0 },
|
|
23
23
|
refineReduceHeight: { default: 0 },
|
|
24
|
+
viewportHeight: {},
|
|
25
|
+
parentChannel: {},
|
|
24
26
|
tableMainProps: {},
|
|
25
27
|
list: { default: () => [] },
|
|
26
28
|
api: {},
|
|
@@ -32,46 +34,42 @@ const Me = {
|
|
|
32
34
|
isAutoRefresh: { type: Boolean },
|
|
33
35
|
isAutoRefreshModifiers: {}
|
|
34
36
|
}),
|
|
35
|
-
emits: /* @__PURE__ */
|
|
36
|
-
setup(
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
emits: /* @__PURE__ */ E(["dataChange", "pageInfoChange"], ["update:isAutoRefresh"]),
|
|
38
|
+
setup(i, { expose: N, emit: J }) {
|
|
39
|
+
ge((e) => ({
|
|
40
|
+
v990abd1c: a(X)
|
|
39
41
|
}));
|
|
40
|
-
const n =
|
|
42
|
+
const n = i, w = J, R = fe(), k = o(() => !!R.header), $ = o(() => !!R.operation), m = de(i, "isAutoRefresh"), v = u({}), p = u(
|
|
41
43
|
{}
|
|
42
|
-
),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
), $ = u(0), j = u(0), k = u(0), z = o(() => ({
|
|
44
|
+
), F = u(!1), s = K(), c = K(), { viewportHeightFinal: Q } = Re(n, {
|
|
45
|
+
fallback: 500
|
|
46
|
+
}), M = u(0), P = u(0), j = u(0), z = o(() => ({
|
|
46
47
|
...p.value,
|
|
47
48
|
...n.staticQuery
|
|
48
|
-
})),
|
|
49
|
-
A.value - G.value - U.value - W.value,
|
|
50
|
-
200
|
|
51
|
-
) : void 0), F = (e, t = "search") => {
|
|
49
|
+
})), A = u(!1), U = o(() => A.value ? M.value + 10 : 0), G = o(() => $.value ? P.value + 10 : 0), W = o(() => k.value ? j.value + 10 : 0), D = o(() => Q.value - n.refineReduceHeight), X = o(() => n.refine ? `${D.value}px` : "auto"), Y = o(() => n.refine ? D.value - U.value - G.value - W.value : void 0), I = (e, t = "search") => {
|
|
52
50
|
var r, l, d;
|
|
53
|
-
let
|
|
54
|
-
if (n.beforeSearch && (
|
|
51
|
+
let f = e;
|
|
52
|
+
if (n.beforeSearch && (f = n.beforeSearch(
|
|
55
53
|
we(e),
|
|
56
54
|
t
|
|
57
|
-
)), t === "reset" && n.clearTableFilterOnReset && ((l = (r = c.value) == null ? void 0 : r.getTableInstance()) == null || l.clearFilter()), JSON.stringify(
|
|
55
|
+
)), t === "reset" && n.clearTableFilterOnReset && ((l = (r = c.value) == null ? void 0 : r.getTableInstance()) == null || l.clearFilter()), JSON.stringify(f) === JSON.stringify(p.value))
|
|
58
56
|
return ["reset", "search"].includes(t) ? (d = c.value) == null ? void 0 : d.reload() : void 0;
|
|
59
57
|
p.value = {
|
|
60
|
-
...
|
|
58
|
+
...f
|
|
61
59
|
};
|
|
62
60
|
}, Z = (e) => {
|
|
63
|
-
|
|
61
|
+
w("dataChange", e);
|
|
64
62
|
}, _ = (e) => {
|
|
65
|
-
|
|
63
|
+
w("pageInfoChange", e);
|
|
66
64
|
}, ee = (e) => {
|
|
67
|
-
|
|
65
|
+
F.value = e;
|
|
68
66
|
}, te = (e) => {
|
|
69
|
-
|
|
67
|
+
M.value = e;
|
|
70
68
|
}, re = (e) => {
|
|
71
|
-
|
|
69
|
+
P.value = e;
|
|
72
70
|
}, ae = (e) => {
|
|
73
|
-
|
|
74
|
-
}, oe = o(() => n.list), ne = o(() => n.rowKey),
|
|
71
|
+
j.value = e;
|
|
72
|
+
}, oe = o(() => n.list), ne = o(() => n.rowKey), V = o(() => v.value), B = {
|
|
75
73
|
refresh: async (e = !1) => {
|
|
76
74
|
var t;
|
|
77
75
|
return (t = c.value) == null ? void 0 : t.refresh(e);
|
|
@@ -85,31 +83,39 @@ const Me = {
|
|
|
85
83
|
return (e = c.value) == null ? void 0 : e.getTableInstance();
|
|
86
84
|
},
|
|
87
85
|
validate: () => {
|
|
88
|
-
if (
|
|
89
|
-
return
|
|
86
|
+
if (s.value)
|
|
87
|
+
return s.value.validate();
|
|
90
88
|
throw new Error("实例化未完成");
|
|
91
89
|
},
|
|
92
90
|
resetFields: () => {
|
|
93
91
|
var e;
|
|
94
|
-
return (e =
|
|
92
|
+
return (e = s.value) == null ? void 0 : e.resetFields();
|
|
95
93
|
},
|
|
96
94
|
clearValidate: (e) => {
|
|
97
95
|
var t;
|
|
98
|
-
return (t =
|
|
96
|
+
return (t = s.value) == null ? void 0 : t.clearValidate(e);
|
|
99
97
|
},
|
|
100
98
|
triggerReset: () => {
|
|
101
99
|
var e;
|
|
102
|
-
return (e =
|
|
100
|
+
return (e = s.value) == null ? void 0 : e.triggerReset();
|
|
103
101
|
},
|
|
104
102
|
triggerSearch: () => {
|
|
105
103
|
var e;
|
|
106
|
-
return (e =
|
|
104
|
+
return (e = s.value) == null ? void 0 : e.triggerSearch();
|
|
107
105
|
},
|
|
106
|
+
toggleCollapse: (e) => {
|
|
107
|
+
var t;
|
|
108
|
+
return (t = s.value) == null ? void 0 : t.toggleCollapse(e);
|
|
109
|
+
},
|
|
110
|
+
isCollapsed: o(() => {
|
|
111
|
+
var e;
|
|
112
|
+
return ((e = s.value) == null ? void 0 : e.isCollapsed.value) ?? !1;
|
|
113
|
+
}),
|
|
108
114
|
update: (e, t) => {
|
|
109
115
|
v.value[e] = t;
|
|
110
116
|
}
|
|
111
117
|
}, se = o(() => {
|
|
112
|
-
const e =
|
|
118
|
+
const e = be(B, [
|
|
113
119
|
"triggerReset",
|
|
114
120
|
"triggerSearch",
|
|
115
121
|
"update"
|
|
@@ -119,104 +125,104 @@ const Me = {
|
|
|
119
125
|
...e
|
|
120
126
|
};
|
|
121
127
|
}), ie = (e) => e, le = (e) => e, ue = (e) => {
|
|
122
|
-
|
|
128
|
+
A.value = e;
|
|
123
129
|
};
|
|
124
|
-
return
|
|
130
|
+
return N(B), me(
|
|
125
131
|
() => n.list,
|
|
126
132
|
(e) => {
|
|
127
|
-
const t =
|
|
128
|
-
v.value = t,
|
|
133
|
+
const t = ye(e);
|
|
134
|
+
v.value = t, I(He(t, e));
|
|
129
135
|
},
|
|
130
136
|
{
|
|
131
137
|
immediate: !0
|
|
132
138
|
}
|
|
133
139
|
), (e, t) => {
|
|
134
|
-
const
|
|
135
|
-
return
|
|
136
|
-
a(
|
|
140
|
+
const f = ce;
|
|
141
|
+
return ve((C(), pe("div", ke, [
|
|
142
|
+
a(k) ? (C(), O(a(L), {
|
|
137
143
|
key: 0,
|
|
138
144
|
class: "list-page-header",
|
|
139
145
|
onHeightChange: ae
|
|
140
146
|
}, {
|
|
141
147
|
default: h(() => [
|
|
142
|
-
|
|
148
|
+
g(e.$slots, "header", {}, void 0, !0)
|
|
143
149
|
]),
|
|
144
150
|
_: 3
|
|
145
|
-
})) :
|
|
146
|
-
|
|
151
|
+
})) : T("", !0),
|
|
152
|
+
q(a(Ce), y({
|
|
147
153
|
ref_key: "formSearch",
|
|
148
|
-
ref:
|
|
154
|
+
ref: s,
|
|
149
155
|
list: a(oe),
|
|
150
|
-
data: a(
|
|
151
|
-
},
|
|
152
|
-
onSearch:
|
|
156
|
+
data: a(V)
|
|
157
|
+
}, i.formSearchProps, {
|
|
158
|
+
onSearch: I,
|
|
153
159
|
onHeightChange: te,
|
|
154
160
|
onVisibleChange: ue
|
|
155
|
-
}),
|
|
156
|
-
|
|
161
|
+
}), x({ _: 2 }, [
|
|
162
|
+
H(i.list, (r) => ({
|
|
157
163
|
name: r.key,
|
|
158
164
|
fn: h((l) => [
|
|
159
|
-
|
|
165
|
+
g(e.$slots, `form-${r.key}`, S(b(l)), void 0, !0)
|
|
160
166
|
])
|
|
161
167
|
}))
|
|
162
168
|
]), 1040, ["list", "data"]),
|
|
163
|
-
a(
|
|
169
|
+
a($) ? (C(), O(a(L), {
|
|
164
170
|
key: 1,
|
|
165
171
|
class: "list-page-operation",
|
|
166
172
|
onHeightChange: re
|
|
167
173
|
}, {
|
|
168
174
|
default: h(() => [
|
|
169
|
-
|
|
175
|
+
g(e.$slots, "operation", {}, void 0, !0)
|
|
170
176
|
]),
|
|
171
177
|
_: 3
|
|
172
|
-
})) :
|
|
173
|
-
|
|
178
|
+
})) : T("", !0),
|
|
179
|
+
q(a(Se), y({
|
|
174
180
|
ref_key: "tableMain",
|
|
175
181
|
ref: c,
|
|
176
182
|
"is-auto-refresh": m.value,
|
|
177
183
|
"onUpdate:isAutoRefresh": t[0] || (t[0] = (r) => m.value = r),
|
|
178
|
-
api:
|
|
179
|
-
columns:
|
|
184
|
+
api: i.api,
|
|
185
|
+
columns: i.columns,
|
|
180
186
|
query: a(z),
|
|
181
|
-
maxHeight: a(
|
|
187
|
+
maxHeight: a(Y),
|
|
182
188
|
rowKey: a(ne)
|
|
183
|
-
},
|
|
189
|
+
}, i.tableMainProps, {
|
|
184
190
|
refine: !1,
|
|
185
191
|
injectInfo: a(se),
|
|
186
192
|
onLoadingChange: ee,
|
|
187
193
|
onDataChange: Z,
|
|
188
194
|
onPageInfoChange: _
|
|
189
|
-
}),
|
|
195
|
+
}), x({
|
|
190
196
|
"custom-view-item": h((r) => [
|
|
191
|
-
|
|
197
|
+
g(e.$slots, "custom-view-item", S(b(r)), void 0, !0)
|
|
192
198
|
]),
|
|
193
199
|
_: 2
|
|
194
200
|
}, [
|
|
195
|
-
|
|
201
|
+
H(i.columns, (r) => ({
|
|
196
202
|
name: r.prop,
|
|
197
203
|
fn: h((l) => [
|
|
198
|
-
|
|
204
|
+
g(e.$slots, `table-${r.prop}`, S(b(ie(l))), void 0, !0)
|
|
199
205
|
])
|
|
200
206
|
})),
|
|
201
|
-
|
|
207
|
+
H(i.columns, (r) => ({
|
|
202
208
|
name: `header-${r.prop}`,
|
|
203
209
|
fn: h((l) => {
|
|
204
210
|
var d;
|
|
205
211
|
return [
|
|
206
|
-
|
|
207
|
-
searchFormData: a(
|
|
208
|
-
triggerSearch: (d = a(
|
|
212
|
+
g(e.$slots, `table-header-${r.columnKey || r.prop}`, y(le(l), {
|
|
213
|
+
searchFormData: a(V),
|
|
214
|
+
triggerSearch: (d = a(s)) == null ? void 0 : d.triggerSearch
|
|
209
215
|
}), void 0, !0)
|
|
210
216
|
];
|
|
211
217
|
})
|
|
212
218
|
}))
|
|
213
219
|
]), 1040, ["is-auto-refresh", "api", "columns", "query", "maxHeight", "rowKey", "injectInfo"])
|
|
214
220
|
])), [
|
|
215
|
-
[
|
|
221
|
+
[f, !m.value && a(F)]
|
|
216
222
|
]);
|
|
217
223
|
};
|
|
218
224
|
}
|
|
219
225
|
});
|
|
220
226
|
export {
|
|
221
|
-
|
|
227
|
+
Oe as default
|
|
222
228
|
};
|