Explorar o código

build: :bug: 去掉首页面包导航

chaooo %!s(int64=2) %!d(string=hai) anos
pai
achega
36f0c10111

+ 7 - 13
src/components/Breadcrumb/index.vue

@@ -1,15 +1,9 @@
 <template>
-  <el-breadcrumb class="h-[50px] flex items-center">
+  <el-breadcrumb :separator-icon="ArrowRight" class="h-[50px] flex items-center">
     <transition-group name="breadcrumb">
       <el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.path">
-        <span
-          v-if="item.redirect === 'noredirect' || index === breadcrumbs.length - 1"
-          class="text-[var(--el-disabled-text-color)]"
-          >{{ translateRouteTitleI18n(item.meta.title) }}</span
-        >
-        <a v-else @click.prevent="handleLink(item)">
-          {{ translateRouteTitleI18n(item.meta.title) }}
-        </a>
+        <span v-if="item.redirect === 'noredirect' || index === breadcrumbs.length - 1">{{ item.meta.title }}</span>
+        <a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
       </el-breadcrumb-item>
     </transition-group>
   </el-breadcrumb>
@@ -17,10 +11,10 @@
 
 <script setup lang="ts">
 import {onBeforeMount, ref, watch} from "vue";
-import {useRoute, RouteLocationMatched} from "vue-router";
+import {RouteLocationMatched, useRoute} from "vue-router";
 import {compile} from "path-to-regexp";
 import router from "@/router";
-import {translateRouteTitleI18n} from "@/utils/i18n";
+import {ArrowRight} from "@element-plus/icons-vue";
 
 const currentRoute = useRoute();
 const pathCompile = (path: string) => {
@@ -32,10 +26,10 @@ const pathCompile = (path: string) => {
 const breadcrumbs = ref([] as Array<RouteLocationMatched>);
 
 function getBreadcrumb() {
-  let matched = currentRoute.matched.filter((item) => item.meta && item.meta.title);
+  let matched = currentRoute.matched.filter((item) => item.meta && item.meta?.title);
   const first = matched[0];
   if (!isDashboard(first)) {
-    matched = [{path: "/dashboard", meta: {title: "dashboard"}} as any].concat(matched);
+    matched = [{path: "/"} as any].concat(matched);
   }
   breadcrumbs.value = matched.filter((item) => {
     return item.meta && item.meta.title && item.meta.breadcrumb !== false;

+ 2 - 2
src/store/modules/permission.ts

@@ -13,7 +13,7 @@ const adminRoutes: RouteRecordRaw[] = JSON.parse(
     {
       path: "/",
       redirect: "/areaboard",
-      meta: {hidden: true, name: "Home"},
+      meta: {hidden: true, breadcrumb: false, name: "Home"},
     },
     {
       path: "/areaboard",
@@ -42,7 +42,7 @@ const schoolRoutes: RouteRecordRaw[] = JSON.parse(
     {
       path: "/",
       redirect: "/dashboard",
-      meta: {hidden: true, name: "Home"},
+      meta: {hidden: true, breadcrumb: false, name: "Home"},
     },
     {
       path: "/dashboard",

+ 27 - 8
src/views/login/index.vue

@@ -26,11 +26,19 @@
           <svg-icon :icon-class="!passwordVisible ? 'eye' : 'eye-open'" class="cursor-pointer" size="18px" />
         </span>
       </el-form-item>
-      <el-button :loading="loading" class="w-full" size="default" type="primary" @click.prevent="handleLogin"
-        >登录
-      </el-button>
 
-      <el-checkbox v-model="autoLogin" fill="#727272" label="自动登录" size="small" />
+      <el-button
+        v-if="loginData.phone && loginData.password"
+        :loading="loading"
+        class="is-active"
+        size="default"
+        type="primary"
+        @click.prevent="handleLogin"
+        >登录</el-button
+      >
+      <el-button v-else :loading="loading" size="default" type="primary">登录</el-button>
+
+      <el-checkbox v-model="autoLogin" label="自动登录" fill="#006eff" text-color="#737373" size="small" />
     </el-form>
   </div>
 </template>
@@ -61,7 +69,7 @@ const passwordVisible = ref(false);
  * 登录表单引用
  */
 const loginFormRef = ref(ElForm);
-const autoLogin = ref(true);
+const autoLogin = ref(false);
 const loginData = ref<LoginData>({
   // phone: "18770033942",
   // password: "123456",
@@ -179,11 +187,17 @@ function handleLogin() {
   }
 
   .el-button {
+    width: 100%;
     height: 54px;
     margin: 20px auto 10px;
     font-size: 18px;
     line-height: 54px;
-    background: #006eff;
+    background: #ddd;
+    border: none;
+
+    &.is-active {
+      background: #006eff;
+    }
   }
 }
 
@@ -247,11 +261,16 @@ function handleLogin() {
   }
 }
 
-:deep(.el-checkbox__input.is-checked .el-checkbox__inner) {
-  background-color: #727272;
+:deep(.el-checkbox__input .el-checkbox__inner) {
+  color: #727272;
   border-color: #727272;
 }
 
+:deep(.el-checkbox__input.is-checked .el-checkbox__inner) {
+  background-color: #006eff;
+  border-color: #006eff;
+}
+
 :deep(.el-checkbox__input.is-checked + .el-checkbox__label) {
   color: #727272;
 }