Przeglądaj źródła

随机题库的生成,往期考试记录的查看

lidie 1 rok temu
rodzic
commit
cf72393605

+ 448 - 0
src/views/platform/bpmn/my-test/examDetail.vue

@@ -0,0 +1,448 @@
+<template>
+    <div class="main">
+        <div class="section-1">
+            <div class="mainHender">
+                <van-row class="hender">
+                    <van-col span="2" @click="handlerDetail()"> <van-icon
+                        name="cross"
+                        size="20px"
+                        color="	#1E90FF"
+                    /></van-col>
+                    <van-col span="18" class="henderTitle"> {{ paperData.paperName }}</van-col>
+                    <van-col span="4" @click="handlerQuestion()">记录</van-col>
+                </van-row>
+            </div>
+            <!-- 考试信息 头部-->
+            <div class="content">
+                <van-row class="personInfo">
+                    <van-col span="8">考试姓名</van-col>
+                    <van-col span="16">{{ transformUser(paperData.examinee) }}</van-col>
+                </van-row>
+                <van-row class="personInfo">
+                    <van-col span="8">得分</van-col>
+                    <van-col span="16">{{ paperData.status !== '已完成' ? '未评分' : `${paperData.resultScore}分` }}</van-col>
+                </van-row>
+                <van-row class="personInfo">
+                    <van-col span="8">题目数量</van-col>
+                    <van-col span="16">{{ paperData.totalCount }}</van-col>
+                </van-row>
+                <van-row class="personInfo">
+                    <van-col span="8">报考时间</van-col>
+                    <van-col span="16">{{ paperData.applyTime }}</van-col>
+                </van-row>
+                <van-row class="personInfo">
+                    <van-col span="8">开考时间</van-col>
+                    <van-col span="16">{{ paperData.startTime }}</van-col>
+                </van-row>
+                <van-row class="personInfo">
+                    <van-col span="8">结束时间</van-col>
+                    <van-col span="16">{{ paperData.endTime }}</van-col>
+                </van-row>
+                <van-row class="personInfo">
+                    <van-col span="8">总分</van-col>
+                    <van-col span="16">{{ paperData.totalScore }}</van-col>
+                </van-row>
+                <van-row class="personInfo">
+                    <van-col span="8">达标占比</van-col>
+                    <van-col span="16">{{ paperData.qualifiedRadio }}</van-col>
+                </van-row>
+                <van-row class="personInfo">
+                    <van-col span="8">计分方式</van-col>
+                    <van-col span="16">{{ paperData.scoringType }}</van-col>
+                </van-row>
+
+            </div>
+            <!-- 展示答过的题 -->
+            <div class="question">
+                <div
+                    v-for="(item, index) in paperData.list"
+                    :key="index"
+                    class="question-item"
+                >
+                    <!--    v-if="paperStatus === 'all'"-->
+                    <div v-if="item.questions.length > 0" class="type">
+                        {{ item.type }}
+                        <van-tag
+                            type="primary"
+                            size="small"
+                            class="score"
+                        >{{ `共${item.totalScore}分` }}</van-tag>
+                    </div>
+                    <div
+                        v-for="(q, qIndex) in item.questions"
+                        :key="`${index}${qIndex}`"
+                        class="card"
+                    >
+                        <div class="stem">
+                            <span>{{ `【${qIndex + 1}】${q.stem}` }}<van-tag class="scoreStyle" type="primary" size="small">{{ `${q.questionScore}分` }}</van-tag></span>
+                        </div>
+                        <div v-if="q.img && q.img.length " class="img">
+                            <div v-for="(img, ind) in photos(q.img)" :key="ind">
+                                <van-image
+                                    width="100"
+                                    height="100"
+                                    :src="img.url"
+                                />
+                            <!-- <img :src="img.url" alt=""> -->
+                            </div>
+                        </div>
+                        <!-- 考生答案 -->
+                        <div class="answer">
+                            <div class="mine">
+                                <div class="title">
+                                    考生答案:<van-tag
+                                        :type="q.score && q.score !== '0' ? 'success' : 'danger'"
+                                        size="small"
+                                        class="score"
+                                    >{{
+                                        !q.score && q.score !== "0" ? "未评分" : `得${q.score}分`
+                                    }}</van-tag>
+                                </div>
+                                <!-- :value="q.answer"  :label="o.label"-->
+                                <div class="answer-content">
+                                    <van-radio-group v-if="q.questionType === '单选题'" v-model="q.answer">
+                                        <van-radio
+                                            v-for="(o, i) in q.options"
+                                            :key="`${index}${qIndex}${i}`"
+                                            :name="o.label"
+                                            disabled
+                                        >{{ `${o.label}.${o.value}` }}</van-radio>
+                                    </van-radio-group>
+                                    <van-checkbox-group v-else-if="q.questionType === '多选题'" v-model="q.answer">
+                                        <van-checkbox
+                                            v-for="(o, i) in q.options"
+                                            :key="`${index}${qIndex}${i}`"
+                                            :name="o.value"
+                                            disabled
+                                        >{{ `${o.label}.${o.value}` }}</van-checkbox>
+                                    </van-checkbox-group>
+                                    <van-radio-group v-else-if="q.questionType === '判断题'" v-model="q.answer">
+                                        <van-radio name="√" disabled>√</van-radio>
+                                        <van-radio name="×" disabled>×</van-radio>
+                                    </van-radio-group>
+                                    <template v-else>
+                                        <van-input
+                                            v-for="(o, i) in q.answer"
+                                            :key="`${index}${qIndex}${i}`"
+                                            :value="o"
+                                            :type="q.questionType === '简答题' ? 'textarea' : 'text'"
+                                            :rows="q.questionType === '简答题' ? 12 : 1"
+                                            readonly
+                                            disabled
+                                        />
+                                    </template>
+                                </div>
+                            </div>
+                            <div class="right">
+                                <div class="title">参考答案:</div>
+                                <div class="answer-content">
+                                    <van-radio-group v-if="q.questionType === '单选题'" v-model="q.rightKey">
+                                        <van-radio
+                                            v-for="(o, i) in q.options"
+                                            :key="`${index}${qIndex}${i}`"
+                                            :name="o.label"
+                                            disabled
+                                        >{{ `${o.label}.${o.value}` }}</van-radio>
+                                    </van-radio-group>
+                                    <van-checkbox-group v-else-if="q.questionType === '多选题'" v-model="q.rightKey">
+                                        <van-checkbox
+                                            v-for="(o, i) in q.options"
+                                            :key="`${index}${qIndex}${i}`"
+                                            :name="o.label"
+                                            disabled
+                                        >{{ `${o.label}.${o.value}` }}</van-checkbox>
+                                    </van-checkbox-group>
+                                    <van-radio-group v-else-if="q.questionType === '判断题'" v-model="q.rightKey">
+                                        <van-radio name="√" disabled>√</van-radio>
+                                        <van-radio name="×" disabled>×</van-radio>
+                                    </van-radio-group>
+                                    <template v-else>
+                                        <van-input
+                                            v-for="(o, i) in q.rightKey"
+                                            :key="`${index}${qIndex}${i}`"
+                                            :value="o"
+                                            :type="q.questionType === '简答题' ? 'textarea' : 'text'"
+                                            :rows="q.questionType === '简答题' ? 12 : 1"
+                                            readonly
+                                            disabled
+                                        />
+                                    </template>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div>
+            <!-- {{ detailData }} -->
+            </div>
+        </div>
+        <!-- 考试详情 -->
+        <van-popup v-model="questionShow" position="right" :style="{ height: '100%', width:'65%' }" close-on-click-overlay class="popupLeft">
+            <van-steps direction="vertical" :active="active">
+                <van-step v-for="(paper, index) in paperList" :key="index" class="stepStyle" @click.native="changePaper(paper.dataId,paper.status,index)">
+                    <h4>试题名称:{{ paper.paperName }}</h4>
+                    <div>开始时间:{{ paper.startTime }}</div>
+                    <div>结束时间:{{ paper.endTime }}</div>
+                    <div>
+                        <span>{{ `得分:${paper.resultScore} ` }}</span>
+                        <van-tag
+                            :type="paper.isQualified ? 'success' : 'danger'"
+                            size="mini"
+                            class="score"
+                        >{{ paper.isQualified ? `达标` : "未达标" }}</van-tag>
+                        <van-tag
+                            v-if="paper.resultScore === maxScore"
+                            type="success"
+                            size="mini"
+                            class="score"
+                        >{{ `最高分` }}</van-tag>
+                        <van-tag
+                            v-if="paper.resultScore === minScore"
+                            type="warning"
+                            size="mini"
+                            class="score"
+                        >{{ `最低分` }}</van-tag>
+                    </div>
+                </van-step>
+            </van-steps>
+        </van-popup>
+    </div>
+</template>
+<script>
+import { getImage } from '@/api/platform/file/attachment'
+import { Notify } from 'vant'
+export default {
+    components: {
+        IbpsImage: () => import('@/business/platform/file/image')
+    },
+    props: {
+        examDetail: {
+            type: Boolean,
+            default: false
+        },
+        detailData: {
+            type: Object,
+            default: () => {}
+            // default: {}
+        },
+        listExam: {
+            type: Array,
+            default: () => []
+        }
+    },
+    data() {
+        return {
+            active: 0,
+            paperList: this.listExam,
+            paperData: [],
+            showPaperId: '',
+            questionShow: false,
+            maxScore: '',
+            minScore: ''
+        }
+    },
+    watch: {
+        listExam(val) {
+            this.paperList = val
+        }
+    },
+
+    async mounted() {
+        this.handelListData()
+    },
+
+    methods: {
+        photos(data) {
+            if (data) {
+                const photos = data
+                photos.forEach(item => {
+                    item.url = getImage(item.id)
+                })
+                return photos
+            }
+            return []
+        },
+        // async ImageData(data) {
+        //     // [{"id":"1247925649339842560","fileName":"640 (21)"}]
+        //     if (data) {
+        //         let str = ''
+        //         for (let a = 0; a < data.length; a++) {
+        //             if (a === 0) {
+        //                 str = data[0].id
+        //             } else {
+        //                 str = str + ',' + data[a].id
+        //             }
+        //         }
+        //         const sql1 = `select FILE_PATH_  from ibps_file_attachment  WHERE id_ in (${str})`
+        //         const res = this.$common.request('sql', sql1)
+        //         if (res.state === 200) {
+        //             const data = res.variables.data
+        //             if (data.length > 0) {
+        //                 const pdfUrlA = []
+        //                 for (let g = 0; g < data.length; g++) {
+        //                     const dataItem = data[g]
+        //                     const url = 'http://dev1.local/' + dataItem.FILE_PATH_
+        //                     pdfUrlA.push(url)
+        //                 }
+        //                 // this.pdfUrls = pdfUrlA
+        //                 return pdfUrlA
+        //                 // this.$set(data, 'pdfUrl', pdfUrlA)
+        //             }
+        //         }
+        //     }
+        // },
+        handelListData() {
+            if (!this.detailData.bankId) {
+                Notify({ type: 'danger', message: '获取题目信息失败,请重试!' })
+                this.handlerDetail()
+                return
+            }
+            // paperList时间线(考了多少次)
+            // paperData上面题库名称开始时间,结束时间啥的
+            this.paperData = this.paperList.find(i => i.dataId === this.detailData.paperId) || this.paperList[0]
+            this.showPaperId = this.paperData.dataId
+            const isAllNotFinish = this.paperList.every(item => item.status !== '已完成')
+            if (isAllNotFinish) {
+                Notify({ type: 'warning', message: '考试未完成或未评分,请稍后再试!' })
+                // this.$message.error('考试未完成或未评分,请稍后再试!')
+                this.handlerDetail()
+                return
+            }
+            const { maxScore, minScore } = this.listExam.filter(i => i.status === '已完成').reduce((acc, curr) => {
+                if (curr.resultScore > acc.maxScore) {
+                    acc.maxScore = curr.resultScore
+                }
+                if (curr.resultScore < acc.minScore) {
+                    acc.minScore = curr.resultScore
+                }
+                return acc
+            }, { maxScore: -Infinity, minScore: Infinity })
+            this.maxScore = maxScore
+            this.minScore = minScore
+        },
+        changePaper(id, status, index) {
+            if (status !== '已完成') {
+                Notify({ type: 'warning', message: '考试未完成或未评分,暂时无法查看!' })
+                return
+            }
+            this.active = index
+            this.showPaperId = id
+            this.paperData = this.paperList.find(i => i.dataId === id)
+            this.questionShow = false
+            // this.paperStatus = 'all'
+        },
+        handlerQuestion() {
+            this.questionShow = true
+        },
+        handlerDetail() {
+            this.$emit('closeDetail', false)
+        },
+        transformUser(userId) {
+            const { userList = [] } = this.$store.getters
+            const user = userList.find(u => u.userId === userId) || {}
+            return user.userName || '-'
+        }
+
+    }
+}
+</script>
+<style lang="less" scoped>
+.main{
+  width: 100%;
+  display: flex;
+  height: 100vh;
+  overflow-y: auto; /* 允许滑动 */
+
+  .content{
+    border: 1px solid #ccc;
+    padding: 10px;
+    box-shadow: 1px 1px 5px 1px rgba(0,0,0,0.2);
+  }
+ .hender{
+  padding: 2% 0;
+  height: 40px;
+  line-height: 40px;
+  .henderTitle{
+    text-align: center;
+  }
+
+ }
+ .personInfo{
+  color: #555;
+  margin: 1% 0;
+ }
+  .question {
+    font-size: 16px;
+    .question-item {
+        padding-top: 20px;
+        &:last-child {
+            padding-bottom: 20px;
+        }
+        .card {
+             padding-bottom: 10px;
+             &:last-child {
+                 padding-bottom: 0;
+            }
+            .scoreStyle{
+              line-height: 20px;
+              margin: 2px;
+            }
+        }
+         .type {
+             font-size: 20px;
+             font-weight: 600;
+            margin-bottom: 20px;
+            .score {
+                margin-left: 10px;
+                 vertical-align: bottom;
+            }
+        }
+        .stem {
+             display: flex;
+             margin-bottom: 10px;
+             align-items: flex-start;
+             > span:first-child {
+             line-height: 1.5;
+             margin-right: 10px;
+            }
+          }
+        .img {
+             position: relative;
+            width: 100%;
+            margin-bottom: 10px;
+         }
+        .answer {
+             display: flex;
+             border: 1px solid #ccc;
+             border-radius: 5px;
+             .mine, .right {
+                 flex: 1;
+                 padding: 10px;
+                .title {
+                     font-size: 16px;
+                     color: #01a39e;
+                     margin-bottom: 10px;
+                        .score {
+                          vertical-align: middle;
+                   }
+                 }
+               }
+        .mine {
+          background-color: #f5f5f5;
+          border-right: 1px solid #ccc;
+        }
+     }
+   }
+ }
+ .popupLeft{
+  margin-top: 10px;
+  padding: 10px;
+ }
+ .section-1{
+  width: 96%;
+  margin: 0 auto;
+ }
+}
+</style>
+

