@done-coding/admin-core 0.1.1-alpha.5 → 0.1.1-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/form/FormItem.vue.mjs +2 -2
- package/es/components/form/FormItem.vue2.mjs +10 -7
- package/es/components/form/FormMain.vue.mjs +32 -32
- package/es/components/form/FormRadioGroup.vue.mjs +57 -20
- package/es/components/form/index.mjs +23 -26
- package/es/components/form/utils.mjs +79 -72
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +88 -90
- package/es/components/modal/DetailModal.vue.mjs +33 -32
- package/es/components/table/TableMain.vue.mjs +2 -2
- package/es/components/table/TableMain.vue2.mjs +91 -90
- package/es/components/table/TableToolbar.vue.mjs +2 -2
- package/es/components/table/TableToolbar.vue2.mjs +55 -56
- package/es/index.mjs +95 -96
- package/es/style.css +1 -1
- package/package.json +2 -2
- package/types/components/form/FormRadioGroup.vue.d.ts +31 -19
- package/types/components/form/index.d.ts +1 -2
- package/types/components/form/types.d.ts +5 -0
- package/types/components/form/utils.d.ts +7 -0
- package/types/components/list-page/ListPage.vue.d.ts +0 -2
- package/types/components/list-page/types.d.ts +0 -4
- package/types/components/modal/types.d.ts +2 -0
- package/es/components/form/FormRadio.vue.mjs +0 -69
- package/es/components/form/FormRadio.vue2.mjs +0 -4
- package/types/components/form/FormRadio.vue.d.ts +0 -35
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ElLoadingDirective as
|
|
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
|
|
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 he, useCssVars as fe, unref as r, useSlots as ge, computed as o, useModel as de, ref as u, shallowRef as T, inject as me, watch as ve, withDirectives as pe, openBlock as y, createElementBlock as ye, createBlock as O, withCtx as g, renderSlot as d, createCommentVNode as E, createVNode as V, mergeProps as H, createSlots as x, renderList as S, normalizeProps as B, guardReactiveProps as K, mergeModels as N } from "vue";
|
|
5
|
+
import He from "../form/FormSearch.vue.mjs";
|
|
6
|
+
import { generateFormData as Se, stringifyFormData as Ce } from "../form/utils.mjs";
|
|
7
|
+
import q from "../display/WatchSize.vue.mjs";
|
|
8
|
+
import be from "../table/TableMain.vue.mjs";
|
|
9
|
+
import Re from "lodash/pick";
|
|
10
|
+
import we from "lodash/cloneDeep";
|
|
11
|
+
import { BODY_CONTENT_VIEWPORT_HEIGHT as Ie } from "../../inject/key.mjs";
|
|
12
|
+
const Me = {
|
|
13
13
|
"element-loading-background": "rgba(122, 122, 122, 0.5)",
|
|
14
14
|
class: "list-page"
|
|
15
|
-
},
|
|
15
|
+
}, xe = /* @__PURE__ */ he({
|
|
16
16
|
__name: "ListPage",
|
|
17
|
-
props: /* @__PURE__ */
|
|
17
|
+
props: /* @__PURE__ */ N({
|
|
18
18
|
staticQuery: { default: () => ({}) },
|
|
19
19
|
formSearchProps: {},
|
|
20
20
|
columns: {},
|
|
@@ -22,8 +22,6 @@ const be = {
|
|
|
22
22
|
refine: { type: Boolean, default: !0 },
|
|
23
23
|
refineReduceHeight: { default: 0 },
|
|
24
24
|
tableMainProps: {},
|
|
25
|
-
showOperation: { type: Boolean, default: !1 },
|
|
26
|
-
showHeader: { type: Boolean, default: !1 },
|
|
27
25
|
list: { default: () => [] },
|
|
28
26
|
api: {},
|
|
29
27
|
query: {},
|
|
@@ -34,46 +32,46 @@ const be = {
|
|
|
34
32
|
isAutoRefresh: { type: Boolean },
|
|
35
33
|
isAutoRefreshModifiers: {}
|
|
36
34
|
}),
|
|
37
|
-
emits: /* @__PURE__ */
|
|
38
|
-
setup(
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
emits: /* @__PURE__ */ N(["dataChange", "pageInfoChange"], ["update:isAutoRefresh"]),
|
|
36
|
+
setup(s, { expose: L, emit: J }) {
|
|
37
|
+
fe((e) => ({
|
|
38
|
+
d5119b7c: r(Y)
|
|
41
39
|
}));
|
|
42
|
-
const
|
|
40
|
+
const n = s, C = J, b = ge(), R = o(() => !!b.header), w = o(() => !!b.operation), m = de(s, "isAutoRefresh"), v = u({}), p = u(
|
|
43
41
|
{}
|
|
44
|
-
),
|
|
45
|
-
|
|
42
|
+
), I = u(!1), i = T(), c = T(), Q = me(
|
|
43
|
+
Ie,
|
|
46
44
|
500
|
|
47
|
-
),
|
|
45
|
+
), M = u(0), P = u(0), j = u(0), z = o(() => ({
|
|
48
46
|
...p.value,
|
|
49
|
-
...
|
|
50
|
-
})),
|
|
51
|
-
|
|
47
|
+
...n.staticQuery
|
|
48
|
+
})), k = u(!1), G = o(() => k.value ? M.value + 10 : 0), U = o(() => w.value ? P.value + 10 : 0), W = o(() => R.value ? j.value + 10 : 0), D = o(() => Q.value - n.refineReduceHeight), Y = o(() => n.refine ? `${D.value}px` : "auto"), _ = o(() => n.refine ? Math.max(
|
|
49
|
+
D.value - G.value - U.value - W.value,
|
|
52
50
|
200
|
|
53
|
-
) : void 0),
|
|
54
|
-
var
|
|
51
|
+
) : void 0), $ = (e, t = "search") => {
|
|
52
|
+
var a, l, f;
|
|
55
53
|
let h = e;
|
|
56
|
-
if (
|
|
57
|
-
|
|
54
|
+
if (n.beforeSearch && (h = n.beforeSearch(
|
|
55
|
+
we(e),
|
|
58
56
|
t
|
|
59
|
-
)), t === "reset" &&
|
|
57
|
+
)), t === "reset" && n.clearTableFilterOnReset && ((l = (a = c.value) == null ? void 0 : a.getTableInstance()) == null || l.clearFilter()), JSON.stringify(h) === JSON.stringify(p.value))
|
|
60
58
|
return ["reset", "search"].includes(t) ? (f = c.value) == null ? void 0 : f.reload() : void 0;
|
|
61
59
|
p.value = {
|
|
62
60
|
...h
|
|
63
61
|
};
|
|
64
|
-
}, W = (e) => {
|
|
65
|
-
S("dataChange", e);
|
|
66
|
-
}, Y = (e) => {
|
|
67
|
-
S("pageInfoChange", e);
|
|
68
62
|
}, X = (e) => {
|
|
69
|
-
|
|
63
|
+
C("dataChange", e);
|
|
70
64
|
}, Z = (e) => {
|
|
71
|
-
|
|
72
|
-
}, _ = (e) => {
|
|
73
|
-
R.value = e;
|
|
65
|
+
C("pageInfoChange", e);
|
|
74
66
|
}, ee = (e) => {
|
|
75
67
|
I.value = e;
|
|
76
|
-
}, te =
|
|
68
|
+
}, te = (e) => {
|
|
69
|
+
M.value = e;
|
|
70
|
+
}, re = (e) => {
|
|
71
|
+
P.value = e;
|
|
72
|
+
}, ae = (e) => {
|
|
73
|
+
j.value = e;
|
|
74
|
+
}, oe = o(() => n.list), ne = o(() => n.rowKey), A = o(() => v.value), F = {
|
|
77
75
|
refresh: async (e = !1) => {
|
|
78
76
|
var t;
|
|
79
77
|
return (t = c.value) == null ? void 0 : t.refresh(e);
|
|
@@ -110,110 +108,110 @@ const be = {
|
|
|
110
108
|
update: (e, t) => {
|
|
111
109
|
v.value[e] = t;
|
|
112
110
|
}
|
|
113
|
-
},
|
|
114
|
-
const e =
|
|
111
|
+
}, se = o(() => {
|
|
112
|
+
const e = Re(F, [
|
|
115
113
|
"triggerReset",
|
|
116
114
|
"triggerSearch",
|
|
117
115
|
"update"
|
|
118
116
|
]);
|
|
119
117
|
return {
|
|
120
|
-
...
|
|
118
|
+
...n.injectInfo || {},
|
|
121
119
|
...e
|
|
122
120
|
};
|
|
123
|
-
}),
|
|
124
|
-
|
|
121
|
+
}), ie = (e) => e, le = (e) => e, ue = (e) => {
|
|
122
|
+
k.value = e;
|
|
125
123
|
};
|
|
126
|
-
return
|
|
127
|
-
() =>
|
|
124
|
+
return L(F), ve(
|
|
125
|
+
() => n.list,
|
|
128
126
|
(e) => {
|
|
129
|
-
const t =
|
|
130
|
-
v.value = t,
|
|
127
|
+
const t = Se(e);
|
|
128
|
+
v.value = t, $(Ce(t, e));
|
|
131
129
|
},
|
|
132
130
|
{
|
|
133
131
|
immediate: !0
|
|
134
132
|
}
|
|
135
133
|
), (e, t) => {
|
|
136
|
-
const h =
|
|
137
|
-
return
|
|
138
|
-
|
|
134
|
+
const h = ce;
|
|
135
|
+
return pe((y(), ye("div", Me, [
|
|
136
|
+
r(R) ? (y(), O(r(q), {
|
|
139
137
|
key: 0,
|
|
140
138
|
class: "list-page-header",
|
|
141
|
-
onHeightChange:
|
|
139
|
+
onHeightChange: ae
|
|
142
140
|
}, {
|
|
143
141
|
default: g(() => [
|
|
144
142
|
d(e.$slots, "header", {}, void 0, !0)
|
|
145
143
|
]),
|
|
146
144
|
_: 3
|
|
147
|
-
})) :
|
|
148
|
-
|
|
145
|
+
})) : E("", !0),
|
|
146
|
+
V(r(He), H({
|
|
149
147
|
ref_key: "formSearch",
|
|
150
148
|
ref: i,
|
|
151
|
-
list:
|
|
152
|
-
data:
|
|
153
|
-
},
|
|
154
|
-
onSearch:
|
|
155
|
-
onHeightChange:
|
|
156
|
-
onVisibleChange:
|
|
157
|
-
}),
|
|
158
|
-
|
|
159
|
-
name:
|
|
149
|
+
list: r(oe),
|
|
150
|
+
data: r(A)
|
|
151
|
+
}, s.formSearchProps, {
|
|
152
|
+
onSearch: $,
|
|
153
|
+
onHeightChange: te,
|
|
154
|
+
onVisibleChange: ue
|
|
155
|
+
}), x({ _: 2 }, [
|
|
156
|
+
S(s.list, (a) => ({
|
|
157
|
+
name: a.key,
|
|
160
158
|
fn: g((l) => [
|
|
161
|
-
d(e.$slots, `form-${
|
|
159
|
+
d(e.$slots, `form-${a.key}`, B(K(l)), void 0, !0)
|
|
162
160
|
])
|
|
163
161
|
}))
|
|
164
162
|
]), 1040, ["list", "data"]),
|
|
165
|
-
|
|
163
|
+
r(w) ? (y(), O(r(q), {
|
|
166
164
|
key: 1,
|
|
167
165
|
class: "list-page-operation",
|
|
168
|
-
onHeightChange:
|
|
166
|
+
onHeightChange: re
|
|
169
167
|
}, {
|
|
170
168
|
default: g(() => [
|
|
171
169
|
d(e.$slots, "operation", {}, void 0, !0)
|
|
172
170
|
]),
|
|
173
171
|
_: 3
|
|
174
|
-
})) :
|
|
175
|
-
|
|
172
|
+
})) : E("", !0),
|
|
173
|
+
V(r(be), H({
|
|
176
174
|
ref_key: "tableMain",
|
|
177
175
|
ref: c,
|
|
178
176
|
"is-auto-refresh": m.value,
|
|
179
|
-
"onUpdate:isAutoRefresh": t[0] || (t[0] = (
|
|
180
|
-
api:
|
|
181
|
-
columns:
|
|
182
|
-
query:
|
|
183
|
-
maxHeight:
|
|
184
|
-
rowKey:
|
|
185
|
-
},
|
|
177
|
+
"onUpdate:isAutoRefresh": t[0] || (t[0] = (a) => m.value = a),
|
|
178
|
+
api: s.api,
|
|
179
|
+
columns: s.columns,
|
|
180
|
+
query: r(z),
|
|
181
|
+
maxHeight: r(_),
|
|
182
|
+
rowKey: r(ne)
|
|
183
|
+
}, s.tableMainProps, {
|
|
186
184
|
refine: !1,
|
|
187
|
-
injectInfo:
|
|
188
|
-
onLoadingChange:
|
|
189
|
-
onDataChange:
|
|
190
|
-
onPageInfoChange:
|
|
191
|
-
}),
|
|
192
|
-
|
|
193
|
-
name:
|
|
185
|
+
injectInfo: r(se),
|
|
186
|
+
onLoadingChange: ee,
|
|
187
|
+
onDataChange: X,
|
|
188
|
+
onPageInfoChange: Z
|
|
189
|
+
}), x({ _: 2 }, [
|
|
190
|
+
S(s.columns, (a) => ({
|
|
191
|
+
name: a.prop,
|
|
194
192
|
fn: g((l) => [
|
|
195
|
-
d(e.$slots, `table-${
|
|
193
|
+
d(e.$slots, `table-${a.prop}`, B(K(ie(l))), void 0, !0)
|
|
196
194
|
])
|
|
197
195
|
})),
|
|
198
|
-
|
|
199
|
-
name: `header-${
|
|
196
|
+
S(s.columns, (a) => ({
|
|
197
|
+
name: `header-${a.prop}`,
|
|
200
198
|
fn: g((l) => {
|
|
201
199
|
var f;
|
|
202
200
|
return [
|
|
203
|
-
d(e.$slots, `table-header-${
|
|
204
|
-
searchFormData:
|
|
205
|
-
triggerSearch: (f =
|
|
201
|
+
d(e.$slots, `table-header-${a.columnKey || a.prop}`, H(le(l), {
|
|
202
|
+
searchFormData: r(A),
|
|
203
|
+
triggerSearch: (f = r(i)) == null ? void 0 : f.triggerSearch
|
|
206
204
|
}), void 0, !0)
|
|
207
205
|
];
|
|
208
206
|
})
|
|
209
207
|
}))
|
|
210
208
|
]), 1040, ["is-auto-refresh", "api", "columns", "query", "maxHeight", "rowKey", "injectInfo"])
|
|
211
209
|
])), [
|
|
212
|
-
[h, !m.value &&
|
|
210
|
+
[h, !m.value && r(I)]
|
|
213
211
|
]);
|
|
214
212
|
};
|
|
215
213
|
}
|
|
216
214
|
});
|
|
217
215
|
export {
|
|
218
|
-
|
|
216
|
+
xe as default
|
|
219
217
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import y from "./ConfirmModal.vue.mjs";
|
|
2
|
-
import
|
|
3
|
-
import { defineComponent as
|
|
2
|
+
import g from "../form/FormMain.vue.mjs";
|
|
3
|
+
import { defineComponent as p, ref as b, computed as r, watch as A, openBlock as C, createBlock as M, unref as s, withCtx as W, createVNode as D, mergeProps as k } from "vue";
|
|
4
4
|
import { stringifyFormData as v } from "../form/utils.mjs";
|
|
5
|
-
const
|
|
5
|
+
const P = /* @__PURE__ */ p({
|
|
6
6
|
__name: "DetailModal",
|
|
7
7
|
props: {
|
|
8
8
|
data: {},
|
|
@@ -15,49 +15,50 @@ const B = "80px", $ = /* @__PURE__ */ g({
|
|
|
15
15
|
modalWidth: { default: 600 },
|
|
16
16
|
formLayout: { default: () => ({ span: 24 }) },
|
|
17
17
|
formProps: {},
|
|
18
|
-
formRowGutter: {}
|
|
18
|
+
formRowGutter: {},
|
|
19
|
+
labelWidth: { default: "auto" }
|
|
19
20
|
},
|
|
20
21
|
emits: ["update:show", "afterAdd", "afterEdit"],
|
|
21
|
-
setup(
|
|
22
|
-
const t =
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
var
|
|
26
|
-
return (
|
|
22
|
+
setup(a, { emit: f }) {
|
|
23
|
+
const t = a, l = f, d = b(), m = r(() => t.data), c = r(() => `${t.type === "add" ? "新增" : "编辑"}${t.subTitle || ""}`), u = (o) => {
|
|
24
|
+
l("update:show", o);
|
|
25
|
+
}, h = () => {
|
|
26
|
+
var o;
|
|
27
|
+
return (o = d.value) == null ? void 0 : o.validate().then(async () => {
|
|
27
28
|
var i, n;
|
|
28
|
-
const
|
|
29
|
-
console.log("confirm",
|
|
29
|
+
const e = v(t.data, t.list);
|
|
30
|
+
console.log("confirm", e), t.type === "add" ? (await ((i = t.addApi) == null ? void 0 : i.call(t, e)), l("afterAdd", e)) : (await ((n = t.editApi) == null ? void 0 : n.call(t, e)), l("afterEdit", e));
|
|
30
31
|
});
|
|
31
|
-
},
|
|
32
|
+
}, w = () => {
|
|
32
33
|
console.log("cancel");
|
|
33
34
|
};
|
|
34
|
-
return
|
|
35
|
+
return A(
|
|
35
36
|
() => t.show,
|
|
36
|
-
(
|
|
37
|
-
var
|
|
38
|
-
|
|
37
|
+
(o) => {
|
|
38
|
+
var e;
|
|
39
|
+
o || (e = d.value) == null || e.clearValidate();
|
|
39
40
|
}
|
|
40
|
-
), (
|
|
41
|
-
const i =
|
|
42
|
-
return
|
|
41
|
+
), (o, e) => {
|
|
42
|
+
const i = g, n = y;
|
|
43
|
+
return C(), M(n, {
|
|
43
44
|
title: s(c),
|
|
44
|
-
show:
|
|
45
|
-
onConfirm:
|
|
46
|
-
onCancel:
|
|
45
|
+
show: a.show,
|
|
46
|
+
onConfirm: h,
|
|
47
|
+
onCancel: w,
|
|
47
48
|
useLoading: "",
|
|
48
|
-
width:
|
|
49
|
+
width: a.modalWidth,
|
|
49
50
|
"onUpdate:show": u
|
|
50
51
|
}, {
|
|
51
|
-
default:
|
|
52
|
-
|
|
52
|
+
default: W(() => [
|
|
53
|
+
D(i, k({
|
|
53
54
|
ref_key: "formMain",
|
|
54
55
|
ref: d,
|
|
55
|
-
list:
|
|
56
|
+
list: a.list,
|
|
56
57
|
data: s(m),
|
|
57
|
-
layout:
|
|
58
|
-
labelWidth:
|
|
59
|
-
"row-gutter":
|
|
60
|
-
},
|
|
58
|
+
layout: a.formLayout,
|
|
59
|
+
labelWidth: a.labelWidth,
|
|
60
|
+
"row-gutter": a.formRowGutter
|
|
61
|
+
}, a.formProps), null, 16, ["list", "data", "layout", "labelWidth", "row-gutter"])
|
|
61
62
|
]),
|
|
62
63
|
_: 1
|
|
63
64
|
}, 8, ["title", "show", "width"]);
|
|
@@ -65,5 +66,5 @@ const B = "80px", $ = /* @__PURE__ */ g({
|
|
|
65
66
|
}
|
|
66
67
|
});
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
+
P as default
|
|
69
70
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TableMain.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-135cf353"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|