瀏覽代碼

页面框架搭建。

jiaxiaoqiang 5 月之前
父節點
當前提交
28713d55e2

+ 2 - 2
.env.development

@@ -2,13 +2,13 @@
 NODE_ENV='development'
 
 # 应用端口
-VITE_APP_PORT = 3005
+VITE_APP_PORT = 4001
 
 # 代理前缀
 VITE_APP_BASE_API = '/dev-api'
 
 # 线上接口地址
-# VITE_APP_API_URL = http://vapi.youlai.tech
+
 # 开发接口地址
 # VITE_APP_API_URL = 'http://192.168.101.4:8078'
 VITE_APP_API_URL = 'http://192.168.101.51:8078'

+ 1 - 1
index.html

@@ -1,5 +1,5 @@
 <!doctype html>
-<html lang="en" class="dark">
+<html lang="en" >
   <head>
     <meta charset="UTF-8" />
     <link rel="icon" href="/favicon.ico" />

+ 0 - 3
src/App.vue

@@ -34,7 +34,4 @@ const fontColor = computed(() => {
     ? "rgba(255, 255, 255, .15)"
     : "rgba(0, 0, 0, .15)";
 });
-
-//设置为深色模式
-settingsStore.changeTheme(ThemeEnum.DARK);
 </script>

+ 7 - 0
src/assets/icons/data-manager.svg

@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
+  <path fill-rule="evenodd" d="M3 2a1 1 0 0 1 1-1h11.5a1 1 0 0 1 .76.35l4.5 5.25a1 1 0 0 1 .24.65V22a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2Zm2 1v18h14V7.62L15.04 3H5Z" clip-rule="evenodd"/>
+  <path fill-rule="evenodd" d="M6.5 14a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v3.5a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1V14Zm2 1v1.5h1V15h-1Z" clip-rule="evenodd"/>
+  <path fill-rule="evenodd" d="M6 17.5a1 1 0 0 1 1-1h10a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>
+  <path fill-rule="evenodd" d="M9.5 11.5a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1v-6Zm2 1v4h1v-4h-1Z" clip-rule="evenodd"/>
+  <path fill-rule="evenodd" d="M12.5 8.998a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v8.5a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1v-8.5Zm2 1v6.5h1v-6.5h-1Z" clip-rule="evenodd"/>
+</svg>

+ 5 - 0
src/assets/icons/home.svg

@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
+  <path fill-rule="evenodd" d="M11.375 2.22a1 1 0 0 1 1.25 0l7.5 6A1 1 0 0 1 20.5 9v12a1 1 0 0 1-1 1h-15a1 1 0 0 1-1-1V9a1 1 0 0 1 .375-.78l7.5-6ZM5.5 9.48V20h13V9.48L12 4.28l-6.5 5.2Z" clip-rule="evenodd"/>
+  <path fill-rule="evenodd" d="M8.5 14.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1V21a1 1 0 0 1-1 1h-5a1 1 0 0 1-1-1v-6.5Zm2 1V20h3v-4.5h-3Z" clip-rule="evenodd"/>
+  <path d="M4.5 21h15"/>
+</svg>

文件差異過大導致無法顯示
+ 7 - 0
src/assets/icons/person-manager.svg


+ 4 - 0
src/assets/icons/project-config.svg

@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
+  <path fill-rule="evenodd" d="M5.5 7.002a1 1 0 0 1 1 1v13a1 1 0 0 1-2 0v-13a1 1 0 0 1 1-1Zm6.5 6.5a1 1 0 0 1 1 1v6.5a1 1 0 0 1-2 0v-6.5a1 1 0 0 1 1-1ZM12 2a1 1 0 0 1 1 1v6.5a1 1 0 1 1-2 0V3a1 1 0 0 1 1-1Zm6.5 0a1 1 0 0 1 1 1v13a1 1 0 1 1-2 0V3a1 1 0 0 1 1-1Z" clip-rule="evenodd"/>
+  <path fill-rule="evenodd" d="M2 5.5a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0ZM5.5 4a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm3 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0Zm3.5-1.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm3 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0Zm3.5-1.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z" clip-rule="evenodd"/>
+</svg>

+ 5 - 0
src/assets/icons/report-template.svg

