去掉无用代码

This commit is contained in:
q4speed 2020-06-02 16:09:35 +08:00
parent 8e52fc7266
commit 74a49ae13f
1 changed files with 14 additions and 56 deletions

View File

@ -2,38 +2,35 @@
<div id="menu-bar"> <div id="menu-bar">
<el-row type="flex"> <el-row type="flex">
<el-col :span="8"> <el-col :span="8">
<el-menu class="header-menu" :unique-opened="true" mode="horizontal" router :default-active='$route.path'> <el-menu class="header-menu" :unique-opened="true" mode="horizontal" router :default-active='$route.path'
menu-trigger="click">
<el-menu-item :index="'/api/home'"> <el-menu-item :index="'/api/home'">
{{ $t("i18n.home") }} {{ $t("i18n.home") }}
</el-menu-item> </el-menu-item>
<el-submenu v-if="isCurrentWorkspaceUser" <el-submenu v-if="isCurrentWorkspaceUser" index="3">
index="3" popper-class="submenu">
<template v-slot:title>{{$t('commons.project')}}</template> <template v-slot:title>{{$t('commons.project')}}</template>
<ms-recent-list :options="projectRecent"/> <ms-recent-list :options="projectRecent"/>
<el-divider/> <el-divider class="menu-divider"/>
<ms-show-all :index="'/api/project/all'"/> <ms-show-all :index="'/api/project/all'"/>
<ms-create-button v-permission="['test_manager', 'test_user']" :index="'/api/project/create'" :title="$t('project.create')"/> <ms-create-button v-permission="['test_manager', 'test_user']" :index="'/api/project/create'"
:title="$t('project.create')"/>
</el-submenu> </el-submenu>
<el-submenu v-if="isCurrentWorkspaceUser" <el-submenu v-if="isCurrentWorkspaceUser" index="4">
index="4" popper-class="submenu">
<template v-slot:title>{{$t('commons.test')}}</template> <template v-slot:title>{{$t('commons.test')}}</template>
<ms-recent-list :options="testRecent"/> <ms-recent-list :options="testRecent"/>
<el-divider/> <el-divider class="menu-divider"/>
<ms-show-all :index="'/api/test/list/all'"/> <ms-show-all :index="'/api/test/list/all'"/>
<ms-create-button v-permission="['test_manager', 'test_user']" :index="'/api/test/create'" :title="$t('load_test.create')"/> <ms-create-button v-permission="['test_manager', 'test_user']" :index="'/api/test/create'"
<!-- <el-menu-item :index="testCaseProjectPath" class="blank_item"></el-menu-item>--> :title="$t('load_test.create')"/>
<!-- <el-menu-item :index="testEditPath" class="blank_item"></el-menu-item>-->
</el-submenu> </el-submenu>
<el-submenu v-if="isCurrentWorkspaceUser" <el-submenu v-if="isCurrentWorkspaceUser" index="5">
index="5" popper-class="submenu">
<template v-slot:title>{{$t('commons.report')}}</template> <template v-slot:title>{{$t('commons.report')}}</template>
<ms-recent-list :options="reportRecent"/> <ms-recent-list :options="reportRecent"/>
<el-divider/> <el-divider class="menu-divider"/>
<ms-show-all :index="'/api/report/list/all'"/> <ms-show-all :index="'/api/report/list/all'"/>
<!-- <el-menu-item :index="reportViewPath" class="blank_item"></el-menu-item>-->
</el-submenu> </el-submenu>
</el-menu> </el-menu>
</el-col> </el-col>
@ -62,10 +59,6 @@
data() { data() {
return { return {
isCurrentWorkspaceUser: false, isCurrentWorkspaceUser: false,
// testCaseProjectPath: '',
// testEditPath: '',
// reportViewPath: '',
// isRouterAlive: true,
projectRecent: { projectRecent: {
title: this.$t('project.recent'), title: this.$t('project.recent'),
url: "/project/recent/5", url: "/project/recent/5",
@ -96,55 +89,20 @@
} }
} }
}, },
// watch: {
// '$route'(to, from) {
// let path = to.path;
// //
// if (path.indexOf("/api/test/") >= 0) {
// this.testCaseProjectPath = '/api/test/' + this.$route.params.projectId;
// this.reload();
// }
// if (path.indexOf("/api/test/edit/") >= 0) {
// this.testEditPath = '/api/test/edit/' + this.$route.params.testId;
// this.reload();
// }
// if (path.indexOf("/api/report/view/") >= 0) {
// this.reportViewPath = '/api/report/view/' + this.$route.params.reportId;
// this.reload();
// }
// }
// },
mounted() { mounted() {
this.isCurrentWorkspaceUser = checkoutCurrentWorkspace(); this.isCurrentWorkspaceUser = checkoutCurrentWorkspace();
}, },
// methods: {
// reload() {
// this.isRouterAlive = false;
// this.$nextTick(function () {
// this.isRouterAlive = true;
// })
// }
// }
} }
</script> </script>
<style scoped> <style scoped>
.el-divider--horizontal {
margin: 0;
}
.el-menu.el-menu--horizontal {
border-bottom: none;
}
#menu-bar { #menu-bar {
border-bottom: 1px solid #E6E6E6; border-bottom: 1px solid #E6E6E6;
background-color: #FFF; background-color: #FFF;
} }
.blank_item { .menu-divider {
display: none; margin: 0;
} }
</style> </style>