|
|
|
@ -323,7 +323,7 @@ |
|
|
|
|
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="55"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<i class="el-icon-delete rm" @click="delProject(scope.$index)"></i> |
|
|
|
|
<i class="el-icon-delete rm" @click="delProject(scope.$index, scope.row)"></i> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
@ -613,30 +613,28 @@ export default { |
|
|
|
|
const result = [] |
|
|
|
|
list.map(e => { |
|
|
|
|
// 如果选中的项目里有该系统的项目,则隐藏 |
|
|
|
|
if (!checked.find(n => n.systemId == e.systemId)) { |
|
|
|
|
// if (!checked.find(n => n.systemId == e.systemId)) { |
|
|
|
|
e.check = false |
|
|
|
|
result.push(e) |
|
|
|
|
} |
|
|
|
|
// } |
|
|
|
|
}) |
|
|
|
|
this.systems = result |
|
|
|
|
list.length && this.getProject(result[0]) |
|
|
|
|
result.length && this.getProject(result[0]) |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
// 获取项目列表 |
|
|
|
|
getProject(item) { |
|
|
|
|
const { check } = item // 项目选中状态跟随系统 |
|
|
|
|
const checked = this.permissions ? this.assessmentData : this.practiceData |
|
|
|
|
const checked = this.checkeds |
|
|
|
|
this.curSystem = item.systemId |
|
|
|
|
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => { |
|
|
|
|
this.projectAll = JSON.parse(JSON.stringify(res)) // 全部项目,另外保存 |
|
|
|
|
const result = [] |
|
|
|
|
res.map(e => { |
|
|
|
|
// 如果选择了该项目,则隐藏 |
|
|
|
|
if (!checked.find(n => n.projectId == e.projectId && n.systemId == e.systemId)) { |
|
|
|
|
e.type = item.type ? '流程类' : '编程类' |
|
|
|
|
e.check = check |
|
|
|
|
// 如果选择了该项目,则禁用并选中 |
|
|
|
|
const include = checked.some(n => n.projectId == e.projectId && n.systemId == e.systemId) |
|
|
|
|
e.check = include |
|
|
|
|
result.push(e) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.projects = result |
|
|
|
|
}).catch(err => {}) |
|
|
|
@ -651,13 +649,19 @@ export default { |
|
|
|
|
// 项目列表选中状态同步 |
|
|
|
|
const { projects, checkeds } = this |
|
|
|
|
if (projects.length && projects[0].systemId == item.systemId) { |
|
|
|
|
projects.map(e => e.check = val) |
|
|
|
|
projects.map(e => { |
|
|
|
|
e.check = val |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.projectKeyword = '' |
|
|
|
|
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => { |
|
|
|
|
if (val) { |
|
|
|
|
res.map(e => e.type = item.type ? '流程类' : '编程类') |
|
|
|
|
checkeds.push(...res) |
|
|
|
|
res.map(e => { |
|
|
|
|
if (!checkeds.find(n => n.projectId == e.projectId && n.systemId == e.systemId)) { |
|
|
|
|
e.type = item.type ? '流程类' : '编程类' |
|
|
|
|
checkeds.push(e) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
res.map(e => { |
|
|
|
|
const i = checkeds.findIndex(n => n.projectId == e.projectId && n.systemId == e.systemId) |
|
|
|
@ -688,11 +692,20 @@ export default { |
|
|
|
|
this.checkeds = this.checkedAll.filter(e => e.projectName.includes(val)) |
|
|
|
|
}, |
|
|
|
|
// 删除已选项目 |
|
|
|
|
delProject(i) { |
|
|
|
|
delProject(i, e) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.checkeds.splice(i, 1) |
|
|
|
|
// 如果当前展示的项目列表跟删掉的项目是同个系统,则找到项目列表里删掉的该项目,重置check和disabled |
|
|
|
|
if (e.systemId == this.curSystem) { |
|
|
|
|
const { projectId } = e |
|
|
|
|
this.projects.map(n => { |
|
|
|
|
if (n.projectId == projectId) { |
|
|
|
|
n.check = false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}, |
|
|
|
|
// 确认系统 |
|
|
|
|