@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
+  <path fill-rule="evenodd" d="M4.5 4a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .5.5h15a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-15ZM2 4.5A2.5 2.5 0 0 1 4.5 2h15A2.5 2.5 0 0 1 22 4.5v15a2.5 2.5 0 0 1-2.5 2.5h-15A2.5 2.5 0 0 1 2 19.5v-15Z" clip-rule="evenodd"/>
+  <path fill-rule="evenodd" d="M2 7a1 1 0 0 1 1-1h17a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1Zm12 4a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm0 4.002a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1ZM10.5 11a1 1 0 0 1 1-1h.5a1 1 0 1 1 0 2h-.5a1 1 0 0 1-1-1Zm0 4.002a1 1 0 0 1 1-1h.5a1 1 0 1 1 0 2h-.5a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>
+  <path fill-rule="evenodd" d="M7 2a1 1 0 0 1 1 1v18a1 1 0 1 1-2 0V3a1 1 0 0 1 1-1Z" clip-rule="evenodd"/>
+</svg>

+ 6 - 0
src/assets/icons/run-test.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
+  <path fill-rule="evenodd" d="M12 1a1 1 0 0 1 1 1v8.5a1 1 0 1 1-2 0V2a1 1 0 0 1 1-1Z" clip-rule="evenodd"/>
+  <path fill-rule="evenodd" d="M1 12C1 5.925 5.925 1 12 1a1 1 0 1 1 0 2 9 9 0 1 0 9 9 8.957 8.957 0 0 0-1.893-5.522 1 1 0 1 1 1.579-1.229A10.956 10.956 0 0 1 23 12c0 6.075-4.925 11-11 11S1 18.075 1 12Z" clip-rule="evenodd"/>
+  <path fill-rule="evenodd" d="M5.5 12A6.5 6.5 0 0 1 12 5.5a1 1 0 1 1 0 2 4.5 4.5 0 1 0 3.554 1.739 1 1 0 0 1 1.578-1.228A6.5 6.5 0 1 1 5.5 12Z" clip-rule="evenodd"/>
+  <path fill-rule="evenodd" d="M12 11.498a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Zm-2.5.5a2.5 2.5 0 1 1 5 0 2.5 2.5 0 0 1-5 0Z" clip-rule="evenodd"/>
+</svg>

+ 1 - 1
src/main.ts

@@ -10,7 +10,7 @@ import "virtual:svg-icons-register";
 
 // 样式
 import "element-plus/dist/index.css";
-import "element-plus/theme-chalk/dark/css-vars.css";
+// import "element-plus/theme-chalk/dark/css-vars.css";
 import "@/styles/index.scss";
 import "uno.css";
 

+ 28 - 20
src/router/index.ts

@@ -32,35 +32,43 @@ export const constantRoutes: RouteRecordRaw[] = [
         component: () => import("@/views/modules/home/home.vue"),
       },
       {
-        path: "work-bench",
-        component: () => import("@/views/modules/workbench/workBench.vue"),
+        path: "run-test",
+        component: () => import("@/views/modules/runTest/run-test.vue"),
       },
       {
-        path: "devices",
-        component: () => import("@/views/modules/devices/devs.vue"),
+        path: "data-manager",
+        component: () =>
+          import("@/views/modules/data-manager/data-manager.vue"),
       },
       {
-        path: "apps",
-        component: () => import("@/views/modules/applications/apps.vue"),
+        path: "project-config",
+        component: () =>
+          import("@/views/modules/project-config/project-config.vue"),
       },
       {
-        path: "work-shop",
-        component: () => import("@/views/modules/workshop/workShop.vue"),
+        path: "report-template",
+        component: () =>
+          import("@/views/modules/report-template/report-template.vue"),
+      },
+      {
+        path: "person-manager",
+        component: () =>
+          import("@/views/modules/person-manager/person-manager.vue"),
       },
     ],
   },
