|
|
|
@ -132,7 +132,7 @@ |
|
|
|
|
{{ scope.row.projectName || scope.row.paperName }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column> |
|
|
|
|
<!-- <el-table-column prop="remark" label="备注名称" align="center"></el-table-column> --> |
|
|
|
|
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="排序" align="center" width="100"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
@ -174,7 +174,7 @@ |
|
|
|
|
{{ scope.row.projectName || scope.row.paperName }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column> |
|
|
|
|
<!-- <el-table-column prop="remark" label="备注名称" align="center"></el-table-column> --> |
|
|
|
|
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="排序" align="center" width="100"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
@ -216,8 +216,8 @@ |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- 配置弹窗 --> |
|
|
|
|
<el-drawer title="添加系统资源" :visible.sync="configVisible" size="1200px" :close-on-click-modal="false" |
|
|
|
|
custom-class="config-dia"> |
|
|
|
|
<el-drawer title="添加系统资源" :visible.sync="configVisible" v-loading="loading" size="1200px" |
|
|
|
|
:close-on-click-modal="false" custom-class="config-dia"> |
|
|
|
|
<div class="config-wrap"> |
|
|
|
|
<div class="item system"> |
|
|
|
|
<h6 class="p-title" style="margin-bottom: 0;">课程系统列表</h6> |
|
|
|
@ -226,17 +226,17 @@ |
|
|
|
|
<li v-for="(item, i) in systems" :key="i" :title="item.systemName"> |
|
|
|
|
<div class="line"> |
|
|
|
|
<el-checkbox v-model="item.check" @change="val => courseChange(val, item)"></el-checkbox> |
|
|
|
|
<div :class="['name', { active: curSystem == item.id }]" @click="getProject(item)"> |
|
|
|
|
<div :class="['name', { active: curCourse == item.cid }]" @click="getProject(item)"> |
|
|
|
|
<span>{{ item.label }}</span> |
|
|
|
|
<i class="el-icon-arrow-right"></i> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="children"> |
|
|
|
|
<div v-for="(system, j) in item.children" :key="j" :title="system.label" class="line"> |
|
|
|
|
<div v-if="item.systemInfo" class="children"> |
|
|
|
|
<div v-for="(system, j) in item.systemInfo" :key="j" :title="system.label" class="line"> |
|
|
|
|
<el-checkbox v-model="system.check" @change="val => systemChange(val, system, item)"></el-checkbox> |
|
|
|
|
<div :class="['name', { active: curSystem == item.id }]" @click="getProject(system)"> |
|
|
|
|
<span>{{ system.label }}</span> |
|
|
|
|
<div :class="['name', { active: curSystem == system.systemId }]" @click="getProject(item, system)"> |
|
|
|
|
<span>{{ system.systemName }}</span> |
|
|
|
|
<i class="el-icon-arrow-right"></i> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -293,10 +293,10 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<div class="btns"> |
|
|
|
|
<el-button @click="configVisible = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="handleConfirm">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
</el-drawer> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -317,7 +317,7 @@ export default { |
|
|
|
|
cid: this.$route.query.cid, |
|
|
|
|
isCopy: this.$route.query.copy, |
|
|
|
|
editorConfig, |
|
|
|
|
step: 2, |
|
|
|
|
step: 1, |
|
|
|
|
form: { |
|
|
|
|
curriculumName: "", |
|
|
|
|
curriculumType: '', |
|
|
|
@ -370,22 +370,21 @@ export default { |
|
|
|
|
pageSize: 10, |
|
|
|
|
multipleSelection: [], |
|
|
|
|
searchTimer: null, |
|
|
|
|
configVisible: false,// 配置弹框 |
|
|
|
|
configVisible: false, |
|
|
|
|
loading: false, |
|
|
|
|
|
|
|
|
|
permissions: '', // 练习:0;考核:1 |
|
|
|
|
practiceData: [], |
|
|
|
|
practiceTotal: 0, |
|
|
|
|
multiplePractice: [], |
|
|
|
|
|
|
|
|
|
matches: [], |
|
|
|
|
matcheTotal: 0, |
|
|
|
|
multipleMatch: [], |
|
|
|
|
submiting: false, // 新增编辑防抖标识 |
|
|
|
|
loadIns: null, |
|
|
|
|
updateTime: 0, |
|
|
|
|
systemAll: [], |
|
|
|
|
systems: [], |
|
|
|
|
systemChecked: [], |
|
|
|
|
curCourse: '', |
|
|
|
|
curSystem: '', |
|
|
|
|
projects: [], |
|
|
|
|
projectKeyword: '', |
|
|
|
@ -419,7 +418,6 @@ export default { |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
this.getSubject() |
|
|
|
|
this.getCourseSystem() |
|
|
|
|
this.cid && this.getInfoData() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
@ -443,31 +441,25 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 获取课程系统 |
|
|
|
|
async getCourseSystem () { |
|
|
|
|
|
|
|
|
|
const r = await this.$post(this.api.schoolCourseProject, { |
|
|
|
|
permissions: 0 |
|
|
|
|
this.loading = true |
|
|
|
|
const res = await this.$post(this.api.schoolCourseProject, { |
|
|
|
|
permissions: this.permissions |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
return |
|
|
|
|
const res = await this.$get(this.api.getSystemIdBySchool) |
|
|
|
|
const systems = res.data |
|
|
|
|
|
|
|
|
|
const { data } = await this.$get(this.api.getSchoolEffectiveCourse) |
|
|
|
|
if (systems.length && data.length) { |
|
|
|
|
this.cid = [data[0].mallId] |
|
|
|
|
data.map(e => { |
|
|
|
|
e.id = e.mallId |
|
|
|
|
const list = res.curriculum |
|
|
|
|
if (list.length) { |
|
|
|
|
// this.cid = [data[0].mallId] |
|
|
|
|
list.map(e => { |
|
|
|
|
e.id = e.cid |
|
|
|
|
e.label = e.curriculumName |
|
|
|
|
e.check = false |
|
|
|
|
const children = _.cloneDeep(systems.filter(n => e.systemId.split(',').includes(n.id + ''))) // 筛选出该课程下的系统 |
|
|
|
|
children.map(n => { |
|
|
|
|
e.systemInfo && e.systemInfo.map(n => { |
|
|
|
|
n.check = false |
|
|
|
|
}) |
|
|
|
|
e.children = children |
|
|
|
|
}) |
|
|
|
|
this.systems = data |
|
|
|
|
// this.getProject(result[0]) |
|
|
|
|
this.systems = list |
|
|
|
|
this.getProject(list[0]) |
|
|
|
|
} |
|
|
|
|
this.loading = false |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 添加学科 |
|
|
|
@ -555,32 +547,29 @@ export default { |
|
|
|
|
|
|
|
|
|
// 课程选择回调 |
|
|
|
|
courseChange (val, item) { |
|
|
|
|
item.children.map(e => e.check = val) |
|
|
|
|
item.systemInfo && item.systemInfo.map(e => e.check = val) |
|
|
|
|
this.systemChange(val, { |
|
|
|
|
systemId: item.systemInfo ? item.systemInfo.map(e => e.systemId).join() : '' |
|
|
|
|
}, item) |
|
|
|
|
}, |
|
|
|
|
// 系统选择回调 |
|
|
|
|
async systemChange (val, system, course) { |
|
|
|
|
// 项目列表选中状态同步 |
|
|
|
|
const { projects, checkeds } = this |
|
|
|
|
if (projects.length && projects[0].systemId == item.systemId) { |
|
|
|
|
if (projects.length && projects[0].systemId == system.systemId) { |
|
|
|
|
projects.map(e => { |
|
|
|
|
e.check = val |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.projectKeyword = '' |
|
|
|
|
const { data } = await this.$post(this.api.queryProjectManage, { |
|
|
|
|
const res = await this.$post(this.api.configureCourseProjectBySchool, { |
|
|
|
|
projectName: this.projectKeyword, |
|
|
|
|
platformId: 1, |
|
|
|
|
founder: 2, |
|
|
|
|
permissions: this.permissions, |
|
|
|
|
cid: course.cid, |
|
|
|
|
mallId: course.mallId, |
|
|
|
|
systemId: system.id, |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 1000, |
|
|
|
|
systemId: system.systemId |
|
|
|
|
}) |
|
|
|
|
const list = data.records |
|
|
|
|
const list = res.projectManages |
|
|
|
|
list.forEach(e => { |
|
|
|
|
e.check = val |
|
|
|
|
const i = checkeds.findIndex(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId)) |
|
|
|
|
if (val) { |
|
|
|
|
i === -1 && checkeds.push(e) |
|
|
|
@ -591,37 +580,44 @@ export default { |
|
|
|
|
this.checkedAll = _.cloneDeep(checkeds) // 全部已选项目,另外保存 |
|
|
|
|
}, |
|
|
|
|
// 获取项目列表 |
|
|
|
|
async getProject (item, fromSystemChange) { |
|
|
|
|
async getProject (item, system) { |
|
|
|
|
const checked = this.checkeds |
|
|
|
|
if (item) this.curSystem = item.systemId |
|
|
|
|
if (system) { |
|
|
|
|
this.curSystem = +system.systemId |
|
|
|
|
} else if (item) { |
|
|
|
|
this.curCourse = item.cid |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const { data } = await this.$post(this.api.queryProjectManage, { |
|
|
|
|
const res = await this.$post(this.api.configureCourseProjectBySchool, { |
|
|
|
|
projectName: this.projectKeyword, |
|
|
|
|
platformId: 1, |
|
|
|
|
founder: 2, |
|
|
|
|
permissions: this.permissions, |
|
|
|
|
cid: item.cid, |
|
|
|
|
mallId: item.mallId, |
|
|
|
|
systemId: item.children.map(e => e.id).join(), |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 1000, |
|
|
|
|
systemId: system ? system.systemId : item.systemInfo.map(e => e.systemId).join(), |
|
|
|
|
}) |
|
|
|
|
const list = res.projectManages |
|
|
|
|
list.map(e => { |
|
|
|
|
// 如果选择了该项目,则禁用并选中 |
|
|
|
|
const include = checked.some(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && n.paperId == e.paperId)) |
|
|
|
|
e.check = include |
|
|
|
|
}) |
|
|
|
|
// const result = [] |
|
|
|
|
// const projects = fromSystemChange ? this.projects : res |
|
|
|
|
// projects.map(e => { |
|
|
|
|
// // 如果选择了该项目,则禁用并选中 |
|
|
|
|
// const include = checked.some(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && n.paperId == e.paperId)) |
|
|
|
|
// e.check = include |
|
|
|
|
// result.push(e) |
|
|
|
|
// }) |
|
|
|
|
// this.checkAll = !result.filter(e => !e.check).length |
|
|
|
|
// this.projects = result |
|
|
|
|
this.checkAll = !list.filter(e => !e.check).length |
|
|
|
|
this.projects = list |
|
|
|
|
}, |
|
|
|
|
// 项目全选回调 |
|
|
|
|
checkAllChange (val, systemId) { |
|
|
|
|
this.systemChange(val, { systemId }) |
|
|
|
|
this.systems.map(e => { |
|
|
|
|
if (e.systemId == systemId) e.check = val |
|
|
|
|
const { projects, checkeds } = this |
|
|
|
|
projects.forEach(e => { |
|
|
|
|
e.check = val |
|
|
|
|
const i = checkeds.findIndex(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId)) |
|
|
|
|
if (val) { |
|
|
|
|
if (i === -1) { |
|
|
|
|
const row = _.cloneDeep(e) |
|
|
|
|
row.check = false |
|
|
|
|
checkeds.push(row) |
|
|
|
|
} |
|
|
|
|
} else if (i !== -1) { |
|
|
|
|
checkeds.splice(i, 1) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 项目选择回调 |
|
|
|
@ -630,7 +626,11 @@ export default { |
|
|
|
|
const i = this.checkeds.findIndex(e => (item.projectId && e.projectId == item.projectId && e.systemId == systemId) || (paperId && paperId == e.paperId)) |
|
|
|
|
// 选中,则push,否则移除 |
|
|
|
|
if (val) { |
|
|
|
|
i === -1 && this.checkeds.push(item) |
|
|
|
|
if (i === -1) { |
|
|
|
|
const row = _.cloneDeep(item) |
|
|
|
|
row.check = false |
|
|
|
|
this.checkeds.push(row) |
|
|
|
|
} |
|
|
|
|
} else if (i !== -1) { |
|
|
|
|
this.checkeds.splice(i, 1) |
|
|
|
|
} |
|
|
|
@ -642,49 +642,52 @@ export default { |
|
|
|
|
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) // 全部已选项目,另外保存 |
|
|
|
|
}, |
|
|
|
|
// 批量移除 |
|
|
|
|
async batchDelChecked (val) { |
|
|
|
|
async batchDelChecked () { |
|
|
|
|
try { |
|
|
|
|
const checked = this.checkeds.filter(e => e.check) |
|
|
|
|
const { projects, checkeds } = this |
|
|
|
|
const checked = checkeds.filter(e => e.check) |
|
|
|
|
if (checked.length) { |
|
|
|
|
checked.map(e => { |
|
|
|
|
const cur = this.allSections.find(n => n.id === e.id) |
|
|
|
|
if (cur) { |
|
|
|
|
cur.check = false |
|
|
|
|
} |
|
|
|
|
const cur = projects.find(n => n.projectId === e.projectId) |
|
|
|
|
if (cur) cur.check = false |
|
|
|
|
}) |
|
|
|
|
this.checkeds = this.checked.filter(e => !e.check) |
|
|
|
|
} else { |
|
|
|
|
Util.warningMsg('请选择数据') |
|
|
|
|
await this.$confirm('确定要移除全部数据吗?', '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
|
}) |
|
|
|
|
checkeds.map(e => { |
|
|
|
|
const cur = projects.find(n => n.projectId === e.projectId) |
|
|
|
|
if (cur) cur.check = false |
|
|
|
|
}) |
|
|
|
|
this.checkeds = [] |
|
|
|
|
} |
|
|
|
|
this.checkAll = false |
|
|
|
|
} catch (e) { } |
|
|
|
|
}, |
|
|
|
|
// 删除已选项目 |
|
|
|
|
delProject (i, e) { |
|
|
|
|
if (e.disabled) return |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.checkeds.splice(i, 1) |
|
|
|
|
// 如果当前展示的项目列表跟删掉的项目是同个系统,则找到项目列表里删掉的该项目,重置check和disabled |
|
|
|
|
if (e.systemId == this.curSystem) { |
|
|
|
|
const { projectId, paperId } = e |
|
|
|
|
this.projects.map(n => { |
|
|
|
|
if ((projectId && n.projectId == projectId) || (paperId && n.paperId == paperId)) { |
|
|
|
|
n.check = false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.checkAll = !this.projects.find(e => !e.check) |
|
|
|
|
} |
|
|
|
|
this.systems.map(n => { |
|
|
|
|
if (n.systemId == e.systemId) n.check = false |
|
|
|
|
this.checkeds.splice(i, 1) |
|
|
|
|
// 如果当前展示的项目列表跟删掉的项目是同个系统,则找到项目列表里删掉的该项目,重置check和disabled |
|
|
|
|
if (e.systemId == this.curSystem) { |
|
|
|
|
const { projectId, paperId } = e |
|
|
|
|
this.projects.map(n => { |
|
|
|
|
if ((projectId && n.projectId == projectId) || (paperId && n.paperId == paperId)) { |
|
|
|
|
n.check = false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
this.checkAll = !this.projects.find(e => !e.check) |
|
|
|
|
} |
|
|
|
|
this.systems.map(n => { |
|
|
|
|
if (n.systemId == e.systemId) n.check = false |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 确认系统 |
|
|
|
|
handleConfirm () { |
|
|
|
|
const list = this.checkeds |
|
|
|
|
if (!list.length) { |
|
|
|
|
this.$message.warning("请选择系统!"); |
|
|
|
|
this.$message.warning('请选择系统!') |
|
|
|
|
} else { |
|
|
|
|
this.configVisible = false |
|
|
|
|
list.map((e, i) => { |
|
|
|
@ -703,19 +706,17 @@ export default { |
|
|
|
|
handleSelectionPractice (val) { // 多选练习项目 |
|
|
|
|
this.multiplePractice = val; |
|
|
|
|
}, |
|
|
|
|
handleSelectionMatch (val) { // 多选竞赛项目 |
|
|
|
|
this.multipleMatch = val; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 练习考核弹框 |
|
|
|
|
handleConfig (type) { |
|
|
|
|
this.projectKeyword = '' |
|
|
|
|
this.checkedKeyword = '' |
|
|
|
|
this.permissions = type; |
|
|
|
|
this.configVisible = true; |
|
|
|
|
this.permissions = type |
|
|
|
|
this.getCourseSystem() |
|
|
|
|
this.configVisible = true |
|
|
|
|
this.pageNo = 1 |
|
|
|
|
this.checkeds = JSON.parse(JSON.stringify(type == 1 ? this.assessmentData : type == 2 ? this.matches : this.practiceData)) |
|
|
|
|
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) |
|
|
|
|
this.checkeds = _.cloneDeep(type == 1 ? this.assessmentData : this.practiceData) |
|
|
|
|
this.checkedAll = _.cloneDeep(this.checkeds) |
|
|
|
|
}, |
|
|
|
|
handleBatchDelete (type) { // 批量移除 |
|
|
|
|
if (type == 1 && !this.multipleAssessment.length) { |
|
|
|
@ -724,9 +725,6 @@ export default { |
|
|
|
|
} else if (!type && !this.multiplePractice.length) { |
|
|
|
|
this.$message.warning("请勾选练习项目!"); |
|
|
|
|
return; |
|
|
|
|
} else if (type == 2 && !this.multipleMatch.length) { |
|
|
|
|
this.$message.warning("请勾选竞赛项目!"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.$confirm("此操作将批量移除项目, 是否继续?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
@ -749,15 +747,6 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.practiceData = tempArr; |
|
|
|
|
} else { |
|
|
|
|
let ids = this.multipleMatch.map(i => i.projectId); |
|
|
|
|
let tempArr = []; |
|
|
|
|
for (let i = 0; i < this.matches.length; i++) { |
|
|
|
|
if (!ids.includes(this.matches[i].projectId)) { |
|
|
|
|
tempArr.push(this.matches[i]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.matches = tempArr; |
|
|
|
|
} |
|
|
|
|
this.$message.success("批量移除成功"); |
|
|
|
|
}).catch(() => { |
|
|
|
@ -956,9 +945,9 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.overflow { |
|
|
|
|
height: calc(100vh - 342px); |
|
|
|
|
// height: calc(100vh - 342px); |
|
|
|
|
margin-bottom: 20px; |
|
|
|
|
overflow: auto; |
|
|
|
|
// overflow: auto; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.btns { |
|
|
|
@ -1072,11 +1061,14 @@ export default { |
|
|
|
|
|
|
|
|
|
.item { |
|
|
|
|
width: 350px; |
|
|
|
|
height: calc(100vh - 93px); |
|
|
|
|
height: calc(100vh - 143px); |
|
|
|
|
padding: 10px; |
|
|
|
|
margin-right: 20px; |
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
|
|
&:not(:last-child) { |
|
|
|
|
margin-right: 20px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
&.project { |
|
|
|
|
border-right: 1px solid #eee; |
|
|
|
|
} |
|
|
|
@ -1103,7 +1095,7 @@ export default { |
|
|
|
|
|
|
|
|
|
.projects { |
|
|
|
|
margin-top: 10px; |
|
|
|
|
max-height: 520px; |
|
|
|
|
max-height: calc(100vh - 174px); |
|
|
|
|
overflow: auto; |
|
|
|
|
|
|
|
|
|
li { |
|
|
|
@ -1127,7 +1119,6 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
span { |
|
|
|
|
max-width: 200px; |
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
white-space: nowrap; |
|
|
|
|
overflow: hidden; |
|
|
|
@ -1150,7 +1141,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.lines { |
|
|
|
|
height: calc(100vh - 228px); |
|
|
|
|
height: calc(100vh - 186px); |
|
|
|
|
padding-right: 10px; |
|
|
|
|
margin-top: 10px; |
|
|
|
|
overflow: auto; |
|
|
|
@ -1176,7 +1167,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.checked-name { |
|
|
|
|
width: 360px; |
|
|
|
|
width: 285px; |
|
|
|
|
margin-right: 20px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|