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`,
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`,
schoolCourseProject: `nakadai/nakadai/curriculum/schoolCourseProject`,
// schoolCourseProject: `nakadai/nakadai/curriculum/schoolCourseProject`,
configureCourseProjectBySchool: `nakadai/nakadai/curriculum/configureCourseProjectBySchool`,
// 教师评语
addComment: `evaluation/cevaluation/comment/addComment`,

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

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

@ -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: '', // 01
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)
// checkdisabled
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)
// checkdisabled
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;
}

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

Loading…
Cancel
Save