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

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

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

Loading…
Cancel
Save