Commit 06c7b874 authored by 王晓铜's avatar 王晓铜

更新合并代码问题

parents ef947120 9daff845
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
<el-table :data="databaseList" border class="table-style" style="width:95%"> <el-table :data="databaseList" border class="table-style" style="width:95%">
<el-table-column label="数据库名称" width="210"> <el-table-column label="数据库名称" width="210">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.db" placeholder="请选择" filterable clearable> <el-select v-model="scope.row.db" placeholder="请选择" filterable clearable allow-create>
<el-option v-for="item in queryDataBaseList" :key="item" :label="item" :value="item"> <el-option v-for="item in queryDataBaseList" :key="item" :label="item" :value="item">
</el-option> </el-option>
</el-select> </el-select>
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
<el-input v-model="addTestDescriptionForm.api"></el-input> <el-input v-model="addTestDescriptionForm.api"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注:" class="input-style" style="width:95%"> <el-form-item label="备注:" class="input-style" style="width:95%">
<el-input v-model="addTestDescriptionForm.scope" type="textarea" autosize=""></el-input> <el-input v-model="addTestDescriptionForm.scope" type="textarea" autosize></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<div style="margin-left:1000px"> <div style="margin-left:1000px">
...@@ -277,6 +277,7 @@ export default { ...@@ -277,6 +277,7 @@ export default {
this.database = JSON.parse(data.database) this.database = JSON.parse(data.database)
this.id = data.id this.id = data.id
this.jiraProjectKey = data.jiraProjectKey this.jiraProjectKey = data.jiraProjectKey
this.updateTime = data.updateTime
}) })
}, },
methods: { methods: {
...@@ -294,23 +295,48 @@ export default { ...@@ -294,23 +295,48 @@ export default {
this.serviceAndBranchList = this.serviceAndBranch this.serviceAndBranchList = this.serviceAndBranch
this.apolloList = this.apollo this.apolloList = this.apollo
this.databaseList = this.database this.databaseList = this.database
this.addTestDescriptionForm.updateTime = this.updateTime
}, },
// 保存方法 // 保存方法
saveTestDescription() { saveTestDescription() {
// 将数组对象转化为Json字符串 // 判断是否选择了重复分支
this.addTestDescriptionForm.serviceAndBranch = JSON.stringify( for (var a = 0; a < this.serviceAndBranchList.length; a++) {
this.serviceAndBranchList for (var b = a + 1; b < this.serviceAndBranchList.length; b++) {
) if (
this.addTestDescriptionForm.apollo = JSON.stringify(this.apolloList) this.serviceAndBranchList[a].serviceName ===
this.addTestDescriptionForm.database = JSON.stringify(this.databaseList) this.serviceAndBranchList[b].serviceName
// console.log('参数信息', this.addTestDescriptionForm) ) {
return this.$message.error(
'已经选择了已有的分支,请重新选择新分支!'
)
}
}
}
// 判断添加的数据库key值是否有重复
for (var i = 0; i < this.databaseList.length; i++) {
for (var j = i + 1; j < this.databaseList.length; j++) {
if (this.databaseList[i].db === this.databaseList[j].db) {
return this.$message.error(
'已经选择了已有的数据库,请重新选择数据库!'
)
}
}
}
this.$refs.addTestDescriptionRef.validate((valid) => { this.$refs.addTestDescriptionRef.validate((valid) => {
if (!valid) { if (!valid) {
return false return false
} else { } else {
// 将数组对象转化为Json字符串
this.addTestDescriptionForm.serviceAndBranch = JSON.stringify(
this.serviceAndBranchList
)
this.addTestDescriptionForm.apollo = JSON.stringify(this.apolloList)
this.addTestDescriptionForm.database = JSON.stringify(
this.databaseList
)
editTestDescription(this.addTestDescriptionForm).then((resp) => { editTestDescription(this.addTestDescriptionForm).then((resp) => {
if (resp.data.businessCode === '0000') { if (resp.data.businessCode === '0000') {
this.$message.success(resp.data.msg) this.$message.success('编辑成功!')
this.isShowDetail = true this.isShowDetail = true
// 返回列表页 // 返回列表页
this.$router.push({ path: `/qa/testDescription` }) this.$router.push({ path: `/qa/testDescription` })
......
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
<el-table :data="databaseList" border class="table-style"> <el-table :data="databaseList" border class="table-style">
<el-table-column label="数据库名称" width="210"> <el-table-column label="数据库名称" width="210">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.db" placeholder="请选择" filterable clearable> <el-select v-model="scope.row.db" placeholder="请选择" filterable clearable allow-create>
<el-option v-for="item in queryDataBaseList" :key="item" :label="item" :value="item"> <el-option v-for="item in queryDataBaseList" :key="item" :label="item" :value="item">
</el-option> </el-option>
</el-select> </el-select>
...@@ -240,7 +240,8 @@ export default { ...@@ -240,7 +240,8 @@ export default {
database: '', database: '',
requirement: '', requirement: '',
api: '', api: '',
scope: '' scope: '',
updateTime: ''
}, },
rules: { rules: {
jiraProjectKey: [ jiraProjectKey: [
...@@ -377,34 +378,53 @@ export default { ...@@ -377,34 +378,53 @@ export default {
this.addTestDescriptionForm.requirement = '' this.addTestDescriptionForm.requirement = ''
this.addTestDescriptionForm.api = '' this.addTestDescriptionForm.api = ''
this.addTestDescriptionForm.scope = '' this.addTestDescriptionForm.scope = ''
this.addTestDescriptionForm.updateTime = ''
this.serviceAndBranchList = [] this.serviceAndBranchList = []
// this.serviceAndBranchList.push({
// serviceName: '',
// branch: '',
// developer: this.getUserName
// })
this.apolloList = [] this.apolloList = []
this.databaseList = [] this.databaseList = []
}, },
// 保存数据按钮 // 保存数据按钮
addTestDescriptionFrom() { addTestDescriptionFrom() {
// 将数组对象转化为Json字符串 // 判断是否选择了重复分支
this.addTestDescriptionForm.serviceAndBranch = JSON.stringify( for (var a = 0; a < this.serviceAndBranchList.length; a++) {
this.serviceAndBranchList for (var b = a + 1; b < this.serviceAndBranchList.length; b++) {
) if (
this.addTestDescriptionForm.apollo = JSON.stringify(this.apolloList) this.serviceAndBranchList[a].serviceName ===
this.addTestDescriptionForm.database = JSON.stringify(this.databaseList) this.serviceAndBranchList[b].serviceName
// console.log('88888', this.addTestDescriptionForm) ) {
return this.$message.error(
'已经选择了已有的分支,请重新选择新分支!'
)
}
}
}
// 判断添加的数据库key值是否有重复
for (var i = 0; i < this.databaseList.length; i++) {
for (var j = i + 1; j < this.databaseList.length; j++) {
if (this.databaseList[i].db === this.databaseList[j].db) {
return this.$message.error(
'已经选择了已有的数据库,请重新选择数据库!'
)
}
}
}
this.$refs.addTestDescriptionRef.validate((valid) => { this.$refs.addTestDescriptionRef.validate((valid) => {
if (!valid) { if (!valid) {
return false return false
} else { } else {
// 将数组对象转化为Json字符串
this.addTestDescriptionForm.serviceAndBranch = JSON.stringify(
this.serviceAndBranchList
)
this.addTestDescriptionForm.apollo = JSON.stringify(this.apolloList)
this.addTestDescriptionForm.database = JSON.stringify(
this.databaseList
)
// 编辑测试文档 // 编辑测试文档
if (this.addTestDescriptionForm.id) { if (this.addTestDescriptionForm.id) {
editTestDescription(this.addTestDescriptionForm).then((resp) => { editTestDescription(this.addTestDescriptionForm).then((resp) => {
if (resp.data.businessCode === '0000') { if (resp.data.businessCode === '0000') {
this.$message.success(resp.data.msg) this.$message.success('修改成功!')
this.DialogAddVisible = false this.DialogAddVisible = false
this.getTestDescriptionList() this.getTestDescriptionList()
} else { } else {
...@@ -415,7 +435,7 @@ export default { ...@@ -415,7 +435,7 @@ export default {
// 添加测试文档 // 添加测试文档
addTestDescription(this.addTestDescriptionForm).then((resp) => { addTestDescription(this.addTestDescriptionForm).then((resp) => {
if (resp.data.businessCode === '0000') { if (resp.data.businessCode === '0000') {
this.$message.success(resp.data.msg) this.$message.success('添加成功!')
this.DialogAddVisible = false this.DialogAddVisible = false
this.getTestDescriptionList() this.getTestDescriptionList()
} else { } else {
...@@ -436,6 +456,7 @@ export default { ...@@ -436,6 +456,7 @@ export default {
this.addTestDescriptionForm.requirement = row.requirement this.addTestDescriptionForm.requirement = row.requirement
this.addTestDescriptionForm.api = row.api this.addTestDescriptionForm.api = row.api
this.addTestDescriptionForm.scope = row.scope this.addTestDescriptionForm.scope = row.scope
this.addTestDescriptionForm.updateTime = row.updateTime
this.serviceAndBranchList = JSON.parse(row.serviceAndBranch) this.serviceAndBranchList = JSON.parse(row.serviceAndBranch)
this.apolloList = JSON.parse(row.apollo) this.apolloList = JSON.parse(row.apollo)
this.databaseList = JSON.parse(row.database) this.databaseList = JSON.parse(row.database)
...@@ -472,11 +493,6 @@ export default { ...@@ -472,11 +493,6 @@ export default {
}, },
// 详情按钮 // 详情按钮
openPreviewDialog(row) { openPreviewDialog(row) {
// this.$router.push('/qa/detailTestDescription?')
// this.$nextTick(function () {
// // DOM 现在更新了
// bus.$emit('msg', row)
// })
this.$router.push({ this.$router.push({
path: `/qa/detailTestDescription`, path: `/qa/detailTestDescription`,
query: { query: {
......
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