Merge branch 'dev' of github.com:fit2cloudrd/metersphere-server into dev

This commit is contained in:
Captain.B 2020-04-09 16:04:26 +08:00
commit abcc06c318
8 changed files with 16 additions and 193 deletions

View File

@ -1,53 +0,0 @@
<template>
<div>
<div class="recent-text">
<i class="el-icon-time"/>
<span>{{$t('project.recent')}}</span>
</div>
<el-menu-item :key="p.id" v-for="p in recentProjects"
:index="'/api/' + p.id" :route="{name:'fucPlan', params:{projectId:p.id, projectName:p.name}}">
<span class="title">{{ p.name }}</span>
</el-menu-item>
</div>
</template>
<script>
import {ROLE_TEST_MANAGER, ROLE_TEST_USER, ROLE_TEST_VIEWER} from "../../../../common/js/constants";
import {hasRoles} from "../../../../common/js/utils";
export default {
name: "ApiRecentProject",
mounted() {
if (hasRoles(ROLE_TEST_VIEWER, ROLE_TEST_USER, ROLE_TEST_MANAGER)) {
this.$get('/project/recent/5', (response) => {
this.recentProjects = response.data;
});
}
},
methods: {},
data() {
return {
recentProjects: [],
}
}
}
</script>
<style scoped>
.recent-text {
padding: 0 10px;
margin-top: -5px;
line-height: 36px;
color: #777777;
background-color: #F5F5F5;
}
.recent-text span {
padding-left: 6px;
}
.title {
padding-left: 20px;
}
</style>

View File

@ -1,54 +0,0 @@
<template>
<div>
<div class="recent-text">
<i class="el-icon-time"/>
<span>{{$t('load_test.recent')}}</span>
</div>
<el-menu-item :key="p.id" v-for="p in recentReports"
:index="'/api/report/view/' + p.id" :route="{path: '/api/report/view/' + p.id}">
<span class="title">{{ p.name }}</span>
</el-menu-item>
</div>
</template>
<script>
import {ROLE_TEST_MANAGER, ROLE_TEST_USER, ROLE_TEST_VIEWER} from "../../../../common/js/constants";
export default {
name: "ApiRecentReport",
mounted() {
const rolesString = localStorage.getItem("roles");
const roles = rolesString.split(',');
if (roles.indexOf(ROLE_TEST_MANAGER) > -1 || roles.indexOf(ROLE_TEST_USER) > -1 || roles.indexOf(ROLE_TEST_VIEWER) > -1) {
this.$get('/api/report/recent/5', (response) => {
this.recentReports = response.data;
});
}
},
methods: {},
data() {
return {
recentReports: [],
}
}
}
</script>
<style scoped>
.recent-text {
padding: 0 10px;
margin-top: -5px;
line-height: 36px;
color: #777777;
background-color: #F5F5F5;
}
.recent-text span {
padding-left: 6px;
}
.title {
padding-left: 20px;
}
</style>

View File

@ -1,6 +1,5 @@
<template> <template>
<div class="testreport-container" v-loading="result.loading"> <div class="container" v-loading="result.loading">
<div class="main-content"> <div class="main-content">
<el-card> <el-card>
<template v-slot:header> <template v-slot:header>
@ -75,7 +74,6 @@
</div> </div>
</el-card> </el-card>
</div> </div>
</div> </div>
</template> </template>
@ -145,7 +143,7 @@
}); });
}, },
_handleDelete(report) { _handleDelete(report) {
this.result = this.$post(this.deletePath + report.id, {},() => { this.result = this.$post(this.deletePath + report.id, {}, () => {
this.$message({ this.$message({
message: this.$t('commons.delete_success'), message: this.$t('commons.delete_success'),
type: 'success' type: 'success'
@ -158,20 +156,6 @@
</script> </script>
<style scoped> <style scoped>
.testreport-container {
padding: 15px;
width: 100%;
height: 100%;
box-sizing: border-box;
}
.main-content {
margin: 0 auto;
width: 100%;
max-width: 1200px;
}
.test-content { .test-content {
width: 100%; width: 100%;
} }

View File

@ -1,41 +0,0 @@
<template>
<el-menu router menu-trigger="click" :default-active="$route.path">
<div class="recent-text">
<i class="el-icon-time"/>
{{$t('load_test.recent')}}
</div>
<el-menu-item :key="t.id" v-for="t in recentTestPlans" :index="'/api/test/edit/' + t.id">
{{ t.name }}
</el-menu-item>
</el-menu>
</template>
<script>
import {ROLE_TEST_MANAGER, ROLE_TEST_USER, ROLE_TEST_VIEWER} from "../../../../common/js/constants";
import {hasRoles} from "../../../../common/js/utils";
export default {
name: "ApiRecentTest",
mounted() {
if (hasRoles(ROLE_TEST_VIEWER, ROLE_TEST_USER, ROLE_TEST_MANAGER)) {
this.$get('/api/recent/5', (response) => {
this.recentTestPlans = response.data;
});
}
},
data() {
return {
recentTestPlans: []
}
}
}
</script>
<style scoped>
.recent-text {
padding-left: 10%;
color: #777777;
}
</style>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="testplan-container" v-loading="result.loading"> <div class="container" v-loading="result.loading">
<div class="main-content"> <div class="main-content">
<el-card> <el-card>
<template v-slot:header> <template v-slot:header>
@ -172,19 +172,6 @@
</script> </script>
<style scoped> <style scoped>
.testplan-container {
padding: 15px;
width: 100%;
height: 100%;
box-sizing: border-box;
}
.main-content {
margin: 0 auto;
width: 100%;
max-width: 1200px;
}
.test-content { .test-content {
width: 100%; width: 100%;
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="project-container"> <div class="container">
<div class="main-content"> <div class="main-content">
<el-card v-loading="result.loading"> <el-card v-loading="result.loading">
<template v-slot:header> <template v-slot:header>
@ -193,18 +193,6 @@
</script> </script>
<style scoped> <style scoped>
.project-container {
padding: 15px;
width: 100%;
height: 100%;
box-sizing: border-box;
}
.main-content {
margin: 0 auto;
width: 100%;
max-width: 1200px;
}
.table-page { .table-page {
padding-top: 20px; padding-top: 20px;

View File

@ -12,6 +12,7 @@ import store from "./store";
import {permission} from './permission' import {permission} from './permission'
import chart from "../common/js/chart"; import chart from "../common/js/chart";
import '../common/css/menu-header.css'; import '../common/css/menu-header.css';
import '../common/css/main.css';
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(icon); Vue.use(icon);

View File

@ -0,0 +1,11 @@
.container {
padding: 15px;
width: 100%;
height: 100%;
box-sizing: border-box;
}
.main-content {
margin: 0 auto;
width: 100%;
}