@ysgroup/ui 0.1.32 → 0.1.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/package.json +1 -1
- package/src/components/YsAppToolbar.vue +151 -0
- package/src/components/YsLoginPage.vue +156 -50
- package/src/components/YsPageLayout.vue +135 -26
- package/src/components/YsSettingsCenterDialog.vue +149 -14
- package/src/components/YsSideMenu.vue +184 -0
- package/src/index.ts +11 -1
package/package.json
CHANGED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
import { Moon, Setting, Sunny } from "@element-plus/icons-vue";
|
|
4
|
+
import { applyTheme, currentMode, type ThemeMode } from "@ysgroup/theme";
|
|
5
|
+
|
|
6
|
+
defineProps<{ username?: string }>();
|
|
7
|
+
const emit = defineEmits<{ settings: []; logout: [] }>();
|
|
8
|
+
const mode = ref<ThemeMode>(
|
|
9
|
+
document.documentElement.getAttribute("data-theme") === "dark"
|
|
10
|
+
? "dark"
|
|
11
|
+
: "light",
|
|
12
|
+
);
|
|
13
|
+
const dropdown = ref<{ handleClose: () => void } | null>(null);
|
|
14
|
+
if (currentMode() === "auto") applyTheme(mode.value);
|
|
15
|
+
|
|
16
|
+
function selectTheme(next: ThemeMode) {
|
|
17
|
+
if (next !== "light" && next !== "dark") return;
|
|
18
|
+
mode.value = next;
|
|
19
|
+
applyTheme(next);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function toggleTheme() {
|
|
23
|
+
dropdown.value?.handleClose();
|
|
24
|
+
selectTheme(mode.value === "dark" ? "light" : "dark");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function settingsCommand(command: string) {
|
|
28
|
+
if (command === "settings") emit("settings");
|
|
29
|
+
if (command === "logout") emit("logout");
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<div class="ys-app-toolbar">
|
|
35
|
+
<span v-if="username" class="ys-app-toolbar__user" :title="username">{{
|
|
36
|
+
username
|
|
37
|
+
}}</span>
|
|
38
|
+
<span v-if="username" class="ys-app-toolbar__divider" aria-hidden="true" />
|
|
39
|
+
<el-dropdown
|
|
40
|
+
ref="dropdown"
|
|
41
|
+
trigger="hover"
|
|
42
|
+
popper-class="ys-app-theme-menu"
|
|
43
|
+
@command="selectTheme"
|
|
44
|
+
>
|
|
45
|
+
<button
|
|
46
|
+
type="button"
|
|
47
|
+
class="ys-app-toolbar__button"
|
|
48
|
+
aria-label="一键换肤"
|
|
49
|
+
@click="toggleTheme"
|
|
50
|
+
>
|
|
51
|
+
<el-icon :size="18"
|
|
52
|
+
><Sunny v-if="mode === 'light'" /><Moon v-else
|
|
53
|
+
/></el-icon>
|
|
54
|
+
</button>
|
|
55
|
+
<template #dropdown>
|
|
56
|
+
<el-dropdown-menu>
|
|
57
|
+
<el-dropdown-item
|
|
58
|
+
command="light"
|
|
59
|
+
:class="{ 'is-current': mode === 'light' }"
|
|
60
|
+
>亮色模式</el-dropdown-item
|
|
61
|
+
>
|
|
62
|
+
<el-dropdown-item
|
|
63
|
+
command="dark"
|
|
64
|
+
divided
|
|
65
|
+
:class="{ 'is-current': mode === 'dark' }"
|
|
66
|
+
>暗色模式</el-dropdown-item
|
|
67
|
+
>
|
|
68
|
+
</el-dropdown-menu>
|
|
69
|
+
</template>
|
|
70
|
+
</el-dropdown>
|
|
71
|
+
<span class="ys-app-toolbar__divider" aria-hidden="true" />
|
|
72
|
+
<el-dropdown trigger="hover" @command="settingsCommand">
|
|
73
|
+
<button type="button" class="ys-app-toolbar__button" aria-label="设置">
|
|
74
|
+
<el-icon :size="18"><Setting /></el-icon>
|
|
75
|
+
</button>
|
|
76
|
+
<template #dropdown>
|
|
77
|
+
<el-dropdown-menu>
|
|
78
|
+
<el-dropdown-item command="settings">设置中心</el-dropdown-item>
|
|
79
|
+
<el-dropdown-item divided command="logout">退出登录</el-dropdown-item>
|
|
80
|
+
</el-dropdown-menu>
|
|
81
|
+
</template>
|
|
82
|
+
</el-dropdown>
|
|
83
|
+
</div>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<style scoped>
|
|
87
|
+
.ys-app-toolbar {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
gap: 2px;
|
|
91
|
+
padding-left: 12px;
|
|
92
|
+
color: color-mix(in srgb, var(--ys-color-text-2) 62%, var(--ys-color-text-3));
|
|
93
|
+
}
|
|
94
|
+
.ys-app-toolbar__user {
|
|
95
|
+
max-width: 160px;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
text-overflow: ellipsis;
|
|
98
|
+
padding: 0 10px;
|
|
99
|
+
font-size: 14px;
|
|
100
|
+
line-height: 32px;
|
|
101
|
+
white-space: nowrap;
|
|
102
|
+
cursor: default;
|
|
103
|
+
}
|
|
104
|
+
.ys-app-toolbar__divider {
|
|
105
|
+
width: 1px;
|
|
106
|
+
height: 16px;
|
|
107
|
+
margin: 0 6px;
|
|
108
|
+
background: color-mix(
|
|
109
|
+
in srgb,
|
|
110
|
+
var(--ys-color-text-3) 48%,
|
|
111
|
+
var(--ys-color-border)
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
.ys-app-toolbar__button {
|
|
115
|
+
display: inline-flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
width: 32px;
|
|
119
|
+
height: 32px;
|
|
120
|
+
padding: 0;
|
|
121
|
+
border: 0;
|
|
122
|
+
border-radius: 6px;
|
|
123
|
+
background: transparent;
|
|
124
|
+
color: inherit;
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
}
|
|
127
|
+
.ys-app-toolbar__button:hover,
|
|
128
|
+
.ys-app-toolbar__button:focus-visible {
|
|
129
|
+
background: var(--ys-color-bg-hover);
|
|
130
|
+
color: var(--ys-color-primary);
|
|
131
|
+
}
|
|
132
|
+
@media (max-width: 600px) {
|
|
133
|
+
.ys-app-toolbar {
|
|
134
|
+
padding-left: 4px;
|
|
135
|
+
}
|
|
136
|
+
.ys-app-toolbar__user {
|
|
137
|
+
max-width: 80px;
|
|
138
|
+
padding: 0 4px;
|
|
139
|
+
}
|
|
140
|
+
.ys-app-toolbar__divider {
|
|
141
|
+
margin: 0 3px;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
</style>
|
|
145
|
+
|
|
146
|
+
<style>
|
|
147
|
+
.ys-app-theme-menu .el-dropdown-menu__item.is-current {
|
|
148
|
+
color: var(--ys-color-primary);
|
|
149
|
+
background: transparent;
|
|
150
|
+
}
|
|
151
|
+
</style>
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<!-- YsLoginPage —— 统一登录页。口令由 @ysgroup/core 密封后提交。 -->
|
|
2
2
|
<script setup lang="ts">
|
|
3
3
|
import { ref } from "vue";
|
|
4
|
+
import { Loading } from "@element-plus/icons-vue";
|
|
4
5
|
|
|
5
|
-
defineProps<{
|
|
6
|
+
const props = defineProps<{
|
|
6
7
|
appTitle: string;
|
|
7
8
|
hint?: string;
|
|
8
9
|
logoUrl?: string;
|
|
9
10
|
error?: string;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
restoring?: boolean;
|
|
10
13
|
}>();
|
|
11
14
|
const emit = defineEmits<{
|
|
12
15
|
login: [username: string, password: string];
|
|
@@ -14,81 +17,152 @@ const emit = defineEmits<{
|
|
|
14
17
|
|
|
15
18
|
const username = ref("");
|
|
16
19
|
const password = ref("");
|
|
17
|
-
const
|
|
20
|
+
const validationError = ref("");
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
loading.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
function submit() {
|
|
23
|
+
if (props.loading || props.restoring) return;
|
|
24
|
+
validationError.value = "";
|
|
25
|
+
if (!username.value.trim() || !password.value) {
|
|
26
|
+
validationError.value = "请输入用户名和密码";
|
|
27
|
+
return;
|
|
25
28
|
}
|
|
29
|
+
emit("login", username.value.trim(), password.value);
|
|
30
|
+
password.value = "";
|
|
26
31
|
}
|
|
27
32
|
</script>
|
|
28
33
|
|
|
29
34
|
<template>
|
|
30
35
|
<div class="ys-login">
|
|
31
36
|
<div class="ys-login__card">
|
|
37
|
+
<span class="ys-login__ambient" aria-hidden="true"></span>
|
|
32
38
|
<img v-if="logoUrl" :src="logoUrl" class="ys-login__logo" alt="logo" />
|
|
33
39
|
<p v-if="hint" class="ys-login__hint">{{ hint }}</p>
|
|
34
40
|
<h2 v-else class="ys-login__title">{{ appTitle }}</h2>
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
<div
|
|
42
|
+
v-if="restoring"
|
|
43
|
+
class="ys-login__pending"
|
|
44
|
+
role="status"
|
|
45
|
+
aria-live="polite"
|
|
46
|
+
aria-busy="true"
|
|
47
|
+
>
|
|
48
|
+
<el-icon class="is-loading" :size="20"><Loading /></el-icon>
|
|
49
|
+
<span>正在安全进入{{ appTitle }}</span>
|
|
50
|
+
</div>
|
|
51
|
+
<template v-else>
|
|
52
|
+
<el-form
|
|
53
|
+
:disabled="loading"
|
|
54
|
+
:aria-busy="!!loading"
|
|
55
|
+
@submit.prevent="submit"
|
|
56
|
+
>
|
|
57
|
+
<el-form-item>
|
|
58
|
+
<el-input
|
|
59
|
+
v-model="username"
|
|
60
|
+
placeholder="用户名"
|
|
61
|
+
aria-label="用户名"
|
|
62
|
+
autocomplete="username"
|
|
63
|
+
size="large"
|
|
64
|
+
/>
|
|
65
|
+
</el-form-item>
|
|
66
|
+
<el-form-item>
|
|
67
|
+
<el-input
|
|
68
|
+
v-model="password"
|
|
69
|
+
type="password"
|
|
70
|
+
placeholder="密码"
|
|
71
|
+
aria-label="密码"
|
|
72
|
+
autocomplete="current-password"
|
|
73
|
+
size="large"
|
|
74
|
+
show-password
|
|
75
|
+
/>
|
|
76
|
+
</el-form-item>
|
|
77
|
+
<el-alert
|
|
78
|
+
v-if="validationError || error"
|
|
79
|
+
:title="validationError || error || ''"
|
|
80
|
+
type="error"
|
|
81
|
+
:closable="false"
|
|
82
|
+
show-icon
|
|
42
83
|
/>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<el-input
|
|
46
|
-
v-model="password"
|
|
47
|
-
type="password"
|
|
48
|
-
placeholder="密码"
|
|
84
|
+
<el-button
|
|
85
|
+
type="primary"
|
|
49
86
|
size="large"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
:closable="false"
|
|
59
|
-
show-icon
|
|
60
|
-
/>
|
|
61
|
-
<el-button
|
|
62
|
-
type="primary"
|
|
63
|
-
size="large"
|
|
64
|
-
:loading="loading"
|
|
65
|
-
style="width: 100%; margin-top: 8px"
|
|
66
|
-
@click="submit"
|
|
67
|
-
>
|
|
68
|
-
登录
|
|
69
|
-
</el-button>
|
|
70
|
-
</el-form>
|
|
87
|
+
native-type="submit"
|
|
88
|
+
:loading="loading"
|
|
89
|
+
class="ys-login__submit"
|
|
90
|
+
>
|
|
91
|
+
登录
|
|
92
|
+
</el-button>
|
|
93
|
+
</el-form>
|
|
94
|
+
</template>
|
|
71
95
|
</div>
|
|
72
96
|
</div>
|
|
73
97
|
</template>
|
|
74
98
|
|
|
75
99
|
<style scoped>
|
|
76
100
|
.ys-login {
|
|
77
|
-
|
|
101
|
+
box-sizing: border-box;
|
|
102
|
+
min-height: 100vh;
|
|
103
|
+
min-height: 100dvh;
|
|
104
|
+
padding: 24px 16px;
|
|
78
105
|
display: flex;
|
|
79
106
|
align-items: center;
|
|
80
107
|
justify-content: center;
|
|
81
108
|
background: var(--ys-color-bg);
|
|
82
109
|
}
|
|
83
110
|
.ys-login__card {
|
|
84
|
-
|
|
111
|
+
position: relative;
|
|
112
|
+
isolation: isolate;
|
|
113
|
+
box-sizing: content-box;
|
|
114
|
+
width: min(360px, calc(100% - 66px));
|
|
115
|
+
flex-shrink: 0;
|
|
85
116
|
padding: 40px 32px;
|
|
86
|
-
|
|
87
|
-
border: 1px solid var(--ys-color-border);
|
|
117
|
+
border: 1px solid transparent;
|
|
88
118
|
border-radius: var(--ys-radius-m);
|
|
89
|
-
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|
|
90
119
|
text-align: center;
|
|
91
|
-
transform: translateY(-200px);
|
|
120
|
+
transform: translateY(clamp(-200px, calc(248px - 50dvh), 0px));
|
|
121
|
+
}
|
|
122
|
+
.ys-login__card::after {
|
|
123
|
+
content: "";
|
|
124
|
+
position: absolute;
|
|
125
|
+
z-index: -1;
|
|
126
|
+
inset: 0;
|
|
127
|
+
border-radius: inherit;
|
|
128
|
+
background: var(--ys-color-bg-elevated);
|
|
129
|
+
box-shadow:
|
|
130
|
+
0 3px 8px rgba(0, 0, 0, 0.04),
|
|
131
|
+
0 14px 28px rgba(0, 0, 0, 0.12);
|
|
132
|
+
pointer-events: none;
|
|
133
|
+
}
|
|
134
|
+
.ys-login__card::before,
|
|
135
|
+
.ys-login__ambient {
|
|
136
|
+
content: "";
|
|
137
|
+
position: absolute;
|
|
138
|
+
z-index: -2;
|
|
139
|
+
inset: 12px;
|
|
140
|
+
border-radius: 24px;
|
|
141
|
+
pointer-events: none;
|
|
142
|
+
opacity: 0.32;
|
|
143
|
+
animation: ys-login-breathe 7s ease-in-out infinite;
|
|
144
|
+
}
|
|
145
|
+
.ys-login__card::before {
|
|
146
|
+
box-shadow: -3px -3px 22px 8px color-mix(in srgb, #3478ff 26%, transparent);
|
|
147
|
+
}
|
|
148
|
+
.ys-login__ambient {
|
|
149
|
+
box-shadow: 3px 6px 26px 10px color-mix(in srgb, #5294ff 22%, transparent);
|
|
150
|
+
animation-delay: -3.5s;
|
|
151
|
+
}
|
|
152
|
+
.ys-login__card:focus-within::before,
|
|
153
|
+
.ys-login__card:focus-within .ys-login__ambient {
|
|
154
|
+
animation-play-state: paused;
|
|
155
|
+
}
|
|
156
|
+
@keyframes ys-login-breathe {
|
|
157
|
+
0%,
|
|
158
|
+
100% {
|
|
159
|
+
opacity: 0.32;
|
|
160
|
+
transform: scale(1);
|
|
161
|
+
}
|
|
162
|
+
50% {
|
|
163
|
+
opacity: 0.8;
|
|
164
|
+
transform: translateY(-1px) scale(1.012);
|
|
165
|
+
}
|
|
92
166
|
}
|
|
93
167
|
.ys-login__logo {
|
|
94
168
|
width: 68px;
|
|
@@ -100,17 +174,49 @@ async function submit() {
|
|
|
100
174
|
margin: 0 0 24px;
|
|
101
175
|
color: var(--ys-color-text-1);
|
|
102
176
|
font-weight: 600;
|
|
177
|
+
font-size: 18px;
|
|
178
|
+
line-height: 28px;
|
|
179
|
+
overflow-wrap: anywhere;
|
|
103
180
|
}
|
|
104
181
|
.ys-login__hint {
|
|
105
182
|
margin: 0 0 24px;
|
|
106
183
|
color: var(--ys-color-text-1);
|
|
107
184
|
font-size: 18px;
|
|
108
185
|
font-weight: 600;
|
|
186
|
+
line-height: 28px;
|
|
187
|
+
overflow-wrap: anywhere;
|
|
109
188
|
}
|
|
110
|
-
|
|
111
|
-
|
|
189
|
+
.ys-login__submit {
|
|
190
|
+
width: 100%;
|
|
191
|
+
margin-top: 8px;
|
|
192
|
+
}
|
|
193
|
+
.ys-login__pending {
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
justify-content: center;
|
|
197
|
+
gap: 8px;
|
|
198
|
+
min-height: 96px;
|
|
199
|
+
color: var(--ys-color-text-2);
|
|
200
|
+
font-size: 13px;
|
|
201
|
+
}
|
|
202
|
+
@media (max-height: 640px), (max-width: 480px) {
|
|
112
203
|
.ys-login__card {
|
|
113
204
|
transform: none;
|
|
114
205
|
}
|
|
115
206
|
}
|
|
207
|
+
@media (prefers-reduced-motion: reduce) {
|
|
208
|
+
.ys-login__card::before,
|
|
209
|
+
.ys-login__ambient {
|
|
210
|
+
animation: none;
|
|
211
|
+
opacity: 0.32;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
</style>
|
|
215
|
+
|
|
216
|
+
<style>
|
|
217
|
+
html:has(.ys-login),
|
|
218
|
+
body:has(.ys-login) {
|
|
219
|
+
margin: 0;
|
|
220
|
+
padding: 0;
|
|
221
|
+
}
|
|
116
222
|
</style>
|
|
@@ -1,43 +1,93 @@
|
|
|
1
1
|
<!-- YsPageLayout —— 统一布局骨架:顶栏(logo/app名/工具条) + 侧栏 + 内容。 -->
|
|
2
2
|
<script setup lang="ts">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { computed, ref } from "vue";
|
|
4
|
+
import { Fold, Expand } from "@element-plus/icons-vue";
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(
|
|
7
|
+
defineProps<{
|
|
8
|
+
appTitle: string;
|
|
9
|
+
logoUrl?: string;
|
|
10
|
+
menus?: { key: string; title: string; icon?: string }[];
|
|
11
|
+
active?: string;
|
|
12
|
+
sidebarCollapsed?: boolean;
|
|
13
|
+
}>(),
|
|
14
|
+
{ logoUrl: "", menus: () => [], active: "", sidebarCollapsed: undefined },
|
|
15
|
+
);
|
|
9
16
|
|
|
10
|
-
defineSlots<{
|
|
17
|
+
const slots = defineSlots<{
|
|
11
18
|
toolbar?: () => unknown;
|
|
19
|
+
switcher?: () => unknown;
|
|
20
|
+
sidebar?: () => unknown;
|
|
12
21
|
default?: () => unknown;
|
|
13
22
|
}>();
|
|
14
23
|
|
|
15
|
-
const emit = defineEmits<{
|
|
24
|
+
const emit = defineEmits<{
|
|
25
|
+
navigate: [key: string];
|
|
26
|
+
"update:sidebarCollapsed": [value: boolean];
|
|
27
|
+
}>();
|
|
28
|
+
const internalCollapsed = ref(false);
|
|
29
|
+
const collapsed = computed(
|
|
30
|
+
() => props.sidebarCollapsed ?? internalCollapsed.value,
|
|
31
|
+
);
|
|
32
|
+
const hasSidebar = computed(() => !!slots.sidebar || !!props.menus?.length);
|
|
33
|
+
|
|
34
|
+
function toggleSidebar() {
|
|
35
|
+
internalCollapsed.value = !collapsed.value;
|
|
36
|
+
emit("update:sidebarCollapsed", internalCollapsed.value);
|
|
37
|
+
}
|
|
16
38
|
</script>
|
|
17
39
|
|
|
18
40
|
<template>
|
|
19
|
-
<div class="ys-layout">
|
|
41
|
+
<div class="ys-layout" :class="{ 'is-collapsed': collapsed }">
|
|
20
42
|
<header class="ys-layout__top">
|
|
21
43
|
<div class="ys-layout__brand">
|
|
44
|
+
<el-tooltip
|
|
45
|
+
v-if="hasSidebar"
|
|
46
|
+
:content="collapsed ? '展开导航栏' : '收起导航栏'"
|
|
47
|
+
placement="bottom"
|
|
48
|
+
>
|
|
49
|
+
<span class="ys-layout__toggle-wrap">
|
|
50
|
+
<button
|
|
51
|
+
type="button"
|
|
52
|
+
class="ys-layout__toggle"
|
|
53
|
+
:aria-label="collapsed ? '展开导航栏' : '收起导航栏'"
|
|
54
|
+
:aria-expanded="!collapsed"
|
|
55
|
+
@click="toggleSidebar"
|
|
56
|
+
>
|
|
57
|
+
<el-icon :size="18"
|
|
58
|
+
><Expand v-if="collapsed" /><Fold v-else
|
|
59
|
+
/></el-icon>
|
|
60
|
+
</button>
|
|
61
|
+
</span>
|
|
62
|
+
</el-tooltip>
|
|
22
63
|
<img v-if="logoUrl" :src="logoUrl" class="ys-layout__logo" alt="logo" />
|
|
23
64
|
<span class="ys-layout__title">{{ appTitle }}</span>
|
|
24
65
|
</div>
|
|
25
|
-
<div class="ys-
|
|
66
|
+
<div class="ys-layout__switcher"><slot name="switcher" /></div>
|
|
26
67
|
<div v-if="$slots.toolbar" class="ys-layout__toolbar">
|
|
27
68
|
<slot name="toolbar" />
|
|
28
69
|
</div>
|
|
29
70
|
</header>
|
|
30
71
|
<div class="ys-layout__body">
|
|
31
|
-
<aside
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
72
|
+
<aside
|
|
73
|
+
v-if="hasSidebar"
|
|
74
|
+
v-show="!collapsed"
|
|
75
|
+
class="ys-layout__side"
|
|
76
|
+
aria-label="侧栏导航"
|
|
77
|
+
>
|
|
78
|
+
<slot name="sidebar">
|
|
79
|
+
<button
|
|
80
|
+
v-for="menu in menus"
|
|
81
|
+
:key="menu.key"
|
|
82
|
+
type="button"
|
|
83
|
+
class="ys-layout__menu"
|
|
84
|
+
:class="{ 'is-active': menu.key === active }"
|
|
85
|
+
:aria-current="menu.key === active ? 'page' : undefined"
|
|
86
|
+
@click="emit('navigate', menu.key)"
|
|
87
|
+
>
|
|
88
|
+
{{ menu.title }}
|
|
89
|
+
</button>
|
|
90
|
+
</slot>
|
|
41
91
|
</aside>
|
|
42
92
|
<main class="ys-layout__content">
|
|
43
93
|
<slot />
|
|
@@ -48,13 +98,25 @@ const emit = defineEmits<{ navigate: [key: string] }>();
|
|
|
48
98
|
|
|
49
99
|
<style scoped>
|
|
50
100
|
.ys-layout {
|
|
101
|
+
--ys-layout-sidebar-width: 200px;
|
|
102
|
+
--ys-layout-header-height: 54px;
|
|
51
103
|
height: 100vh;
|
|
104
|
+
height: 100dvh;
|
|
105
|
+
min-width: 0;
|
|
52
106
|
display: flex;
|
|
53
107
|
flex-direction: column;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
box-sizing: border-box;
|
|
54
110
|
}
|
|
55
111
|
.ys-layout__top {
|
|
56
|
-
|
|
57
|
-
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
height: var(--ys-layout-header-height);
|
|
114
|
+
flex: 0 0 var(--ys-layout-header-height);
|
|
115
|
+
display: grid;
|
|
116
|
+
grid-template-columns:
|
|
117
|
+
minmax(0, var(--ys-layout-sidebar-width)) minmax(0, 1fr)
|
|
118
|
+
auto;
|
|
119
|
+
grid-template-rows: minmax(0, 1fr);
|
|
58
120
|
align-items: center;
|
|
59
121
|
padding: 0 16px 0 0;
|
|
60
122
|
background: var(--ys-color-bg-elevated);
|
|
@@ -66,7 +128,7 @@ const emit = defineEmits<{ navigate: [key: string] }>();
|
|
|
66
128
|
align-items: center;
|
|
67
129
|
gap: 10px;
|
|
68
130
|
box-sizing: border-box;
|
|
69
|
-
width:
|
|
131
|
+
width: 100%;
|
|
70
132
|
min-width: 0;
|
|
71
133
|
padding-left: 16px;
|
|
72
134
|
overflow: hidden;
|
|
@@ -80,10 +142,35 @@ const emit = defineEmits<{ navigate: [key: string] }>();
|
|
|
80
142
|
font-weight: 600;
|
|
81
143
|
color: var(--ys-color-text-1);
|
|
82
144
|
white-space: nowrap;
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
text-overflow: ellipsis;
|
|
83
147
|
}
|
|
84
|
-
.ys-
|
|
85
|
-
|
|
148
|
+
.ys-layout__toggle-wrap {
|
|
149
|
+
display: inline-flex;
|
|
150
|
+
flex: 0 0 30px;
|
|
151
|
+
}
|
|
152
|
+
.ys-layout__toggle {
|
|
153
|
+
display: inline-flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
justify-content: center;
|
|
156
|
+
flex: 0 0 30px;
|
|
157
|
+
height: 30px;
|
|
158
|
+
border: 0;
|
|
159
|
+
border-radius: 6px;
|
|
160
|
+
background: transparent;
|
|
161
|
+
color: var(--ys-color-text-2);
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
}
|
|
164
|
+
.ys-layout__toggle:hover,
|
|
165
|
+
.ys-layout__toggle:focus-visible {
|
|
166
|
+
color: var(--ys-color-primary);
|
|
167
|
+
background: var(--ys-color-bg-hover);
|
|
168
|
+
}
|
|
169
|
+
.ys-layout__switcher {
|
|
86
170
|
min-width: 0;
|
|
171
|
+
height: 100%;
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
87
174
|
}
|
|
88
175
|
.ys-layout__toolbar {
|
|
89
176
|
flex: none;
|
|
@@ -93,17 +180,28 @@ const emit = defineEmits<{ navigate: [key: string] }>();
|
|
|
93
180
|
}
|
|
94
181
|
.ys-layout__body {
|
|
95
182
|
flex: 1;
|
|
183
|
+
min-height: 0;
|
|
184
|
+
min-width: 0;
|
|
96
185
|
display: flex;
|
|
97
186
|
overflow: hidden;
|
|
98
187
|
}
|
|
99
188
|
.ys-layout__side {
|
|
100
|
-
|
|
189
|
+
box-sizing: border-box;
|
|
190
|
+
width: var(--ys-layout-sidebar-width);
|
|
191
|
+
flex: 0 0 var(--ys-layout-sidebar-width);
|
|
192
|
+
min-height: 0;
|
|
101
193
|
background: var(--ys-color-bg-elevated);
|
|
102
194
|
border-right: 1px solid var(--ys-color-border);
|
|
103
195
|
padding: 8px;
|
|
104
196
|
overflow-y: auto;
|
|
105
197
|
}
|
|
106
198
|
.ys-layout__menu {
|
|
199
|
+
display: block;
|
|
200
|
+
width: 100%;
|
|
201
|
+
border: 0;
|
|
202
|
+
background: transparent;
|
|
203
|
+
text-align: left;
|
|
204
|
+
font: inherit;
|
|
107
205
|
padding: 9px 14px;
|
|
108
206
|
border-radius: var(--ys-radius-m);
|
|
109
207
|
cursor: pointer;
|
|
@@ -119,8 +217,19 @@ const emit = defineEmits<{ navigate: [key: string] }>();
|
|
|
119
217
|
}
|
|
120
218
|
.ys-layout__content {
|
|
121
219
|
flex: 1;
|
|
220
|
+
min-width: 0;
|
|
221
|
+
min-height: 0;
|
|
222
|
+
box-sizing: border-box;
|
|
122
223
|
padding: 16px;
|
|
123
224
|
overflow: auto;
|
|
124
225
|
background: var(--ys-color-bg);
|
|
125
226
|
}
|
|
126
227
|
</style>
|
|
228
|
+
|
|
229
|
+
<style>
|
|
230
|
+
html:has(.ys-layout),
|
|
231
|
+
body:has(.ys-layout) {
|
|
232
|
+
margin: 0;
|
|
233
|
+
padding: 0;
|
|
234
|
+
}
|
|
235
|
+
</style>
|
|
@@ -19,14 +19,25 @@ const active = ref("security");
|
|
|
19
19
|
const form = reactive({ current: "", next: "", confirm: "" });
|
|
20
20
|
const error = ref("");
|
|
21
21
|
const submitting = ref(false);
|
|
22
|
-
const PASSWORD_REQUIREMENT =
|
|
22
|
+
const PASSWORD_REQUIREMENT =
|
|
23
|
+
"密码须至少包含 8 个字符,并同时包含大写字母、小写字母和数字。";
|
|
23
24
|
|
|
24
|
-
const canChangePassword = computed(
|
|
25
|
-
|
|
25
|
+
const canChangePassword = computed(
|
|
26
|
+
() =>
|
|
27
|
+
props.role !== "Root" && props.username?.trim().toLowerCase() !== "root",
|
|
28
|
+
);
|
|
29
|
+
const canManageFrontend = computed(
|
|
30
|
+
() => props.role === "Admin" || props.role === "Manager",
|
|
31
|
+
);
|
|
26
32
|
const visible = computed(() => props.modelValue && props.authenticated);
|
|
27
33
|
|
|
28
34
|
function isStrongPassword(password: string): boolean {
|
|
29
|
-
return
|
|
35
|
+
return (
|
|
36
|
+
password.length >= 8 &&
|
|
37
|
+
/[A-Z]/.test(password) &&
|
|
38
|
+
/[a-z]/.test(password) &&
|
|
39
|
+
/\d/.test(password)
|
|
40
|
+
);
|
|
30
41
|
}
|
|
31
42
|
|
|
32
43
|
function reset() {
|
|
@@ -89,6 +100,7 @@ defineExpose({
|
|
|
89
100
|
:model-value="visible"
|
|
90
101
|
title="设置中心"
|
|
91
102
|
width="560px"
|
|
103
|
+
class="ys-settings-dialog"
|
|
92
104
|
destroy-on-close
|
|
93
105
|
:close-on-click-modal="!submitting"
|
|
94
106
|
:close-on-press-escape="!submitting"
|
|
@@ -108,35 +120,93 @@ defineExpose({
|
|
|
108
120
|
/>
|
|
109
121
|
<div class="ys-settings__password-link">
|
|
110
122
|
<span>前往 Auth系统修改密码:</span>
|
|
111
|
-
<el-button
|
|
123
|
+
<el-button
|
|
124
|
+
class="ys-settings__password-button"
|
|
125
|
+
tag="a"
|
|
126
|
+
type="primary"
|
|
127
|
+
:href="passwordManagementUrl"
|
|
128
|
+
target="_blank"
|
|
129
|
+
rel="noopener noreferrer"
|
|
130
|
+
>前往</el-button
|
|
131
|
+
>
|
|
112
132
|
</div>
|
|
113
133
|
</template>
|
|
114
134
|
<template v-else-if="canChangePassword">
|
|
115
135
|
<h3 class="ys-settings__title">修改登录密码</h3>
|
|
116
|
-
<el-alert
|
|
117
|
-
|
|
136
|
+
<el-alert
|
|
137
|
+
title="修改成功后,当前账号的所有登录会话都会退出,请使用新密码重新登录。"
|
|
138
|
+
type="info"
|
|
139
|
+
:closable="false"
|
|
140
|
+
show-icon
|
|
141
|
+
class="ys-settings__notice"
|
|
142
|
+
/>
|
|
143
|
+
<el-alert
|
|
144
|
+
:title="PASSWORD_REQUIREMENT"
|
|
145
|
+
type="info"
|
|
146
|
+
:closable="false"
|
|
147
|
+
show-icon
|
|
148
|
+
class="ys-settings__notice"
|
|
149
|
+
/>
|
|
118
150
|
<el-form label-width="110px" @submit.prevent="submit">
|
|
119
151
|
<el-form-item label="当前密码" required>
|
|
120
|
-
<el-input
|
|
152
|
+
<el-input
|
|
153
|
+
v-model="form.current"
|
|
154
|
+
type="password"
|
|
155
|
+
show-password
|
|
156
|
+
autocomplete="current-password"
|
|
157
|
+
/>
|
|
121
158
|
</el-form-item>
|
|
122
159
|
<el-form-item label="新密码" required>
|
|
123
|
-
<el-input
|
|
160
|
+
<el-input
|
|
161
|
+
v-model="form.next"
|
|
162
|
+
type="password"
|
|
163
|
+
show-password
|
|
164
|
+
autocomplete="new-password"
|
|
165
|
+
/>
|
|
124
166
|
</el-form-item>
|
|
125
167
|
<el-form-item label="确认新密码" required>
|
|
126
|
-
<el-input
|
|
168
|
+
<el-input
|
|
169
|
+
v-model="form.confirm"
|
|
170
|
+
type="password"
|
|
171
|
+
show-password
|
|
172
|
+
autocomplete="new-password"
|
|
173
|
+
/>
|
|
127
174
|
</el-form-item>
|
|
128
175
|
</el-form>
|
|
129
|
-
<el-alert
|
|
176
|
+
<el-alert
|
|
177
|
+
v-if="error"
|
|
178
|
+
:title="error"
|
|
179
|
+
type="error"
|
|
180
|
+
:closable="false"
|
|
181
|
+
show-icon
|
|
182
|
+
/>
|
|
130
183
|
</template>
|
|
131
|
-
<el-empty
|
|
184
|
+
<el-empty
|
|
185
|
+
v-else
|
|
186
|
+
description="Root 登录密码由平台安全配置维护,不允许在设置中心修改"
|
|
187
|
+
:image-size="72"
|
|
188
|
+
/>
|
|
132
189
|
</el-tab-pane>
|
|
133
|
-
<el-tab-pane
|
|
190
|
+
<el-tab-pane
|
|
191
|
+
v-if="canManageFrontend && $slots.managerActions"
|
|
192
|
+
label="前端管理"
|
|
193
|
+
name="manager-actions"
|
|
194
|
+
>
|
|
134
195
|
<slot name="managerActions" />
|
|
135
196
|
</el-tab-pane>
|
|
136
197
|
</el-tabs>
|
|
137
198
|
<template #footer>
|
|
138
199
|
<el-button @click="close">关闭</el-button>
|
|
139
|
-
<el-button
|
|
200
|
+
<el-button
|
|
201
|
+
v-if="
|
|
202
|
+
canChangePassword && !passwordManagementUrl && active === 'security'
|
|
203
|
+
"
|
|
204
|
+
type="primary"
|
|
205
|
+
:loading="submitting"
|
|
206
|
+
@click="submit"
|
|
207
|
+
>
|
|
208
|
+
修改并退出
|
|
209
|
+
</el-button>
|
|
140
210
|
</template>
|
|
141
211
|
</el-dialog>
|
|
142
212
|
</template>
|
|
@@ -144,6 +214,41 @@ defineExpose({
|
|
|
144
214
|
<style scoped>
|
|
145
215
|
.ys-settings {
|
|
146
216
|
min-height: 300px;
|
|
217
|
+
--ys-settings-heading-height: 40px;
|
|
218
|
+
}
|
|
219
|
+
.ys-settings :deep(.el-tabs__header) {
|
|
220
|
+
margin-right: 20px;
|
|
221
|
+
}
|
|
222
|
+
.ys-settings :deep(.el-tabs__item) {
|
|
223
|
+
height: var(--ys-settings-heading-height);
|
|
224
|
+
line-height: var(--ys-settings-heading-height);
|
|
225
|
+
padding: 0 16px;
|
|
226
|
+
}
|
|
227
|
+
.ys-settings :deep(.el-tabs__content) {
|
|
228
|
+
min-width: 0;
|
|
229
|
+
}
|
|
230
|
+
.ys-settings :deep(.el-tab-pane > h3),
|
|
231
|
+
.ys-settings__title {
|
|
232
|
+
display: flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
box-sizing: border-box;
|
|
235
|
+
min-height: var(--ys-settings-heading-height);
|
|
236
|
+
margin: 0 0 14px;
|
|
237
|
+
font-size: 14px;
|
|
238
|
+
line-height: 20px;
|
|
239
|
+
font-weight: 600;
|
|
240
|
+
color: var(--ys-color-text-1);
|
|
241
|
+
}
|
|
242
|
+
.ys-settings :deep(.manager-actions__notice) {
|
|
243
|
+
margin-bottom: 18px;
|
|
244
|
+
}
|
|
245
|
+
.ys-settings :deep(.manager-actions__buttons) {
|
|
246
|
+
display: flex;
|
|
247
|
+
flex-wrap: wrap;
|
|
248
|
+
gap: 8px;
|
|
249
|
+
}
|
|
250
|
+
.ys-settings :deep(.manager-actions__buttons .el-button + .el-button) {
|
|
251
|
+
margin-left: 0;
|
|
147
252
|
}
|
|
148
253
|
.ys-settings__title {
|
|
149
254
|
margin: 0 0 14px;
|
|
@@ -164,3 +269,33 @@ defineExpose({
|
|
|
164
269
|
text-decoration: none;
|
|
165
270
|
}
|
|
166
271
|
</style>
|
|
272
|
+
|
|
273
|
+
<style>
|
|
274
|
+
.ys-settings-dialog {
|
|
275
|
+
max-width: calc(100vw - 24px);
|
|
276
|
+
}
|
|
277
|
+
@media (max-width: 480px) {
|
|
278
|
+
.ys-settings-dialog .el-tabs--left {
|
|
279
|
+
display: flex;
|
|
280
|
+
flex-direction: column;
|
|
281
|
+
}
|
|
282
|
+
.ys-settings-dialog .el-tabs--left > .el-tabs__header {
|
|
283
|
+
margin: 0 0 12px;
|
|
284
|
+
float: none;
|
|
285
|
+
}
|
|
286
|
+
.ys-settings-dialog .el-tabs__nav.is-left {
|
|
287
|
+
display: flex;
|
|
288
|
+
flex-direction: row;
|
|
289
|
+
float: none;
|
|
290
|
+
width: 100%;
|
|
291
|
+
height: auto;
|
|
292
|
+
}
|
|
293
|
+
.ys-settings-dialog .el-tabs__item.is-left {
|
|
294
|
+
flex: 1;
|
|
295
|
+
text-align: center;
|
|
296
|
+
}
|
|
297
|
+
.ys-settings-dialog .el-tabs__active-bar {
|
|
298
|
+
display: none;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
</style>
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { CaretBottom, CaretRight } from "@element-plus/icons-vue";
|
|
3
|
+
|
|
4
|
+
export type YsSideMenuChild = { key: string; title: string };
|
|
5
|
+
export type YsSideMenuItem = {
|
|
6
|
+
key: string;
|
|
7
|
+
title: string;
|
|
8
|
+
children?: YsSideMenuChild[];
|
|
9
|
+
};
|
|
10
|
+
defineProps<{ items: YsSideMenuItem[]; active: string; openKeys: string[] }>();
|
|
11
|
+
const emit = defineEmits<{ navigate: [key: string]; toggle: [key: string] }>();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<nav class="ys-side-menu" aria-label="主导航">
|
|
16
|
+
<div v-for="item in items" :key="item.key">
|
|
17
|
+
<div
|
|
18
|
+
class="ys-side-menu__row"
|
|
19
|
+
:class="{
|
|
20
|
+
'is-current': !item.children?.length && item.key === active,
|
|
21
|
+
'is-open': !!item.children?.length && openKeys.includes(item.key),
|
|
22
|
+
'is-ancestor':
|
|
23
|
+
!!item.children?.some((child) => child.key === active) &&
|
|
24
|
+
!openKeys.includes(item.key),
|
|
25
|
+
}"
|
|
26
|
+
>
|
|
27
|
+
<button
|
|
28
|
+
type="button"
|
|
29
|
+
class="ys-side-menu__main"
|
|
30
|
+
:aria-current="
|
|
31
|
+
!item.children?.length && item.key === active ? 'page' : undefined
|
|
32
|
+
"
|
|
33
|
+
@click="emit('navigate', item.key)"
|
|
34
|
+
>
|
|
35
|
+
{{ item.title }}
|
|
36
|
+
</button>
|
|
37
|
+
<button
|
|
38
|
+
v-if="item.children?.length"
|
|
39
|
+
type="button"
|
|
40
|
+
class="ys-side-menu__toggle"
|
|
41
|
+
:aria-expanded="openKeys.includes(item.key)"
|
|
42
|
+
:aria-label="`${openKeys.includes(item.key) ? '收起' : '展开'}${item.title}`"
|
|
43
|
+
@click="emit('toggle', item.key)"
|
|
44
|
+
>
|
|
45
|
+
<el-icon :size="12"
|
|
46
|
+
><CaretBottom v-if="openKeys.includes(item.key)" /><CaretRight
|
|
47
|
+
v-else
|
|
48
|
+
/></el-icon>
|
|
49
|
+
</button>
|
|
50
|
+
</div>
|
|
51
|
+
<div
|
|
52
|
+
v-if="item.children?.length && openKeys.includes(item.key)"
|
|
53
|
+
class="ys-side-menu__children"
|
|
54
|
+
>
|
|
55
|
+
<button
|
|
56
|
+
v-for="child in item.children"
|
|
57
|
+
:key="child.key"
|
|
58
|
+
type="button"
|
|
59
|
+
class="ys-side-menu__child"
|
|
60
|
+
:class="{ 'is-current': child.key === active }"
|
|
61
|
+
:aria-current="child.key === active ? 'page' : undefined"
|
|
62
|
+
@click="emit('navigate', child.key)"
|
|
63
|
+
>
|
|
64
|
+
<span class="ys-side-menu__marker" aria-hidden="true" />{{
|
|
65
|
+
child.title
|
|
66
|
+
}}
|
|
67
|
+
</button>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</nav>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<style scoped>
|
|
74
|
+
.ys-side-menu {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
gap: 2px;
|
|
78
|
+
}
|
|
79
|
+
.ys-side-menu__row {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
border-radius: var(--ys-radius-m);
|
|
83
|
+
}
|
|
84
|
+
.ys-side-menu__row:hover,
|
|
85
|
+
.ys-side-menu__row.is-open {
|
|
86
|
+
background: var(--ys-color-bg-hover);
|
|
87
|
+
}
|
|
88
|
+
.ys-side-menu__row.is-current {
|
|
89
|
+
background: var(--ys-color-primary);
|
|
90
|
+
}
|
|
91
|
+
.ys-side-menu__main,
|
|
92
|
+
.ys-side-menu__toggle,
|
|
93
|
+
.ys-side-menu__child {
|
|
94
|
+
margin: 0;
|
|
95
|
+
border: 0;
|
|
96
|
+
background: transparent;
|
|
97
|
+
font: inherit;
|
|
98
|
+
font-size: 13px;
|
|
99
|
+
line-height: 20px;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
}
|
|
102
|
+
.ys-side-menu__main {
|
|
103
|
+
flex: 1;
|
|
104
|
+
min-width: 0;
|
|
105
|
+
padding: 9px 4px 9px 14px;
|
|
106
|
+
border-radius: var(--ys-radius-m);
|
|
107
|
+
color: var(--ys-color-text-2);
|
|
108
|
+
text-align: left;
|
|
109
|
+
}
|
|
110
|
+
.ys-side-menu__row.is-current .ys-side-menu__main {
|
|
111
|
+
color: var(--ys-color-bg-elevated);
|
|
112
|
+
font-weight: 600;
|
|
113
|
+
}
|
|
114
|
+
.ys-side-menu__row.is-open .ys-side-menu__main {
|
|
115
|
+
color: var(--ys-color-text-1);
|
|
116
|
+
font-weight: 600;
|
|
117
|
+
}
|
|
118
|
+
.ys-side-menu__row.is-ancestor {
|
|
119
|
+
background: color-mix(in srgb, var(--ys-color-primary) 12%, transparent);
|
|
120
|
+
}
|
|
121
|
+
.ys-side-menu__row.is-ancestor .ys-side-menu__main {
|
|
122
|
+
color: var(--ys-color-primary);
|
|
123
|
+
font-weight: 600;
|
|
124
|
+
}
|
|
125
|
+
.ys-side-menu__toggle {
|
|
126
|
+
display: flex;
|
|
127
|
+
flex: none;
|
|
128
|
+
align-items: center;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
width: 28px;
|
|
131
|
+
height: 28px;
|
|
132
|
+
margin-right: 4px;
|
|
133
|
+
border-radius: var(--ys-radius-s);
|
|
134
|
+
color: var(--ys-color-text-3);
|
|
135
|
+
}
|
|
136
|
+
.ys-side-menu__toggle:hover {
|
|
137
|
+
color: var(--ys-color-primary);
|
|
138
|
+
background: var(--ys-color-bg-elevated);
|
|
139
|
+
}
|
|
140
|
+
.ys-side-menu button:focus-visible {
|
|
141
|
+
outline: 2px solid var(--ys-color-primary);
|
|
142
|
+
outline-offset: -2px;
|
|
143
|
+
}
|
|
144
|
+
.ys-side-menu__children {
|
|
145
|
+
display: flex;
|
|
146
|
+
flex-direction: column;
|
|
147
|
+
gap: 1px;
|
|
148
|
+
margin: 2px 0 6px;
|
|
149
|
+
padding-left: 18px;
|
|
150
|
+
}
|
|
151
|
+
.ys-side-menu__child {
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
gap: 8px;
|
|
155
|
+
width: 100%;
|
|
156
|
+
padding: 7px 12px 7px 8px;
|
|
157
|
+
border-radius: var(--ys-radius-m);
|
|
158
|
+
color: var(--ys-color-text-2);
|
|
159
|
+
text-align: left;
|
|
160
|
+
}
|
|
161
|
+
.ys-side-menu__child:hover {
|
|
162
|
+
background: var(--ys-color-bg-hover);
|
|
163
|
+
color: var(--ys-color-text-1);
|
|
164
|
+
}
|
|
165
|
+
.ys-side-menu__marker {
|
|
166
|
+
width: 5px;
|
|
167
|
+
height: 5px;
|
|
168
|
+
flex: none;
|
|
169
|
+
border-radius: 50%;
|
|
170
|
+
background: var(--ys-color-border);
|
|
171
|
+
}
|
|
172
|
+
.ys-side-menu__child.is-current {
|
|
173
|
+
background: color-mix(
|
|
174
|
+
in srgb,
|
|
175
|
+
var(--ys-color-primary) 12%,
|
|
176
|
+
var(--ys-color-bg-elevated)
|
|
177
|
+
);
|
|
178
|
+
color: var(--ys-color-primary);
|
|
179
|
+
font-weight: 600;
|
|
180
|
+
}
|
|
181
|
+
.ys-side-menu__child.is-current .ys-side-menu__marker {
|
|
182
|
+
background: var(--ys-color-primary);
|
|
183
|
+
}
|
|
184
|
+
</style>
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,12 @@ export { default as YsRowActionMenu } from "./components/YsRowActionMenu.vue";
|
|
|
7
7
|
export type { YsRowAction } from "./components/YsRowActionMenu.vue";
|
|
8
8
|
export { default as YsFormDialog } from "./components/YsFormDialog.vue";
|
|
9
9
|
export { default as YsPageLayout } from "./components/YsPageLayout.vue";
|
|
10
|
+
export { default as YsAppToolbar } from "./components/YsAppToolbar.vue";
|
|
11
|
+
export { default as YsSideMenu } from "./components/YsSideMenu.vue";
|
|
12
|
+
export type {
|
|
13
|
+
YsSideMenuItem,
|
|
14
|
+
YsSideMenuChild,
|
|
15
|
+
} from "./components/YsSideMenu.vue";
|
|
10
16
|
export { default as YsPageHeader } from "./components/YsPageHeader.vue";
|
|
11
17
|
export { default as YsLoginPage } from "./components/YsLoginPage.vue";
|
|
12
18
|
export { default as YsSettingsCenterDialog } from "./components/YsSettingsCenterDialog.vue";
|
|
@@ -15,4 +21,8 @@ export { default as YsRoleTag } from "./components/YsRoleTag.vue";
|
|
|
15
21
|
export { default as YsBoolMark } from "./components/YsBoolMark.vue";
|
|
16
22
|
export { default as YsSegmented } from "./components/YsSegmented.vue";
|
|
17
23
|
export { enumOptions, enumLabel, type EnumOption } from "./tokens-runtime";
|
|
18
|
-
export {
|
|
24
|
+
export {
|
|
25
|
+
registerColumnWidths,
|
|
26
|
+
columnWidth,
|
|
27
|
+
type ColumnWidthMap,
|
|
28
|
+
} from "./columnWidths";
|