@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
package/dist/esm/pages/login.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import
|
|
4
|
-
import { useMessage as
|
|
1
|
+
import { defineComponent as h, ref as v, reactive as w, createVNode as e, isVNode as x } from "vue";
|
|
2
|
+
import { useTheme as b, useManage as y, useI18n as k, useLogin as j, DuxLogo as D } from "@duxweb/dvha-core";
|
|
3
|
+
import L from "clsx";
|
|
4
|
+
import { useMessage as N, NForm as F, NFormItem as n, NInput as p, NButton as P } from "naive-ui";
|
|
5
5
|
import "vue-echarts";
|
|
6
6
|
import "vue-router";
|
|
7
7
|
import "@overlastic/vue";
|
|
@@ -15,7 +15,7 @@ import "pinia";
|
|
|
15
15
|
import "vue-cropper";
|
|
16
16
|
import "jinrishici";
|
|
17
17
|
import "vue-draggable-plus";
|
|
18
|
-
import { DuxDrawApps as
|
|
18
|
+
import { DuxDrawApps as S } from "../components/draw/drawApps.js";
|
|
19
19
|
import "aieditor";
|
|
20
20
|
import "vee-validate";
|
|
21
21
|
import "@vee-validate/i18n";
|
|
@@ -41,130 +41,126 @@ import "ace-builds/src-noconflict/theme-tomorrow";
|
|
|
41
41
|
import "ace-builds/src-noconflict/ext-searchbox";
|
|
42
42
|
import "ace-builds/src-noconflict/ext-language_tools";
|
|
43
43
|
import "ace-builds/src-noconflict/mode-snippets";
|
|
44
|
-
function
|
|
45
|
-
return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !
|
|
44
|
+
function V(i) {
|
|
45
|
+
return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !x(i);
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const be = /* @__PURE__ */ h({
|
|
48
48
|
name: "DuxLoginPage",
|
|
49
49
|
setup(i, {
|
|
50
|
-
slots:
|
|
50
|
+
slots: u
|
|
51
51
|
}) {
|
|
52
|
-
const
|
|
52
|
+
const r = b(), o = y(), {
|
|
53
53
|
t: s
|
|
54
|
-
} =
|
|
54
|
+
} = k(), c = v(), m = N(), t = w({
|
|
55
55
|
username: "",
|
|
56
56
|
password: ""
|
|
57
57
|
}), {
|
|
58
|
-
mutate:
|
|
59
|
-
isLoading:
|
|
60
|
-
} =
|
|
58
|
+
mutate: d,
|
|
59
|
+
isLoading: g
|
|
60
|
+
} = j({
|
|
61
61
|
onSuccess: () => {
|
|
62
|
-
|
|
62
|
+
m.success(s("pages.login.success"));
|
|
63
63
|
},
|
|
64
|
-
onError: (
|
|
65
|
-
|
|
64
|
+
onError: (l) => {
|
|
65
|
+
m.error(l?.message || s("pages.login.error"));
|
|
66
66
|
}
|
|
67
|
-
}),
|
|
68
|
-
|
|
67
|
+
}), f = () => {
|
|
68
|
+
d(t);
|
|
69
69
|
};
|
|
70
70
|
return () => {
|
|
71
|
-
|
|
72
|
-
let o;
|
|
71
|
+
let l;
|
|
73
72
|
return e("div", {
|
|
74
73
|
"un-cloak": !0,
|
|
75
|
-
class:
|
|
74
|
+
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"])
|
|
76
75
|
}, [e("div", {
|
|
77
76
|
class: "relative md:m-4 max-w-180 w-full h-full md:h-auto grid-cols-1 md:grid-cols-2 gap-12 overflow-hidden md:rounded-lg p-8 md:shadow bg-default dark:bg-muted grid"
|
|
78
77
|
}, [e("div", {
|
|
79
78
|
class: "flex justify-center tex absolute h-30 w-30 rotate-45 cursor-pointer items-end p-3 text-white bg-primary -right-15 -top-15 hover:bg-primary-hover",
|
|
80
|
-
onClick: () =>
|
|
81
|
-
}, [
|
|
79
|
+
onClick: () => r.toggle()
|
|
80
|
+
}, [r.mode.value === "auto" && e("div", {
|
|
82
81
|
class: "i-tabler:brightness-half h-5 w-5"
|
|
83
|
-
}, null),
|
|
82
|
+
}, null), r.mode.value === "light" && e("div", {
|
|
84
83
|
class: "h-5 w-5 i-tabler:sun"
|
|
85
|
-
}, null),
|
|
84
|
+
}, null), r.mode.value === "dark" && e("div", {
|
|
86
85
|
class: "h-5 w-5 i-tabler:moon"
|
|
87
86
|
}, null)]), e("div", {
|
|
88
87
|
class: "justify-center hidden md:flex flex-row items-center"
|
|
89
|
-
}, [
|
|
88
|
+
}, [o.config.theme?.banner ? e("img", {
|
|
90
89
|
class: "w-full h-auto",
|
|
91
|
-
src:
|
|
90
|
+
src: o.config.theme?.banner
|
|
92
91
|
}, null) : e("div", {
|
|
93
92
|
class: "w-full h-auto"
|
|
94
|
-
}, [e(
|
|
93
|
+
}, [e(S, null, null)])]), e("div", {
|
|
95
94
|
class: "flex flex-col"
|
|
96
95
|
}, [e("div", {
|
|
97
96
|
class: "flex flex-col items-center justify-center mt-4"
|
|
98
|
-
}, [e("div", null, [
|
|
97
|
+
}, [e("div", null, [o.config.theme?.logo ? e("img", {
|
|
99
98
|
class: "w-auto h-16",
|
|
100
|
-
src:
|
|
99
|
+
src: o.config.theme?.logo
|
|
101
100
|
}, null) : e("div", {
|
|
102
101
|
class: "h-10"
|
|
103
|
-
}, [e(
|
|
102
|
+
}, [e(D, null, null)])]), e("div", {
|
|
104
103
|
class: "mt-4 text-lg text-muted"
|
|
105
|
-
}, [
|
|
104
|
+
}, [o.config.title || "Dux Admin Manage"])]), e("div", {
|
|
106
105
|
class: "my-6"
|
|
107
|
-
}, [e(
|
|
108
|
-
ref:
|
|
106
|
+
}, [e(F, {
|
|
107
|
+
ref: c,
|
|
109
108
|
model: t,
|
|
110
109
|
class: "flex flex-col gap-4"
|
|
111
110
|
}, {
|
|
112
|
-
default: () => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
default: () => [e(n, {
|
|
112
|
+
showLabel: !1,
|
|
113
|
+
path: "username",
|
|
114
|
+
showFeedback: !1
|
|
115
|
+
}, {
|
|
116
|
+
default: () => [e(p, {
|
|
117
|
+
value: t.username,
|
|
118
|
+
onUpdateValue: (a) => t.username = a,
|
|
119
|
+
type: "text",
|
|
120
|
+
placeholder: s("pages.login.placeholder.username"),
|
|
121
|
+
size: "large"
|
|
118
122
|
}, {
|
|
119
|
-
default: () =>
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}, {
|
|
135
|
-
default: () => [e(v, {
|
|
136
|
-
value: t.password,
|
|
137
|
-
onUpdateValue: (m) => t.password = m,
|
|
138
|
-
type: "password",
|
|
139
|
-
showPasswordOn: "mousedown",
|
|
140
|
-
placeholder: s("pages.login.placeholder.password"),
|
|
141
|
-
size: "large",
|
|
142
|
-
inputProps: {
|
|
143
|
-
autocomplete: "new-password"
|
|
144
|
-
}
|
|
145
|
-
}, {
|
|
146
|
-
default: () => e("div", {
|
|
147
|
-
class: "text-lg i-tabler:lock"
|
|
148
|
-
}, null)
|
|
149
|
-
})]
|
|
150
|
-
}), (f = a.default) == null ? void 0 : f.call(a, t), e("div", {
|
|
151
|
-
class: "mb-2 mt-4"
|
|
152
|
-
}, [e(I, {
|
|
153
|
-
type: "primary",
|
|
123
|
+
default: () => e("div", {
|
|
124
|
+
class: "text-lg i-tabler:user"
|
|
125
|
+
}, null)
|
|
126
|
+
})]
|
|
127
|
+
}), e(n, {
|
|
128
|
+
showLabel: !1,
|
|
129
|
+
path: "password",
|
|
130
|
+
showFeedback: !1
|
|
131
|
+
}, {
|
|
132
|
+
default: () => [e(p, {
|
|
133
|
+
value: t.password,
|
|
134
|
+
onUpdateValue: (a) => t.password = a,
|
|
135
|
+
type: "password",
|
|
136
|
+
showPasswordOn: "mousedown",
|
|
137
|
+
placeholder: s("pages.login.placeholder.password"),
|
|
154
138
|
size: "large",
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
},
|
|
159
|
-
default: () =>
|
|
160
|
-
|
|
161
|
-
|
|
139
|
+
inputProps: {
|
|
140
|
+
autocomplete: "new-password"
|
|
141
|
+
}
|
|
142
|
+
}, {
|
|
143
|
+
default: () => e("div", {
|
|
144
|
+
class: "text-lg i-tabler:lock"
|
|
145
|
+
}, null)
|
|
146
|
+
})]
|
|
147
|
+
}), u.default?.(t), e("div", {
|
|
148
|
+
class: "mb-2 mt-4"
|
|
149
|
+
}, [e(P, {
|
|
150
|
+
type: "primary",
|
|
151
|
+
size: "large",
|
|
152
|
+
block: !0,
|
|
153
|
+
loading: g.value,
|
|
154
|
+
onClick: f
|
|
155
|
+
}, V(l = s("pages.login.buttons.login")) ? l : {
|
|
156
|
+
default: () => [l]
|
|
157
|
+
})])]
|
|
162
158
|
})]), e("div", {
|
|
163
159
|
class: "text-center text-sm text-gray-5"
|
|
164
|
-
}, [
|
|
160
|
+
}, [o.config?.copyright || "All rights reserved © duxweb 2024"])])])]);
|
|
165
161
|
};
|
|
166
162
|
}
|
|
167
163
|
});
|
|
168
164
|
export {
|
|
169
|
-
|
|
165
|
+
be as DuxLoginPage
|
|
170
166
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as A, computed as
|
|
2
|
-
import { useI18n as
|
|
1
|
+
import { defineComponent as A, computed as d, createVNode as e } from "vue";
|
|
2
|
+
import { useI18n as v, useManage as L, useLogout as R, useTheme as I, useGetAuth as S } from "@duxweb/dvha-core";
|
|
3
3
|
import { NDropdown as B } from "naive-ui";
|
|
4
4
|
import { useRouter as N } from "vue-router";
|
|
5
5
|
import "clsx";
|
|
6
|
-
import { DuxAvatar as
|
|
6
|
+
import { DuxAvatar as f } from "../../components/widget/avatar.js";
|
|
7
7
|
import "vue-echarts";
|
|
8
8
|
import "@overlastic/vue";
|
|
9
9
|
import "dayjs";
|
|
@@ -50,193 +50,180 @@ const $e = /* @__PURE__ */ A({
|
|
|
50
50
|
default: !1
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
setup(
|
|
53
|
+
setup(g) {
|
|
54
54
|
const {
|
|
55
|
-
t
|
|
56
|
-
} =
|
|
57
|
-
config:
|
|
58
|
-
getRoutePath:
|
|
55
|
+
t
|
|
56
|
+
} = v(), s = v(), b = N(), {
|
|
57
|
+
config: h,
|
|
58
|
+
getRoutePath: y
|
|
59
59
|
} = L(), {
|
|
60
|
-
mutate:
|
|
60
|
+
mutate: k
|
|
61
61
|
} = R(), {
|
|
62
|
-
mode:
|
|
63
|
-
primaryColors:
|
|
64
|
-
neutralColors:
|
|
65
|
-
colorMapping:
|
|
66
|
-
setColor:
|
|
67
|
-
setMode:
|
|
68
|
-
} = I(),
|
|
62
|
+
mode: u,
|
|
63
|
+
primaryColors: x,
|
|
64
|
+
neutralColors: C,
|
|
65
|
+
colorMapping: c,
|
|
66
|
+
setColor: p,
|
|
67
|
+
setMode: M
|
|
68
|
+
} = I(), r = (o, l) => e("div", {
|
|
69
69
|
class: "flex gap-2 items-center w-30"
|
|
70
70
|
}, [e("div", {
|
|
71
71
|
class: "flex-1 min-w-0"
|
|
72
|
-
}, [
|
|
72
|
+
}, [o]), e("div", null, [l && e("div", {
|
|
73
73
|
class: "i-tabler:check"
|
|
74
|
-
}, null)])]),
|
|
75
|
-
class: `${
|
|
76
|
-
}, null),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
path: o.path
|
|
74
|
+
}, null)])]), n = (o) => e("div", {
|
|
75
|
+
class: `${o} size-4`
|
|
76
|
+
}, null), w = d(() => {
|
|
77
|
+
const o = h.userMenus?.map((l) => ({
|
|
78
|
+
label: t(l.label || "", {}, l.label),
|
|
79
|
+
key: l.key,
|
|
80
|
+
icon: () => n(l.icon),
|
|
81
|
+
path: l.path
|
|
83
82
|
}));
|
|
84
|
-
return
|
|
83
|
+
return o?.length > 0 ? [...o, {
|
|
85
84
|
type: "divider"
|
|
86
85
|
}] : [];
|
|
87
|
-
}),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
86
|
+
}), a = S(), z = d(() => [{
|
|
87
|
+
key: "header",
|
|
88
|
+
type: "render",
|
|
89
|
+
render: () => e("div", {
|
|
90
|
+
class: "flex gap-2 px-3 pb-1 pt-1 items-center "
|
|
91
|
+
}, [e(f, {
|
|
92
|
+
round: !0,
|
|
93
|
+
size: 28,
|
|
94
|
+
src: a.info?.avatar
|
|
95
|
+
}, null), e("div", {
|
|
96
|
+
class: "flex flex-col"
|
|
97
|
+
}, [e("div", {
|
|
98
|
+
class: "text-sm font-medium"
|
|
99
|
+
}, [a.info?.nickname]), e("div", {
|
|
100
|
+
class: "text-xs text-muted"
|
|
101
|
+
}, [a.info?.username])])])
|
|
102
|
+
}, {
|
|
103
|
+
type: "divider"
|
|
104
|
+
}, ...w.value, {
|
|
105
|
+
label: t("components.menu.language"),
|
|
106
|
+
key: "locale",
|
|
107
|
+
icon: () => n("i-tabler:language"),
|
|
108
|
+
children: [...(s.getLocales() || []).map((o) => ({
|
|
109
|
+
label: () => r(t(`locale.${o}`), s.getLocale() === o),
|
|
110
|
+
key: `locale.${o}`
|
|
111
|
+
}))]
|
|
112
|
+
}, {
|
|
113
|
+
label: t("components.menu.color"),
|
|
114
|
+
key: "color",
|
|
115
|
+
icon: () => n("i-tabler:palette"),
|
|
116
|
+
children: [{
|
|
117
|
+
label: () => e("div", {
|
|
118
|
+
class: "flex gap-2 items-center w-30"
|
|
119
|
+
}, [e("div", {
|
|
120
|
+
class: "size-2 rounded-full",
|
|
121
|
+
style: {
|
|
122
|
+
backgroundColor: "rgb(var(--ui-color-primary))"
|
|
123
|
+
}
|
|
124
|
+
}, null), e("div", null, [t("components.menu.primaryColor")])]),
|
|
125
|
+
key: "color.primary",
|
|
126
|
+
children: x.value?.map((o) => ({
|
|
127
|
+
label: () => r(e("div", {
|
|
128
|
+
class: "flex gap-2 items-center"
|
|
125
129
|
}, [e("div", {
|
|
126
130
|
class: "size-2 rounded-full",
|
|
127
131
|
style: {
|
|
128
|
-
backgroundColor:
|
|
132
|
+
backgroundColor: `rgb(var(--base-color-${o}-500))`
|
|
129
133
|
}
|
|
130
|
-
}, null), e("div", null, [
|
|
131
|
-
key:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
label: () => e("div", {
|
|
145
|
-
class: "flex gap-2 items-center
|
|
134
|
+
}, null), e("div", null, [o])]), c.value.primary === o),
|
|
135
|
+
key: `color.primary.${o}`
|
|
136
|
+
}))
|
|
137
|
+
}, {
|
|
138
|
+
label: () => e("div", {
|
|
139
|
+
class: "flex gap-2 items-center w-30"
|
|
140
|
+
}, [e("div", {
|
|
141
|
+
class: "size-2 rounded-full",
|
|
142
|
+
style: {
|
|
143
|
+
backgroundColor: "rgb(var(--ui-color-gray-600))"
|
|
144
|
+
}
|
|
145
|
+
}, null), e("div", null, [t("components.menu.neutralColor")])]),
|
|
146
|
+
key: "color.neutral",
|
|
147
|
+
children: C.value?.map((o) => ({
|
|
148
|
+
label: () => r(e("div", {
|
|
149
|
+
class: "flex gap-2 items-center"
|
|
146
150
|
}, [e("div", {
|
|
147
151
|
class: "size-2 rounded-full",
|
|
148
152
|
style: {
|
|
149
|
-
backgroundColor:
|
|
153
|
+
backgroundColor: `rgb(var(--base-color-${o}-600))`
|
|
150
154
|
}
|
|
151
|
-
}, null), e("div", null, [
|
|
152
|
-
key:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
key: `color.neutral.${o}`
|
|
163
|
-
}))
|
|
164
|
-
}]
|
|
165
|
-
}, {
|
|
166
|
-
label: r("components.menu.theme"),
|
|
167
|
-
key: "theme",
|
|
168
|
-
icon: () => s("i-tabler:brightness-half"),
|
|
169
|
-
children: [{
|
|
170
|
-
label: () => n(r("components.menu.followSystem"), m.value === "auto"),
|
|
171
|
-
key: "theme.auto"
|
|
172
|
-
}, {
|
|
173
|
-
label: () => n(r("components.menu.lightMode"), m.value === "light"),
|
|
174
|
-
key: "theme.light"
|
|
175
|
-
}, {
|
|
176
|
-
label: () => n(r("components.menu.darkMode"), m.value === "dark"),
|
|
177
|
-
key: "theme.dark"
|
|
178
|
-
}]
|
|
155
|
+
}, null), e("div", null, [o])]), c.value.gray === o),
|
|
156
|
+
key: `color.neutral.${o}`
|
|
157
|
+
}))
|
|
158
|
+
}]
|
|
159
|
+
}, {
|
|
160
|
+
label: t("components.menu.theme"),
|
|
161
|
+
key: "theme",
|
|
162
|
+
icon: () => n("i-tabler:brightness-half"),
|
|
163
|
+
children: [{
|
|
164
|
+
label: () => r(t("components.menu.followSystem"), u.value === "auto"),
|
|
165
|
+
key: "theme.auto"
|
|
179
166
|
}, {
|
|
180
|
-
|
|
167
|
+
label: () => r(t("components.menu.lightMode"), u.value === "light"),
|
|
168
|
+
key: "theme.light"
|
|
181
169
|
}, {
|
|
182
|
-
label: r("components.menu.
|
|
183
|
-
key: "
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
170
|
+
label: () => r(t("components.menu.darkMode"), u.value === "dark"),
|
|
171
|
+
key: "theme.dark"
|
|
172
|
+
}]
|
|
173
|
+
}, {
|
|
174
|
+
type: "divider"
|
|
175
|
+
}, {
|
|
176
|
+
label: t("components.menu.logout"),
|
|
177
|
+
key: "logout",
|
|
178
|
+
icon: () => n("i-tabler:logout")
|
|
179
|
+
}]);
|
|
180
|
+
function $(o, l) {
|
|
181
|
+
const m = o.lastIndexOf("."), [D, i] = m === -1 ? [o, ""] : [o.substring(0, m), o.substring(m + 1)];
|
|
182
|
+
switch (D) {
|
|
190
183
|
case "locale":
|
|
191
|
-
|
|
184
|
+
s.changeLocale(i);
|
|
192
185
|
break;
|
|
193
186
|
case "color.primary":
|
|
194
|
-
|
|
187
|
+
p("primary", i);
|
|
195
188
|
break;
|
|
196
189
|
case "color.neutral":
|
|
197
|
-
|
|
190
|
+
p("gray", i);
|
|
198
191
|
break;
|
|
199
192
|
case "theme":
|
|
200
|
-
|
|
193
|
+
M(i);
|
|
201
194
|
break;
|
|
202
195
|
case "logout":
|
|
203
|
-
|
|
196
|
+
k();
|
|
204
197
|
break;
|
|
205
198
|
default:
|
|
206
|
-
if (!
|
|
199
|
+
if (!l?.path)
|
|
207
200
|
return;
|
|
208
|
-
|
|
201
|
+
b.push(y(l.path));
|
|
209
202
|
}
|
|
210
203
|
}
|
|
211
204
|
return () => e(B, {
|
|
212
|
-
options:
|
|
205
|
+
options: z.value,
|
|
213
206
|
placement: "bottom-start",
|
|
214
207
|
trigger: "click",
|
|
215
|
-
onSelect:
|
|
208
|
+
onSelect: $,
|
|
216
209
|
width: 200
|
|
217
210
|
}, {
|
|
218
211
|
default: () => [e(G, {
|
|
219
|
-
collapsed:
|
|
212
|
+
collapsed: g.collapsed
|
|
220
213
|
}, {
|
|
221
|
-
icon: () => {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
},
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}, [e("div", {
|
|
235
|
-
class: "text-sm font-medium"
|
|
236
|
-
}, [(t = i.info) == null ? void 0 : t.nickname]), e("div", {
|
|
237
|
-
class: "text-xs text-muted"
|
|
238
|
-
}, [(l = i.info) == null ? void 0 : l.username])]);
|
|
239
|
-
}
|
|
214
|
+
icon: () => e(f, {
|
|
215
|
+
class: "group-hover:shadow-lg",
|
|
216
|
+
round: !0,
|
|
217
|
+
size: 28,
|
|
218
|
+
src: a.info?.avatar
|
|
219
|
+
}, null),
|
|
220
|
+
default: () => e("div", {
|
|
221
|
+
class: "flex flex-col"
|
|
222
|
+
}, [e("div", {
|
|
223
|
+
class: "text-sm font-medium"
|
|
224
|
+
}, [a.info?.nickname]), e("div", {
|
|
225
|
+
class: "text-xs text-muted"
|
|
226
|
+
}, [a.info?.username])])
|
|
240
227
|
})]
|
|
241
228
|
});
|
|
242
229
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, createVNode as i } from "vue";
|
|
2
2
|
import "@duxweb/dvha-core";
|
|
3
3
|
import "naive-ui";
|
|
4
4
|
import "vue-router";
|
|
@@ -39,8 +39,8 @@ import "ace-builds/src-noconflict/ext-language_tools";
|
|
|
39
39
|
import "ace-builds/src-noconflict/mode-snippets";
|
|
40
40
|
import "dayjs";
|
|
41
41
|
import "@tanstack/vue-query";
|
|
42
|
-
import { useUI as
|
|
43
|
-
const
|
|
42
|
+
import { useUI as m } from "../../hooks/ui.js";
|
|
43
|
+
const X = /* @__PURE__ */ p({
|
|
44
44
|
name: "DuxMenuButton",
|
|
45
45
|
props: {
|
|
46
46
|
class: {
|
|
@@ -62,26 +62,22 @@ const _ = /* @__PURE__ */ n({
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
setup(t, {
|
|
65
|
-
slots:
|
|
65
|
+
slots: o
|
|
66
66
|
}) {
|
|
67
67
|
const {
|
|
68
|
-
menuCollapsed:
|
|
69
|
-
menuMobileCollapsed:
|
|
70
|
-
} =
|
|
71
|
-
return () => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}, [(r = e.icon) == null ? void 0 : r.call(e), t.collapsed === !1 && !o.value && !i.value && a("div", {
|
|
80
|
-
class: ["overflow-hidden ease-in-out whitespace-nowrap text-left min-w-0 flex-1", t.inverted ? "text-default" : ""]
|
|
81
|
-
}, [(m = e.default) == null ? void 0 : m.call(e)])]);
|
|
82
|
-
};
|
|
68
|
+
menuCollapsed: e,
|
|
69
|
+
menuMobileCollapsed: r
|
|
70
|
+
} = m();
|
|
71
|
+
return () => i("div", {
|
|
72
|
+
onClick: () => {
|
|
73
|
+
t.onClick?.();
|
|
74
|
+
},
|
|
75
|
+
class: ["flex items-center gap-1 justify-center py-1 px-2 cursor-pointer gap-2", t.class, e.value && !r.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"]
|
|
76
|
+
}, [o.icon?.(), t.collapsed === !1 && !e.value && !r.value && i("div", {
|
|
77
|
+
class: ["overflow-hidden ease-in-out whitespace-nowrap text-left min-w-0 flex-1", t.inverted ? "text-default" : ""]
|
|
78
|
+
}, [o.default?.()])]);
|
|
83
79
|
}
|
|
84
80
|
});
|
|
85
81
|
export {
|
|
86
|
-
|
|
82
|
+
X as default
|
|
87
83
|
};
|