-
zhangwei
2025-12-19 71ae6f580c5746a93aab3e3b26122491f4c93875
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<template>
  <div class="chuany-flex chuany-justify-start chuany-align-center w-[100%]">
    <div class="chuany-flex chuany-justify-start chuany-align-center content">
      <div class="mr-20"><el-image :src="logo" style="width:192px;height:27px" /></div>
      <el-menu ellipsis class="el-menu-popper-demo chuany-flex chuany-justify-between chuany-font18" mode="horizontal" @select="goToIndex" :default-active="data.activeIndex"
        :popper-offset="16" style="width:75%">
        <el-menu-item index="/index" @click="inmenu('/index')">首页</el-menu-item>
        <el-sub-menu index="2" :popper-offset="0">
          <template #title>关于川印</template>
          <el-menu-item index="/aboutus"  @click="inmenu('/aboutus')">企业介绍</el-menu-item>
          <el-menu-item index="/qualification"  @click="inmenu('/qualification')">资质认证</el-menu-item>
          <el-menu-item index="/service" @click="inmenu('/service')">川印服务</el-menu-item>
          <el-menu-item index="/development" @click="inmenu('/development')">发展规划</el-menu-item>
        </el-sub-menu>
        <el-sub-menu index="3" :popper-offset="0">
          <template #title>业务范围</template>
          <el-menu-item index="/examination"  @click="inmenu('/examination')">试卷</el-menu-item>
          <el-menu-item index="/yiyuan" @click="inmenu('/yiyuan')">医院印刷品</el-menu-item>
          <el-menu-item index="/workbook" @click="inmenu('/workbook')">作业本</el-menu-item>
          <el-menu-item index="/assembly" @click="inmenu('/assembly')">资料汇编</el-menu-item>
          <el-menu-item index="/magazine" @click="inmenu('/magazine')">期刊杂志</el-menu-item>
          <el-menu-item index="/enrollment" @click="inmenu('/enrollment')">招生资料</el-menu-item>
          <el-menu-item index="/other" @click="inmenu('/other')">其他印刷品</el-menu-item>
        </el-sub-menu>
        <el-menu-item index="/servecustomers" @click="inmenu('/servecustomers',{id:1})">服务客户</el-menu-item>
        <el-menu-item index="/equipment" @click="inmenu('/equipment',{id:1})">设备实力</el-menu-item>
        <el-menu-item index="/join" @click="inmenu('/join',{id:1})">商务合作</el-menu-item>
      </el-menu>
      <div style="width:220px; " class="chuany-flex chuany-justify-end chuany-align-center">
      <el-menu v-if="$store().userInfo.userName"
        :default-active="$store().userInfo.userName ? $store().userInfo.userName : 2" mode="horizontal"
        @select="handleSelect">
        <el-sub-menu index="2">
          <!-- <template #title>{{userInfo.userName}}</template> -->
          <template #title>{{ $store().userInfo.nickName }}</template>
          <el-menu-item index="/member">个人中心</el-menu-item>
          <!-- <el-menu-item index="/dealer" v-if="$store().userInfo.gradeName==='经销商'">经销商中心</el-menu-item> -->
          <el-menu-item index="/orders">订单中心</el-menu-item>
          <!--<el-menu-item index="2-3">发票中心</el-menu-item> -->
          <el-menu-item index="outlogin">退出登录</el-menu-item>
        </el-sub-menu>
      </el-menu>
      <div v-else>
        <el-button type="primary" @click="loginin" round>登录</el-button>
        <!-- <el-button>
            <a href="http://ycmht.51zhengcai.com:9010/#/user/login" target="_blank">员工登录</a>
          </el-button> -->
 
      </div>
    </div>
    </div>
    
  </div>
</template>
 
 
<script setup>
const { $route, $message, $meth } = getCurrentInstance().appContext.config.globalProperties
import $store from "@/store/index.js";
import { logout } from '@/api/login.js';
import logo from '@/static/img/logo.png'
import { onMounted, ref } from 'vue';
// const props = defineProps({
//   userInfo: {
//     type: Object,
//     default: () => {
//       return {};
//     }
//   },
 
// })
onMounted(() => {
  data.activeIndex=$store().headermen
})
const data = reactive({
  activeIndex: '/index',
 
  //   userInfo: $store().userInfo
 
})
const goToIndex = (key,keypath)=>{
  console.log(key,keypath);
  data.activeIndex = key
}
const inmenu = (el, num) => {
  $meth.gourl(el, num);
  $store().sethdmen(el);
}
const emit = defineEmits(["click"])
const handleSelect = (el) => {
  // emit("click", el)
  if (el == "outlogin") {
    outlogins()
  } else {
    $meth.gourl(el)
  }
 
}
const outlogins = (el) => {
  logout().then(res => {
    if (res.status == true) {
      $store().removeuserInfo()
      $store().removeToken()
      data.userInfo = {}
      $meth.gourl("/login")
 
 
    } else {
      $message({
        message: res.msg,
        grouping: true,
        type: 'error',
      })
    }
  })
}
 
const loginin = () => {
  // sessionStorage.setItem("redirectPath", $meth.circularSafeStringify($route))
  // console.log($route);
  $meth.gourl("/tologin")
}
</script>
<style scoped lang="scss">
.el-menu--horizontal.el-menu {
  border-bottom: 0px;
}
 
.spanmenu span {
  padding-bottom: 10px;
}
 
.actived {
  border-bottom: 2px solid $main-color;
}
 
// .actived::after {
//   content: "";
//   display: block;
//   width: 20px;
//   height: 2px;
//   background:$main-color;
//   margin: 0 auto;
// }
a {
  text-decoration: none;
  color: inherit;
}
 
.el-menu-item {
  font-size: 18px;
}
 
::v-deep(.el-sub-menu__title) {
  font-size: 18px !important;
}
</style>