openf12
yujialong 1 year ago
parent c53b018596
commit 981ed55a11
  1. 2
      src/api/index.js
  2. 2
      src/components/TestPanel.vue
  3. 77
      src/components/codemirror.vue
  4. 2
      src/views/Home.vue

@ -37,4 +37,6 @@ export default {
getCompetition: `competition/competition/management/getCompetition`, getCompetition: `competition/competition/management/getCompetition`,
whetherCanPaste: `nakadai/nakadai/model/demo/whetherCanPaste`, whetherCanPaste: `nakadai/nakadai/model/demo/whetherCanPaste`,
displayListOrNotByStudent: `nakadai/nakadai/model/demo/displayListOrNotByStudent`, displayListOrNotByStudent: `nakadai/nakadai/model/demo/displayListOrNotByStudent`,
modelClassListByStudent: `nakadai/nakadai/model/student/modelClassListByStudent`,
studentModelListBySystem: `nakadai/nakadai/model/student/studentModelListBySystem`,
} }

@ -319,7 +319,7 @@ export default {
this.experimentTarget = project.experimentTarget this.experimentTarget = project.experimentTarget
this.experimentDescription = project.experimentDescription this.experimentDescription = project.experimentDescription
this.experimentHint = project.experimentHint this.experimentHint = project.experimentHint
this.hintOpen = mg.founder ? !mg.hintOpenBySchool : !mg.hintOpen // 01 this.hintOpen = mg.founder ? !mg.hintOpen : !mg.hintOpenBySchool // 01
this.$emit('tell', projectId, systemId, this.points) this.$emit('tell', projectId, systemId, this.points)
const isPrac = this.projectPermissions == 0 // const isPrac = this.projectPermissions == 0 //
this.text = isPrac ? '已用' : '剩余' this.text = isPrac ? '已用' : '剩余'

@ -76,9 +76,41 @@
<el-dialog title="请选择要导入的模型" <el-dialog title="请选择要导入的模型"
:visible.sync="modelVisible" :visible.sync="modelVisible"
width="400px" width="400px"
:close-on-click-modal="false"> :close-on-click-modal="false"
custom-class="model-dia">
<el-select class="w-100"
v-model="modelType"
size="mini">
<el-option v-for="item in modelOp"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<!-- <el-radio-group v-model="modelType"
@change="changeModelType">
<div style="margin-bottom: 10px;">
<el-radio :label="0">本校模型</el-radio>
</div>
<div>
<el-radio :label="1">内置模型</el-radio>
</div>
</el-radio-group> -->
<!-- <el-divider></el-divider> -->
<div class="model-wrap"> <div class="model-wrap">
<el-tree :data="modelData" <el-tree v-if="!modelType"
:data="schoolModel"
ref="tree"
default-expand-all
@check-change="treeCheckChange"
show-checkbox
:check-strictly="true"
node-key="id"
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}"
v-loading="modelLoading">
</el-tree>
<el-tree v-if="modelType"
:data="systemModel"
ref="tree" ref="tree"
default-expand-all default-expand-all
@check-change="treeCheckChange" @check-change="treeCheckChange"
@ -200,7 +232,19 @@ export default {
modelVisible: false, modelVisible: false,
modelLoading: false, modelLoading: false,
modelImporting: false, modelImporting: false,
modelData: [] schoolModel: [],
systemModel: [],
modelType: 1,
modelOp: [
{
id: 0,
name: '本校模型'
},
{
id: 1,
name: '内置模型'
},
]
}; };
}, },
components: { components: {
@ -252,14 +296,15 @@ export default {
this.modelLoading = true this.modelLoading = true
this.modelVisible = true this.modelVisible = true
// //
this.$post(`${this.api.modelClassList}?systemId=${this.systemId}&founder=1`).then(({ data }) => { this.$post(`${this.api.modelClassListByStudent}?systemId=${this.systemId}&founder=1`).then(res => {
const promises = [] const promises = []
const addType = list => { const addType = (list, system) => {
list.map(e => { list.map(e => {
e.disabled = true e.disabled = true
// promise // promise
promises.push(new Promise((resolve, reject) => { promises.push(new Promise((resolve, reject) => {
this.$post(this.api.studentModelList, { //
this.$post(this.api[system ? 'studentModelListBySystem' : 'studentModelList'], {
categoryId: e.id, categoryId: e.id,
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
@ -277,16 +322,22 @@ export default {
reject() 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(_ => { Promise.all(promises).then(_ => {
this.modelData = data this.schoolModel = res.schoolClassification
this.systemModel = res.systemBuiltInClassification
this.modelLoading = false this.modelLoading = false
}).catch(res => { }) }).catch(res => { })
}).catch(res => { }) }).catch(res => { })
}, },
//
changeModelType (val) {
// this.getType()
},
// //
treeCheckChange (data, checked, indeterminate) { treeCheckChange (data, checked, indeterminate) {
const checkKey = this.$refs.tree.getCheckedKeys() const checkKey = this.$refs.tree.getCheckedKeys()
@ -754,6 +805,14 @@ export default {
max-width: 100%; max-width: 100%;
} }
} }
/deep/.model-dia {
.el-dialog__body {
padding: 0 20px;
}
.el-divider--horizontal {
margin: 15px 0;
}
}
.model-wrap { .model-wrap {
max-height: 400px; max-height: 400px;
overflow: auto; overflow: auto;

@ -67,7 +67,7 @@
height="700"> --> height="700"> -->
<iframe v-else <iframe v-else
class="vscode" class="vscode"
src="http://121.37.12.51:8088/?folder=/home/coder" src="https://vscode.occupationlab.com/"
frameborder="0" frameborder="0"
width="100%"></iframe> width="100%"></iframe>
</el-tab-pane> </el-tab-pane>

Loading…
Cancel
Save