fix(标准合规评估流程): 导入校验
This commit is contained in:
@@ -1049,29 +1049,21 @@ export default {
|
||||
// 确认添加事件
|
||||
okProject () {
|
||||
if(this.projectList.length) {
|
||||
const proData = []
|
||||
this.projectList.forEach(i => {
|
||||
i.name = i.projectGroup + '-' + i.managementHostName + '-' + i.developmentHostName
|
||||
})
|
||||
if(this.dataList.length) {
|
||||
this.dataList.forEach(item => {
|
||||
if(!proData.length) {
|
||||
proData.push(item.projectGroup)
|
||||
}else if(!proData.includes(item.projectGroup)) {
|
||||
proData.push(item.projectGroup)
|
||||
}
|
||||
})
|
||||
this.projectList.forEach(items => {
|
||||
if(!proData.includes(items.projectGroup)) {
|
||||
this.dataList.push(items)
|
||||
}else{
|
||||
this.subFlag++
|
||||
}
|
||||
})
|
||||
if(this.subFlag > 0) {
|
||||
if (this.dataList.some(data => this.projectList.some(project => project.name === data.name))) {
|
||||
this.$message.warning('请勿重复添加数据')
|
||||
return
|
||||
} else {
|
||||
this.dataList = [ ...this.dataList, ...this.projectList ]
|
||||
}
|
||||
}else{
|
||||
this.dataList = this.projectList
|
||||
this.dataList = [ ...this.projectList ]
|
||||
}
|
||||
this.ProjectModel = false;
|
||||
console.log(this.dataList === this.projectList)
|
||||
}else{
|
||||
this.$message.warning('请至少选择一条数据进行添加')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user