工作台菜单+无关路由去除

main
lijingyu007 11 months ago
parent 071637fcb1
commit 854d0b52fc
  1. 704
      src/page/personalpage/commonheader/personalheader.vue
  2. 193
      src/router/router.js

@ -1,11 +1,20 @@
<template> <template>
<div class="bgback"> <div class="bgback">
<div class="headbg"> <div class="headbg">
<div style="margin:10px 50px 10px 10px;display:flex;justify-content:space-between; height:50px;align-items:center; "> <div
<div style="width:430px;display:flex;justify-content:space-between;align-items:center; "> style="
margin: 10px 50px 10px 10px;
display: flex;
justify-content: space-between;
height: 50px;
align-items: center;
"
>
<div style="width: 430px; display: flex; justify-content: space-between; align-items: center">
<!-- <img @click="tishou" style="cursor:pointer;height:45px;object-fit:contain" src="/assets/loginreg/logo.png" alt=""> --> <!-- <img @click="tishou" style="cursor:pointer;height:45px;object-fit:contain" src="/assets/loginreg/logo.png" alt=""> -->
<p @click="tishou" style="font-weight:bold;color: #262626;cursor:pointer;font-size:20px;"> <p @click="tishou" style="font-weight: bold; color: #262626; cursor: pointer; font-size: 20px">
<img src="/assets/loginreg/logo1.png" style="width: 20px;vertical-align: middle;" alt=""> 关键测试宝 <img src="/assets/loginreg/logo1.png" style="width: 20px; vertical-align: middle" alt="" />
关键测试宝
</p> </p>
<!-- <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;"> <!-- <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;">
<el-radio-button type='text' :label="false">展开</el-radio-button> <el-radio-button type='text' :label="false">展开</el-radio-button>
@ -13,40 +22,63 @@
</el-radio-group> --> </el-radio-group> -->
<!-- <p @click='opencollapse' style="cursor:pointer" >展开收齐</p> --> <!-- <p @click='opencollapse' style="cursor:pointer" >展开收齐</p> -->
<svg <svg
@click='opencollapse' @click="opencollapse"
:class="{'is-active':isCollapse}" :class="{ 'is-active': isCollapse }"
class="hamburger" class="hamburger"
viewBox="0 0 1024 1024" viewBox="0 0 1024 1024"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="64" width="64"
height="64" height="64"
> >
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" /> <path
d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"
/>
</svg> </svg>
<el-breadcrumb separator="/" style="width:180px"> <el-breadcrumb separator="/" style="width: 180px">
<el-breadcrumb-item v-for='(item,key) of breadcrumblist' :key="key" >{{item.name}}</el-breadcrumb-item> <el-breadcrumb-item v-for="(item, key) of breadcrumblist" :key="key">{{
item.name
}}</el-breadcrumb-item>
<!-- <el-breadcrumb-item><a href="/"> :to="{ path: item.path }"活动管理</a></el-breadcrumb-item> <!-- <el-breadcrumb-item><a href="/"> :to="{ path: item.path }"活动管理</a></el-breadcrumb-item>
<el-breadcrumb-item>活动列表</el-breadcrumb-item> <el-breadcrumb-item>活动列表</el-breadcrumb-item>
<el-breadcrumb-item>活动详情</el-breadcrumb-item> --> <el-breadcrumb-item>活动详情</el-breadcrumb-item> -->
</el-breadcrumb> </el-breadcrumb>
</div> </div>
<div style="display:flex;justify-content:space-between;align-items:center; font-size:14px; "> <div style="display: flex; justify-content: space-between; align-items: center; font-size: 14px">
<!-- <div style="width:300px;display:flex;justify-content:space-between;align-items:center; font-size:14px; "> --> <!-- <div style="width:300px;display:flex;justify-content:space-between;align-items:center; font-size:14px; "> -->
<!-- <div class="permissions" @click="mypermissions('shopping')"> <!-- <div class="permissions" @click="mypermissions('shopping')">
<el-badge :value="cartCount" :max="100" :hidden="cartCount==0" :class="cartCount>0?'baggeitem':'baggeitemda'"> <el-badge :value="cartCount" :max="100" :hidden="cartCount==0" :class="cartCount>0?'baggeitem':'baggeitemda'">
<img style="margin-right:5px" src="/assets/home/gouwuche(1).png" alt=""> <img style="margin-right:5px" src="/assets/home/gouwuche(1).png" alt="">
</el-badge> </el-badge>
<p style="margin-left:5px">购物车</p> <p style="margin-left:5px">购物车</p>
</div> --> </div> -->
<div class="permissions" @click="mypermissions('message')"> <div class="permissions" @click="mypermissions('message')">
<el-badge :value="messageCount" :max="100" :hidden="messageCount==0" :class="messageCount>0?'baggeitem':'baggeitemda'"> <el-badge
<img style="margin-right:5px" src="/assets/home/xiaoxi.png" alt=""> :value="messageCount"
:max="100"
:hidden="messageCount == 0"
:class="messageCount > 0 ? 'baggeitem' : 'baggeitemda'"
>
<img style="margin-right: 5px" src="/assets/home/xiaoxi.png" alt="" />
</el-badge> </el-badge>
<p style="margin-left:5px">站内消息</p> <p style="margin-left: 5px">站内消息</p>
</div> </div>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click" placement='bottom'> <el-dropdown
class="avatar-container right-menu-item hover-effect"
trigger="click"
placement="bottom"
>
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<img style="width:54px;height:54px;margin:13px 0 5px 0px;cursor:pointer;border-radius:50%" :src="userinform.avatar" alt=""> <img
style="
width: 54px;
height: 54px;
margin: 13px 0 5px 0px;
cursor: pointer;
border-radius: 50%;
"
:src="userinform.avatar"
alt=""
/>
<!-- <i style="margin-bottom:10px" class="el-icon-caret-bottom"/> --> <!-- <i style="margin-bottom:10px" class="el-icon-caret-bottom"/> -->
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
@ -58,124 +90,141 @@
</el-dropdown> </el-dropdown>
</div> </div>
</div> </div>
</div> </div>
<div style="display:flex;justify-content:space-between;"> <div style="display: flex; justify-content: space-between">
<div style="width:225px;position:fixed;margin-top:70px;"> <div style="width: 225px; position: fixed; margin-top: 70px">
<el-menu :default-active="currentactive" class="el-menu-vertical-demo" :collapse="isCollapse" router unique-opened text-color='#000000' active-text-color='#0066EB'> <el-menu
<!--打开关闭导航栏 @open="handleOpen" @close="handleClose" --> :default-active="currentactive"
<!-- <el-menu-item index="/console"> class="el-menu-vertical-demo"
<i class="el-icon-s-home"></i> :collapse="isCollapse"
<span slot="title">首页</span> router
</el-menu-item> --> unique-opened
<el-submenu index="2"> text-color="#000000"
<template slot="title"> active-text-color="#0066EB"
<!-- <i class="el-icon-s-cooperation"></i> --> >
<img class='imghd' style="margin-right:10px" src="/assets/personal/suichegongju.png" alt="" > <!-- 企业用户--新菜单 -->
<span slot="title" >工具市场</span> <template v-if="userinform.companyStatus == 2">
</template> <el-menu-item index="/console/myparticipate">
<el-menu-item-group > <i class="el-icon-document-copy"></i>
<el-menu-item index="/console/toolsmarket"> <span>我的众包</span>
<i class="el-icon-s-cooperation"></i> </el-menu-item>
<span>工具市场</span> <el-menu-item index="/console/myrelease">
</el-menu-item> <i class="el-icon-user"></i>
<el-menu-item index="/console/orders"> <span>发布众包任务</span>
<i class="el-icon-s-order"></i> </el-menu-item>
<el-submenu index="3">
<template slot="title">
<i class="el-icon-s-finance"></i>
<span slot="title">我的工具</span>
</template>
<el-menu-item-group>
<el-menu-item index="/console/mytools">
<i class="el-icon-c-scale-to-original"></i>
<span>我的工具</span>
</el-menu-item>
<el-menu-item index="/console/mytasks">
<i class="el-icon-s-claim"></i>
<span>测试历史</span>
</el-menu-item>
</el-menu-item-group>
</el-submenu>
<el-menu-item index="/console/orders">
<i class="el-icon-s-order"></i>
<span>我的订单</span> <span>我的订单</span>
</el-menu-item> </el-menu-item>
<!-- <el-menu-item index="/console/cart"> <el-menu-item index="/console/demand">
<i class="el-icon-shopping-cart-2"></i> <i class="el-icon-s-unfold"></i>
<span>我的购物车</span> <span>用人记录</span>
</el-menu-item> --> </el-menu-item>
</el-menu-item-group> <el-menu-item index="/console/account">
</el-submenu> <i class="el-icon-s-shop"></i>
<el-submenu index="3"> <span slot="title">钱包管理</span>
<template slot="title"> </el-menu-item>
<i class="el-icon-s-finance"></i> <el-menu-item index="/console/myBm">
<span slot="title">测试管理</span> <i class="el-icon-chat-line-round"></i>
</template> <span slot="title">我的培训班</span>
<el-menu-item-group> </el-menu-item>
<el-menu-item index="/console/mytools"> <el-menu-item index="/console/myreview">
<i class="el-icon-c-scale-to-original"></i> <i class="el-icon-tickets"></i>
<span>我的工具</span> <span slot="title">我收到的评价</span>
</el-menu-item> </el-menu-item>
<el-menu-item index="/console/mytasks"> <el-submenu index="7">
<i class="el-icon-s-claim"></i> <template slot="title">
<span>我的任务</span> <i class="el-icon-user-solid"></i>
</el-menu-item> <span slot="title">个人中心</span>
</el-menu-item-group> </template>
</el-submenu> <el-menu-item-group>
<el-submenu index="4"> <el-menu-item index="/console/profile">
<template slot="title"> <span>基本信息</span>
<i class="el-icon-s-management"></i> </el-menu-item>
<span slot="title">众包服务</span> <el-menu-item index="/console/message">
</template> <span>消息管理</span>
<el-menu-item-group> </el-menu-item>
<!-- <span slot="title">分组一</span> --> </el-menu-item-group>
<el-menu-item index="/console/myparticipate"> </el-submenu>
<i class="el-icon-document-copy"></i> </template>
<span>我参与的</span> <template v-else>
</el-menu-item> <el-menu-item index="/console/myparticipate">
<!-- <el-menu-item index="/console/mycrowd"> --> <i class="el-icon-document-copy"></i>
<el-menu-item v-if="userinform.companyStatus==2" index="/console/myrelease"> <span>我的众包</span>
<i class="el-icon-user"></i> </el-menu-item>
<span>我发布的</span>
</el-menu-item> <el-submenu index="3">
<!-- <el-menu-item v-if="userinform.companyStatus==2" index="/console/pendingtask"> <template slot="title">
<i class="el-icon-notebook-2"></i> <i class="el-icon-s-finance"></i>
<span>待付款任务</span> <span slot="title">我的工具</span>
</el-menu-item> --> </template>
</el-menu-item-group> <el-menu-item-group>
</el-submenu> <el-menu-item index="/console/mytools">
<i class="el-icon-c-scale-to-original"></i>
<el-submenu index="6"> <span>我的工具</span>
<template slot="title"> </el-menu-item>
<i class="el-icon-user-solid"></i> <el-menu-item index="/console/mytasks">
<span slot="title">人才服务</span> <i class="el-icon-s-claim"></i>
</template> <span>测试历史</span>
<el-menu-item-group> </el-menu-item>
<el-menu-item index="/console/demand"> </el-menu-item-group>
<i class="el-icon-s-unfold"></i> </el-submenu>
<span>我要用人</span>
</el-menu-item> <el-menu-item index="/console/demand">
</el-menu-item-group> <i class="el-icon-s-unfold"></i>
</el-submenu> <span>用人记录</span>
<el-menu-item index="/console/account"> </el-menu-item>
<i class="el-icon-s-shop"></i> <el-menu-item index="/console/account">
<span slot="title">账户管理</span>
</el-menu-item>
<el-menu-item index="/console/myBm">
<i class="el-icon-chat-line-round"></i>
<span slot="title">我的培训班</span>
</el-menu-item>
<el-menu-item index="/console/myreview">
<i class="el-icon-tickets"></i>
<span slot="title">我的评价</span>
</el-menu-item>
<!-- <el-submenu index="5">
<template slot="title">
<i class="el-icon-s-shop"></i> <i class="el-icon-s-shop"></i>
<span slot="title">账户管理</span> <span slot="title">我的钱包</span>
</template> </el-menu-item>
<el-menu-item-group> <el-menu-item index="/console/myBm">
<el-menu-item index="/console/accountoverview"> <i class="el-icon-chat-line-round"></i>
<i class="el-icon-s-unfold"></i> <span slot="title">我的培训班</span>
<span>账户概览</span> </el-menu-item>
</el-menu-item> <el-menu-item index="/console/myreview">
<el-menu-item index="/console/transaction"> <i class="el-icon-tickets"></i>
<i class="el-icon-s-order"></i> <span slot="title">我收到的评价</span>
<span>交易记录</span> </el-menu-item>
</el-menu-item> <el-menu-item index="/console/orders">
<el-menu-item index="/console/tranpassword"> <i class="el-icon-s-order"></i>
<i class="el-icon-lock"></i> <span>我的订单</span>
<span>交易密码</span> </el-menu-item>
</el-menu-item> <el-submenu index="7">
</el-menu-item-group> <template slot="title">
</el-submenu> --> <i class="el-icon-user-solid"></i>
<span slot="title">个人中心</span>
</template>
<el-menu-item-group>
<el-menu-item index="/console/profile">
<span>基本信息</span>
</el-menu-item>
<el-menu-item index="/console/message">
<span>消息管理</span>
</el-menu-item>
</el-menu-item-group>
</el-submenu>
</template>
</el-menu> </el-menu>
</div> </div>
<div class="content-wrapper" :style="[{'padding-left':isCollapse?'100px':'240px'}]"> <div class="content-wrapper" :style="[{ 'padding-left': isCollapse ? '100px' : '240px' }]">
<transition name="fade" mode="out-in" > <transition name="fade" mode="out-in">
<router-view></router-view> <router-view></router-view>
</transition> </transition>
</div> </div>
@ -183,219 +232,218 @@
</div> </div>
</template> </template>
<script> <script>
import {mapGetters} from "vuex"; import { mapGetters } from 'vuex'
import store from "@/store"; import store from '@/store'
import {listMyMessageCount} from '@/api/system/message' import { listMyMessageCount } from '@/api/system/message'
export default{ export default {
data(){ data() {
return{ return {
isCollapse: false , isCollapse: false,
currentactive:'', currentactive: '',
screenWidth: document.body.clientWidth, screenWidth: document.body.clientWidth,
breadcrumblist:[],// breadcrumblist: [], //
messageCount: 0, messageCount: 0,
cartCount: 0 cartCount: 0,
} }
}, },
watch:{ watch: {
$route:{ $route: {
handler(val, old) { handler(val, old) {
let curetoter=val.path.substr(10); let curetoter = val.path.substr(10)
this.breadcrumblist=[]; this.breadcrumblist = []
if(val.meta.type==1){ if (val.meta.type == 1) {
this.breadcrumblist.push({name:'首页'},{name:val.meta.title}) this.breadcrumblist.push({ name: '首页' }, { name: val.meta.title })
} }
if(val.meta.type==2){ if (val.meta.type == 2) {
this.breadcrumblist.push({name:'工具市场'},{name:val.meta.title}) this.breadcrumblist.push({ name: '工具市场' }, { name: val.meta.title })
} }
if(val.meta.type==3){ if (val.meta.type == 3) {
this.breadcrumblist.push({name:'测试管理'},{name:val.meta.title}) this.breadcrumblist.push({ name: '测试管理' }, { name: val.meta.title })
} }
if(val.meta.type==4){ if (val.meta.type == 4) {
this.breadcrumblist.push({name:'众包服务'},{name:val.meta.title}) this.breadcrumblist.push({ name: '众包服务' }, { name: val.meta.title })
}
},
immediate:true
},
screenWidth(val){
// resize使
if(!this.timer){
// screenWidthdatascreenWidth
this.screenWidth = val
this.timer = true
let that = this
setTimeout(function(){
// screenWidth
if(that.screenWidth<1500){
that.isCollapse=true
}else{
that.isCollapse=false
}
that.timer = false
},400)
} }
}, },
count(newVal, oldVal) { immediate: true,
this.messageCount = newVal;
},
cartCountW(newVal, oldVal) {
this.cartCount = newVal;
}
}, },
created(){ screenWidth(val) {
if(this.token){ // resize使
listMyMessageCount().then(response => { if (!this.timer) {
this.messageCount = response.data; // screenWidthdatascreenWidth
this.cartCount = response.cartCount; this.screenWidth = val
store.commit('SET_MESSAGECOUNT', this.messageCount); this.timer = true
store.commit('SET_CARTCOUNT', this.cartCount); let that = this
}) setTimeout(function () {
// screenWidth
if (that.screenWidth < 1500) {
that.isCollapse = true
} else {
that.isCollapse = false
}
that.timer = false
}, 400)
} }
}, },
computed: { count(newVal, oldVal) {
...mapGetters(['token','logindate','avatar','userinform']), this.messageCount = newVal
count() {
return store.getters.messageCount;  //
},
cartCountW() {
return store.getters.cartCount; //
},
}, },
mounted(){ cartCountW(newVal, oldVal) {
// this.currentactive=this.$route.path.substr(10); this.cartCount = newVal
this.currentactive=this.$route.path
const that = this
window.onresize = () => {
return (() => {
window.screenWidth = document.body.clientWidth
that.screenWidth = window.screenWidth
})()
}
}, },
methods:{ },
//logo created() {
tishou(){ if (this.token) {
this.$router.push('/') listMyMessageCount().then((response) => {
}, this.messageCount = response.data
// this.cartCount = response.cartCount
mypermissions(type){ store.commit('SET_MESSAGECOUNT', this.messageCount)
let currentdata=Date.parse(new Date()); store.commit('SET_CARTCOUNT', this.cartCount)
let logindate=this.logindate; })
let timedifference=currentdata-(parseInt(logindate)+432000000); }
if(timedifference>0){ },
this.$confirm('登录状态失效,请您重新登录' , '提示', { computed: {
confirmButtonText: '确定', ...mapGetters(['token', 'logindate', 'avatar', 'userinform']),
cancelButtonText: '取消', count() {
type: 'warning' return store.getters.messageCount //
}).then(()=> { },
this.$router.push('/login?type=log') cartCountW() {
}).catch(()=>{ return store.getters.cartCount //
}) },
}else{ },
if(type=='message'){ mounted() {
this.$router.push('/console/message') // this.currentactive=this.$route.path.substr(10);
}else if(type=='shopping'){ this.currentactive = this.$route.path
this.$router.push('/console/cart') const that = this
}else if(type=='imembers'){ window.onresize = () => {
this.$router.push('/console/profile') return (() => {
} window.screenWidth = document.body.clientWidth
} that.screenWidth = window.screenWidth
}, })()
//退 }
logout() { },
this.$confirm('确定退出登录吗?', '提示', { methods: {
//logo
tishou() {
this.$router.push('/')
},
//
mypermissions(type) {
let currentdata = Date.parse(new Date())
let logindate = this.logindate
let timedifference = currentdata - (parseInt(logindate) + 432000000)
if (timedifference > 0) {
this.$confirm('登录状态失效,请您重新登录', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning',
}).then(() => { })
this.$store.dispatch('LogOut').then(() => { .then(() => {
// this.$router.push('/')
this.$router.push('/login?type=log') this.$router.push('/login?type=log')
}) })
.catch(() => {})
} else {
if (type == 'message') {
this.$router.push('/console/message')
} else if (type == 'shopping') {
this.$router.push('/console/cart')
} else if (type == 'imembers') {
this.$router.push('/console/profile')
}
}
},
//退
logout() {
this.$confirm('确定退出登录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
// this.$router.push('/')
this.$router.push('/login?type=log')
}) })
}, })
//
opencollapse(){
this.isCollapse=!this.isCollapse
},
// //
// handleOpen(key, keyPath) {
// },
// //
// handleClose(key, keyPath) {
// },
}, },
//
} opencollapse() {
this.isCollapse = !this.isCollapse
},
// //
// handleOpen(key, keyPath) {
// },
// //
// handleClose(key, keyPath) {
// },
},
}
</script> </script>
<style scoped> <style scoped>
.bgback{ .bgback {
/* background-color:#F0F2F5!important; /* background-color:#F0F2F5!important;
background-color: #FFFFFF!important; */ background-color: #FFFFFF!important; */
width:100vw; width: 100vw;
height:100vh; height: 100vh;
}
} .headbg {
.headbg{ /* width:1200px;
/* width:1200px;
margin:0 auto; */ margin:0 auto; */
width: 100vw; width: 100vw;
position: fixed; position: fixed;
/* padding:10px 50px 10px 10px; */ /* padding:10px 50px 10px 10px; */
/* display:flex; /* display:flex;
justify-content:space-between; justify-content:space-between;
align-items:center; */ align-items:center; */
/* height:50px; */ /* height:50px; */
z-index:99; z-index: 99;
background-color: #FFFFFF; background-color: #ffffff;
box-shadow: 0px 1px 8px 0px rgba(0, 0, 0, 0.11); box-shadow: 0px 1px 8px 0px rgba(0, 0, 0, 0.11);
} }
.permissions{ .permissions {
display:flex; display: flex;
align-items:center; align-items: center;
margin-left:10px; margin-left: 10px;
margin-right: 20px; margin-right: 20px;
cursor:pointer; cursor: pointer;
} }
.avatar-wrapper img:hover{ .avatar-wrapper img:hover {
opacity:0.5; opacity: 0.5;
/* transition: 0.3s; */ /* transition: 0.3s; */
} }
.el-menu-vertical-demo:not(.el-menu--collapse) { .el-menu-vertical-demo:not(.el-menu--collapse) {
width:100%; width: 100%;
min-height: 400px; min-height: 400px;
height:95vh height: 95vh;
} }
.hamburger { .hamburger {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
width: 20px; width: 20px;
height: 20px; height: 20px;
} }
.hamburger.is-active { .hamburger.is-active {
transform: rotate(180deg); transform: rotate(180deg);
} }
.el-menu--collapse{ .el-menu--collapse {
height:92vh height: 92vh;
} }
.content-wrapper{ .content-wrapper {
padding:100px 20px 0 249px; padding: 100px 20px 0 249px;
box-sizing: border-box; box-sizing: border-box;
width: 100vw; width: 100vw;
/* background:#666666!important */ /* background:#666666!important */
} }
.baggeitem { .baggeitem {
margin-top:5px; margin-top: 5px;
margin-right:15px; margin-right: 15px;
} }
.baggeitemda { .baggeitemda {
margin-top:5px; margin-top: 5px;
/* margin-right:10px; */ /* margin-right:10px; */
} }
.el-dropdown-menu__item{ .el-dropdown-menu__item {
padding:0 20px!important; padding: 0 20px !important;
} }
.el-dropdown-menu{ .el-dropdown-menu {
top:56px!important top: 56px !important;
} }
</style> </style>

