dev_202412
yujialong 2 months ago
parent 7abfb5437a
commit 3a0907ddfb
  1. 6
      src/api/index.js
  2. 2
      src/layouts/home/index.vue
  3. 3
      src/layouts/navbar/index.vue
  4. 233
      src/pages/lesson/detail/index.vue
  5. 2
      src/pages/lesson/list/index.vue

@ -519,9 +519,13 @@ export default {
curriculumList: `nakadai/nakadai/curriculum/curriculumList`, curriculumList: `nakadai/nakadai/curriculum/curriculumList`,
createCurriculum: `nakadai/nakadai/curriculum/createCurriculum`, createCurriculum: `nakadai/nakadai/curriculum/createCurriculum`,
configureCourseProject: `nakadai/nakadai/curriculum/configureCourseProject`,
deleteCoursePrompt: `nakadai/nakadai/curriculum/deleteCoursePrompt`,
delCourse: `nakadai/nakadai/curriculum/delCourse`,
isShelves: `nakadai/nakadai/curriculum/isShelves`,
modifyCourse: `nakadai/nakadai/curriculum/modifyCourse`, modifyCourse: `nakadai/nakadai/curriculum/modifyCourse`,
schoolCourseProject: `nakadai/nakadai/curriculum/schoolCourseProject`, schoolCourseProject: `nakadai/nakadai/curriculum/schoolCourseProject`,
// schoolCourseProject: `nakadai/nakadai/curriculum/schoolCourseProject`, configureCourseProjectBySchool: `nakadai/nakadai/curriculum/configureCourseProjectBySchool`,
// 教师评语 // 教师评语
addComment: `evaluation/cevaluation/comment/addComment`, addComment: `evaluation/cevaluation/comment/addComment`,

@ -212,7 +212,7 @@ export default {
.content { .content {
// width: calc(100vw - 160px); // width: calc(100vw - 160px);
flex: 1; flex: 1;
height: calc(100vh - 213px); // height: calc(100vh - 213px);
padding: 24px; padding: 24px;
margin-bottom: 20px; margin-bottom: 20px;
transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;

@ -156,6 +156,9 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.menus { .menus {
z-index: 1000;
position: sticky;
top: 0;
display: flex; display: flex;
justify-content: center; justify-content: center;
background-color: #062c87; background-color: #062c87;

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

@ -152,6 +152,7 @@ export default {
onVisible: false, onVisible: false,
classes: [], classes: [],
isSpecify: 0,
curRow: {}, curRow: {},
}; };
}, },
@ -314,6 +315,7 @@ export default {
// //
async changeSwitch (val, row) { async changeSwitch (val, row) {
if (val) { if (val) {
row.isShelves = 0
this.curRow = row this.curRow = row
this.onVisible = true this.onVisible = true
} else { } else {

Loading…
Cancel
Save