@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,12 +1,23 @@
|
|
|
1
|
-
import { defineComponent as S, computed as n, watch as U, createVNode as
|
|
1
|
+
import { defineComponent as S, computed as n, watch as c, ref as U, createVNode as a } from "vue";
|
|
2
2
|
import { useI18n as k, useUpload as w } from "@duxweb/dvha-core";
|
|
3
3
|
import { useVModel as I } from "@vueuse/core";
|
|
4
4
|
import V from "clsx";
|
|
5
|
-
import { useMessage as j, NImage as
|
|
6
|
-
import { VueDraggable as
|
|
5
|
+
import { useMessage as j, NImage as A, NButton as p, NProgress as D } from "naive-ui";
|
|
6
|
+
import { VueDraggable as B } from "vue-draggable-plus";
|
|
7
7
|
import "vue-router";
|
|
8
8
|
import "@overlastic/vue";
|
|
9
9
|
import "vue-echarts";
|
|
10
|
+
import "vue3-ace-editor";
|
|
11
|
+
import "ace-builds/src-noconflict/mode-vue";
|
|
12
|
+
import "ace-builds/src-noconflict/mode-javascript";
|
|
13
|
+
import "ace-builds/src-noconflict/mode-html";
|
|
14
|
+
import "ace-builds/src-noconflict/mode-json";
|
|
15
|
+
import "ace-builds/src-noconflict/mode-json5";
|
|
16
|
+
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
17
|
+
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
18
|
+
import "ace-builds/src-noconflict/ext-searchbox";
|
|
19
|
+
import "ace-builds/src-noconflict/ext-language_tools";
|
|
20
|
+
import "ace-builds/src-noconflict/mode-snippets";
|
|
10
21
|
import "vue-cropper";
|
|
11
22
|
import "jinrishici";
|
|
12
23
|
import "lodash-es";
|
|
@@ -25,25 +36,16 @@ import "vue-command-palette";
|
|
|
25
36
|
import "@duxweb/dvha-naiveui";
|
|
26
37
|
import "../../pages/page404.js";
|
|
27
38
|
import "@iconify-json/tabler/icons.json";
|
|
39
|
+
import "../image/elements/index.js";
|
|
40
|
+
import "fabric";
|
|
28
41
|
import "mime";
|
|
29
42
|
import { useUploadConfig as M } from "./config.js";
|
|
30
|
-
import "vue3-ace-editor";
|
|
31
|
-
import "ace-builds/src-noconflict/mode-vue";
|
|
32
|
-
import "ace-builds/src-noconflict/mode-javascript";
|
|
33
|
-
import "ace-builds/src-noconflict/mode-html";
|
|
34
|
-
import "ace-builds/src-noconflict/mode-json";
|
|
35
|
-
import "ace-builds/src-noconflict/mode-json5";
|
|
36
|
-
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
37
|
-
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
38
|
-
import "ace-builds/src-noconflict/ext-searchbox";
|
|
39
|
-
import "ace-builds/src-noconflict/ext-language_tools";
|
|
40
|
-
import "ace-builds/src-noconflict/mode-snippets";
|
|
41
43
|
import { useModal as L } from "../../hooks/modal.js";
|
|
42
44
|
import "dayjs";
|
|
43
45
|
import { useImagePreview as O } from "../../hooks/image.js";
|
|
44
46
|
import "@tanstack/vue-query";
|
|
45
47
|
import "pinia";
|
|
46
|
-
const
|
|
48
|
+
const je = /* @__PURE__ */ S({
|
|
47
49
|
name: "DuxImageUpload",
|
|
48
50
|
props: {
|
|
49
51
|
path: {
|
|
@@ -74,16 +76,16 @@ const Ie = /* @__PURE__ */ S({
|
|
|
74
76
|
defaultValue: [String, Array],
|
|
75
77
|
onUpdateValue: Function
|
|
76
78
|
},
|
|
77
|
-
setup(
|
|
78
|
-
emit:
|
|
79
|
+
setup(t, {
|
|
80
|
+
emit: g
|
|
79
81
|
}) {
|
|
80
|
-
const
|
|
82
|
+
const u = I(t, "value", g, {
|
|
81
83
|
passive: !0,
|
|
82
84
|
deep: !0,
|
|
83
|
-
defaultValue:
|
|
84
|
-
}),
|
|
85
|
+
defaultValue: t.defaultValue
|
|
86
|
+
}), v = j(), f = O(), {
|
|
85
87
|
t: m
|
|
86
|
-
} = k(),
|
|
88
|
+
} = k(), o = {
|
|
87
89
|
container: "flex gap-2",
|
|
88
90
|
imageItem: "size-80px rounded border border-muted relative group draggable flex items-center",
|
|
89
91
|
imageOverlay: "z-1 size-full inset-0 absolute flex items-center justify-center bg-default/80 transition-all opacity-0 group-hover:opacity-100 rounded",
|
|
@@ -91,129 +93,132 @@ const Ie = /* @__PURE__ */ S({
|
|
|
91
93
|
uploadContent: "flex-1 flex flex-col justify-center items-center gap-1 relative",
|
|
92
94
|
progressContainer: "size-80px flex items-center justify-center rounded",
|
|
93
95
|
progressBar: "absolute left-2 right-2 bottom-2"
|
|
94
|
-
}, h = n(() =>
|
|
95
|
-
uploadPath:
|
|
96
|
-
managePath:
|
|
97
|
-
driver:
|
|
96
|
+
}, h = n(() => t.maxSize), {
|
|
97
|
+
uploadPath: s,
|
|
98
|
+
managePath: b,
|
|
99
|
+
driver: x
|
|
98
100
|
} = M({
|
|
99
|
-
driver:
|
|
100
|
-
signPath:
|
|
101
|
-
signCallback:
|
|
102
|
-
uploadPath:
|
|
103
|
-
managePath:
|
|
104
|
-
}),
|
|
105
|
-
path:
|
|
106
|
-
multiple:
|
|
107
|
-
maxFileCount:
|
|
101
|
+
driver: t?.driver,
|
|
102
|
+
signPath: t?.signPath,
|
|
103
|
+
signCallback: t?.signCallback,
|
|
104
|
+
uploadPath: t?.path,
|
|
105
|
+
managePath: t?.managePath
|
|
106
|
+
}), r = w({
|
|
107
|
+
path: s.value,
|
|
108
|
+
multiple: t.multiple,
|
|
109
|
+
maxFileCount: t.maxNum,
|
|
108
110
|
maxFileSize: h.value * 1024 * 1024,
|
|
109
111
|
autoUpload: !0,
|
|
110
112
|
accept: "image/*",
|
|
111
|
-
onError: (
|
|
112
|
-
|
|
113
|
+
onError: (e) => {
|
|
114
|
+
v.error(e.message || m("components.upload.error"));
|
|
113
115
|
},
|
|
114
|
-
driver:
|
|
116
|
+
driver: x.value
|
|
115
117
|
});
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
g.value = r, (u = e.onUpdateValue) == null || u.call(e, r);
|
|
118
|
+
c(r.dataFiles, (e) => {
|
|
119
|
+
const l = t.multiple ? e?.map((i) => i.url) : e?.[0]?.url;
|
|
120
|
+
u.value = l, t.onUpdateValue?.(l);
|
|
120
121
|
});
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
}, P = n(() =>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
const y = n(() => r.progress.value.totalPercent), z = n(() => r.isUploading.value), F = async () => {
|
|
123
|
+
r.open();
|
|
124
|
+
}, P = n(() => t.multiple ? t.maxNum && r.uploadFiles.value.length >= t.maxNum : !0), C = n(() => r.dataFiles.value?.map((e) => e.url)), N = L(), d = U(!1);
|
|
125
|
+
return c(u, (e) => {
|
|
126
|
+
if (!e || !e?.length || d.value)
|
|
127
|
+
return;
|
|
128
|
+
d.value = !0;
|
|
129
|
+
const l = typeof e == "string" ? [e] : Array.isArray(e) ? e : [];
|
|
130
|
+
r.addDataFiles(l.map((i) => ({
|
|
131
|
+
url: i
|
|
132
|
+
})));
|
|
133
|
+
}, {
|
|
134
|
+
immediate: !0
|
|
135
|
+
}), () => a("div", null, [a(B, {
|
|
136
|
+
modelValue: r.uploadFiles.value,
|
|
137
|
+
"onUpdate:modelValue": (e) => r.uploadFiles.value = e,
|
|
138
|
+
class: o.container,
|
|
131
139
|
draggable: ".draggable"
|
|
132
140
|
}, {
|
|
133
|
-
default: () => {
|
|
134
|
-
|
|
135
|
-
return
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
class: "n-icon i-tabler:trash"
|
|
163
|
-
}, null),
|
|
164
|
-
onClick: () => {
|
|
165
|
-
l.removeFiles([r.id]);
|
|
166
|
-
}
|
|
167
|
-
}, null)])]);
|
|
168
|
-
}), (l.uploadFiles.value.length === 0 || !P.value) && t("div", {
|
|
169
|
-
class: i.uploadArea,
|
|
141
|
+
default: () => [r.uploadFiles.value?.map((e, l) => {
|
|
142
|
+
const i = e.url || URL.createObjectURL(e.file);
|
|
143
|
+
return a("div", {
|
|
144
|
+
key: l,
|
|
145
|
+
class: V(o.imageItem)
|
|
146
|
+
}, [a(A, {
|
|
147
|
+
class: "z-0 rounded",
|
|
148
|
+
objectFit: "scale-down",
|
|
149
|
+
width: 78,
|
|
150
|
+
height: 78,
|
|
151
|
+
previewDisabled: !0,
|
|
152
|
+
src: i
|
|
153
|
+
}, null), a("div", {
|
|
154
|
+
class: o.imageOverlay
|
|
155
|
+
}, [e.status === "success" && a(p, {
|
|
156
|
+
quaternary: !0,
|
|
157
|
+
circle: !0,
|
|
158
|
+
size: "small",
|
|
159
|
+
renderIcon: () => a("div", {
|
|
160
|
+
class: "n-icon i-tabler:eye"
|
|
161
|
+
}, null),
|
|
162
|
+
onClick: () => f.show(C.value, l)
|
|
163
|
+
}, null), a(p, {
|
|
164
|
+
quaternary: !0,
|
|
165
|
+
circle: !0,
|
|
166
|
+
size: "small",
|
|
167
|
+
renderIcon: () => a("div", {
|
|
168
|
+
class: "n-icon i-tabler:trash"
|
|
169
|
+
}, null),
|
|
170
170
|
onClick: () => {
|
|
171
|
-
|
|
171
|
+
r.removeFiles([e.id]);
|
|
172
172
|
}
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
173
|
+
}, null)])]);
|
|
174
|
+
}), (r.uploadFiles.value.length === 0 || !P.value) && a("div", {
|
|
175
|
+
class: o.uploadArea,
|
|
176
|
+
onClick: () => {
|
|
177
|
+
F();
|
|
178
|
+
}
|
|
179
|
+
}, [t.manager && a("div", {
|
|
180
|
+
class: " py-1 text-xs bg-muted border-b border-dashed border-accented flex items-center justify-center",
|
|
181
|
+
onClick: (e) => {
|
|
182
|
+
e.stopPropagation(), N.show({
|
|
183
|
+
title: m("components.upload.title"),
|
|
184
|
+
width: "800px",
|
|
185
|
+
component: () => import("./manager.js"),
|
|
186
|
+
componentProps: {
|
|
187
|
+
path: b.value,
|
|
188
|
+
type: "image",
|
|
189
|
+
multiple: t.multiple,
|
|
190
|
+
uploadParams: {
|
|
191
|
+
path: s.value,
|
|
192
|
+
accept: "image/*",
|
|
193
|
+
maxNum: t.maxNum,
|
|
194
|
+
maxSize: t.maxSize
|
|
190
195
|
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
196
|
+
}
|
|
197
|
+
}).then((l) => {
|
|
198
|
+
r.addDataFiles(l);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}, [a("div", {
|
|
202
|
+
class: "i-tabler:folder size-4"
|
|
203
|
+
}, null)]), a("div", {
|
|
204
|
+
class: o.uploadContent
|
|
205
|
+
}, [z.value ? a("div", {
|
|
206
|
+
class: o.progressContainer
|
|
207
|
+
}, [a("div", {
|
|
208
|
+
class: "i-tabler:photo size-6"
|
|
209
|
+
}, null), a("div", {
|
|
210
|
+
class: o.progressBar
|
|
211
|
+
}, [a(D, {
|
|
212
|
+
type: "line",
|
|
213
|
+
percentage: y.value,
|
|
214
|
+
showIndicator: !1,
|
|
215
|
+
height: 4
|
|
216
|
+
}, null)])]) : a("div", {
|
|
217
|
+
class: "i-tabler:plus size-4"
|
|
218
|
+
}, null)])])]
|
|
214
219
|
})]);
|
|
215
220
|
}
|
|
216
221
|
});
|
|
217
222
|
export {
|
|
218
|
-
|
|
223
|
+
je as DuxImageUpload
|
|
219
224
|
};
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
import { defineComponent as c, createVNode as
|
|
1
|
+
import { defineComponent as c, createVNode as e } from "vue";
|
|
2
2
|
import { useI18n as s } from "@duxweb/dvha-core";
|
|
3
|
-
import
|
|
4
|
-
import { NCheckbox as
|
|
3
|
+
import p from "clsx";
|
|
4
|
+
import { NCheckbox as a, NImage as u } from "naive-ui";
|
|
5
5
|
import "vue-router";
|
|
6
6
|
import { useDialog as d } from "../../../hooks/dialog.js";
|
|
7
7
|
import "@overlastic/vue";
|
|
8
8
|
import "vue-echarts";
|
|
9
9
|
import "@vueuse/core";
|
|
10
|
+
import "vue3-ace-editor";
|
|
11
|
+
import "ace-builds/src-noconflict/mode-vue";
|
|
12
|
+
import "ace-builds/src-noconflict/mode-javascript";
|
|
13
|
+
import "ace-builds/src-noconflict/mode-html";
|
|
14
|
+
import "ace-builds/src-noconflict/mode-json";
|
|
15
|
+
import "ace-builds/src-noconflict/mode-json5";
|
|
16
|
+
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
17
|
+
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
18
|
+
import "ace-builds/src-noconflict/ext-searchbox";
|
|
19
|
+
import "ace-builds/src-noconflict/ext-language_tools";
|
|
20
|
+
import "ace-builds/src-noconflict/mode-snippets";
|
|
10
21
|
import "vue-cropper";
|
|
11
22
|
import "jinrishici";
|
|
12
23
|
import "lodash-es";
|
|
@@ -26,6 +37,8 @@ import "vue-command-palette";
|
|
|
26
37
|
import "@duxweb/dvha-naiveui";
|
|
27
38
|
import "../../../pages/page404.js";
|
|
28
39
|
import "@iconify-json/tabler/icons.json";
|
|
40
|
+
import "../../image/elements/index.js";
|
|
41
|
+
import "fabric";
|
|
29
42
|
import "mime";
|
|
30
43
|
import f from "../../../static/images/icon/audio.svg.js";
|
|
31
44
|
import g from "../../../static/images/icon/excel.svg.js";
|
|
@@ -35,21 +48,10 @@ import h from "../../../static/images/icon/pdf.svg.js";
|
|
|
35
48
|
import x from "../../../static/images/icon/ppt.svg.js";
|
|
36
49
|
import k from "../../../static/images/icon/video.svg.js";
|
|
37
50
|
import w from "../../../static/images/icon/word.svg.js";
|
|
38
|
-
import "vue3-ace-editor";
|
|
39
|
-
import "ace-builds/src-noconflict/mode-vue";
|
|
40
|
-
import "ace-builds/src-noconflict/mode-javascript";
|
|
41
|
-
import "ace-builds/src-noconflict/mode-html";
|
|
42
|
-
import "ace-builds/src-noconflict/mode-json";
|
|
43
|
-
import "ace-builds/src-noconflict/mode-json5";
|
|
44
|
-
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
45
|
-
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
46
|
-
import "ace-builds/src-noconflict/ext-searchbox";
|
|
47
|
-
import "ace-builds/src-noconflict/ext-language_tools";
|
|
48
|
-
import "ace-builds/src-noconflict/mode-snippets";
|
|
49
51
|
import "dayjs";
|
|
50
52
|
import "@tanstack/vue-query";
|
|
51
53
|
import "pinia";
|
|
52
|
-
const
|
|
54
|
+
const we = /* @__PURE__ */ c({
|
|
53
55
|
name: "DuxFileManageItem",
|
|
54
56
|
props: {
|
|
55
57
|
name: String,
|
|
@@ -67,125 +69,122 @@ const xe = /* @__PURE__ */ c({
|
|
|
67
69
|
t: r
|
|
68
70
|
} = s(), m = {
|
|
69
71
|
image: {
|
|
70
|
-
check: (
|
|
71
|
-
render: () =>
|
|
72
|
+
check: (t) => t.startsWith("image/"),
|
|
73
|
+
render: () => e("div", {
|
|
72
74
|
class: "size-12 flex items-center justify-center",
|
|
73
|
-
onClick: (
|
|
74
|
-
}, [
|
|
75
|
+
onClick: (t) => t.stopPropagation()
|
|
76
|
+
}, [e(u, {
|
|
75
77
|
src: i.url,
|
|
76
78
|
width: 48,
|
|
77
79
|
height: 48
|
|
78
80
|
}, null)])
|
|
79
81
|
},
|
|
80
82
|
video: {
|
|
81
|
-
check: (
|
|
82
|
-
render: () =>
|
|
83
|
-
onClick: (
|
|
84
|
-
|
|
83
|
+
check: (t) => t.startsWith("video/"),
|
|
84
|
+
render: () => e("div", {
|
|
85
|
+
onClick: (t) => {
|
|
86
|
+
t.stopPropagation(), o.node({
|
|
85
87
|
title: r("components.button.preview"),
|
|
86
|
-
render: () =>
|
|
88
|
+
render: () => e("div", {
|
|
87
89
|
class: "flex items-center justify-center"
|
|
88
|
-
}, [
|
|
90
|
+
}, [e("video", {
|
|
89
91
|
class: "w-120 max-w-full",
|
|
90
92
|
controls: !0
|
|
91
|
-
}, [
|
|
93
|
+
}, [e("source", {
|
|
92
94
|
src: i.url,
|
|
93
95
|
type: i.mime
|
|
94
96
|
}, null)])])
|
|
95
97
|
});
|
|
96
98
|
}
|
|
97
|
-
}, [
|
|
99
|
+
}, [e("img", {
|
|
98
100
|
src: k,
|
|
99
101
|
class: "size-12"
|
|
100
102
|
}, null)])
|
|
101
103
|
},
|
|
102
104
|
audio: {
|
|
103
|
-
check: (
|
|
104
|
-
render: () =>
|
|
105
|
-
onClick: (
|
|
106
|
-
|
|
105
|
+
check: (t) => t.startsWith("audio/"),
|
|
106
|
+
render: () => e("div", {
|
|
107
|
+
onClick: (t) => {
|
|
108
|
+
t.stopPropagation(), o.node({
|
|
107
109
|
title: r("components.button.preview"),
|
|
108
|
-
render: () =>
|
|
110
|
+
render: () => e("div", {
|
|
109
111
|
class: "flex items-center justify-center"
|
|
110
|
-
}, [
|
|
112
|
+
}, [e("audio", {
|
|
111
113
|
class: "w-120 max-w-full",
|
|
112
114
|
controls: !0
|
|
113
|
-
}, [
|
|
115
|
+
}, [e("source", {
|
|
114
116
|
src: i.url,
|
|
115
117
|
type: i.mime
|
|
116
118
|
}, null)])])
|
|
117
119
|
});
|
|
118
120
|
}
|
|
119
|
-
}, [
|
|
121
|
+
}, [e("img", {
|
|
120
122
|
src: f,
|
|
121
123
|
class: "size-12"
|
|
122
124
|
}, null)])
|
|
123
125
|
},
|
|
124
126
|
pdf: {
|
|
125
|
-
check: (
|
|
126
|
-
render: () =>
|
|
127
|
+
check: (t) => t === "application/pdf",
|
|
128
|
+
render: () => e("img", {
|
|
127
129
|
src: h,
|
|
128
130
|
class: "size-12"
|
|
129
131
|
}, null)
|
|
130
132
|
},
|
|
131
133
|
word: {
|
|
132
|
-
check: (
|
|
133
|
-
render: () =>
|
|
134
|
+
check: (t) => ["application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/msword"].includes(t),
|
|
135
|
+
render: () => e("img", {
|
|
134
136
|
src: w,
|
|
135
137
|
class: "size-12"
|
|
136
138
|
}, null)
|
|
137
139
|
},
|
|
138
140
|
excel: {
|
|
139
|
-
check: (
|
|
140
|
-
render: () =>
|
|
141
|
+
check: (t) => ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.ms-excel"].includes(t),
|
|
142
|
+
render: () => e("img", {
|
|
141
143
|
src: g,
|
|
142
144
|
class: "size-12"
|
|
143
145
|
}, null)
|
|
144
146
|
},
|
|
145
147
|
powerpoint: {
|
|
146
|
-
check: (
|
|
147
|
-
render: () =>
|
|
148
|
+
check: (t) => ["application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.ms-powerpoint"].includes(t),
|
|
149
|
+
render: () => e("img", {
|
|
148
150
|
src: x,
|
|
149
151
|
class: "size-12"
|
|
150
152
|
}, null)
|
|
151
153
|
}
|
|
152
154
|
}, l = () => {
|
|
153
155
|
if (i.type === "folder")
|
|
154
|
-
return
|
|
156
|
+
return e("img", {
|
|
155
157
|
src: v,
|
|
156
158
|
class: "size-12"
|
|
157
159
|
}, null);
|
|
158
160
|
if (!i.mime)
|
|
159
|
-
return
|
|
161
|
+
return e("img", {
|
|
160
162
|
src: n,
|
|
161
163
|
class: "size-12"
|
|
162
164
|
}, null);
|
|
163
|
-
for (const
|
|
164
|
-
if (
|
|
165
|
-
return
|
|
166
|
-
return
|
|
165
|
+
for (const t of Object.values(m))
|
|
166
|
+
if (t.check(i.mime))
|
|
167
|
+
return t.render();
|
|
168
|
+
return e("img", {
|
|
167
169
|
src: n,
|
|
168
170
|
class: "size-12"
|
|
169
171
|
}, null);
|
|
170
172
|
};
|
|
171
|
-
return () =>
|
|
173
|
+
return () => e("div", {
|
|
172
174
|
class: "flex flex-col items-center justify-center hover:bg-primary/10 cursor-pointer p-2 rounded-sm relative group",
|
|
173
175
|
onContextmenu: i.onContextmenu,
|
|
174
|
-
onClick: () =>
|
|
175
|
-
|
|
176
|
-
return (e = i.onSelect) == null ? void 0 : e.call(i, !(i != null && i.value));
|
|
177
|
-
}
|
|
178
|
-
}, [t("div", {
|
|
176
|
+
onClick: () => i.onSelect?.(!i?.value)
|
|
177
|
+
}, [e("div", {
|
|
179
178
|
class: "mb-2"
|
|
180
|
-
}, [l()]),
|
|
179
|
+
}, [l()]), e("div", {
|
|
181
180
|
class: "truncate w-full text-center"
|
|
182
|
-
}, [i.name]),
|
|
183
|
-
class:
|
|
184
|
-
}, [i.type === "file" && !i.page &&
|
|
181
|
+
}, [i.name]), e("div", {
|
|
182
|
+
class: p(["absolute top-2 right-2", i.value ? "block" : "hidden group-hover:block"])
|
|
183
|
+
}, [i.type === "file" && !i.page && e(a, {
|
|
185
184
|
checked: i.value
|
|
186
185
|
}, null)])]);
|
|
187
186
|
}
|
|
188
187
|
});
|
|
189
188
|
export {
|
|
190
|
-
|
|
189
|
+
we as DuxFileManageItem
|
|
191
190
|
};
|