-  {
-    path: "/test",
-    component: () => import("@/views/modules/home/test/test.vue"),
-    meta: { hidden: true },
-    // redirect: "/main/home",
-    // children: [
-    //   {
-    //     path: "test1",
-    //     component: () => import("@/views/modules/home/home.vue"),
-    //   },
-    // ],
-  },
+  // {
+  // path: "/test",
+  // component: () => import("@/views/modules/home/test/test.vue"),
+  // meta: { hidden: true },
+  // redirect: "/main/home",
+  // children: [
+  //   {
+  //     path: "test1",
+  //     component: () => import("@/views/modules/home/home.vue"),
+  //   },
+  // ],
+  // },
   {
     path: "/login",
     component: () => import("@/views/demo/test-dark.vue"),

+ 1 - 1
src/settings.ts

@@ -8,7 +8,7 @@ const defaultSettings: AppSettings = {
   fixedHeader: true,
   sidebarLogo: true,
   layout: "left",
-  theme: "dark",
+  theme: "light",
   size: "default",
   language: "zh-cn",
   themeColor: "#409EFF",

+ 3 - 5
src/styles/index.scss

@@ -29,12 +29,10 @@
 
 .mainContentBox {
   width: 100%;
-  height: calc(100% - 10px);
+  height: calc(100vh - 48px);
   padding: 10px;
-  margin-bottom: 6px;
-  overflow-x: auto;
-  background-color: white;
-  border-radius: 10px;
+  overflow: auto;
+  border: 2px solid black;
 }
 
 //二级页面公共样式,上下结构,上面是childHeader

+ 6 - 47
src/styles/variables.scss

@@ -15,7 +15,7 @@
   --hj-blue-3: #096dd9;
   --hj-purple-3: #531dab;
   --hj-white-3: #d9d9d9;
-  --hj-black-3: #303030;
+
 
   --hj-red-2: #ff7a7a;
   --hj-orange-2: #faa31a;
@@ -38,6 +38,8 @@
 
   --hj-black-1: #1a1a1a;
   --hj-black-2: #303030;
+  --hj-black-3: #404040;
+
 
   --hj-bg: #fff;
 
@@ -45,55 +47,11 @@
   --fc-color-default: #000000;
   --fc-color-1: #00000090;
   --fc-color-2: #00000060;
+
+  --gray-bg-1: #F1F3F5
 }
 
-/** 暗黑主题 */
-html.dark {
-  --menu-background: var(--el-bg-color-overlay);
-  --menu-text: #fff;
-  --menu-active-text: var(--el-menu-active-color);
-  --menu-hover: rgb(0 0 0 / 20%);
-  --sidebar-logo-background: rgb(0 0 0 / 20%);
-
-  --hj-red-3: #822c2c;
-  --hj-orange-3: #8a590f;
-  --hj-yellow-3: #8a7000;
-  --hj-green-3: #426e32;
-  --hj-cyan-3: #005f43;
-  --hj-blue-3: #003d7a;
-  --hj-purple-3: #3b005c;
-  --hj-white-3: #7a7a7a;
-  --hj-black-3: #1a1a1a;
-
-  --hj-red-2: #a14141;
-  --hj-orange-2: #b26a10;
-  --hj-yellow-2: #b28200;
-  --hj-green-2: #57854a;
-  --hj-cyan-2: #007655;
-  --hj-blue-2: #005199;
-  --hj-purple-2: #4b0072;
-
-  --hj-red-1: #c15a5a;
-  --hj-orange-1: #c27a10;
-  --hj-yellow-1: #c29000;
-  --hj-green-1: #68995c;
-  --hj-cyan-1: #008e6a;
-  --hj-blue-1: #006ac2;
-  --hj-purple-1: #5a178b;
-
-  --hj-white-1: #f0f0f0;
-  --hj-white-2: #d9d9d9;
-
-  --hj-black-1: #303030;
-  --hj-black-2: #424242;
-
-  --hj-bg: #000;
 
-  //字体颜色
-  --fc-color-default: #ffffff;
-  --fc-color-1: #ffffff;
-  --fc-color-2: #ffffff;
-}
 
 $menu-background: var(--menu-background); // 菜单背景色
 $menu-text: var(--menu-text); // 菜单文字颜色
@@ -106,6 +64,7 @@ $sidebar-width-collapsed: 54px; // 侧边栏收缩宽度
 $navbar-height: 50px; // 导航栏高度
 $tags-view-height: 34px; // TagsView 高度
 
+$main-header-height: 48px; // 主页面上面的header的高度
 //二级页面上面的header的高度
 $child-header-height: 116px;
 

+ 13 - 0
src/views/main/components/header.vue

@@ -0,0 +1,13 @@
+<script setup lang="ts"></script>
+
+<template>
+  <div class="main-header">dd</div>
+</template>
+
+<style scoped lang="scss">
+.main-header {
+  width: 100%;
+  height: $main-header-height;
+  background-color: $hj-white-1;
+}
+</style>

+ 3 - 3
src/views/main/components/layout.vue

@@ -3,7 +3,7 @@
 <template>
   <div class="layout">
     <router-view v-slot="{ Component }">
-      <transition name="fade" mode="out-in" appear>
+      <transition name="fade" appear>
         <component :is="Component" />
       </transition>
     </router-view>
@@ -12,9 +12,9 @@
 
 <style scoped lang="scss">
 .layout {
-  height: 100%;
+  height: calc(100vh - $main-header-height);
   flex: 1;
-  border: 2px solid #0d9f12;
+  background-color: var(--gray-bg-1);
 }
 
 .fade-leave-active,

+ 42 - 29
src/views/main/components/menu.vue

@@ -12,25 +12,29 @@ const menus = ref<MenuItem[]>([
     route: "/main/home",
   },
   {
-    name: "工作台",
-    icon: "work-bench",
-    route: "/main/work-bench",
+    name: "测试执行",
+    icon: "run-test",
+    route: "/main/run-test",
   },
   {
-    name: "设备",
-    name: "设备",
-    icon: "devices",
-    route: "/main/devices",
+    name: "数据管理",
+    icon: "data-manager",
+    route: "/main/data-manager",
   },
   {
-    name: "应用",
-    icon: "apps",
-    route: "/main/apps",
+    name: "工程配置",
+    icon: "project-config",
+    route: "/main/project-config",
   },
   {
-    name: "车间",
-    icon: "work-shop",
-    route: "/main/work-shop",
+    name: "报告魔板",
+    icon: "report-template",
+    route: "/main/report-template",
+  },
+  {
+    name: "人员管理",
+    icon: "person-manager",
+    route: "/main/person-manager",
   },
 ]);
 const currentMenu = ref<MenuItem>(menus.value[0]);