+ 26 - 26
src/views/platform/bpmn/my-test/examPop.vue

@@ -62,7 +62,7 @@
                             v-for="(item, index) in popList[questionsIndex].options"
                             :key="index"
                             class="radioAlign"
-                            :name="item.value"
+                            :name="item.label"
                         >{{ `${item.label}.
               ${item.value}` }}</van-radio>
                     </van-radio-group>
@@ -202,7 +202,7 @@ export default {
             type: String,
             default: ''
         },
-        id1: {
+        id: {
             type: String,
             default: ''
         },
@@ -349,6 +349,7 @@ export default {
             window.scrollTo(0, this.scrollWhere)
             this.scrollWhere = 0
         },
+        // 获取题目信息
         getInit() {
             const sql = `select id_ as questionId, ti_gan_ as stem, ti_xing_ as questionType, fu_tu_ as img, xuan_xiang_lei_xi as optionType, da_an_ as options, xuan_xiang_shu_ as optionsLength, fen_zhi_ as score, ping_fen_fang_shi as rateType, ping_fen_ren_ as rater, zheng_que_da_an_ as rightKey, nan_du_ as questionLevel from t_questions where parent_id_ = '${this.bankId}' and zhuang_tai_ = '启用' order by field(ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题')`
             if (this.bankId !== '') {
@@ -359,7 +360,7 @@ export default {
                         this.closeDialog()
                         return
                     }
-                    const sql = `slect * from t_examination where exam_id='${this.bankId}'`
+                    // const sql = `slect * from t_examination where exam_id='${this.bankId}'`
                     if (this.listDatas.isRand === '1') {
                         data = this.getRandQuestionData(data)
                     }
@@ -407,26 +408,23 @@ export default {
                                     astr = astr + ',' + item.img[a].id
                                 }
                             }
-                            const sql1 = `select FILE_PATH_  from ibps_file_attachment  WHERE id_ in (${astr})`
-                            this.$common.request('sql', sql1).then(res => {
-                                if (res.state === 200) {
-                                    const data = res.variables.data
-                                    if (data.length > 0) {
-                                        const pdfUrlA = []
-                                        for (let g = 0; g < data.length; g++) {
-                                            const dataItem = data[g]
-                                            const url = 'http://dev1.local/' + dataItem.FILE_PATH_
-                                            pdfUrlA.push(url)
-                                        }
-                                        // item.pdfUrl = pdfUrl
-                                        this.$set(item, 'pdfUrl', pdfUrlA)
 
-                                        // this.popList = [...this.popList, item]
-                                        // this.popList.push(item)
-                                        // this.popList[i].pdfUrl = pdfUrlA
-                                    }
-                                }
-                            })
+                            // const sql1 = `select FILE_PATH_  from ibps_file_attachment  WHERE id_ in (${astr})`
+                            // this.$common.request('sql', sql1).then(res => {
+                            //     if (res.state === 200) {
+                            //         const data = res.variables.data
+                            //         if (data.length > 0) {
+                            //             const pdfUrlA = []
+                            //             for (let g = 0; g < data.length; g++) {
+                            //                 const dataItem = data[g]
+                            //                 const url = 'http://dev1.local/' + dataItem.FILE_PATH_
+                            //                 pdfUrlA.push(url)
+                            //             }
+                            //             this.$set(item, 'pdfUrl', pdfUrlA)
+
+                            //         }
+                            //     }
+                            // })
                         } else {
                             // this.popList = [...this.popList, item]
                             // this.popList[i] = item
@@ -558,6 +556,7 @@ export default {
             this.questionsIndex = ind
             this.answerSheet = false
         },
+        // 点击交卷触发的函数
         handInAnExaminationPaperBtn() {
         // this.showPop=false
             this.showConfirmationBox = true
@@ -583,7 +582,7 @@ export default {
                 updList: [
                     {
                         where: {
-                            id_: this.id1
+                            id_: this.id
                         },
                         param: {
                             jie_shu_shi_jian_: that.$common.getDateNow(19),
@@ -597,7 +596,7 @@ export default {
             }
             that.$common.request('add', addParams).then(() => {
                 that.$common.request('update', updateParams).then(() => {
-                    // this.$message.success('提交成功!')
+                    console.log('更新成功')
                 })
             })
         },
@@ -611,7 +610,7 @@ export default {
                 const multipleType = ['多选题', '填空题'].includes(item.questionType)
                 const selectType = ['多选题', '单选题'].includes(item.questionType)
                 submitData.push({
-                    parent_id_: that.id1,
+                    parent_id_: that.id, // t_examination的id
                     ti_mu_id_: item.questionId,
                     ti_gan_: item.stem,
                     ti_xing_: item.questionType,
@@ -627,7 +626,7 @@ export default {
                     ping_yue_shi_jian: autoType ? time : '',
                     de_fen_: autoType ? this.getScore(item) : '',
                     jie_xi_: '',
-                    nan_du_: item.questionLevel || 0
+                    nan_du_: item.questionLevel || 0// 难度
                 })
             })
             return submitData
@@ -650,6 +649,7 @@ export default {
             }
             return str
         },
+        // 点击提示是否交卷,确定交卷的按钮
         confirmEvent() {
             this.showPop = false
             this.handInAnExaminationPaperEvent()

+ 268 - 12
src/views/platform/bpmn/my-test/index.vue

@@ -7,11 +7,10 @@
                 left-arrow
                 @click-left="$router.push({ name: 'dashboard' })"
             />
+            <van-tabs v-model="tabActive" color="#3396FB" @click="onClickTab">
+                <van-tab v-for="data in tabDatas" :key="data.name" :name="data.name" :title="data.title" />
+            </van-tabs>
             <van-search v-model="subject" show-action placeholder="请输入搜索关键词" @search="onSearch">
-                <!-- <template #left>
-          <van-icon name="bars" :class="{'ibps-active':$utils.isNotEmpty(typeId)}" class="ibps-pr-5"
-            @click="clickType" />
-        </template> -->
                 <template #action>
                     <van-icon name="filter-o" :class="{'ibps-active':stateActive}" @click="clickMoreSearch" />
                 </template>
@@ -21,7 +20,7 @@
         <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
             <van-list v-model="loading" :finished="finished" @load="loadData">
                 <van-checkbox-group v-model="checkedIds">
-                    <van-cell v-for="(item,index) in listData" :key="item.id+index" :title="item.examName">
+                    <van-cell v-for="(item,index) in listData" :key="item.id+index" :title="item.examName" @click="onDialogShow(item)">
                         <!-- :label="getTaskDesc(item.subject)" @click="onClick(item,index)"> -->
                         <!-- 插入图标 -->
                         <template slot="icon">
@@ -60,7 +59,7 @@
                         </template>
                         <!-- 插入内容 -->
                         <span>{{ item.createTime|formatRelativeTime }}</span>
-                        <div style="margin-top: 90%;height: 100%;">
+                        <div v-if="tabActive==0" style="margin-top: 90%;height: 100%;">
                             <van-tag type="primary" size="medium" @click="onClick(item,index)">开始考试</van-tag>
                         </div>
                         <!-- <div> -->
@@ -184,14 +183,26 @@
         <van-popup v-model="showPop" :style="{ width: '100%', height: '100%' }">
             <exam-pop
                 v-if="showPop"
+                :id="id"
                 ref="childPop"
-                :id1="id1"
                 :not-start="countTotal.notStart"
                 :list-data="examPopup"
                 :bank-id=" examPopup.bankId"
                 :show="showPop"
                 @updataSet="updataSet"
             /></van-popup>
+        <!--
+            <van-popup v-model="examDetail" :style="{ width: '100%', height: 'auto', maxHeight: '100vh' }">
+    <exam-detail -->
+        <van-popup v-model="examDetail" :style="{ width: '100%', height: '100%' }">
+            <exam-detail
+                v-if="examDetail"
+                :detail-data="detailData"
+                :exam-detail="examDetail"
+                :list-exam="listExam"
+                @closeDetail="closeDetail"
+            />
+        </van-popup>
         <van-divider v-if="footText">到底了~</van-divider>
         <van-empty v-if="noData" description="暂无数据" />
 
@@ -199,7 +210,7 @@
 </template>
 <script>
 import { mapState } from 'vuex'
-import examPop from './examPop.vue'
+
 import ActionUtils from '@/utils/action'
 import i18n from '@/utils/i18n'
 import random from '@/mixins/random'
@@ -211,6 +222,8 @@ import IbpsToolbar from '@/components/ibps-toolbar'
 import IbpsListResultPage from '@/components/ibps-list-result-page'
 import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
 import { Notify } from 'vant'
+import examPop from './examPop.vue'
+import examDetail from './examDetail.vue'
 
 export default {
     components: {
@@ -220,15 +233,32 @@ export default {
         IbpsToolbar,
         IbpsListResultPage,
         IbpsBpmnFormrenderDialog,
-        examPop
+        examPop,
+        examDetail
     },
     mixins: [random, bpmnStatus],
     data() {
         const { userId, userList = [], deptList = [], menus, userInfo } = this.$store.getters
         return {
+            tabActive: 0,
+            tabDatas: [{
+                name: 0,
+                title: '待考'
+            }, {
+                name: 1,
+                title: '已考'
+            }],
+            id: '',
+            listExam: [],
+            dataList: [],
+            paperList: [],
+            detailData: '',
+            paperData: [],
+            showPaperId: '',
             userId: userId,
             footText: false,
             showPop: false,
+            examDetail: false,
             noData: false,
             showConfirmationBoxList: true,
             countTotal: {},
@@ -317,6 +347,223 @@ export default {
     },
 
     methods: {
+        onClickTab(index) {
+            // this.loadData()
+            // 清空查询条件
+            this.subject = ''
+            // this.typeId = ''
+            // this.moreParams = {}
+
+            this.onSearch()
+        },
+        async onDialogShow(item) {
+            if (this.tabActive === 1) {
+                this.detailData = item
+                const examId = item.examId
+                const examineeId = item.examinee
+                const bankId = item.bankId
+                const param = examId ? `and e.exam_id_ = '${examId}'` : 'and e.exam_id_ is null'
+                const sql = `select e.id_ as dataId, e.exam_id_ as examId, e.kao_shi_ren_ as examinee, e.bu_men_ as dept, e.zhuang_tai_ as status, e.bao_ming_shi_jian as applyTime, e.kai_shi_shi_jian_ as startTime, e.jie_shu_shi_jian_ as endTime, e.ti_ku_zong_fen_ as totalScore, e.de_fen_ as resultScore, ed.ti_mu_id_ as questionId, ed.ti_gan_ as stem, ed.ti_xing_ as questionType, ed.fen_zhi_ as questionScore, ed.fu_tu_ as img, ed.xuan_xiang_lei_xi as optionsType, ed.xuan_xiang_ as options, ed.can_kao_da_an_ as rightKey, ed.ping_fen_fang_shi as rateType, ed.ping_fen_ren_ as rater, ed.hui_da_ as answer, ed.ping_yue_shi_jian as rateTime, ed.de_fen_ as score, ed.jie_xi_ as analysis, q.ti_ku_ming_cheng_ as paperName, case when e.exam_id_ is not null then ex.da_biao_zhan_bi_ else q.da_biao_zhan_bi_ end as qualifiedRadio, case when e.exam_id_ is not null then ex.ji_fen_fang_shi_ else q.ji_fen_fang_shi_ end as scoringType, case when e.exam_id_ is not null then ex.kao_shi_ming_chen else '自主考核' end as examName, case when e.exam_id_ is not null then ex.xian_kao_shi_jian else '不限' end as limitDate from t_examination e left join t_examination_detail ed on e.id_ = ed.parent_id_ left join  t_question_bank q on e.ti_ku_id_ = q.id_ left join  t_exams ex on e.exam_id_ = ex.id_ where e.ti_ku_id_ = '${bankId}' ${param} and e.kao_shi_ren_ = '${examineeId}' and (e.zhuang_tai_ = '已完成' or e.zhuang_tai_ = '已交卷') order by field(ed.ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题')`
+                // return new Promise((resolve, reject) => {
+                this.$common.request('sql', sql).then(res => {
+                    const { data = [] } = res.variables || {}
+                    if (!data.length) {
+                        // this.$message.error('未查询到已提交的考试记录,请先完成考试!')
+                        Notify({ type: 'primary', message: '未查询到已提交的考试记录,请先完成考试!' })
+                        this.closeDialog()
+                        return
+                    }
+                    const result = []
+                    data.map(item => {
+                        // 数据转换
+                        if (['单选题', '多选题'].includes(item.questionType)) {
+                            item.options = JSON.parse(item.options)
+                            item.rightKey = item.questionType === '多选题' ? item.rightKey.split(',') : item.rightKey
+                            item.answer = item.questionType === '多选题' ? JSON.parse(item.answer) : item.answer
+                        } else if (item.questionType === '填空题') {
+                            item.rightKey = item.rightKey ? JSON.parse(item.rightKey) : []
+                            item.answer = item.answer ? JSON.parse(item.answer) : Array(item.rightKey.length).fill('')
+                        } else if (item.questionType === '简答题') {
+                            item.rightKey = [item.rightKey]
+                            item.answer = [item.answer]
+                        }
+                        item.img = item.img ? JSON.parse(item.img) : ''
+
+                        // 数据分组
+                        const index = result.findIndex(i => i.dataId === item.dataId)
+                        if (index === -1) {
+                            const { dataId, examinee, dept, status, applyTime, startTime, endTime, qualifiedRadio, paperName, totalScore, resultScore, scoringType } = item || {}
+                            result.push({
+                                dataId,
+                                examinee,
+                                dept,
+                                status,
+                                applyTime,
+                                startTime,
+                                endTime,
+                                qualifiedRadio,
+                                isQualified: status === '已完成' ? parseFloat(resultScore) >= (parseFloat(qualifiedRadio) / 100 * parseFloat(totalScore)) : '',
+                                paperName,
+                                totalScore: parseFloat(totalScore),
+                                resultScore: parseFloat(resultScore),
+                                // totalCount: data.length,
+                                scoringType,
+                                list: [{
+                                    type: item.questionType,
+                                    questions: [item]
+                                }]
+                            })
+                        } else {
+                            const qIndex = result[index].list.findIndex(i => i.type === item.questionType)
+                            if (qIndex === -1) {
+                                result[index].list.push({
+                                    type: item.questionType,
+                                    questions: [item]
+                                })
+                            } else {
+                                result[index].list[qIndex].questions.push(item)
+                            }
+                        }
+                    })
+                    result.forEach(item => {
+                        let count = 0
+                        item.list.forEach(i => {
+                            count += i.questions.length
+                            i.totalScore = i.questions.reduce((a, b) => a + parseFloat(b.questionScore), 0)
+                        })
+                        item.totalCount = count
+                    })
+                    // 获取最高分最低分
+                    const { maxScore, minScore } = result.filter(i => i.status === '已完成').reduce((acc, curr) => {
+                        if (curr.resultScore > acc.maxScore) {
+                            acc.maxScore = curr.resultScore
+                        }
+                        if (curr.resultScore < acc.minScore) {
+                            acc.minScore = curr.resultScore
+                        }
+                        return acc
+                    }, { maxScore: -Infinity, minScore: Infinity })
+                    this.maxScore = maxScore
+                    this.minScore = minScore
+                    this.listExam = result
+                    if (!bankId) {
+                        Notify({ type: 'danger', message: '获取题目信息失败,请重试!' })
+                        this.closeDetail(false)
+                        return
+                    }
+                    this.paperList = result
+                    this.paperData = this.paperList.find(i => i.dataId === item.paperId) || this.paperList[0]
+                    this.showPaperId = this.paperData.dataId
+                    const isAllNotFinish = this.paperList.every(item => item.status !== '已完成')
+                    if (isAllNotFinish) {
+                        Notify({ type: 'warning', message: '考试未完成或未评分,请稍后再试!' })
+                        // this.$message.error('考试未完成或未评分,请稍后再试!')
+                        this.closeDetail(false)
+                        return
+                    }
+                    this.examDetail = true
+                    //     resolve(result)
+                    // }).catch(error => {
+                    //     reject(error)
+                    // })
+                })
+            }
+        },
+        // getQuestionData() {
+        //     const param = this.examId ? `and e.exam_id_ = '${this.examId}'` : 'and e.exam_id_ is null'
+        //     const sql = `select e.id_ as dataId, e.exam_id_ as examId, e.kao_shi_ren_ as examinee, e.bu_men_ as dept, e.zhuang_tai_ as status, e.bao_ming_shi_jian as applyTime, e.kai_shi_shi_jian_ as startTime, e.jie_shu_shi_jian_ as endTime, e.ti_ku_zong_fen_ as totalScore, e.de_fen_ as resultScore, ed.ti_mu_id_ as questionId, ed.ti_gan_ as stem, ed.ti_xing_ as questionType, ed.fen_zhi_ as questionScore, ed.fu_tu_ as img, ed.xuan_xiang_lei_xi as optionsType, ed.xuan_xiang_ as options, ed.can_kao_da_an_ as rightKey, ed.ping_fen_fang_shi as rateType, ed.ping_fen_ren_ as rater, ed.hui_da_ as answer, ed.ping_yue_shi_jian as rateTime, ed.de_fen_ as score, ed.jie_xi_ as analysis, q.ti_ku_ming_cheng_ as paperName, case when e.exam_id_ is not null then ex.da_biao_zhan_bi_ else q.da_biao_zhan_bi_ end as qualifiedRadio, case when e.exam_id_ is not null then ex.ji_fen_fang_shi_ else q.ji_fen_fang_shi_ end as scoringType, case when e.exam_id_ is not null then ex.kao_shi_ming_chen else '自主考核' end as examName, case when e.exam_id_ is not null then ex.xian_kao_shi_jian else '不限' end as limitDate from t_examination e left join t_examination_detail ed on e.id_ = ed.parent_id_ left join  t_question_bank q on e.ti_ku_id_ = q.id_ left join  t_exams ex on e.exam_id_ = ex.id_ where e.ti_ku_id_ = '${this.bankId}' ${param} and e.kao_shi_ren_ = '${this.examineeId}' and (e.zhuang_tai_ = '已完成' or e.zhuang_tai_ = '已交卷') order by field(ed.ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题')`
+        //     return new Promise((resolve, reject) => {
+        //         this.$common.request('sql', sql).then(res => {
+        //             const { data = [] } = res.variables || {}
+        //             if (!data.length) {
+        //                 Notify({ type: 'primary', message: '未查询到已提交的考试记录,请先完成考试!' })
+        //                 // this.$message.error('未查询到已提交的考试记录,请先完成考试!')
+        //                 this.closeDialog()
+        //                 return
+        //             }
+        //             const result = []
+        //             data.map(item => {
+        //                 // 数据转换
+        //                 if (['单选题', '多选题'].includes(item.questionType)) {
+        //                     item.options = JSON.parse(item.options)
+        //                     item.rightKey = item.questionType === '多选题' ? item.rightKey.split(',') : item.rightKey
+        //                     item.answer = item.questionType === '多选题' ? JSON.parse(item.answer) : item.answer
+        //                 } else if (item.questionType === '填空题') {
+        //                     item.rightKey = item.rightKey ? JSON.parse(item.rightKey) : []
+        //                     item.answer = item.answer ? JSON.parse(item.answer) : Array(item.rightKey.length).fill('')
+        //                 } else if (item.questionType === '简答题') {
+        //                     item.rightKey = [item.rightKey]
+        //                     item.answer = [item.answer]
+        //                 }
+        //                 item.img = item.img ? JSON.parse(item.img) : ''
+
+        //                 // 数据分组
+        //                 const index = result.findIndex(i => i.dataId === item.dataId)
+        //                 if (index === -1) {
+        //                     const { dataId, examinee, dept, status, applyTime, startTime, endTime, qualifiedRadio, paperName, totalScore, resultScore, scoringType } = item || {}
+        //                     result.push({
+        //                         dataId,
+        //                         examinee,
+        //                         dept,
+        //                         status,
+        //                         applyTime,
+        //                         startTime,
+        //                         endTime,
+        //                         qualifiedRadio,
+        //                         isQualified: status === '已完成' ? parseFloat(resultScore) >= (parseFloat(qualifiedRadio) / 100 * parseFloat(totalScore)) : '',
+        //                         paperName,
+        //                         totalScore: parseFloat(totalScore),
+        //                         resultScore: parseFloat(resultScore),
+        //                         // totalCount: data.length,
+        //                         scoringType,
+        //                         list: [{
+        //                             type: item.questionType,
+        //                             questions: [item]
+        //                         }]
+        //                     })
+        //                 } else {
+        //                     const qIndex = result[index].list.findIndex(i => i.type === item.questionType)
+        //                     if (qIndex === -1) {
+        //                         result[index].list.push({
+        //                             type: item.questionType,
+        //                             questions: [item]
+        //                         })
+        //                     } else {
+        //                         result[index].list[qIndex].questions.push(item)
+        //                     }
+        //                 }
+        //             })
+        //             result.forEach(item => {
+        //                 let count = 0
+        //                 item.list.forEach(i => {
+        //                     count += i.questions.length
+        //                     i.totalScore = i.questions.reduce((a, b) => a + parseFloat(b.questionScore), 0)
+        //                 })
+        //                 item.totalCount = count
+        //             })
+        //             // 获取最高分最低分
+        //             const { maxScore, minScore } = result.filter(i => i.status === '已完成').reduce((acc, curr) => {
+        //                 if (curr.resultScore > acc.maxScore) {
+        //                     acc.maxScore = curr.resultScore
+        //                 }
+        //                 if (curr.resultScore < acc.minScore) {
+        //                     acc.minScore = curr.resultScore
+        //                 }
+        //                 return acc
+        //             }, { maxScore: -Infinity, minScore: Infinity })
+        //             this.maxScore = maxScore
+        //             this.minScore = minScore
+        //             resolve(result)
+        //         }).catch(error => {
+        //             console.log('111')
+        //             reject(error)
+        //         })
+        //     })
+        // },
+        closeDetail(val) {
+            this.examDetail = val
+            this.onSearch()
+        },
         // 点击开始考试
         async onClick(item, index) {
             this.id1 = item.id_
@@ -355,8 +602,11 @@ export default {
                         }
                     }]
                 }
-                this.$common.request('update', updataParams)
-                this.showPop = true
+                this.$common.request('update', updataParams).then(() => {
+                    // 2024-9-26
+                    this.id = this.countTotal.notStart
+                    this.showPop = true
+                })
             } else {
                 // 无未开始试卷
                 const mid = this.examPopup
@@ -380,6 +630,7 @@ export default {
                 })
             })
         },
+        // 当没有未开始的时候创建一条未开始数据
         createPaper(data, examinees) {
             const that = this
             // const { first, second } = uni.getStorageSync('level') || {}
@@ -409,6 +660,8 @@ export default {
                 that.$common.request('add', addParams).then(res => {
                     const { cont } = res.variables || {}
                     if (cont.length) {
+                        // 2024-9-26
+                        this.id = cont[0].id_
                         that.showPop = true
                     }
                 })
@@ -535,8 +788,11 @@ export default {
             // let canshu = key != '' ? `and (examName like '%${key}%' or bankName like '%${key}%')` : ''
             // const sql = `select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu} ORDER BY startDate DESC LIMIT ${page},10`
             const sql1 = `select * from (select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu}${canshu3}${canshu4} ORDER BY startDate DESC LIMIT ${page},10) a LEFT JOIN (select exam_id_,id_,COUNT(id_) as num from t_examination where kao_shi_ren_ = '${this.info.employee.id}' and zhuang_tai_ != '已取消' GROUP BY exam_id_) b on a.examId = b.exam_id_`
+            const sql2 = `select * from (select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu}${canshu3}${canshu4} ) a INNER JOIN (select exam_id_,id_,COUNT(id_) as num from t_examination where kao_shi_ren_ = '${this.info.employee.id}' and  (zhuang_tai_ ='已完成' OR zhuang_tai_ ='已交卷'  )  GROUP BY exam_id_) b on a.examId = b.exam_id_ ORDER BY startDate DESC LIMIT ${page},10`
+            const sql = this.tabActive === 0 ? sql1 : sql2
             // let sql2 = `select * from (select * from t-exams ) a LEFT JOIN () B ON a.examId=b.exam_id_`
-            this.$common.request('sql', sql1).then(res => {
+            // const { variables: { data }} = await this.$common.request('sql', sql)
+            this.$common.request('sql', sql).then(res => {
                 if (res.variables.data.length === 0) {
                     if (this.current === 0) {
                         this.noData = true