Преглед на файлове

feat: 删除多余的代码

louhangfei преди 1 година
родител
ревизия
c590b24309

+ 6 - 50
src/App.vue

@@ -1,65 +1,21 @@
 <template>
   <el-config-provider size="default" :zIndex="zIndex">
     <AppProvider>
-      <RouterView v-if="!isLock" />
-      <transition v-if="isLock && $route.name !== LoginName" name="slide-up">
-        <LockScreen />
-      </transition>
+      <HeaderMenu />
+      <div>
+        <RouterView />
+      </div>
     </AppProvider>
   </el-config-provider>
 </template>
 
 <script lang="ts" setup>
-  import { computed, onMounted, onUnmounted, ref } from 'vue';
+  import { ref } from 'vue';
   import { ElConfigProvider } from 'element-plus';
-  import { LockScreen } from '@/components/Lockscreen';
   import { AppProvider } from '@/components/Application';
-  import { useLockscreenStore } from '@/store/modules/lockscreen';
-  import { useRoute } from 'vue-router';
-  import { PageEnum } from '@/enums/pageEnum';
-  import { useGlobSetting } from './hooks/setting';
-
-  const route = useRoute();
-  const useLockscreen = useLockscreenStore();
-  const { title } = useGlobSetting();
-
-  /** 设置不锁屏幕 */
-  // const isLock = computed(() => useLockscreen.isLock);
-  const isLock = ref(false);
-  const lockTime = computed(() => useLockscreen.lockTime);
+  import HeaderMenu from '@/layout/components/header-menu/HeaderMenu.vue';
 
   const zIndex = ref(3000);
-
-  const LoginName = PageEnum.BASE_LOGIN_NAME;
-
-  let timer;
-
-  const timekeeping = () => {
-    clearInterval(timer);
-    if (route.name === LoginName || isLock.value) return;
-    // 设置不锁屏
-    useLockscreen.setLock(false);
-    // 重置锁屏时间
-    useLockscreen.setLockTime();
-    timer = setInterval(() => {
-      // 锁屏倒计时递减
-      useLockscreen.setLockTime(lockTime.value - 1);
-      if (lockTime.value <= 0) {
-        // 设置锁屏
-        useLockscreen.setLock(true);
-        return clearInterval(timer);
-      }
-    }, 1000);
-  };
-
-  onMounted(() => {
-    document.addEventListener('mousedown', timekeeping);
-    document.title = title;
-  });
-
-  onUnmounted(() => {
-    document.removeEventListener('mousedown', timekeeping);
-  });
 </script>
 
 <style lang="scss">

+ 3 - 0
src/enums/pageEnum.ts