@@ -53,12 +57,19 @@ const handleMenuClick = (menu: MenuItem) => {
       @click="handleMenuClick(menu)"
     >
       <!--      这里的图标可以用可变色的svg 传过去一个color属性,然后根据当前路由的颜色来显示不同的颜色-->
-      <div class="icon">{{ menu.icon }}</div>
+
+      <svg-icon
+        :icon-class="menu.icon"
+        :size="24"
+        :style="{
+          color: menu.route === currentMenu.route ? 'white' : '#AFB9D0',
+        }"
+      />
       <div
         class="name"
         :class="[menu.route === currentMenu.route ? 'selected' : 'normal']"
       >
-        {{ menu.name }} {{ menu.route === currentMenu.route ? "▲" : "" }}
+        {{ menu.name }}
       </div>
     </div>
   </div>
@@ -66,37 +77,39 @@ const handleMenuClick = (menu: MenuItem) => {
 
 <style scoped lang="scss">
 .menu {
-  height: 100%;
-  width: 150px;
-  border: 2px solid blue;
+  height: calc(100vh - $main-header-height);
+  width: 79px;
+
   display: flex;
   flex-direction: column;
-  justify-content: space-around;
+  justify-content: start;
   align-items: center;
-  padding: 150px 45px;
+  padding: 12px 6px;
+  background-color: $hj-black-3;
 
   .menu-box {
-    width: 60px;
+    width: 64px;
+    height: 64px;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
 
-    .icon {
-      width: 60px;
-      height: 60px;
-      border: 1px solid #0a84ff;
-    }
+    margin-bottom: 12px;
 
     .name {
       margin-top: 10px;
       font-weight: bold;
-      font-size: 16px;
+      font-size: 12px;
       line-height: 19px;
       text-align: center;
     }
 
     .normal {
-      color: $hj-white-1;
+      color: #afb9d0;
     }
     .selected {
-      color: $hj-blue-1;
+      color: $hj-white-1;
     }
   }
 }

+ 11 - 6
src/views/main/main.vue

@@ -1,12 +1,16 @@
 <script setup lang="ts">
 import Menu from "./components/menu.vue";
 import Layout from "./components/layout.vue";
+import Header from "./components/header.vue";
 </script>
 
 <template>
   <div class="main">
-    <Menu />
-    <Layout> </Layout>
+    <Header></Header>
+    <div class="content">
+      <Menu />
+      <Layout> </Layout>
+    </div>
   </div>
 </template>
 
@@ -14,10 +18,11 @@ import Layout from "./components/layout.vue";
 .main {
   width: 100%;
   height: 100%;
-  display: flex;
-  justify-content: start;
-  align-items: center;
-  border: 2px solid red;
   background: $hj-bg;
+  .content {
+    display: flex;
+    justify-content: start;
+    align-items: center;
+  }
 }
 </style>

+ 0 - 9
src/views/modules/applications/apps.vue

@@ -1,9 +0,0 @@
-<script setup lang="ts"></script>
-
-<template>
-  <div class="apps">
-    <h1>Applications</h1>
-  </div>
-</template>
-
-<style scoped lang="scss"></style>

+ 0 - 26
src/views/modules/components/ChildHeader.vue

@@ -1,26 +0,0 @@
-<script setup lang="ts">
-const router = useRouter();
-const back = () => {
-  router.back();
-};
-</script>
-
-<template>
-  <div class="child-header">
-    <div @click="back">
-      <div>返回</div>
-    </div>
-    <div class="right-slot">
-      <slot></slot>
-    </div>
-  </div>
-</template>
-
-<style scoped lang="scss">
-.right-slot {
-  display: flex;
-  align-items: center;
-  justify-content: flex-end;
-  gap: 20px;
-}
-</style>

+ 5 - 0
src/views/modules/data-manager/data-manager.vue

@@ -0,0 +1,5 @@
+<script setup lang="ts"></script>
+
+<template><div>data-manager</div></template>
+
+<style scoped lang="scss"></style>

+ 0 - 9
src/views/modules/devices/devs.vue

@@ -1,9 +0,0 @@
-<script setup lang="ts"></script>
-
-<template>
-  <div class="devs">
-    <h1>Devices</h1>
-  </div>
-</template>
-
-<style scoped lang="scss"></style>

+ 2 - 10
src/views/modules/home/home.vue

@@ -1,15 +1,7 @@
-<script setup lang="ts">
-const router = useRouter();
-const gotoTest = () => {
-  router.push("/test");
-};
-</script>
+<script setup lang="ts"></script>
 
 <template>
-  <div class="home">
-    <h1>Welcome to Home Page</h1>
-    <el-button type="primary" @click="gotoTest">Go to Test Page</el-button>
-  </div>
+  <div class="mainContentBox">dfdfas</div>
 </template>
 
 <style scoped lang="scss"></style>

+ 0 - 19
src/views/modules/home/test/test.vue

@@ -1,19 +0,0 @@
-<script setup lang="ts">
-import ChildHeader from "@/views/modules/components/ChildHeader.vue";
-</script>
-
-<template>
-  <div class="child-page-container">
-    <ChildHeader>
-      <template #default>
-        <el-tag>测试页面</el-tag>
-        <div>右侧功能</div>
-      </template>
-    </ChildHeader>
-    <div class="child-bottom">
-      <h1>This is the test page</h1>
-    </div>
-  </div>
-</template>
-
-<style scoped lang="scss"></style>

+ 5 - 0
src/views/modules/person-manager/person-manager.vue

@@ -0,0 +1,5 @@
+<script setup lang="ts"></script>
+
+<template>person-manager</template>
+
+<style scoped lang="scss"></style>

+ 5 - 0
src/views/modules/project-config/project-config.vue

@@ -0,0 +1,5 @@
+<script setup lang="ts"></script>
+
+<template>project-config</template>
+
+<style scoped lang="scss"></style>

+ 5 - 0
src/views/modules/report-template/report-template.vue

@@ -0,0 +1,5 @@
+<script setup lang="ts"></script>
+
+<template>report-template</template>
+
+<style scoped lang="scss"></style>

+ 5 - 0
src/views/modules/runTest/run-test.vue

@@ -0,0 +1,5 @@
+<script setup lang="ts"></script>
+
+<template>runtest</template>
+
+<style scoped lang="scss"></style>

+ 0 - 9
src/views/modules/workbench/workBench.vue

@@ -1,9 +0,0 @@
-<script setup lang="ts"></script>
-
-<template>
-  <div class="workbench">
-    <h1>Workbench</h1>
-  </div>
-</template>
-
-<style scoped lang="scss"></style>

+ 0 - 9
src/views/modules/workshop/workShop.vue

@@ -1,9 +0,0 @@
-<script setup lang="ts"></script>
-
-<template>
-  <div class="workshop">
-    <h1>Workshop</h1>
-  </div>
-</template>
-
-<style scoped lang="scss"></style>