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