@@ -7,6 +7,9 @@ export enum PageEnum {
   REDIRECT_NAME = 'Redirect',
   // 首页
   BASE_HOME = '/dashboard',
+
+  HOME_PAGE = '/home',
+
   //首页跳转默认路由
   BASE_HOME_REDIRECT = '/dashboard/console',
   // 错误

+ 0 - 103
src/layout/components/Header/SwitchTenant.vue

@@ -1,103 +0,0 @@
-<!-- 切换租户 -->
-<template>
-  <div class="switchTenantLable-wrapper" v-if="optionsShown">
-    <div class="switchTenantLable">选择租户</div>
-    <el-tree-select
-      :model-value="currentTenant"
-      :data="options"
-      check-strictly
-      show-all-levels
-      default-expand-all
-      placeholder="请选择租户"
-      @change="handleChange"
-    />
-  </div>
-</template>
-<script lang="ts" setup>
-  import { ref, computed, onMounted } from 'vue';
-  import { ElMessageBox, ElMessage } from 'element-plus';
-  import { useUserStore } from '@/store/modules/user';
-  import { queryListTenant } from '@/api/tenant';
-  import { useTargetTenantIdSetting } from '@/utils/useTargetTenantIdSetting';
-  import { replaceParams } from '@/utils/helper/treeHelper';
-  import router from '@/router';
-  import { useRoute } from 'vue-router';
-
-  interface TenantOption {
-    label: string;
-    value: string;
-    children?: TenantOption[];
-  }
-
-  const userStore = useUserStore();
-  const { setValue, getValue } = useTargetTenantIdSetting();
-  const localTId = getValue();
-  const tenantId = computed(() => {
-    return userStore.info.tenantId;
-  });
-  const currentTenant = ref(localTId ? Number(localTId) : Number(tenantId.value));
-  const options = ref<TenantOption[]>([]);
-
-  const route = useRoute();
-
-  const optionsShown = computed(() => {
-    // 列表空
-    if (!options.value.length) return false;
-    // 当前租户本身,且没有子租户
-    if (options.value.length === 1 && !options.value[0].children?.length) return false;
-    return true;
-  });
-
-  onMounted(() => {
-    const routeTenantId = route.query.targetTenantId as string;
-    if (routeTenantId && routeTenantId !== 'undefined') {
-      const nextTenantId = Number(routeTenantId);
-      currentTenant.value = nextTenantId;
-      setValue(routeTenantId);
-    }
-    queryListTenant().then((res) => {
-      if (!res) return;
-      options.value = replaceParams(res || [], 'tenantName', 'id');
-    });
-  });
-
-  /* 选择租户添加二次确认弹窗 */
-  const handleChange = (targetTenantId: string) => {
-    ElMessageBox.confirm('是否切换租户?', '提示', {
-      confirmButtonText: '确定',
-      cancelButtonText: '取消',
-      type: 'warning',
-    })
-      .then(async () => {
-        setValue(targetTenantId);
-        currentTenant.value = Number(targetTenantId);
-        // 统一返回首页
-        await router.push({ name: 'DashboardConsole' });
-        window.location.reload();
-      })
-      .catch(() => {
-        ElMessage({
-          type: 'info',
-          message: '取消切换',
-        });
-      });
-  };
-</script>
-<style scoped>
-  .switchTenantLable {
-    margin-right: 15px;
-    display: inline-block;
-    width: 100px;
-  }
-
-  .switchTenantWrapper {
-    margin-right: 20px;
-  }
-
-  .switchTenantLable-wrapper {
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    width: 200px;
-  }
-</style>

+ 12 - 56
src/layout/components/Header/index.vue

@@ -6,10 +6,7 @@
     }"
   >
     <!--顶部菜单-->
-    <div
-      v-if="navMode === 'horizontal' || (navMode === 'horizontal-mix' && mixMenu)"
-      class="layout-header-left"
-    >
+    <div v-if="navMode === 'horizontal' || (navMode === 'horizontal-mix' && mixMenu)" class="layout-header-left">
       <div v-if="navMode === 'horizontal'" class="logo">
         <img alt="" src="~@/assets/images/logo.png" />
         <h2 v-show="!collapsed" class="title">NaiveAdmin</h2>
@@ -46,26 +43,15 @@
           <el-breadcrumb-item v-if="routeItem.meta.breadcrumbView != false">
             <el-dropdown v-if="routeItem.children.length" :options="routeItem.children">
               <span class="flex items-center link-text">
-                <el-icon
-                  class="mr-2 el-input__icon"
-                  :size="18"
-                  v-if="crumbsSetting.showIcon && routeItem.meta.icon"
-                >
+                <el-icon class="mr-2 el-input__icon" :size="18" v-if="crumbsSetting.showIcon && routeItem.meta.icon">
                   <component :is="routeItem.meta.icon" />
                 </el-icon>
-                <Render
-                  :ref="`renderDom_${routeItem.name}`"
-                  :value="getRender(routeItem.meta.title)"
-                />
+                <Render :ref="`renderDom_${routeItem.name}`" :value="getRender(routeItem.meta.title)" />
               </span>
               <template #dropdown>
                 <el-dropdown-menu>
                   <el-dropdown-item v-for="item in routeItem.children" :key="item.name" @click="item.props.onClick">
-                    <el-icon
-                      class="el-input__icon"
-                      :size="18"
-                      v-if="crumbsSetting.showIcon && item.meta.icon"
-                    >
+                    <el-icon class="el-input__icon" :size="18" v-if="crumbsSetting.showIcon && item.meta.icon">
                       <component :is="item.meta.icon" />
                     </el-icon>
                     <Render :ref="`renderDom_${item.name}`" :value="getRender(item.meta.title)" />
