|
|
|
@ -187,7 +187,7 @@ |
|
|
|
|
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="applicationName" label="系统名称" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ systems.find(e => e.systemId == scope.row.systemId).systemName }} |
|
|
|
|
{{ systemAll.find(e => e.systemId == scope.row.systemId).systemName }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="排序" align="center" width="100"> |
|
|
|
@ -237,7 +237,7 @@ |
|
|
|
|
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="applicationName" label="系统名称" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ systems.find(e => e.systemId == scope.row.systemId).systemName }} |
|
|
|
|
{{ systemAll.find(e => e.systemId == scope.row.systemId).systemName }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="排序" align="center" width="100"> |
|
|
|
@ -268,19 +268,19 @@ |
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
<!-- 配置弹窗 --> |
|
|
|
|
<el-dialog :visible.sync="configVisible" width="1000px" center custom-class="config-dia"> |
|
|
|
|
<el-dialog :visible.sync="configVisible" width="1200px" center custom-class="config-dia"> |
|
|
|
|
<div class="config-wrap"> |
|
|
|
|
<div class="system"> |
|
|
|
|
<div class="item system"> |
|
|
|
|
<div class="title-wrap flex-center"> |
|
|
|
|
<p class="addhr_tag"></p> |
|
|
|
|
<span>系统列表</span> |
|
|
|
|
</div> |
|
|
|
|
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="configSearch" clearable></el-input> |
|
|
|
|
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="systemKeyword" clearable></el-input> |
|
|
|
|
|
|
|
|
|
<ul class="systems"> |
|
|
|
|
<li v-for="(item, i) in systems" :key="i"> |
|
|
|
|
<el-checkbox></el-checkbox> |
|
|
|
|
<div class="name"> |
|
|
|
|
<el-checkbox v-model="item.check" @change="val => systemChange(val, item)"></el-checkbox> |
|
|
|
|
<div class="name" @click="getProject(item)"> |
|
|
|
|
<span>{{ item.systemName }}</span> |
|
|
|
|
<i class="el-icon-arrow-right"></i> |
|
|
|
|
</div> |
|
|
|
@ -288,24 +288,46 @@ |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="system"> |
|
|
|
|
<div class="item project"> |
|
|
|
|
<div class="title-wrap flex-center"> |
|
|
|
|
<p class="addhr_tag"></p> |
|
|
|
|
<span>项目列表</span> |
|
|
|
|
</div> |
|
|
|
|
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="configSearch" clearable></el-input> |
|
|
|
|
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="projectKeyword" clearable></el-input> |
|
|
|
|
|
|
|
|
|
<ul class="systems"> |
|
|
|
|
<li v-for="(item, i) in systems" :key="i"> |
|
|
|
|
<el-checkbox></el-checkbox> |
|
|
|
|
<div class="name"> |
|
|
|
|
<span>{{ item.systemName }}</span> |
|
|
|
|
<i class="el-icon-arrow-right"></i> |
|
|
|
|
</div> |
|
|
|
|
<li v-for="(item, i) in projects" :key="i"> |
|
|
|
|
<el-checkbox v-model="item.check" :label="item.projectName" @change="val => projectChange(val, item)"></el-checkbox> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="item checked"> |
|
|
|
|
<div class="title-wrap flex-center"> |
|
|
|
|
<p class="addhr_tag"></p> |
|
|
|
|
<span>已选择项目({{ checkeds.length }}个)</span> |
|
|
|
|
</div> |
|
|
|
|
<el-input style="width: 200px;margin-bottom: 20px;" placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="checkedKeyword" clearable></el-input> |
|
|
|
|
<el-table :data="checkeds" class="table" stripe header-align="center"> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="applicationName" label="系统名称" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ systemAll.find(e => e.systemId == scope.row.systemId).systemName }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="projectName" width="90" label="系统类型" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.type }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="60"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<i class="el-icon-delete rm" @click="delProject(scope.$index)"></i> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
@ -400,11 +422,10 @@ export default { |
|
|
|
|
0: "运行中", |
|
|
|
|
1: "默认" |
|
|
|
|
}, |
|
|
|
|
systems: [], |
|
|
|
|
pageNo: 1, |
|
|
|
|
pageSize: 10, |
|
|
|
|
multipleSelection: [], |
|
|
|
|
configSearch: "", |
|
|
|
|
systemKeyword: "", |
|
|
|
|
searchTimer: null, |
|
|
|
|
configVisible: false,// 配置弹框 |
|
|
|
|
|
|
|
|
@ -419,8 +440,15 @@ export default { |
|
|
|
|
submiting: false, // 新增编辑防抖标识 |
|
|
|
|
loadIns: null, |
|
|
|
|
updateTime: 0, |
|
|
|
|
systemAll: [], |
|
|
|
|
systems: [], |
|
|
|
|
systemChecked: [] |
|
|
|
|
systemChecked: [], |
|
|
|
|
projects: [], |
|
|
|
|
projectAll: [], |
|
|
|
|
projectKeyword: '', |
|
|
|
|
checkedKeyword: '', |
|
|
|
|
checkeds: [], |
|
|
|
|
checkedAll: [] |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
@ -431,46 +459,34 @@ export default { |
|
|
|
|
}, |
|
|
|
|
deep:true |
|
|
|
|
}, |
|
|
|
|
configSearch: function(val) { |
|
|
|
|
systemKeyword: function(val) { |
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.getConfig(); |
|
|
|
|
}, 500); |
|
|
|
|
}, |
|
|
|
|
projectKeyword: function(val) { |
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.initData(); |
|
|
|
|
this.filterProject(); |
|
|
|
|
}, 500); |
|
|
|
|
}, |
|
|
|
|
checkedKeyword: function(val) { |
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.filterChecked(); |
|
|
|
|
}, 500); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
this.getSubject(); |
|
|
|
|
this.getConfig(); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
// 详情 |
|
|
|
|
if (this.form.cid) { |
|
|
|
|
this.getInfoData(); |
|
|
|
|
} |
|
|
|
|
// this.getSystems() |
|
|
|
|
this.getSubject() |
|
|
|
|
this.getConfig() |
|
|
|
|
this.form.cid && this.getInfoData() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
goback() { |
|
|
|
|
const id = this.form.cid |
|
|
|
|
const updateTime = this.updateTime |
|
|
|
|
// 更改了信息才需要提示 |
|
|
|
|
if ((id && updateTime > 1) || (!id && updateTime)) { |
|
|
|
|
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.saveAdd(1) |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.backPage() |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.backPage() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 返回上一页 |
|
|
|
|
backPage() { |
|
|
|
|
this.$router.back() |
|
|
|
|
this.loadIns.close() |
|
|
|
|
}, |
|
|
|
|
getInfoData() { |
|
|
|
|
this.$post(`${this.api.curriculumDetail}?cid=${this.form.cid}`).then(res => { |
|
|
|
|
let { data } = res; |
|
|
|
@ -575,82 +591,127 @@ export default { |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
handleConfig(type) { // 弹窗 |
|
|
|
|
// 练习考核弹框 |
|
|
|
|
handleConfig(type) { |
|
|
|
|
this.permissions = type; |
|
|
|
|
this.configVisible = true; |
|
|
|
|
this.pageNo = 1; |
|
|
|
|
this.getConfig(); |
|
|
|
|
}, |
|
|
|
|
getConfig() { // 获取配置 |
|
|
|
|
let data = { |
|
|
|
|
systemName: this.configSearch, |
|
|
|
|
pageNum: this.pageNo, |
|
|
|
|
pageSize: this.pageSize |
|
|
|
|
}; |
|
|
|
|
this.$post(this.api.queryServiceConfig, data).then(res => { |
|
|
|
|
this.systems = res.serviceList.records; |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
practiceSelectable(row, index) { // 禁止勾选已经选过的系统 |
|
|
|
|
let boolean = true; |
|
|
|
|
if (this.permissions) { |
|
|
|
|
this.assessmentData.length && this.assessmentData.some(e => { |
|
|
|
|
if (e.systemId == row.systemId) { |
|
|
|
|
boolean = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.checkeds = JSON.parse(JSON.stringify(type ? this.assessmentData : this.practiceData)) |
|
|
|
|
}, |
|
|
|
|
// 获取系统 |
|
|
|
|
getConfig() { |
|
|
|
|
const checked = this.permissions ? this.assessmentData : this.practiceData |
|
|
|
|
this.$post(this.api.queryServiceConfig, { |
|
|
|
|
systemName: this.systemKeyword, |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 1000 |
|
|
|
|
}).then(res => { |
|
|
|
|
const list = res.serviceList.records |
|
|
|
|
this.systemAll = JSON.parse(JSON.stringify(list)) // 全部系统,另外保存 |
|
|
|
|
const result = [] |
|
|
|
|
list.map(e => { |
|
|
|
|
// 如果选中的项目里有该系统的项目,则隐藏 |
|
|
|
|
if (!checked.find(n => n.systemId == e.systemId)) { |
|
|
|
|
e.check = false |
|
|
|
|
result.push(e) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.systems = result |
|
|
|
|
list.length && this.getProject(result[0]) |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
// 获取项目列表 |
|
|
|
|
getProject(item) { |
|
|
|
|
const { check } = item // 项目选中状态跟随系统 |
|
|
|
|
const checked = this.permissions ? this.assessmentData : this.practiceData |
|
|
|
|
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 |
|
|
|
|
result.push(e) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.projects = result |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
// 项目模糊查询 |
|
|
|
|
filterProject() { |
|
|
|
|
const val = this.projectKeyword |
|
|
|
|
this.projects = this.projectAll.filter(e => e.projectName.includes(val)) |
|
|
|
|
}, |
|
|
|
|
// 系统选择回调 |
|
|
|
|
systemChange(val, item) { |
|
|
|
|
// 项目列表选中状态同步 |
|
|
|
|
const { projects, checkeds } = this |
|
|
|
|
if (projects.length && projects[0].systemId == item.systemId) { |
|
|
|
|
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) |
|
|
|
|
} else { |
|
|
|
|
this.practiceData.length && this.practiceData.some(e => { |
|
|
|
|
if (e.systemId == row.systemId) { |
|
|
|
|
boolean = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
res.map(e => { |
|
|
|
|
const i = checkeds.findIndex(n => n.projectId == e.projectId && n.systemId == e.systemId) |
|
|
|
|
i === -1 || checkeds.splice(i, 1) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
return boolean; |
|
|
|
|
}, |
|
|
|
|
initData() { |
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
|
this.pageNo = 1; |
|
|
|
|
this.getConfig(); |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange(val) { // 系统-多选操作 |
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange(val) { // 系统-切换分页 |
|
|
|
|
this.pageNo = val; |
|
|
|
|
this.getConfig(); |
|
|
|
|
}, |
|
|
|
|
handleConfirm() { // 确认系统 |
|
|
|
|
const list = this.multipleSelection |
|
|
|
|
if (!list.length) { |
|
|
|
|
this.$message.warning("请选择系统!"); |
|
|
|
|
return; |
|
|
|
|
} else if (list.find(e => !e.type) && list.find(e => e.type === 1)) { |
|
|
|
|
return this.$message.warning('请勿同时选择编程类和流程类的系统!') |
|
|
|
|
this.checkedAll = JSON.parse(JSON.stringify(checkeds)) // 全部已选项目,另外保存 |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
// 项目选择回调 |
|
|
|
|
projectChange(val, item) { |
|
|
|
|
const { systemId } = item |
|
|
|
|
const i = this.checkeds.findIndex(e => e.projectId == item.projectId && e.systemId == systemId) |
|
|
|
|
// 选中,则push,否则移除 |
|
|
|
|
if (val) { |
|
|
|
|
this.checkeds.push(item) |
|
|
|
|
} else if (i !== -1) { |
|
|
|
|
this.systems.map(e => { |
|
|
|
|
if (e.systemId == systemId) e.check = false |
|
|
|
|
}) |
|
|
|
|
this.checkeds.splice(i, 1) |
|
|
|
|
} |
|
|
|
|
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) // 全部已选项目,另外保存 |
|
|
|
|
}, |
|
|
|
|
// 已选择项目模糊查询 |
|
|
|
|
filterChecked() { |
|
|
|
|
const val = this.checkedKeyword |
|
|
|
|
this.checkeds = this.checkedAll.filter(e => e.projectName.includes(val)) |
|
|
|
|
}, |
|
|
|
|
// 删除已选项目 |
|
|
|
|
delProject(i) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.checkeds.splice(i, 1) |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}, |
|
|
|
|
// 确认系统 |
|
|
|
|
handleConfirm() { |
|
|
|
|
const list = this.checkeds |
|
|
|
|
if (!list.length) { |
|
|
|
|
this.$message.warning("请选择系统!"); |
|
|
|
|
} else { |
|
|
|
|
this.configVisible = false |
|
|
|
|
list.map((e, i) => { |
|
|
|
|
e.isShow = 0; // isShow是否展示(默认0:展示 1:不展示) |
|
|
|
|
e.sort = i + 1; // 排序 |
|
|
|
|
}); |
|
|
|
|
if (this.permissions) { |
|
|
|
|
this.assessmentData = JSON.parse(JSON.stringify(list)) |
|
|
|
|
this.assessmentTotal = this.assessmentData.length; |
|
|
|
|
} else { |
|
|
|
|
this.getConfigData(); |
|
|
|
|
this.configVisible = false; |
|
|
|
|
this.practiceData = JSON.parse(JSON.stringify(list)) |
|
|
|
|
this.practiceTotal = this.practiceData.length; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getConfigData() { // 查询实训配置 |
|
|
|
|
let ids = this.multipleSelection.map(i => i.systemId); |
|
|
|
|
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${ids.toString()}`).then((res) => { |
|
|
|
|
let data = res.map((e, i) => { |
|
|
|
|
e.isShow = 0; // isShow是否展示(默认0:展示 1:不展示) |
|
|
|
|
e.sort = i + 1; // 排序 |
|
|
|
|
return e; |
|
|
|
|
}); |
|
|
|
|
if (this.permissions) { |
|
|
|
|
this.assessmentData.push(...data) |
|
|
|
|
this.assessmentTotal = this.assessmentData.length; |
|
|
|
|
} else { |
|
|
|
|
this.practiceData.push(...data) |
|
|
|
|
this.practiceTotal = this.practiceData.length; |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
practiceSortChange(row, index) { // 处理排序 |
|
|
|
|
this.practiceData.splice(index, 1, row); |
|
|
|
@ -794,6 +855,27 @@ export default { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
goback() { |
|
|
|
|
const id = this.form.cid |
|
|
|
|
const updateTime = this.updateTime |
|
|
|
|
// 更改了信息才需要提示 |
|
|
|
|
if ((id && updateTime > 1) || (!id && updateTime)) { |
|
|
|
|
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.saveAdd(1) |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.backPage() |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.backPage() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 返回上一页 |
|
|
|
|
backPage() { |
|
|
|
|
this.$router.back() |
|
|
|
|
this.loadIns.close() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
@ -881,10 +963,15 @@ $avatar-width: 104px; |
|
|
|
|
.title-wrap { |
|
|
|
|
margin-bottom: 15px; |
|
|
|
|
} |
|
|
|
|
.item { |
|
|
|
|
max-height: 600px; |
|
|
|
|
margin-right: 20px; |
|
|
|
|
overflow: auto; |
|
|
|
|
} |
|
|
|
|
.system { |
|
|
|
|
width: 280px; |
|
|
|
|
padding-right: 20px; |
|
|
|
|
// border-right: 1px solid #ccc; |
|
|
|
|
padding: 10px; |
|
|
|
|
background-color: #f9f9f9; |
|
|
|
|
} |
|
|
|
|
.systems { |
|
|
|
|
margin-top: 10px; |
|
|
|
@ -905,5 +992,18 @@ $avatar-width: 104px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.project { |
|
|
|
|
width: 350px; |
|
|
|
|
} |
|
|
|
|
.checked { |
|
|
|
|
flex: 1; |
|
|
|
|
} |
|
|
|
|
.rm { |
|
|
|
|
font-size: 14px; |
|
|
|
|
cursor: pointer; |
|
|
|
|
&:hover { |
|
|
|
|
color: #9076FF; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |