zhanghaijun 1 vuosi sitten
vanhempi
commit
10d7dcc6cc

+ 2 - 11
eslint.config.mjs

@@ -15,9 +15,7 @@ const __filename = fileURLToPath(import.meta.url)
 const __dirname = dirname(__filename)
 
 // 读取 .auto-import.json 文件的内容,并将其解析为 JSON 对象
-const autoImportConfig = JSON.parse(
-  fs.readFileSync(path.resolve(__dirname, '.auto-import.json'), 'utf-8')
-)
+const autoImportConfig = JSON.parse(fs.readFileSync(path.resolve(__dirname, '.auto-import.json'), 'utf-8'))
 
 export default [
   // 指定文件匹配规则
@@ -75,14 +73,7 @@ export default [
   },
   // 忽略文件
   {
-    ignores: [
-      'node_modules',
-      'dist',
-      'public',
-      '.vscode/**',
-      'src/assets/**',
-      'src/utils/console.ts'
-    ]
+    ignores: ['node_modules', 'dist', 'public', '.vscode/**', 'src/assets/**', 'src/utils/console.ts']
   },
   // prettier 配置
   eslintPluginPrettierRecommended

+ 0 - 7
src/router/routes/staticRoutes.ts

@@ -10,13 +10,6 @@ import { RoutesAlias } from '../routesAlias'
  * 2、不需要登录就能访问的路由,在 meta 中添加 noLogin: true
  */
 export const staticRoutes: AppRouteRecordRaw[] = [
-  // 不需要登录就能访问的路由示例
-  // {
-  //   path: '/welcome',
-  //   name: 'WelcomeStatic',
-  //   component: () => import('@views/dashboard/console/index.vue'),
-  //   meta: { title: 'menus.dashboard.title', noLogin: true }
-  // },
   {
     path: RoutesAlias.Login,
     name: 'Login',

+ 1 - 3
src/router/utils/menuToRouter.ts

@@ -91,9 +91,7 @@ const validateComponent = (route: AppRouteRecord, parentPath: string): void => {
 
   // 一级菜单:必须指定 Layout,除非是外链
   if (parentPath === '' && !hasExternalLink) {
-    console.error(
-      `[路由错误] 一级菜单(${routePath}) 缺少 component,必须指向 ${RoutesAlias.Layout}`
-    )
+    console.error(`[路由错误] 一级菜单(${routePath}) 缺少 component,必须指向 ${RoutesAlias.Layout}`)
     return
   }
 

+ 14 - 35
src/views/dashboard/console/index.vue

@@ -1,44 +1,23 @@
 <template>
-  <div class="console">
-    <CardList></CardList>
+  <div class="flex items-center justify-center bg-gray-50">
+    <div class="train_card grid auto-rows-[200px] grid-cols-[repeat(4,200px)] gap-4">
+      <!-- 教员培训 -->
+      <div class="col-span-2 row-span-2 flex items-center justify-center rounded-2xl bg-green-500 text-xl font-bold text-white shadow-md"> 教员培训 </div>
 
-    <el-row :gutter="20">
-      <el-col :sm="24" :md="12" :lg="10">
-        <ActiveUser />
-      </el-col>
-      <el-col :sm="24" :md="12" :lg="14">
-        <SalesOverview />
-      </el-col>
-    </el-row>
+      <!-- 课程编辑 -->
+      <div class="col-span-2 flex items-center justify-center rounded-2xl bg-purple-500 text-lg font-semibold text-white shadow-md"> 课程编辑 </div>
 
-    <el-row :gutter="20">
-      <el-col :sm="24" :md="24" :lg="12">
-        <NewUser />
-      </el-col>
-      <el-col :sm="24" :md="12" :lg="6">
-        <Dynamic />
-      </el-col>
-      <el-col :sm="24" :md="12" :lg="6">
-        <TodoList />
-      </el-col>
-    </el-row>
+      <!-- 故障管理 -->
+      <div class="flex items-center justify-center rounded-2xl bg-teal-500 text-lg font-semibold text-white shadow-md"> 故障管理 </div>
+
+      <!-- 评价中心 -->
+      <div class="flex aspect-square items-center justify-center rounded-2xl bg-rose-500 text-lg font-semibold text-white shadow-md"> 评价中心 </div>
+    </div>
   </div>
 </template>
 
 <script setup lang="ts">
-  import CardList from './widget/CardList.vue'
-  import ActiveUser from './widget/ActiveUser.vue'
-  import SalesOverview from './widget/SalesOverview.vue'
-  import NewUser from './widget/NewUser.vue'
-  import Dynamic from './widget/Dynamic.vue'
-  import TodoList from './widget/TodoList.vue'
-  import { useCommon } from '@/composables/useCommon'
-
-  defineOptions({ name: 'Console' })
-
-  useCommon().scrollToTop()
+  defineOptions({ name: 'TrainConsole' })
 </script>
 
-<style lang="scss" scoped>
-  @use './style';
-</style>
+<style lang="scss" scoped></style>

+ 44 - 0
src/views/dashboard/console/index2.vue

@@ -0,0 +1,44 @@
+<template>
+  <div class="console">
+    <CardList></CardList>
+
+    <el-row :gutter="20">
+      <el-col :sm="24" :md="12" :lg="10">
+        <ActiveUser />
+      </el-col>
+      <el-col :sm="24" :md="12" :lg="14">
+        <SalesOverview />
+      </el-col>
+    </el-row>
+
+    <el-row :gutter="20">
+      <el-col :sm="24" :md="24" :lg="12">
+        <NewUser />
+      </el-col>
+      <el-col :sm="24" :md="12" :lg="6">
+        <Dynamic />
+      </el-col>
+      <el-col :sm="24" :md="12" :lg="6">
+        <TodoList />
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script setup lang="ts">
+  import CardList from './widget/CardList.vue'
+  import ActiveUser from './widget/ActiveUser.vue'
+  import SalesOverview from './widget/SalesOverview.vue'
+  import NewUser from './widget/NewUser.vue'
+  import Dynamic from './widget/Dynamic.vue'
+  import TodoList from './widget/TodoList.vue'
+  import { useCommon } from '@/composables/useCommon'
+
+  defineOptions({ name: 'Console' })
+
+  useCommon().scrollToTop()
+</script>
+
+<style lang="scss" scoped>
+  @use './style';
+</style>