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