@ -1,62 +1,61 @@
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import store from "@/store"; import store from "@/store";
import { Message,MessageBox } from 'element-ui' // import { Message,MessageBox } from 'element-ui'
//自定义组件 //自定义组件
import logpage from "../page/logpage/index.vue"
import login from "../page/logpage/log/login.vue" import login from "../page/logpage/log/login.vue"
import index from "../page/homepage/index.vue" import index from "../page/homepage/index.vue"
import home from "../page/homepage/home/home.vue" import home from "../page/homepage/home/home.vue"
import toolmarker from "../page/homepage/tool/toolmarker.vue" import toolmarker from "../page/homepage/tool/toolmarker.vue"
import openSource from "../page/homepage/openSource/index.vue"
import openSourceTooldetails from "../page/homepage/openSource/tooldetails.vue"
import safetyTesteTool from "../page/homepage/openSourceArea/safetyTesteTool.vue"
import codeScanningTool from "../page/homepage/openSourceArea/codeScanningTool.vue"
import unitTesteTool from "../page/homepage/openSourceArea/unitTesteTool.vue"
import functionTesteTool from "../page/homepage/openSourceArea/functionTesteTool.vue"
import pressureTesteTool from "../page/homepage/openSourceArea/pressureTesteTool.vue"
import interfaceTestTool from "../page/homepage/openSourceArea/interfaceTestTool.vue"
import CNASsolution from "../page/homepage/solution/CNASsolution.vue"
import GJB5000Bsolution from "../page/homepage/solution/GJB5000Bsolution.vue"
import tooldetails from "../page/homepage/tool/tooldetails.vue" import tooldetails from "../page/homepage/tool/tooldetails.vue"
import crowd from "../page/homepage/crowdsourcing/crowd.vue" import crowd from "../page/homepage/crowdsourcing/crowd.vue"
import crowddetails from "../page/homepage/crowdsourcing/crowddetails.vue" import crowddetails from "../page/homepage/crowdsourcing/crowddetails.vue"
import publishtasks from "../page/homepage/crowdsourcing/publishtasks.vue" import publishtasks from "../page/homepage/crowdsourcing/publishtasks.vue"
import train from "../page/homepage/traininstitute/train.vue" import train from "../page/homepage/traininstitute/train.vue"
import dynamics from "../page/homepage/industrydynamics/dynamics.vue"
import industrydetails from "../page/homepage/industrydynamics/industrydetails.vue"
import ability from "../page/homepage/personability/ability.vue" import ability from "../page/homepage/personability/ability.vue"
import employ from "../page/homepage/employ/employ.vue" import employ from "../page/homepage/employ/employ.vue"
import cooperation from "../page/homepage/cooperation/cooperation.vue" import cooperation from "../page/homepage/cooperation/cooperation.vue"
import aboutwo from "../page/homepage/aboutus/aboutwo.vue" import aboutwo from "../page/homepage/aboutus/aboutwo.vue"
import joinus from "../page/homepage/aboutus/joinus.vue"
import personal from "../page/personalpage/index.vue" import personal from "../page/personalpage/index.vue"
import imember from "../page/personalpage/home/imember.vue"
import personalcenter from "../page/personalpage/home/personalcenter.vue" import personalcenter from "../page/personalpage/home/personalcenter.vue"
import stationmessage from "../page/personalpage/home/stationmessage.vue" import stationmessage from "../page/personalpage/home/stationmessage.vue"
import messagelist from "../page/personalpage/home/messagelist.vue"
import toolmarket from "../page/personalpage/testtool/toolmarket.vue"
import mytooldetails from "../page/personalpage/testtool/mytooldetails.vue"
import myorder from "../page/personalpage/testtool/myorder.vue" import myorder from "../page/personalpage/testtool/myorder.vue"
import myshopcart from "../page/personalpage/testtool/myshopcart.vue"
import mytask from "../page/personalpage/testmanagement/mytask.vue" import mytask from "../page/personalpage/testmanagement/mytask.vue"
import mytool from "../page/personalpage/testmanagement/mytool.vue" import mytool from "../page/personalpage/testmanagement/mytool.vue"
import crowdmarket from "../page/personalpage/testcrowd/crowdmarket.vue"
import currentcrowd from "../page/personalpage/testcrowd/currentcrowd.vue"
import crowdinform from "../page/personalpage/testcrowd/crowdinform.vue"
import mycrowd from "../page/personalpage/testcrowd/mycrowd.vue"
import myparticipate from "../page/personalpage/testcrowd/myparticipate.vue" import myparticipate from "../page/personalpage/testcrowd/myparticipate.vue"
import myrelease from "../page/personalpage/testcrowd/myrelease.vue" import myrelease from "../page/personalpage/testcrowd/myrelease.vue"
import pendingtask from "../page/personalpage/testcrowd/pendingtask.vue"
import edittasks from "../page/personalpage/testcrowd/edittasks.vue" import edittasks from "../page/personalpage/testcrowd/edittasks.vue"
import accountoverview from "../page/personalpage/testtreasure/accountoverview.vue"
import transaction from "../page/personalpage/testtreasure/transaction.vue"
import tranpassword from "../page/personalpage/testtreasure/tranpassword.vue"
import testKit from "../page/personalpage/testtreasure/testKit.vue" import testKit from "../page/personalpage/testtreasure/testKit.vue"
import demand from "../page/personalpage/demand/index.vue" import demand from "../page/personalpage/demand/index.vue"
import myreview from '../page/personalpage/myreview/index.vue' import myreview from '../page/personalpage/myreview/index.vue'
import myBm from '../page/personalpage/myBm/index.vue' import myBm from '../page/personalpage/myBm/index.vue'
// import logpage from "../page/logpage/index.vue"
// import openSource from "../page/homepage/openSource/index.vue"
// import openSourceTooldetails from "../page/homepage/openSource/tooldetails.vue"
// import safetyTesteTool from "../page/homepage/openSourceArea/safetyTesteTool.vue"
// import codeScanningTool from "../page/homepage/openSourceArea/codeScanningTool.vue"
// import unitTesteTool from "../page/homepage/openSourceArea/unitTesteTool.vue"
// import functionTesteTool from "../page/homepage/openSourceArea/functionTesteTool.vue"
// import pressureTesteTool from "../page/homepage/openSourceArea/pressureTesteTool.vue"
// import interfaceTestTool from "../page/homepage/openSourceArea/interfaceTestTool.vue"
// import CNASsolution from "../page/homepage/solution/CNASsolution.vue"
// import GJB5000Bsolution from "../page/homepage/solution/GJB5000Bsolution.vue"
// import dynamics from "../page/homepage/industrydynamics/dynamics.vue"
// import industrydetails from "../page/homepage/industrydynamics/industrydetails.vue"
// import joinus from "../page/homepage/aboutus/joinus.vue"
// import imember from "../page/personalpage/home/imember.vue"
// import messagelist from "../page/personalpage/home/messagelist.vue"
// import toolmarket from "../page/personalpage/testtool/toolmarket.vue"
// import mytooldetails from "../page/personalpage/testtool/mytooldetails.vue"
// import myshopcart from "../page/personalpage/testtool/myshopcart.vue"
// import crowdmarket from "../page/personalpage/testcrowd/crowdmarket.vue"
// import currentcrowd from "../page/personalpage/testcrowd/currentcrowd.vue"
// import crowdinform from "../page/personalpage/testcrowd/crowdinform.vue"
// import mycrowd from "../page/personalpage/testcrowd/mycrowd.vue"
// import pendingtask from "../page/personalpage/testcrowd/pendingtask.vue"
// import accountoverview from "../page/personalpage/testtreasure/accountoverview.vue"
// import transaction from "../page/personalpage/testtreasure/transaction.vue"
// import tranpassword from "../page/personalpage/testtreasure/tranpassword.vue"
Vue.use(Router) Vue.use(Router)
//为组件配置路径 //为组件配置路径
@ -65,80 +64,82 @@ const router = new Router({
// linkActiveClass:'is-active', // linkActiveClass:'is-active',
routes: [ routes: [
//首页 //首页
{path:'',component:index, {
redirect:'/', path: '', component: index,
children:[ redirect: '/',
{path:'/',component:home,name:'home',}, children: [
{path:'login',component:login,name:'login',}, { path: '/', component: home, name: 'home', },
{path:'market',component:toolmarker,name:'market'}, { path: 'login', component: login, name: 'login', },
{path:'openSource', component: openSource, name:'openSource'}, { path: 'market', component: toolmarker, name: 'market' },
{path:'openSourceArea/safetyTesteTool',component:safetyTesteTool,name:'safetyTesteTool'}, // {path:'openSource', component: openSource, name:'openSource'},
{path:'openSourceArea/codeScanningTool',component:codeScanningTool,name:'codeScanningTool'}, // {path:'openSourceArea/safetyTesteTool',component:safetyTesteTool,name:'safetyTesteTool'},
{path:'openSourceArea/unitTesteTool',component:unitTesteTool,name:'unitTesteTool'}, // {path:'openSourceArea/codeScanningTool',component:codeScanningTool,name:'codeScanningTool'},
{path:'openSourceArea/functionTesteTool',component:functionTesteTool,name:'functionTesteTool'}, // {path:'openSourceArea/unitTesteTool',component:unitTesteTool,name:'unitTesteTool'},
{path:'openSourceArea/pressureTesteTool',component:pressureTesteTool,name:'pressureTesteTool'}, // {path:'openSourceArea/functionTesteTool',component:functionTesteTool,name:'functionTesteTool'},
{path:'openSourceArea/interfaceTestTool',component:interfaceTestTool,name:'interfaceTestTool'}, // {path:'openSourceArea/pressureTesteTool',component:pressureTesteTool,name:'pressureTesteTool'},
{path:'solution/CNAS',component:CNASsolution,name:'CNASsolution'}, // {path:'openSourceArea/interfaceTestTool',component:interfaceTestTool,name:'interfaceTestTool'},
{path:'solution/GJB5000B',component:GJB5000Bsolution,name:'GJB5000Bsolution'}, // {path:'solution/CNAS',component:CNASsolution,name:'CNASsolution'},
{path:'market/tooldetails',component:tooldetails}, // {path:'solution/GJB5000B',component:GJB5000Bsolution,name:'GJB5000Bsolution'},
{path:'openSource/openSourceTooldetails', component: openSourceTooldetails }, { path: 'market/tooldetails', component: tooldetails },
{path:'crowdsourcing',component:crowd,name:'crowd',}, // {path:'openSource/openSourceTooldetails', component: openSourceTooldetails },
{path:'crowdsourcing/crowddetails',component:crowddetails,}, { path: 'crowdsourcing', component: crowd, name: 'crowd', },
{path:'crowdsourcing/publishtasks',component:publishtasks,}, { path: 'crowdsourcing/crowddetails', component: crowddetails, },
{path:'college',component:train}, { path: 'crowdsourcing/publishtasks', component: publishtasks, },
{path:'ability',component:ability}, { path: 'college', component: train },
{path:'news',component:dynamics,}, { path: 'ability', component: ability },
{path:'news/detail',component:industrydetails,name:'industrydynamics',}, // {path:'news',component:dynamics,},
{path:'employ',component:employ}, // {path:'news/detail',component:industrydetails,name:'industrydynamics',},
{path:'cooperation',component:cooperation}, { path: 'employ', component: employ },
{path:'about',component:aboutwo}, { path: 'cooperation', component: cooperation },
{path:'aboutus/joinus',component:joinus,meta:{isAuth: true}}, { path: 'about', component: aboutwo },
// {path:'aboutus/joinus',component:joinus,meta:{isAuth: true}},
] ]
}, },
// 登录相关 // 登录相关
// {path:'/login',component:logpage, // {path:'/login',component:logpage,
// redirect:'/login', // redirect:'/login',
// children:[ // children:[
// {path:'login',component:login}, // {path:'login',component:login},
// ] // ]
// }, // },
// 工具市场: market // 工具市场: market
// 众包市场:crowdsourcing // 众包市场:crowdsourcing
// 培训学院:college // 培训学院:college
// 行业动态:news // 行业动态:news
// 关于我们:about // 关于我们:about
//个人中心 //个人中心
{path:'/console',component:personal, {
redirect:'/', path: '/console', component: personal,
children:[ redirect: '/console/myparticipate',
{path:'/',component:imember,meta: { title: '工作台', isAuth: true,type:1}}, children: [
{path:'profile',component:personalcenter,meta: { title: '个人中心', isAuth: true,type:1}}, // {path:'/',component:imember,meta: { title: '工作台', isAuth: true,type:1}},
{path:'message',component:stationmessage,meta: { title: '站内消息', isAuth: true,type:1}}, { path: 'profile', component: personalcenter, meta: { title: '个人中心', isAuth: true, type: 1 } },
{path:'messagelist',component:messagelist,meta: { title: '消息列表', isAuth: true,type:1}}, { path: 'message', component: stationmessage, meta: { title: '站内消息', isAuth: true, type: 1 } },
{path:'toolsmarket',component:toolmarket,meta: { title: '工具市场', isAuth: true,type:2}}, // {path:'messagelist',component:messagelist,meta: { title: '消息列表', isAuth: true,type:1}},
{path:'mytooldetails',component:mytooldetails,meta: { title: '测试工具详情', isAuth: true,type:2}}, // {path:'toolsmarket',component:toolmarket,meta: { title: '工具市场', isAuth: true,type:2}},
{path:'orders',component:myorder,meta: { title: '我的订单', isAuth: true,type:2}}, // {path:'mytooldetails',component:mytooldetails,meta: { title: '测试工具详情', isAuth: true,type:2}},
{path:'cart',component:myshopcart,meta: { title: '我的购物车', isAuth: true,type:2}}, { path: 'orders', component: myorder, meta: { title: '我的订单', isAuth: true, type: 2 } },
{path:'mytasks',component:mytask,meta: { title: '我的任务', isAuth: true,type:3}}, // {path:'cart',component:myshopcart,meta: { title: '我的购物车', isAuth: true,type:2}},
{path:'mytools',component:mytool,meta: { title: '我的工具', isAuth: true,type:3}}, { path: 'mytasks', component: mytask, meta: { title: '我的任务', isAuth: true, type: 3 } },
{path:'crowdmarket',component:crowdmarket,meta: { title: '众包市场', isAuth: true,type:4}}, { path: 'mytools', component: mytool, meta: { title: '我的工具', isAuth: true, type: 3 } },
{path:'currentcrowd',component:currentcrowd,meta: { title: '任务详情', isAuth: true,type:4}}, // {path:'crowdmarket',component:crowdmarket,meta: { title: '众包市场', isAuth: true,type:4}},
{path:'crowdinform',component:crowdinform,meta: { title: '测试众包详情', isAuth: true,type:4}}, // {path:'currentcrowd',component:currentcrowd,meta: { title: '任务详情', isAuth: true,type:4}},
{path:'mycrowd',component:mycrowd,meta: { title: '我的众包', isAuth: true,type:4}}, // {path:'crowdinform',component:crowdinform,meta: { title: '测试众包详情', isAuth: true,type:4}},
{path:'myparticipate',component:myparticipate,meta: { title: '我参与的', isAuth: true,type:4}}, // {path:'mycrowd',component:mycrowd,meta: { title: '我的众包', isAuth: true,type:4}},
{path:'myrelease',component:myrelease,meta: { title: '我发布的', isAuth: true,type:4}}, { path: 'myparticipate', component: myparticipate, meta: { title: '我参与的', isAuth: true, type: 4 } },
{path:'pendingtask',component:pendingtask,meta: { title: '待付款任务', isAuth: true,type:4}}, { path: 'myrelease', component: myrelease, meta: { title: '我发布的', isAuth: true, type: 4 } },
{path:'edittasks',component:edittasks,meta: { title: '重新发布', isAuth: true,type:4}}, // {path:'pendingtask',component:pendingtask,meta: { title: '待付款任务', isAuth: true,type:4}},
{path:'edittasksFB',component:edittasks,meta: { title: '发布任务', isAuth: true,type:4}}, { path: 'edittasks', component: edittasks, meta: { title: '重新发布', isAuth: true, type: 4 } },
{path:'account',component:testKit,meta: { title: '我的测试宝', isAuth: true,type:5}}, { path: 'edittasksFB', component: edittasks, meta: { title: '发布任务', isAuth: true, type: 4 } },
{path:'accountoverview',component:accountoverview,meta: { title: '账户概览', isAuth: true,type:5}}, { path: 'account', component: testKit, meta: { title: '我的测试宝', isAuth: true, type: 5 } },
{path:'transaction',component:transaction,meta: { title: '交易记录', isAuth: true,type:5}}, // {path:'accountoverview',component:accountoverview,meta: { title: '账户概览', isAuth: true,type:5}},
{path:'tranpassword',component:tranpassword,meta: { title: '交易密码', isAuth: true,type:5}}, // {path:'transaction',component:transaction,meta: { title: '交易记录', isAuth: true,type:5}},
{path:'demand',component:demand,meta: { title: '我要用人', isAuth: true,type:6}}, // {path:'tranpassword',component:tranpassword,meta: { title: '交易密码', isAuth: true,type:5}},
{path:'myreview',component:myreview,meta: { title: '我的评价', isAuth: true,type:5}}, { path: 'demand', component: demand, meta: { title: '我要用人', isAuth: true, type: 6 } },
{path:'myBm',component:myBm,meta: { title: '我的培训班', isAuth: true,type:5}}, { path: 'myreview', component: myreview, meta: { title: '我的评价', isAuth: true, type: 5 } },
{ path: 'myBm', component: myBm, meta: { title: '我的培训班', isAuth: true, type: 5 } },
] ]
}, },
@ -150,16 +151,16 @@ const router = new Router({
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// 百度统计 // 百度统计
const tjarr = ['/market', '/crowdsourcing', '/ability' ,'/college', '/about'] const tjarr = ['/market', '/crowdsourcing', '/ability', '/college', '/about']
if (_hmt) { if (_hmt) {
if (tjarr.some(it => it == to.path)) { if (tjarr.some(it => it == to.path)) {
_hmt.push(['_trackPageview', '/' + to.fullPath]); _hmt.push(['_trackPageview', '/' + to.fullPath]);
} }
} }
// console.log(store.getters.companyStatus); // console.log(store.getters.companyStatus);
let token=store.getters.token; let token = store.getters.token;
// if(token){ // if(token){
// store.dispatch("SET_KEYSAASDICT") // store.dispatch("SET_KEYSAASDICT")
// } // }
@ -200,13 +201,13 @@ router.beforeEach((to, from, next) => {
// // next() // // next()
// // } // // }
// } else { // } else {
next() next()
// } // }
}) })
// 解决这个报错:vue-router.esm.js?ac56:2065 Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: "/login?type=log". // 解决这个报错:vue-router.esm.js?ac56:2065 Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: "/login?type=log".
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题 // 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push const originalPush = Router.prototype.push
Router.prototype.push = function push (location) { Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err) return originalPush.call(this, location).catch(err => err)
} }
export default router; export default router;
Loading…
Cancel
Save