@done-coding/admin-core 0.17.0 → 0.17.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/es/components/app-layout/AppBody.vue.mjs +2 -2
- package/es/components/app-layout/AppBody.vue2.mjs +53 -54
- package/es/components/app-layout/keep-alive.mjs +22 -0
- package/es/components/data-view/DataListView.vue.mjs +2 -2
- package/es/components/data-view/DataListView.vue2.mjs +55 -53
- package/es/components/display/ActionConfirm.vue.mjs +2 -2
- package/es/components/display/ActionConfirm.vue2.mjs +1 -1
- package/es/components/display/TabsRefineFlow.vue.mjs +34 -32
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +74 -75
- package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
- package/es/components/misc/AutoRefreshGroup.vue2.mjs +42 -35
- package/es/components/modal/{ConfirmModal.vue.mjs → ModalConfirm.vue.mjs} +3 -3
- package/es/components/modal/{ConfirmModal.vue2.mjs → ModalConfirm.vue2.mjs} +34 -34
- package/es/components/modal/ModalDetail.vue.mjs +63 -0
- package/es/components/modal/ModalDetail.vue2.mjs +4 -0
- package/es/components/modal/ModalForm.vue.mjs +75 -0
- package/es/components/modal/ModalForm.vue2.mjs +4 -0
- package/es/components/panel/PanelItem.vue.mjs +5 -81
- package/es/components/panel/PanelItem.vue2.mjs +93 -2
- package/es/components/panel/PanelMain.vue2.mjs +14 -14
- package/es/components/table/TableMain.vue.mjs +2 -2
- package/es/components/table/TableMain.vue2.mjs +210 -174
- package/es/components/table/TableSkeleton.vue.mjs +7 -0
- package/es/components/table/TableSkeleton.vue2.mjs +89 -0
- package/es/components/table/TableToolbar.vue.mjs +2 -2
- package/es/components/table/TableToolbar.vue2.mjs +22 -21
- package/es/components/table/use-fill-height.mjs +14 -0
- package/es/components/table/use-table-skeleton.mjs +19 -0
- package/es/index.mjs +230 -223
- package/es/router/group-redirect.mjs +20 -0
- package/es/style.css +1 -1
- package/package.json +2 -2
- package/types/components/app-layout/keep-alive.d.ts +14 -0
- package/types/components/data-view/types.d.ts +1 -0
- package/types/components/misc/AutoRefreshGroup.vue.d.ts +2 -1
- package/types/components/misc/types.d.ts +1 -0
- package/types/components/modal/{ConfirmModal.vue.d.ts → ModalConfirm.vue.d.ts} +1 -1
- package/types/components/modal/{DetailModal.vue.d.ts → ModalDetail.vue.d.ts} +2 -2
- package/types/components/modal/ModalForm.vue.d.ts +24 -0
- package/types/components/modal/index.d.ts +4 -3
- package/types/components/modal/types.d.ts +26 -2
- package/types/components/panel/PanelItem.vue.d.ts +1 -1
- package/types/components/panel/types.d.ts +4 -1
- package/types/components/table/TableSkeleton.vue.d.ts +7 -0
- package/types/components/table/types.d.ts +10 -0
- package/types/components/table/use-fill-height.d.ts +11 -0
- package/types/components/table/use-table-skeleton.d.ts +17 -0
- package/types/injectInfo.json.d.ts +1 -1
- package/types/router/group-redirect.d.ts +5 -0
- package/types/router/index.d.ts +1 -0
- package/es/components/modal/DetailModal.vue.mjs +0 -74
- package/es/components/modal/DetailModal.vue2.mjs +0 -4
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { vLoading as
|
|
3
|
-
import
|
|
4
|
-
import { generateFormData as
|
|
5
|
-
import { useListPageSticky as
|
|
1
|
+
import { defineComponent as Re, useCssVars as Ve, unref as i, useSlots as Ie, computed as s, useModel as C, ref as u, shallowRef as q, watch as Ae, withDirectives as Me, openBlock as k, createBlock as H, normalizeClass as Be, withCtx as n, createVNode as N, mergeProps as R, createSlots as E, renderSlot as f, normalizeProps as V, guardReactiveProps as I, renderList as A, createCommentVNode as U, mergeModels as J } from "vue";
|
|
2
|
+
import { vLoading as $e } from "element-plus";
|
|
3
|
+
import Fe from "../form/FormSearch.vue.mjs";
|
|
4
|
+
import { generateFormData as Pe, stringifyFormData as je } from "../form/utils.mjs";
|
|
5
|
+
import { useListPageSticky as ze } from "./use-sticky.mjs";
|
|
6
6
|
import Q from "../display/WatchSize.vue.mjs";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
7
|
+
import De from "../table/TableMain.vue.mjs";
|
|
8
|
+
import Oe from "../slot-layout/SlotLayoutFlowAside.vue.mjs";
|
|
9
|
+
import xe from "lodash/pick";
|
|
10
|
+
import Le from "lodash/cloneDeep";
|
|
11
11
|
import { useChannelViewportHeight as Te } from "../../hooks/use-channel-viewport-height.mjs";
|
|
12
|
-
const
|
|
12
|
+
const Ze = /* @__PURE__ */ Re({
|
|
13
13
|
__name: "ListPage",
|
|
14
14
|
props: /* @__PURE__ */ J({
|
|
15
15
|
staticQuery: { default: () => ({}) },
|
|
@@ -46,61 +46,61 @@ const Ye = /* @__PURE__ */ He({
|
|
|
46
46
|
}),
|
|
47
47
|
emits: /* @__PURE__ */ J(["dataChange", "pageInfoChange"], ["update:isAutoRefresh", "update:refreshInterval", "update:customView"]),
|
|
48
48
|
setup(a, { expose: W, emit: G }) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
Ve((e) => ({
|
|
50
|
+
v9b019db8: ue.value,
|
|
51
|
+
v676bd8af: i(oe),
|
|
52
|
+
v9dcea7f4: i(se),
|
|
53
|
+
v82e6163c: i(ie)
|
|
54
54
|
}));
|
|
55
|
-
const o = a,
|
|
55
|
+
const o = a, M = G, B = Ie(), $ = s(() => !!B.header), F = s(() => !!B.operation), m = C(a, "isAutoRefresh"), P = C(a, "refreshInterval"), j = C(a, "customView"), y = u({}), S = u(
|
|
56
56
|
{}
|
|
57
|
-
), z = u(!1), l = q(), c = q(), { viewportHeightFinal:
|
|
57
|
+
), z = u(!1), X = s(() => !m.value && z.value), l = q(), c = q(), { viewportHeightFinal: Y } = Te(o), w = u(0), D = u(0), O = u(0), Z = s(() => ({
|
|
58
58
|
...S.value,
|
|
59
59
|
...o.staticQuery
|
|
60
|
-
})), b = u(!1),
|
|
61
|
-
layoutRoot:
|
|
62
|
-
searchStickyActive:
|
|
63
|
-
toolbarStickyActive:
|
|
64
|
-
pagerStickyActive:
|
|
65
|
-
searchStickyTop:
|
|
66
|
-
toolbarStickyTop:
|
|
67
|
-
pagerStickyBottom:
|
|
68
|
-
} =
|
|
60
|
+
})), b = u(!1), _ = s(() => b.value ? w.value + 10 : 0), {
|
|
61
|
+
layoutRoot: ee,
|
|
62
|
+
searchStickyActive: te,
|
|
63
|
+
toolbarStickyActive: ae,
|
|
64
|
+
pagerStickyActive: re,
|
|
65
|
+
searchStickyTop: oe,
|
|
66
|
+
toolbarStickyTop: se,
|
|
67
|
+
pagerStickyBottom: ie
|
|
68
|
+
} = ze({
|
|
69
69
|
searchSticky: () => o.searchSticky,
|
|
70
70
|
toolbarSticky: () => o.toolbarSticky,
|
|
71
71
|
pagerSticky: () => o.pagerSticky,
|
|
72
72
|
separateSearch: () => o.separateSearch,
|
|
73
73
|
searchHeight: () => w.value,
|
|
74
74
|
showSearch: () => b.value
|
|
75
|
-
}),
|
|
75
|
+
}), le = s(() => F.value ? D.value + 10 : 0), ne = s(() => $.value ? O.value + 10 : 0), p = s(() => Y.value - o.refineReduceHeight), ue = s(() => o.refine ? `${p.value}px` : "auto"), ce = s(() => {
|
|
76
76
|
if (o.refine)
|
|
77
|
-
return o.separateSearch ? p.value : p.value -
|
|
78
|
-
}),
|
|
77
|
+
return o.separateSearch ? p.value : p.value - _.value - le.value - ne.value;
|
|
78
|
+
}), he = s(
|
|
79
79
|
() => o.refine ? `${p.value}px` : "100vh"
|
|
80
80
|
), x = (e, t = "search") => {
|
|
81
|
-
var
|
|
81
|
+
var v, g, r;
|
|
82
82
|
let h = e;
|
|
83
83
|
if (o.beforeSearch && (h = o.beforeSearch(
|
|
84
|
-
|
|
84
|
+
Le(e),
|
|
85
85
|
t
|
|
86
|
-
)), t === "reset" && o.clearTableFilterOnReset && ((
|
|
86
|
+
)), t === "reset" && o.clearTableFilterOnReset && ((g = (v = c.value) == null ? void 0 : v.getTableInstance()) == null || g.clearFilter()), JSON.stringify(h) === JSON.stringify(S.value))
|
|
87
87
|
return ["reset", "search"].includes(t) ? (r = c.value) == null ? void 0 : r.reload() : void 0;
|
|
88
88
|
S.value = {
|
|
89
89
|
...h
|
|
90
90
|
};
|
|
91
|
-
}, he = (e) => {
|
|
92
|
-
B("dataChange", e);
|
|
93
91
|
}, fe = (e) => {
|
|
94
|
-
|
|
92
|
+
M("dataChange", e);
|
|
93
|
+
}, ve = (e) => {
|
|
94
|
+
M("pageInfoChange", e);
|
|
95
95
|
}, ge = (e) => {
|
|
96
96
|
z.value = e;
|
|
97
|
-
}, ve = (e) => {
|
|
98
|
-
w.value = e;
|
|
99
97
|
}, de = (e) => {
|
|
100
|
-
|
|
98
|
+
w.value = e;
|
|
101
99
|
}, pe = (e) => {
|
|
100
|
+
D.value = e;
|
|
101
|
+
}, me = (e) => {
|
|
102
102
|
O.value = e;
|
|
103
|
-
},
|
|
103
|
+
}, ye = s(() => o.list), Se = s(() => o.rowKey), L = s(() => y.value), T = {
|
|
104
104
|
refresh: async (e = !1) => {
|
|
105
105
|
var t;
|
|
106
106
|
return (t = c.value) == null ? void 0 : t.refresh(e);
|
|
@@ -145,8 +145,8 @@ const Ye = /* @__PURE__ */ He({
|
|
|
145
145
|
update: (e, t) => {
|
|
146
146
|
y.value[e] = t;
|
|
147
147
|
}
|
|
148
|
-
},
|
|
149
|
-
const e =
|
|
148
|
+
}, we = s(() => {
|
|
149
|
+
const e = xe(T, [
|
|
150
150
|
"triggerReset",
|
|
151
151
|
"triggerSearch",
|
|
152
152
|
"update"
|
|
@@ -155,57 +155,56 @@ const Ye = /* @__PURE__ */ He({
|
|
|
155
155
|
...o.injectInfo || {},
|
|
156
156
|
...e
|
|
157
157
|
};
|
|
158
|
-
}),
|
|
158
|
+
}), be = (e) => e, Ce = (e) => e, ke = (e) => e, He = (e) => {
|
|
159
159
|
b.value = e;
|
|
160
160
|
};
|
|
161
|
-
return W(
|
|
161
|
+
return W(T), Ae(
|
|
162
162
|
() => o.list,
|
|
163
163
|
(e) => {
|
|
164
|
-
const t =
|
|
165
|
-
y.value = t, x(
|
|
164
|
+
const t = Pe(e);
|
|
165
|
+
y.value = t, x(je(t, e));
|
|
166
166
|
},
|
|
167
167
|
{
|
|
168
168
|
immediate: !0
|
|
169
169
|
}
|
|
170
170
|
), (e, t) => {
|
|
171
|
-
var h,
|
|
172
|
-
return
|
|
171
|
+
var h, v, g;
|
|
172
|
+
return Me((k(), H(i(Oe), {
|
|
173
173
|
ref_key: "layoutRoot",
|
|
174
|
-
ref:
|
|
175
|
-
"element-loading-background": "rgba(122, 122, 122, 0.5)",
|
|
174
|
+
ref: ee,
|
|
176
175
|
class: Be(["dc-list-page list-page", {
|
|
177
|
-
"list-page_search-sticky": i(
|
|
178
|
-
"list-page_toolbar-sticky": i(
|
|
179
|
-
"list-page_pager-sticky": i(
|
|
176
|
+
"list-page_search-sticky": i(te),
|
|
177
|
+
"list-page_toolbar-sticky": i(ae),
|
|
178
|
+
"list-page_pager-sticky": i(re)
|
|
180
179
|
}]),
|
|
181
180
|
separate: a.separateSearch,
|
|
182
181
|
type: (h = a.separateSearchConfig) == null ? void 0 : h.type,
|
|
183
|
-
gap: (
|
|
184
|
-
"aside-width": (
|
|
185
|
-
"aside-max-height":
|
|
182
|
+
gap: (v = a.separateSearchConfig) == null ? void 0 : v.gap,
|
|
183
|
+
"aside-width": (g = a.separateSearchConfig) == null ? void 0 : g.asideWidth,
|
|
184
|
+
"aside-max-height": he.value
|
|
186
185
|
}, {
|
|
187
186
|
aside: n(() => [
|
|
188
187
|
$.value ? (k(), H(i(Q), {
|
|
189
188
|
key: 0,
|
|
190
189
|
class: "list-page-header",
|
|
191
190
|
"observe-resize": a.headerObserveResize,
|
|
192
|
-
onHeightChange:
|
|
191
|
+
onHeightChange: me
|
|
193
192
|
}, {
|
|
194
193
|
default: n(() => [
|
|
195
194
|
f(e.$slots, "header", {}, void 0, !0)
|
|
196
195
|
]),
|
|
197
196
|
_: 3
|
|
198
197
|
}, 8, ["observe-resize"])) : U("", !0),
|
|
199
|
-
N(i(
|
|
198
|
+
N(i(Fe), R({
|
|
200
199
|
ref_key: "formSearch",
|
|
201
200
|
ref: l,
|
|
202
|
-
list:
|
|
203
|
-
data:
|
|
201
|
+
list: ye.value,
|
|
202
|
+
data: L.value
|
|
204
203
|
}, a.formSearchProps, {
|
|
205
204
|
compact: a.separateSearch,
|
|
206
205
|
onSearch: x,
|
|
207
|
-
onHeightChange:
|
|
208
|
-
onVisibleChange:
|
|
206
|
+
onHeightChange: de,
|
|
207
|
+
onVisibleChange: He
|
|
209
208
|
}), E({ _: 2 }, [
|
|
210
209
|
A(a.list, (r) => ({
|
|
211
210
|
name: r.key,
|
|
@@ -218,7 +217,7 @@ const Ye = /* @__PURE__ */ He({
|
|
|
218
217
|
key: 1,
|
|
219
218
|
class: "list-page-operation",
|
|
220
219
|
"observe-resize": a.operationObserveResize,
|
|
221
|
-
onHeightChange:
|
|
220
|
+
onHeightChange: pe
|
|
222
221
|
}, {
|
|
223
222
|
default: n(() => [
|
|
224
223
|
f(e.$slots, "operation", {}, void 0, !0)
|
|
@@ -227,7 +226,7 @@ const Ye = /* @__PURE__ */ He({
|
|
|
227
226
|
}, 8, ["observe-resize"])) : U("", !0)
|
|
228
227
|
]),
|
|
229
228
|
default: n(() => [
|
|
230
|
-
N(i(
|
|
229
|
+
N(i(De), R({
|
|
231
230
|
ref_key: "tableMain",
|
|
232
231
|
ref: c,
|
|
233
232
|
"is-auto-refresh": m.value,
|
|
@@ -238,27 +237,27 @@ const Ye = /* @__PURE__ */ He({
|
|
|
238
237
|
"onUpdate:customView": t[2] || (t[2] = (r) => j.value = r),
|
|
239
238
|
api: a.api,
|
|
240
239
|
columns: a.columns,
|
|
241
|
-
query:
|
|
242
|
-
maxHeight:
|
|
243
|
-
rowKey:
|
|
240
|
+
query: Z.value,
|
|
241
|
+
maxHeight: ce.value,
|
|
242
|
+
rowKey: Se.value,
|
|
244
243
|
toolbar: a.toolbar,
|
|
245
244
|
showSwitchView: a.showSwitchView
|
|
246
245
|
}, a.tableMainProps, {
|
|
247
246
|
refine: !1,
|
|
248
|
-
injectInfo:
|
|
247
|
+
injectInfo: we.value,
|
|
249
248
|
onLoadingChange: ge,
|
|
250
|
-
onDataChange:
|
|
251
|
-
onPageInfoChange:
|
|
249
|
+
onDataChange: fe,
|
|
250
|
+
onPageInfoChange: ve
|
|
252
251
|
}), E({
|
|
253
252
|
"custom-view-item": n((r) => [
|
|
254
|
-
f(e.$slots, "custom-view-item", V(I(
|
|
253
|
+
f(e.$slots, "custom-view-item", V(I(ke(r))), void 0, !0)
|
|
255
254
|
]),
|
|
256
255
|
_: 2
|
|
257
256
|
}, [
|
|
258
257
|
A(a.columns, (r) => ({
|
|
259
258
|
name: r.prop,
|
|
260
259
|
fn: n((d) => [
|
|
261
|
-
f(e.$slots, `table-${r.prop}`, V(I(
|
|
260
|
+
f(e.$slots, `table-${r.prop}`, V(I(be(d))), void 0, !0)
|
|
262
261
|
])
|
|
263
262
|
})),
|
|
264
263
|
A(a.columns, (r) => ({
|
|
@@ -266,8 +265,8 @@ const Ye = /* @__PURE__ */ He({
|
|
|
266
265
|
fn: n((d) => {
|
|
267
266
|
var K;
|
|
268
267
|
return [
|
|
269
|
-
f(e.$slots, `table-header-${r.columnKey || r.prop}`, R(
|
|
270
|
-
searchFormData:
|
|
268
|
+
f(e.$slots, `table-header-${r.columnKey || r.prop}`, R(Ce(d), {
|
|
269
|
+
searchFormData: L.value,
|
|
271
270
|
triggerSearch: (K = l.value) == null ? void 0 : K.triggerSearch
|
|
272
271
|
}), void 0, !0)
|
|
273
272
|
];
|
|
@@ -277,11 +276,11 @@ const Ye = /* @__PURE__ */ He({
|
|
|
277
276
|
]),
|
|
278
277
|
_: 3
|
|
279
278
|
}, 8, ["class", "separate", "type", "gap", "aside-width", "aside-max-height"])), [
|
|
280
|
-
[i(
|
|
279
|
+
[i($e), X.value]
|
|
281
280
|
]);
|
|
282
281
|
};
|
|
283
282
|
}
|
|
284
283
|
});
|
|
285
284
|
export {
|
|
286
|
-
|
|
285
|
+
Ze as default
|
|
287
286
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AutoRefreshGroup.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b4bb0cd5"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { defineComponent as m, useModel as
|
|
2
|
-
import
|
|
3
|
-
import { ElButton as
|
|
4
|
-
import { Refresh as
|
|
1
|
+
import { defineComponent as m, useModel as i, openBlock as l, createBlock as a, unref as r, withCtx as n, createCommentVNode as f, createVNode as d, normalizeClass as h, mergeModels as R } from "vue";
|
|
2
|
+
import v from "./AutoRefresh.vue.mjs";
|
|
3
|
+
import { ElButton as A, ElIcon as c } from "element-plus";
|
|
4
|
+
import { Refresh as B } from "@element-plus/icons-vue";
|
|
5
|
+
import y from "../slot-layout/SlotLayoutTemplate.vue.mjs";
|
|
5
6
|
const V = /* @__PURE__ */ m({
|
|
6
7
|
__name: "AutoRefreshGroup",
|
|
7
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ R({
|
|
8
9
|
showAutoRefresh: { type: Boolean, default: !0 },
|
|
9
10
|
showRefresh: { type: Boolean, default: !0 },
|
|
10
11
|
loading: { type: Boolean },
|
|
12
|
+
needRootNode: { type: Boolean, default: !0 },
|
|
11
13
|
refreshFn: {}
|
|
12
14
|
}, {
|
|
13
15
|
isAutoRefresh: { type: Boolean },
|
|
@@ -17,36 +19,41 @@ const V = /* @__PURE__ */ m({
|
|
|
17
19
|
}),
|
|
18
20
|
emits: ["update:isAutoRefresh", "update:interval"],
|
|
19
21
|
setup(e) {
|
|
20
|
-
const
|
|
21
|
-
return (
|
|
22
|
-
e.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
22
|
+
const s = i(e, "isAutoRefresh"), u = i(e, "interval");
|
|
23
|
+
return (g, t) => (l(), a(r(y), {
|
|
24
|
+
disabled: !e.needRootNode
|
|
25
|
+
}, {
|
|
26
|
+
default: n(() => [
|
|
27
|
+
e.showAutoRefresh ? (l(), a(v, {
|
|
28
|
+
key: 0,
|
|
29
|
+
modelValue: s.value,
|
|
30
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => s.value = o),
|
|
31
|
+
interval: u.value,
|
|
32
|
+
"onUpdate:interval": t[1] || (t[1] = (o) => u.value = o),
|
|
33
|
+
refreshFn: e.refreshFn,
|
|
34
|
+
disabled: e.loading
|
|
35
|
+
}, null, 8, ["modelValue", "interval", "refreshFn", "disabled"])) : f("", !0),
|
|
36
|
+
e.showRefresh ? (l(), a(r(A), {
|
|
37
|
+
key: 1,
|
|
38
|
+
size: "small",
|
|
39
|
+
circle: "",
|
|
40
|
+
onClick: t[2] || (t[2] = (o) => e.refreshFn())
|
|
41
|
+
}, {
|
|
42
|
+
default: n(() => [
|
|
43
|
+
d(r(c), {
|
|
44
|
+
class: h({ "auto-refresh-group-icon--rotating": e.loading })
|
|
45
|
+
}, {
|
|
46
|
+
default: n(() => [
|
|
47
|
+
d(r(B))
|
|
48
|
+
]),
|
|
49
|
+
_: 1
|
|
50
|
+
}, 8, ["class"])
|
|
51
|
+
]),
|
|
52
|
+
_: 1
|
|
53
|
+
})) : f("", !0)
|
|
54
|
+
]),
|
|
55
|
+
_: 1
|
|
56
|
+
}, 8, ["disabled"]));
|
|
50
57
|
}
|
|
51
58
|
});
|
|
52
59
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import o from "./
|
|
1
|
+
import o from "./ModalConfirm.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import r from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
5
|
-
const
|
|
5
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-3d9e58a4"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
f as default
|
|
8
8
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElDrawer as
|
|
3
|
-
import { BODY_CONTENT_VIEWPORT_HEIGHT as
|
|
4
|
-
import { useActivated as
|
|
5
|
-
import { useObserveSize as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as A, computed as l, shallowRef as F, ref as w, inject as b, provide as D, openBlock as i, createBlock as s, resolveDynamicComponent as C, mergeProps as W, withCtx as r, createElementVNode as g, normalizeClass as G, renderSlot as c, createElementBlock as O, Fragment as x, createTextVNode as f, toDisplayString as u, unref as R, createCommentVNode as j, createVNode as X } from "vue";
|
|
2
|
+
import { ElDrawer as Y, ElDialog as q, ElButton as M } from "element-plus";
|
|
3
|
+
import { BODY_CONTENT_VIEWPORT_HEIGHT as p, SCOPE_VIEWPORT_MAX_HEIGHT as J } from "../../inject/key.mjs";
|
|
4
|
+
import { useActivated as K } from "../../hooks/activated.mjs";
|
|
5
|
+
import { useObserveSize as Q } from "../../hooks/use-observe-size.mjs";
|
|
6
|
+
const U = { class: "confirm-modal__title" }, Z = ["reverse"], ae = /* @__PURE__ */ A({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
|
-
__name: "
|
|
8
|
+
__name: "ModalConfirm",
|
|
9
9
|
props: {
|
|
10
10
|
show: { type: Boolean },
|
|
11
11
|
showClose: { type: Boolean, default: !0 },
|
|
@@ -25,30 +25,30 @@ const K = { class: "confirm-modal__title" }, Q = ["reverse"], oe = /* @__PURE__
|
|
|
25
25
|
type: { default: "primary" },
|
|
26
26
|
layerType: { default: "modal" },
|
|
27
27
|
direction: { default: "rtl" },
|
|
28
|
-
headerDivider: { type: Boolean, default:
|
|
29
|
-
footerDivider: { type: Boolean, default:
|
|
28
|
+
headerDivider: { type: Boolean, default: void 0 },
|
|
29
|
+
footerDivider: { type: Boolean, default: void 0 },
|
|
30
30
|
modalReserve: { default: 200 }
|
|
31
31
|
},
|
|
32
32
|
emits: ["update:show"],
|
|
33
|
-
setup(e, { emit:
|
|
34
|
-
const o = e,
|
|
33
|
+
setup(e, { emit: z }) {
|
|
34
|
+
const o = e, N = z, n = l(() => o.layerType === "drawer"), P = l(() => o.headerDivider ?? n.value), S = l(() => o.footerDivider ?? n.value), T = F(), m = w(0), v = b(p, void 0), V = l(
|
|
35
35
|
() => n.value ? m.value : (v == null ? void 0 : v.value) ?? 0
|
|
36
36
|
);
|
|
37
|
-
D(
|
|
37
|
+
D(p, V);
|
|
38
38
|
const B = w(
|
|
39
39
|
typeof window > "u" ? 0 : window.innerHeight
|
|
40
|
-
),
|
|
40
|
+
), h = () => {
|
|
41
41
|
B.value = window.innerHeight;
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
t.isActivated ? (
|
|
45
|
-
}), D(
|
|
43
|
+
K((t) => {
|
|
44
|
+
t.isActivated ? (h(), window.addEventListener("resize", h)) : window.removeEventListener("resize", h);
|
|
45
|
+
}), D(J, {
|
|
46
46
|
scope: void 0,
|
|
47
47
|
viewportMaxHeight: l(
|
|
48
48
|
() => n.value ? m.value : Math.max(0, B.value - o.modalReserve)
|
|
49
49
|
),
|
|
50
50
|
parent: void 0
|
|
51
|
-
}),
|
|
51
|
+
}), Q({
|
|
52
52
|
getTarget: () => {
|
|
53
53
|
var t;
|
|
54
54
|
return (t = T.value) == null ? void 0 : t.parentElement;
|
|
@@ -60,45 +60,45 @@ const K = { class: "confirm-modal__title" }, Q = ["reverse"], oe = /* @__PURE__
|
|
|
60
60
|
// 用 hook 默认 100ms 防抖:抽屉开合动画 / 视口变化时 RO 每帧回调写 drawerBodyHeight →
|
|
61
61
|
// provide computed 链 + 插槽内列表重算,防抖合并高频帧(leading 首帧即时给出可用高、不闪)。
|
|
62
62
|
});
|
|
63
|
-
const
|
|
63
|
+
const $ = l(() => n.value ? Y : q), I = l(
|
|
64
64
|
() => n.value ? { size: o.width, direction: o.direction } : { width: o.width, alignCenter: !0 }
|
|
65
|
-
), d = w(!1), E = l(() => o.useLoading && d.value),
|
|
65
|
+
), d = w(!1), E = l(() => o.useLoading && d.value), y = (t) => {
|
|
66
66
|
var a;
|
|
67
|
-
|
|
67
|
+
N("update:show", !1), (a = o.onClose) == null || a.call(o, t);
|
|
68
68
|
}, k = async () => {
|
|
69
69
|
var a;
|
|
70
|
-
await ((a = o.onCancel) == null ? void 0 : a.call(o)) !== !1 &&
|
|
70
|
+
await ((a = o.onCancel) == null ? void 0 : a.call(o)) !== !1 && y(!1);
|
|
71
71
|
}, H = async () => {
|
|
72
72
|
var t;
|
|
73
73
|
d.value = !0;
|
|
74
74
|
try {
|
|
75
75
|
const a = await ((t = o.onConfirm) == null ? void 0 : t.call(o));
|
|
76
76
|
if (d.value = !1, a === !1) return;
|
|
77
|
-
|
|
77
|
+
y(!0);
|
|
78
78
|
} catch {
|
|
79
79
|
d.value = !1;
|
|
80
80
|
}
|
|
81
|
-
},
|
|
82
|
-
|
|
81
|
+
}, L = () => {
|
|
82
|
+
y(!1);
|
|
83
83
|
};
|
|
84
|
-
return (t, a) => (i(), s(C(
|
|
84
|
+
return (t, a) => (i(), s(C($.value), W({ ...t.$attrs, ...I.value }, {
|
|
85
85
|
"model-value": e.show,
|
|
86
86
|
class: [
|
|
87
87
|
"dc-confirm-modal",
|
|
88
88
|
"confirm-modal",
|
|
89
89
|
{
|
|
90
|
-
"confirm-modal_header-divider":
|
|
91
|
-
"confirm-modal_footer-divider":
|
|
90
|
+
"confirm-modal_header-divider": P.value,
|
|
91
|
+
"confirm-modal_footer-divider": S.value
|
|
92
92
|
}
|
|
93
93
|
],
|
|
94
94
|
"show-close": e.showClose,
|
|
95
95
|
"append-to-body": "",
|
|
96
96
|
"close-on-click-modal": e.closeOnClickModal,
|
|
97
97
|
"close-on-press-escape": e.closeOnPressEscape,
|
|
98
|
-
onClose:
|
|
98
|
+
onClose: L
|
|
99
99
|
}), {
|
|
100
100
|
header: r(() => [
|
|
101
|
-
g("div",
|
|
101
|
+
g("div", U, [
|
|
102
102
|
c(t.$slots, "title", {}, () => [
|
|
103
103
|
typeof e.title == "function" ? (i(), s(C(e.title), { key: 0 })) : (i(), O(x, { key: 1 }, [
|
|
104
104
|
f(u(e.title), 1)
|
|
@@ -116,7 +116,7 @@ const K = { class: "confirm-modal__title" }, Q = ["reverse"], oe = /* @__PURE__
|
|
|
116
116
|
confirmHandler: H,
|
|
117
117
|
loading: E.value
|
|
118
118
|
}, () => [
|
|
119
|
-
e.hiddenCancel ?
|
|
119
|
+
e.hiddenCancel ? j("", !0) : (i(), s(R(M), {
|
|
120
120
|
key: 0,
|
|
121
121
|
class: "confirm-modal__cancel",
|
|
122
122
|
onClick: k
|
|
@@ -126,7 +126,7 @@ const K = { class: "confirm-modal__title" }, Q = ["reverse"], oe = /* @__PURE__
|
|
|
126
126
|
]),
|
|
127
127
|
_: 1
|
|
128
128
|
})),
|
|
129
|
-
|
|
129
|
+
X(R(M), {
|
|
130
130
|
class: "confirm-modal__confirm",
|
|
131
131
|
type: e.type,
|
|
132
132
|
loading: E.value,
|
|
@@ -138,13 +138,13 @@ const K = { class: "confirm-modal__title" }, Q = ["reverse"], oe = /* @__PURE__
|
|
|
138
138
|
_: 1
|
|
139
139
|
}, 8, ["type", "loading"])
|
|
140
140
|
], !0)
|
|
141
|
-
], 8,
|
|
141
|
+
], 8, Z)
|
|
142
142
|
]),
|
|
143
143
|
default: r(() => [
|
|
144
144
|
g("div", {
|
|
145
145
|
ref_key: "contentRef",
|
|
146
146
|
ref: T,
|
|
147
|
-
class:
|
|
147
|
+
class: G(["confirm-modal__content", { "confirm-modal__content_drawer": n.value }])
|
|
148
148
|
}, [
|
|
149
149
|
c(t.$slots, "main-header", {}, void 0, !0),
|
|
150
150
|
c(t.$slots, "default", {}, () => [
|
|
@@ -160,5 +160,5 @@ const K = { class: "confirm-modal__title" }, Q = ["reverse"], oe = /* @__PURE__
|
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
export {
|
|
163
|
-
|
|
163
|
+
ae as default
|
|
164
164
|
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { defineComponent as w, computed as i, openBlock as y, createBlock as p, withCtx as r, renderSlot as l } from "vue";
|
|
2
|
+
import b from "./ModalForm.vue.mjs";
|
|
3
|
+
const T = /* @__PURE__ */ w({
|
|
4
|
+
__name: "ModalDetail",
|
|
5
|
+
props: {
|
|
6
|
+
data: {},
|
|
7
|
+
list: {},
|
|
8
|
+
type: {},
|
|
9
|
+
title: {},
|
|
10
|
+
subTitle: {},
|
|
11
|
+
show: { type: Boolean },
|
|
12
|
+
addApi: {},
|
|
13
|
+
editApi: {},
|
|
14
|
+
width: { default: 600 },
|
|
15
|
+
formLayout: { default: () => ({ span: 24 }) },
|
|
16
|
+
formProps: {},
|
|
17
|
+
formRowGutter: {},
|
|
18
|
+
labelWidth: { default: "auto" },
|
|
19
|
+
layerType: {},
|
|
20
|
+
direction: {}
|
|
21
|
+
},
|
|
22
|
+
emits: ["update:show", "afterAdd", "afterEdit"],
|
|
23
|
+
setup(t, { emit: s }) {
|
|
24
|
+
const e = t, d = s, n = i(() => e.data), f = i(() => `${e.type === "add" ? "新增" : "编辑"}${e.subTitle || ""}`), u = i(() => e.title ?? f.value), m = (o) => {
|
|
25
|
+
const a = e.type === "add" ? e.addApi : e.editApi;
|
|
26
|
+
return (a == null ? void 0 : a(o)) ?? Promise.resolve();
|
|
27
|
+
}, c = (o) => {
|
|
28
|
+
d("update:show", o);
|
|
29
|
+
}, h = (o) => {
|
|
30
|
+
d(e.type === "add" ? "afterAdd" : "afterEdit", o);
|
|
31
|
+
};
|
|
32
|
+
return (o, a) => (y(), p(b, {
|
|
33
|
+
class: "dc-detail-modal",
|
|
34
|
+
title: u.value,
|
|
35
|
+
show: t.show,
|
|
36
|
+
list: t.list,
|
|
37
|
+
data: n.value,
|
|
38
|
+
submitFn: m,
|
|
39
|
+
width: t.width,
|
|
40
|
+
layerType: t.layerType,
|
|
41
|
+
direction: t.direction,
|
|
42
|
+
formLayout: t.formLayout,
|
|
43
|
+
labelWidth: t.labelWidth,
|
|
44
|
+
formRowGutter: t.formRowGutter,
|
|
45
|
+
formProps: t.formProps,
|
|
46
|
+
headerDivider: !1,
|
|
47
|
+
footerDivider: !1,
|
|
48
|
+
"onUpdate:show": c,
|
|
49
|
+
onSubmitSuccess: h
|
|
50
|
+
}, {
|
|
51
|
+
header: r(() => [
|
|
52
|
+
l(o.$slots, "header")
|
|
53
|
+
]),
|
|
54
|
+
footer: r(() => [
|
|
55
|
+
l(o.$slots, "footer")
|
|
56
|
+
]),
|
|
57
|
+
_: 3
|
|
58
|
+
}, 8, ["title", "show", "list", "data", "width", "layerType", "direction", "formLayout", "labelWidth", "formRowGutter", "formProps"]));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
export {
|
|
62
|
+
T as default
|
|
63
|
+
};
|