@@ -74,17 +60,10 @@
               </template>
             </el-dropdown>
             <span v-else class="link-text" @click="routeItem.props.onClick">
-              <el-icon
-                class="el-input__icon"
-                :size="18"
-                v-if="crumbsSetting.showIcon && routeItem.meta.icon"
-              >
+              <el-icon class="el-input__icon" :size="18" v-if="crumbsSetting.showIcon && routeItem.meta.icon">
                 <component :is="routeItem.meta.icon" />
               </el-icon>
-              <Render
-                :ref="`renderDom_${routeItem.name}`"
-                :value="getRender(routeItem.meta.title)"
-              />
+              <Render :ref="`renderDom_${routeItem.name}`" :value="getRender(routeItem.meta.title)" />
             </span>
           </el-breadcrumb-item>
         </template>
@@ -112,7 +91,6 @@
           </el-icon>
         </el-tooltip>
       </div> -->
-      <SwitchTenant />
       <!-- 个人中心 -->
       <div class="layout-header-trigger layout-header-trigger-min">
         <el-dropdown trigger="hover" @command="avatarSelect">
@@ -132,12 +110,10 @@
                 >个人设置</el-dropdown-item
               > -->
               <el-dropdown-item command="3"
-                ><el-icon class="el-input__icon" :size="18"><LockClosedOutline /></el-icon
-                >修改密码</el-dropdown-item
+                ><el-icon class="el-input__icon" :size="18"><LockClosedOutline /></el-icon>修改密码</el-dropdown-item
               >
               <el-dropdown-item command="2"
-                ><el-icon class="el-input__icon" :size="18"><LogoutOutlined /></el-icon
-                >退出登录</el-dropdown-item
+                ><el-icon class="el-input__icon" :size="18"><LogoutOutlined /></el-icon>退出登录</el-dropdown-item
               >
             </el-dropdown-menu>
           </template>
@@ -149,9 +125,7 @@
       </div>
       <!-- 安全管控平台 -->
       <div class="layout-header-trigger layout-header-trigger-min">
-        <el-button style="border: none" type="primary" @click="handleGoPlatform">
-          返回平台
-        </el-button>
+        <el-button style="border: none" type="primary" @click="handleGoPlatform"> 返回平台 </el-button>
       </div>
       <!--切换全屏-->
       <!-- <div class="layout-header-trigger layout-header-trigger-min">
@@ -182,8 +156,6 @@
       </div> -->
     </div>
   </div>
-  <!--项目配置-->
-  <ProjectSetting ref="drawerSetting" />
 
   <!-- 搜索 -->
   <AppSearch ref="appSearchRef" />
@@ -195,30 +167,16 @@
 <script lang="ts" setup>
   import { computed, ref, unref, watch, inject } from 'vue';
   import { useRoute, useRouter } from 'vue-router';
-  import { TABS_ROUTES } from '@/store/mutation-types';
   import { useUserStore } from '@/store/modules/user';
   // import { useLockscreenStore } from '@/store/modules/lockscreen';
   import { useProjectSetting } from '@/hooks/setting/useProjectSetting';
   import { AppSearch } from '@/components/Application/index';
   import ProjectSetting from './ProjectSetting.vue';
   import QRcodePopover from './QRcodePopover.vue';
-  import NotifierProPlus from './NotifierProPlus.vue';
   import Sider from '../Sider/Sider.vue';
   import AmendPwd from './AmendPwd.vue';
   import { useGo, useRedo } from '@/hooks/web/usePage';
-  import {
-    FullscreenExitOutlined,
-    FullscreenOutlined,
-    GithubOutlined,
-    LockOutlined,
-    LogoutOutlined,
-    MenuFoldOutlined,
-    MenuUnfoldOutlined,
-    ReloadOutlined,
-    SearchOutlined,
-    SettingOutlined,
-    UserSwitchOutlined,
-  } from '@vicons/antd';
+  import { LogoutOutlined, MenuFoldOutlined, MenuUnfoldOutlined } from '@vicons/antd';
   import { LockClosedOutline } from '@vicons/ionicons5';
   import { PageEnum } from '@/enums/pageEnum';
   import schoolboy from '@/assets/images/schoolboy.png';
