@duxweb/dvha-pro 1.0.23 → 1.0.24
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/dist/cjs/components/card/card.cjs +1 -1
- package/dist/cjs/components/card/store.cjs +1 -1
- package/dist/cjs/components/carousel/carousel.cjs +1 -1
- package/dist/cjs/components/crop/imageCrop.cjs +1 -1
- package/dist/cjs/components/crop/imageCropModal.cjs +1 -1
- package/dist/cjs/components/dashboard/hello.cjs +1 -1
- package/dist/cjs/components/dashboard/helloBig.cjs +1 -1
- package/dist/cjs/components/dashboard/quick.cjs +1 -1
- package/dist/cjs/components/data/dynamicData.cjs +1 -1
- package/dist/cjs/components/data/dynamicSelect.cjs +1 -1
- package/dist/cjs/components/data/selectModal.cjs +1 -1
- package/dist/cjs/components/dialog/dialog.cjs +1 -1
- package/dist/cjs/components/drawer/drawer.cjs +1 -1
- package/dist/cjs/components/drawer/drawerPage.cjs +1 -1
- package/dist/cjs/components/editor/aiEditor.cjs +1 -1
- package/dist/cjs/components/form/drawerForm.cjs +1 -1
- package/dist/cjs/components/form/formItem.cjs +1 -1
- package/dist/cjs/components/form/formLayout.cjs +1 -1
- package/dist/cjs/components/form/modalForm.cjs +1 -1
- package/dist/cjs/components/form/pageForm.cjs +1 -1
- package/dist/cjs/components/form/settingForm.cjs +1 -1
- package/dist/cjs/components/icon/iconPicker.cjs +1 -1
- package/dist/cjs/components/layout/filter.cjs +1 -1
- package/dist/cjs/components/layout/filterLayout.cjs +1 -1
- package/dist/cjs/components/layout/list.cjs +1 -1
- package/dist/cjs/components/layout/table.cjs +1 -1
- package/dist/cjs/components/layout/tools.cjs +1 -1
- package/dist/cjs/components/list/card.cjs +1 -1
- package/dist/cjs/components/list/list.cjs +1 -1
- package/dist/cjs/components/media/media.cjs +1 -1
- package/dist/cjs/components/modal/modal.cjs +1 -1
- package/dist/cjs/components/modal/modalPage.cjs +1 -1
- package/dist/cjs/components/modal/modalTab.cjs +1 -1
- package/dist/cjs/components/panel/alert.cjs +1 -1
- package/dist/cjs/components/panel/collapse.cjs +1 -1
- package/dist/cjs/components/panel/setting.cjs +1 -1
- package/dist/cjs/components/select/cardSelect.cjs +1 -1
- package/dist/cjs/components/status/listEmpty.cjs +1 -1
- package/dist/cjs/components/table/tablePage.cjs +1 -1
- package/dist/cjs/components/tree/treeFilter.cjs +1 -1
- package/dist/cjs/components/upload/config.cjs +1 -1
- package/dist/cjs/components/upload/file.cjs +1 -1
- package/dist/cjs/components/upload/image.cjs +1 -1
- package/dist/cjs/components/upload/manage/item.cjs +1 -1
- package/dist/cjs/components/upload/manager.cjs +1 -1
- package/dist/cjs/components/widget/connect.cjs +1 -1
- package/dist/cjs/dvha-pro.css +1 -1
- package/dist/cjs/hooks/action.cjs +1 -1
- package/dist/cjs/hooks/download.cjs +1 -1
- package/dist/cjs/hooks/echart.cjs +1 -1
- package/dist/cjs/hooks/image.cjs +1 -1
- package/dist/cjs/hooks/level.cjs +1 -1
- package/dist/cjs/hooks/table/color.cjs +1 -0
- package/dist/cjs/hooks/table/column.cjs +1 -1
- package/dist/cjs/hooks/table/image.cjs +1 -1
- package/dist/cjs/hooks/table/input.cjs +1 -1
- package/dist/cjs/hooks/table/map.cjs +1 -1
- package/dist/cjs/hooks/table/status.cjs +1 -1
- package/dist/cjs/hooks/table/switch.cjs +1 -1
- package/dist/cjs/hooks/table.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/pages/layout/global.cjs +1 -1
- package/dist/cjs/pages/layout/tab.cjs +1 -1
- package/dist/cjs/pages/login.cjs +1 -1
- package/dist/cjs/pages/menu/avatar.cjs +1 -1
- package/dist/cjs/pages/menu/button.cjs +1 -1
- package/dist/cjs/pages/menu/cmd.cjs +1 -1
- package/dist/cjs/pages/page.cjs +1 -1
- package/dist/cjs/pages/pageStatus.cjs +1 -1
- package/dist/cjs/stores/ui.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +2 -1
- package/dist/esm/components/card/card.js +24 -27
- package/dist/esm/components/card/store.js +33 -39
- package/dist/esm/components/carousel/carousel.js +16 -19
- package/dist/esm/components/crop/imageCrop.js +32 -35
- package/dist/esm/components/crop/imageCropModal.js +36 -37
- package/dist/esm/components/dashboard/hello.js +27 -30
- package/dist/esm/components/dashboard/helloBig.js +328 -331
- package/dist/esm/components/dashboard/quick.js +30 -33
- package/dist/esm/components/data/dynamicData.js +86 -98
- package/dist/esm/components/data/dynamicSelect.js +29 -31
- package/dist/esm/components/data/selectModal.js +45 -49
- package/dist/esm/components/dialog/dialog.js +54 -55
- package/dist/esm/components/drawer/drawer.js +23 -23
- package/dist/esm/components/drawer/drawerPage.js +39 -49
- package/dist/esm/components/editor/aiEditor.js +64 -70
- package/dist/esm/components/form/drawerForm.js +48 -48
- package/dist/esm/components/form/formItem.js +45 -51
- package/dist/esm/components/form/formLayout.js +7 -10
- package/dist/esm/components/form/modalForm.js +50 -50
- package/dist/esm/components/form/pageForm.js +47 -50
- package/dist/esm/components/form/settingForm.js +34 -37
- package/dist/esm/components/icon/iconPicker.js +54 -58
- package/dist/esm/components/layout/filter.js +13 -16
- package/dist/esm/components/layout/filterLayout.js +7 -10
- package/dist/esm/components/layout/list.js +299 -326
- package/dist/esm/components/layout/table.js +268 -283
- package/dist/esm/components/layout/tools.js +38 -41
- package/dist/esm/components/list/card.js +35 -38
- package/dist/esm/components/list/list.js +15 -18
- package/dist/esm/components/media/media.js +35 -36
- package/dist/esm/components/modal/modal.js +10 -10
- package/dist/esm/components/modal/modalPage.js +32 -36
- package/dist/esm/components/modal/modalTab.js +39 -45
- package/dist/esm/components/panel/alert.js +19 -22
- package/dist/esm/components/panel/collapse.js +33 -36
- package/dist/esm/components/panel/setting.js +25 -31
- package/dist/esm/components/select/cardSelect.js +27 -28
- package/dist/esm/components/status/listEmpty.js +13 -13
- package/dist/esm/components/table/tablePage.js +25 -25
- package/dist/esm/components/tree/treeFilter.js +137 -147
- package/dist/esm/components/upload/config.js +15 -27
- package/dist/esm/components/upload/file.js +90 -94
- package/dist/esm/components/upload/image.js +116 -123
- package/dist/esm/components/upload/manage/item.js +44 -47
- package/dist/esm/components/upload/manager.js +190 -207
- package/dist/esm/components/widget/connect.js +103 -106
- package/dist/esm/dvha-pro.css +1 -1
- package/dist/esm/hooks/action.js +115 -131
- package/dist/esm/hooks/download.js +55 -56
- package/dist/esm/hooks/echart.js +156 -179
- package/dist/esm/hooks/image.js +14 -15
- package/dist/esm/hooks/level.js +7 -7
- package/dist/esm/hooks/table/color.js +19 -0
- package/dist/esm/hooks/table/column.js +25 -23
- package/dist/esm/hooks/table/image.js +2 -2
- package/dist/esm/hooks/table/input.js +28 -28
- package/dist/esm/hooks/table/map.js +7 -7
- package/dist/esm/hooks/table/status.js +8 -9
- package/dist/esm/hooks/table/switch.js +19 -19
- package/dist/esm/hooks/table.js +27 -31
- package/dist/esm/index.js +167 -165
- package/dist/esm/pages/layout/global.js +12 -15
- package/dist/esm/pages/layout/tab.js +58 -71
- package/dist/esm/pages/login.js +81 -85
- package/dist/esm/pages/menu/avatar.js +136 -149
- package/dist/esm/pages/menu/button.js +16 -20
- package/dist/esm/pages/menu/cmd.js +68 -74
- package/dist/esm/pages/page.js +21 -25
- package/dist/esm/pages/pageStatus.js +21 -24
- package/dist/esm/stores/ui.js +15 -15
- package/dist/esm/theme/uno.css.js +2 -1
- package/dist/types/components/form/drawerForm.d.ts +6 -0
- package/dist/types/components/form/modalForm.d.ts +6 -0
- package/dist/types/components/form/pageForm.d.ts +6 -0
- package/dist/types/components/form/settingForm.d.ts +6 -0
- package/dist/types/components/layout/table.d.ts +9 -0
- package/dist/types/components/table/tablePage.d.ts +9 -0
- package/dist/types/hooks/table/color.d.ts +13 -0
- package/dist/types/hooks/table/column.d.ts +1 -0
- package/dist/types/hooks/table/index.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as b, computed as
|
|
2
|
-
import { useI18n as N, useExtendForm as h } from "@duxweb/dvha-core";
|
|
3
|
-
import { useMessage as j, NButton as
|
|
1
|
+
import { defineComponent as b, computed as v, toRef as C, createVNode as e, Fragment as F, mergeProps as x, isVNode as D } from "vue";
|
|
2
|
+
import { useI18n as E, useInvalidate as N, useExtendForm as h } from "@duxweb/dvha-core";
|
|
3
|
+
import { useMessage as j, NButton as a, NScrollbar as w } from "naive-ui";
|
|
4
4
|
import "clsx";
|
|
5
5
|
import "vue-echarts";
|
|
6
6
|
import "vue-router";
|
|
@@ -15,9 +15,9 @@ import "pinia";
|
|
|
15
15
|
import "vue-cropper";
|
|
16
16
|
import "jinrishici";
|
|
17
17
|
import "vue-draggable-plus";
|
|
18
|
-
import { DuxDrawerPage as
|
|
18
|
+
import { DuxDrawerPage as O } from "../drawer/drawerPage.js";
|
|
19
19
|
import "aieditor";
|
|
20
|
-
import { DuxFormLayout as
|
|
20
|
+
import { DuxFormLayout as p } from "./formLayout.js";
|
|
21
21
|
import "vee-validate";
|
|
22
22
|
import "@vee-validate/i18n";
|
|
23
23
|
import "colorizr";
|
|
@@ -42,10 +42,10 @@ import "ace-builds/src-noconflict/theme-tomorrow";
|
|
|
42
42
|
import "ace-builds/src-noconflict/ext-searchbox";
|
|
43
43
|
import "ace-builds/src-noconflict/ext-language_tools";
|
|
44
44
|
import "ace-builds/src-noconflict/mode-snippets";
|
|
45
|
-
function
|
|
46
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !
|
|
45
|
+
function s(t) {
|
|
46
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !D(t);
|
|
47
47
|
}
|
|
48
|
-
const
|
|
48
|
+
const ht = /* @__PURE__ */ b({
|
|
49
49
|
name: "DuxDrawerForm",
|
|
50
50
|
props: {
|
|
51
51
|
id: {
|
|
@@ -71,79 +71,79 @@ const Nt = /* @__PURE__ */ b({
|
|
|
71
71
|
},
|
|
72
72
|
onError: {
|
|
73
73
|
type: Function
|
|
74
|
+
},
|
|
75
|
+
invalidate: {
|
|
76
|
+
type: String
|
|
74
77
|
}
|
|
75
78
|
},
|
|
76
|
-
extends:
|
|
79
|
+
extends: p,
|
|
77
80
|
setup(t, {
|
|
78
|
-
slots:
|
|
81
|
+
slots: c
|
|
79
82
|
}) {
|
|
80
83
|
const {
|
|
81
84
|
t: r
|
|
82
|
-
} =
|
|
85
|
+
} = E(), l = v(() => {
|
|
83
86
|
const {
|
|
84
87
|
onClose: o,
|
|
85
|
-
onSuccess:
|
|
86
|
-
onError:
|
|
87
|
-
action:
|
|
88
|
-
title:
|
|
89
|
-
id:
|
|
90
|
-
path:
|
|
91
|
-
data:
|
|
88
|
+
onSuccess: i,
|
|
89
|
+
onError: P,
|
|
90
|
+
action: _,
|
|
91
|
+
title: k,
|
|
92
|
+
id: I,
|
|
93
|
+
path: L,
|
|
94
|
+
data: R,
|
|
92
95
|
...S
|
|
93
96
|
} = t;
|
|
94
97
|
return S;
|
|
95
|
-
}),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
}), u = C(t, "data", {}), n = j(), {
|
|
99
|
+
invalidate: d
|
|
100
|
+
} = N(), {
|
|
101
|
+
isLoading: m,
|
|
102
|
+
onSubmit: f,
|
|
103
|
+
onReset: g,
|
|
99
104
|
isEdit: y
|
|
100
105
|
} = h({
|
|
101
106
|
id: t.id,
|
|
102
107
|
path: t.path,
|
|
103
|
-
form:
|
|
108
|
+
form: u,
|
|
104
109
|
action: t.action,
|
|
105
110
|
onError: (o) => {
|
|
106
|
-
|
|
107
|
-
c.error(o.message || r("components.form.error")), (e = t.onError) == null || e.call(t, o);
|
|
111
|
+
n.error(o.message || r("components.form.error")), t.onError?.(o);
|
|
108
112
|
},
|
|
109
113
|
onSuccess: (o) => {
|
|
110
|
-
|
|
111
|
-
c.success(r("components.form.success")), (e = t.onSuccess) == null || e.call(t, o), (n = t.onClose) == null || n.call(t);
|
|
114
|
+
n.success(r("components.form.success")), t.onSuccess?.(o), t.onClose?.(), t.invalidate && d(t.invalidate);
|
|
112
115
|
}
|
|
113
116
|
});
|
|
114
|
-
return () =>
|
|
117
|
+
return () => e(O, {
|
|
115
118
|
scrollbar: !1,
|
|
116
|
-
title:
|
|
117
|
-
onClose: t
|
|
119
|
+
title: t?.title || (y.value ? r("components.form.edit") : r("components.form.create")),
|
|
120
|
+
onClose: t?.onClose
|
|
118
121
|
}, {
|
|
119
|
-
default: () =>
|
|
120
|
-
default: () => [
|
|
122
|
+
default: () => e(w, null, {
|
|
123
|
+
default: () => [e(p, x({
|
|
121
124
|
class: "p-4"
|
|
122
|
-
},
|
|
123
|
-
default: () =>
|
|
124
|
-
var o;
|
|
125
|
-
return [(o = m == null ? void 0 : m.default) == null ? void 0 : o.call(m)];
|
|
126
|
-
}
|
|
125
|
+
}, l.value), {
|
|
126
|
+
default: () => [c?.default?.()]
|
|
127
127
|
})]
|
|
128
128
|
}),
|
|
129
129
|
footer: () => {
|
|
130
|
-
let o,
|
|
131
|
-
return
|
|
132
|
-
onClick:
|
|
133
|
-
loading:
|
|
134
|
-
},
|
|
130
|
+
let o, i;
|
|
131
|
+
return e(F, null, [e(a, {
|
|
132
|
+
onClick: g,
|
|
133
|
+
loading: m.value
|
|
134
|
+
}, s(o = r("components.button.reset")) ? o : {
|
|
135
135
|
default: () => [o]
|
|
136
|
-
}),
|
|
136
|
+
}), e(a, {
|
|
137
137
|
type: "primary",
|
|
138
|
-
loading:
|
|
139
|
-
onClick: () =>
|
|
140
|
-
},
|
|
141
|
-
default: () => [
|
|
138
|
+
loading: m.value,
|
|
139
|
+
onClick: () => f()
|
|
140
|
+
}, s(i = r("components.button.submit")) ? i : {
|
|
141
|
+
default: () => [i]
|
|
142
142
|
})]);
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
export {
|
|
148
|
-
|
|
148
|
+
ht as DuxDrawerForm
|
|
149
149
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as b, toRef as h, computed as a, watch as y, inject as q, createVNode as
|
|
1
|
+
import { defineComponent as b, toRef as h, computed as a, watch as y, inject as q, createVNode as l, createTextVNode as j } from "vue";
|
|
2
2
|
import { watchThrottled as S } from "@vueuse/core";
|
|
3
3
|
import { useField as w } from "vee-validate";
|
|
4
4
|
const F = /* @__PURE__ */ b({
|
|
@@ -24,68 +24,62 @@ const F = /* @__PURE__ */ b({
|
|
|
24
24
|
message: [String, Object]
|
|
25
25
|
},
|
|
26
26
|
setup(e, {
|
|
27
|
-
slots:
|
|
27
|
+
slots: d
|
|
28
28
|
}) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
setErrors: g,
|
|
39
|
-
validate: s
|
|
40
|
-
} = w(e.path || "", f.value || {}, {
|
|
29
|
+
const s = h(e.message), c = a(() => typeof e.rule == "object" ? {
|
|
30
|
+
...e.rule,
|
|
31
|
+
required: !!e.required
|
|
32
|
+
} : typeof e.rule == "string" ? e.rule?.includes("required") ? e.rule : e.rule ? `${e.rule}|required` : "required" : e.rule), {
|
|
33
|
+
errorMessage: n,
|
|
34
|
+
value: f,
|
|
35
|
+
setErrors: m,
|
|
36
|
+
validate: g
|
|
37
|
+
} = w(e.path || "", c.value || {}, {
|
|
41
38
|
label: e.label
|
|
42
|
-
}), v = a(() => e.required ? !0 : e.rule ? typeof e.rule == "string" ? e.rule.includes("required") : typeof e.rule == "object" ? "required" in e.rule : !1 : !1),
|
|
43
|
-
y(
|
|
44
|
-
|
|
39
|
+
}), v = a(() => e.required ? !0 : e.rule ? typeof e.rule == "string" ? e.rule.includes("required") : typeof e.rule == "object" ? "required" in e.rule : !1 : !1), u = a(() => n.value && (s.value || n.value));
|
|
40
|
+
y(u, (r) => {
|
|
41
|
+
r && m(r);
|
|
45
42
|
}, {
|
|
46
43
|
immediate: !0
|
|
47
|
-
}), S(
|
|
48
|
-
|
|
44
|
+
}), S(f, (r) => {
|
|
45
|
+
r && g();
|
|
49
46
|
}, {
|
|
50
47
|
throttle: 300,
|
|
51
48
|
deep: !0
|
|
52
49
|
});
|
|
53
|
-
const
|
|
50
|
+
const i = q("dux.form", {
|
|
54
51
|
labelPlacement: "left",
|
|
55
52
|
labelAlign: "left",
|
|
56
53
|
labelWidth: 70,
|
|
57
54
|
divider: !1
|
|
58
|
-
}),
|
|
59
|
-
let
|
|
60
|
-
return typeof
|
|
61
|
-
}), x = a(() =>
|
|
62
|
-
return () => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
class: "text-error"
|
|
87
|
-
}, [n.value])])]);
|
|
88
|
-
};
|
|
55
|
+
}), t = a(() => e.labelPlacement || i.labelPlacement), o = a(() => {
|
|
56
|
+
let r = e.labelWidth || i.labelWidth || 70;
|
|
57
|
+
return typeof r == "number" && (r = `${r}px`), t.value !== "left" ? "auto" : r;
|
|
58
|
+
}), x = a(() => i.divider || t.value === "page");
|
|
59
|
+
return () => l("div", {
|
|
60
|
+
class: [t.value !== "top" ? "md:flex-row gap-2 lg:items-center" : "gap-1", x.value ? "py-6" : "", t.value === "setting" ? "md:justify-between md:items-start md:gap-4" : "", t.value === "page" ? "grid grid-cols-1 lg:grid-cols-4 px-4" : "flex flex-col"]
|
|
61
|
+
}, [l("div", {
|
|
62
|
+
class: [t.value === "left" ? "flex lg:items-center" : "", t.value === "left" && i.labelAlign === "right" ? "justify-end" : ""],
|
|
63
|
+
style: {
|
|
64
|
+
width: o.value
|
|
65
|
+
}
|
|
66
|
+
}, [l("div", {
|
|
67
|
+
class: "flex flex-col"
|
|
68
|
+
}, [l("div", null, [l("span", {
|
|
69
|
+
class: "relative flex items-center gap-1"
|
|
70
|
+
}, [e.label, v.value && l("span", {
|
|
71
|
+
class: "text-error font-mono text-xs"
|
|
72
|
+
}, [j("*")])])]), e.description && (t.value === "setting" || t.value === "page") && l("div", {
|
|
73
|
+
class: "text-sm text-muted"
|
|
74
|
+
}, [e.description])])]), l("div", {
|
|
75
|
+
class: ["flex flex-col gap-1", t.value !== "left" ? "md:mt-1" : "", t.value === "setting" ? "flex-none md:w-40%" : "flex-1", t.value === "page" ? "col-span-3" : ""]
|
|
76
|
+
}, [l("div", {
|
|
77
|
+
class: t.value === "setting" ? "flex-1 lg:flex lg:justify-end" : ""
|
|
78
|
+
}, [d?.default?.()]), e.description && t.value === "left" && l("div", {
|
|
79
|
+
class: "text-sm text-muted"
|
|
80
|
+
}, [e.description]), u.value && l("div", {
|
|
81
|
+
class: "text-error"
|
|
82
|
+
}, [u.value])])]);
|
|
89
83
|
}
|
|
90
84
|
});
|
|
91
85
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as a, provide as t, createVNode as i } from "vue";
|
|
2
|
+
const n = /* @__PURE__ */ a({
|
|
3
3
|
name: "DuxFormLayout",
|
|
4
4
|
props: {
|
|
5
5
|
labelPlacement: {
|
|
@@ -25,19 +25,16 @@ const f = /* @__PURE__ */ i({
|
|
|
25
25
|
setup(e, {
|
|
26
26
|
slots: l
|
|
27
27
|
}) {
|
|
28
|
-
return
|
|
28
|
+
return t("dux.form", {
|
|
29
29
|
labelPlacement: e.labelPlacement,
|
|
30
30
|
labelAlign: e.labelAlign,
|
|
31
31
|
labelWidth: e.labelWidth,
|
|
32
32
|
divider: e.divider
|
|
33
|
-
}), () => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class: ["flex ", e.divider || e.labelPlacement === "page" ? " divide-y divide-default dark:divide-gray-800" : "", e.inline ? "flex-row" : "flex-col", e.labelPlacement === "page" || e.labelPlacement === "setting" ? "container mx-auto" : "gap-4"]
|
|
37
|
-
}, [(a = l == null ? void 0 : l.default) == null ? void 0 : a.call(l)]);
|
|
38
|
-
};
|
|
33
|
+
}), () => i("div", {
|
|
34
|
+
class: ["flex ", e.divider || e.labelPlacement === "page" ? " divide-y divide-default dark:divide-gray-800" : "", e.inline ? "flex-row" : "flex-col", e.labelPlacement === "page" || e.labelPlacement === "setting" ? "container mx-auto" : "gap-4"]
|
|
35
|
+
}, [l?.default?.()]);
|
|
39
36
|
}
|
|
40
37
|
});
|
|
41
38
|
export {
|
|
42
|
-
|
|
39
|
+
n as DuxFormLayout
|
|
43
40
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as h, useExtendForm as j } from "@duxweb/dvha-core";
|
|
3
|
-
import { useMessage as
|
|
1
|
+
import { defineComponent as b, computed as v, toRef as C, createVNode as i, Fragment as F, isVNode as x } from "vue";
|
|
2
|
+
import { useI18n as E, useInvalidate as h, useExtendForm as j } from "@duxweb/dvha-core";
|
|
3
|
+
import { useMessage as D, NButton as p } from "naive-ui";
|
|
4
4
|
import "clsx";
|
|
5
5
|
import "vue-echarts";
|
|
6
6
|
import "vue-router";
|
|
@@ -13,11 +13,11 @@ import "@duxweb/dvha-naiveui";
|
|
|
13
13
|
import "@vueuse/core";
|
|
14
14
|
import "pinia";
|
|
15
15
|
import "vue-cropper";
|
|
16
|
-
import
|
|
16
|
+
import M from "../modal/modalPage.js";
|
|
17
17
|
import "jinrishici";
|
|
18
18
|
import "vue-draggable-plus";
|
|
19
19
|
import "aieditor";
|
|
20
|
-
import { DuxFormLayout as
|
|
20
|
+
import { DuxFormLayout as a } from "./formLayout.js";
|
|
21
21
|
import "vee-validate";
|
|
22
22
|
import "@vee-validate/i18n";
|
|
23
23
|
import "colorizr";
|
|
@@ -42,10 +42,10 @@ import "ace-builds/src-noconflict/theme-tomorrow";
|
|
|
42
42
|
import "ace-builds/src-noconflict/ext-searchbox";
|
|
43
43
|
import "ace-builds/src-noconflict/ext-language_tools";
|
|
44
44
|
import "ace-builds/src-noconflict/mode-snippets";
|
|
45
|
-
function
|
|
46
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !
|
|
45
|
+
function c(t) {
|
|
46
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !x(t);
|
|
47
47
|
}
|
|
48
|
-
const
|
|
48
|
+
const ht = /* @__PURE__ */ b({
|
|
49
49
|
name: "DuxModalForm",
|
|
50
50
|
props: {
|
|
51
51
|
id: {
|
|
@@ -66,6 +66,9 @@ const Et = /* @__PURE__ */ s({
|
|
|
66
66
|
title: {
|
|
67
67
|
type: String
|
|
68
68
|
},
|
|
69
|
+
invalidate: {
|
|
70
|
+
type: String
|
|
71
|
+
},
|
|
69
72
|
onSuccess: {
|
|
70
73
|
type: Function
|
|
71
74
|
},
|
|
@@ -73,72 +76,69 @@ const Et = /* @__PURE__ */ s({
|
|
|
73
76
|
type: Function
|
|
74
77
|
}
|
|
75
78
|
},
|
|
76
|
-
extends:
|
|
79
|
+
extends: a,
|
|
77
80
|
setup(t, {
|
|
78
|
-
slots:
|
|
81
|
+
slots: s
|
|
79
82
|
}) {
|
|
80
83
|
const {
|
|
81
|
-
t:
|
|
82
|
-
} =
|
|
84
|
+
t: e
|
|
85
|
+
} = E(), u = v(() => {
|
|
83
86
|
const {
|
|
84
87
|
onClose: o,
|
|
85
|
-
onSuccess:
|
|
86
|
-
onError:
|
|
87
|
-
action:
|
|
88
|
-
title:
|
|
89
|
-
id:
|
|
90
|
-
path:
|
|
91
|
-
data:
|
|
92
|
-
...
|
|
88
|
+
onSuccess: r,
|
|
89
|
+
onError: N,
|
|
90
|
+
action: O,
|
|
91
|
+
title: _,
|
|
92
|
+
id: k,
|
|
93
|
+
path: I,
|
|
94
|
+
data: L,
|
|
95
|
+
...S
|
|
93
96
|
} = t;
|
|
94
|
-
return
|
|
95
|
-
}),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
return S;
|
|
98
|
+
}), l = C(t, "data", {}), n = D(), {
|
|
99
|
+
invalidate: d
|
|
100
|
+
} = h(), {
|
|
101
|
+
isLoading: m,
|
|
102
|
+
onSubmit: f,
|
|
103
|
+
onReset: g,
|
|
104
|
+
isEdit: y
|
|
100
105
|
} = j({
|
|
101
106
|
id: t.id,
|
|
102
107
|
path: t.path,
|
|
103
|
-
form:
|
|
108
|
+
form: l,
|
|
104
109
|
action: t.action,
|
|
105
110
|
onError: (o) => {
|
|
106
|
-
|
|
107
|
-
c.error(o.message || i("components.form.error")), (e = t.onError) == null || e.call(t, o);
|
|
111
|
+
n.error(o.message || e("components.form.error")), t.onError?.(o);
|
|
108
112
|
},
|
|
109
113
|
onSuccess: (o) => {
|
|
110
|
-
|
|
111
|
-
c.success(i("components.form.success")), (e = t.onSuccess) == null || e.call(t, o), (r = t.onClose) == null || r.call(t);
|
|
114
|
+
t.invalidate && d(t.invalidate), n.success(e("components.form.success")), t.onSuccess?.(o), t.onClose?.();
|
|
112
115
|
}
|
|
113
116
|
});
|
|
114
|
-
return () =>
|
|
115
|
-
title:
|
|
116
|
-
onClose: t
|
|
117
|
+
return () => i(M, {
|
|
118
|
+
title: t?.title || (y.value ? e("components.form.edit") : e("components.form.create")),
|
|
119
|
+
onClose: t?.onClose
|
|
117
120
|
}, {
|
|
118
|
-
default: () =>
|
|
119
|
-
default: () =>
|
|
120
|
-
var o;
|
|
121
|
-
return [(o = m == null ? void 0 : m.default) == null ? void 0 : o.call(m)];
|
|
122
|
-
}
|
|
121
|
+
default: () => i(a, u.value, {
|
|
122
|
+
default: () => [s?.default?.()]
|
|
123
123
|
}),
|
|
124
124
|
footer: () => {
|
|
125
|
-
let o,
|
|
126
|
-
return
|
|
127
|
-
onClick:
|
|
128
|
-
loading:
|
|
129
|
-
},
|
|
125
|
+
let o, r;
|
|
126
|
+
return i(F, null, [i(p, {
|
|
127
|
+
onClick: g,
|
|
128
|
+
loading: m.value
|
|
129
|
+
}, c(o = e("components.button.reset")) ? o : {
|
|
130
130
|
default: () => [o]
|
|
131
|
-
}),
|
|
131
|
+
}), i(p, {
|
|
132
132
|
type: "primary",
|
|
133
|
-
loading:
|
|
134
|
-
onClick: () =>
|
|
135
|
-
},
|
|
136
|
-
default: () => [
|
|
133
|
+
loading: m.value,
|
|
134
|
+
onClick: () => f()
|
|
135
|
+
}, c(r = e("components.button.submit")) ? r : {
|
|
136
|
+
default: () => [r]
|
|
137
137
|
})]);
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
export {
|
|
143
|
-
|
|
143
|
+
ht as DuxModalForm
|
|
144
144
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { useMessage as
|
|
1
|
+
import { defineComponent as f, toRef as b, createVNode as e } from "vue";
|
|
2
|
+
import { useI18n as g, useTabStore as y, useInvalidate as S, useExtendForm as x } from "@duxweb/dvha-core";
|
|
3
|
+
import { useMessage as h, NButton as p, NScrollbar as v } from "naive-ui";
|
|
4
4
|
import { useRouter as E } from "vue-router";
|
|
5
5
|
import "@overlastic/vue";
|
|
6
6
|
import { DuxCard as F } from "../card/card.js";
|
|
@@ -12,7 +12,7 @@ import "jinrishici";
|
|
|
12
12
|
import "lodash-es";
|
|
13
13
|
import "vue-draggable-plus";
|
|
14
14
|
import "aieditor";
|
|
15
|
-
import { DuxFormLayout as
|
|
15
|
+
import { DuxFormLayout as C } from "./formLayout.js";
|
|
16
16
|
import "vee-validate";
|
|
17
17
|
import "@iconify-json/tabler/icons.json";
|
|
18
18
|
import "mime";
|
|
@@ -41,9 +41,9 @@ import "unocss/preset-wind4";
|
|
|
41
41
|
import "@vee-validate/i18n/dist/locale/en.json";
|
|
42
42
|
import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
43
43
|
import "vue-command-palette";
|
|
44
|
-
import { DuxPage as
|
|
44
|
+
import { DuxPage as D } from "../../pages/page.js";
|
|
45
45
|
import "../../pages/page404.js";
|
|
46
|
-
const
|
|
46
|
+
const yt = /* @__PURE__ */ f({
|
|
47
47
|
name: "DuxPageForm",
|
|
48
48
|
props: {
|
|
49
49
|
id: {
|
|
@@ -73,76 +73,73 @@ const xt = /* @__PURE__ */ b({
|
|
|
73
73
|
size: {
|
|
74
74
|
type: String,
|
|
75
75
|
default: "medium"
|
|
76
|
+
},
|
|
77
|
+
invalidate: {
|
|
78
|
+
type: String
|
|
76
79
|
}
|
|
77
80
|
},
|
|
78
81
|
setup(t, {
|
|
79
|
-
slots:
|
|
82
|
+
slots: m
|
|
80
83
|
}) {
|
|
81
84
|
const {
|
|
82
85
|
t: o
|
|
83
|
-
} =
|
|
86
|
+
} = g(), s = b(t, "data", {}), a = h(), c = E(), n = y(), {
|
|
87
|
+
invalidate: l
|
|
88
|
+
} = S(), r = x({
|
|
84
89
|
id: t.id,
|
|
85
90
|
path: t.path,
|
|
86
|
-
form:
|
|
91
|
+
form: s,
|
|
87
92
|
action: t.action,
|
|
88
|
-
onError: (
|
|
89
|
-
|
|
90
|
-
u.error(e.message || o("components.form.error")), (a = t.onError) == null || a.call(t, e);
|
|
93
|
+
onError: (i) => {
|
|
94
|
+
a.error(i.message || o("components.form.error")), t.onError?.(i);
|
|
91
95
|
},
|
|
92
|
-
onSuccess: (
|
|
93
|
-
|
|
94
|
-
u.success(o("components.form.success")), (a = t.onSuccess) == null || a.call(t, e), !m.isEdit.value && n.current && n.delTab(n.current, (f) => l.push(f.path || ""));
|
|
96
|
+
onSuccess: (i) => {
|
|
97
|
+
a.success(o("components.form.success")), t.onSuccess?.(i), !r.isEdit.value && n.current && n.delTab(n.current, (d) => c.push(d.path || "")), t.invalidate && l(t.invalidate);
|
|
95
98
|
}
|
|
96
|
-
}),
|
|
97
|
-
return () =>
|
|
99
|
+
}), u = n.tabs.find((i) => i.path === n.current);
|
|
100
|
+
return () => e(D, {
|
|
98
101
|
card: !1,
|
|
99
102
|
scrollbar: !1
|
|
100
103
|
}, {
|
|
101
|
-
default: () => [
|
|
102
|
-
title:
|
|
103
|
-
description: t
|
|
104
|
+
default: () => [e(F, {
|
|
105
|
+
title: t?.title || u?.label || (r.isEdit.value ? o("components.form.edit") : o("components.form.create")),
|
|
106
|
+
description: t?.description,
|
|
104
107
|
class: "h-full flex flex-col",
|
|
105
108
|
contentClass: "flex-1 min-h-0",
|
|
106
109
|
contentSize: "none",
|
|
107
110
|
"header-bordered": !0
|
|
108
111
|
}, {
|
|
109
|
-
default: () =>
|
|
110
|
-
default: () => [
|
|
112
|
+
default: () => e(v, null, {
|
|
113
|
+
default: () => [e(C, {
|
|
111
114
|
"label-placement": "page"
|
|
112
115
|
}, {
|
|
113
|
-
default: () =>
|
|
114
|
-
var e;
|
|
115
|
-
return [(e = r == null ? void 0 : r.default) == null ? void 0 : e.call(r, m)];
|
|
116
|
-
}
|
|
116
|
+
default: () => [m?.default?.(r)]
|
|
117
117
|
})]
|
|
118
118
|
}),
|
|
119
|
-
headerExtra: () => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}, null)
|
|
140
|
-
})])]);
|
|
141
|
-
}
|
|
119
|
+
headerExtra: () => e("div", {
|
|
120
|
+
class: "flex gap-6 items-center"
|
|
121
|
+
}, [m?.actions?.(r), e("div", {
|
|
122
|
+
class: "flex gap-2"
|
|
123
|
+
}, [e(p, {
|
|
124
|
+
onClick: () => r.onReset()
|
|
125
|
+
}, {
|
|
126
|
+
default: () => o("components.button.reset"),
|
|
127
|
+
icon: () => e("i", {
|
|
128
|
+
class: "i-tabler:refresh"
|
|
129
|
+
}, null)
|
|
130
|
+
}), e(p, {
|
|
131
|
+
type: "primary",
|
|
132
|
+
onClick: () => r.onSubmit()
|
|
133
|
+
}, {
|
|
134
|
+
default: () => o("components.button.submit"),
|
|
135
|
+
icon: () => e("i", {
|
|
136
|
+
class: "i-tabler:device-floppy"
|
|
137
|
+
}, null)
|
|
138
|
+
})])])
|
|
142
139
|
})]
|
|
143
140
|
});
|
|
144
141
|
}
|
|
145
142
|
});
|
|
146
143
|
export {
|
|
147
|
-
|
|
144
|
+
yt as DuxPageForm
|
|
148
145
|
};
|