@duxweb/dvha-pro 1.0.23 → 1.0.25
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/component.cjs +1 -1
- 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/chart/echart.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/icon.cjs +1 -1
- package/dist/cjs/components/icon/iconPicker.cjs +1 -1
- package/dist/cjs/components/image/components/CanvasRuler.cjs +1 -0
- package/dist/cjs/components/image/elements/circle.cjs +1 -0
- package/dist/cjs/components/image/elements/image.cjs +1 -0
- package/dist/cjs/components/image/elements/index.cjs +1 -0
- package/dist/cjs/components/image/elements/rect.cjs +1 -0
- package/dist/cjs/components/image/elements/text.cjs +1 -0
- package/dist/cjs/components/image/hooks/usePosterEditor.cjs +1 -0
- package/dist/cjs/components/image/pages/LeftToolbar.cjs +1 -0
- package/dist/cjs/components/image/pages/Panel.cjs +1 -0
- package/dist/cjs/components/image/pages/PanelItem.cjs +1 -0
- package/dist/cjs/components/image/pages/RightPanel.cjs +1 -0
- package/dist/cjs/components/image/posterEditor.cjs +1 -0
- 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/level/level.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/table.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/dialog.cjs +1 -1
- package/dist/cjs/hooks/download.cjs +1 -1
- package/dist/cjs/hooks/drawer.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/modal.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/media.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/authLayout.cjs +1 -1
- package/dist/cjs/pages/layout/global.cjs +1 -1
- package/dist/cjs/pages/layout/page.cjs +1 -1
- package/dist/cjs/pages/layout/tab.cjs +1 -1
- package/dist/cjs/pages/layout.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/menu/main.cjs +1 -1
- package/dist/cjs/pages/menu/mobile.cjs +1 -1
- package/dist/cjs/pages/page.cjs +1 -1
- package/dist/cjs/pages/page404.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 +26 -1
- package/dist/esm/component.js +49 -47
- 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/chart/echart.js +15 -13
- package/dist/esm/components/crop/imageCrop.js +45 -46
- 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 +42 -42
- package/dist/esm/components/data/selectModal.js +58 -60
- 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 +61 -59
- 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 +63 -61
- package/dist/esm/components/form/pageForm.js +56 -57
- package/dist/esm/components/form/settingForm.js +43 -44
- package/dist/esm/components/icon/icon.js +15 -13
- package/dist/esm/components/icon/iconPicker.js +54 -58
- package/dist/esm/components/image/components/CanvasRuler.js +113 -0
- package/dist/esm/components/image/elements/circle.js +127 -0
- package/dist/esm/components/image/elements/image.js +131 -0
- package/dist/esm/components/image/elements/index.js +46 -0
- package/dist/esm/components/image/elements/rect.js +171 -0
- package/dist/esm/components/image/elements/text.js +206 -0
- package/dist/esm/components/image/hooks/usePosterEditor.js +434 -0
- package/dist/esm/components/image/pages/LeftToolbar.js +40 -0
- package/dist/esm/components/image/pages/Panel.js +31 -0
- package/dist/esm/components/image/pages/PanelItem.js +22 -0
- package/dist/esm/components/image/pages/RightPanel.js +421 -0
- package/dist/esm/components/image/posterEditor.js +227 -0
- 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 +312 -337
- package/dist/esm/components/layout/table.js +281 -294
- package/dist/esm/components/layout/tools.js +38 -41
- package/dist/esm/components/level/level.js +15 -13
- 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/table.js +15 -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 +115 -109
- package/dist/esm/components/upload/image.js +135 -130
- package/dist/esm/components/upload/manage/item.js +59 -60
- package/dist/esm/components/upload/manager.js +203 -218
- 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/dialog.js +15 -13
- package/dist/esm/hooks/download.js +55 -56
- package/dist/esm/hooks/drawer.js +15 -13
- 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/modal.js +15 -13
- 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 +17 -15
- package/dist/esm/hooks/table/input.js +28 -28
- package/dist/esm/hooks/table/map.js +7 -7
- package/dist/esm/hooks/table/media.js +15 -13
- 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 +213 -200
- package/dist/esm/pages/authLayout.js +15 -13
- package/dist/esm/pages/layout/global.js +12 -15
- package/dist/esm/pages/layout/page.js +15 -13
- package/dist/esm/pages/layout/tab.js +58 -71
- package/dist/esm/pages/layout.js +7 -6
- package/dist/esm/pages/login.js +95 -98
- package/dist/esm/pages/menu/avatar.js +151 -162
- package/dist/esm/pages/menu/button.js +29 -31
- package/dist/esm/pages/menu/cmd.js +83 -87
- package/dist/esm/pages/menu/main.js +25 -23
- package/dist/esm/pages/menu/mobile.js +15 -13
- package/dist/esm/pages/page.js +21 -25
- package/dist/esm/pages/page404.js +13 -11
- package/dist/esm/pages/pageStatus.js +33 -34
- package/dist/esm/stores/ui.js +15 -15
- package/dist/esm/theme/uno.css.js +26 -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/image/components/CanvasRuler.d.ts +43 -0
- package/dist/types/components/image/components/index.d.ts +1 -0
- package/dist/types/components/image/elements/circle.d.ts +3 -0
- package/dist/types/components/image/elements/image.d.ts +3 -0
- package/dist/types/components/image/elements/index.d.ts +15 -0
- package/dist/types/components/image/elements/rect.d.ts +3 -0
- package/dist/types/components/image/elements/text.d.ts +3 -0
- package/dist/types/components/image/elements/types.d.ts +51 -0
- package/dist/types/components/image/hooks/index.d.ts +1 -0
- package/dist/types/components/image/hooks/usePosterEditor.d.ts +48 -0
- package/dist/types/components/image/index.d.ts +4 -0
- package/dist/types/components/image/pages/LeftToolbar.d.ts +33 -0
- package/dist/types/components/image/pages/Panel.d.ts +11 -0
- package/dist/types/components/image/pages/PanelItem.d.ts +11 -0
- package/dist/types/components/image/pages/RightPanel.d.ts +208 -0
- package/dist/types/components/image/pages/index.d.ts +4 -0
- package/dist/types/components/image/posterEditor.d.ts +61 -0
- package/dist/types/components/image/types/editor.d.ts +47 -0
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/components/layout/table.d.ts +9 -0
- package/dist/types/components/stats/number.d.ts +1 -1
- package/dist/types/components/table/tablePage.d.ts +9 -0
- package/dist/types/components/upload/file.d.ts +5 -3
- 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/dist/types/index.d.ts +1 -0
- package/dist/types/pages/layout/global.d.ts +0 -1
- package/package.json +6 -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 p, NScrollbar as w } from "naive-ui";
|
|
4
4
|
import "clsx";
|
|
5
5
|
import "vue-echarts";
|
|
6
6
|
import "vue-router";
|
|
@@ -12,12 +12,23 @@ import "@tanstack/vue-query";
|
|
|
12
12
|
import "@duxweb/dvha-naiveui";
|
|
13
13
|
import "@vueuse/core";
|
|
14
14
|
import "pinia";
|
|
15
|
+
import "vue3-ace-editor";
|
|
16
|
+
import "ace-builds/src-noconflict/mode-vue";
|
|
17
|
+
import "ace-builds/src-noconflict/mode-javascript";
|
|
18
|
+
import "ace-builds/src-noconflict/mode-html";
|
|
19
|
+
import "ace-builds/src-noconflict/mode-json";
|
|
20
|
+
import "ace-builds/src-noconflict/mode-json5";
|
|
21
|
+
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
22
|
+
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
23
|
+
import "ace-builds/src-noconflict/ext-searchbox";
|
|
24
|
+
import "ace-builds/src-noconflict/ext-language_tools";
|
|
25
|
+
import "ace-builds/src-noconflict/mode-snippets";
|
|
15
26
|
import "vue-cropper";
|
|
16
27
|
import "jinrishici";
|
|
17
28
|
import "vue-draggable-plus";
|
|
18
|
-
import { DuxDrawerPage as
|
|
29
|
+
import { DuxDrawerPage as O } from "../drawer/drawerPage.js";
|
|
19
30
|
import "aieditor";
|
|
20
|
-
import { DuxFormLayout as
|
|
31
|
+
import { DuxFormLayout as a } from "./formLayout.js";
|
|
21
32
|
import "vee-validate";
|
|
22
33
|
import "@vee-validate/i18n";
|
|
23
34
|
import "colorizr";
|
|
@@ -31,21 +42,12 @@ import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
|
31
42
|
import "vue-command-palette";
|
|
32
43
|
import "../../pages/page404.js";
|
|
33
44
|
import "@iconify-json/tabler/icons.json";
|
|
34
|
-
import "
|
|
35
|
-
import "
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
import "ace-builds/src-noconflict/mode-json";
|
|
39
|
-
import "ace-builds/src-noconflict/mode-json5";
|
|
40
|
-
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
41
|
-
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
42
|
-
import "ace-builds/src-noconflict/ext-searchbox";
|
|
43
|
-
import "ace-builds/src-noconflict/ext-language_tools";
|
|
44
|
-
import "ace-builds/src-noconflict/mode-snippets";
|
|
45
|
-
function d(t) {
|
|
46
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !E(t);
|
|
45
|
+
import "../image/elements/index.js";
|
|
46
|
+
import "fabric";
|
|
47
|
+
function s(t) {
|
|
48
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !D(t);
|
|
47
49
|
}
|
|
48
|
-
const
|
|
50
|
+
const wt = /* @__PURE__ */ b({
|
|
49
51
|
name: "DuxDrawerForm",
|
|
50
52
|
props: {
|
|
51
53
|
id: {
|
|
@@ -71,79 +73,79 @@ const Nt = /* @__PURE__ */ b({
|
|
|
71
73
|
},
|
|
72
74
|
onError: {
|
|
73
75
|
type: Function
|
|
76
|
+
},
|
|
77
|
+
invalidate: {
|
|
78
|
+
type: String
|
|
74
79
|
}
|
|
75
80
|
},
|
|
76
|
-
extends:
|
|
81
|
+
extends: a,
|
|
77
82
|
setup(t, {
|
|
78
|
-
slots:
|
|
83
|
+
slots: c
|
|
79
84
|
}) {
|
|
80
85
|
const {
|
|
81
86
|
t: r
|
|
82
|
-
} =
|
|
87
|
+
} = E(), l = v(() => {
|
|
83
88
|
const {
|
|
84
89
|
onClose: o,
|
|
85
|
-
onSuccess:
|
|
86
|
-
onError:
|
|
87
|
-
action:
|
|
88
|
-
title:
|
|
89
|
-
id:
|
|
90
|
-
path:
|
|
91
|
-
data:
|
|
90
|
+
onSuccess: i,
|
|
91
|
+
onError: P,
|
|
92
|
+
action: _,
|
|
93
|
+
title: k,
|
|
94
|
+
id: I,
|
|
95
|
+
path: L,
|
|
96
|
+
data: R,
|
|
92
97
|
...S
|
|
93
98
|
} = t;
|
|
94
99
|
return S;
|
|
95
|
-
}),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
}), u = C(t, "data", {}), n = j(), {
|
|
101
|
+
invalidate: d
|
|
102
|
+
} = N(), {
|
|
103
|
+
isLoading: m,
|
|
104
|
+
onSubmit: f,
|
|
105
|
+
onReset: g,
|
|
99
106
|
isEdit: y
|
|
100
107
|
} = h({
|
|
101
108
|
id: t.id,
|
|
102
109
|
path: t.path,
|
|
103
|
-
form:
|
|
110
|
+
form: u,
|
|
104
111
|
action: t.action,
|
|
105
112
|
onError: (o) => {
|
|
106
|
-
|
|
107
|
-
c.error(o.message || r("components.form.error")), (e = t.onError) == null || e.call(t, o);
|
|
113
|
+
n.error(o.message || r("components.form.error")), t.onError?.(o);
|
|
108
114
|
},
|
|
109
115
|
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);
|
|
116
|
+
n.success(r("components.form.success")), t.onSuccess?.(o), t.onClose?.(), t.invalidate && d(t.invalidate);
|
|
112
117
|
}
|
|
113
118
|
});
|
|
114
|
-
return () =>
|
|
119
|
+
return () => e(O, {
|
|
115
120
|
scrollbar: !1,
|
|
116
|
-
title:
|
|
117
|
-
onClose: t
|
|
121
|
+
title: t?.title || (y.value ? r("components.form.edit") : r("components.form.create")),
|
|
122
|
+
onClose: t?.onClose
|
|
118
123
|
}, {
|
|
119
|
-
default: () =>
|
|
120
|
-
default: () => [
|
|
124
|
+
default: () => e(w, null, {
|
|
125
|
+
default: () => [e(a, x({
|
|
121
126
|
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
|
-
}
|
|
127
|
+
}, l.value), {
|
|
128
|
+
default: () => [c?.default?.()]
|
|
127
129
|
})]
|
|
128
130
|
}),
|
|
129
131
|
footer: () => {
|
|
130
|
-
let o,
|
|
131
|
-
return
|
|
132
|
-
onClick:
|
|
133
|
-
loading:
|
|
134
|
-
},
|
|
132
|
+
let o, i;
|
|
133
|
+
return e(F, null, [e(p, {
|
|
134
|
+
onClick: g,
|
|
135
|
+
loading: m.value
|
|
136
|
+
}, s(o = r("components.button.reset")) ? o : {
|
|
135
137
|
default: () => [o]
|
|
136
|
-
}),
|
|
138
|
+
}), e(p, {
|
|
137
139
|
type: "primary",
|
|
138
|
-
loading:
|
|
139
|
-
onClick: () =>
|
|
140
|
-
},
|
|
141
|
-
default: () => [
|
|
140
|
+
loading: m.value,
|
|
141
|
+
onClick: () => f()
|
|
142
|
+
}, s(i = r("components.button.submit")) ? i : {
|
|
143
|
+
default: () => [i]
|
|
142
144
|
})]);
|
|
143
145
|
}
|
|
144
146
|
});
|
|
145
147
|
}
|
|
146
148
|
});
|
|
147
149
|
export {
|
|
148
|
-
|
|
150
|
+
wt as DuxDrawerForm
|
|
149
151
|
};
|
|
@@ -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";
|
|
@@ -12,12 +12,23 @@ import "@tanstack/vue-query";
|
|
|
12
12
|
import "@duxweb/dvha-naiveui";
|
|
13
13
|
import "@vueuse/core";
|
|
14
14
|
import "pinia";
|
|
15
|
+
import "vue3-ace-editor";
|
|
16
|
+
import "ace-builds/src-noconflict/mode-vue";
|
|
17
|
+
import "ace-builds/src-noconflict/mode-javascript";
|
|
18
|
+
import "ace-builds/src-noconflict/mode-html";
|
|
19
|
+
import "ace-builds/src-noconflict/mode-json";
|
|
20
|
+
import "ace-builds/src-noconflict/mode-json5";
|
|
21
|
+
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
22
|
+
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
23
|
+
import "ace-builds/src-noconflict/ext-searchbox";
|
|
24
|
+
import "ace-builds/src-noconflict/ext-language_tools";
|
|
25
|
+
import "ace-builds/src-noconflict/mode-snippets";
|
|
15
26
|
import "vue-cropper";
|
|
16
|
-
import
|
|
27
|
+
import M from "../modal/modalPage.js";
|
|
17
28
|
import "jinrishici";
|
|
18
29
|
import "vue-draggable-plus";
|
|
19
30
|
import "aieditor";
|
|
20
|
-
import { DuxFormLayout as
|
|
31
|
+
import { DuxFormLayout as a } from "./formLayout.js";
|
|
21
32
|
import "vee-validate";
|
|
22
33
|
import "@vee-validate/i18n";
|
|
23
34
|
import "colorizr";
|
|
@@ -31,21 +42,12 @@ import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
|
31
42
|
import "vue-command-palette";
|
|
32
43
|
import "../../pages/page404.js";
|
|
33
44
|
import "@iconify-json/tabler/icons.json";
|
|
34
|
-
import "
|
|
35
|
-
import "
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
import "ace-builds/src-noconflict/mode-json";
|
|
39
|
-
import "ace-builds/src-noconflict/mode-json5";
|
|
40
|
-
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
41
|
-
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
42
|
-
import "ace-builds/src-noconflict/ext-searchbox";
|
|
43
|
-
import "ace-builds/src-noconflict/ext-language_tools";
|
|
44
|
-
import "ace-builds/src-noconflict/mode-snippets";
|
|
45
|
-
function l(t) {
|
|
46
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !E(t);
|
|
45
|
+
import "../image/elements/index.js";
|
|
46
|
+
import "fabric";
|
|
47
|
+
function c(t) {
|
|
48
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !x(t);
|
|
47
49
|
}
|
|
48
|
-
const
|
|
50
|
+
const Dt = /* @__PURE__ */ b({
|
|
49
51
|
name: "DuxModalForm",
|
|
50
52
|
props: {
|
|
51
53
|
id: {
|
|
@@ -66,6 +68,9 @@ const Et = /* @__PURE__ */ s({
|
|
|
66
68
|
title: {
|
|
67
69
|
type: String
|
|
68
70
|
},
|
|
71
|
+
invalidate: {
|
|
72
|
+
type: String
|
|
73
|
+
},
|
|
69
74
|
onSuccess: {
|
|
70
75
|
type: Function
|
|
71
76
|
},
|
|
@@ -73,72 +78,69 @@ const Et = /* @__PURE__ */ s({
|
|
|
73
78
|
type: Function
|
|
74
79
|
}
|
|
75
80
|
},
|
|
76
|
-
extends:
|
|
81
|
+
extends: a,
|
|
77
82
|
setup(t, {
|
|
78
|
-
slots:
|
|
83
|
+
slots: s
|
|
79
84
|
}) {
|
|
80
85
|
const {
|
|
81
|
-
t:
|
|
82
|
-
} =
|
|
86
|
+
t: e
|
|
87
|
+
} = E(), u = v(() => {
|
|
83
88
|
const {
|
|
84
89
|
onClose: o,
|
|
85
|
-
onSuccess:
|
|
86
|
-
onError:
|
|
87
|
-
action:
|
|
88
|
-
title:
|
|
89
|
-
id:
|
|
90
|
-
path:
|
|
91
|
-
data:
|
|
92
|
-
...
|
|
90
|
+
onSuccess: r,
|
|
91
|
+
onError: N,
|
|
92
|
+
action: O,
|
|
93
|
+
title: _,
|
|
94
|
+
id: k,
|
|
95
|
+
path: I,
|
|
96
|
+
data: L,
|
|
97
|
+
...S
|
|
93
98
|
} = t;
|
|
94
|
-
return
|
|
95
|
-
}),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
return S;
|
|
100
|
+
}), l = C(t, "data", {}), n = D(), {
|
|
101
|
+
invalidate: d
|
|
102
|
+
} = h(), {
|
|
103
|
+
isLoading: m,
|
|
104
|
+
onSubmit: f,
|
|
105
|
+
onReset: g,
|
|
106
|
+
isEdit: y
|
|
100
107
|
} = j({
|
|
101
108
|
id: t.id,
|
|
102
109
|
path: t.path,
|
|
103
|
-
form:
|
|
110
|
+
form: l,
|
|
104
111
|
action: t.action,
|
|
105
112
|
onError: (o) => {
|
|
106
|
-
|
|
107
|
-
c.error(o.message || i("components.form.error")), (e = t.onError) == null || e.call(t, o);
|
|
113
|
+
n.error(o.message || e("components.form.error")), t.onError?.(o);
|
|
108
114
|
},
|
|
109
115
|
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);
|
|
116
|
+
t.invalidate && d(t.invalidate), n.success(e("components.form.success")), t.onSuccess?.(o), t.onClose?.();
|
|
112
117
|
}
|
|
113
118
|
});
|
|
114
|
-
return () =>
|
|
115
|
-
title:
|
|
116
|
-
onClose: t
|
|
119
|
+
return () => i(M, {
|
|
120
|
+
title: t?.title || (y.value ? e("components.form.edit") : e("components.form.create")),
|
|
121
|
+
onClose: t?.onClose
|
|
117
122
|
}, {
|
|
118
|
-
default: () =>
|
|
119
|
-
default: () =>
|
|
120
|
-
var o;
|
|
121
|
-
return [(o = m == null ? void 0 : m.default) == null ? void 0 : o.call(m)];
|
|
122
|
-
}
|
|
123
|
+
default: () => i(a, u.value, {
|
|
124
|
+
default: () => [s?.default?.()]
|
|
123
125
|
}),
|
|
124
126
|
footer: () => {
|
|
125
|
-
let o,
|
|
126
|
-
return
|
|
127
|
-
onClick:
|
|
128
|
-
loading:
|
|
129
|
-
},
|
|
127
|
+
let o, r;
|
|
128
|
+
return i(F, null, [i(p, {
|
|
129
|
+
onClick: g,
|
|
130
|
+
loading: m.value
|
|
131
|
+
}, c(o = e("components.button.reset")) ? o : {
|
|
130
132
|
default: () => [o]
|
|
131
|
-
}),
|
|
133
|
+
}), i(p, {
|
|
132
134
|
type: "primary",
|
|
133
|
-
loading:
|
|
134
|
-
onClick: () =>
|
|
135
|
-
},
|
|
136
|
-
default: () => [
|
|
135
|
+
loading: m.value,
|
|
136
|
+
onClick: () => f()
|
|
137
|
+
}, c(r = e("components.button.submit")) ? r : {
|
|
138
|
+
default: () => [r]
|
|
137
139
|
})]);
|
|
138
140
|
}
|
|
139
141
|
});
|
|
140
142
|
}
|
|
141
143
|
});
|
|
142
144
|
export {
|
|
143
|
-
|
|
145
|
+
Dt as DuxModalForm
|
|
144
146
|
};
|