|
@@ -5,41 +5,35 @@
|
|
|
<!--页面头部(上边)-->
|
|
|
<el-header>
|
|
|
<div class="admin-logo-container">
|
|
|
- <!-- <img
|
|
|
- class="admin-logo"
|
|
|
- src="../assets/img/admin.jpg"
|
|
|
- alt=""
|
|
|
- > -->
|
|
|
- <span>安徽省农产品质量安全监测系统</span>
|
|
|
- </div>
|
|
|
- <div class="right-function-container">
|
|
|
- <el-button type="text" style="color:#FFFFFF" size="medium" @click="getAccount()">个人中心</el-button>
|
|
|
- <el-button @click="logout">
|
|
|
- 退 出
|
|
|
- </el-button>
|
|
|
+ <span>安徽省农产品质量安全监测系统-监管平台</span>
|
|
|
</div>
|
|
|
</el-header>
|
|
|
+ <!-- 页面个人中心 -->
|
|
|
+ <div class="hello">
|
|
|
+ <span>您好,监管部门!--{{name}}</span>
|
|
|
+ <div class="btn">
|
|
|
+ <el-button class="btns" @click="userInform()" size="mini">个人信息</el-button>
|
|
|
+ <el-button class="btns" @click="logout" size="mini">退出</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<!--页面主体部分-->
|
|
|
<el-container>
|
|
|
+
|
|
|
<!--页面侧边栏(左边)-->
|
|
|
<el-aside style="width: 210px;">
|
|
|
<!-- 页面左侧菜单区域-->
|
|
|
<el-menu :default-active="$route.path" background-color="#EEF1F6" text-color="#48576a"
|
|
|
- active-text-color="#31B404" :collapse-transition="false" :router="true">
|
|
|
- <!-- :unique-opened="true" -->
|
|
|
- <!-- <el-menu-item
|
|
|
- index="/admin"
|
|
|
- @click="addTab('系统首页', '/admin')"
|
|
|
- >
|
|
|
- <i class="el-icon-s-home" />
|
|
|
- <span slot="title">系统首页</span>
|
|
|
- </el-menu-item> -->
|
|
|
+ active-text-color="#187bdd" :collapse-transition="false" :router="true">
|
|
|
+ <!-- <el-menu-item index="/admin" @click="addTab('首页', '/admin')">
|
|
|
+ <i class="el-icon-s-home" />
|
|
|
+ <span slot="title">首页</span>
|
|
|
+ </el-menu-item> -->
|
|
|
<!-- 一级菜单-->
|
|
|
<el-submenu :index="index+''" v-for="(item, index) in menuList" :key="index">
|
|
|
<!-- 一级菜单模板区-->
|
|
|
<template slot="title">
|
|
|
<!-- 图标-->
|
|
|
- <i :class="item.icon" />
|
|
|
+ <!-- <i :class="item.icon" /> -->
|
|
|
<!-- 文本-->
|
|
|
<span>{{ item.subMenuName }}</span>
|
|
|
</template>
|
|
@@ -65,7 +59,7 @@
|
|
|
<el-container>
|
|
|
<el-main>
|
|
|
<el-card shadow="always">
|
|
|
- <!-- 内容显示-->
|
|
|
+ <!--内容显示-->
|
|
|
<router-view :key="item.name" />
|
|
|
</el-card>
|
|
|
</el-main>
|
|
@@ -83,6 +77,7 @@
|
|
|
name: 'Admin',
|
|
|
data() {
|
|
|
return {
|
|
|
+ name:'',
|
|
|
lastTime: null, // 最后一次点击的时间
|
|
|
currentTime: null, // 当前点击的时间
|
|
|
timeOut: 30 * 60 * 1000, // 设置超时时间: 30分钟
|
|
@@ -94,42 +89,27 @@
|
|
|
menuList: []
|
|
|
}
|
|
|
},
|
|
|
- // watch: {
|
|
|
- // /** 监听,当路由发生变化的时候执行(防止用户手动更换地址导致tabs的面板变动却不切换相应的tabs) */
|
|
|
- // '$route.path': function() {
|
|
|
- // var iindex = -1
|
|
|
- // var jindex = -1
|
|
|
- // for (let i = 0; i < this.menuList.length; i++) {
|
|
|
- // for (let j = 0; j < this.menuList[i].children.length; j++) {
|
|
|
- // if (this.menuList[i].children[j].path == this.$route.path) {
|
|
|
- // iindex = i
|
|
|
- // jindex = j
|
|
|
- // break
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // this.addTab(this.menuList[iindex].children[jindex].subMenuName, this.$route.path)
|
|
|
- // }
|
|
|
- // },
|
|
|
+
|
|
|
created() {
|
|
|
+ this.getAccount()
|
|
|
this.lastTime = new Date().getTime() // 网页第一次打开时,记录当前时间
|
|
|
// 保证admin中的页面刷新后重置到/admin路由下
|
|
|
if (this.$route.path !== '/admin/routineMonitor') this.$router.push('/admin/routineMonitor')
|
|
|
let groupname = window.sessionStorage.getItem('groupname')
|
|
|
let data1 = []
|
|
|
let data = [
|
|
|
- // {
|
|
|
- // // icon: 'el-icon-user-solid',
|
|
|
- // subMenuName: '监测模型',
|
|
|
- // children: [{
|
|
|
- // id: '1-1',
|
|
|
- // subMenuName: '模型配置',
|
|
|
- // path: '/admin/'
|
|
|
- // }]
|
|
|
- // },
|
|
|
{
|
|
|
// icon: 'el-icon-user-solid',
|
|
|
- subMenuName: '主体信息管理',
|
|
|
+ subMenuName: '首页',
|
|
|
+ children: [{
|
|
|
+ id: '6-1',
|
|
|
+ subMenuName: '控制台',
|
|
|
+ path: '/admin/Console'
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // icon: 'el-icon-user-solid',
|
|
|
+ subMenuName: '机构查询',
|
|
|
children: [{
|
|
|
id: '4-1',
|
|
|
subMenuName: '检测机构',
|
|
@@ -141,30 +121,6 @@
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
-
|
|
|
- // subMenuName: '主体管理',
|
|
|
- // children: [{
|
|
|
- // id: '6-1',
|
|
|
- // subMenuName: '监管机构',
|
|
|
- // path: '/admin/regulatoryAuthority'
|
|
|
- // }, {
|
|
|
- // id: '6-2',
|
|
|
- // subMenuName: '监测机构',
|
|
|
- // path: '/admin/testingFacility'
|
|
|
- // }
|
|
|
- // ,{
|
|
|
- // id: '5-3',
|
|
|
- // subMenuName: '监测抽查',
|
|
|
- // path: '/admin/checkMonitor'
|
|
|
- // },{
|
|
|
- // id: '5-4',
|
|
|
- // subMenuName: '复检任务',
|
|
|
- // path: '/admin/'
|
|
|
- // // },
|
|
|
- // ]
|
|
|
- // },
|
|
|
- // {
|
|
|
- // icon: 'el-icon-user-solid',
|
|
|
subMenuName: '监测任务',
|
|
|
children: [{
|
|
|
id: '5-1',
|
|
@@ -185,30 +141,20 @@
|
|
|
subMenuName: '退回任务',
|
|
|
path: '/admin/retask'
|
|
|
}
|
|
|
-
|
|
|
- // ,{
|
|
|
- // id: '5-3',
|
|
|
- // subMenuName: '监测抽查',
|
|
|
- // path: '/admin/checkMonitor'
|
|
|
- // },{
|
|
|
-
|
|
|
- // id: '5-4',
|
|
|
- // subMenuName: '复检任务',
|
|
|
- // path: '/admin/'
|
|
|
- // },
|
|
|
]
|
|
|
},
|
|
|
- // },
|
|
|
|
|
|
]
|
|
|
this.menuList = data
|
|
|
},
|
|
|
methods: {
|
|
|
- // async getAccount() {
|
|
|
- // const result = await this.$http.post('getAccount', {
|
|
|
- // })},
|
|
|
- getAccount() {
|
|
|
- this.$router.push('getAccount')
|
|
|
+ async getAccount() {
|
|
|
+ const result = await this.$http.post('getAccount')
|
|
|
+ this.name = result.data.data.name
|
|
|
+ console.log(this.name)
|
|
|
+ },
|
|
|
+ async userInform() {
|
|
|
+ this.$router.push('userAccount')
|
|
|
},
|
|
|
handleOpen(index) {
|
|
|
console.log(index)
|
|
@@ -259,10 +205,10 @@
|
|
|
// 清除seesion信息
|
|
|
window.sessionStorage.clear()
|
|
|
this.$router.push('/login')
|
|
|
- // }
|
|
|
+ //}
|
|
|
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
async checkTimeOut() {
|
|
|
this.currentTime = new Date().getTime() // 记录这次点击的时间
|
|
|
// 如果当前页面不是登录,初始化界面就可以执行是否退出
|
|
@@ -332,12 +278,12 @@
|
|
|
|
|
|
|
|
|
// .admin-logo-container {
|
|
|
- // border-color: #5EB9DE;
|
|
|
- // border-right-width: 1px;
|
|
|
- // border-right-style: solid;
|
|
|
- // // border-color: #5EB9DE;
|
|
|
- // // border-right-width: 1px;
|
|
|
- // // border-right-style: solid;
|
|
|
+ // border-color: #5EB9DE;
|
|
|
+ // border-right-width: 1px;
|
|
|
+ // border-right-style: solid;
|
|
|
+ // border-color: #5EB9DE;
|
|
|
+ // border-right-width: 1px;
|
|
|
+ // border-right-style: solid;
|
|
|
// }
|
|
|
|
|
|
.admin-logo {
|
|
@@ -349,7 +295,7 @@
|
|
|
}
|
|
|
|
|
|
.el-header {
|
|
|
- background-color: #31B404;
|
|
|
+ background-color: #145faa;
|
|
|
width: 100%;
|
|
|
color: white;
|
|
|
font-size: 25px;
|
|
@@ -362,7 +308,7 @@
|
|
|
align-items: center;
|
|
|
|
|
|
span {
|
|
|
- margin-left: 15px;
|
|
|
+ margin-left: 20px;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -397,4 +343,22 @@
|
|
|
float: right;
|
|
|
margin-top:10px;
|
|
|
}
|
|
|
+ .hello{
|
|
|
+ border: 0.5px solid rgb(233, 233, 233);
|
|
|
+ height: 30px;
|
|
|
+ // position: relative;
|
|
|
+ float: right;
|
|
|
+ padding: 3px;
|
|
|
+ }
|
|
|
+ .btn{
|
|
|
+ // margin-left: 5px;
|
|
|
+ // margin-top:2px;
|
|
|
+ // margin-bottom: 2px;
|
|
|
+ text-align: right;
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
+ .btns{
|
|
|
+ border-style: solid;
|
|
|
+ border-color: rgb(52, 92, 224);
|
|
|
+ }
|
|
|
</style>
|