fix:修改 endpoint 批量新增的相关问题

This commit is contained in:
zhangyu
2021-08-17 10:25:53 +08:00
parent 5e781c1ad3
commit 9428be3bdb
2 changed files with 20 additions and 6 deletions

View File

@@ -283,7 +283,8 @@ export default {
show: true,
width: 150
}
]
],
endpointIndex: ''
}
},
methods: {
@@ -383,7 +384,7 @@ export default {
this.rightBox.show = false
if (!isEdit) { return }
this.batchEndpoint.tableData.forEach((item, index) => {
if (item.id === endpoint.id) {
if (index === this.endpointIndex) {
this.batchEndpoint.tableData[index] = { ...endpoint }
}
})
@@ -392,7 +393,8 @@ export default {
del (index) {
this.batchEndpoint.tableData.splice(index, 1)
},
edit (row) {
edit (row, endpointIndex) {
this.endpointIndex = endpointIndex
this.object = row
// this.object.configs = JSON.parse(this.object.configs)
this.object.projectId = this.object.project.id
@@ -423,6 +425,17 @@ export default {
}
pipeline.labels = labelsArr
}
if (pipeline.type === 'json') {
const expressionsArr = []
if (JSON.stringify(pipeline.expressions) !== '{}' && pipeline.expressions) {
Object.keys(pipeline.expressions).forEach(key => {
expressionsArr.push({ key, value: pipeline.expressions[key] })
})
} else {
expressionsArr.push({ key: '', value: '' })
}
pipeline.expressions = expressionsArr
}
})
if (!item.pipeline) {
item.pipeline = []