@duxweb/dvha-pro 1.0.31 → 1.0.33
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/chart/echart.cjs +1 -1
- package/dist/cjs/components/crop/imageCrop.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/designEditor/components/grid.cjs +1 -1
- package/dist/cjs/components/designEditor/editor/setting.cjs +1 -1
- package/dist/cjs/components/form/drawerForm.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/pageTabForm.cjs +1 -0
- package/dist/cjs/components/form/settingForm.cjs +1 -1
- package/dist/cjs/components/formEditor/base/base.cjs +1 -1
- package/dist/cjs/components/formEditor/base/setting.cjs +1 -1
- package/dist/cjs/components/formEditor/components/cascader.cjs +1 -1
- package/dist/cjs/components/formEditor/components/cascaderAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/checkbox.cjs +1 -1
- package/dist/cjs/components/formEditor/components/color.cjs +1 -1
- package/dist/cjs/components/formEditor/components/date.cjs +1 -1
- package/dist/cjs/components/formEditor/components/dynamicInput.cjs +1 -1
- package/dist/cjs/components/formEditor/components/dynamicTags.cjs +1 -1
- package/dist/cjs/components/formEditor/components/editor.cjs +1 -1
- package/dist/cjs/components/formEditor/components/input.cjs +1 -1
- package/dist/cjs/components/formEditor/components/inputNumber.cjs +1 -1
- package/dist/cjs/components/formEditor/components/mentionAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/radio.cjs +1 -1
- package/dist/cjs/components/formEditor/components/region.cjs +1 -1
- package/dist/cjs/components/formEditor/components/select.cjs +1 -1
- package/dist/cjs/components/formEditor/components/selectAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/sider.cjs +1 -1
- package/dist/cjs/components/formEditor/components/switch.cjs +1 -1
- package/dist/cjs/components/formEditor/components/time.cjs +1 -1
- package/dist/cjs/components/formEditor/components/transferAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/treeSelect.cjs +1 -1
- package/dist/cjs/components/formEditor/components/treeSelectAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/editor.cjs +1 -1
- package/dist/cjs/components/formEditor/renderer.cjs +1 -1
- package/dist/cjs/components/icon/icon.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/level/level.cjs +1 -1
- package/dist/cjs/components/posterEditor/pages/RightPanel.cjs +1 -1
- package/dist/cjs/components/posterEditor/posterEditor.cjs +1 -1
- package/dist/cjs/components/table/table.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/config/echart.cjs +1 -1
- package/dist/cjs/dvha-pro.css +1 -1
- package/dist/cjs/hooks/dialog.cjs +1 -1
- package/dist/cjs/hooks/drawer.cjs +1 -1
- package/dist/cjs/hooks/modal.cjs +1 -1
- package/dist/cjs/hooks/table/image.cjs +1 -1
- package/dist/cjs/hooks/table/media.cjs +1 -1
- package/dist/cjs/index.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/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/page404.cjs +1 -1
- package/dist/cjs/pages/pageStatus.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +2 -1
- package/dist/esm/component.js +31 -31
- package/dist/esm/components/chart/echart.js +16 -2
- package/dist/esm/components/crop/imageCrop.js +26 -12
- package/dist/esm/components/data/dynamicSelect.js +34 -20
- package/dist/esm/components/data/selectModal.js +41 -27
- package/dist/esm/components/designEditor/components/grid.js +39 -25
- package/dist/esm/components/designEditor/editor/setting.js +36 -22
- package/dist/esm/components/form/drawerForm.js +32 -18
- package/dist/esm/components/form/modalForm.js +31 -17
- package/dist/esm/components/form/pageForm.js +40 -30
- package/dist/esm/components/form/pageTabForm.js +159 -0
- package/dist/esm/components/form/settingForm.js +32 -18
- package/dist/esm/components/formEditor/base/base.js +29 -15
- package/dist/esm/components/formEditor/base/setting.js +21 -7
- package/dist/esm/components/formEditor/components/cascader.js +65 -51
- package/dist/esm/components/formEditor/components/cascaderAsync.js +95 -81
- package/dist/esm/components/formEditor/components/checkbox.js +43 -29
- package/dist/esm/components/formEditor/components/color.js +34 -20
- package/dist/esm/components/formEditor/components/date.js +51 -37
- package/dist/esm/components/formEditor/components/dynamicInput.js +42 -28
- package/dist/esm/components/formEditor/components/dynamicTags.js +39 -25
- package/dist/esm/components/formEditor/components/editor.js +23 -9
- package/dist/esm/components/formEditor/components/input.js +66 -52
- package/dist/esm/components/formEditor/components/inputNumber.js +37 -23
- package/dist/esm/components/formEditor/components/mentionAsync.js +60 -46
- package/dist/esm/components/formEditor/components/radio.js +28 -14
- package/dist/esm/components/formEditor/components/region.js +37 -23
- package/dist/esm/components/formEditor/components/select.js +16 -2
- package/dist/esm/components/formEditor/components/selectAsync.js +72 -58
- package/dist/esm/components/formEditor/components/sider.js +40 -26
- package/dist/esm/components/formEditor/components/switch.js +33 -19
- package/dist/esm/components/formEditor/components/time.js +60 -46
- package/dist/esm/components/formEditor/components/transferAsync.js +49 -35
- package/dist/esm/components/formEditor/components/treeSelect.js +54 -40
- package/dist/esm/components/formEditor/components/treeSelectAsync.js +74 -60
- package/dist/esm/components/formEditor/editor.js +16 -2
- package/dist/esm/components/formEditor/renderer.js +28 -14
- package/dist/esm/components/icon/icon.js +23 -9
- package/dist/esm/components/layout/list.js +69 -55
- package/dist/esm/components/layout/table.js +101 -85
- package/dist/esm/components/level/level.js +37 -23
- package/dist/esm/components/posterEditor/pages/RightPanel.js +46 -32
- package/dist/esm/components/posterEditor/posterEditor.js +26 -12
- package/dist/esm/components/table/table.js +21 -7
- package/dist/esm/components/upload/file.js +20 -4
- package/dist/esm/components/upload/image.js +42 -28
- package/dist/esm/components/upload/manage/item.js +24 -10
- package/dist/esm/components/upload/manager.js +16 -2
- package/dist/esm/config/echart.js +1 -1
- package/dist/esm/dvha-pro.css +1 -1
- package/dist/esm/hooks/dialog.js +16 -2
- package/dist/esm/hooks/drawer.js +16 -2
- package/dist/esm/hooks/modal.js +16 -2
- package/dist/esm/hooks/table/image.js +20 -6
- package/dist/esm/hooks/table/media.js +20 -6
- package/dist/esm/index.js +130 -128
- package/dist/esm/pages/layout/global.js +52 -37
- package/dist/esm/pages/layout/page.js +26 -12
- package/dist/esm/pages/login.js +33 -19
- package/dist/esm/pages/menu/avatar.js +46 -32
- package/dist/esm/pages/menu/button.js +22 -8
- package/dist/esm/pages/menu/cmd.js +51 -37
- package/dist/esm/pages/menu/main.js +42 -28
- package/dist/esm/pages/menu/mobile.js +16 -2
- package/dist/esm/pages/page404.js +14 -0
- package/dist/esm/pages/pageStatus.js +18 -4
- package/dist/esm/theme/uno.css.js +2 -1
- package/dist/types/components/data/selectModal.d.ts +1 -1
- package/dist/types/components/form/index.d.ts +1 -0
- package/dist/types/components/form/pageForm.d.ts +0 -9
- package/dist/types/components/form/pageTabForm.d.ts +63 -0
- package/dist/types/components/layout/table.d.ts +2 -2
- package/dist/types/components/table/tablePage.d.ts +2 -2
- package/package.json +5 -3
package/dist/esm/pages/login.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as h, ref as v, reactive as w, createVNode as e, isVNode as x } from "vue";
|
|
2
2
|
import { useTheme as b, useManage as y, useI18n as k, useLogin as j, DuxLogo as D } from "@duxweb/dvha-core";
|
|
3
3
|
import L from "clsx";
|
|
4
|
-
import { useMessage as N, NForm as F, NFormItem as
|
|
4
|
+
import { useMessage as N, NForm as F, NFormItem as p, NInput as n, NButton as P } from "naive-ui";
|
|
5
5
|
import "vue-echarts";
|
|
6
6
|
import "vue-router";
|
|
7
7
|
import "@overlastic/vue";
|
|
@@ -30,6 +30,20 @@ import { DuxDrawApps as S } from "../components/draw/drawApps.js";
|
|
|
30
30
|
import "@vee-validate/i18n";
|
|
31
31
|
import "colorizr";
|
|
32
32
|
import "echarts";
|
|
33
|
+
import "highlight.js/lib/core";
|
|
34
|
+
import "highlight.js/lib/languages/bash";
|
|
35
|
+
import "highlight.js/lib/languages/css";
|
|
36
|
+
import "highlight.js/lib/languages/go";
|
|
37
|
+
import "highlight.js/lib/languages/java";
|
|
38
|
+
import "highlight.js/lib/languages/javascript";
|
|
39
|
+
import "highlight.js/lib/languages/json";
|
|
40
|
+
import "highlight.js/lib/languages/markdown";
|
|
41
|
+
import "highlight.js/lib/languages/php";
|
|
42
|
+
import "highlight.js/lib/languages/python";
|
|
43
|
+
import "highlight.js/lib/languages/shell";
|
|
44
|
+
import "highlight.js/lib/languages/sql";
|
|
45
|
+
import "highlight.js/lib/languages/typescript";
|
|
46
|
+
import "highlight.js/lib/languages/xml";
|
|
33
47
|
import "@ant-design/colors";
|
|
34
48
|
import "@unocss/preset-icons/browser";
|
|
35
49
|
import "@unocss/preset-typography";
|
|
@@ -44,16 +58,16 @@ import "aieditor";
|
|
|
44
58
|
import "@iconify-json/tabler/icons.json";
|
|
45
59
|
import "../components/posterEditor/elements/index.js";
|
|
46
60
|
import "fabric";
|
|
47
|
-
function V(
|
|
48
|
-
return typeof
|
|
61
|
+
function V(l) {
|
|
62
|
+
return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !x(l);
|
|
49
63
|
}
|
|
50
|
-
const
|
|
64
|
+
const _e = /* @__PURE__ */ h({
|
|
51
65
|
name: "DuxLoginPage",
|
|
52
|
-
setup(
|
|
66
|
+
setup(l, {
|
|
53
67
|
slots: u
|
|
54
68
|
}) {
|
|
55
69
|
const r = b(), o = y(), {
|
|
56
|
-
t:
|
|
70
|
+
t: i
|
|
57
71
|
} = k(), c = v(), m = N(), t = w({
|
|
58
72
|
username: "",
|
|
59
73
|
password: ""
|
|
@@ -62,16 +76,16 @@ const je = /* @__PURE__ */ h({
|
|
|
62
76
|
isLoading: g
|
|
63
77
|
} = j({
|
|
64
78
|
onSuccess: () => {
|
|
65
|
-
m.success(
|
|
79
|
+
m.success(i("pages.login.success"));
|
|
66
80
|
},
|
|
67
|
-
onError: (
|
|
68
|
-
m.error(
|
|
81
|
+
onError: (s) => {
|
|
82
|
+
m.error(s?.message || i("pages.login.error"));
|
|
69
83
|
}
|
|
70
84
|
}), f = () => {
|
|
71
85
|
d(t);
|
|
72
86
|
};
|
|
73
87
|
return () => {
|
|
74
|
-
let
|
|
88
|
+
let s;
|
|
75
89
|
return e("div", {
|
|
76
90
|
class: L(["h-screen w-screen flex items-start justify-center text-secondary md:items-center", r.isDark.value ? "app-login-dark-bg" : "app-login-bg"])
|
|
77
91
|
}, [e("div", {
|
|
@@ -110,33 +124,33 @@ const je = /* @__PURE__ */ h({
|
|
|
110
124
|
model: t,
|
|
111
125
|
class: "flex flex-col gap-4"
|
|
112
126
|
}, {
|
|
113
|
-
default: () => [e(
|
|
127
|
+
default: () => [e(p, {
|
|
114
128
|
showLabel: !1,
|
|
115
129
|
path: "username",
|
|
116
130
|
showFeedback: !1
|
|
117
131
|
}, {
|
|
118
|
-
default: () => [e(
|
|
132
|
+
default: () => [e(n, {
|
|
119
133
|
value: t.username,
|
|
120
134
|
onUpdateValue: (a) => t.username = a,
|
|
121
135
|
type: "text",
|
|
122
|
-
placeholder:
|
|
136
|
+
placeholder: i("pages.login.placeholder.username"),
|
|
123
137
|
size: "large"
|
|
124
138
|
}, {
|
|
125
139
|
default: () => e("div", {
|
|
126
140
|
class: "text-lg i-tabler:user"
|
|
127
141
|
}, null)
|
|
128
142
|
})]
|
|
129
|
-
}), e(
|
|
143
|
+
}), e(p, {
|
|
130
144
|
showLabel: !1,
|
|
131
145
|
path: "password",
|
|
132
146
|
showFeedback: !1
|
|
133
147
|
}, {
|
|
134
|
-
default: () => [e(
|
|
148
|
+
default: () => [e(n, {
|
|
135
149
|
value: t.password,
|
|
136
150
|
onUpdateValue: (a) => t.password = a,
|
|
137
151
|
type: "password",
|
|
138
152
|
showPasswordOn: "mousedown",
|
|
139
|
-
placeholder:
|
|
153
|
+
placeholder: i("pages.login.placeholder.password"),
|
|
140
154
|
size: "large",
|
|
141
155
|
inputProps: {
|
|
142
156
|
autocomplete: "new-password"
|
|
@@ -154,8 +168,8 @@ const je = /* @__PURE__ */ h({
|
|
|
154
168
|
block: !0,
|
|
155
169
|
loading: g.value,
|
|
156
170
|
onClick: f
|
|
157
|
-
}, V(
|
|
158
|
-
default: () => [
|
|
171
|
+
}, V(s = i("pages.login.buttons.login")) ? s : {
|
|
172
|
+
default: () => [s]
|
|
159
173
|
})])]
|
|
160
174
|
})]), e("div", {
|
|
161
175
|
class: "text-center text-sm text-muted"
|
|
@@ -164,5 +178,5 @@ const je = /* @__PURE__ */ h({
|
|
|
164
178
|
}
|
|
165
179
|
});
|
|
166
180
|
export {
|
|
167
|
-
|
|
181
|
+
_e as DuxLoginPage
|
|
168
182
|
};
|
|
@@ -30,6 +30,20 @@ import "vue-draggable-plus";
|
|
|
30
30
|
import "@vee-validate/i18n";
|
|
31
31
|
import "colorizr";
|
|
32
32
|
import "echarts";
|
|
33
|
+
import "highlight.js/lib/core";
|
|
34
|
+
import "highlight.js/lib/languages/bash";
|
|
35
|
+
import "highlight.js/lib/languages/css";
|
|
36
|
+
import "highlight.js/lib/languages/go";
|
|
37
|
+
import "highlight.js/lib/languages/java";
|
|
38
|
+
import "highlight.js/lib/languages/javascript";
|
|
39
|
+
import "highlight.js/lib/languages/json";
|
|
40
|
+
import "highlight.js/lib/languages/markdown";
|
|
41
|
+
import "highlight.js/lib/languages/php";
|
|
42
|
+
import "highlight.js/lib/languages/python";
|
|
43
|
+
import "highlight.js/lib/languages/shell";
|
|
44
|
+
import "highlight.js/lib/languages/sql";
|
|
45
|
+
import "highlight.js/lib/languages/typescript";
|
|
46
|
+
import "highlight.js/lib/languages/xml";
|
|
33
47
|
import "@ant-design/colors";
|
|
34
48
|
import "@unocss/preset-icons/browser";
|
|
35
49
|
import "@unocss/preset-typography";
|
|
@@ -45,7 +59,7 @@ import "aieditor";
|
|
|
45
59
|
import "@iconify-json/tabler/icons.json";
|
|
46
60
|
import "../../components/posterEditor/elements/index.js";
|
|
47
61
|
import "fabric";
|
|
48
|
-
const
|
|
62
|
+
const Fe = /* @__PURE__ */ A({
|
|
49
63
|
name: "DuxMenuAvatar",
|
|
50
64
|
props: {
|
|
51
65
|
collapsed: {
|
|
@@ -65,23 +79,23 @@ const Le = /* @__PURE__ */ A({
|
|
|
65
79
|
mode: m,
|
|
66
80
|
primaryColors: x,
|
|
67
81
|
neutralColors: C,
|
|
68
|
-
colorMapping:
|
|
69
|
-
setColor:
|
|
82
|
+
colorMapping: u,
|
|
83
|
+
setColor: c,
|
|
70
84
|
setMode: M
|
|
71
|
-
} = I(),
|
|
85
|
+
} = I(), l = (o, r) => e("div", {
|
|
72
86
|
class: "flex gap-2 items-center w-30"
|
|
73
87
|
}, [e("div", {
|
|
74
88
|
class: "flex-1 min-w-0"
|
|
75
|
-
}, [o]), e("div", null, [
|
|
89
|
+
}, [o]), e("div", null, [r && e("div", {
|
|
76
90
|
class: "i-tabler:check"
|
|
77
|
-
}, null)])]),
|
|
91
|
+
}, null)])]), i = (o) => e("div", {
|
|
78
92
|
class: `${o} size-4`
|
|
79
93
|
}, null), w = d(() => {
|
|
80
|
-
const o = h.userMenus?.map((
|
|
81
|
-
label: t(
|
|
82
|
-
key:
|
|
83
|
-
icon: () =>
|
|
84
|
-
path:
|
|
94
|
+
const o = h.userMenus?.map((r) => ({
|
|
95
|
+
label: t(r.label || "", {}, r.label),
|
|
96
|
+
key: r.key,
|
|
97
|
+
icon: () => i(r.icon),
|
|
98
|
+
path: r.path
|
|
85
99
|
}));
|
|
86
100
|
return o?.length > 0 ? [...o, {
|
|
87
101
|
type: "divider"
|
|
@@ -107,15 +121,15 @@ const Le = /* @__PURE__ */ A({
|
|
|
107
121
|
}, ...w.value, {
|
|
108
122
|
label: t("components.menu.language"),
|
|
109
123
|
key: "locale",
|
|
110
|
-
icon: () =>
|
|
124
|
+
icon: () => i("i-tabler:language"),
|
|
111
125
|
children: [...(s.getLocales() || []).map((o) => ({
|
|
112
|
-
label: () =>
|
|
126
|
+
label: () => l(t(`locale.${o}`), s.getLocale() === o),
|
|
113
127
|
key: `locale.${o}`
|
|
114
128
|
}))]
|
|
115
129
|
}, {
|
|
116
130
|
label: t("components.menu.color"),
|
|
117
131
|
key: "color",
|
|
118
|
-
icon: () =>
|
|
132
|
+
icon: () => i("i-tabler:palette"),
|
|
119
133
|
children: [{
|
|
120
134
|
label: () => e("div", {
|
|
121
135
|
class: "flex gap-2 items-center w-30"
|
|
@@ -127,14 +141,14 @@ const Le = /* @__PURE__ */ A({
|
|
|
127
141
|
}, null), e("div", null, [t("components.menu.primaryColor")])]),
|
|
128
142
|
key: "color.primary",
|
|
129
143
|
children: x.value?.map((o) => ({
|
|
130
|
-
label: () =>
|
|
144
|
+
label: () => l(e("div", {
|
|
131
145
|
class: "flex gap-2 items-center"
|
|
132
146
|
}, [e("div", {
|
|
133
147
|
class: "size-2 rounded-full",
|
|
134
148
|
style: {
|
|
135
149
|
backgroundColor: `rgb(var(--base-color-${o}-500))`
|
|
136
150
|
}
|
|
137
|
-
}, null), e("div", null, [o])]),
|
|
151
|
+
}, null), e("div", null, [o])]), u.value.primary === o),
|
|
138
152
|
key: `color.primary.${o}`
|
|
139
153
|
}))
|
|
140
154
|
}, {
|
|
@@ -148,29 +162,29 @@ const Le = /* @__PURE__ */ A({
|
|
|
148
162
|
}, null), e("div", null, [t("components.menu.neutralColor")])]),
|
|
149
163
|
key: "color.neutral",
|
|
150
164
|
children: C.value?.map((o) => ({
|
|
151
|
-
label: () =>
|
|
165
|
+
label: () => l(e("div", {
|
|
152
166
|
class: "flex gap-2 items-center"
|
|
153
167
|
}, [e("div", {
|
|
154
168
|
class: "size-2 rounded-full",
|
|
155
169
|
style: {
|
|
156
170
|
backgroundColor: `rgb(var(--base-color-${o}-600))`
|
|
157
171
|
}
|
|
158
|
-
}, null), e("div", null, [o])]),
|
|
172
|
+
}, null), e("div", null, [o])]), u.value.gray === o),
|
|
159
173
|
key: `color.neutral.${o}`
|
|
160
174
|
}))
|
|
161
175
|
}]
|
|
162
176
|
}, {
|
|
163
177
|
label: t("components.menu.theme"),
|
|
164
178
|
key: "theme",
|
|
165
|
-
icon: () =>
|
|
179
|
+
icon: () => i("i-tabler:brightness-half"),
|
|
166
180
|
children: [{
|
|
167
|
-
label: () =>
|
|
181
|
+
label: () => l(t("components.menu.followSystem"), m.value === "auto"),
|
|
168
182
|
key: "theme.auto"
|
|
169
183
|
}, {
|
|
170
|
-
label: () =>
|
|
184
|
+
label: () => l(t("components.menu.lightMode"), m.value === "light"),
|
|
171
185
|
key: "theme.light"
|
|
172
186
|
}, {
|
|
173
|
-
label: () =>
|
|
187
|
+
label: () => l(t("components.menu.darkMode"), m.value === "dark"),
|
|
174
188
|
key: "theme.dark"
|
|
175
189
|
}]
|
|
176
190
|
}, {
|
|
@@ -178,30 +192,30 @@ const Le = /* @__PURE__ */ A({
|
|
|
178
192
|
}, {
|
|
179
193
|
label: t("components.menu.logout"),
|
|
180
194
|
key: "logout",
|
|
181
|
-
icon: () =>
|
|
195
|
+
icon: () => i("i-tabler:logout")
|
|
182
196
|
}]);
|
|
183
|
-
function $(o,
|
|
184
|
-
const
|
|
197
|
+
function $(o, r) {
|
|
198
|
+
const p = o.lastIndexOf("."), [D, n] = p === -1 ? [o, ""] : [o.substring(0, p), o.substring(p + 1)];
|
|
185
199
|
switch (D) {
|
|
186
200
|
case "locale":
|
|
187
|
-
s.changeLocale(
|
|
201
|
+
s.changeLocale(n);
|
|
188
202
|
break;
|
|
189
203
|
case "color.primary":
|
|
190
|
-
|
|
204
|
+
c("primary", n);
|
|
191
205
|
break;
|
|
192
206
|
case "color.neutral":
|
|
193
|
-
|
|
207
|
+
c("gray", n);
|
|
194
208
|
break;
|
|
195
209
|
case "theme":
|
|
196
|
-
M(
|
|
210
|
+
M(n);
|
|
197
211
|
break;
|
|
198
212
|
case "logout":
|
|
199
213
|
k();
|
|
200
214
|
break;
|
|
201
215
|
default:
|
|
202
|
-
if (!
|
|
216
|
+
if (!r?.path)
|
|
203
217
|
return;
|
|
204
|
-
b.push(y(
|
|
218
|
+
b.push(y(r.path));
|
|
205
219
|
}
|
|
206
220
|
}
|
|
207
221
|
return () => e(B, {
|
|
@@ -232,5 +246,5 @@ const Le = /* @__PURE__ */ A({
|
|
|
232
246
|
}
|
|
233
247
|
});
|
|
234
248
|
export {
|
|
235
|
-
|
|
249
|
+
Fe as default
|
|
236
250
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as p, createVNode as
|
|
1
|
+
import { defineComponent as p, createVNode as e } from "vue";
|
|
2
2
|
import "@duxweb/dvha-core";
|
|
3
3
|
import "naive-ui";
|
|
4
4
|
import "vue-router";
|
|
@@ -24,6 +24,20 @@ import "vue-draggable-plus";
|
|
|
24
24
|
import "@vee-validate/i18n";
|
|
25
25
|
import "colorizr";
|
|
26
26
|
import "echarts";
|
|
27
|
+
import "highlight.js/lib/core";
|
|
28
|
+
import "highlight.js/lib/languages/bash";
|
|
29
|
+
import "highlight.js/lib/languages/css";
|
|
30
|
+
import "highlight.js/lib/languages/go";
|
|
31
|
+
import "highlight.js/lib/languages/java";
|
|
32
|
+
import "highlight.js/lib/languages/javascript";
|
|
33
|
+
import "highlight.js/lib/languages/json";
|
|
34
|
+
import "highlight.js/lib/languages/markdown";
|
|
35
|
+
import "highlight.js/lib/languages/php";
|
|
36
|
+
import "highlight.js/lib/languages/python";
|
|
37
|
+
import "highlight.js/lib/languages/shell";
|
|
38
|
+
import "highlight.js/lib/languages/sql";
|
|
39
|
+
import "highlight.js/lib/languages/typescript";
|
|
40
|
+
import "highlight.js/lib/languages/xml";
|
|
27
41
|
import "@ant-design/colors";
|
|
28
42
|
import "@unocss/preset-icons/browser";
|
|
29
43
|
import "@unocss/preset-typography";
|
|
@@ -43,7 +57,7 @@ import "mime";
|
|
|
43
57
|
import "dayjs";
|
|
44
58
|
import "@tanstack/vue-query";
|
|
45
59
|
import { useUI as m } from "../../hooks/ui.js";
|
|
46
|
-
const
|
|
60
|
+
const st = /* @__PURE__ */ p({
|
|
47
61
|
name: "DuxMenuButton",
|
|
48
62
|
props: {
|
|
49
63
|
class: {
|
|
@@ -68,19 +82,19 @@ const _ = /* @__PURE__ */ p({
|
|
|
68
82
|
slots: o
|
|
69
83
|
}) {
|
|
70
84
|
const {
|
|
71
|
-
menuCollapsed:
|
|
72
|
-
menuMobileCollapsed:
|
|
85
|
+
menuCollapsed: r,
|
|
86
|
+
menuMobileCollapsed: i
|
|
73
87
|
} = m();
|
|
74
|
-
return () =>
|
|
88
|
+
return () => e("div", {
|
|
75
89
|
onClick: () => {
|
|
76
90
|
t.onClick?.();
|
|
77
91
|
},
|
|
78
|
-
class: ["flex items-center gap-1 justify-center py-1 px-2 cursor-pointer gap-2", t.class,
|
|
79
|
-
}, [o.icon?.(), t.collapsed === !1 && !
|
|
92
|
+
class: ["flex items-center gap-1 justify-center py-1 px-2 cursor-pointer gap-2", t.class, r.value && !i.value ? "group" : "hover:shadow-xs hover:bg-default flex-1 w-full", t.inverted ? "transition-all duration-300 bg-inverted/5 rounded-full hover:bg-default hover:shadow-xs" : " rounded-md"]
|
|
93
|
+
}, [o.icon?.(), t.collapsed === !1 && !r.value && !i.value && e("div", {
|
|
80
94
|
class: ["overflow-hidden ease-in-out whitespace-nowrap text-left min-w-0 flex-1", t.inverted ? "text-default" : ""]
|
|
81
95
|
}, [o.default?.()])]);
|
|
82
96
|
}
|
|
83
97
|
});
|
|
84
98
|
export {
|
|
85
|
-
|
|
99
|
+
st as default
|
|
86
100
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as M, ref as
|
|
1
|
+
import { defineComponent as M, ref as p, watch as m, computed as w, createVNode as t, Fragment as V, createTextVNode as B } from "vue";
|
|
2
2
|
import { useRouteStore as D, useTheme as T, useI18n as K } from "@duxweb/dvha-core";
|
|
3
3
|
import { useMagicKeys as R, watchThrottled as j } from "@vueuse/core";
|
|
4
4
|
import { cloneDeep as E } from "lodash-es";
|
|
5
5
|
import { NTag as k, NButton as G } from "naive-ui";
|
|
6
|
-
import { Command as
|
|
6
|
+
import { Command as l } from "vue-command-palette";
|
|
7
7
|
import { useRouter as L } from "vue-router";
|
|
8
8
|
import "@overlastic/vue";
|
|
9
9
|
import "clsx";
|
|
@@ -25,6 +25,20 @@ import "vue-draggable-plus";
|
|
|
25
25
|
import "@vee-validate/i18n";
|
|
26
26
|
import "colorizr";
|
|
27
27
|
import "echarts";
|
|
28
|
+
import "highlight.js/lib/core";
|
|
29
|
+
import "highlight.js/lib/languages/bash";
|
|
30
|
+
import "highlight.js/lib/languages/css";
|
|
31
|
+
import "highlight.js/lib/languages/go";
|
|
32
|
+
import "highlight.js/lib/languages/java";
|
|
33
|
+
import "highlight.js/lib/languages/javascript";
|
|
34
|
+
import "highlight.js/lib/languages/json";
|
|
35
|
+
import "highlight.js/lib/languages/markdown";
|
|
36
|
+
import "highlight.js/lib/languages/php";
|
|
37
|
+
import "highlight.js/lib/languages/python";
|
|
38
|
+
import "highlight.js/lib/languages/shell";
|
|
39
|
+
import "highlight.js/lib/languages/sql";
|
|
40
|
+
import "highlight.js/lib/languages/typescript";
|
|
41
|
+
import "highlight.js/lib/languages/xml";
|
|
28
42
|
import "@ant-design/colors";
|
|
29
43
|
import "@unocss/preset-icons/browser";
|
|
30
44
|
import "@unocss/preset-typography";
|
|
@@ -43,47 +57,47 @@ import "mime";
|
|
|
43
57
|
import "dayjs";
|
|
44
58
|
import "@tanstack/vue-query";
|
|
45
59
|
import { useUI as q } from "../../hooks/ui.js";
|
|
46
|
-
const
|
|
60
|
+
const Je = /* @__PURE__ */ M({
|
|
47
61
|
name: "DuxMenuCmd",
|
|
48
62
|
setup() {
|
|
49
63
|
const {
|
|
50
64
|
cmdVisible: h,
|
|
51
|
-
setCmdVisible:
|
|
52
|
-
} = q(),
|
|
65
|
+
setCmdVisible: s
|
|
66
|
+
} = q(), c = R(), y = c["Meta+K"], u = p(), i = p([]), S = L(), a = D(), {
|
|
53
67
|
setMode: v
|
|
54
|
-
} = T(), n =
|
|
55
|
-
t:
|
|
56
|
-
} = K(), b =
|
|
57
|
-
const
|
|
58
|
-
u.value = e,
|
|
68
|
+
} = T(), n = p(""), {
|
|
69
|
+
t: o
|
|
70
|
+
} = K(), b = p(), g = (e) => {
|
|
71
|
+
const r = a.routes.filter((I) => I.parent === e);
|
|
72
|
+
u.value = e, i.value = r;
|
|
59
73
|
}, C = () => {
|
|
60
|
-
|
|
74
|
+
s(!0);
|
|
61
75
|
}, N = () => {
|
|
62
|
-
|
|
76
|
+
s(!1);
|
|
63
77
|
}, z = (e) => {
|
|
64
|
-
e ?
|
|
78
|
+
e ? i.value = [...E(a.routes).filter((r) => r.label?.includes(e))] : i.value = a.routes.filter((r) => !r.parent);
|
|
65
79
|
};
|
|
66
|
-
|
|
67
|
-
e ?
|
|
80
|
+
m(h, (e) => {
|
|
81
|
+
e ? i.value = a.routes.filter((r) => !r.parent) : i.value = a.routes.filter((r) => !r.parent);
|
|
68
82
|
}), j(n, () => {
|
|
69
83
|
z(n.value);
|
|
70
84
|
}, {
|
|
71
85
|
throttle: 500
|
|
72
86
|
});
|
|
73
87
|
const x = () => {
|
|
74
|
-
const e =
|
|
88
|
+
const e = a.routes.find((r) => r.name === u.value);
|
|
75
89
|
g(e?.parent);
|
|
76
90
|
};
|
|
77
|
-
|
|
91
|
+
m(y, (e) => {
|
|
78
92
|
e && C();
|
|
79
|
-
}),
|
|
80
|
-
e &&
|
|
81
|
-
}),
|
|
93
|
+
}), m(c.Escape, (e) => {
|
|
94
|
+
e && s(!1);
|
|
95
|
+
}), m(c.Backspace, (e) => {
|
|
82
96
|
e && n.value === "" && u.value && x();
|
|
83
|
-
}),
|
|
97
|
+
}), m(b, (e) => {
|
|
84
98
|
e && e.focus();
|
|
85
99
|
});
|
|
86
|
-
const d = w(() =>
|
|
100
|
+
const d = w(() => i.value.filter((e) => e.hidden === void 0 || e.hidden === !1)), f = (e) => t(l.Item, {
|
|
87
101
|
onSelect: e?.onSelect
|
|
88
102
|
}, {
|
|
89
103
|
default: () => [t("div", {
|
|
@@ -98,7 +112,7 @@ const De = /* @__PURE__ */ M({
|
|
|
98
112
|
default: () => [e?.keyName]
|
|
99
113
|
})])])]
|
|
100
114
|
});
|
|
101
|
-
return () => t(
|
|
115
|
+
return () => t(l.Dialog, {
|
|
102
116
|
visible: h.value,
|
|
103
117
|
theme: "command-palette"
|
|
104
118
|
}, {
|
|
@@ -106,7 +120,7 @@ const De = /* @__PURE__ */ M({
|
|
|
106
120
|
class: "relative"
|
|
107
121
|
}, [t("input", {
|
|
108
122
|
ref: b,
|
|
109
|
-
placeholder:
|
|
123
|
+
placeholder: o("common.search"),
|
|
110
124
|
onInput: (e) => {
|
|
111
125
|
n.value = e.target.value;
|
|
112
126
|
},
|
|
@@ -126,7 +140,7 @@ const De = /* @__PURE__ */ M({
|
|
|
126
140
|
quaternary: !0,
|
|
127
141
|
circle: !0,
|
|
128
142
|
size: "small",
|
|
129
|
-
onClick: () =>
|
|
143
|
+
onClick: () => s(!1)
|
|
130
144
|
}, {
|
|
131
145
|
icon: () => t("div", {
|
|
132
146
|
class: "i-tabler:x size-5",
|
|
@@ -135,12 +149,12 @@ const De = /* @__PURE__ */ M({
|
|
|
135
149
|
})])]),
|
|
136
150
|
body: () => t(V, null, [d.value.length === 0 && n.value && t("div", {
|
|
137
151
|
class: "flex items-center justify-center h-20 border-t border-muted"
|
|
138
|
-
}, [
|
|
139
|
-
default: () => [t(
|
|
140
|
-
heading:
|
|
152
|
+
}, [o("common.empty")]), d.value.length > 0 && t(l.List, null, {
|
|
153
|
+
default: () => [t(l.Group, {
|
|
154
|
+
heading: o("common.menu")
|
|
141
155
|
}, {
|
|
142
|
-
default: () => [d.value?.map((e,
|
|
143
|
-
key:
|
|
156
|
+
default: () => [d.value?.map((e, r) => t(l.Item, {
|
|
157
|
+
key: r,
|
|
144
158
|
onSelect: () => {
|
|
145
159
|
e.path ? (S.push(e.path), N()) : g(e.name);
|
|
146
160
|
}
|
|
@@ -149,23 +163,23 @@ const De = /* @__PURE__ */ M({
|
|
|
149
163
|
class: e.path ? "i-tabler:link" : "i-tabler:folder"
|
|
150
164
|
}, null), e.label]
|
|
151
165
|
}))]
|
|
152
|
-
}), t(
|
|
166
|
+
}), t(l.Separator, null, null), u.value ? t(f, {
|
|
153
167
|
icon: "i-tabler:arrow-left",
|
|
154
|
-
label:
|
|
168
|
+
label: o("common.back"),
|
|
155
169
|
onSelect: x,
|
|
156
170
|
keyName: "Backspace"
|
|
157
|
-
}, null) : t(
|
|
158
|
-
heading:
|
|
171
|
+
}, null) : t(l.Group, {
|
|
172
|
+
heading: o("common.theme")
|
|
159
173
|
}, {
|
|
160
174
|
default: () => [t(f, {
|
|
161
175
|
icon: "i-tabler:moon",
|
|
162
|
-
label:
|
|
176
|
+
label: o("common.dark"),
|
|
163
177
|
onSelect: () => {
|
|
164
178
|
v("dark");
|
|
165
179
|
}
|
|
166
180
|
}, null), t(f, {
|
|
167
181
|
icon: "i-tabler:sun",
|
|
168
|
-
label:
|
|
182
|
+
label: o("common.light"),
|
|
169
183
|
onSelect: () => {
|
|
170
184
|
v("light");
|
|
171
185
|
}
|
|
@@ -176,5 +190,5 @@ const De = /* @__PURE__ */ M({
|
|
|
176
190
|
}
|
|
177
191
|
});
|
|
178
192
|
export {
|
|
179
|
-
|
|
193
|
+
Je as DuxMenuCmd
|
|
180
194
|
};
|