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

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

@ -222,11 +222,7 @@
</span>
</el-dialog>
<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>
<Knowledge :visible.sync="kpVisible" @closed="getKnowledge" />
</div>
</template>
<script>
@ -598,15 +594,18 @@ export default {
},
//
answerAnalysisReady (editor) {
this.isDisabled ? editor.setDisabled() : editor.setContent(this.answerAnalysis)
this.isDisabled && editor.setDisabled()
editor.setContent(this.answerAnalysis)
},
//
uploadInstructionsReady (editor) {
this.isDisabled ? editor.setDisabled() : editor.setContent(this.form.uploadInstructions)
this.isDisabled && editor.setDisabled()
editor.setContent(this.form.uploadInstructions)
},
//
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) {
@ -946,10 +945,4 @@ export default {
.correct-check {
margin-right: 15px;
}
/deep/.kp-dia {
.el-drawer__header {
margin-bottom: 0;
}
}
</style>

@ -30,7 +30,7 @@
:on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove"
:limit="1" :data="{
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">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
@ -145,7 +145,7 @@ export default {
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
// display: none !important;
display: none !important;
}
}
</style>

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

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

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

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