Merge branch 'master' into dev

# Conflicts:
#	frontend/src/performance/components/router/router.js
This commit is contained in:
Captain.B 2020-02-12 13:37:56 +08:00
commit 041093d292
7 changed files with 109 additions and 4 deletions

2
.gitignore vendored
View File

@ -15,7 +15,7 @@ yarn-error.log*
# Editor directories and files # Editor directories and files
.idea .idea
frontend.iml **/*.iml
.vscode .vscode
*.suo *.suo
*.ntvs* *.ntvs*

View File

@ -10,7 +10,7 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-row type="flex" justify="center" align="middle"> <el-row type="flex" justify="center" align="middle">
<el-button type="primary" size="small">创建测试</el-button> <el-button type="primary" size="small" @click="createTest">创建测试</el-button>
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
@ -47,7 +47,12 @@
window.location.href = "/login" window.location.href = "/login"
}); });
}, },
components: {MsWebSocket, MsUser, MsMenus, MsSetting, MsView} components: {MsWebSocket, MsUser, MsMenus, MsSetting, MsView},
methods: {
createTest() {
this.$router.push({path: '/createTest'})
}
}
} }
</script> </script>

View File

@ -4,6 +4,7 @@ import RouterSidebar from "./RouterSidebar";
import Setting from "../settings/Setting"; import Setting from "../settings/Setting";
import Workspace from "../settings/Workspace"; import Workspace from "../settings/Workspace";
import User from "../settings/User"; import User from "../settings/User";
import CreateTestPlan from "../testPlan/CreateTestPlan";
Vue.use(VueRouter); Vue.use(VueRouter);
@ -27,7 +28,12 @@ const router = new VueRouter({
component: User component: User
} }
] ]
}] },
{
path: "/createTest", components: {
content: CreateTestPlan
}
},]
}); });
export default router export default router

View File

@ -0,0 +1,46 @@
<template>
<div class="container">
<el-tabs v-model="active">
<el-tab-pane
v-for="item in tabs"
:key="item.id"
:label="item.title"
>
<component :is="active === item.id ? item.component : false"/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import BasicConfig from './components/BasicConfig';
import PressureConfig from './components/PressureConfig';
import AdvancedConfig from './components/AdvancedConfig';
export default {
name: "CreateTestPlan",
components: {
BasicConfig,
PressureConfig,
AdvancedConfig
},
data () {
return {
active: '0',
tabs: [{
title: '场景配置',
id: '0',
component: 'BasicConfig'
}, {
title: '压力配置',
id: '1',
component: 'PressureConfig'
}, {
title: '高级配置',
id: '2',
component: 'AdvancedConfig'
}]
}
}
}
</script>

View File

@ -0,0 +1,16 @@
<style>
</style>
<template>
<div>我是第三个子组件</div>
</template>
<script>
export default {
data() {
return {
}
}
}
</script>

View File

@ -0,0 +1,16 @@
<style>
</style>
<template>
<div>我是第一个子组件</div>
</template>
<script>
export default {
data() {
return {
}
}
}
</script>

View File

@ -0,0 +1,16 @@
<style>
</style>
<template>
<div>我是第二个子组件</div>
</template>
<script>
export default {
data() {
return {
}
}
}
</script>