yujialong 4 years ago
parent 94434ab283
commit 1004a1de26
  1. 13
      src/pages/quesBank/list/globalQuesBank.vue
  2. 2
      src/pages/quesBank/list/myQuesBank.vue
  3. 37
      src/pages/quesBank/list/quesBankType.vue
  4. 50
      src/pages/quesBank/list/quesDialog.vue

@ -35,8 +35,7 @@
<div class="p-title">题目列表</div>
<div>
<!-- <el-button type="primary" size="small" round @click="delAllData" v-auth>取消共享</el-button> -->
<el-button type="primary" size="small" round @click="delAllData" v-auth>批量删除</el-button>
<el-button type="primary" size="small" round @click="delAllData" v-auth>批量取消共享</el-button>
</div>
</div>
<el-table :data="listData" class="table" stripe header-align="center" row-key="id" @selection-change="handleSelectionChange">
@ -53,7 +52,7 @@
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth>取消共享</el-button>
</template>
</el-table-column>
</el-table>
@ -139,12 +138,12 @@ export default {
this.multipleSelection = val
},
delData(row) {
this.$confirm('确定要删除吗?', '提示', {
this.$confirm('确定要取消共享吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteByMeSubjectBySharing}?identification=1&ids=${row.sid}`).then(res => {
this.$message.success('删除成功')
this.$message.success('取消共享成功')
this.getData()
}).catch(res => {});
})
@ -157,13 +156,13 @@ export default {
return item.sid
})
this.$confirm('确定要删除吗?', '提示', {
this.$confirm('确定要取消共享吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteByMeSubjectBySharing}?identification=1&ids=${delList.join()}`).then(res => {
this.multipleSelection = [];
this.$message.success('删除成功')
this.$message.success('取消共享成功')
this.getData()
this.$refs.table.clearSelection()
}).catch(res => {})

@ -89,7 +89,7 @@
<el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column>
<el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="上传时间" width="140" align="center"></el-table-column>
<el-table-column label="操作" width="200">
<el-table-column label="操作" width="230">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="edit(scope.row)">修改</el-button>

@ -20,9 +20,12 @@
<el-button type="primary" size="small" round @click="addFirst" v-auth>添加一级分类</el-button>
</div>
</div>
<el-table :data="listData" class="table" stripe header-align="center" row-key="cid" :tree-props="treeProps" :indent="32">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="typeName" label="分类名称"></el-table-column>
<el-table :data="listData" class="table" stripe header-align="center" row-key="cid" :tree-props="treeProps" :indent="9">
<el-table-column prop="typeName" label="分类名称">
<template slot-scope="scope">
<span style="display: inline-block;width: 23px;" v-if="!scope.row.secondColumn.length"></span>{{scope.row.typeName}}
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" v-if="scope.row.parentId == 0" @click="addSecond(scope.row)" v-auth>添加</el-button>
@ -88,7 +91,7 @@ export default {
},
computed: {
...mapState('user', [
'userId'
'userId','clientId'
])
},
mounted() {
@ -106,24 +109,20 @@ export default {
getData() {
let data = {
pageNum: this.page,
pageSize: this.pageSize
pageSize: this.pageSize,
keyword: this.keyword,
schoolId: this.clientId,
source: 1
}
this.$post(this.api.listByPage,data)
.then(res => {
let list = res.data.list.list
// list.map((n,i) => {
// n.index = i + 1
// n.secondColumn.map((j,i) => {
// j.index = i + 1
// })
// })
this.listData = list
this.listData = res.data.list.list
this.total = res.data.list.totalCount
}).catch(err => {})
},
handleCurrentChange(val) {
this.page = val;
this.getData();
this.page = val
this.getData()
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
@ -135,7 +134,7 @@ export default {
this.getData()
}).catch(res => {})
})
.catch(() => {});
.catch(() => {})
},
addFirst(){
this.isAddFirst = true
@ -145,7 +144,9 @@ export default {
if(!this.firstName) return this.$message.warning('请填写题库分类名称')
let data = {
userId: this.userId,
typeName: this.firstName
typeName: this.firstName,
schoolId: this.clientId,
source: 1
}
if(this.curRow.cid){
data.cid = this.curRow.cid
@ -197,6 +198,8 @@ export default {
let data = {
typeName: this.secondName,
userId: this.userId,
schoolId: this.clientId,
source: 1
}
if(this.curRow.parentId == 0){
data.parentId = this.curRow.cid

@ -11,7 +11,12 @@
>
<el-form-item label="所属题库" prop="cid">
<el-select v-model="topicForm.cid" clearable placeholder="请选择所属题库">
<el-option v-for="(item,index) in quesBankList" :key="index" :label="item.typeName" :value="item.cid"></el-option>
<template v-for="(item,index) in quesBankList">
<el-option :key="index" :label="item.typeName" :value="item.cid"></el-option>
<template v-for="(item1,index1) in item.secondColumn">
<el-option class="second" :key="index1" :label="item1.typeName" :value="item1.cid"></el-option>
</template>
</template>
</el-select>
</el-form-item>
<el-form-item label="所属课程" prop="courses">
@ -51,44 +56,44 @@
<el-form-item label="选项" prop="optionA" v-if="topicForm.questionType != '填空题' && topicForm.questionType != '简答题'">
<template v-if="topicForm.questionType == '判断题'">
<div class="input flex_around bt">
<div class="input flex j-around a-center m-b-15">
<span>A</span>
<el-input placeholder="请输入题目" v-model="topicForm.judgeOptionA" disabled></el-input>
<el-radio v-model="topicForm.aisTrue" label="1">设为正确答案</el-radio>
</div>
<div class="input flex_around bt">
<div class="input flex j-around a-center m-b-15">
<span>B</span>
<el-input placeholder="请输入题目" v-model="topicForm.judgeOptionB" disabled></el-input>
<el-radio v-model="topicForm.aisTrue" label="2">设为正确答案</el-radio>
</div>
</template>
<template v-else>
<div class="input flex_around bt">
<div class="input flex j-around a-center m-b-15">
<span>A</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionA"></el-input>
<el-checkbox v-model="topicForm.aisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex_around bt">
<div class="input flex j-around a-center m-b-15">
<span>B</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionB"></el-input>
<el-checkbox v-model="topicForm.bisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex_around bt">
<div class="input flex j-around a-center m-b-15">
<span>C</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionC"></el-input>
<el-checkbox v-model="topicForm.cisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex_around bt">
<div class="input flex j-around a-center m-b-15">
<span>D</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionD"></el-input>
<el-checkbox v-model="topicForm.disTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex_around bt">
<div class="input flex j-around a-center m-b-15">
<span>E</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionE"></el-input>
<el-checkbox v-model="topicForm.eisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex_around">
<div class="input flex j-around a-center">
<span>F</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionF"></el-input>
<el-checkbox v-model="topicForm.fisTrue">设为正确答案</el-checkbox>
@ -176,7 +181,7 @@ export default {
},
computed: {
...mapState('user', [
'userId'
'userId','clientId'
])
},
components: { quill },
@ -245,16 +250,13 @@ export default {
getQuesBank() {
let data = {
pageNum: 1,
pageSize: 10000
pageSize: 10000,
schoolId: this.clientId,
source: 1
}
this.$post(this.api.listByPage,data)
.then(res => {
let list = res.data.list.list
let result = list
list.map((n,i) => {
result = result.concat(n.secondColumn)
})
this.quesBankList = result
this.quesBankList = res.data.list.list
})
.catch(err => {})
},
@ -435,20 +437,12 @@ export default {
/deep/.el-radio{
margin-right: 15px;
}
.second{
padding-left: 46px !important;
}
::v-deep .el-checkbox-group{
font-size: 2px;
}
.Upload {
text-align: center;
}
.bt {
margin-bottom: 15px;
}
.flex_around {
display: flex;
justify-content: space-around;
align-items: center;
}
.input ::v-deep .el-input {
width: 50%;
}

Loading…
Cancel
Save