@@ -227,9 +185,8 @@
   import { ElMessageBox, ElMessage } from 'element-plus';
   import { useDesignSetting } from '@/hooks/setting/useDesignSetting';
   import { Render, getRender } from '@/components/Render';
-  import { getLogoutUrl, getRedirectUrl } from '@/utils/getRedirectUrl';
+  import { getLogoutUrl } from '@/utils/getRedirectUrl';
   import { useGlobSetting } from '@/hooks/setting';
-  import SwitchTenant from './SwitchTenant.vue';
 
   defineEmits(['update:collapsed']);
 
@@ -238,8 +195,7 @@
   const appSearchRef = ref();
   const isRefresh = ref(false);
   const { getDarkTheme } = useDesignSetting();
-  const { getNavMode, getNavTheme, getHeaderSetting, getMenuSetting, getCrumbsSetting } =
-    useProjectSetting();
+  const { getNavMode, getNavTheme, getHeaderSetting, getMenuSetting, getCrumbsSetting } = useProjectSetting();
 
   const props = defineProps({
     inverted: {

+ 19 - 0
src/layout/components/header-menu/HeaderMenu.vue

@@ -0,0 +1,19 @@
+<template>
+  <div class="header">
+    <div>上飞院安全智能管控平台</div>
+    <div class="item">首页</div>
+    <div class="item">院内安全态势</div>
+    <div class="item">生产安全</div>
+  </div>
+</template>
+<script lang="ts" setup></script>
+<style scoped lang="scss">
+  .header {
+    display: flex;
+    gap: 20px;
+  }
+  .item {
+    border: 1px solid #ccc;
+    padding: 10px;
+  }
+</style>

+ 0 - 3
src/main.ts

@@ -5,7 +5,6 @@ import 'element-plus/theme-chalk/display.css';
 import 'element-plus/theme-chalk/dark/css-vars.css';
 import 'nprogress/nprogress.css';
 import './main.css';
-import VueKonva from 'vue-konva';
 
 import { createApp } from 'vue';
 import App from './App.vue';
@@ -16,7 +15,6 @@ import { setupElement, setupDirectives, setupCustomComponents } from '@/plugins'
 
 async function bootstrap() {
   const app = createApp(App);
-  app.use(VueKonva);
 
   // 全局完整引入 element 组件
   setupElement(app);
@@ -41,7 +39,6 @@ async function bootstrap() {
 
   // 路由准备就绪后挂载APP实例
   await router.isReady();
-  app.use(VueKonva);
   app.mount('#app', true);
 }
 

+ 8 - 9
src/router/index.ts

@@ -29,15 +29,14 @@ export const RootRoute: RouteRecordRaw = {
   },
 };
 
-export const LoginRoute: RouteRecordRaw = {
-  path: '/login',
-  name: 'Login',
-  // component: () => import('@/views/login/index.vue'), //v1.x 模板
-  // component: () => import('@/views/login/newLogin.vue'), // 2.x新模板
-  component: () => import('@/views/login/newLogin2.vue'), // 2.x全新模板
-  // redirect: '/',
+export const HOME_PAGE: RouteRecordRaw = {
+  // 模板管理
+  path: '/home',
+  name: 'HomePage',
+  component: () => import('@/views/home/home.vue'),
   meta: {
-    title: '登录',
+    icon: '',
+    title: '公司主页',
   },
 };
 
@@ -45,7 +44,7 @@ export const LoginRoute: RouteRecordRaw = {
 export const asyncRoutes = [...routeModuleList];
 
 //普通路由 无需验证权限
-export const constantRouter: any[] = [LoginRoute, RootRoute, RedirectRoute];
+export const constantRouter: any[] = [RootRoute, HOME_PAGE, RedirectRoute];
 
 export const router = createRouter({
   history: createWebHashHistory(),

+ 0 - 32
src/router/modules/about.ts

@@ -1,32 +0,0 @@
-import { RouteRecordRaw } from 'vue-router';
-import { Layout } from '@/router/constant';
-import { ProjectOutlined } from '@vicons/antd';
-import { renderIcon } from '@/utils/index';
-
-const routes: Array<RouteRecordRaw> = [
-  {
-    path: '/about',
-    name: 'about',
-    component: Layout,
-    meta: {
-      sort: 11,
-      isRoot: true,
-      activeMenu: 'about_index',
-      alwaysShow: true,
-      icon: renderIcon(ProjectOutlined),
-    },
-    children: [
-      {
-        path: 'index',
-        name: `about_index`,
-        meta: {
-          title: '关于项目',
-          activeMenu: 'about_index',
-        },
-        component: () => import('@/views/about/index.vue'),
-      },
-    ],
-  },
-];
-
-export default routes;

+ 0 - 179
src/router/modules/comp.ts

@@ -1,179 +0,0 @@
-import { RouteRecordRaw } from 'vue-router';
-import { Layout, ParentLayout } from '@/router/constant';
-import { WalletOutlined } from '@vicons/antd';
-import { renderIcon } from '@/utils';
-
-const routeName = 'comp';
-
-/**
- * @param name 路由名称, 必须设置,且不能重名
- * @param meta 路由元信息(路由附带扩展信息)
- * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
- * @param meta.disabled 禁用整个菜单
- * @param meta.title 菜单名称
- * @param meta.icon 菜单图标
- * @param meta.keepAlive 缓存该路由
- * @param meta.sort 排序越小越排前
- *
- * */
-const routes: Array<RouteRecordRaw> = [
-  /**
-  {
-    path: '/comp',
-    name: routeName,
-    component: Layout,
-    redirect: '/comp/table',
-    meta: {
-      title: '组件示例',
-      icon: renderIcon(WalletOutlined),
-      sort: 8,
-    },
-    children: [
-      {
-        path: 'table',
-        name: `${routeName}_table`,
-        redirect: '/comp/table/basic',
-        component: ParentLayout,
-        meta: {
-          title: '表格扩展',
-        },
-        children: [
-          {
-            path: 'basic',
-            name: `${routeName}_table_basic`,
-            meta: {
-              title: '基础表格',
-            },
-            component: () => import('@/views/comp/table/basic.vue'),
-          },
-          {
-            path: 'editCell',
-            name: `${routeName}_table_editCell`,
-            meta: {
-              title: '单元格编辑',
-            },
-            component: () => import('@/views/comp/table/editCell.vue'),
-          },
-          {
-            path: 'editRow',
-            name: `${routeName}_table_editRow`,
-            meta: {
-              title: '整行编辑',
-            },
-            component: () => import('@/views/comp/table/editRow.vue'),
-          },
-        ],
-      },
-      {
-        path: 'form',
-        name: `${routeName}_form`,
-        redirect: '/comp/form/basic',
-        component: ParentLayout,
-        meta: {
-          title: '表单扩展',
-        },
-        children: [
-          {
-            path: 'basic',
-            name: `${routeName}_form_basic`,
-            meta: {
-              title: '基础使用',
-            },
-            component: () => import('@/views/comp/form/basic.vue'),
-          },
-          {
-            path: 'useForm',
-            name: `useForm`,
-            meta: {
-              title: 'useForm',
-            },
-            component: () => import('@/views/comp/form/useForm.vue'),
-          },
-        ],
-      },
-      {
-        path: 'upload',
-        name: `${routeName}_upload`,
-        meta: {
-          title: '上传图片',
-        },
-        component: () => import('@/views/comp/upload/index.vue'),
-      },
-      {
-        path: 'modal',
-        name: `${routeName}_modal`,
-        meta: {
-          title: '弹窗扩展',
-        },
-        component: () => import('@/views/comp/modal/index.vue'),
-      },
-      {
-        path: 'richtext',
-        name: `richtext`,
-        meta: {
-          title: '富文本',
-        },
-        component: () => import('@/views/comp/richtext/vue-quill.vue'),
-      },
-      {
-        path: 'drag',
-        name: `Drag`,
-        meta: {
-          title: '拖拽',
-        },
-        component: () => import('@/views/comp/drag/index.vue'),
-      },
-      {
-        path: 'region',
-        name: `Region`,
-        meta: {
-          title: '地区',
-        },
-        component: () => import('@/views/comp/region/index.vue'),
-      },
-      {
-        path: 'cropper',
-        name: `Cropper`,
-        meta: {
-          title: '图片裁剪',
-        },
-        component: () => import('@/views/comp/cropper/index.vue'),
-      },
-      {
-        path: 'qrcode',
-        name: `Qrcode`,
-        meta: {
-          title: '二维码',
-        },
-        component: () => import('@/views/comp/qrcode/index.vue'),
-      },
-      {
-        path: 'password',
-        name: `Password`,
-        meta: {
-          title: '密码强度',
-        },
-        component: () => import('@/views/comp/password/index.vue'),
-      },
-      {
-        path: 'select',
-        name: `Select`,
-        meta: {
-          title: '选择器',
-        },
-        component: () => import('@/views/comp/select/BasicSelect.vue'),
-      },
-      {
-        path: 'tableselect',
-        name: `TableSelect`,
-        meta: {
-          title: '表格选择器',
-        },
-        component: () => import('@/views/comp/tableSelect/tableSelect.vue'),
-      },
-    ],
-  }, 
-  */
-];
-
-export default routes;

+ 0 - 46
src/router/modules/comtemp.ts

@@ -1,46 +0,0 @@
-import { RouteRecordRaw } from 'vue-router';
-import { Layout } from '@/router/constant';
-import { CubeOutline } from '@vicons/ionicons5';
-import { renderIcon } from '@/utils/index';
-
-const routes: Array<RouteRecordRaw> = [
-  // {
-  //   path: '/comtemp',
-  //   name: 'Comtemp',
-  //   component: Layout,
-  //   redirect: '/comtemp/search-article',
-  //   meta: {
-  //     title: '常用模板',
-  //     icon: renderIcon(CubeOutline),
-  //     sort: 9,
-  //   },
-  //   children: [
-  //     {
-  //       path: 'search-article',
-  //       name: 'SearchArticle',
-  //       meta: {
-  //         title: '搜索列表(文章)',
-  //       },
-  //       component: () => import('@/views/comtemp/search-article/search-article.vue'),
-  //     },
-  //     {
-  //       path: 'search-video',
-  //       name: 'SearchVideo',
-  //       meta: {
-  //         title: '搜索列表(视频)',
-  //       },
-  //       component: () => import('@/views/comtemp/search-video/search-video.vue'),
-  //     },
-  //     {
-  //       path: 'search-make',
-  //       name: 'SearchMake',
-  //       meta: {
-  //         title: '搜索列表(预约)',
-  //       },
-  //       component: () => import('@/views/comtemp/search-make/search-make.vue'),
-  //     },
-  //   ],
-  // },
-];
-
-export default routes;

+ 0 - 19
src/router/modules/docs.ts

@@ -1,19 +0,0 @@
-import { RouteRecordRaw } from 'vue-router';
-import { Layout } from '@/router/constant';
-import { DocumentTextOutline } from '@vicons/ionicons5';
-import { renderIcon } from '@/utils/index';
-
-const routes: Array<RouteRecordRaw> = [
-  {
-    path: '/external',
-    name: 'https://www.naiveadmin.com',
-    component: Layout,
-    meta: {
-      title: '项目文档',
-      icon: renderIcon(DocumentTextOutline),
-      sort: 11,
-    },
-  },
-];
-
-export default routes;

+ 0 - 66
src/router/modules/form.ts

@@ -1,66 +0,0 @@
-import { RouteRecordRaw } from 'vue-router';
-import { Layout } from '@/router/constant';
-import { ProfileOutlined } from '@vicons/antd';
-import { renderIcon } from '@/utils/index';
-
-/**
- * @param name 路由名称, 必须设置,且不能重名
- * @param meta 路由元信息(路由附带扩展信息)
- * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
- * @param meta.disabled 禁用整个菜单
- * @param meta.title 菜单名称
- * @param meta.icon 菜单图标
- * @param meta.keepAlive 缓存该路由
- * @param meta.sort 排序越小越排前
- *
- * */
-const routes: Array<RouteRecordRaw> = [
-  {
-    path: '/form',
-    name: 'Form',
-    redirect: '/form/basic-form',
-    component: Layout,
-    meta: {
-      title: '表单页面',
-      icon: renderIcon(ProfileOutlined),
-      sort: 3,
-    },
-    children: [
-      {
-        path: 'basic-form',
-        name: 'BasicForm',
-        meta: {
-          title: '基础表单',
-          keepAlive: true,
-        },
-        component: () => import('@/views/form/basicForm/index.vue'),
-      },
-      {
-        path: 'advanced-form',
-        name: 'form-advanced-form',
-        meta: {
-          title: '高级表单',
-        },
-        component: () => import('@/views/form/advancedForm/advancedForm.vue'),
-      },
-      {
-        path: 'step-form',
-        name: 'form-step-form',
-        meta: {
-          title: '分步表单',
-        },
-        component: () => import('@/views/form/stepForm/stepForm.vue'),
-      },
-      {
-        path: 'detail',
-        name: 'form-detail',
-        meta: {
-          title: '表单详情',
-        },
-        component: () => import('@/views/form/detail/index.vue'),
-      },
-    ],
-  },
-];
-
-export default routes;

+ 0 - 42
src/router/modules/frame.ts

@@ -1,42 +0,0 @@
-import { RouteRecordRaw } from 'vue-router';
-import { Layout } from '@/router/constant';
-import { DesktopOutline } from '@vicons/ionicons5';
-import { renderIcon } from '@/utils/index';
-
-const IFrame = () => import('@/views/iframe/index.vue');
-
-const routes: Array<RouteRecordRaw> = [
-  {
-    path: '/frame',
-    name: 'Frame',
-    redirect: '/frame/docs',
-    component: Layout,
-    meta: {
-      title: '外部页面',
-      sort: 9,
-      icon: renderIcon(DesktopOutline),
-    },
-    children: [
-      {
-        path: 'docs',
-        name: 'frame-docs',
-        meta: {
-          title: '项目文档(内嵌)',
-          frameSrc: 'https://www.naiveadmin.com',
-        },
-        component: IFrame,
-      },
-      {
-        path: 'element-plus',
-        name: 'frame-element-plus',
-        meta: {
-          title: 'ElementPlus(内嵌)',
-          frameSrc: 'https://element-plus.org',
-        },
-        component: IFrame,
-      },
-    ],
-  },
-];
-
-export default routes;

+ 0 - 38
src/router/modules/instation.ts

@@ -1,38 +0,0 @@
-import { RouteRecordRaw } from 'vue-router';
-import { Layout } from '@/router/constant';
-import { BellOutlined } from '@vicons/antd';
-import { renderIcon } from '@/utils/index';
-
-const routes: Array<RouteRecordRaw> = [
-  // {
-  //   path: '/instation',
-  //   name: 'Instation',
-  //   redirect: '/instation/myalerts',
-  //   component: Layout,
-  //   meta: {
-  //     title: '站内通知',
-  //     icon: renderIcon(BellOutlined),
-  //     sort: 7,
-  //   },
-  //   children: [
-  //     {
-  //       path: 'myalerts',
-  //       name: 'myalerts',
-  //       meta: {
-  //         title: '我的通知',
-  //       },
-  //       component: () => import('@/views/instation/myalerts/myalerts.vue'),
-  //     },
-  //     {
-  //       path: 'notice',
-  //       name: 'instation_notice',
-  //       meta: {
-  //         title: '通知管理',
-  //       },
-  //       component: () => import('@/views/instation/notice/notice.vue'),
-  //     },
-  //   ],
-  // },
-];
-
-export default routes;

+ 0 - 53
src/router/modules/list.ts

@@ -1,53 +0,0 @@
-import { RouteRecordRaw } from 'vue-router';
-import { Layout } from '@/router/constant';
-import { TableOutlined } from '@vicons/antd';
-import { renderIcon } from '@/utils/index';
-
-/**
- * @param name 路由名称, 必须设置,且不能重名
- * @param meta 路由元信息(路由附带扩展信息)
- * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
- * @param meta.disabled 禁用整个菜单
- * @param meta.title 菜单名称
- * @param meta.icon 菜单图标
- * @param meta.keepAlive 缓存该路由
- * @param meta.sort 排序越小越排前
- *
- * */
-const routes: Array<RouteRecordRaw> = [
-  {
-    path: '/list',
-    name: 'List',
-    redirect: '/list/basic-list',
-    component: Layout,
-    meta: {
-      title: '列表页面',
-      icon: renderIcon(TableOutlined),
-      sort: 2,
-      permissions: ['basic_list'],
-    },
-    children: [
-      {
-        path: 'basic-list/:id?',
-        name: 'basic-list',
-        meta: {
-          title: '基础列表',
-        },
-        component: () => import('@/views/list/basicList/index.vue'),
-      },
-      {
-        path: 'basic-info/:id?',
-        name: 'BasicInfo',
-        meta: {
-          title: '基础详情',
-          hidden: true,
-          activeMenu: 'basic-list',
-          keepAlive: true,
-        },
-        component: () => import('@/views/list/basicList/info.vue'),
-      },
-    ],
-  },
-];
-
-export default routes;

+ 0 - 19
src/router/modules/mandate.ts

@@ -1,19 +0,0 @@
-import { RouteRecordRaw } from 'vue-router';
-import { Layout } from '@/router/constant';
-import { DiamondOutline } from '@vicons/ionicons5';
-import { renderIcon } from '@/utils/index';
-
-const routes: Array<RouteRecordRaw> = [
-  {
-    path: '/mandate',
-    name: 'https://www.naiveadmin.com/authorize/index',
-    component: Layout,
-    meta: {
-      title: '获取授权',
-      icon: renderIcon(DiamondOutline),
-      sort: 13,
-    },
-  },
-];
-
-export default routes;

+ 0 - 47
src/router/modules/notice.ts

@@ -1,47 +0,0 @@
-import { RouteRecordRaw } from 'vue-router';
-import { Layout } from '@/router/constant';
-import { BellOutlined } from '@vicons/antd';
-import { renderIcon } from '@/utils/index';
-
-const routes: Array<RouteRecordRaw> = [
-  // {
-  //   path: '/instation',
-  //   name: 'Notice',
-  //   redirect: '/instation/myalerts',
-  //   component: Layout,
-  //   meta: {
-  //     title: '站内通知',
-  //     icon: renderIcon(BellOutlined),
-  //     sort: 10,
-  //   },
-  //   children: [
-  //     {
-  //       path: 'myalerts',
-  //       name: 'instation_myalerts',
-  //       meta: {
-  //         title: '我的通知',
-  //       },
-  //       component: () => import('@/views/instation/myalerts/myalerts.vue'),
-  //     },
-  //     {
-  //       path: 'notice',
-  //       name: 'instation_notice',
-  //       meta: {
-  //         title: '通知管理',
-  //       },
-  //       component: () => import('@/views/instation/notice/notice.vue'),
-  //     },
-  //     {
-  //       path: 'notice/info/:id',
-  //       name: 'instation_notice_info',
-  //       meta: {
-  //         title: '查看通知',
-  //         hidden: true,
-  //       },
-  //       component: () => import('@/views/instation/notice/info.vue'),
-  //     },
-  //   ],
-  // },
-];
-
-export default routes;

+ 2 - 3
src/router/router-guards.ts

@@ -11,7 +11,7 @@ import { getRedirectUrl } from '@/utils/getRedirectUrl';
 
 const LOGIN_PATH = PageEnum.BASE_LOGIN;
 
-const whitePathList = [LOGIN_PATH]; // no redirect whitelist
+const whitePathList = [LOGIN_PATH, PageEnum.HOME_PAGE, PageEnum.BASE_HOME]; // no redirect whitelist
 
 export function createRouterGuards(router: Router) {
   const userStore = useUserStoreWidthOut();
@@ -89,8 +89,7 @@ export function createRouterGuards(router: Router) {
   router.afterEach((to, _, failure) => {
     //handleKeepAlive(to);
     document.title =
-      (to?.meta?.documentTitle ? to?.meta?.documentTitle : (to?.meta?.title as string)) ||
-      document.title;
+      (to?.meta?.documentTitle ? to?.meta?.documentTitle : (to?.meta?.title as string)) || document.title;
     if (isNavigationFailure(failure)) {
       //console.log('failed navigation', failure)
     }

+ 3 - 0
src/views/home/home.vue

@@ -0,0 +1,3 @@
+<template>
+  <div> home页面 </div>
+</template>