Skip to content

Commit d3f38c6

Browse files
YunaiVgitee-org
authored andcommitted
!495 优化stylelint、优化登录页、等等
Merge pull request !495 from 半栈幼儿员/master
2 parents 2dc738a + 8c2ecbd commit d3f38c6

File tree

15 files changed

+61
-31
lines changed

15 files changed

+61
-31
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
"editor.defaultFormatter": "esbenp.prettier-vscode"
8484
},
8585
"editor.codeActionsOnSave": {
86-
"source.fixAll.eslint": "explicit"
86+
"source.fixAll.eslint": "explicit",
87+
"source.fixAll.stylelint": "explicit"
8788
},
8889
"[vue]": {
8990
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"

src/components/DictTag/src/DictTag.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default defineComponent({
7272
// 添加标签的文字颜色为白色,解决自定义背景颜色时标签文字看不清的问题
7373
<ElTag
7474
style={dict?.cssClass ? 'color: #fff' : ''}
75-
type={dict?.colorType}
75+
type={dict?.colorType || null}
7676
color={dict?.cssClass && isHexColor(dict?.cssClass) ? dict?.cssClass : ''}
7777
disableTransitions={true}
7878
>

src/layout/components/TagsView/src/TagsView.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,13 @@ watch(
358358
>
359359
<Icon
360360
v-if="
361-
item?.matched &&
362-
item?.matched[1] &&
363-
item?.matched[1]?.meta?.icon &&
364-
tagsViewIcon
361+
tagsViewIcon &&
362+
(item?.meta?.icon ||
363+
(item?.matched &&
364+
item.matched[0] &&
365+
item.matched[item.matched.length - 1].meta?.icon))
365366
"
366-
:icon="item?.matched[1]?.meta?.icon"
367+
:icon="item?.meta?.icon || item.matched[item.matched.length - 1].meta.icon"
367368
:size="12"
368369
class="mr-5px"
369370
/>

src/router/modules/remaining.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,16 @@ const remainingRouter: AppRouteRecordRaw[] = [
593593
}
594594
}
595595
]
596+
},
597+
{
598+
path: '/:pathMatch(.*)*',
599+
component: () => import('@/views/Error/404.vue'),
600+
name: '',
601+
meta: {
602+
title: '404',
603+
hidden: true,
604+
breadcrumb: false
605+
}
596606
}
597607
]
598608

