Commit 8e2c4828 authored by 王晓铜's avatar 王晓铜

样式修改

parent 6bffc0e6
...@@ -46,3 +46,11 @@ export function executeScene(queryInfo) { ...@@ -46,3 +46,11 @@ export function executeScene(queryInfo) {
params: queryInfo params: queryInfo
}) })
} }
// 编辑场景接口
export function editScene(data) {
return request({
url: '/auto/scene/modify',
method: 'post',
data
})
}
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<el-option v-for="item in modelList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in modelList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<el-input v-model="queryModuleInfo.testcaseName" clearable placeholder="请输入用例名称" style="width: 300px;"></el-input> <el-input v-model="queryModuleInfo.testcaseName" clearable placeholder="请输入用例名称" style="width: 300px;"></el-input>
<el-button type="primary" style="margin-left:20px" icon="el-icon-search" @click="queryData">查询</el-button> <el-button type="primary" style="margin-left:10px" icon="el-icon-search" @click="queryData">查询</el-button>
<el-button type="primary" style="margin-left:20px" icon="el-icon-circle-plus" @click="addPage">新增</el-button> <el-button type="primary" style="margin-left:10px" icon="el-icon-circle-plus" @click="addPage">新增</el-button>
</div> </div>
<el-table :data="singleCaseList" border style="width: 100%;margin-top:20px"> <el-table :data="singleCaseList" border style="width: 100%;margin-top:20px">
<el-table-column type='index' width="50px"></el-table-column> <el-table-column type='index' width="50px"></el-table-column>
......
...@@ -688,8 +688,10 @@ export default { ...@@ -688,8 +688,10 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
div-style { .el-select {
margin: 20px, 0, 0, 0; width:220px
float: right; }
.input{
width:300px;
} }
</style> </style>
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<el-option v-for="item in modelList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in modelList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<el-input v-model="queryModuleInfo.interfaceName" clearable placeholder="请输入接口名称" style="width: 300px;"></el-input> <el-input v-model="queryModuleInfo.interfaceName" clearable placeholder="请输入接口名称" style="width: 300px;"></el-input>
<el-button type="primary" style="margin-left:20px" icon="el-icon-search" @click="queryData">查询</el-button> <el-button type="primary" style="margin-left:10px" icon="el-icon-search" @click="queryData">查询</el-button>
<el-button type="primary" style="margin-left:20px" icon="el-icon-circle-plus" @click="addPage">新增</el-button> <el-button type="primary" style="margin-left:10px" icon="el-icon-circle-plus" @click="addPage">新增</el-button>
</div> </div>
<el-table :data="interfaceList" border style="width: 100%;margin-top:20px"> <el-table :data="interfaceList" border style="width: 100%;margin-top:20px">
<el-table-column type='index' width="50px"></el-table-column> <el-table-column type='index' width="50px"></el-table-column>
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<div> <div>
场景名称: 场景名称:
<el-input v-model="queryModuleInfo.sceneName" clearable placeholder="请输入场景名称" style="width: 300px;"></el-input> <el-input v-model="queryModuleInfo.sceneName" clearable placeholder="请输入场景名称" style="width: 300px;"></el-input>
<el-button type="primary" style="margin-left:20px" icon="el-icon-search" @click="queryData">查询</el-button> <el-button type="primary" style="margin-left:10px" icon="el-icon-search" @click="queryData">查询</el-button>
<el-button type="primary" style="margin-left:20px" icon="el-icon-circle-plus" @click="DialogVisible = true">新增</el-button> <el-button type="primary" style="margin-left:10px" icon="el-icon-circle-plus" @click="DialogVisible = true">新增</el-button>
</div> </div>
<el-table :data="sceneList" border style="width: 100%;margin-top:20px"> <el-table :data="sceneList" border style="width: 100%;margin-top:20px">
<el-table-column type='index' width="50px"></el-table-column> <el-table-column type='index' width="50px"></el-table-column>
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
<el-table-column label="操作"> <el-table-column label="操作">
<slot slot-scope="scope"> <slot slot-scope="scope">
<el-button type="success" icon="el-icon-link" @click="executeSceneFrom(scope.row)">执行</el-button> <el-button type="success" icon="el-icon-link" @click="executeSceneFrom(scope.row)">执行</el-button>
<el-button type="warning" icon="el-icon-edit" @click="editeSceneFrom(scope.row)">编辑</el-button> <el-button type="warning" icon="el-icon-edit" @click="editeSceneFrom(scope.row)">编辑场景</el-button>
<el-button type="warning" icon="el-icon-edit" @click="editeSceneCaseFrom(scope.row)">编辑场景用例</el-button>
<el-button type="danger" icon="el-icon-delete" @click="deleSceneFrom(scope.row)">删除</el-button> <el-button type="danger" icon="el-icon-delete" @click="deleSceneFrom(scope.row)">删除</el-button>
</slot> </slot>
</el-table-column> </el-table-column>
...@@ -59,7 +60,8 @@ import { ...@@ -59,7 +60,8 @@ import {
getSceneList, getSceneList,
addSecene, addSecene,
delSecne, delSecne,
executeScene executeScene,
editScene
} from '@/api/getAutoScene' } from '@/api/getAutoScene'
import { getProjectList } from '@/api/getAotoInterface' import { getProjectList } from '@/api/getAotoInterface'
export default { export default {
...@@ -146,6 +148,11 @@ export default { ...@@ -146,6 +148,11 @@ export default {
}, },
// 编辑场景 // 编辑场景
editeSceneFrom(row) { editeSceneFrom(row) {
this.DialogVisible = true
this.sceneForm = row
},
// 编辑场景用例
editeSceneCaseFrom(row) {
window.sessionStorage.setItem('curScene', JSON.stringify(row)) window.sessionStorage.setItem('curScene', JSON.stringify(row))
this.$router.push({ path: 'EditScene' }) this.$router.push({ path: 'EditScene' })
// bus使用 // bus使用
...@@ -196,13 +203,31 @@ export default { ...@@ -196,13 +203,31 @@ export default {
}, },
// 添加场景 // 添加场景
addSceneFrom() { addSceneFrom() {
addSecene(this.sceneForm).then((resp) => { this.$refs.sceneFormAddRef.validate((valid) => {
if (resp.data.data === true) { if (!valid) {
this.DialogVisible = false return false
this.$message.success('新增成功!')
this.getSecneList()
} else { } else {
this.$message.error(resp.data.msg) if (this.sceneForm.id) {
editScene(this.sceneForm).then((resp) => {
if (resp.data.data === true) {
this.DialogVisible = false
this.$message.success('修改成功!')
this.getSecneList()
} else {
this.$message.error(resp.data.msg)
}
})
} else {
addSecene(this.sceneForm).then((resp) => {
if (resp.data.data === true) {
this.DialogVisible = false
this.$message.success('新增成功!')
this.getSecneList()
} else {
this.$message.error(resp.data.msg)
}
})
}
} }
}) })
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment