题库管理
This commit is contained in:
@@ -169,7 +169,7 @@
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="240"
|
||||
width="300"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
@@ -189,11 +189,14 @@
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="showLinkTags(scope.row)"
|
||||
>查看引用</el-button
|
||||
>
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleQuestionBank(scope.row)"
|
||||
>题库管理</el-button
|
||||
>
|
||||
<el-button type="text" size="small" @click="showLinkTags(scope.row)"
|
||||
>查看引用</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@@ -216,7 +219,7 @@
|
||||
>查看引用</el-button
|
||||
>
|
||||
</el-dropdown-item> -->
|
||||
<!-- <el-dropdown-item>
|
||||
<!-- <el-dropdown-item>
|
||||
<el-button
|
||||
@click="showDirectorShow(scope.row)"
|
||||
type="text"
|
||||
@@ -224,7 +227,7 @@
|
||||
>教务主任管理</el-button
|
||||
>
|
||||
</el-dropdown-item> -->
|
||||
<!-- </el-dropdown-menu>
|
||||
<!-- </el-dropdown-menu>
|
||||
</el-dropdown> -->
|
||||
</div>
|
||||
</template>
|
||||
@@ -354,15 +357,37 @@
|
||||
<el-button type="primary" @click="saveDirector">提 交</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-drawer title="" size="80%" :visible.sync="showQuestionBank" destroy-on-close>
|
||||
<div slot="title">
|
||||
<p
|
||||
style="margin: 0;font-size: 18px;"
|
||||
>
|
||||
<span style="font-weight: bold;">题库管理</span
|
||||
><span style="margin-left: 20px;">[ {{ selectCourse.title }} ]</span>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div style="padding:0 20px;box-sizing: border-box;">
|
||||
<question-bank
|
||||
ref="questionBank"
|
||||
:course="selectCourse"
|
||||
></question-bank>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import commonShopTable from "./shopproductTable.vue";
|
||||
import AddOrUpdate from "./course-add-or-update";
|
||||
import questionBank from "./examination/questionBank";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectCourse: {},
|
||||
showQuestionBank: false,
|
||||
selectType: [],
|
||||
director: {
|
||||
director: null,
|
||||
@@ -420,7 +445,8 @@ export default {
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
commonShopTable
|
||||
commonShopTable,
|
||||
questionBank
|
||||
},
|
||||
activated() {
|
||||
if (this.$route.query.upPageInde != null) {
|
||||
@@ -439,9 +465,12 @@ export default {
|
||||
this.relationProducts = list.slice(1, 1);
|
||||
},
|
||||
saveDirector() {
|
||||
if(this.director.director == this.director.ddirector && this.director.director != null){
|
||||
this.$message.error('主任与副主任不能是同一人')
|
||||
return
|
||||
if (
|
||||
this.director.director == this.director.ddirector &&
|
||||
this.director.director != null
|
||||
) {
|
||||
this.$message.error("主任与副主任不能是同一人");
|
||||
return;
|
||||
}
|
||||
var director = 0;
|
||||
var ddirector = 0;
|
||||
@@ -477,16 +506,14 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
this.$refs["director"].resetFields();
|
||||
this.director = {
|
||||
director: null,
|
||||
ddirector: null
|
||||
};
|
||||
this.userList = []
|
||||
director: null,
|
||||
ddirector: null
|
||||
};
|
||||
this.userList = [];
|
||||
this.optCourse = {};
|
||||
console.log("director关闭了吗", this.director);
|
||||
})
|
||||
|
||||
},200)
|
||||
|
||||
console.log("director关闭了吗", this.director);
|
||||
});
|
||||
}, 200);
|
||||
},
|
||||
async showDirectorShow(data) {
|
||||
this.optCourse = data;
|
||||
@@ -495,41 +522,42 @@ export default {
|
||||
if (obj) {
|
||||
// console.log("有绑定", obj.data.director.tel);
|
||||
if (obj.data.director != null) {
|
||||
var list = this.userList.map( item => { return item.id})
|
||||
console.log('list',list)
|
||||
var i = list.find(function(elem){
|
||||
return elem == obj.data.director.id;
|
||||
});
|
||||
if(!i){
|
||||
var list = this.userList.map(item => {
|
||||
return item.id;
|
||||
});
|
||||
console.log("list", list);
|
||||
var i = list.find(function(elem) {
|
||||
return elem == obj.data.director.id;
|
||||
});
|
||||
if (!i) {
|
||||
this.userList.push({
|
||||
id:obj.data.director.id,
|
||||
tel:obj.data.director.tel
|
||||
})
|
||||
}
|
||||
this.director.director = obj.data.director.id;
|
||||
}
|
||||
else {
|
||||
// this.director.director = null;
|
||||
}
|
||||
if (obj.data.ddirector != null) {
|
||||
console.log('jinlailema')
|
||||
var list = this.userList.map( item => { return item.id})
|
||||
console.log('list',list)
|
||||
var i = list.find(function(elem){
|
||||
return elem == obj.data.ddirector.id;
|
||||
id: obj.data.director.id,
|
||||
tel: obj.data.director.tel
|
||||
});
|
||||
if(!i){
|
||||
this.userList.push({
|
||||
id:obj.data.ddirector.id,
|
||||
tel:obj.data.ddirector.tel
|
||||
})
|
||||
}
|
||||
this.director.director = obj.data.director.id;
|
||||
} else {
|
||||
// this.director.director = null;
|
||||
}
|
||||
if (obj.data.ddirector != null) {
|
||||
console.log("jinlailema");
|
||||
var list = this.userList.map(item => {
|
||||
return item.id;
|
||||
});
|
||||
console.log("list", list);
|
||||
var i = list.find(function(elem) {
|
||||
return elem == obj.data.ddirector.id;
|
||||
});
|
||||
if (!i) {
|
||||
this.userList.push({
|
||||
id: obj.data.ddirector.id,
|
||||
tel: obj.data.ddirector.tel
|
||||
});
|
||||
}
|
||||
this.director.ddirector = obj.data.ddirector.id;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// this.ddirector.director = null;
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log("没有绑定");
|
||||
this.director = {
|
||||
@@ -723,6 +751,15 @@ export default {
|
||||
this.$refs.addOrUpdate.init(row);
|
||||
});
|
||||
},
|
||||
// 新增 / 修改
|
||||
handleQuestionBank(row) {
|
||||
console.log("row at line 744:", row);
|
||||
|
||||
this.showQuestionBank = true;
|
||||
this.selectCourse = row;
|
||||
this.$forceUpdate();
|
||||
// row ? (this.courseId = row.id) : "";
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id) {
|
||||
var ids = id
|
||||
@@ -845,10 +882,13 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
isSameOne() {
|
||||
if(this.director.ddirector == this.director.director && this.director.ddirector != null){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
if (
|
||||
this.director.ddirector == this.director.director &&
|
||||
this.director.ddirector != null
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -863,4 +903,6 @@ export default {
|
||||
.flexbox {
|
||||
display: flex;
|
||||
}
|
||||
/deep/.el-drawer__header{
|
||||
background-color: #f0f0f0 !important;}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user