@done-coding/admin-core 0.9.0 → 0.10.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/theme.mjs +41 -38
- package/es/components/app-layout/AppTheme.vue.mjs +2 -2
- package/es/components/app-layout/AppTheme.vue2.mjs +19 -19
- 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 -140
- package/es/components/form/FormMain.vue2.mjs +160 -2
- package/es/components/form/FormSearch.vue.mjs +2 -2
- package/es/components/form/FormSearch.vue2.mjs +43 -42
- package/es/components/form/FormSubmitPanel.vue2.mjs +21 -20
- 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/modal/ConfirmModal.vue.mjs +1 -2
- package/es/components/modal/ConfirmModal.vue2.mjs +73 -94
- package/es/components/modal/DetailModal.vue.mjs +6 -6
- 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 +2 -2
- package/es/components/panel/PanelMain.vue2.mjs +52 -45
- package/es/components/panel/nest-panel-form.mjs +53 -0
- package/es/components/panel/nest-panel-item.mjs +25 -0
- package/es/index.mjs +182 -153
- package/es/inject/key.mjs +12 -6
- package/es/style.css +1 -1
- package/package.json +2 -2
- package/types/bridge/index.d.ts +3 -3
- package/types/bridge/theme.d.ts +22 -3
- 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/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/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 +2 -2
- package/types/inject/key.d.ts +28 -1
|
@@ -1,16 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import m from "lodash/cloneDeep";
|
|
2
|
+
const l = ["xs", "sm", "md", "lg", "xl"], d = [6, 8, 12, 24], p = (t, n = d) => {
|
|
3
|
+
const e = [...n].sort((o, i) => o - i), s = e[0], r = e[e.length - 1];
|
|
4
|
+
return t <= s ? s : t >= r ? r : e.find((o) => o >= t) ?? r;
|
|
5
|
+
}, O = (t) => {
|
|
6
|
+
if (!t) return 24;
|
|
7
|
+
if (typeof t.span == "number") return t.span;
|
|
8
|
+
for (const n of ["lg", "md", "sm", "xl", "xs"]) {
|
|
9
|
+
const e = t[n];
|
|
10
|
+
if (typeof e == "number") return e;
|
|
11
|
+
}
|
|
12
|
+
return 24;
|
|
13
|
+
}, T = (t, n = 1) => {
|
|
3
14
|
if (!t) return {};
|
|
4
|
-
const
|
|
5
|
-
return t.span !== void 0 &&
|
|
6
|
-
t[
|
|
7
|
-
}), n
|
|
8
|
-
|
|
15
|
+
const e = { ...t };
|
|
16
|
+
return t.span !== void 0 && l.forEach((s) => {
|
|
17
|
+
t[s] === void 0 && (e[s] = t.span);
|
|
18
|
+
}), n === 1 || (typeof e.span == "number" && (e.span = p(e.span * n)), l.forEach((s) => {
|
|
19
|
+
typeof e[s] == "number" && (e[s] = p(e[s] * n));
|
|
20
|
+
})), e;
|
|
21
|
+
}, D = () => {
|
|
9
22
|
const t = /* @__PURE__ */ new Date(), n = new Date(
|
|
10
23
|
t.getFullYear(),
|
|
11
24
|
t.getMonth(),
|
|
12
25
|
t.getDate()
|
|
13
|
-
), e = new Date(n.getTime() + 864e5 - 1), s = new Date(n.getTime() - 864e5), r = new Date(n.getTime() - 1),
|
|
26
|
+
), e = new Date(n.getTime() + 864e5 - 1), s = new Date(n.getTime() - 864e5), r = new Date(n.getTime() - 1), o = new Date(n.getTime() - 6 * 864e5);
|
|
14
27
|
return [
|
|
15
28
|
{
|
|
16
29
|
text: "今日",
|
|
@@ -22,54 +35,54 @@ const m = ["xs", "sm", "md", "lg", "xl"], O = (t) => {
|
|
|
22
35
|
},
|
|
23
36
|
{
|
|
24
37
|
text: "近7日",
|
|
25
|
-
value: () => [
|
|
38
|
+
value: () => [o, e]
|
|
26
39
|
}
|
|
27
40
|
];
|
|
28
|
-
},
|
|
41
|
+
}, f = (t) => {
|
|
29
42
|
const { ignore: n, key: e } = t;
|
|
30
43
|
return n || e.startsWith("__") && e.toUpperCase() === e;
|
|
31
|
-
},
|
|
32
|
-
(n, e) => (
|
|
44
|
+
}, y = (t) => typeof t == "function", E = (t) => t.reduce(
|
|
45
|
+
(n, e) => (f(e) || (typeof e.init == "object" && console.error(
|
|
33
46
|
`表单项${e.label}的初始值不能为对象 请设置为返回值的形式`
|
|
34
|
-
), n[e.key] =
|
|
47
|
+
), n[e.key] = y(e.init) ? e.init() : e.init), n),
|
|
35
48
|
{}
|
|
36
|
-
),
|
|
37
|
-
const e =
|
|
49
|
+
), I = (t, n) => {
|
|
50
|
+
const e = m(t);
|
|
38
51
|
return n.reduce(
|
|
39
52
|
(s, r) => {
|
|
40
|
-
if (
|
|
53
|
+
if (f(r)) return s;
|
|
41
54
|
if (r.parse) {
|
|
42
|
-
const
|
|
55
|
+
const o = r.parse(
|
|
43
56
|
t[r.key],
|
|
44
57
|
s,
|
|
45
58
|
e
|
|
46
59
|
);
|
|
47
|
-
|
|
60
|
+
o !== void 0 && (s[r.key] = o);
|
|
48
61
|
} else
|
|
49
62
|
s[r.key] = t[r.key];
|
|
50
63
|
return s;
|
|
51
64
|
},
|
|
52
65
|
{}
|
|
53
66
|
);
|
|
54
|
-
},
|
|
55
|
-
const e =
|
|
67
|
+
}, _ = (t, n) => {
|
|
68
|
+
const e = m(t);
|
|
56
69
|
return n.reduce(
|
|
57
70
|
(s, r) => {
|
|
58
|
-
if (
|
|
71
|
+
if (f(r)) return s;
|
|
59
72
|
if (r.stringify) {
|
|
60
|
-
const
|
|
73
|
+
const o = r.stringify(
|
|
61
74
|
t[r.key],
|
|
62
75
|
s,
|
|
63
76
|
e
|
|
64
77
|
);
|
|
65
|
-
|
|
78
|
+
o !== void 0 && (s[r.key] = o);
|
|
66
79
|
} else
|
|
67
80
|
s[r.key] = t[r.key];
|
|
68
81
|
return s;
|
|
69
82
|
},
|
|
70
83
|
{}
|
|
71
84
|
);
|
|
72
|
-
},
|
|
85
|
+
}, h = ({
|
|
73
86
|
modelValueKey: t = "modelValue",
|
|
74
87
|
config: n,
|
|
75
88
|
data: e,
|
|
@@ -81,58 +94,58 @@ const m = ["xs", "sm", "md", "lg", "xl"], O = (t) => {
|
|
|
81
94
|
[`onUpdate:${t}`]: (r) => {
|
|
82
95
|
s(r);
|
|
83
96
|
}
|
|
84
|
-
}),
|
|
97
|
+
}), k = (t) => {
|
|
85
98
|
var n, e;
|
|
86
99
|
return (n = t.extra) != null && n.isInput ? {
|
|
87
100
|
placeholder: `请输入${t.label}`
|
|
88
101
|
} : (e = t.extra) != null && e.isSelect ? {
|
|
89
102
|
placeholder: `请选择${t.label}`
|
|
90
103
|
} : {};
|
|
91
|
-
},
|
|
104
|
+
}, C = (t, n) => {
|
|
92
105
|
const { extra: e } = t;
|
|
93
106
|
if (e != null && e.enterSubmit)
|
|
94
107
|
return {
|
|
95
108
|
onKeyup: (s) => {
|
|
96
|
-
var r,
|
|
97
|
-
s.key === "Enter" && (n(), (
|
|
109
|
+
var r, o;
|
|
110
|
+
s.key === "Enter" && (n(), (o = (r = s.target) == null ? void 0 : r.blur) == null || o.call(r));
|
|
98
111
|
}
|
|
99
112
|
};
|
|
100
|
-
},
|
|
113
|
+
}, N = (t, n) => {
|
|
101
114
|
const { extra: e } = t;
|
|
102
115
|
if (e != null && e.isInput && ((e == null ? void 0 : e.blurSubmit) ?? !0))
|
|
103
116
|
return {
|
|
104
117
|
onBlur: n
|
|
105
118
|
};
|
|
106
|
-
},
|
|
119
|
+
}, w = (t, n) => {
|
|
107
120
|
const { extra: e } = t;
|
|
108
121
|
if (e != null && e.isSelect && ((e == null ? void 0 : e.changeSubmit) ?? !0))
|
|
109
122
|
return {
|
|
110
123
|
onChange: n
|
|
111
124
|
};
|
|
112
|
-
},
|
|
113
|
-
p.push(...t);
|
|
114
|
-
}, F = (t) => {
|
|
125
|
+
}, F = Symbol("FORM_ITEM_CHANGE_LOADING"), S = (t) => t.required === !0, a = [], g = [], v = (t) => {
|
|
115
126
|
a.push(...t);
|
|
116
|
-
},
|
|
127
|
+
}, L = (t) => {
|
|
128
|
+
g.push(...t);
|
|
129
|
+
}, M = (t) => {
|
|
117
130
|
const { label: n, type: e, ...s } = t;
|
|
118
131
|
let r;
|
|
119
132
|
if (e)
|
|
120
133
|
r = e;
|
|
121
134
|
else {
|
|
122
|
-
const { render:
|
|
123
|
-
|
|
135
|
+
const { render: u } = t;
|
|
136
|
+
u && (a.includes(u) ? r = "input" : g.includes(u) && (r = "select"));
|
|
124
137
|
}
|
|
125
|
-
let
|
|
126
|
-
r === "input" && (
|
|
138
|
+
let o;
|
|
139
|
+
r === "input" && (o = {
|
|
127
140
|
...s.extra || {},
|
|
128
141
|
isInput: !0
|
|
129
|
-
}), r === "select" && (
|
|
142
|
+
}), r === "select" && (o = {
|
|
130
143
|
...s.extra || {},
|
|
131
144
|
isSelect: !0
|
|
132
145
|
});
|
|
133
|
-
let
|
|
134
|
-
if (
|
|
135
|
-
|
|
146
|
+
let i;
|
|
147
|
+
if (S(t)) {
|
|
148
|
+
i = [
|
|
136
149
|
{
|
|
137
150
|
required: !0,
|
|
138
151
|
message: `请${{
|
|
@@ -143,33 +156,36 @@ const m = ["xs", "sm", "md", "lg", "xl"], O = (t) => {
|
|
|
143
156
|
trigger: "blur"
|
|
144
157
|
}
|
|
145
158
|
];
|
|
146
|
-
const { required:
|
|
159
|
+
const { required: u, ...c } = s;
|
|
147
160
|
return {
|
|
148
161
|
label: n,
|
|
149
|
-
extra:
|
|
150
|
-
rules:
|
|
151
|
-
...
|
|
162
|
+
extra: o,
|
|
163
|
+
rules: i,
|
|
164
|
+
...c
|
|
152
165
|
};
|
|
153
166
|
} else
|
|
154
167
|
return {
|
|
155
168
|
label: n,
|
|
156
|
-
extra:
|
|
169
|
+
extra: o,
|
|
157
170
|
...s
|
|
158
171
|
};
|
|
159
172
|
};
|
|
160
173
|
export {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
k as
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
F as FORM_ITEM_CHANGE_LOADING,
|
|
175
|
+
d as NEST_LAYOUT_TIERS,
|
|
176
|
+
p as ceilToTier,
|
|
177
|
+
E as generateFormData,
|
|
178
|
+
N as getBlurSubmit,
|
|
179
|
+
w as getChangeSubmit,
|
|
180
|
+
D as getDatePickerShortcuts,
|
|
181
|
+
C as getEnterSubmit,
|
|
182
|
+
k as getPlaceholder,
|
|
183
|
+
h as getVModelSugar,
|
|
184
|
+
I as parseFormData,
|
|
185
|
+
T as resolveFormLayout,
|
|
186
|
+
O as resolveLayoutSpan,
|
|
187
|
+
v as setInputComponent,
|
|
188
|
+
L as setSelectComponent,
|
|
189
|
+
_ as stringifyFormData,
|
|
190
|
+
M as swiftFormItemConfig
|
|
175
191
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import o from "./ConfirmModal.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
|
-
/* empty css */
|
|
4
3
|
import r from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
5
|
-
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-26598cb2"]]);
|
|
6
5
|
export {
|
|
7
6
|
f as default
|
|
8
7
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElDialog as
|
|
3
|
-
|
|
4
|
-
const D = { class: "main" }, F = { class: "shim" }, L = { class: "title" }, M = { class: "content" }, P = ["reverse"], q = /* @__PURE__ */ H({
|
|
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({
|
|
5
4
|
inheritAttrs: !1,
|
|
6
5
|
__name: "ConfirmModal",
|
|
7
6
|
props: {
|
|
@@ -15,7 +14,7 @@ const D = { class: "main" }, F = { class: "shim" }, L = { class: "title" }, M =
|
|
|
15
14
|
cancelText: { type: [String, Function], default: "取消" },
|
|
16
15
|
confirmText: { type: [String, Function], default: "确定" },
|
|
17
16
|
hiddenCancel: { type: Boolean, default: !1 },
|
|
18
|
-
width: { default:
|
|
17
|
+
width: { default: 420 },
|
|
19
18
|
reverse: { type: Boolean, default: !1 },
|
|
20
19
|
closeOnPressEscape: { type: Boolean, default: !0 },
|
|
21
20
|
closeOnClickModal: { type: Boolean, default: !0 },
|
|
@@ -23,113 +22,93 @@ const D = { class: "main" }, F = { class: "shim" }, L = { class: "title" }, M =
|
|
|
23
22
|
type: { default: "primary" }
|
|
24
23
|
},
|
|
25
24
|
emits: ["update:show"],
|
|
26
|
-
setup(e, { emit:
|
|
27
|
-
const
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
var t;
|
|
32
|
-
if (await ((t = o.onCancel) == null ? void 0 : t.call(o)) === !1) {
|
|
33
|
-
console.log("确认弹窗 onCancel 返回false,不关闭弹窗");
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
i(!1);
|
|
37
|
-
}, g = 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 () => {
|
|
38
30
|
var n;
|
|
39
|
-
|
|
31
|
+
await ((n = t.onCancel) == null ? void 0 : n.call(t)) !== !1 && f(!1);
|
|
32
|
+
}, C = async () => {
|
|
33
|
+
var o;
|
|
34
|
+
c.value = !0;
|
|
40
35
|
try {
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
i(!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);
|
|
47
39
|
} catch {
|
|
48
|
-
|
|
40
|
+
c.value = !1;
|
|
49
41
|
}
|
|
50
|
-
},
|
|
51
|
-
|
|
42
|
+
}, T = () => {
|
|
43
|
+
f(!1);
|
|
52
44
|
};
|
|
53
|
-
return (
|
|
45
|
+
return (o, n) => (l(), s(r(D), {
|
|
54
46
|
"model-value": e.show,
|
|
55
|
-
class: "confirm-
|
|
47
|
+
class: "confirm-modal",
|
|
56
48
|
width: e.width,
|
|
57
|
-
"show-close":
|
|
49
|
+
"show-close": e.showClose,
|
|
58
50
|
"append-to-body": "",
|
|
59
51
|
"align-center": "",
|
|
60
52
|
"close-on-click-modal": e.closeOnClickModal,
|
|
61
53
|
"close-on-press-escape": e.closeOnPressEscape,
|
|
62
|
-
onClose:
|
|
54
|
+
onClose: T
|
|
63
55
|
}, {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
e.hiddenCancel ? B("", !0) : (l(), d(a(x), {
|
|
91
|
-
key: 0,
|
|
92
|
-
class: "btn cancel-btn",
|
|
93
|
-
btnHover: "",
|
|
94
|
-
onClick: v
|
|
95
|
-
}, {
|
|
96
|
-
default: r(() => [
|
|
97
|
-
f(u(typeof e.cancelText == "function" ? e.cancelText() : e.cancelText), 1)
|
|
98
|
-
]),
|
|
99
|
-
_: 1
|
|
100
|
-
})),
|
|
101
|
-
C(a(x), {
|
|
102
|
-
type: e.type,
|
|
103
|
-
class: "btn confirm-btn",
|
|
104
|
-
loading: h.value,
|
|
105
|
-
onClick: g
|
|
106
|
-
}, {
|
|
107
|
-
default: r(() => [
|
|
108
|
-
f(u(typeof e.confirmText == "function" ? e.confirmText() : e.confirmText), 1)
|
|
109
|
-
]),
|
|
110
|
-
_: 1
|
|
111
|
-
}, 8, ["type", "loading"])
|
|
112
|
-
], !0)
|
|
113
|
-
], 8, P)
|
|
114
|
-
]),
|
|
115
|
-
e.showClose ? (l(), y("div", {
|
|
116
|
-
key: 0,
|
|
117
|
-
class: "close-box",
|
|
118
|
-
onClick: t[0] || (t[0] = (z) => i())
|
|
119
|
-
}, [
|
|
120
|
-
C(a(V), { size: 22 }, {
|
|
121
|
-
default: r(() => [
|
|
122
|
-
C(a($))
|
|
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)
|
|
123
82
|
]),
|
|
124
83
|
_: 1
|
|
125
|
-
})
|
|
126
|
-
|
|
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)
|
|
93
|
+
]),
|
|
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)
|
|
127
106
|
])
|
|
128
107
|
]),
|
|
129
108
|
_: 3
|
|
130
|
-
}, 8, ["model-value", "width", "close-on-click-modal", "close-on-press-escape"]));
|
|
109
|
+
}, 8, ["model-value", "width", "show-close", "close-on-click-modal", "close-on-press-escape"]));
|
|
131
110
|
}
|
|
132
111
|
});
|
|
133
112
|
export {
|
|
134
|
-
|
|
113
|
+
P as default
|
|
135
114
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
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
|
|
3
|
-
import { stringifyFormData as
|
|
2
|
+
import M from "../form/FormMain.vue.mjs";
|
|
3
|
+
import { stringifyFormData as D } from "../form/utils.mjs";
|
|
4
4
|
import k from "./ConfirmModal.vue.mjs";
|
|
5
|
-
const
|
|
5
|
+
const P = /* @__PURE__ */ w({
|
|
6
6
|
__name: "DetailModal",
|
|
7
7
|
props: {
|
|
8
8
|
data: {},
|
|
@@ -26,7 +26,7 @@ const $ = /* @__PURE__ */ w({
|
|
|
26
26
|
var o;
|
|
27
27
|
return (o = l.value) == null ? void 0 : o.validate().then(async () => {
|
|
28
28
|
var d, r;
|
|
29
|
-
const e =
|
|
29
|
+
const e = D(t.data, t.list);
|
|
30
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 = () => {
|
|
@@ -48,7 +48,7 @@ const $ = /* @__PURE__ */ w({
|
|
|
48
48
|
"onUpdate:show": m
|
|
49
49
|
}, {
|
|
50
50
|
default: A(() => [
|
|
51
|
-
W(v(
|
|
51
|
+
W(v(M), C({
|
|
52
52
|
ref_key: "formMain",
|
|
53
53
|
ref: l,
|
|
54
54
|
list: a.list,
|
|
@@ -63,5 +63,5 @@ const $ = /* @__PURE__ */ w({
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
export {
|
|
66
|
-
|
|
66
|
+
P as default
|
|
67
67
|
};
|
|
@@ -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
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9c14b584"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|