Bläddra i källkod

feat:项目配置文件

lvkun996 3 år sedan
förälder
incheckning
14e73f6e46

+ 5 - 0
config/app.ts

@@ -0,0 +1,5 @@
+/**
+ *
+ * @description 整个项目基础配置
+ *
+ */

+ 11 - 0
config/defaultSetting.ts

@@ -0,0 +1,11 @@
+
+/**
+ * @description 项目默认配置
+ */
+
+export default {
+  docTitle: 'jjl',
+  docLogo: '',
+  title: '',
+  logo: ''
+}

+ 14 - 0
config/proxy.ts

@@ -0,0 +1,14 @@
+
+/**
+ * @description 项目代理配置
+ */
+
+export default {
+  dev: {
+    '/api': {
+      target: 'your target network address',
+      changeOrigin: true,
+      pathRewrite: { '^/api': '' }
+    }
+  }
+}

+ 1 - 1
public/index.html

@@ -4,7 +4,7 @@
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+    <!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico"> -->
     <title><%= htmlWebpackPlugin.options.title %></title>
   </head>
   <body>

+ 13 - 0
src/components/ModalPro/index.vue

@@ -0,0 +1,13 @@
+<template>
+
+  <a-row></a-row>
+
+</template>
+
+<script lang="ts" setup >
+
+</script>
+
+<style>
+
+</style>

+ 4 - 0
src/components/Row/index.vue

@@ -0,0 +1,4 @@
+<template>
+  <a-row>
+  </a-row>
+</template>

+ 9 - 0
src/components/TablePro/index.vue

@@ -0,0 +1,9 @@
+<template>
+  <div></div>
+</template>
+
+<script lang="ts" setup >
+</script>
+
+<style>
+</style>

+ 3 - 3
src/layout/sider.vue

@@ -5,7 +5,7 @@
             :trigger="null"
             v-model:collapsed="collapsed"
             collapsible
-            style="background: #fff; height: 92.5%;"
+            style="background: #fff; height: 95%;"
             breakpoint="lg"
             @collapse="onCollapse"
             @breakpoint="onBreakpoint"
@@ -36,8 +36,8 @@
           </a-menu>
         </a-layout-sider>
         <div class="control" >
-          <menu-fold-outlined @click="collapsed = true" v-if="!collapsed" style="font-size: 30px;cursor: pointer;" />
-          <menu-unfold-outlined  @click="collapsed = false" v-else style="font-size: 30px;cursor: pointer;" />
+          <menu-fold-outlined @click="collapsed = true" v-if="!collapsed" style="font-size: 26px;cursor: pointer;" />
+          <menu-unfold-outlined  @click="collapsed = false" v-else style="font-size: 26px;cursor: pointer;" />
         </div>
     </a-col>
   </a-row>

+ 3 - 4
src/router/index.ts

@@ -1,16 +1,15 @@
-import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
+import { createRouter, createWebHistory } from 'vue-router'
 
-const routes: Array<RouteRecordRaw> = [
+const routes: Array<ROUTER.RoutesProps> = [
   {
     path: '/',
     name: '首页',
+    title: '首页',
     component: () => import('@/layout/layout.vue'),
-    redirect: '/dashboard',
     children: [
       {
         path: '/dashboard',
         name: '仪表盘',
-        redirect: '/dashboard-item',
         component: () => import('@/pages/Dashboard/index.vue'),
         children: [
           {

+ 5 - 7
src/store/router.ts

@@ -17,7 +17,7 @@ import { useRoute } from 'vue-router'
 
 const emitter = useEmitter()
 
-const initAppRouterState: Router.RouterRecords = {
+const initAppRouterState: ROUTER.RouterRecords = {
   navbar: {
     route: [],
     selectPath: ''
@@ -29,11 +29,9 @@ const initAppRouterState: Router.RouterRecords = {
   }
 }
 export const useAppRouter = defineStore(ConstantStore.ROUTER, () => {
-  let appRouter = reactive<Router.RouterRecords>(initAppRouterState)
+  let appRouter = reactive<ROUTER.RouterRecords>(initAppRouterState)
 
-  const route = useRoute()
-
-  const [appRouterState, setAppRouterState] = useLocalStorageState<Router.RouterRecords>(AppRouterEnum.ROUTER, {
+  const [appRouterState, setAppRouterState] = useLocalStorageState<ROUTER.RouterRecords>(AppRouterEnum.ROUTER, {
     defaultValue: initAppRouterState
   })
 
@@ -63,7 +61,7 @@ export const useAppRouter = defineStore(ConstantStore.ROUTER, () => {
     () => RootRouter.currentRoute.value.path,
     () => {
       appRouter.sider = {
-        route: RootRouter.getRoutes().find(item => item.path === appRouter.navbar!.selectPath)?.children as Router.RoutesProps[],
+        route: RootRouter.getRoutes().find(item => item.path === appRouter.navbar!.selectPath)?.children as ROUTER.RoutesProps[],
         selectPath: RootRouter.currentRoute.value.path,
         openKeys: [RootRouter.currentRoute.value.matched[1].path]
       }
@@ -72,7 +70,7 @@ export const useAppRouter = defineStore(ConstantStore.ROUTER, () => {
     }
   )
 
-  appRouter = appRouterState.value as Router.RouterRecords
+  appRouter = appRouterState.value as ROUTER.RouterRecords
 
   if (appRouter.navbar.route.length === 0) {
     initAppRouter()

+ 1 - 1
src/typeing.d.ts

@@ -1,4 +1,4 @@
-declare namespace Router {
+declare namespace ROUTER {
 
   type RoutesProps = RouteRecordRaw & {
     title: string