Procházet zdrojové kódy

考试模块整体优化改进

luoaoxuan před 1 rokem
rodič
revize
8a70318299

+ 6 - 2
src/views/platform/examination/exam/detail.vue

@@ -16,7 +16,9 @@
             <div class="paper-info">
                 <div class="info-item">
                     <span class="label">考试名称:</span>
-                    <span class="value">{{ paperData.examName }}</span>
+                    <el-tooltip class="item" effect="dark" :content="paperData.examName" placement="top-start">
+                        <span class="value">{{ paperData.examName }}</span>
+                    </el-tooltip>
                 </div>
                 <div class="info-item">
                     <span class="label">创建人:</span>
@@ -44,7 +46,9 @@
                 </div>
                 <div class="info-item">
                     <span class="label">题库名称:</span>
-                    <span class="value">{{ paperData.bankName }}</span>
+                    <el-tooltip class="item" effect="dark" :content="paperData.bankName" placement="top-start">
+                        <span class="value">{{ paperData.bankName }}</span>
+                    </el-tooltip>
                 </div>
                 <div class="info-item">
                     <span class="label">题目数量:</span>

+ 19 - 2
src/views/platform/examination/exam/edit.vue

@@ -95,7 +95,8 @@
                             placeholder="请选择考试题目"
                             style="width:90%"
                         />
-                        <div class="number">题数:{{ allQuestionsNumber.handQuestionsNumber }}</div>
+                        <div class="number">题数:{{ allQuestions.handQuestions?allQuestions.handQuestions.split(',').length:0 }}</div>
+                        <div class="number" style="margin-left:-20px">去重后:{{ allQuestionsNumber.handQuestionsNumber }}</div>
                     </div>
                 </div>
             </el-form-item>
@@ -542,7 +543,13 @@ export default {
                     allRequests.push(this.$common.request('sql', sql))
                 }
                 if (handQuestions) {
-                    const sql = `select * from t_questions where id_ in (${handQuestions.split(',').map(i => `'${i}'`)}) and zhuang_tai_ = '启用' order by field(ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题')`
+                    let sql = ''
+                    if (tiKu) {
+                        sql = `select * from t_questions where id_ in (${handQuestions.split(',').map(i => `'${i}'`)}) and parent_id_ not in (${tiKu.split(',').map(i => `'${i}'`)}) and zhuang_tai_ = '启用' order by field(ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题')`
+                    } else {
+                        sql = `select * from t_questions where id_ in (${handQuestions.split(',').map(i => `'${i}'`)}) and zhuang_tai_ = '启用' order by field(ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题')`
+                    }
+
                     allRequests.push(this.$common.request('sql', sql))
                 }
                 if (allRequests.length) {
@@ -607,7 +614,17 @@ export default {
                         level.questionNumber = level.list.length
                     })
                 } else {
+                    // 根据当前的抽题方式给另外一种抽题方式填充默认值
                     this.isFirst = false
+                    if (this.form.chou_ti_fang_shi_ === '1') {
+                        this.levelList.forEach(level => {
+                            level.questionNumber = level.list.length
+                        })
+                    } else if (this.form.chou_ti_fang_shi_ === '2') {
+                        this.handList.forEach(hand => {
+                            hand.questionNumber = hand.list.length
+                        })
+                    }
                 }
             }
 

+ 2 - 1
src/views/platform/examination/exam/list.vue

@@ -283,7 +283,7 @@ export default {
                                 bankName: item.bankName,
                                 examinee: item.examinee,
                                 questionCount: item.isRand === '1' ? parseFloat(item.randTotal) : parseFloat(item.questionCount),
-                                duration: item.duration,
+                                duration: this.transformTime(item.duration),
                                 limitCount: item.limitCount,
                                 limitDate: item.limitDate,
                                 qualifiedRadio: item.qualifiedRadio,
@@ -726,6 +726,7 @@ export default {
             return user.userName || '-'
         },
         transformTime (timeStamp) {
+            if (timeStamp === '不限' || !timeStamp) return '不限'
             const hours = Math.floor(parseInt(timeStamp) / 3600000)
             const minutes = Math.floor((parseInt(timeStamp) % 3600000) / 60000)
             return hours + '小时' + minutes + '分钟'

+ 3 - 1
src/views/platform/examination/questionBank/detail.vue

@@ -16,7 +16,9 @@
             <div class="paper-info">
                 <div class="info-item">
                     <span class="label">题库名称:</span>
-                    <span class="value">{{ paperData.paperName }}</span>
+                    <el-tooltip class="item" effect="dark" :content="paperData.paperName" placement="top-start">
+                        <span class="value">{{ paperData.paperName }}</span>
+                    </el-tooltip>
                 </div>
                 <div class="info-item">
                     <span class="label">题目数量:</span>

+ 5 - 1
src/views/platform/examination/questionBank/test.vue

@@ -515,12 +515,16 @@ export default {
             }
             // 处理最后一题无法自动提交的bug
             if (this.questionList[this.questionList.length - 1] !== '判断题' && this.questionList[this.questionList.length - 1] !== '单选题') {
+                const temp = this.showIndex
                 if (this.showIndex !== this.questionList.length) {
                     this.showIndex = this.questionList.length
                 } else {
                     this.showIndex = 1
                 }
-                this.$nextTick(nextHandle)
+                this.$nextTick(() => {
+                    this.showIndex = temp
+                    nextHandle()
+                })
             } else {
                 nextHandle()
             }