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

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

@ -1,11 +1,20 @@
<template>
<div class="bgback">
<div class="headbg">
<div 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; ">
<div
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=""> -->
<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=""> 关键测试宝
<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="" />
关键测试宝
</p>
<!-- <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;">
<el-radio-button type='text' :label="false">展开</el-radio-button>
@ -13,24 +22,28 @@
</el-radio-group> -->
<!-- <p @click='opencollapse' style="cursor:pointer" >展开收齐</p> -->
<svg
@click='opencollapse'
:class="{'is-active':isCollapse}"
@click="opencollapse"
:class="{ 'is-active': isCollapse }"
class="hamburger"
viewBox="0 0 1024 1024"
xmlns="http://www.w3.org/2000/svg"
width="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>
<el-breadcrumb separator="/" style="width:180px">
<el-breadcrumb-item v-for='(item,key) of breadcrumblist' :key="key" >{{item.name}}</el-breadcrumb-item>
<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><a href="/"> :to="{ path: item.path }"活动管理</a></el-breadcrumb-item>
<el-breadcrumb-item>活动列表</el-breadcrumb-item>
<el-breadcrumb-item>活动详情</el-breadcrumb-item> -->
</el-breadcrumb>
</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 class="permissions" @click="mypermissions('shopping')">
<el-badge :value="cartCount" :max="100" :hidden="cartCount==0" :class="cartCount>0?'baggeitem':'baggeitemda'">
@ -39,14 +52,33 @@
<p style="margin-left:5px">购物车</p>
</div> -->
<div class="permissions" @click="mypermissions('message')">
<el-badge :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
: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>
<p style="margin-left:5px">站内消息</p>
<p style="margin-left: 5px">站内消息</p>
</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">
<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"/> -->
</div>
<el-dropdown-menu slot="dropdown">
@ -59,39 +91,31 @@
</div>
</div>
</div>
<div style="display:flex;justify-content:space-between;">
<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'>
<!--打开关闭导航栏 @open="handleOpen" @close="handleClose" -->
<!-- <el-menu-item index="/console">
<i class="el-icon-s-home"></i>
<span slot="title">首页</span>
</el-menu-item> -->
<el-submenu index="2">
<template slot="title">
<!-- <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>
<el-menu-item-group >
<el-menu-item index="/console/toolsmarket">
<i class="el-icon-s-cooperation"></i>
<span>工具市场</span>
<div style="display: flex; justify-content: space-between">
<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"
>
<!-- 企业用户--新菜单 -->
<template v-if="userinform.companyStatus == 2">
<el-menu-item index="/console/myparticipate">
<i class="el-icon-document-copy"></i>
<span>我的众包</span>
</el-menu-item>
<el-menu-item index="/console/orders">
<i class="el-icon-s-order"></i>
<span>我的订单</span>
<el-menu-item index="/console/myrelease">
<i class="el-icon-user"></i>
<span>发布众包任务</span>
</el-menu-item>
<!-- <el-menu-item index="/console/cart">
<i class="el-icon-shopping-cart-2"></i>
<span>我的购物车</span>
</el-menu-item> -->
</el-menu-item-group>
</el-submenu>
<el-submenu index="3">
<template slot="title">
<i class="el-icon-s-finance"></i>
<span slot="title">测试管理</span>
<span slot="title">我的工具</span>
</template>
<el-menu-item-group>
<el-menu-item index="/console/mytools">
@ -100,48 +124,75 @@
</el-menu-item>
<el-menu-item index="/console/mytasks">
<i class="el-icon-s-claim"></i>
<span>我的任务</span>
<span>测试历史</span>
</el-menu-item>
</el-menu-item-group>
</el-submenu>
<el-submenu index="4">
<el-menu-item index="/console/orders">
<i class="el-icon-s-order"></i>
<span>我的订单</span>
</el-menu-item>
<el-menu-item index="/console/demand">
<i class="el-icon-s-unfold"></i>
<span>用人记录</span>
</el-menu-item>
<el-menu-item index="/console/account">
<i class="el-icon-s-shop"></i>
<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="7">
<template slot="title">
<i class="el-icon-s-management"></i>
<span slot="title">众包服务</span>
<i class="el-icon-user-solid"></i>
<span slot="title">个人中心</span>
</template>
<el-menu-item-group>
<!-- <span slot="title">分组一</span> -->
<el-menu-item index="/console/myparticipate">
<i class="el-icon-document-copy"></i>
<span>我参与的</span>
<el-menu-item index="/console/profile">
<span>基本信息</span>
</el-menu-item>
<!-- <el-menu-item index="/console/mycrowd"> -->
<el-menu-item v-if="userinform.companyStatus==2" index="/console/myrelease">
<i class="el-icon-user"></i>
<span>我发布的</span>
<el-menu-item index="/console/message">
<span>消息管理</span>
</el-menu-item>
<!-- <el-menu-item v-if="userinform.companyStatus==2" index="/console/pendingtask">
<i class="el-icon-notebook-2"></i>
<span>待付款任务</span>
</el-menu-item> -->
</el-menu-item-group>
</el-submenu>
</template>
<template v-else>
<el-menu-item index="/console/myparticipate">
<i class="el-icon-document-copy"></i>
<span>我的众包</span>
</el-menu-item>
<el-submenu index="6">
<el-submenu index="3">
<template slot="title">
<i class="el-icon-user-solid"></i>
<span slot="title">人才服务</span>
<i class="el-icon-s-finance"></i>
<span slot="title">我的工具</span>
</template>
<el-menu-item-group>
<el-menu-item index="/console/demand">
<i class="el-icon-s-unfold"></i>
<span>我要用人</span>
<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/demand">
<i class="el-icon-s-unfold"></i>
<span>用人记录</span>
</el-menu-item>
<el-menu-item index="/console/account">
<i class="el-icon-s-shop"></i>
<span slot="title">账户管理</span>
<span slot="title">我的钱包</span>
</el-menu-item>
<el-menu-item index="/console/myBm">
<i class="el-icon-chat-line-round"></i>
@ -149,33 +200,31 @@
</el-menu-item>
<el-menu-item index="/console/myreview">
<i class="el-icon-tickets"></i>
<span slot="title">我的评价</span>
<span slot="title">收到的评价</span>
</el-menu-item>
<!-- <el-submenu index="5">
<el-menu-item index="/console/orders">
<i class="el-icon-s-order"></i>
<span>我的订单</span>
</el-menu-item>
<el-submenu index="7">
<template slot="title">
<i class="el-icon-s-shop"></i>
<span slot="title">账户管理</span>
<i class="el-icon-user-solid"></i>
<span slot="title">个人中心</span>
</template>
<el-menu-item-group>
<el-menu-item index="/console/accountoverview">
<i class="el-icon-s-unfold"></i>
<span>账户概览</span>
</el-menu-item>
<el-menu-item index="/console/transaction">
<i class="el-icon-s-order"></i>
<span>交易记录</span>
<el-menu-item index="/console/profile">
<span>基本信息</span>
</el-menu-item>
<el-menu-item index="/console/tranpassword">
<i class="el-icon-lock"></i>
<span>交易密码</span>
<el-menu-item index="/console/message">
<span>消息管理</span>
</el-menu-item>
</el-menu-item-group>
</el-submenu> -->
</el-submenu>
</template>
</el-menu>
</div>
<div class="content-wrapper" :style="[{'padding-left':isCollapse?'100px':'240px'}]">
<transition name="fade" mode="out-in" >
<div class="content-wrapper" :style="[{ 'padding-left': isCollapse ? '100px' : '240px' }]">
<transition name="fade" mode="out-in">
<router-view></router-view>
</transition>
</div>
@ -183,87 +232,87 @@
</div>
</template>
<script>
import {mapGetters} from "vuex";
import store from "@/store";
import {listMyMessageCount} from '@/api/system/message'
export default{
data(){
return{
isCollapse: false ,
currentactive:'',
import { mapGetters } from 'vuex'
import store from '@/store'
import { listMyMessageCount } from '@/api/system/message'
export default {
data() {
return {
isCollapse: false,
currentactive: '',
screenWidth: document.body.clientWidth,
breadcrumblist:[],//
breadcrumblist: [], //
messageCount: 0,
cartCount: 0
cartCount: 0,
}
},
watch:{
$route:{
watch: {
$route: {
handler(val, old) {
let curetoter=val.path.substr(10);
this.breadcrumblist=[];
if(val.meta.type==1){
this.breadcrumblist.push({name:'首页'},{name:val.meta.title})
let curetoter = val.path.substr(10)
this.breadcrumblist = []
if (val.meta.type == 1) {
this.breadcrumblist.push({ name: '首页' }, { name: val.meta.title })
}
if(val.meta.type==2){
this.breadcrumblist.push({name:'工具市场'},{name:val.meta.title})
if (val.meta.type == 2) {
this.breadcrumblist.push({ name: '工具市场' }, { name: val.meta.title })
}
if(val.meta.type==3){
this.breadcrumblist.push({name:'测试管理'},{name:val.meta.title})
if (val.meta.type == 3) {
this.breadcrumblist.push({ name: '测试管理' }, { name: val.meta.title })
}
if(val.meta.type==4){
this.breadcrumblist.push({name:'众包服务'},{name:val.meta.title})
if (val.meta.type == 4) {
this.breadcrumblist.push({ name: '众包服务' }, { name: val.meta.title })
}
},
immediate:true
immediate: true,
},
screenWidth(val){
screenWidth(val) {
// resize使
if(!this.timer){
if (!this.timer) {
// screenWidthdatascreenWidth
this.screenWidth = val
this.timer = true
let that = this
setTimeout(function(){
setTimeout(function () {
// screenWidth
if(that.screenWidth<1500){
that.isCollapse=true
}else{
that.isCollapse=false
if (that.screenWidth < 1500) {
that.isCollapse = true
} else {
that.isCollapse = false
}
that.timer = false
},400)
}, 400)
}
},
count(newVal, oldVal) {
this.messageCount = newVal;
this.messageCount = newVal
},
cartCountW(newVal, oldVal) {
this.cartCount = newVal;
}
this.cartCount = newVal
},
},
created(){
if(this.token){
listMyMessageCount().then(response => {
this.messageCount = response.data;
this.cartCount = response.cartCount;
store.commit('SET_MESSAGECOUNT', this.messageCount);
store.commit('SET_CARTCOUNT', this.cartCount);
created() {
if (this.token) {
listMyMessageCount().then((response) => {
this.messageCount = response.data
this.cartCount = response.cartCount
store.commit('SET_MESSAGECOUNT', this.messageCount)
store.commit('SET_CARTCOUNT', this.cartCount)
})
}
},
computed: {
...mapGetters(['token','logindate','avatar','userinform']),
...mapGetters(['token', 'logindate', 'avatar', 'userinform']),
count() {
return store.getters.messageCount;  //
return store.getters.messageCount //
},
cartCountW() {
return store.getters.cartCount; //
return store.getters.cartCount //
},
},
mounted(){
mounted() {
// this.currentactive=this.$route.path.substr(10);
this.currentactive=this.$route.path
this.currentactive = this.$route.path
const that = this
window.onresize = () => {
return (() => {
@ -272,31 +321,32 @@
})()
}
},
methods:{
methods: {
//logo
tishou(){
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('登录状态失效,请您重新登录' , '提示', {
mypermissions(type) {
let currentdata = Date.parse(new Date())
let logindate = this.logindate
let timedifference = currentdata - (parseInt(logindate) + 432000000)
if (timedifference > 0) {
this.$confirm('登录状态失效,请您重新登录', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(()=> {
type: 'warning',
})
.then(() => {
this.$router.push('/login?type=log')
}).catch(()=>{
})
}else{
if(type=='message'){
.catch(() => {})
} else {
if (type == 'message') {
this.$router.push('/console/message')
}else if(type=='shopping'){
} else if (type == 'shopping') {
this.$router.push('/console/cart')
}else if(type=='imembers'){
} else if (type == 'imembers') {
this.$router.push('/console/profile')
}
}
@ -306,7 +356,7 @@
this.$confirm('确定退出登录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
// this.$router.push('/')
@ -315,8 +365,8 @@
})
},
//
opencollapse(){
this.isCollapse=!this.isCollapse
opencollapse() {
this.isCollapse = !this.isCollapse
},
// //
// handleOpen(key, keyPath) {
@ -325,18 +375,16 @@
// handleClose(key, keyPath) {
// },
},
}
}
</script>
<style scoped>
.bgback{
.bgback {
/* background-color:#F0F2F5!important;
background-color: #FFFFFF!important; */
width:100vw;
height:100vh;
}
.headbg{
width: 100vw;
height: 100vh;
}
.headbg {
/* width:1200px;
margin:0 auto; */
width: 100vw;
@ -346,56 +394,56 @@
justify-content:space-between;
align-items:center; */
/* height:50px; */
z-index:99;
background-color: #FFFFFF;
z-index: 99;
background-color: #ffffff;
box-shadow: 0px 1px 8px 0px rgba(0, 0, 0, 0.11);
}
.permissions{
display:flex;
align-items:center;
margin-left:10px;
}
.permissions {
display: flex;
align-items: center;
margin-left: 10px;
margin-right: 20px;
cursor:pointer;
}
.avatar-wrapper img:hover{
opacity:0.5;
cursor: pointer;
}
.avatar-wrapper img:hover {
opacity: 0.5;
/* transition: 0.3s; */
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
width:100%;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
width: 100%;
min-height: 400px;
height:95vh
}
.hamburger {
height: 95vh;
}
.hamburger {
display: inline-block;
vertical-align: middle;
width: 20px;
height: 20px;
}
.hamburger.is-active {
}
.hamburger.is-active {
transform: rotate(180deg);
}
.el-menu--collapse{
height:92vh
}
.content-wrapper{
padding:100px 20px 0 249px;
}
.el-menu--collapse {
height: 92vh;
}
.content-wrapper {
padding: 100px 20px 0 249px;
box-sizing: border-box;
width: 100vw;
/* background:#666666!important */
}
.baggeitem {
margin-top:5px;
margin-right:15px;
}
.baggeitemda {
margin-top:5px;
}
.baggeitem {
margin-top: 5px;
margin-right: 15px;
}
.baggeitemda {
margin-top: 5px;
/* margin-right:10px; */
}
.el-dropdown-menu__item{
padding:0 20px!important;
}
.el-dropdown-menu{
top:56px!important
}
}
.el-dropdown-menu__item {
padding: 0 20px !important;
}
.el-dropdown-menu {
top: 56px !important;
}
</style>

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