@done-coding/admin-core 0.8.3-alpha.0 → 0.9.1-alpha.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/docs/nested-config-paradigm.md +80 -0
- package/es/bridge/config-hook.mjs +37 -0
- package/es/bridge/index.mjs +157 -62
- package/es/bridge/plugin.mjs +29 -0
- package/es/bridge/theme.mjs +65 -0
- package/es/components/app-layout/AppBody.vue.mjs +1 -1
- package/es/components/app-layout/AppBody.vue2.mjs +47 -49
- package/es/components/app-layout/AppBreadcrumb.vue.mjs +1 -1
- package/es/components/app-layout/AppBreadcrumb.vue2.mjs +35 -41
- package/es/components/app-layout/AppFooter.vue.mjs +2 -2
- package/es/components/app-layout/AppFooter.vue2.mjs +8 -8
- package/es/components/app-layout/AppHeader.vue.mjs +1 -1
- package/es/components/app-layout/AppHeader.vue2.mjs +60 -69
- package/es/components/app-layout/AppLayout.vue.mjs +2 -2
- package/es/components/app-layout/AppLayout.vue2.mjs +95 -93
- package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
- package/es/components/app-layout/AppSidebar.vue2.mjs +79 -82
- package/es/components/app-layout/AppTheme.vue.mjs +7 -0
- package/es/components/app-layout/AppTheme.vue2.mjs +38 -0
- package/es/components/data-view/DataListView.vue.mjs +2 -2
- package/es/components/data-view/DataListView.vue2.mjs +36 -36
- package/es/components/display/ActionConfirm.vue2.mjs +16 -16
- package/es/components/display/HeightProvider.vue.mjs +10 -10
- package/es/components/display/TabsHeader.vue.mjs +4 -4
- package/es/components/display/TabsHeader.vue2.mjs +34 -34
- package/es/components/display/TabsMain.vue.mjs +40 -39
- package/es/components/display/TabsRefineFlow.vue.mjs +30 -28
- package/es/components/form/FormItem.vue.mjs +1 -1
- package/es/components/form/FormItem.vue2.mjs +75 -81
- package/es/components/form/FormItemNestForm.vue.mjs +7 -0
- package/es/components/form/FormItemNestForm.vue2.mjs +49 -0
- package/es/components/form/FormItemNestFormList.vue.mjs +7 -0
- package/es/components/form/FormItemNestFormList.vue2.mjs +137 -0
- package/es/components/form/FormMain.vue.mjs +5 -147
- package/es/components/form/FormMain.vue2.mjs +160 -2
- package/es/components/form/FormRadioGroup.vue.mjs +42 -49
- package/es/components/form/FormSearch.vue.mjs +2 -2
- package/es/components/form/FormSearch.vue2.mjs +122 -128
- package/es/components/form/FormSelect.vue.mjs +34 -40
- package/es/components/form/FormSubmitBtn.vue.mjs +23 -28
- package/es/components/form/FormSubmitPanel.vue.mjs +2 -2
- package/es/components/form/FormSubmitPanel.vue2.mjs +29 -28
- package/es/components/form/FormTree.vue.mjs +16 -21
- package/es/components/form/FormVerifyCode.vue.mjs +37 -43
- package/es/components/form/FormVerifyImage.vue.mjs +2 -2
- package/es/components/form/FormVerifyImage.vue2.mjs +36 -41
- package/es/components/form/nest-form-item-list.mjs +71 -0
- package/es/components/form/nest-form-item.mjs +42 -0
- package/es/components/form/nest-registry.mjs +7 -0
- package/es/components/form/use-nest-form-list.mjs +22 -0
- package/es/components/form/use-nest-form.mjs +34 -0
- package/es/components/form/use-nest-layout-scale.mjs +14 -0
- package/es/components/form/utils.mjs +77 -61
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +134 -139
- package/es/components/menu/MenuItemSub.vue.mjs +41 -48
- package/es/components/menu/MenuTree.vue.mjs +58 -65
- package/es/components/misc/AutoRefresh.vue.mjs +2 -2
- package/es/components/misc/AutoRefresh.vue2.mjs +44 -51
- package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
- package/es/components/misc/AutoRefreshGroup.vue2.mjs +37 -43
- package/es/components/modal/ConfirmModal.vue.mjs +3 -4
- package/es/components/modal/ConfirmModal.vue2.mjs +83 -111
- package/es/components/modal/DetailModal.vue.mjs +38 -41
- package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
- package/es/components/panel/PanelEditSwitch.vue2.mjs +50 -55
- package/es/components/panel/PanelItemNestForm.vue.mjs +7 -0
- package/es/components/panel/PanelItemNestForm.vue2.mjs +69 -0
- package/es/components/panel/PanelItemNestPanel.vue.mjs +34 -0
- package/es/components/panel/PanelItemNestPanel.vue2.mjs +4 -0
- package/es/components/panel/PanelMain.vue.mjs +1 -1
- package/es/components/panel/PanelMain.vue2.mjs +72 -72
- package/es/components/panel/nest-panel-form.mjs +53 -0
- package/es/components/panel/nest-panel-item.mjs +25 -0
- package/es/components/table/TableMain.vue.mjs +2 -2
- package/es/components/table/TableMain.vue2.mjs +221 -229
- package/es/components/table/TableToolbar.vue.mjs +2 -2
- package/es/components/table/TableToolbar.vue2.mjs +115 -126
- package/es/hooks/use-admin-theme-apply.mjs +84 -0
- package/es/hooks/use-admin-viewport-apply.mjs +27 -0
- package/es/index.mjs +190 -153
- package/es/inject/key.mjs +15 -6
- package/es/store/app.mjs +75 -84
- package/es/style.css +1 -1
- package/es/utils/theme-scale.mjs +37 -0
- package/package.json +2 -4
- package/types/bridge/config-hook.d.ts +91 -0
- package/types/bridge/index.d.ts +108 -8
- package/types/bridge/plugin.d.ts +39 -0
- package/types/bridge/theme.d.ts +85 -0
- package/types/components/app-layout/AppTheme.vue.d.ts +2 -0
- package/types/components/app-layout/types.d.ts +1 -1
- package/types/components/form/FormItem.vue.d.ts +12 -12
- package/types/components/form/FormItemNestForm.vue.d.ts +36 -0
- package/types/components/form/FormItemNestFormList.vue.d.ts +63 -0
- package/types/components/form/FormMain.vue.d.ts +2 -2
- package/types/components/form/FormSearch.vue.d.ts +2 -2
- package/types/components/form/FormTree.vue.d.ts +50 -50
- package/types/components/form/index.d.ts +9 -1
- package/types/components/form/nest-form-item-list.d.ts +63 -0
- package/types/components/form/nest-form-item.d.ts +36 -0
- package/types/components/form/nest-registry.d.ts +22 -0
- package/types/components/form/types.d.ts +2 -0
- package/types/components/form/use-nest-form-list.d.ts +20 -0
- package/types/components/form/use-nest-form.d.ts +26 -0
- package/types/components/form/use-nest-layout-scale.d.ts +17 -0
- package/types/components/form/utils.d.ts +26 -1
- package/types/components/menu/MenuTree.vue.d.ts +10 -10
- package/types/components/modal/ModalShelf.vue.d.ts +1 -1
- package/types/components/panel/PanelItemNestForm.vue.d.ts +35 -0
- package/types/components/panel/PanelItemNestPanel.vue.d.ts +22 -0
- package/types/components/panel/index.d.ts +5 -1
- package/types/components/panel/nest-panel-form.d.ts +38 -0
- package/types/components/panel/nest-panel-item.d.ts +28 -0
- package/types/components/panel/types.d.ts +2 -0
- package/types/components/table/TableMain.vue.d.ts +3 -3
- package/types/hooks/activated.d.ts +2 -2
- package/types/hooks/feel-size.d.ts +1 -1
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/menus-dispatch.d.ts +5 -5
- package/types/hooks/use-admin-theme-apply.d.ts +17 -0
- package/types/hooks/use-admin-viewport-apply.d.ts +15 -0
- package/types/hooks/use-breakpoint.d.ts +1 -1
- package/types/inject/key.d.ts +46 -1
- package/types/store/app.d.ts +138 -59
- package/types/utils/index.d.ts +1 -0
- package/types/utils/theme-scale.d.ts +35 -0
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "element-plus
|
|
3
|
-
|
|
4
|
-
import "element-plus/es/components/icon/style/css";
|
|
5
|
-
import "element-plus/es/components/button/style/css";
|
|
6
|
-
import { defineComponent as V, ref as $, computed as F, openBlock as l, createBlock as i, withCtx as d, createElementVNode as c, renderSlot as u, resolveDynamicComponent as w, createElementBlock as m, Fragment as B, createTextVNode as r, toDisplayString as f, unref as y, createCommentVNode as x, createVNode as C } from "vue";
|
|
7
|
-
import { Close as L } from "@element-plus/icons-vue";
|
|
8
|
-
const M = { class: "main" }, I = { class: "shim" }, P = { class: "title" }, z = { class: "content" }, A = ["reverse"], W = /* @__PURE__ */ V({
|
|
1
|
+
import { defineComponent as E, ref as N, computed as O, openBlock as l, createBlock as s, unref as r, withCtx as a, createElementVNode as u, renderSlot as m, resolveDynamicComponent as v, createElementBlock as w, Fragment as k, createTextVNode as i, toDisplayString as d, createCommentVNode as S, createVNode as V } from "vue";
|
|
2
|
+
import { ElDialog as D, ElButton as g } from "element-plus";
|
|
3
|
+
const F = { class: "confirm-modal__title" }, H = { class: "confirm-modal__content" }, L = ["reverse"], P = /* @__PURE__ */ E({
|
|
9
4
|
inheritAttrs: !1,
|
|
10
5
|
__name: "ConfirmModal",
|
|
11
6
|
props: {
|
|
@@ -19,7 +14,7 @@ const M = { class: "main" }, I = { class: "shim" }, P = { class: "title" }, z =
|
|
|
19
14
|
cancelText: { type: [String, Function], default: "取消" },
|
|
20
15
|
confirmText: { type: [String, Function], default: "确定" },
|
|
21
16
|
hiddenCancel: { type: Boolean, default: !1 },
|
|
22
|
-
width: { default:
|
|
17
|
+
width: { default: 420 },
|
|
23
18
|
reverse: { type: Boolean, default: !1 },
|
|
24
19
|
closeOnPressEscape: { type: Boolean, default: !0 },
|
|
25
20
|
closeOnClickModal: { type: Boolean, default: !0 },
|
|
@@ -27,116 +22,93 @@ const M = { class: "main" }, I = { class: "shim" }, P = { class: "title" }, z =
|
|
|
27
22
|
type: { default: "primary" }
|
|
28
23
|
},
|
|
29
24
|
emits: ["update:show"],
|
|
30
|
-
setup(e, { emit:
|
|
31
|
-
const
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
var t;
|
|
36
|
-
if (await ((t = o.onCancel) == null ? void 0 : t.call(o)) === !1) {
|
|
37
|
-
console.log("确认弹窗 onCancel 返回false,不关闭弹窗");
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
s(!1);
|
|
41
|
-
}, v = async () => {
|
|
25
|
+
setup(e, { emit: B }) {
|
|
26
|
+
const t = e, x = B, c = N(!1), y = O(() => t.useLoading && c.value), f = (o) => {
|
|
27
|
+
var n;
|
|
28
|
+
x("update:show", !1), (n = t.onClose) == null || n.call(t, o);
|
|
29
|
+
}, h = async () => {
|
|
42
30
|
var n;
|
|
43
|
-
|
|
31
|
+
await ((n = t.onCancel) == null ? void 0 : n.call(t)) !== !1 && f(!1);
|
|
32
|
+
}, C = async () => {
|
|
33
|
+
var o;
|
|
34
|
+
c.value = !0;
|
|
44
35
|
try {
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
s(!0);
|
|
36
|
+
const n = await ((o = t.onConfirm) == null ? void 0 : o.call(t));
|
|
37
|
+
if (c.value = !1, n === !1) return;
|
|
38
|
+
f(!0);
|
|
51
39
|
} catch {
|
|
52
|
-
|
|
40
|
+
c.value = !1;
|
|
53
41
|
}
|
|
54
|
-
},
|
|
55
|
-
|
|
42
|
+
}, T = () => {
|
|
43
|
+
f(!1);
|
|
56
44
|
};
|
|
57
|
-
return (
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
45
|
+
return (o, n) => (l(), s(r(D), {
|
|
46
|
+
"model-value": e.show,
|
|
47
|
+
class: "confirm-modal",
|
|
48
|
+
width: e.width,
|
|
49
|
+
"show-close": e.showClose,
|
|
50
|
+
"append-to-body": "",
|
|
51
|
+
"align-center": "",
|
|
52
|
+
"close-on-click-modal": e.closeOnClickModal,
|
|
53
|
+
"close-on-press-escape": e.closeOnPressEscape,
|
|
54
|
+
onClose: T
|
|
55
|
+
}, {
|
|
56
|
+
header: a(() => [
|
|
57
|
+
u("div", F, [
|
|
58
|
+
m(o.$slots, "title", {}, () => [
|
|
59
|
+
typeof e.title == "function" ? (l(), s(v(e.title), { key: 0 })) : (l(), w(k, { key: 1 }, [
|
|
60
|
+
i(d(e.title), 1)
|
|
61
|
+
], 64))
|
|
62
|
+
], !0)
|
|
63
|
+
])
|
|
64
|
+
]),
|
|
65
|
+
footer: a(() => [
|
|
66
|
+
u("div", {
|
|
67
|
+
class: "confirm-modal__footer",
|
|
68
|
+
reverse: e.reverse
|
|
69
|
+
}, [
|
|
70
|
+
m(o.$slots, "footer", {
|
|
71
|
+
cancelHandler: h,
|
|
72
|
+
confirmHandler: C,
|
|
73
|
+
loading: y.value
|
|
74
|
+
}, () => [
|
|
75
|
+
e.hiddenCancel ? S("", !0) : (l(), s(r(g), {
|
|
76
|
+
key: 0,
|
|
77
|
+
class: "confirm-modal__cancel",
|
|
78
|
+
onClick: h
|
|
79
|
+
}, {
|
|
80
|
+
default: a(() => [
|
|
81
|
+
i(d(typeof e.cancelText == "function" ? e.cancelText() : e.cancelText), 1)
|
|
79
82
|
]),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
_: 1
|
|
84
|
+
})),
|
|
85
|
+
V(r(g), {
|
|
86
|
+
class: "confirm-modal__confirm",
|
|
87
|
+
type: e.type,
|
|
88
|
+
loading: y.value,
|
|
89
|
+
onClick: C
|
|
90
|
+
}, {
|
|
91
|
+
default: a(() => [
|
|
92
|
+
i(d(typeof e.confirmText == "function" ? e.confirmText() : e.confirmText), 1)
|
|
86
93
|
]),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
r(f(typeof e.cancelText == "function" ? e.cancelText() : e.cancelText), 1)
|
|
104
|
-
]),
|
|
105
|
-
_: 1
|
|
106
|
-
})),
|
|
107
|
-
C(k, {
|
|
108
|
-
type: e.type,
|
|
109
|
-
class: "btn confirm-btn",
|
|
110
|
-
loading: y(h),
|
|
111
|
-
onClick: v
|
|
112
|
-
}, {
|
|
113
|
-
default: d(() => [
|
|
114
|
-
r(f(typeof e.confirmText == "function" ? e.confirmText() : e.confirmText), 1)
|
|
115
|
-
]),
|
|
116
|
-
_: 1
|
|
117
|
-
}, 8, ["type", "loading"])
|
|
118
|
-
], !0)
|
|
119
|
-
], 8, A)
|
|
120
|
-
]),
|
|
121
|
-
e.showClose ? (l(), m("div", {
|
|
122
|
-
key: 0,
|
|
123
|
-
class: "close-box",
|
|
124
|
-
onClick: t[0] || (t[0] = (j) => s())
|
|
125
|
-
}, [
|
|
126
|
-
C(H, { size: 22 }, {
|
|
127
|
-
default: d(() => [
|
|
128
|
-
C(y(L))
|
|
129
|
-
]),
|
|
130
|
-
_: 1
|
|
131
|
-
})
|
|
132
|
-
])) : x("", !0)
|
|
133
|
-
])
|
|
134
|
-
]),
|
|
135
|
-
_: 3
|
|
136
|
-
}, 8, ["model-value", "width", "close-on-click-modal", "close-on-press-escape"]);
|
|
137
|
-
};
|
|
94
|
+
_: 1
|
|
95
|
+
}, 8, ["type", "loading"])
|
|
96
|
+
], !0)
|
|
97
|
+
], 8, L)
|
|
98
|
+
]),
|
|
99
|
+
default: a(() => [
|
|
100
|
+
u("div", H, [
|
|
101
|
+
m(o.$slots, "default", {}, () => [
|
|
102
|
+
typeof e.content == "function" ? (l(), s(v(e.content), { key: 0 })) : (l(), w(k, { key: 1 }, [
|
|
103
|
+
i(d(e.content), 1)
|
|
104
|
+
], 64))
|
|
105
|
+
], !0)
|
|
106
|
+
])
|
|
107
|
+
]),
|
|
108
|
+
_: 3
|
|
109
|
+
}, 8, ["model-value", "width", "show-close", "close-on-click-modal", "close-on-press-escape"]));
|
|
138
110
|
}
|
|
139
111
|
});
|
|
140
112
|
export {
|
|
141
|
-
|
|
113
|
+
P as default
|
|
142
114
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import y from "
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as w, ref as y, computed as n, watch as g, openBlock as b, createBlock as p, withCtx as A, createVNode as W, unref as v, mergeProps as C } from "vue";
|
|
2
|
+
import M from "../form/FormMain.vue.mjs";
|
|
3
|
+
import { stringifyFormData as D } from "../form/utils.mjs";
|
|
4
|
+
import k from "./ConfirmModal.vue.mjs";
|
|
5
|
+
const P = /* @__PURE__ */ w({
|
|
6
6
|
__name: "DetailModal",
|
|
7
7
|
props: {
|
|
8
8
|
data: {},
|
|
@@ -20,51 +20,48 @@ const L = /* @__PURE__ */ g({
|
|
|
20
20
|
},
|
|
21
21
|
emits: ["update:show", "afterAdd", "afterEdit"],
|
|
22
22
|
setup(a, { emit: f }) {
|
|
23
|
-
const t = a,
|
|
24
|
-
|
|
25
|
-
},
|
|
23
|
+
const t = a, i = f, l = y(), s = n(() => t.data), u = n(() => `${t.type === "add" ? "新增" : "编辑"}${t.subTitle || ""}`), m = (o) => {
|
|
24
|
+
i("update:show", o);
|
|
25
|
+
}, c = () => {
|
|
26
26
|
var o;
|
|
27
|
-
return (o =
|
|
28
|
-
var
|
|
29
|
-
const e =
|
|
30
|
-
console.log("confirm", e), t.type === "add" ? (await ((
|
|
27
|
+
return (o = l.value) == null ? void 0 : o.validate().then(async () => {
|
|
28
|
+
var d, r;
|
|
29
|
+
const e = D(t.data, t.list);
|
|
30
|
+
console.log("confirm", e), t.type === "add" ? (await ((d = t.addApi) == null ? void 0 : d.call(t, e)), i("afterAdd", e)) : (await ((r = t.editApi) == null ? void 0 : r.call(t, e)), i("afterEdit", e));
|
|
31
31
|
});
|
|
32
|
-
},
|
|
32
|
+
}, h = () => {
|
|
33
33
|
console.log("cancel");
|
|
34
34
|
};
|
|
35
|
-
return
|
|
35
|
+
return g(
|
|
36
36
|
() => t.show,
|
|
37
37
|
(o) => {
|
|
38
38
|
var e;
|
|
39
|
-
o || (e =
|
|
39
|
+
o || (e = l.value) == null || e.clearValidate();
|
|
40
40
|
}
|
|
41
|
-
), (o, e) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
_: 1
|
|
64
|
-
}, 8, ["title", "show", "width"]);
|
|
65
|
-
};
|
|
41
|
+
), (o, e) => (b(), p(k, {
|
|
42
|
+
title: u.value,
|
|
43
|
+
show: a.show,
|
|
44
|
+
onConfirm: c,
|
|
45
|
+
onCancel: h,
|
|
46
|
+
useLoading: "",
|
|
47
|
+
width: a.modalWidth,
|
|
48
|
+
"onUpdate:show": m
|
|
49
|
+
}, {
|
|
50
|
+
default: A(() => [
|
|
51
|
+
W(v(M), C({
|
|
52
|
+
ref_key: "formMain",
|
|
53
|
+
ref: l,
|
|
54
|
+
list: a.list,
|
|
55
|
+
data: s.value,
|
|
56
|
+
layout: a.formLayout,
|
|
57
|
+
labelWidth: a.labelWidth,
|
|
58
|
+
"row-gutter": a.formRowGutter
|
|
59
|
+
}, a.formProps), null, 16, ["list", "data", "layout", "labelWidth", "row-gutter"])
|
|
60
|
+
]),
|
|
61
|
+
_: 1
|
|
62
|
+
}, 8, ["title", "show", "width"]));
|
|
66
63
|
}
|
|
67
64
|
});
|
|
68
65
|
export {
|
|
69
|
-
|
|
66
|
+
P as default
|
|
70
67
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./PanelEditSwitch.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-
|
|
4
|
+
const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-65f056ab"]]);
|
|
5
5
|
export {
|
|
6
6
|
i as default
|
|
7
7
|
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "element-plus
|
|
3
|
-
import "
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import T from "../form/FormSubmitPanel.vue.mjs";
|
|
7
|
-
const V = { class: "panel-edit-switch" }, A = /* @__PURE__ */ h({
|
|
1
|
+
import { defineComponent as S, useModel as C, ref as h, computed as w, watch as l, openBlock as s, createElementBlock as u, createBlock as d, unref as c, withCtx as F, createTextVNode as B, createCommentVNode as E, renderSlot as r, Fragment as P, mergeModels as f } from "vue";
|
|
2
|
+
import { ElButton as M } from "element-plus";
|
|
3
|
+
import $ from "lodash/cloneDeep";
|
|
4
|
+
import N from "../form/FormSubmitPanel.vue.mjs";
|
|
5
|
+
const T = { class: "panel-edit-switch" }, R = /* @__PURE__ */ S({
|
|
8
6
|
name: "PanelEditSwitch",
|
|
9
7
|
__name: "PanelEditSwitch",
|
|
10
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ f({
|
|
11
9
|
data: {},
|
|
12
10
|
config: {},
|
|
13
11
|
editable: { type: Boolean },
|
|
@@ -16,28 +14,28 @@ const V = { class: "panel-edit-switch" }, A = /* @__PURE__ */ h({
|
|
|
16
14
|
editing: { type: Boolean, default: !1 },
|
|
17
15
|
editingModifiers: {}
|
|
18
16
|
}),
|
|
19
|
-
emits: /* @__PURE__ */
|
|
20
|
-
setup(i, { emit:
|
|
21
|
-
const n = i, g =
|
|
17
|
+
emits: /* @__PURE__ */ f(["submitSuccess"], ["update:editing"]),
|
|
18
|
+
setup(i, { emit: m }) {
|
|
19
|
+
const n = i, g = m, e = C(i, "editing"), a = h(
|
|
22
20
|
{}
|
|
23
|
-
),
|
|
21
|
+
), y = w(() => [n.config.editorConfig]), b = (t) => t, p = () => {
|
|
24
22
|
e.value = !0;
|
|
25
|
-
},
|
|
23
|
+
}, v = () => {
|
|
26
24
|
e.value = !1;
|
|
27
|
-
},
|
|
25
|
+
}, k = (t) => {
|
|
28
26
|
if (!n.submitFn)
|
|
29
27
|
throw new Error("可编辑 那么必须提供 submitFn");
|
|
30
28
|
return n.submitFn(t);
|
|
31
29
|
}, D = (t) => {
|
|
32
30
|
e.value = !1, g("submitSuccess", t);
|
|
33
31
|
};
|
|
34
|
-
return
|
|
32
|
+
return l(
|
|
35
33
|
e,
|
|
36
|
-
(t,
|
|
37
|
-
t && !
|
|
34
|
+
(t, o) => {
|
|
35
|
+
t && !o && (a.value = $(n.data));
|
|
38
36
|
},
|
|
39
37
|
{ immediate: !0 }
|
|
40
|
-
),
|
|
38
|
+
), l(
|
|
41
39
|
() => n.editable,
|
|
42
40
|
(t) => {
|
|
43
41
|
t || (e.value = !1);
|
|
@@ -45,47 +43,44 @@ const V = { class: "panel-edit-switch" }, A = /* @__PURE__ */ h({
|
|
|
45
43
|
{
|
|
46
44
|
immediate: !0
|
|
47
45
|
}
|
|
48
|
-
), (t,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
), (t, o) => (s(), u("div", T, [
|
|
47
|
+
i.editable && !e.value ? (s(), d(c(M), {
|
|
48
|
+
key: 0,
|
|
49
|
+
class: "panel-edit-switch-edit-btn",
|
|
50
|
+
type: "primary",
|
|
51
|
+
link: "",
|
|
52
|
+
size: "small",
|
|
53
|
+
onClick: p
|
|
54
|
+
}, {
|
|
55
|
+
default: F(() => [...o[0] || (o[0] = [
|
|
56
|
+
B(" 编辑", -1)
|
|
57
|
+
])]),
|
|
58
|
+
_: 1
|
|
59
|
+
})) : E("", !0),
|
|
60
|
+
e.value ? (s(), u(P, { key: 2 }, [
|
|
61
|
+
i.config.editorRender ? r(t.$slots, "editor", {
|
|
52
62
|
key: 0,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
link: "",
|
|
56
|
-
size: "small",
|
|
57
|
-
onClick: b
|
|
58
|
-
}, {
|
|
59
|
-
default: E(() => [...s[0] || (s[0] = [
|
|
60
|
-
P(" 编辑", -1)
|
|
61
|
-
])]),
|
|
62
|
-
_: 1
|
|
63
|
-
})) : M("", !0),
|
|
64
|
-
e.value ? (r(), u($, { key: 2 }, [
|
|
65
|
-
i.config.editorRender ? l(t.$slots, "editor", {
|
|
66
|
-
key: 0,
|
|
67
|
-
stringifyDraftData: o(a)
|
|
68
|
-
}, void 0, !0) : i.config.editorConfig ? (r(), d(o(T), {
|
|
69
|
-
key: 1,
|
|
70
|
-
list: o(p),
|
|
71
|
-
"stringify-data": y(o(a)),
|
|
72
|
-
"cancel-btn": "取消",
|
|
73
|
-
"operation-position": "bottom-right",
|
|
74
|
-
"submit-fn": v,
|
|
75
|
-
onCancel: k,
|
|
76
|
-
onSuccess: D
|
|
77
|
-
}, null, 8, ["list", "stringify-data"])) : l(t.$slots, "default", {
|
|
78
|
-
key: 2,
|
|
79
|
-
stringifyDraftData: o(a)
|
|
80
|
-
}, void 0, !0)
|
|
81
|
-
], 64)) : l(t.$slots, "default", {
|
|
63
|
+
stringifyDraftData: a.value
|
|
64
|
+
}, void 0, !0) : i.config.editorConfig ? (s(), d(c(N), {
|
|
82
65
|
key: 1,
|
|
83
|
-
|
|
66
|
+
list: y.value,
|
|
67
|
+
"stringify-data": b(a.value),
|
|
68
|
+
"cancel-btn": "取消",
|
|
69
|
+
"operation-position": "bottom-right",
|
|
70
|
+
"submit-fn": k,
|
|
71
|
+
onCancel: v,
|
|
72
|
+
onSuccess: D
|
|
73
|
+
}, null, 8, ["list", "stringify-data"])) : r(t.$slots, "default", {
|
|
74
|
+
key: 2,
|
|
75
|
+
stringifyDraftData: a.value
|
|
84
76
|
}, void 0, !0)
|
|
85
|
-
])
|
|
86
|
-
|
|
77
|
+
], 64)) : r(t.$slots, "default", {
|
|
78
|
+
key: 1,
|
|
79
|
+
stringifyDraftData: i.data
|
|
80
|
+
}, void 0, !0)
|
|
81
|
+
]));
|
|
87
82
|
}
|
|
88
83
|
});
|
|
89
84
|
export {
|
|
90
|
-
|
|
85
|
+
R as default
|
|
91
86
|
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { defineComponent as y, ref as h, openBlock as b, createElementBlock as x, createVNode as n, unref as l, createElementVNode as w, withCtx as c, createTextVNode as i, toDisplayString as r } from "vue";
|
|
2
|
+
import N from "../form/FormMain.vue.mjs";
|
|
3
|
+
import { useNestForm as S } from "../form/use-nest-form.mjs";
|
|
4
|
+
import { useNestLayoutScale as C } from "../form/use-nest-layout-scale.mjs";
|
|
5
|
+
import s from "../display/ActionBtn.vue.mjs";
|
|
6
|
+
const k = { class: "panel-item-nest-form" }, p = { class: "panel-item-nest-form-actions" }, _ = /* @__PURE__ */ y({
|
|
7
|
+
name: "PanelItemNestForm",
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "PanelItemNestForm",
|
|
10
|
+
props: {
|
|
11
|
+
data: {},
|
|
12
|
+
list: {},
|
|
13
|
+
layout: {},
|
|
14
|
+
rowGutter: {},
|
|
15
|
+
submitText: { default: "提交" },
|
|
16
|
+
cancelText: { default: "取消" },
|
|
17
|
+
submit: {},
|
|
18
|
+
cancel: {},
|
|
19
|
+
parentSpan: {},
|
|
20
|
+
rebase: { type: Boolean, default: !0 }
|
|
21
|
+
},
|
|
22
|
+
setup(e) {
|
|
23
|
+
const t = e, m = C({
|
|
24
|
+
parentSpan: () => t.parentSpan,
|
|
25
|
+
rebase: () => t.rebase
|
|
26
|
+
}), o = h(), { validateChild: u } = S({ childRef: o }), d = async () => {
|
|
27
|
+
var a;
|
|
28
|
+
await u(), await ((a = t.submit) == null ? void 0 : a.call(t));
|
|
29
|
+
}, f = () => {
|
|
30
|
+
var a;
|
|
31
|
+
(a = t.cancel) == null || a.call(t);
|
|
32
|
+
};
|
|
33
|
+
return (a, T) => (b(), x("div", k, [
|
|
34
|
+
n(l(N), {
|
|
35
|
+
ref_key: "childRef",
|
|
36
|
+
ref: o,
|
|
37
|
+
list: e.list,
|
|
38
|
+
data: e.data,
|
|
39
|
+
layout: e.layout,
|
|
40
|
+
"layout-scale": l(m),
|
|
41
|
+
"row-gutter": e.rowGutter
|
|
42
|
+
}, null, 8, ["list", "data", "layout", "layout-scale", "row-gutter"]),
|
|
43
|
+
w("div", p, [
|
|
44
|
+
n(l(s), {
|
|
45
|
+
size: "small",
|
|
46
|
+
onClick: f
|
|
47
|
+
}, {
|
|
48
|
+
default: c(() => [
|
|
49
|
+
i(r(e.cancelText), 1)
|
|
50
|
+
]),
|
|
51
|
+
_: 1
|
|
52
|
+
}),
|
|
53
|
+
n(l(s), {
|
|
54
|
+
size: "small",
|
|
55
|
+
type: "primary",
|
|
56
|
+
onClick: d
|
|
57
|
+
}, {
|
|
58
|
+
default: c(() => [
|
|
59
|
+
i(r(e.submitText), 1)
|
|
60
|
+
]),
|
|
61
|
+
_: 1
|
|
62
|
+
})
|
|
63
|
+
])
|
|
64
|
+
]));
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export {
|
|
68
|
+
_ as default
|
|
69
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineComponent as r, openBlock as l, createBlock as n, unref as o } from "vue";
|
|
2
|
+
import u from "./PanelMain.vue.mjs";
|
|
3
|
+
import { useNestLayoutScale as c } from "../form/use-nest-layout-scale.mjs";
|
|
4
|
+
const p = /* @__PURE__ */ r({
|
|
5
|
+
name: "PanelItemNestPanel",
|
|
6
|
+
inheritAttrs: !1,
|
|
7
|
+
__name: "PanelItemNestPanel",
|
|
8
|
+
props: {
|
|
9
|
+
data: {},
|
|
10
|
+
list: {},
|
|
11
|
+
itemCard: { type: [Boolean, Object] },
|
|
12
|
+
layout: {},
|
|
13
|
+
rowGutter: {},
|
|
14
|
+
parentSpan: {},
|
|
15
|
+
rebase: { type: Boolean, default: !0 }
|
|
16
|
+
},
|
|
17
|
+
setup(t) {
|
|
18
|
+
const e = t, a = c({
|
|
19
|
+
parentSpan: () => e.parentSpan,
|
|
20
|
+
rebase: () => e.rebase
|
|
21
|
+
});
|
|
22
|
+
return (s, i) => (l(), n(u, {
|
|
23
|
+
list: t.list,
|
|
24
|
+
data: t.data,
|
|
25
|
+
"item-card": t.itemCard,
|
|
26
|
+
layout: t.layout,
|
|
27
|
+
"layout-scale": o(a),
|
|
28
|
+
"row-gutter": t.rowGutter
|
|
29
|
+
}, null, 8, ["list", "data", "item-card", "layout", "layout-scale", "row-gutter"]));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
p as default
|
|
34
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./PanelMain.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9c14b584"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|