guoyujie
2025-10-21 60087945430822537743764af5ca1b5987469aef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<script setup lang="ts">
import OrderUnfinishedView from '@/views/order/OrderUnfinishedView.vue'
import {Expand,CloseBold} from "@element-plus/icons-vue";
import {useRouter,useRoute } from 'vue-router'
import {ref} from "vue";
import userInfo from '@/stores/userInfo'
const activeIndex = ref('1')
const router = useRouter()
const user=userInfo()
 
 
const handleSelect = (key: string, keyPath: string[]) => {
  router.push({
    path:`/${key}`,
  })
}
 
</script>
 
<template>
  <div id="main-div">
    <el-container>
      <el-header>
        <el-menu
            :default-active="activeIndex"
            class="el-menu-demo"
            mode="horizontal"
            :ellipsis="false"
            @select="handleSelect"
        >
          <el-menu-item  >
            <img
                style="width: 5rem"
                src="../assets/northGlass.ico"
                alt="Element logo"
            />
            <el-text
                :truncated="true"
                style="margin-left: 1rem;font-weight: bolder;width: 40vw">
              {{user.user.customerName}}
            </el-text>
          </el-menu-item>
 
 
 
          <el-sub-menu index="2">
            <template #title><el-icon><Expand /></el-icon></template>
            <el-menu-item index="orderUnfinished">生产订单</el-menu-item>
            <el-menu-item index="orderHistory">历史订单</el-menu-item>
            <el-menu-item v-if="user.user.loginName==='admin'" index="register">客户注册</el-menu-item>
            <el-menu-item index=""><el-icon><CloseBold /></el-icon></el-menu-item>
          </el-sub-menu>
        </el-menu>
      </el-header>
      <el-main >
        <router-view></router-view>
      </el-main>
    </el-container>
  </div>
 
</template>
 
<style scoped>
#main-div{
  width: 100vw;
  height: 100vh;
}
.el-menu--horizontal > .el-menu-item:nth-child(1) {
  margin-right: auto;
}
*{
  margin: 0;
  padding: 0;
}
 
.el-header{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}
.el-main{
  margin-top: 5rem;
  width: 100vw;
  height: calc(100vh - 5rem);
}
 
 
</style>