diff --git a/src/api/index.js b/src/api/index.js index 6d075fa..57df35f 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -37,4 +37,6 @@ export default { getCompetition: `competition/competition/management/getCompetition`, whetherCanPaste: `nakadai/nakadai/model/demo/whetherCanPaste`, displayListOrNotByStudent: `nakadai/nakadai/model/demo/displayListOrNotByStudent`, + modelClassListByStudent: `nakadai/nakadai/model/student/modelClassListByStudent`, + studentModelListBySystem: `nakadai/nakadai/model/student/studentModelListBySystem`, } \ No newline at end of file diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index 3717328..4d8c0fd 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -319,7 +319,7 @@ export default { this.experimentTarget = project.experimentTarget this.experimentDescription = project.experimentDescription this.experimentHint = project.experimentHint - this.hintOpen = mg.founder ? !mg.hintOpenBySchool : !mg.hintOpen // 0显示,1不显示 + this.hintOpen = mg.founder ? !mg.hintOpen : !mg.hintOpenBySchool // 0显示,1不显示,系统跟老师的禁用字段不一样 this.$emit('tell', projectId, systemId, this.points) const isPrac = this.projectPermissions == 0 // 是否是练习 this.text = isPrac ? '已用' : '剩余' diff --git a/src/components/codemirror.vue b/src/components/codemirror.vue index 88fa4be..9e159c7 100644 --- a/src/components/codemirror.vue +++ b/src/components/codemirror.vue @@ -76,9 +76,41 @@ + :close-on-click-modal="false" + custom-class="model-dia"> + + + + + +
- + + { + this.$post(`${this.api.modelClassListByStudent}?systemId=${this.systemId}&founder=1`).then(res => { const promises = [] - const addType = list => { + const addType = (list, system) => { list.map(e => { e.disabled = true // 用promise储存以添加完后更新数据 promises.push(new Promise((resolve, reject) => { - this.$post(this.api.studentModelList, { + // 系统内置跟本校的模型接口不一样 + this.$post(this.api[system ? 'studentModelListBySystem' : 'studentModelList'], { categoryId: e.id, pageNum: 1, pageSize: 10000, @@ -277,16 +322,22 @@ export default { reject() }) })) - e.children && e.children.length && addType(e.children) + e.children && e.children.length && addType(e.children, system) }) } - addType(data) + addType(res.schoolClassification) + addType(res.systemBuiltInClassification, 1) Promise.all(promises).then(_ => { - this.modelData = data + this.schoolModel = res.schoolClassification + this.systemModel = res.systemBuiltInClassification this.modelLoading = false }).catch(res => { }) }).catch(res => { }) }, + // 分类类型选择回调 + changeModelType (val) { + // this.getType() + }, // 多选框选择回调 treeCheckChange (data, checked, indeterminate) { const checkKey = this.$refs.tree.getCheckedKeys() @@ -754,6 +805,14 @@ export default { max-width: 100%; } } +/deep/.model-dia { + .el-dialog__body { + padding: 0 20px; + } + .el-divider--horizontal { + margin: 15px 0; + } +} .model-wrap { max-height: 400px; overflow: auto; diff --git a/src/views/Home.vue b/src/views/Home.vue index 5257deb..a01d5d1 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -67,7 +67,7 @@ height="700"> -->