yujialong 1 month ago
parent 761e5549b6
commit 688a08ab1a
  1. 1
      public/static/ueditorPlus/ueditor.config.js
  2. 72
      src/pages/knowledge/index.vue
  3. 21
      src/pages/ques/detail/index.vue
  4. 4
      src/pages/ques/list/batchImport.vue
  5. 15
      src/pages/ques/list/index.vue
  6. 9
      src/pages/testPaper/detail/auto.vue
  7. 4
      src/pages/testPaper/detail/index.vue
  8. 5
      src/styles/common.scss

@ -60,6 +60,7 @@
".gif", ".gif",
".bmp" ".bmp"
], ],
autoFloatEnabled: false,
// fontfamily: [], // fontfamily: [],
//工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义 //工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义

@ -1,7 +1,7 @@
<template> <template>
<div :class="['page', { inQues }]"> <el-drawer title="知识点设置" :visible.sync="kpVisible" size="1200px" :close-on-click-modal="false" append-to-body
<Breadcrumb v-if="!inQues" style="margin-bottom: 0;" :data="crumbs" /> custom-class="kp-dia" @closed="closeDia">
<div class="wrap"> <div class="page">
<div class="side"> <div class="side">
<div class="m-b-20"> <div class="m-b-20">
<el-radio-group v-model="isNotJoin" @change="changeType"> <el-radio-group v-model="isNotJoin" @change="changeType">
@ -22,7 +22,7 @@
<el-input class="m-b-10" placeholder="请输入知识点分类" prefix-icon="el-icon-search" size="small" clearable <el-input class="m-b-10" placeholder="请输入知识点分类" prefix-icon="el-icon-search" size="small" clearable
v-model="keyword"></el-input> v-model="keyword"></el-input>
<div style="overflow: auto"> <div class="type-wrap">
<el-tree v-loading="loading" :data="types" default-expand-all ref="typeTree" node-key="id" highlight-current <el-tree v-loading="loading" :data="types" default-expand-all ref="typeTree" node-key="id" highlight-current
:expand-on-click-node="false" @node-click="handleNodeClick" :props="{ label: 'name', isLeaf: 'leaf' }"> :expand-on-click-node="false" @node-click="handleNodeClick" :props="{ label: 'name', isLeaf: 'leaf' }">
<span class="custom-tree-node" slot-scope="{ node, data }"> <span class="custom-tree-node" slot-scope="{ node, data }">
@ -117,7 +117,6 @@
</div> </div>
</div> </div>
<el-dialog title="提示" :visible.sync="delVisible" width="400px" :close-on-click-modal="false" append-to-body <el-dialog title="提示" :visible.sync="delVisible" width="400px" :close-on-click-modal="false" append-to-body
custom-class="del-dia"> custom-class="del-dia">
<div class="del-wrap"> <div class="del-wrap">
@ -132,7 +131,7 @@
<el-button type="primary" @click="delTypeSubmit">确定</el-button> <el-button type="primary" @click="delTypeSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </el-drawer>
</template> </template>
<script> <script>
@ -140,12 +139,12 @@ import Util from '@/libs/util'
import _ from 'lodash' import _ from 'lodash'
import Breadcrumb from '@/components/breadcrumb' import Breadcrumb from '@/components/breadcrumb'
export default { export default {
props: ['visible'],
components: { Breadcrumb }, components: { Breadcrumb },
data () { data () {
return { return {
crumbs: [], kpVisible: false,
questionBankId: this.$route.query.questionBankId, questionBankId: this.$route.query.questionBankId,
inQues: false,
createSource: 1, createSource: 1,
loading: false, loading: false,
keyword: '', keyword: '',
@ -209,26 +208,12 @@ export default {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(this.getList, 500) this.searchTimer = setTimeout(this.getList, 500)
}, },
visible () {
this.kpVisible = this.visible
this.visible && this.getType()
}
}, },
mounted () { mounted () { },
const { query } = this.$route
const { referrer1, referrer2 } = this.$store.state.user
this.crumbs = [
{
name: query.questionBankName || '题库管理',
route: referrer1 || '/quesBank'
},
{
name: '试题列表',
route: referrer2 || '/ques',
},
{
name: '知识点列表'
},
]
this.inQues = this.$route.path === '/ques/detail' //
this.getType()
},
methods: { methods: {
// //
async getType () { async getType () {
@ -259,7 +244,7 @@ export default {
name: '', name: '',
} }
this.typeVisible = true this.typeVisible = true
this.cascaderValue = data.path.split('/').map(e => +e) this.cascaderValue = data ? data.path.split('/').map(e => +e) : []
}, },
// //
editType (node, data) { editType (node, data) {
@ -403,7 +388,6 @@ export default {
name: row.name, name: row.name,
parentId: path.slice(0, path.length - 1), parentId: path.slice(0, path.length - 1),
} }
console.log(11, this.form)
}, },
// //
async knowledgeSubmit () { async knowledgeSubmit () {
@ -446,29 +430,29 @@ export default {
Util.warningMsg('请选择数据') Util.warningMsg('请选择数据')
} }
}, },
//
closeDia () {
this.$emit('closed')
this.$emit('update:visible', false)
}
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.m-b-20 {
margin-bottom: 20px;
}
.org-name { .org-name {
margin-right: 20px; margin-right: 20px;
} }
.w-100 {
width: 100%;
}
.inQues { /deep/.kp-dia {
padding: 0 25px; .el-drawer__header {
} margin-bottom: 0;
}
.wrap { .page {
display: flex; display: flex;
padding: 0 24px;
.side { .side {
width: 300px; width: 300px;
@ -477,9 +461,17 @@ export default {
border-right: 1px solid rgba(0, 0, 0, 0.06); border-right: 1px solid rgba(0, 0, 0, 0.06);
} }
.type-wrap {
max-height: calc(100vh - 265px);
overflow: auto;
}
.right { .right {
width: calc(100% - 324px); width: calc(100% - 324px);
max-height: calc(100vh - 53px);
padding: 24px 0; padding: 24px 0;
overflow: auto;
}
} }
} }
</style> </style>

@ -222,11 +222,7 @@
</span> </span>
</el-dialog> </el-dialog>
<Knowledge :visible.sync="kpVisible" @closed="getKnowledge" />
<el-drawer title="知识点设置" :visible.sync="kpVisible" size="1200px" :close-on-click-modal="false" append-to-body
custom-class="kp-dia" @closed="getKnowledge">
<Knowledge />
</el-drawer>
</div> </div>
</template> </template>
<script> <script>
@ -598,15 +594,18 @@ export default {
}, },
// //
answerAnalysisReady (editor) { answerAnalysisReady (editor) {
this.isDisabled ? editor.setDisabled() : editor.setContent(this.answerAnalysis) this.isDisabled && editor.setDisabled()
editor.setContent(this.answerAnalysis)
}, },
// //
uploadInstructionsReady (editor) { uploadInstructionsReady (editor) {
this.isDisabled ? editor.setDisabled() : editor.setContent(this.form.uploadInstructions) this.isDisabled && editor.setDisabled()
editor.setContent(this.form.uploadInstructions)
}, },
// //
referenceAnswerReady (editor) { referenceAnswerReady (editor) {
this.isDisabled ? editor.setDisabled() : editor.setContent(this.form.questionAnswerVersions[0].referenceAnswer) this.isDisabled && editor.setDisabled()
editor.setContent(this.form.questionAnswerVersions[0].referenceAnswer)
}, },
// //
correctChange (i) { correctChange (i) {
@ -946,10 +945,4 @@ export default {
.correct-check { .correct-check {
margin-right: 15px; margin-right: 15px;
} }
/deep/.kp-dia {
.el-drawer__header {
margin-bottom: 0;
}
}
</style> </style>

@ -30,7 +30,7 @@
:on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove"
:limit="1" :data="{ :limit="1" :data="{
questionBankId: params.questionBankId questionBankId: params.questionBankId
}" :disabled="uploading" :loading="uploading" :on-exceed="handleExceed" }" :disabled="uploading" v-loading="uploading" :on-exceed="handleExceed"
:action="this.api.batchImportQuestions" :file-list="uploadList" :headers="headers"> :action="this.api.batchImportQuestions" :file-list="uploadList" :headers="headers">
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
@ -145,7 +145,7 @@ export default {
.el-progress__text, .el-progress__text,
.el-progress, .el-progress,
.el-upload-list__item-status-label { .el-upload-list__item-status-label {
// display: none !important; display: none !important;
} }
} }
</style> </style>

@ -164,18 +164,21 @@
</el-dialog> </el-dialog>
<BatchImport :visible.sync="importVisible" :params.sync="$route.query" /> <BatchImport :visible.sync="importVisible" :params.sync="$route.query" />
<Knowledge :visible.sync="kpVisible" @closed="getType" />
</div> </div>
</template> </template>
<script> <script>
import Breadcrumb from '@/components/breadcrumb' import Breadcrumb from '@/components/breadcrumb'
import BatchImport from './batchImport' import BatchImport from './batchImport'
import Knowledge from '@/pages/knowledge'
import Util from '@/libs/util' import Util from '@/libs/util'
import Setting from '@/setting' import Setting from '@/setting'
import Const from '@/const/ques' import Const from '@/const/ques'
import Qs from 'qs' import Qs from 'qs'
export default { export default {
components: { Breadcrumb, BatchImport }, components: { Breadcrumb, BatchImport, Knowledge },
data () { data () {
return { return {
crumbs: [], crumbs: [],
@ -230,6 +233,8 @@ export default {
curRow: {}, curRow: {},
importVisible: false, importVisible: false,
kpVisible: false,
}; };
}, },
computed: { computed: {
@ -318,11 +323,7 @@ export default {
}, },
// //
toSet () { toSet () {
this.setReferrer() this.kpVisible = true
this.$router.push({
path: '/knowledge',
query: this.$route.query
})
}, },
// url // url
setReferrer () { setReferrer () {
@ -489,6 +490,8 @@ export default {
await this.$post(this.api.delQuestion, ids) await this.$post(this.api.delQuestion, ids)
Util.successMsg('删除成功') Util.successMsg('删除成功')
this.getList() this.getList()
this.multipleSelection = []
this.$refs.table.clearSelection()
} catch (e) { } } catch (e) { }
} }
}, },

@ -1,5 +1,4 @@
<template> <template>
<div>
<el-drawer title="自动选题" :visible.sync="quesVisible" size="1200px" :close-on-click-modal="false" <el-drawer title="自动选题" :visible.sync="quesVisible" size="1200px" :close-on-click-modal="false"
custom-class="ques-dia" @closed="closeDia"> custom-class="ques-dia" @closed="closeDia">
<div class="overflow"> <div class="overflow">
@ -8,7 +7,7 @@
<ul class="filter"> <ul class="filter">
<li style="margin-right: 10px"> <li style="margin-right: 10px">
<label>试卷难度</label> <label>试卷难度</label>
<el-select v-model="difficult" placeholder="请选择试卷难度" @change="difficultChange"> <el-select v-model="difficult" placeholder="请选择试卷难度" clearable @change="difficultChange">
<el-option v-for="(item, i) in difficults" :key="i" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item, i) in difficults" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
@ -182,7 +181,6 @@
<el-button type="primary" :loading="submiting" @click="submit">自动选题</el-button> <el-button type="primary" :loading="submiting" @click="submit">自动选题</el-button>
</div> </div>
</el-drawer> </el-drawer>
</div>
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from '@/setting'
@ -438,6 +436,7 @@ export default {
// //
difficultChange (val) { difficultChange (val) {
if (val) {
const difficultyWeights = [0.2, 0.4, 0.6, 0.8] const difficultyWeights = [0.2, 0.4, 0.6, 0.8]
const names = ['basicDifficulty', 'normalDifficulty', 'hardDifficulty', 'veryHardDifficulty'] const names = ['basicDifficulty', 'normalDifficulty', 'hardDifficulty', 'veryHardDifficulty']
// //
@ -476,6 +475,7 @@ export default {
} }
this.$set(e, 'randomDifficulty', 0) this.$set(e, 'randomDifficulty', 0)
}) })
}
}, },
// //
yearAllChange (val) { yearAllChange (val) {
@ -488,7 +488,7 @@ export default {
// //
async submit () { async submit () {
if (this.submiting) return false if (this.submiting) return false
const { list } = this const { list, checked } = this
let invalid = 0 let invalid = 0
let totalCount = 0 let totalCount = 0
for (const i in list) { for (const i in list) {
@ -540,6 +540,7 @@ export default {
list.map(e => { list.map(e => {
e.givenYears = years e.givenYears = years
e.knowledgePointsIds = k e.knowledgePointsIds = k
e.questionBankIds = checked.map(n => n.quesBank.id)
}) })
try { try {
const res = await this.$post(this.api.selectQuestionsByTypeAndDifficulty, list) const res = await this.$post(this.api.selectQuestionsByTypeAndDifficulty, list)

@ -921,12 +921,12 @@ export default {
invalid = 1 invalid = 1
break break
} }
if (!e.questionNum) { if (e.questionNum === '') {
Util.warningMsg('请输入目标题数') Util.warningMsg('请输入目标题数')
invalid = 1 invalid = 1
break break
} }
if (!e.targetScore) { if (e.targetScore === '') {
Util.warningMsg('请输入目标分值') Util.warningMsg('请输入目标分值')
invalid = 1 invalid = 1
break break

@ -496,3 +496,8 @@
} }
} }
} }
.el-drawer__header > :first-child {
font-size: 16px;
font-weight: 600;
color: #333;
}
Loading…
Cancel
Save