fix:性能测试-测试
This commit is contained in:
@@ -29,7 +29,11 @@
|
|||||||
@click="handleClickLoad">引用接口自动化场景</el-button>
|
@click="handleClickLoad">引用接口自动化场景</el-button>
|
||||||
<el-table :data="changeList">
|
<el-table :data="changeList">
|
||||||
<el-table-column prop="name" label="场景名称" />
|
<el-table-column prop="name" label="场景名称" />
|
||||||
<el-table-column prop="status" label="Enable/Disable" />
|
<el-table-column prop="status" label="Enable/Disable">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-switch v-model="scope.row.status" active-value="1" inactive-value="0"></el-switch>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="action" label="操作">
|
<el-table-column prop="action" label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" icon="el-icon-delete" style="color: red;"
|
<el-button type="text" icon="el-icon-delete" style="color: red;"
|
||||||
@@ -243,6 +247,10 @@ export default {
|
|||||||
handleWithSaveAndExecute() {
|
handleWithSaveAndExecute() {
|
||||||
this.validationForm()
|
this.validationForm()
|
||||||
if (this.validation === false) { return }
|
if (this.validation === false) { return }
|
||||||
|
if (this.addForm.crontab === '' || this.addForm.crontab === null) {
|
||||||
|
this.$message({ message: '请输入Crontab表达式', type: 'warning' })
|
||||||
|
return
|
||||||
|
}
|
||||||
// 需要校验crontab表达式
|
// 需要校验crontab表达式
|
||||||
addAndExecuteTest(this.addForm).then(res => {
|
addAndExecuteTest(this.addForm).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
@@ -300,6 +308,9 @@ export default {
|
|||||||
},
|
},
|
||||||
handleWithSure() {
|
handleWithSure() {
|
||||||
this.changeList = this.multipleSelection
|
this.changeList = this.multipleSelection
|
||||||
|
this.changeList.forEach(item => {
|
||||||
|
item.status = '1'
|
||||||
|
})
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
},
|
},
|
||||||
switchChange(val) {
|
switchChange(val) {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<el-button style="margin-top: 10px; margin-bottom: 10px;" icon="el-icon-share"
|
<el-button style="margin-top: 10px; margin-bottom: 10px;" icon="el-icon-share"
|
||||||
@click="handleClickLoad">引用接口自动化场景</el-button>
|
@click="handleClickLoad">引用接口自动化场景</el-button>
|
||||||
<el-table :data="changeList">
|
<el-table :data="changeList">
|
||||||
<el-table-column prop="name" label="场景名称" />
|
<el-table-column prop="testCaseName" label="场景名称" />
|
||||||
<el-table-column prop="status" label="Enable/Disable">
|
<el-table-column prop="status" label="Enable/Disable">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch v-model="scope.row.status" active-value="1" inactive-value="0"></el-switch>
|
<el-switch v-model="scope.row.status" active-value="1" inactive-value="0"></el-switch>
|
||||||
@@ -198,6 +198,7 @@ export default {
|
|||||||
time: "2025-02-22 10:00:00",
|
time: "2025-02-22 10:00:00",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
validation: false, // 校验
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -205,15 +206,30 @@ export default {
|
|||||||
this.getTestDetailData()
|
this.getTestDetailData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 校验
|
||||||
|
validationForm() {
|
||||||
|
if (this.addForm.performanceName === '' || this.addForm.performanceName === null) {
|
||||||
|
this.$message({ message: '请输入测试名称', type: 'warning' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.addForm.errorOperType === '' || this.addForm.errorOperType === null) {
|
||||||
|
this.$message({ message: '请填写取样器错误后', type: 'warning' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.addForm.executeType === '' || this.addForm.executeType === null) {
|
||||||
|
this.$message({ message: '请选择执行方式', type: 'warning' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.validation = true
|
||||||
|
},
|
||||||
// 保存
|
// 保存
|
||||||
handleWithSave() {
|
handleWithSave() {
|
||||||
this.changeList.forEach(item => {
|
this.validationForm()
|
||||||
const par = {
|
if (this.validation === false) { return }
|
||||||
testCaseId: item.id,
|
this.addForm.performanceTestCaseVOList = this.changeList
|
||||||
status: item.status
|
|
||||||
}
|
|
||||||
this.addForm.performanceTestCaseVOList.push(par)
|
|
||||||
})
|
|
||||||
editTest(this.addForm).then(res => {
|
editTest(this.addForm).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.$message({ message: '编辑成功', type: 'success' })
|
this.$message({ message: '编辑成功', type: 'success' })
|
||||||
@@ -225,6 +241,12 @@ export default {
|
|||||||
},
|
},
|
||||||
// 保存并执行
|
// 保存并执行
|
||||||
handleWithSaveAndExecute() {
|
handleWithSaveAndExecute() {
|
||||||
|
this.validationForm()
|
||||||
|
if (this.validation === false) { return }
|
||||||
|
if (this.addForm.crontab === '' || this.addForm.crontab === null) {
|
||||||
|
this.$message({ message: '请输入Crontab表达式', type: 'warning' })
|
||||||
|
return
|
||||||
|
}
|
||||||
editAndExecuteTest(this.addForm).then(res => {
|
editAndExecuteTest(this.addForm).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.$message({ message: '编辑成功', type: 'success' })
|
this.$message({ message: '编辑成功', type: 'success' })
|
||||||
@@ -253,17 +275,29 @@ export default {
|
|||||||
// 加载jmx文件
|
// 加载jmx文件
|
||||||
handleClickLoad() {
|
handleClickLoad() {
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
let array = this.multipleSelection
|
||||||
|
this.sceneList.forEach(row => {
|
||||||
|
if (array.includes(row)) {
|
||||||
|
this.$refs.tableRef.toggleRowSelection(row, true);
|
||||||
|
} else {
|
||||||
|
this.$refs.tableRef.toggleRowSelection(row, false);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
hadleClickDelete(val) {
|
hadleClickDelete(val) {
|
||||||
this.changeList = this.changeList.filter(item => item !== val);
|
this.changeList = this.changeList.filter(item => item !== val);
|
||||||
this.multipleSelection = this.multipleSelection.filter(item => item !== val);
|
console.log(this.changeList)
|
||||||
|
this.multipleSelection = []
|
||||||
this.sceneList.forEach(row => {
|
this.sceneList.forEach(row => {
|
||||||
if (this.multipleSelection.includes(row)) {
|
this.changeList.forEach(item => {
|
||||||
this.$refs.tableRef.toggleRowSelection(row, true);
|
if (row.id === item.testCaseId) {
|
||||||
} else {
|
this.multipleSelection.push(row)
|
||||||
this.$refs.tableRef.toggleRowSelection(row, false);
|
}
|
||||||
}
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// netWorking
|
// netWorking
|
||||||
@@ -280,6 +314,18 @@ export default {
|
|||||||
getTestDetail(this.$route.query.id).then(res => {
|
getTestDetail(this.$route.query.id).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.addForm = res.data
|
this.addForm = res.data
|
||||||
|
res.data.performanceTestCaseVOList.forEach(item => {
|
||||||
|
item.status = String(item.status)
|
||||||
|
})
|
||||||
|
this.changeList = res.data.performanceTestCaseVOList
|
||||||
|
this.sceneList.forEach(row => {
|
||||||
|
this.changeList.forEach(item => {
|
||||||
|
if (row.id === item.testCaseId) {
|
||||||
|
this.multipleSelection.push(row)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.addForm.rpsStatus = String(res.data.rpsStatus)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -299,7 +345,16 @@ export default {
|
|||||||
this.multipleSelection = val;
|
this.multipleSelection = val;
|
||||||
},
|
},
|
||||||
handleWithSure() {
|
handleWithSure() {
|
||||||
this.changeList = this.multipleSelection
|
this.changeList = []
|
||||||
|
this.multipleSelection.forEach(item => {
|
||||||
|
var par = {
|
||||||
|
testCaseId: item.id,
|
||||||
|
status: '1',
|
||||||
|
testCaseName: item.name
|
||||||
|
}
|
||||||
|
this.changeList.push(par)
|
||||||
|
})
|
||||||
|
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
},
|
},
|
||||||
switchChange(val) {
|
switchChange(val) {
|
||||||
|
|||||||
Reference in New Issue
Block a user