src/store/modules/permission.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ export const usePermissionStore = defineStore('permission', {
4040
}
4141
const routerMap: AppRouteRecordRaw[] = generateRoute(res)
4242
// 动态路由,404一定要放到最后面
43+
// preschooler:vue-router@4以后已支持静态404路由,此处可不再追加
4344
this.addRouters = routerMap.concat([
4445
{
4546
path: '/:path(.*)*',
46-
redirect: '/404',
47+
// redirect: '/404',
48+
component: () => import('@/views/Error/404.vue'),
4749
name: '404Page',
4850
meta: {
4951
hidden: true,

src/styles/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import './var.css';
22
@import './FormCreate/index.scss';
3+
@import './theme.scss';
34
@import 'element-plus/theme-chalk/dark/css-vars.css';
45

56
.reset-margin [class*='el-icon'] + span {

src/styles/theme.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,14 @@
44
// .dark .dark\:text-color {
55
// color: rgba(255, 255, 255, var(--dark-text-color));
66
// }
7+
8+
// 登录页
9+
.dark .login-form {
10+
.el-divider__text {
11+
background-color: var(--login-bg-color);
12+
}
13+
14+
.el-card {
15+
background-color: var(--login-bg-color);
16+
}
17+
}

src/views/Login/Login.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
>
66
<div class="relative mx-auto h-full flex">
77
<div
8-
:class="`${prefixCls}__left flex-1 bg-gray-500 bg-opacity-20 relative p-30px lt-xl:hidden`"
8+
:class="`${prefixCls}__left flex-1 bg-gray-500 bg-opacity-20 relative p-30px lt-xl:hidden overflow-x-hidden overflow-y-auto`"
99
>
1010
<!-- 左上角的 logo + 系统标题 -->
1111
<div class="relative flex items-center text-white">
@@ -27,7 +27,9 @@
2727
</TransitionGroup>
2828
</div>
2929
</div>
30-
<div class="relative flex-1 p-30px dark:bg-[var(--login-bg-color)] lt-sm:p-10px">
30+
<div
31+
class="relative flex-1 p-30px dark:bg-[var(--login-bg-color)] lt-sm:p-10px overflow-x-hidden overflow-y-auto"
32+
>
3133
<!-- 右上角的主题、语言选择 -->
3234
<div
3335
class="flex items-center justify-between text-white at-2xl:justify-end at-xl:justify-end"
@@ -36,15 +38,15 @@
3638
<img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" />
3739
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
3840
</div>
39-
<div class="flex items-center justify-end space-x-10px">
41+
<div class="flex items-center justify-end space-x-10px h-48px">
4042
<ThemeSwitch />
4143
<LocaleDropdown class="dark:text-white lt-xl:text-white" />
4244
</div>
4345
</div>
4446
<!-- 右边的登录界面 -->
4547
<Transition appear enter-active-class="animate__animated animate__bounceInRight">
4648
<div
47-
class="m-auto h-full w-[100%] flex items-center at-2xl:max-w-500px at-lg:max-w-500px at-md:max-w-500px at-xl:max-w-500px"
49+
class="m-auto h-[calc(100%-60px)] w-[100%] flex items-center at-2xl:max-w-500px at-lg:max-w-500px at-md:max-w-500px at-xl:max-w-500px"
4850
>
4951
<!-- 账号登录 -->
5052
<LoginForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />

src/views/Login/SocialLogin.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<template>
22
<div
33
:class="prefixCls"
4-
class="relative h-[100%] lt-xl:bg-[var(--login-bg-color)] lt-md:px-10px lt-sm:px-10px lt-xl:px-10px"
4+
class="relative h-[100%] lt-md:px-10px lt-sm:px-10px lt-xl:px-10px lt-xl:px-10px"
55
>
66
<div class="relative mx-auto h-full flex">
77
<div
8-
:class="`${prefixCls}__left flex-1 bg-gray-500 bg-opacity-20 relative p-30px lt-xl:hidden`"
8+
:class="`${prefixCls}__left flex-1 bg-gray-500 bg-opacity-20 relative p-30px lt-xl:hidden overflow-x-hidden overflow-y-auto`"
99
>
1010
<!-- 左上角的 logo + 系统标题 -->
1111
<div class="relative flex items-center text-white">
@@ -27,7 +27,9 @@
2727
</TransitionGroup>
2828
</div>
2929
</div>
30-
<div class="relative flex-1 p-30px dark:bg-[var(--login-bg-color)] lt-sm:p-10px">
30+
<div
31+
class="relative flex-1 p-30px dark:bg-[var(--login-bg-color)] lt-sm:p-10px overflow-x-hidden overflow-y-auto"
32+
>
3133
<!-- 右上角的主题、语言选择 -->
3234
<div
3335
class="flex items-center justify-between text-white at-2xl:justify-end at-xl:justify-end"
@@ -36,15 +38,15 @@
3638
<img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" />
3739
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
3840
</div>
39-
<div class="flex items-center justify-end space-x-10px">
41+
<div class="flex items-center justify-end space-x-10px h-48px">
4042
<ThemeSwitch />
4143
<LocaleDropdown class="dark:text-white lt-xl:text-white" />
4244
</div>
4345
</div>
4446
<!-- 右边的登录界面 -->
4547
<Transition appear enter-active-class="animate__animated animate__bounceInRight">
4648
<div
47-
class="m-auto h-full w-[100%] flex items-center at-2xl:max-w-500px at-lg:max-w-500px at-md:max-w-500px at-xl:max-w-500px"
49+
class="m-auto h-[calc(100%-60px)] w-[100%] flex items-center at-2xl:max-w-500px at-lg:max-w-500px at-md:max-w-500px at-xl:max-w-500px"
4850
>
4951
<!-- 账号登录 -->
5052
<el-form

src/views/Login/components/QrCodeForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<el-row v-show="getShow" style="margin-right: -10px; margin-left: -10px">
2+
<el-row class="login-form" v-show="getShow" style="margin-right: -10px; margin-left: -10px">
33
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
44
<LoginFormTitle style="width: 100%" />
55
</el-col>

0 commit comments

Comments
 (0)