@done-coding/admin-core 0.0.1-alpha.0 → 0.0.1-alpha.1
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/components/form/FormMain.vue.mjs +65 -61
- package/es/components/form/FormSearch.vue2.mjs +24 -23
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +92 -85
- package/es/components/modal/DetailModal.vue.mjs +31 -29
- package/es/components/table/TableMain.vue.mjs +2 -2
- package/es/components/table/TableMain.vue2.mjs +65 -61
- package/es/style.css +1 -1
- package/package.json +3 -3
- package/types/components/form/FormMain.vue.d.ts +3 -0
- package/types/components/form/types.d.ts +1 -0
- package/types/components/list-page/ListPage.vue.d.ts +16 -2
- package/types/components/modal/types.d.ts +2 -0
- package/types/components/table/TableMain.vue.d.ts +10 -0
|
@@ -1,94 +1,98 @@
|
|
|
1
|
-
import { ElForm as
|
|
1
|
+
import { ElForm as M, ElRow as A, ElCol as B } from "element-plus/es";
|
|
2
2
|
import "element-plus/es/components/base/style/css";
|
|
3
3
|
import "element-plus/es/components/form/style/css";
|
|
4
4
|
import "element-plus/es/components/row/style/css";
|
|
5
5
|
import "element-plus/es/components/col/style/css";
|
|
6
|
-
import { defineComponent as
|
|
6
|
+
import { defineComponent as H, shallowRef as N, ref as _, computed as i, provide as P, watch as h, openBlock as p, createBlock as L, unref as y, withCtx as m, createVNode as O, createElementBlock as D, Fragment as T, renderList as q, withDirectives as z, mergeProps as V, renderSlot as j, vShow as J } from "vue";
|
|
7
7
|
import Q from "./FormItem.vue.mjs";
|
|
8
8
|
import { FORM_ITEM_CHANGE_LOADING as U } from "./utils.mjs";
|
|
9
|
-
const ue = /* @__PURE__ */
|
|
9
|
+
const ue = /* @__PURE__ */ H({
|
|
10
10
|
name: "FormMain",
|
|
11
11
|
inheritAttrs: !0,
|
|
12
12
|
__name: "FormMain",
|
|
13
13
|
props: {
|
|
14
14
|
list: {},
|
|
15
15
|
data: {},
|
|
16
|
-
layout: {}
|
|
16
|
+
layout: {},
|
|
17
|
+
rowGutter: { default: 0 }
|
|
17
18
|
},
|
|
18
19
|
emits: ["loadingChange", "visibleChange", "submit"],
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
(e) =>
|
|
22
|
-
)), R = i(() =>
|
|
23
|
-
|
|
20
|
+
setup(f, { expose: S, emit: x }) {
|
|
21
|
+
const d = f, v = x, a = N(), c = _([]), u = _({}), b = i(() => !!c.value.length), w = i(() => Object.keys(u.value).filter(
|
|
22
|
+
(e) => u.value[e]
|
|
23
|
+
)), R = i(() => d.list.filter((e) => !w.value.includes(e.key))), $ = i(() => R.value.length > 0), G = (e) => e;
|
|
24
|
+
S({
|
|
24
25
|
validate: () => a.value ? new Promise((e, t) => {
|
|
25
|
-
var
|
|
26
|
-
(
|
|
27
|
-
if (
|
|
26
|
+
var l;
|
|
27
|
+
(l = a.value) == null || l.validate((r, s) => {
|
|
28
|
+
if (r)
|
|
28
29
|
e();
|
|
29
30
|
else {
|
|
30
|
-
const
|
|
31
|
-
Object.keys(
|
|
31
|
+
const o = { ...s || {} };
|
|
32
|
+
Object.keys(o).forEach((n) => {
|
|
32
33
|
var C;
|
|
33
|
-
|
|
34
|
-
}), Object.keys(
|
|
34
|
+
w.value.includes(n) && (console.log(`当前${n}被隐藏,移除校验`, o[n]), delete o[n], (C = a.value) == null || C.clearValidate(n));
|
|
35
|
+
}), Object.keys(o).length === 0 ? e() : t(s);
|
|
35
36
|
}
|
|
36
37
|
});
|
|
37
38
|
}) : Promise.reject(new Error("实例化未完成")),
|
|
38
39
|
resetFields: () => a.value ? a.value.resetFields() : console.error("实例化未完成"),
|
|
39
40
|
clearValidate: (e) => a.value ? a.value.clearValidate(e) : console.error("实例化未完成")
|
|
40
41
|
});
|
|
41
|
-
const g = i(() =>
|
|
42
|
-
data:
|
|
42
|
+
const g = i(() => d.list), k = i(() => g.value.reduce((e, t) => (t.rules && (typeof t.rules == "function" ? e[t.key] = t.rules({
|
|
43
|
+
data: d.data,
|
|
43
44
|
config: t
|
|
44
|
-
}) : e[t.key] = t.rules), e), {})),
|
|
45
|
+
}) : e[t.key] = t.rules), e), {})), F = i(() => c.value.reduce(
|
|
45
46
|
(e, t) => (e[t.key] = [
|
|
46
47
|
{
|
|
47
48
|
validator: () => [new Error(`${t.label}${t.message}`)]
|
|
48
49
|
}
|
|
49
50
|
], e),
|
|
50
51
|
{}
|
|
51
|
-
)),
|
|
52
|
-
const e = Object.keys(
|
|
53
|
-
return [...new Set(e.concat(t))].reduce((
|
|
54
|
-
...
|
|
55
|
-
...
|
|
56
|
-
],
|
|
52
|
+
)), I = i(() => {
|
|
53
|
+
const e = Object.keys(k.value), t = Object.keys(F.value);
|
|
54
|
+
return [...new Set(e.concat(t))].reduce((r, s) => (r[s] = [
|
|
55
|
+
...k.value[s] || [],
|
|
56
|
+
...F.value[s] || []
|
|
57
|
+
], r), {});
|
|
57
58
|
});
|
|
58
|
-
|
|
59
|
+
P(U, ({ key: e, message: t }) => {
|
|
59
60
|
if (!e)
|
|
60
61
|
return console.error("更新状态未传入key, 此处忽略");
|
|
61
|
-
const
|
|
62
|
-
|
|
62
|
+
const l = c.value.findIndex((r) => r.key === e);
|
|
63
|
+
l === -1 ? t && c.value.push({
|
|
63
64
|
key: e,
|
|
64
65
|
message: t,
|
|
65
|
-
label:
|
|
66
|
-
}) : t ?
|
|
66
|
+
label: d.list.find((r) => r.key === e).label
|
|
67
|
+
}) : t ? c.value.splice(l, 1, {
|
|
67
68
|
key: e,
|
|
68
69
|
message: t,
|
|
69
|
-
label:
|
|
70
|
-
}) :
|
|
70
|
+
label: d.list.find((r) => r.key === e).label
|
|
71
|
+
}) : c.value.splice(l, 1);
|
|
71
72
|
});
|
|
72
|
-
const
|
|
73
|
+
const K = ({
|
|
73
74
|
status: e,
|
|
74
75
|
config: { key: t }
|
|
75
76
|
}) => {
|
|
76
|
-
(
|
|
77
|
-
},
|
|
78
|
-
...
|
|
77
|
+
(u.value[t] || !1) !== e && (u.value[t] = e);
|
|
78
|
+
}, E = (e) => ({
|
|
79
|
+
...d.layout || {},
|
|
79
80
|
...e || {}
|
|
80
81
|
});
|
|
81
|
-
return
|
|
82
|
+
return h(
|
|
82
83
|
g,
|
|
83
|
-
() => {
|
|
84
|
-
|
|
84
|
+
(e) => {
|
|
85
|
+
const t = e.map((l) => l.key);
|
|
86
|
+
Object.keys(u.value).forEach((l) => {
|
|
87
|
+
t.includes(l) || delete u.value[l];
|
|
88
|
+
});
|
|
85
89
|
},
|
|
86
90
|
{
|
|
87
91
|
immediate: !0
|
|
88
92
|
}
|
|
89
|
-
),
|
|
93
|
+
), h(b, () => {
|
|
90
94
|
v("loadingChange", b.value);
|
|
91
|
-
}),
|
|
95
|
+
}), h(
|
|
92
96
|
$,
|
|
93
97
|
(e) => {
|
|
94
98
|
v("visibleChange", e);
|
|
@@ -97,40 +101,40 @@ const ue = /* @__PURE__ */ N({
|
|
|
97
101
|
immediate: !0
|
|
98
102
|
}
|
|
99
103
|
), (e, t) => {
|
|
100
|
-
const
|
|
101
|
-
return
|
|
104
|
+
const l = B, r = A, s = M;
|
|
105
|
+
return p(), L(s, {
|
|
102
106
|
ref_key: "elForm",
|
|
103
107
|
ref: a,
|
|
104
|
-
model:
|
|
105
|
-
rules: y(
|
|
108
|
+
model: f.data,
|
|
109
|
+
rules: y(I)
|
|
106
110
|
}, {
|
|
107
|
-
default:
|
|
108
|
-
|
|
109
|
-
default:
|
|
110
|
-
(
|
|
111
|
-
key:
|
|
112
|
-
}, { ref_for: !0 },
|
|
113
|
-
default:
|
|
114
|
-
|
|
115
|
-
data:
|
|
116
|
-
config:
|
|
117
|
-
onViewHideChange:
|
|
111
|
+
default: m(() => [
|
|
112
|
+
O(r, { gutter: f.rowGutter }, {
|
|
113
|
+
default: m(() => [
|
|
114
|
+
(p(!0), D(T, null, q(y(g), (o) => z((p(), L(l, V({
|
|
115
|
+
key: o.key
|
|
116
|
+
}, { ref_for: !0 }, E(o.layout)), {
|
|
117
|
+
default: m(() => [
|
|
118
|
+
O(Q, {
|
|
119
|
+
data: f.data,
|
|
120
|
+
config: G(o),
|
|
121
|
+
onViewHideChange: K,
|
|
118
122
|
onSubmit: t[0] || (t[0] = (n) => v("submit", n))
|
|
119
123
|
}, {
|
|
120
|
-
default:
|
|
121
|
-
|
|
124
|
+
default: m((n) => [
|
|
125
|
+
j(e.$slots, o.key, V({ ref_for: !0 }, n))
|
|
122
126
|
]),
|
|
123
127
|
_: 2
|
|
124
128
|
}, 1032, ["data", "config"])
|
|
125
129
|
]),
|
|
126
130
|
_: 2
|
|
127
131
|
}, 1040)), [
|
|
128
|
-
[J, !(y(
|
|
132
|
+
[J, !(y(u)[o.key] ?? !1)]
|
|
129
133
|
])), 128)),
|
|
130
|
-
|
|
134
|
+
j(e.$slots, "default", { mergeLayout: E })
|
|
131
135
|
]),
|
|
132
136
|
_: 3
|
|
133
|
-
})
|
|
137
|
+
}, 8, ["gutter"])
|
|
134
138
|
]),
|
|
135
139
|
_: 3
|
|
136
140
|
}, 8, ["model", "rules"]);
|
|
@@ -3,7 +3,7 @@ import { ElCol as k, ElButton as M } 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 { defineComponent as B, useAttrs as R, ref as W, computed as $, shallowRef as D, openBlock as N, createBlock as Q, normalizeClass as z, unref as i, withCtx as r, withDirectives as A, createVNode as m, mergeProps as
|
|
6
|
+
import { defineComponent as B, useAttrs as R, ref as W, computed as $, shallowRef as D, openBlock as N, createBlock as Q, normalizeClass as z, unref as i, withCtx as r, withDirectives as A, createVNode as m, mergeProps as G, createSlots as H, normalizeProps as g, guardReactiveProps as v, createElementVNode as L, createTextVNode as y, renderList as T, renderSlot as j, vShow as q } from "vue";
|
|
7
7
|
import { stringifyFormData as I } from "./utils.mjs";
|
|
8
8
|
import J from "../display/WatchSize.vue.mjs";
|
|
9
9
|
const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
|
|
@@ -22,21 +22,22 @@ const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
|
|
|
22
22
|
md: 12,
|
|
23
23
|
lg: 8,
|
|
24
24
|
xl: 6
|
|
25
|
-
}) }
|
|
25
|
+
}) },
|
|
26
|
+
rowGutter: {}
|
|
26
27
|
},
|
|
27
28
|
emits: ["search", "heightChange", "visibleChange"],
|
|
28
|
-
setup(
|
|
29
|
-
const s =
|
|
29
|
+
setup(a, { expose: b, emit: w }) {
|
|
30
|
+
const s = a, l = w, C = R(), u = W(!1), x = $(() => s.data), S = (e) => {
|
|
30
31
|
l("heightChange", e);
|
|
31
|
-
},
|
|
32
|
+
}, o = D(), d = (e) => ({
|
|
32
33
|
...s.staticQuery || {},
|
|
33
34
|
...I(e, s.list)
|
|
34
35
|
}), h = () => {
|
|
35
36
|
var e;
|
|
36
|
-
(e =
|
|
37
|
+
(e = o.value) == null || e.resetFields(), l("search", d(s.data), "reset");
|
|
37
38
|
}, c = (e = "search") => {
|
|
38
39
|
var t;
|
|
39
|
-
(t =
|
|
40
|
+
(t = o.value) == null || t.validate().then(() => {
|
|
40
41
|
l("search", d(s.data), e);
|
|
41
42
|
});
|
|
42
43
|
}, F = (e) => {
|
|
@@ -44,17 +45,17 @@ const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
|
|
|
44
45
|
};
|
|
45
46
|
b({
|
|
46
47
|
validate: () => {
|
|
47
|
-
if (
|
|
48
|
-
return
|
|
48
|
+
if (o.value)
|
|
49
|
+
return o.value.validate();
|
|
49
50
|
throw new Error("实例化未完成");
|
|
50
51
|
},
|
|
51
52
|
resetFields: () => {
|
|
52
53
|
var e;
|
|
53
|
-
return (e =
|
|
54
|
+
return (e = o.value) == null ? void 0 : e.resetFields();
|
|
54
55
|
},
|
|
55
56
|
clearValidate: (e) => {
|
|
56
57
|
var t;
|
|
57
|
-
return (t =
|
|
58
|
+
return (t = o.value) == null ? void 0 : t.clearValidate(e);
|
|
58
59
|
},
|
|
59
60
|
triggerReset: h,
|
|
60
61
|
triggerSearch: () => c()
|
|
@@ -71,22 +72,22 @@ const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
|
|
|
71
72
|
onHeightChange: S
|
|
72
73
|
}, {
|
|
73
74
|
default: r(() => [
|
|
74
|
-
A(m(E,
|
|
75
|
+
A(m(E, G({
|
|
75
76
|
ref_key: "formMain",
|
|
76
|
-
ref:
|
|
77
|
-
list:
|
|
77
|
+
ref: o,
|
|
78
|
+
list: a.list,
|
|
78
79
|
data: i(x)
|
|
79
|
-
}, i(
|
|
80
|
-
layout:
|
|
81
|
-
labelPosition:
|
|
82
|
-
labelWidth:
|
|
80
|
+
}, i(C), {
|
|
81
|
+
layout: a.layout,
|
|
82
|
+
labelPosition: a.labelPosition,
|
|
83
|
+
labelWidth: a.labelWidth,
|
|
83
84
|
onSubmit: F,
|
|
84
85
|
onVisibleChange: _
|
|
85
|
-
}),
|
|
86
|
+
}), H({
|
|
86
87
|
default: r(({ mergeLayout: n }) => [
|
|
87
88
|
m(P, g(v(n())), {
|
|
88
89
|
default: r(() => [
|
|
89
|
-
|
|
90
|
+
L("div", K, [
|
|
90
91
|
m(f, {
|
|
91
92
|
type: "primary",
|
|
92
93
|
onMousedown: h
|
|
@@ -112,14 +113,14 @@ const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
|
|
|
112
113
|
]),
|
|
113
114
|
_: 2
|
|
114
115
|
}, [
|
|
115
|
-
|
|
116
|
+
T(a.list, (n) => ({
|
|
116
117
|
name: n.key,
|
|
117
118
|
fn: r((p) => [
|
|
118
|
-
|
|
119
|
+
j(e.$slots, n.key, g(v(p)), void 0, !0)
|
|
119
120
|
])
|
|
120
121
|
}))
|
|
121
122
|
]), 1040, ["list", "data", "layout", "labelPosition", "labelWidth"]), [
|
|
122
|
-
[
|
|
123
|
+
[q, i(u)]
|
|
123
124
|
])
|
|
124
125
|
]),
|
|
125
126
|
_: 3
|
|
@@ -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-c9564dc7"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ElLoadingDirective as
|
|
1
|
+
import { ElLoadingDirective as Z } 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
|
|
5
|
-
import
|
|
6
|
-
import { generateFormData as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { BODY_CONTENT_VIEWPORT_HEIGHT as
|
|
12
|
-
const
|
|
4
|
+
import { defineComponent as ee, useCssVars as te, unref as r, ref as u, shallowRef as R, inject as re, computed as o, watch as ae, withDirectives as ne, openBlock as j, createElementBlock as oe, createVNode as k, mergeProps as v, createSlots as F, renderList as y, withCtx as h, renderSlot as m, normalizeProps as T, guardReactiveProps as $, createBlock as se, createCommentVNode as ie } from "vue";
|
|
5
|
+
import le from "../form/FormSearch.vue.mjs";
|
|
6
|
+
import { generateFormData as ce, stringifyFormData as ue } from "../form/utils.mjs";
|
|
7
|
+
import fe from "../display/WatchSize.vue.mjs";
|
|
8
|
+
import ge from "../table/TableMain.vue.mjs";
|
|
9
|
+
import he from "lodash/pick";
|
|
10
|
+
import me from "lodash/cloneDeep";
|
|
11
|
+
import { BODY_CONTENT_VIEWPORT_HEIGHT as de } from "../../inject/key.mjs";
|
|
12
|
+
const pe = {
|
|
13
13
|
"element-loading-background": "rgba(122, 122, 122, 0.5)",
|
|
14
14
|
class: "list-page"
|
|
15
|
-
},
|
|
15
|
+
}, Re = /* @__PURE__ */ ee({
|
|
16
16
|
__name: "ListPage",
|
|
17
17
|
props: {
|
|
18
18
|
staticQuery: { default: () => ({}) },
|
|
@@ -30,50 +30,55 @@ const he = {
|
|
|
30
30
|
beforeSearch: {},
|
|
31
31
|
clearTableFilterOnReset: { type: Boolean }
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
emits: ["dataChange", "pageInfoChange"],
|
|
34
|
+
setup(s, { expose: M, emit: x }) {
|
|
35
|
+
te((e) => ({
|
|
36
|
+
f49642f0: r(N)
|
|
36
37
|
}));
|
|
37
|
-
const a = s, d =
|
|
38
|
+
const a = s, S = x, d = u({}), p = u(
|
|
38
39
|
{}
|
|
39
|
-
),
|
|
40
|
-
|
|
40
|
+
), b = u(!1), i = R(), c = R(), E = re(
|
|
41
|
+
de,
|
|
41
42
|
500
|
|
42
|
-
),
|
|
43
|
+
), C = u(0), H = u(0), V = o(() => ({
|
|
43
44
|
...p.value,
|
|
44
45
|
...a.staticQuery
|
|
45
|
-
})), w =
|
|
46
|
-
|
|
46
|
+
})), w = u(!1), B = o(() => w.value ? C.value + 10 : 0), K = o(() => a.showOperation ? H.value + 10 : 0), I = o(() => E.value - a.refineReduceHeight), N = o(() => a.refine ? `${I.value}px` : "auto"), q = o(() => a.refine ? Math.max(
|
|
47
|
+
I.value - B.value - K.value,
|
|
47
48
|
200
|
|
48
|
-
) : void 0),
|
|
49
|
-
var
|
|
49
|
+
) : void 0), P = (e, t = "search") => {
|
|
50
|
+
var n, l, g;
|
|
50
51
|
let f = e;
|
|
51
52
|
if (a.beforeSearch && (f = a.beforeSearch(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
)),
|
|
55
|
-
return ["reset", "search"].includes(
|
|
53
|
+
me(e),
|
|
54
|
+
t
|
|
55
|
+
)), t === "reset" && a.clearTableFilterOnReset && ((l = (n = c.value) == null ? void 0 : n.getTableInstance()) == null || l.clearFilter()), JSON.stringify(f) === JSON.stringify(p.value))
|
|
56
|
+
return ["reset", "search"].includes(t) ? (g = c.value) == null ? void 0 : g.reload() : void 0;
|
|
56
57
|
p.value = {
|
|
57
58
|
...f
|
|
58
59
|
};
|
|
59
|
-
}, N = (e) => {
|
|
60
|
-
S.value = e;
|
|
61
|
-
}, q = (e) => {
|
|
62
|
-
b.value = e;
|
|
63
60
|
}, L = (e) => {
|
|
61
|
+
S("dataChange", e);
|
|
62
|
+
}, A = (e) => {
|
|
63
|
+
S("pageInfoChange", e);
|
|
64
|
+
}, _ = (e) => {
|
|
65
|
+
b.value = e;
|
|
66
|
+
}, J = (e) => {
|
|
67
|
+
C.value = e;
|
|
68
|
+
}, Q = (e) => {
|
|
64
69
|
H.value = e;
|
|
65
|
-
},
|
|
70
|
+
}, z = o(() => a.list), G = o(() => a.rowKey), D = o(() => d.value), O = {
|
|
66
71
|
refresh: (e = !1) => {
|
|
67
|
-
var
|
|
68
|
-
return (
|
|
72
|
+
var t;
|
|
73
|
+
return (t = c.value) == null ? void 0 : t.refresh(e);
|
|
69
74
|
},
|
|
70
75
|
reload: (e = !1) => {
|
|
71
|
-
var
|
|
72
|
-
return (
|
|
76
|
+
var t;
|
|
77
|
+
return (t = c.value) == null ? void 0 : t.reload(e);
|
|
73
78
|
},
|
|
74
79
|
getTableInstance: () => {
|
|
75
80
|
var e;
|
|
76
|
-
return (e =
|
|
81
|
+
return (e = c.value) == null ? void 0 : e.getTableInstance();
|
|
77
82
|
},
|
|
78
83
|
validate: () => {
|
|
79
84
|
if (i.value)
|
|
@@ -85,8 +90,8 @@ const he = {
|
|
|
85
90
|
return (e = i.value) == null ? void 0 : e.resetFields();
|
|
86
91
|
},
|
|
87
92
|
clearValidate: (e) => {
|
|
88
|
-
var
|
|
89
|
-
return (
|
|
93
|
+
var t;
|
|
94
|
+
return (t = i.value) == null ? void 0 : t.clearValidate(e);
|
|
90
95
|
},
|
|
91
96
|
triggerReset: () => {
|
|
92
97
|
var e;
|
|
@@ -96,11 +101,11 @@ const he = {
|
|
|
96
101
|
var e;
|
|
97
102
|
return (e = i.value) == null ? void 0 : e.triggerSearch();
|
|
98
103
|
},
|
|
99
|
-
update: (e,
|
|
100
|
-
d.value[e] =
|
|
104
|
+
update: (e, t) => {
|
|
105
|
+
d.value[e] = t;
|
|
101
106
|
}
|
|
102
|
-
},
|
|
103
|
-
const e =
|
|
107
|
+
}, W = o(() => {
|
|
108
|
+
const e = he(O, [
|
|
104
109
|
"triggerReset",
|
|
105
110
|
"triggerSearch",
|
|
106
111
|
"update"
|
|
@@ -109,86 +114,88 @@ const he = {
|
|
|
109
114
|
...a.injectInfo || {},
|
|
110
115
|
...e
|
|
111
116
|
};
|
|
112
|
-
}),
|
|
117
|
+
}), Y = (e) => e, U = (e) => e, X = (e) => {
|
|
113
118
|
w.value = e;
|
|
114
119
|
};
|
|
115
|
-
return
|
|
120
|
+
return M(O), ae(
|
|
116
121
|
() => a.list,
|
|
117
122
|
(e) => {
|
|
118
|
-
const
|
|
119
|
-
d.value =
|
|
123
|
+
const t = ce(e);
|
|
124
|
+
d.value = t, P(ue(t, e));
|
|
120
125
|
},
|
|
121
126
|
{
|
|
122
127
|
immediate: !0
|
|
123
128
|
}
|
|
124
|
-
), (e,
|
|
125
|
-
const f =
|
|
126
|
-
return
|
|
127
|
-
|
|
129
|
+
), (e, t) => {
|
|
130
|
+
const f = Z;
|
|
131
|
+
return ne((j(), oe("div", pe, [
|
|
132
|
+
k(r(le), v({
|
|
128
133
|
ref_key: "formSearch",
|
|
129
134
|
ref: i,
|
|
130
|
-
list:
|
|
131
|
-
data:
|
|
135
|
+
list: r(z),
|
|
136
|
+
data: r(D)
|
|
132
137
|
}, s.formSearchProps, {
|
|
133
|
-
onSearch:
|
|
134
|
-
onHeightChange:
|
|
135
|
-
onVisibleChange:
|
|
136
|
-
}),
|
|
137
|
-
y(s.list, (
|
|
138
|
-
name:
|
|
139
|
-
fn:
|
|
140
|
-
m(e.$slots, `form-${
|
|
138
|
+
onSearch: P,
|
|
139
|
+
onHeightChange: J,
|
|
140
|
+
onVisibleChange: X
|
|
141
|
+
}), F({ _: 2 }, [
|
|
142
|
+
y(s.list, (n) => ({
|
|
143
|
+
name: n.key,
|
|
144
|
+
fn: h((l) => [
|
|
145
|
+
m(e.$slots, `form-${n.key}`, T($(l)), void 0, !0)
|
|
141
146
|
])
|
|
142
147
|
}))
|
|
143
148
|
]), 1040, ["list", "data"]),
|
|
144
|
-
s.showOperation ? (
|
|
149
|
+
s.showOperation ? (j(), se(r(fe), {
|
|
145
150
|
key: 0,
|
|
146
151
|
class: "list-page-operation",
|
|
147
|
-
onHeightChange:
|
|
152
|
+
onHeightChange: Q
|
|
148
153
|
}, {
|
|
149
|
-
default:
|
|
154
|
+
default: h(() => [
|
|
150
155
|
m(e.$slots, "operation", {}, void 0, !0)
|
|
151
156
|
]),
|
|
152
157
|
_: 3
|
|
153
|
-
})) :
|
|
154
|
-
|
|
158
|
+
})) : ie("", !0),
|
|
159
|
+
k(r(ge), v({
|
|
155
160
|
ref_key: "tableMain",
|
|
156
|
-
ref:
|
|
161
|
+
ref: c,
|
|
157
162
|
api: s.api,
|
|
158
163
|
columns: s.columns,
|
|
159
|
-
query:
|
|
160
|
-
maxHeight:
|
|
161
|
-
rowKey:
|
|
164
|
+
query: r(V),
|
|
165
|
+
maxHeight: r(q),
|
|
166
|
+
rowKey: r(G)
|
|
162
167
|
}, s.tableMainProps, {
|
|
163
168
|
refine: !1,
|
|
164
|
-
injectInfo:
|
|
165
|
-
onLoadingChange:
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
injectInfo: r(W),
|
|
170
|
+
onLoadingChange: _,
|
|
171
|
+
onDataChange: L,
|
|
172
|
+
onPageInfoChange: A
|
|
173
|
+
}), F({ _: 2 }, [
|
|
174
|
+
y(s.columns, (n) => ({
|
|
175
|
+
name: n.prop,
|
|
176
|
+
fn: h((l) => [
|
|
177
|
+
m(e.$slots, `table-${n.prop}`, T($(Y(l))), void 0, !0)
|
|
171
178
|
])
|
|
172
179
|
})),
|
|
173
|
-
y(s.columns, (
|
|
174
|
-
name: `header-${
|
|
175
|
-
fn:
|
|
176
|
-
var
|
|
180
|
+
y(s.columns, (n) => ({
|
|
181
|
+
name: `header-${n.prop}`,
|
|
182
|
+
fn: h((l) => {
|
|
183
|
+
var g;
|
|
177
184
|
return [
|
|
178
|
-
m(e.$slots, `table-header-${
|
|
179
|
-
searchFormData:
|
|
180
|
-
triggerSearch: (
|
|
185
|
+
m(e.$slots, `table-header-${n.columnKey || n.prop}`, v(U(l), {
|
|
186
|
+
searchFormData: r(D),
|
|
187
|
+
triggerSearch: (g = r(i)) == null ? void 0 : g.triggerSearch
|
|
181
188
|
}), void 0, !0)
|
|
182
189
|
];
|
|
183
190
|
})
|
|
184
191
|
}))
|
|
185
192
|
]), 1040, ["api", "columns", "query", "maxHeight", "rowKey", "injectInfo"])
|
|
186
193
|
])), [
|
|
187
|
-
[f,
|
|
194
|
+
[f, r(b)]
|
|
188
195
|
]);
|
|
189
196
|
};
|
|
190
197
|
}
|
|
191
198
|
});
|
|
192
199
|
export {
|
|
193
|
-
|
|
200
|
+
Re as default
|
|
194
201
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { defineComponent as g, ref as A, computed as
|
|
4
|
-
import { stringifyFormData as
|
|
5
|
-
const
|
|
1
|
+
import y from "./ConfirmModal.vue.mjs";
|
|
2
|
+
import p from "../form/FormMain.vue.mjs";
|
|
3
|
+
import { defineComponent as g, ref as A, computed as l, watch as C, openBlock as M, createBlock as x, unref as s, withCtx as D, createVNode as b, mergeProps as k } from "vue";
|
|
4
|
+
import { stringifyFormData as v } from "../form/utils.mjs";
|
|
5
|
+
const B = "80px", $ = /* @__PURE__ */ g({
|
|
6
6
|
__name: "DetailModal",
|
|
7
7
|
props: {
|
|
8
8
|
data: {},
|
|
@@ -14,48 +14,50 @@ const v = "80px", W = /* @__PURE__ */ g({
|
|
|
14
14
|
editApi: {},
|
|
15
15
|
modalWidth: { default: 600 },
|
|
16
16
|
formLayout: { default: () => ({ span: 24 }) },
|
|
17
|
-
formProps: {}
|
|
17
|
+
formProps: {},
|
|
18
|
+
formRowGutter: {}
|
|
18
19
|
},
|
|
19
20
|
emits: ["update:show", "afterAdd", "afterEdit"],
|
|
20
|
-
setup(e, { emit:
|
|
21
|
-
const t = e,
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
var
|
|
25
|
-
return (
|
|
21
|
+
setup(e, { emit: f }) {
|
|
22
|
+
const t = e, r = f, d = A(), m = l(() => t.data), c = l(() => `${t.type === "add" ? "新增" : "编辑"}${t.subTitle || ""}`), u = (a) => {
|
|
23
|
+
r("update:show", a);
|
|
24
|
+
}, w = () => {
|
|
25
|
+
var a;
|
|
26
|
+
return (a = d.value) == null ? void 0 : a.validate().then(async () => {
|
|
26
27
|
var i, n;
|
|
27
|
-
const
|
|
28
|
-
console.log("confirm",
|
|
28
|
+
const o = v(t.data, t.list);
|
|
29
|
+
console.log("confirm", o), t.type === "add" ? (await ((i = t.addApi) == null ? void 0 : i.call(t, o)), r("afterAdd", o)) : (await ((n = t.editApi) == null ? void 0 : n.call(t, o)), r("afterEdit", o));
|
|
29
30
|
});
|
|
30
|
-
},
|
|
31
|
+
}, h = () => {
|
|
31
32
|
console.log("cancel");
|
|
32
33
|
};
|
|
33
34
|
return C(
|
|
34
35
|
() => t.show,
|
|
35
|
-
(
|
|
36
|
-
var
|
|
37
|
-
|
|
36
|
+
(a) => {
|
|
37
|
+
var o;
|
|
38
|
+
a || (o = d.value) == null || o.clearValidate();
|
|
38
39
|
}
|
|
39
|
-
), (
|
|
40
|
-
const i =
|
|
40
|
+
), (a, o) => {
|
|
41
|
+
const i = p, n = y;
|
|
41
42
|
return M(), x(n, {
|
|
42
|
-
title: s(
|
|
43
|
+
title: s(c),
|
|
43
44
|
show: e.show,
|
|
44
|
-
onConfirm:
|
|
45
|
-
onCancel:
|
|
45
|
+
onConfirm: w,
|
|
46
|
+
onCancel: h,
|
|
46
47
|
useLoading: "",
|
|
47
48
|
width: e.modalWidth,
|
|
48
49
|
"onUpdate:show": u
|
|
49
50
|
}, {
|
|
50
51
|
default: D(() => [
|
|
51
|
-
|
|
52
|
+
b(i, k({
|
|
52
53
|
ref_key: "formMain",
|
|
53
|
-
ref:
|
|
54
|
+
ref: d,
|
|
54
55
|
list: e.list,
|
|
55
|
-
data: s(
|
|
56
|
+
data: s(m),
|
|
56
57
|
layout: e.formLayout,
|
|
57
|
-
labelWidth:
|
|
58
|
-
|
|
58
|
+
labelWidth: B,
|
|
59
|
+
"row-gutter": e.formRowGutter
|
|
60
|
+
}, e.formProps), null, 16, ["list", "data", "layout", "row-gutter"])
|
|
59
61
|
]),
|
|
60
62
|
_: 1
|
|
61
63
|
}, 8, ["title", "show", "width"]);
|
|
@@ -63,5 +65,5 @@ const v = "80px", W = /* @__PURE__ */ g({
|
|
|
63
65
|
}
|
|
64
66
|
});
|
|
65
67
|
export {
|
|
66
|
-
|
|
68
|
+
$ as default
|
|
67
69
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TableMain.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const m = /* @__PURE__ */
|
|
3
|
+
import f from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
const m = /* @__PURE__ */ f(o, [["__scopeId", "data-v-c7f10ff2"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ElTable as
|
|
1
|
+
import { ElTable as ae, ElTableColumn as ne, ElEmpty as oe, ElPagination as ie } from "element-plus/es";
|
|
2
2
|
import "element-plus/es/components/base/style/css";
|
|
3
3
|
import "element-plus/es/components/pagination/style/css";
|
|
4
4
|
import "element-plus/es/components/table/style/css";
|
|
5
5
|
import "element-plus/es/components/empty/style/css";
|
|
6
6
|
import "element-plus/es/components/table-column/style/css";
|
|
7
|
-
import { defineComponent as le, useCssVars as se, useAttrs as ue, ref as p, shallowRef as fe, inject as pe, computed as _, onMounted as ge, onActivated as de, watch as g, openBlock as
|
|
7
|
+
import { defineComponent as le, useCssVars as se, useAttrs as ue, ref as p, shallowRef as fe, inject as pe, computed as _, onMounted as ge, onActivated as de, watch as g, openBlock as i, createElementBlock as m, createVNode as L, mergeProps as d, unref as u, withCtx as S, Fragment as C, renderList as ce, createBlock as E, createSlots as me, renderSlot as j, resolveDynamicComponent as A, createTextVNode as P, toDisplayString as J, withDirectives as he, createElementVNode as ye, isRef as B, vShow as ve } from "vue";
|
|
8
8
|
import $ from "lodash/cloneDeep";
|
|
9
9
|
import M from "lodash/omit";
|
|
10
10
|
import V from "lodash/set";
|
|
11
11
|
import Y from "lodash/get";
|
|
12
12
|
import { BODY_CONTENT_VIEWPORT_HEIGHT as _e } from "../../inject/key.mjs";
|
|
13
13
|
import { APP_API_LIST_MODEL_KEY_CONFIG as b } from "../../config/list-model.mjs";
|
|
14
|
-
const Se = { class: "table-main" },
|
|
14
|
+
const Se = { class: "table-main" }, Ce = { class: "table-main-pagination" }, Ke = /* @__PURE__ */ le({
|
|
15
15
|
__name: "TableMain",
|
|
16
16
|
props: {
|
|
17
17
|
showPager: { type: Boolean, default: !0 },
|
|
@@ -29,104 +29,108 @@ const Se = { class: "table-main" }, Ee = { class: "table-main-pagination" }, Ke
|
|
|
29
29
|
refineReduceHeight: { default: 0 },
|
|
30
30
|
injectInfo: {}
|
|
31
31
|
},
|
|
32
|
-
emits: ["pageChange", "pageSizeChange", "dataChange", "loadingChange"],
|
|
32
|
+
emits: ["pageChange", "pageSizeChange", "dataChange", "loadingChange", "pageInfoChange"],
|
|
33
33
|
setup(f, { expose: G, emit: q }) {
|
|
34
34
|
se((e) => ({
|
|
35
|
-
|
|
35
|
+
d46c1602: e.headerColor
|
|
36
36
|
}));
|
|
37
|
-
const
|
|
37
|
+
const a = f, c = q, D = ue(), w = p([]), x = p(0), o = p(0), n = p(1), h = p(!1), I = p(!1), T = fe(), F = pe(
|
|
38
38
|
_e,
|
|
39
39
|
500
|
|
40
|
-
),
|
|
41
|
-
const { maxHeight: e, refine: t } =
|
|
42
|
-
return e ? Math.max(e -
|
|
43
|
-
F.value -
|
|
40
|
+
), O = _(() => a.showPager ? 35 : 0), U = _(() => {
|
|
41
|
+
const { maxHeight: e, refine: t } = a;
|
|
42
|
+
return e ? Math.max(e - O.value, 200) : t ? Math.max(
|
|
43
|
+
F.value - O.value - a.refineReduceHeight,
|
|
44
44
|
200
|
|
45
45
|
) : void 0;
|
|
46
46
|
}), y = _(() => {
|
|
47
|
-
const e = $(
|
|
48
|
-
return V(e, b.PAGE_SIZE_KEY,
|
|
47
|
+
const e = $(a.query || {});
|
|
48
|
+
return V(e, b.PAGE_SIZE_KEY, o.value), V(
|
|
49
49
|
e,
|
|
50
50
|
b.CURRENT_PAGE_KEY,
|
|
51
|
-
|
|
51
|
+
n.value
|
|
52
52
|
), e;
|
|
53
53
|
}), W = _(() => ({
|
|
54
|
-
...
|
|
54
|
+
...a.tableProps,
|
|
55
55
|
...D
|
|
56
|
-
})),
|
|
56
|
+
})), z = (e, t = !0) => {
|
|
57
57
|
const l = JSON.stringify(e) === JSON.stringify(y.value);
|
|
58
58
|
return !l && t && console.warn(
|
|
59
59
|
`同一地方 并发请求 参数冰花 当前不是最新的参数 丢弃结果 ${JSON.stringify(
|
|
60
60
|
e
|
|
61
61
|
)} => ${JSON.stringify(y.value)}`
|
|
62
62
|
), l;
|
|
63
|
-
},
|
|
64
|
-
if (!
|
|
65
|
-
h.value ? console.warn("请求并发") : h.value = !0, e || (
|
|
63
|
+
}, N = (e = !1) => {
|
|
64
|
+
if (!o.value) return;
|
|
65
|
+
h.value ? console.warn("请求并发") : h.value = !0, e || (I.value = !0);
|
|
66
66
|
const t = $(y.value);
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
a.api(t).then((l) => {
|
|
68
|
+
z(t, !1) && (w.value = Y(
|
|
69
69
|
l,
|
|
70
70
|
b.LIST_KEY
|
|
71
|
-
),
|
|
71
|
+
), x.value = Y(
|
|
72
72
|
l,
|
|
73
73
|
b.TOTAL_KEY
|
|
74
|
-
)
|
|
74
|
+
), c("pageInfoChange", {
|
|
75
|
+
pageSize: o.value,
|
|
76
|
+
currentPage: n.value,
|
|
77
|
+
total: x.value
|
|
78
|
+
}));
|
|
75
79
|
}).finally(() => {
|
|
76
|
-
|
|
80
|
+
z(t) && (h.value = !1, I.value = !1);
|
|
77
81
|
});
|
|
78
|
-
},
|
|
79
|
-
|
|
82
|
+
}, k = (e = !1) => {
|
|
83
|
+
N(e);
|
|
80
84
|
}, Z = (e = !1) => {
|
|
81
|
-
|
|
85
|
+
n.value === 1 ? k(e) : n.value = 1;
|
|
82
86
|
}, Q = (e) => e, v = {
|
|
83
|
-
refresh:
|
|
87
|
+
refresh: k,
|
|
84
88
|
reload: Z,
|
|
85
|
-
getTableInstance: () =>
|
|
89
|
+
getTableInstance: () => T.value
|
|
86
90
|
}, R = (e, t = []) => ({
|
|
87
91
|
...M(e, ["render", "headerRender"].concat(t)),
|
|
88
|
-
injectInfo:
|
|
92
|
+
injectInfo: a.injectInfo || {},
|
|
89
93
|
exposeInfo: v
|
|
90
94
|
}), H = (e) => ({
|
|
91
95
|
...M(e, ["render", "headerRender"]),
|
|
92
|
-
injectInfo:
|
|
96
|
+
injectInfo: a.injectInfo || {},
|
|
93
97
|
exposeInfo: v
|
|
94
98
|
});
|
|
95
99
|
G(v);
|
|
96
100
|
const X = (e) => {
|
|
97
|
-
|
|
101
|
+
o.value = e, n.value = 1;
|
|
98
102
|
}, K = (e) => !e || e === "expand";
|
|
99
103
|
return ge(() => {
|
|
100
|
-
|
|
104
|
+
o.value = a.pageSizeInit, de(() => {
|
|
101
105
|
v.refresh();
|
|
102
106
|
});
|
|
103
107
|
}), g(w, (e) => {
|
|
104
|
-
|
|
108
|
+
c("dataChange", e);
|
|
105
109
|
}), g(
|
|
106
|
-
() =>
|
|
110
|
+
() => a.query,
|
|
107
111
|
(e, t) => {
|
|
108
|
-
JSON.stringify(e) !== JSON.stringify(t) && (
|
|
112
|
+
JSON.stringify(e) !== JSON.stringify(t) && (n.value = 1);
|
|
109
113
|
}
|
|
110
114
|
), g(
|
|
111
115
|
y,
|
|
112
116
|
(e, t) => {
|
|
113
|
-
JSON.stringify(e) !== JSON.stringify(t) &&
|
|
117
|
+
JSON.stringify(e) !== JSON.stringify(t) && N();
|
|
114
118
|
},
|
|
115
119
|
{
|
|
116
120
|
immediate: !0
|
|
117
121
|
}
|
|
118
|
-
), g(
|
|
119
|
-
|
|
120
|
-
}), g(
|
|
121
|
-
|
|
122
|
-
}), g(
|
|
123
|
-
|
|
122
|
+
), g(I, (e) => {
|
|
123
|
+
c("loadingChange", e);
|
|
124
|
+
}), g(o, (e) => {
|
|
125
|
+
c("pageSizeChange", e);
|
|
126
|
+
}), g(n, (e) => {
|
|
127
|
+
c("pageChange", e);
|
|
124
128
|
}), (e, t) => {
|
|
125
|
-
const l =
|
|
126
|
-
return
|
|
129
|
+
const l = ne, ee = oe, te = ae, re = ie;
|
|
130
|
+
return i(), m("div", Se, [
|
|
127
131
|
L(te, d({
|
|
128
132
|
ref_key: "elTable",
|
|
129
|
-
ref:
|
|
133
|
+
ref: T,
|
|
130
134
|
class: "table-main-table",
|
|
131
135
|
stripe: "",
|
|
132
136
|
border: "",
|
|
@@ -137,25 +141,25 @@ const Se = { class: "table-main" }, Ee = { class: "table-main-pagination" }, Ke
|
|
|
137
141
|
rowKey: Q(f.rowKey)
|
|
138
142
|
}), {
|
|
139
143
|
empty: S(() => [
|
|
140
|
-
u(h) ? (
|
|
141
|
-
|
|
142
|
-
], 64)) : (
|
|
144
|
+
u(h) ? (i(), m(C, { key: 0 }, [
|
|
145
|
+
P("加载中...")
|
|
146
|
+
], 64)) : (i(), E(ee, { key: 1 }))
|
|
143
147
|
]),
|
|
144
148
|
default: S(() => [
|
|
145
|
-
(
|
|
149
|
+
(i(!0), m(C, null, ce(f.columns, (r) => (i(), E(l, d({
|
|
146
150
|
key: r.columnKey || r.prop
|
|
147
151
|
}, { ref_for: !0 }, r), me({ _: 2 }, [
|
|
148
152
|
K(r.type) ? {
|
|
149
153
|
name: "default",
|
|
150
154
|
fn: S((s) => [
|
|
151
155
|
j(e.$slots, r.prop, d({ ref_for: !0 }, R(s)), () => [
|
|
152
|
-
r.render ? (
|
|
156
|
+
r.render ? (i(), E(A(r.render), d({
|
|
153
157
|
key: 0,
|
|
154
158
|
ref_for: !0
|
|
155
159
|
}, R(s, ["$index"]), {
|
|
156
160
|
_index: s.$index
|
|
157
|
-
}), null, 16, ["_index"])) : (
|
|
158
|
-
|
|
161
|
+
}), null, 16, ["_index"])) : (i(), m(C, { key: 1 }, [
|
|
162
|
+
P(J(s.row[r.prop]), 1)
|
|
159
163
|
], 64))
|
|
160
164
|
], !0)
|
|
161
165
|
]),
|
|
@@ -165,11 +169,11 @@ const Se = { class: "table-main" }, Ee = { class: "table-main-pagination" }, Ke
|
|
|
165
169
|
name: "header",
|
|
166
170
|
fn: S((s) => [
|
|
167
171
|
j(e.$slots, `header-${r.prop}`, d({ ref_for: !0 }, H(s)), () => [
|
|
168
|
-
r.headerRender ? (
|
|
172
|
+
r.headerRender ? (i(), E(A(r.headerRender), d({
|
|
169
173
|
key: 0,
|
|
170
174
|
ref_for: !0
|
|
171
|
-
}, H(s)), null, 16)) : (
|
|
172
|
-
|
|
175
|
+
}, H(s)), null, 16)) : (i(), m(C, { key: 1 }, [
|
|
176
|
+
P(J(r.label), 1)
|
|
173
177
|
], 64))
|
|
174
178
|
], !0)
|
|
175
179
|
]),
|
|
@@ -179,17 +183,17 @@ const Se = { class: "table-main" }, Ee = { class: "table-main-pagination" }, Ke
|
|
|
179
183
|
]),
|
|
180
184
|
_: 3
|
|
181
185
|
}, 16, ["maxHeight", "data", "rowKey"]),
|
|
182
|
-
he(ye("div",
|
|
186
|
+
he(ye("div", Ce, [
|
|
183
187
|
L(re, {
|
|
184
|
-
"current-page": u(
|
|
185
|
-
"onUpdate:currentPage": t[0] || (t[0] = (r) => B(
|
|
186
|
-
"page-size": u(
|
|
187
|
-
"onUpdate:pageSize": t[1] || (t[1] = (r) => B(
|
|
188
|
+
"current-page": u(n),
|
|
189
|
+
"onUpdate:currentPage": t[0] || (t[0] = (r) => B(n) ? n.value = r : null),
|
|
190
|
+
"page-size": u(o),
|
|
191
|
+
"onUpdate:pageSize": t[1] || (t[1] = (r) => B(o) ? o.value = r : null),
|
|
188
192
|
"page-sizes": f.pageSizeOptions,
|
|
189
193
|
small: "",
|
|
190
194
|
background: "",
|
|
191
195
|
layout: f.pageLayout,
|
|
192
|
-
total: u(
|
|
196
|
+
total: u(x),
|
|
193
197
|
onSizeChange: X
|
|
194
198
|
}, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total"])
|
|
195
199
|
], 512), [
|
package/es/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.form-item-tip[data-v-e889a0ed]{text-align:left;line-height:1.5;font-size:12px}.form-search_show[data-v-8896356d]{margin-bottom:10px}.form-search .btn-box[data-v-8896356d]{padding-left:20px}.form-search[data-v-8896356d] .el-col{padding-left:14px}.form-verify-image[data-v-a4baf877] .el-input__suffix-inner *{margin:0}.form-verify-image-suffix[data-v-a4baf877]{position:absolute;height:100%;border-radius:var(--el-input-border-radius, var(--el-border-radius-base));top:50%;transform:translateY(-50%);overflow:hidden;cursor:pointer}.form-verify-image-suffix-main[data-v-a4baf877]{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f4f4f4}.confirm-dialog .content[data-v-2f0c870e]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 200px)}.confirm-dialog .btn[data-v-2f0c870e]{width:150px;height:40px;border-radius:4px}.confirm-dialog .main[data-v-2f0c870e]{position:relative;text-align:center}.confirm-dialog .main .close-box[data-v-2f0c870e]{position:absolute;top:0;right:0;cursor:pointer;z-index:2}.confirm-dialog .main .shim[data-v-2f0c870e]{position:relative;z-index:1}.confirm-dialog .main .shim .title[data-v-2f0c870e]{font-size:18px;font-weight:500}.confirm-dialog .main .shim .content[data-v-2f0c870e]{font-size:16px;margin-top:15px}.confirm-dialog .main .shim .footer[data-v-2f0c870e]{display:flex;justify-content:center;align-items:center;padding-top:5px}.confirm-dialog .main .shim .footer>.btn[data-v-2f0c870e]:not(:last-child){margin-right:30px}.confirm-dialog .main .shim .footer[reverse=true][data-v-2f0c870e]{flex-direction:row-reverse}.confirm-dialog .main .shim .footer[reverse=true]>.btn[data-v-2f0c870e]:not(:last-child){margin-right:0;margin-left:30px}.confirm-dialog .el-dialog__header,.confirm-dialog .el-dialog__body{padding:0;background-color:transparent}.table-main-table[data-v-
|
|
1
|
+
.form-item-tip[data-v-e889a0ed]{text-align:left;line-height:1.5;font-size:12px}.form-search_show[data-v-8896356d]{margin-bottom:10px}.form-search .btn-box[data-v-8896356d]{padding-left:20px}.form-search[data-v-8896356d] .el-col{padding-left:14px}.form-verify-image[data-v-a4baf877] .el-input__suffix-inner *{margin:0}.form-verify-image-suffix[data-v-a4baf877]{position:absolute;height:100%;border-radius:var(--el-input-border-radius, var(--el-border-radius-base));top:50%;transform:translateY(-50%);overflow:hidden;cursor:pointer}.form-verify-image-suffix-main[data-v-a4baf877]{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f4f4f4}.confirm-dialog .content[data-v-2f0c870e]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 200px)}.confirm-dialog .btn[data-v-2f0c870e]{width:150px;height:40px;border-radius:4px}.confirm-dialog .main[data-v-2f0c870e]{position:relative;text-align:center}.confirm-dialog .main .close-box[data-v-2f0c870e]{position:absolute;top:0;right:0;cursor:pointer;z-index:2}.confirm-dialog .main .shim[data-v-2f0c870e]{position:relative;z-index:1}.confirm-dialog .main .shim .title[data-v-2f0c870e]{font-size:18px;font-weight:500}.confirm-dialog .main .shim .content[data-v-2f0c870e]{font-size:16px;margin-top:15px}.confirm-dialog .main .shim .footer[data-v-2f0c870e]{display:flex;justify-content:center;align-items:center;padding-top:5px}.confirm-dialog .main .shim .footer>.btn[data-v-2f0c870e]:not(:last-child){margin-right:30px}.confirm-dialog .main .shim .footer[reverse=true][data-v-2f0c870e]{flex-direction:row-reverse}.confirm-dialog .main .shim .footer[reverse=true]>.btn[data-v-2f0c870e]:not(:last-child){margin-right:0;margin-left:30px}.confirm-dialog .el-dialog__header,.confirm-dialog .el-dialog__body{padding:0;background-color:transparent}.table-main-table[data-v-c7f10ff2]{--el-table-header-bg-color: var(--d46c1602)}.table-main-pagination[data-v-c7f10ff2]{margin-top:10px;display:flex;justify-content:flex-end}.list-page[data-v-c9564dc7]{min-height:var(--f49642f0)}.list-page-operation[data-v-c9564dc7]{margin-bottom:10px}.list-page[data-v-c9564dc7] .el-loading-mask{left:-10px;top:-10px;right:-10px;bottom:-10px}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@done-coding/admin-core",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.1",
|
|
4
4
|
"description": "后台管理核心",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "lib/index.cjs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"predev": "dc-inject",
|
|
27
27
|
"dev": "vite build -w -m hotBuild",
|
|
28
28
|
"prebuild": "dc-inject",
|
|
29
|
-
"build": "
|
|
29
|
+
"build": "vue-tsc && vite build",
|
|
30
30
|
"prepack": "pnpm build",
|
|
31
31
|
"test": "vitest",
|
|
32
32
|
"coverage": "vitest run --coverage"
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"node": ">=18.0.0",
|
|
78
78
|
"pnpm": ">=9.0.0"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "66c74dcd8e8bb283b06a1a2515f98406fe9b0f13"
|
|
81
81
|
}
|
|
@@ -149,6 +149,7 @@ export interface FormMainProps<PO extends Record<string, any>, SO extends Record
|
|
|
149
149
|
list: FormItemConfigList<PO, SO>;
|
|
150
150
|
data: PO;
|
|
151
151
|
layout?: Partial<ColProps>;
|
|
152
|
+
rowGutter?: number;
|
|
152
153
|
}
|
|
153
154
|
/** FormSearch props */
|
|
154
155
|
export interface FormSearchProps<PO extends Record<string, any>, SO extends Record<string, any>, SQ extends Record<string, any>> extends FormMainProps<PO, SO> {
|
|
@@ -3,7 +3,14 @@ import { TableMainInstance } from '../table';
|
|
|
3
3
|
import { ListPageInnerInjectInfo, ListPageInstance } from './types';
|
|
4
4
|
|
|
5
5
|
declare const _default: <T extends Record<string, any>, PO extends Record<string, any>, SO extends Record<string, any>, SQ extends Record<string, any>, F extends Record<string, any>>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
6
|
-
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
6
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
7
|
+
readonly onDataChange?: ((data: T[]) => any) | undefined;
|
|
8
|
+
readonly onPageInfoChange?: ((info: {
|
|
9
|
+
pageSize: number;
|
|
10
|
+
currentPage: number;
|
|
11
|
+
total: number;
|
|
12
|
+
}) => any) | undefined;
|
|
13
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & (Partial<Pick<import('../form').FormSearchProps<PO, SO, {}>, "staticQuery">> & {
|
|
7
14
|
formSearchProps?: Partial<Omit<import('../form').FormSearchProps<PO, SO, {}>, "list" | "staticQuery">> | undefined;
|
|
8
15
|
} & Pick<import('../table').TableMainProps<T, import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, ListPageInnerInjectInfo<PO, F>>, import('./types').TableMainRequiredKey> & Partial<Pick<import('../table').TableMainProps<T, import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, ListPageInnerInjectInfo<PO, F>>, import('./types').TableMainOptionsKey>> & {
|
|
9
16
|
tableMainProps?: Partial<Omit<import('../table').TableMainProps<T, import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, ListPageInnerInjectInfo<PO, F>>, import('./types').TableMainOptionsKey | import('./types').TableMainRewriteKey>> | undefined;
|
|
@@ -34,7 +41,14 @@ declare const _default: <T extends Record<string, any>, PO extends Record<string
|
|
|
34
41
|
}) => any>> & {
|
|
35
42
|
operation?(_: {}): any;
|
|
36
43
|
}>;
|
|
37
|
-
emit:
|
|
44
|
+
emit: {
|
|
45
|
+
(e: "dataChange", data: T[]): void;
|
|
46
|
+
(e: "pageInfoChange", info: {
|
|
47
|
+
pageSize: number;
|
|
48
|
+
currentPage: number;
|
|
49
|
+
total: number;
|
|
50
|
+
}): void;
|
|
51
|
+
};
|
|
38
52
|
}>) => import('vue').VNode & {
|
|
39
53
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
40
54
|
};
|
|
@@ -6,6 +6,11 @@ declare const _default: <T extends Record<string, any>, SQ extends Record<string
|
|
|
6
6
|
readonly onPageChange?: ((value: number) => any) | undefined;
|
|
7
7
|
readonly onPageSizeChange?: ((value: number) => any) | undefined;
|
|
8
8
|
readonly onDataChange?: ((data: T[]) => any) | undefined;
|
|
9
|
+
readonly onPageInfoChange?: ((info: {
|
|
10
|
+
pageSize: number;
|
|
11
|
+
currentPage: number;
|
|
12
|
+
total: number;
|
|
13
|
+
}) => any) | undefined;
|
|
9
14
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & TableMainProps<T, SQ, F>, keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
10
15
|
expose(exposed: import('vue').ShallowUnwrapRef<TableMainInstance>): void;
|
|
11
16
|
attrs: any;
|
|
@@ -25,6 +30,11 @@ declare const _default: <T extends Record<string, any>, SQ extends Record<string
|
|
|
25
30
|
(e: "pageChange" | "pageSizeChange", value: number): void;
|
|
26
31
|
(e: "dataChange", data: T[]): void;
|
|
27
32
|
(e: "loadingChange", value: boolean): void;
|
|
33
|
+
(e: "pageInfoChange", info: {
|
|
34
|
+
pageSize: number;
|
|
35
|
+
currentPage: number;
|
|
36
|
+
total: number;
|
|
37
|
+
}): void;
|
|
28
38
|
};
|
|
29
39
|
}>) => import('vue').VNode & {
|
|
30
40
|
__ctx?: Awaited<typeof __VLS_setup>;
|