cyy пре 1 година
родитељ
комит
44add0edbf
2 измењених фајлова са 813 додато и 721 уклоњено
  1. 238 146
      src/views/platform/bpmn/my-test/examDetail.vue
  2. 575 575
      src/views/platform/bpmn/my-test/index.vue

+ 238 - 146
src/views/platform/bpmn/my-test/examDetail.vue

@@ -74,7 +74,11 @@
                         class="card"
                     >
                         <div class="stem">
-                            <span>{{ `【${qIndex + 1}】${q.stem}` }}<van-tag class="scoreStyle" type="primary" size="small">{{ `${q.questionScore}分` }}</van-tag></span>
+                            <div>{{ `【${qIndex + 1}】${q.stem}` }}<van-tag class="scoreStyle" type="primary" size="small">{{ `${q.questionScore}分` }}</van-tag></div>
+                            <div v-if="q.rate>0">
+                                <van-rate v-model="q.rate" :size="20" :color="colors[q.rate]" void-icon="star" void-color="#eee" readonly  />
+                                <span style="margin-left:5px">{{ texts[q.rate-1] }}</span>
+                            </div>
                         </div>
                         <div v-if="q.img && q.img.length " class="img">
                             <div v-for="(img, ind) in photos(q.img)" :key="ind">
@@ -137,22 +141,23 @@
                             <div class="right">
                                 <div class="title">参考答案:</div>
                                 <div class="answer-content">
-                                    <van-radio-group v-if="q.questionType === '单选题'" v-model="q.rightKey">
+                                    <div v-if="q.questionType === '单选题'||q.questionType === '多选题'">{{q.questionType === '单选题'?q.rightKey:q.rightKey.join(",")}}</div>
+                                    <!-- <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-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-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>
@@ -169,6 +174,18 @@
                                         />
                                     </template>
                                 </div>
+                                <div class="title titleNth">答案解析:</div>
+                                <div class="activity-desc-wrapper">
+                                    <input id="toggleInput" v-model="isUnFold" type="checkbox" class="toggleInput"/>
+                                    <div :id="'descBox'+qIndex" :ref="'text' +q.questionType+ qIndex" class="activity-desc">
+                                        <label v-if="q.resolution!==''" class="btn" for="toggleInput" @click="buttonClick(q.questionType,qIndex)">
+                                            {{ isTF.hasOwnProperty('text' + q.questionType + qIndex)&&isTF['text' + q.questionType + qIndex] ? '' : '...' }}
+                                            <span v-if="!isTF.hasOwnProperty('text' + q.questionType + qIndex)||(isTF.hasOwnProperty('text' + q.questionType + qIndex)&&!isTF['text' + q.questionType + qIndex])" class="fontStyle"><van-icon name="arrow-down" size="0.8rem" /></span>
+                                            <!-- <span v-else class="fontStyle">收起</span> -->
+                                        </label>
+                                        {{ q.resolution===''?'无':q.resolution }}
+                                    </div>
+                                </div>
                             </div>
                         </div>
                     </div>
@@ -214,148 +231,169 @@
 import { getImage } from '@/api/platform/file/attachment'
 import { Notify } from 'vant'
 export default {
-    components: {
-        IbpsImage: () => import('@/business/platform/file/image')
+  components: {
+    IbpsImage: () => import('@/business/platform/file/image')
+  },
+  props: {
+    examDetail: {
+      type: Boolean,
+      default: false
     },
-    props: {
-        examDetail: {
-            type: Boolean,
-            default: false
-        },
-        detailData: {
-            type: Object,
-            default: () => {}
-            // default: {}
-        },
-        listExam: {
-            type: Array,
-            default: () => []
-        }
+    detailData: {
+      type: Object,
+      default: () => {}
+      // default: {}
     },
-    data() {
-        return {
-            active: -1,
-            paperList: this.listExam,
-            paperData: [],
-            showPaperId: '',
-            questionShow: false,
-            maxScore: '',
-            minScore: ''
-        }
+    listExam: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      active: -1,
+      paperList: this.listExam,
+      paperData: [],
+      showPaperId: '',
+      questionShow: false,
+      maxScore: '',
+      minScore: '',
+      colors: { 1: '#00FF00', 2: '#7FFF00', 3: '#FFFF00', 4: '#FFA500', 5: '#FF0000' },
+      texts: ['易', '偏易', '适中', '偏难', '难'],
+      isUnFold: true,
+      isTF: {}
+    }
+  },
+  watch: {
+    listExam(val) {
+      this.paperList = val
+    }
+  },
+
+  async mounted() {
+    this.handelListData()
+    // this.$nextTick(() => {
+    //   const height = this.$refs['descBox' + type + index].scrollHeight
+    //   const lineHeight = +window
+    //     .getComputedStyle(this.$refs['descBox' + type + index])
+    //     .lineHeight.match(/\d+\.*\d+/g)[0]
+    //   this.isMoreThan7Line = height / lineHeight > 7
+    //   this.isMoreThan2Line = height / lineHeight > 2
+    // })
+  },
+
+  methods: {
+    initializeActive() {
+      if (this.listExam && this.listExam.length > 0) {
+        const index = this.listExam.findIndex(item => item.status === '已完成')
+        this.active = index !== -1 ? index : 0 // 如果没有找到,则设置为0或其他默认值
+      } else {
+        this.active = 0 // 默认值
+      }
     },
-    watch: {
-        listExam(val) {
-            this.paperList = val
-        }
+    photos(data) {
+      if (data) {
+        const photos = data
+        photos.forEach(item => {
+          item.url = getImage(item.id)
+        })
+        return photos
+      }
+      return []
     },
-
-    async mounted() {
-        this.handelListData()
+    buttonClick(type, index) {
+      this.$refs['text' + type + index].forEach((it, i) => {
+        it.classList.toggle('expanded') // 切换expanded类名
+      })
+      this.isTF['text' + type + index] = this.isTF.hasOwnProperty('text' + type + index) ? !this.isTF['text' + type + index] : true
+      console.log(this.$refs)
     },
+    // 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
+      }
+      this.initializeActive()
+      // paperList时间线(考了多少次)
+      // paperData上面题库名称开始时间,结束时间啥的
+      console.log(this.paperList)
 
-    methods: {
-        initializeActive() {
-            if (this.listExam && this.listExam.length > 0) {
-                const index = this.listExam.findIndex(item => item.status === '已完成')
-                this.active = index !== -1 ? index : 0 // 如果没有找到,则设置为0或其他默认值
-            } else {
-                this.active = 0 // 默认值
-            }
-        },
-        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
-            }
-            this.initializeActive()
-            // paperList时间线(考了多少次)
-            // paperData上面题库名称开始时间,结束时间啥的
-            this.paperData = this.paperList.find(item => item.status === '已完成') || this.paperList[0]
-            // 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 || '-'
+      this.paperData = this.paperList.find(item => item.status === '已完成') || this.paperList[0]
+      // 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>
@@ -413,9 +451,17 @@ export default {
              display: flex;
              margin-bottom: 10px;
              align-items: flex-start;
-             > span:first-child {
-             line-height: 1.5;
-             margin-right: 10px;
+             justify-content: space-between;
+             div {
+                line-height: 1.5;
+                display: flex;
+                align-items: self-start;
+             }
+             > div:first-child {
+                margin-right: 10px;
+                width: 55%;
+                word-break: break-all;
+                white-space: pre-wrap;
             }
           }
         .img {
@@ -434,10 +480,56 @@ export default {
                      font-size: 16px;
                      color: #01a39e;
                      margin-bottom: 10px;
-                        .score {
-                          vertical-align: middle;
-                   }
-                 }
+                    .score {
+                        vertical-align: middle;
+                    }
+                }
+                .titleNth{
+                    margin-top: 10px;
+                }
+                .activity-desc-wrapper {
+                    display: flex;
+                    .toggleInput {
+                        display: none;
+                    }
+                    .toggleInput:checked + .activity-desc {
+                        // -webkit-line-clamp: unset;
+                    }
+                    .activity-desc.expanded {
+                        -webkit-line-clamp: unset; /* 展开时显示全部内容 */
+                        height: auto;
+                    }
+                    .activity-desc {
+                        padding: 0;
+                        position: relative;
+                        line-height: 1.2;
+                        display: -webkit-box;
+                        overflow: hidden;
+                        -webkit-line-clamp: 3;
+                        -webkit-box-orient: vertical;
+                        font-size: 14px;
+
+                        .btn {
+                            position: absolute;
+                            padding: 0 3px 0 7px;
+                            font-weight: 400;
+                            bottom: 0px;
+                            right: 0;
+                            line-height: 1.2;
+                            background: #fff;
+                            &::before {
+                                content: '';
+                                transform: translateX(-100%);
+                            }
+                            .fontStyle{
+                                color: #01a39e;
+                            }
+                        }
+                        .btn-no-absolute {
+                            float: none;
+                        }
+                    }
+                    }
                }
         .mine {
           background-color: #f5f5f5;

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

@@ -242,604 +242,604 @@ import examPop from './examPop.vue'
 import examDetail from './examDetail.vue'
 
 export default {
-    components: {
-        IbpsMoreSearch,
-        IbpsTypeTree,
-        IbpsAvatar,
-        IbpsToolbar,
-        IbpsListResultPage,
-        IbpsBpmnFormrenderDialog,
-        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: {},
-            examPopup: '',
-            ReachBottomShow: false,
-            moreSearchPopup: false,
-            id1: '',
-            searchForms: {
-                forms: [
-                    // { prop: 'Q^examName_^SL', label: '考试名称', fieldType: 'text' },
-                    //   { prop: 'Q^bankName^SL', label: '题库名称', fieldType: 'text' },
-                    { prop: 'examName', label: '考试名称', fieldType: 'text' },
-                    { prop: 'bankName', label: '题库名称', fieldType: 'text' },
-                    {
-                        prop: 'examType', label: '考试类型', fieldType: 'checker', cols: 2, valueKey: 'value', options: [
-                            { value: 'trainingExam', label: '培训考试' },
-                            { value: 'POCTtraining', label: 'POCT培训' },
-                            { value: 'selfAssessment', label: '自主考核' },
-                            { value: 'routine', label: '常规' }
-                        ]
-                    },
-                    { prop: ['startDateDL', 'startDateDG'], label: '开始时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }},
-                    { prop: ['limitDateDL', 'limitDateDG'], label: '限考时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
-                    // { prop: ['Q^startDate^DL^yyyy-MM-dd', 'Q^startDate^DG^yyyy-MM-dd'], label: '开始时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }},
-                    // { prop: ['Q^limitDate^DL^yyyy-MM-dd', 'Q^limitDate^DG^yyyy-MM-dd'], label: '限考时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
-                ]
-            },
-            // './views/platform/bpmn/communication/communicationList
-            mainActions: [{
-                'name': this.$t('common.button.remove'),
-                'type': 'danger',
-                'callback': this.onRemove
-            }],
-            stateActive: false,
-            subject: '',
-            moreSubject: '',
-            subjectTitle: '',
-            typeId: '',
-            moreParams: {},
-            listData: [],
-            pagination: {},
-            sorts: {},
+  components: {
+    IbpsMoreSearch,
+    IbpsTypeTree,
+    IbpsAvatar,
+    IbpsToolbar,
+    IbpsListResultPage,
+    IbpsBpmnFormrenderDialog,
+    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: {},
+      examPopup: '',
+      ReachBottomShow: false,
+      moreSearchPopup: false,
+      id1: '',
+      searchForms: {
+        forms: [
+          // { prop: 'Q^examName_^SL', label: '考试名称', fieldType: 'text' },
+          //   { prop: 'Q^bankName^SL', label: '题库名称', fieldType: 'text' },
+          { prop: 'examName', label: '考试名称', fieldType: 'text' },
+          { prop: 'bankName', label: '题库名称', fieldType: 'text' },
+          {
+            prop: 'examType', label: '考试类型', fieldType: 'checker', cols: 2, valueKey: 'value', options: [
+              { value: 'trainingExam', label: '培训考试' },
+              { value: 'POCTtraining', label: 'POCT培训' },
+              { value: 'selfAssessment', label: '自主考核' },
+              { value: 'routine', label: '常规' }
+            ]
+          },
+          { prop: ['startDateDL', 'startDateDG'], label: '开始时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }},
+          { prop: ['limitDateDL', 'limitDateDG'], label: '限考时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
+          // { prop: ['Q^startDate^DL^yyyy-MM-dd', 'Q^startDate^DG^yyyy-MM-dd'], label: '开始时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }},
+          // { prop: ['Q^limitDate^DL^yyyy-MM-dd', 'Q^limitDate^DG^yyyy-MM-dd'], label: '限考时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
+        ]
+      },
+      // './views/platform/bpmn/communication/communicationList
+      mainActions: [{
+        'name': this.$t('common.button.remove'),
+        'type': 'danger',
+        'callback': this.onRemove
+      }],
+      stateActive: false,
+      subject: '',
+      moreSubject: '',
+      subjectTitle: '',
+      typeId: '',
+      moreParams: {},
+      listData: [],
+      pagination: {},
+      sorts: {},
 
-            loading: false,
-            finished: false,
-            refreshing: false,
-            resultType: 'init',
-            errorType: null,
-            resultMessage: null,
-
-            checkMode: false,
-            checkedIds: [],
-            proInstId: '',
-            defId: '',
-            formrenderVisible: false,
-            formrenderTitle: '',
-            typeTreePopup: false,
-            keyword: '',
-            name: '全部',
-            current: 0,
-            startTime: [],
-            endTime: []
-        }
-    },
-    computed: {
-        ...mapState('ibps/user', [
-            'info'
-        ]),
-        rightText() {
-            return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
-        },
-        selectedIds() {
-            return this.checkedIds.join(',')
-        }
-    },
+      loading: false,
+      finished: false,
+      refreshing: false,
+      resultType: 'init',
+      errorType: null,
+      resultMessage: null,
 
-    beforeRouteLeave(to, from, next) {
-        if (this.showPop === true) {
-        // this.showConfirmationBoxList = true
-            this.$refs.childPop.parentSubmit()
-            this.showPop = false
-            next(false)
-        } else {
-            next()
-        }
+      checkMode: false,
+      checkedIds: [],
+      proInstId: '',
+      defId: '',
+      formrenderVisible: false,
+      formrenderTitle: '',
+      typeTreePopup: false,
+      keyword: '',
+      name: '全部',
+      current: 0,
+      startTime: [],
+      endTime: []
+    }
+  },
+  computed: {
+    ...mapState('ibps/user', [
+      'info'
+    ]),
+    rightText() {
+      return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
     },
-    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_, '单选题', '多选题', '判断题', '填空题', '简答题'),applyTime DESC`
-                // 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) : ''
+    selectedIds() {
+      return this.checkedIds.join(',')
+    }
+  },
 
-                        // 数据分组
-                        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
-                    })
+  beforeRouteLeave(to, from, next) {
+    if (this.showPop === true) {
+      // this.showConfirmationBoxList = true
+      this.$refs.childPop.parentSubmit()
+      this.showPop = false
+      next(false)
+    } else {
+      next()
+    }
+  },
+  methods: {
+    onClickTab(index) {
+      // this.loadData()
+      // 清空查询条件
+      this.subject = ''
+      // this.typeId = ''
+      // this.moreParams = {}
 
-                    // 获取最高分最低分
-                    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.detailData = result.find(item => item.status === '已完成')
-                    this.examDetail = true
-                    //     resolve(result)
-                    // }).catch(error => {
-                    //     reject(error)
-                    // })
-                })
-            }
-        },
-        closeDetail(val) {
-            this.examDetail = val
-            if (val) {
-                this.onSearch()
-            }
-        },
-        // 点击开始考试
-        async onClick(item, index) {
-            this.id1 = item.id_
-            this.examPopup = item
-            this.countTotal = await this.getExamCount(item.examId) || 0
-            if (this.countTotal.count >= parseInt(item.limitCount) && !this.countTotal.notStart) {
-                return Notify({ type: 'primary', message: '本次考试次数已达到上限!' })
-            }
-            this.ReachBottomShow = true
-        },
-        // 考试达标状态
-        examAttainment(data) {
-            const { paperState, submittedCount, totalScore, qualifiedRadio, averageScore, maxScore, recentScore, scoringType } = data
-            // 只要有一次已完成,就是完成
-            if (paperState === '已完成') {
-                // 计算是否达标
-                const passScore = +totalScore * +qualifiedRadio / 100
-                let curScore = null
-                if (scoringType === '平均分') {
-                    curScore = +averageScore
-                }
-                if (scoringType === '最高分') {
-                    curScore = +maxScore
-                }
-                if (scoringType === '最近得分') {
-                    curScore = +recentScore
-                }
-                return curScore >= passScore ? 'passed' : 'failed'
-                // if (curScore >= passScore) {
-                //     return `已达标`
-                // }
-                // return `未达标`
-            } else {
-                // 未完成分两种:未开始和待批阅
-                return submittedCount > 0 ? 'pending-review' : ''
-                // if (submittedCount > 0) {
-                //     return `待批阅`
-                // }
-                // return '/'
-            }
-        },
-        examAttainmentText(data) {
-            const { paperState, submittedCount, totalScore, qualifiedRadio, averageScore, maxScore, recentScore, scoringType } = data
-            // 只要有一次已完成,就是完成
-            if (paperState === '已完成') {
-                // 计算是否达标
-                const passScore = +totalScore * +qualifiedRadio / 100
-                let curScore = null
-                if (scoringType === '平均分') {
-                    curScore = +averageScore
-                }
-                if (scoringType === '最高分') {
-                    curScore = +maxScore
-                }
-                if (scoringType === '最近得分') {
-                    curScore = +recentScore
-                }
-                if (curScore >= passScore) {
-                    return `已达标`
-                }
-                return `未达标`
-            } else {
-                // 未完成分两种:未开始和待批阅
-                if (submittedCount > 0) {
-                    return `待批阅`
-                }
-                return '/'
+      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,ed.nan_du_+0 as rate,ed.da_an_jie_xi_ as resolution, 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_, '单选题', '多选题', '判断题', '填空题', '简答题'),applyTime DESC`
+        // 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) : ''
 
-        showPopup() {
-            this.ReachBottomShow = true
-        },
-        onClose() {
-            this.ReachBottomShow = false
-        },
-        // 点击确定进入考试界面
-        async changeShowPop(item) {
-            this.countTotal = await this.getExamCount(item.examId) || 0
-            if (this.countTotal.count >= parseInt(item.limitCount) && !this.countTotal.notStart) {
-                return Notify({ type: 'primary', message: '本次考试次数已达到上限!' })
-            }
-            this.ReachBottomShow = false
-            if (this.countTotal.notStart && this.examPopup.bankId !== '') {
-                // 已有未开始的试卷 更新开始时间
-                const updataParams = {
-                    tableName: 't_examination',
-                    updList: [{
-                        where: {
-                            id_: this.countTotal.notStart
-                        },
-                        param: {
-                            zhuang_tai_: '进行中',
-                            kai_shi_shi_jian_: this.$common.getDateNow(19)
-                        }
-                    }]
-                }
-                this.$common.request('update', updataParams).then(() => {
-                    // 2024-9-26
-                    this.id = this.countTotal.notStart
-                    this.showPop = true
-                })
+            // 数据分组
+            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 mid = this.examPopup
-                this.createPaper({ ...mid }, this.info)
-            }
-        },
-
-        async getExamCount(id) {
-            const param = id ? `exam_id_ = '${id}'` : 'exam_id_ is null'
-            const sql = `select id_, zhuang_tai_ from t_examination where ${param} and kao_shi_ren_ = '${this.userId}' and zhuang_tai_ != '已取消' order by bao_ming_shi_jian asc`
-            return new Promise((resolve, reject) => {
-                this.$common.request('sql', sql).then(res => {
-                    const { data = [] } = res.variables || {}
-                    const temp = data.find(item => item.zhuang_tai_ === '未开始')
-                    resolve({
-                        count: data.length,
-                        notStart: temp ? temp.id_ : ''
-                    })
-                }).catch(error => {
-                    reject(error)
+              const qIndex = result[index].list.findIndex(i => i.type === item.questionType)
+              if (qIndex === -1) {
+                result[index].list.push({
+                  type: item.questionType,
+                  questions: [item]
                 })
-            })
-        },
-        // 当没有未开始的时候创建一条未开始数据
-        createPaper(data, examinees) {
-            const that = this
-            // const { first, second } = uni.getStorageSync('level') || {}
-            const { first = '', second = '' } = this.$store.getters.level
-            const { examId, bankId, examName, questionCount, totalScore, duration, qualifiedRadio, limitDate, limitCount } = data || {}
-            const examineeList = examinees.user.id.split(',')
-            const time = this.$common.getDateNow(19)
-            const paramWhere = examineeList.map(i => ({
-                exam_id_: examId,
-                ti_ku_id_: bankId,
-                di_dian_: second || first,
-                kao_shi_ren_: i,
-                bu_men_: '',
-                bao_ming_shi_jian: time,
-                kai_shi_shi_jian_: time,
-                ti_ku_zong_fen_: totalScore,
-                zhuang_tai_: '未开始',
-                sheng_yu_shi_chan: duration,
-                da_biao_zhan_bi_: qualifiedRadio
-            }))
-            const addParams = {
-                tableName: 't_examination',
-                paramWhere
+              } 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
+          })
 
-            if (that.examPopup.bankId !== '') {
-                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
-                    }
-                })
-            }
-        },
-        updataSet(v) {
-            this.showPop = v
-            this.onRefresh()
-        },
-        generateTitle(name, title) { // generateTitle by vue-i18n
-            return i18n.generateTitle(name, title)
-        },
-        toCheckMode() {
-            if (this.$utils.isEmpty(this.listData)) {
-                return
-            }
-            if (this.checkMode) {
-                // this.show = true
-                this.checkedIds = []
+          // 获取最高分最低分
+          const { maxScore, minScore } = result.filter(i => i.status === '已完成').reduce((acc, curr) => {
+            if (curr.resultScore > acc.maxScore) {
+              acc.maxScore = curr.resultScore
             }
-            this.checkMode = !this.checkMode
-        },
-        clickType() {
-            this.typeTreePopup = true
-        },
-        onSearch() {
-            this.stateActive = false
-            ActionUtils.initListData(this)
-            this.current = 0
-            this.listData = []
-            this.loadData()
-        },
-        clickMoreSearch() {
-            this.moreSearchPopup = true
-            this.stateActive = false
-        },
-        clickTypeNode(data) {
-            this.typeId = data.id
-            this.onMoreSearch({})
-        },
-        // 高级查询
-        onMoreSearch(params) {
-            if (this.$utils.isNotEmpty(this.typeId)) {
-                params['Q^type_id_^SL'] = this.typeId
+            if (curr.resultScore < acc.minScore) {
+              acc.minScore = curr.resultScore
             }
-            this.moreParams = params
-            this.onSearch()
-            if (this.$utils.isNotEmpty(params)) {
-                this.stateActive = true
+            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.detailData = result.find(item => item.status === '已完成')
+          this.examDetail = true
+          //     resolve(result)
+          // }).catch(error => {
+          //     reject(error)
+          // })
+        })
+      }
+    },
+    closeDetail(val) {
+      this.examDetail = val
+      if (val) {
+        this.onSearch()
+      }
+    },
+    // 点击开始考试
+    async onClick(item, index) {
+      this.id1 = item.id_
+      this.examPopup = item
+      this.countTotal = await this.getExamCount(item.examId) || 0
+      if (this.countTotal.count >= parseInt(item.limitCount) && !this.countTotal.notStart) {
+        return Notify({ type: 'primary', message: '本次考试次数已达到上限!' })
+      }
+      this.ReachBottomShow = true
+    },
+    // 考试达标状态
+    examAttainment(data) {
+      const { paperState, submittedCount, totalScore, qualifiedRadio, averageScore, maxScore, recentScore, scoringType } = data
+      // 只要有一次已完成,就是完成
+      if (paperState === '已完成') {
+        // 计算是否达标
+        const passScore = +totalScore * +qualifiedRadio / 100
+        let curScore = null
+        if (scoringType === '平均分') {
+          curScore = +averageScore
+        }
+        if (scoringType === '最高分') {
+          curScore = +maxScore
+        }
+        if (scoringType === '最近得分') {
+          curScore = +recentScore
+        }
+        return curScore >= passScore ? 'passed' : 'failed'
+        // if (curScore >= passScore) {
+        //     return `已达标`
+        // }
+        // return `未达标`
+      } else {
+        // 未完成分两种:未开始和待批阅
+        return submittedCount > 0 ? 'pending-review' : ''
+        // if (submittedCount > 0) {
+        //     return `待批阅`
+        // }
+        // return '/'
+      }
+    },
+    examAttainmentText(data) {
+      const { paperState, submittedCount, totalScore, qualifiedRadio, averageScore, maxScore, recentScore, scoringType } = data
+      // 只要有一次已完成,就是完成
+      if (paperState === '已完成') {
+        // 计算是否达标
+        const passScore = +totalScore * +qualifiedRadio / 100
+        let curScore = null
+        if (scoringType === '平均分') {
+          curScore = +averageScore
+        }
+        if (scoringType === '最高分') {
+          curScore = +maxScore
+        }
+        if (scoringType === '最近得分') {
+          curScore = +recentScore
+        }
+        if (curScore >= passScore) {
+          return `已达标`
+        }
+        return `未达标`
+      } else {
+        // 未完成分两种:未开始和待批阅
+        if (submittedCount > 0) {
+          return `待批阅`
+        }
+        return '/'
+      }
+    },
+
+    showPopup() {
+      this.ReachBottomShow = true
+    },
+    onClose() {
+      this.ReachBottomShow = false
+    },
+    // 点击确定进入考试界面
+    async changeShowPop(item) {
+      this.countTotal = await this.getExamCount(item.examId) || 0
+      if (this.countTotal.count >= parseInt(item.limitCount) && !this.countTotal.notStart) {
+        return Notify({ type: 'primary', message: '本次考试次数已达到上限!' })
+      }
+      this.ReachBottomShow = false
+      if (this.countTotal.notStart && this.examPopup.bankId !== '') {
+        // 已有未开始的试卷 更新开始时间
+        const updataParams = {
+          tableName: 't_examination',
+          updList: [{
+            where: {
+              id_: this.countTotal.notStart
+            },
+            param: {
+              zhuang_tai_: '进行中',
+              kai_shi_shi_jian_: this.$common.getDateNow(19)
             }
-        },
-        resetForm() {
-            this.typeId = ''
-            this.name = ''
-            this.moreSubject = ''
-            this.moreParams = {}
-        },
-        // 下拉刷新
-        onRefresh() {
-            this.footText = false
-            this.noData = false
-            this.refreshing = true
-            this.finished = false
-            this.loading = true
-            this.onSearch()
-        },
-        onRefreshPage() {
-            this.checkedIds = []
-            this.checkMode = false
-            this.onRefresh()
-        },
-        searchGao() {
+          }]
+        }
+        this.$common.request('update', updataParams).then(() => {
+          // 2024-9-26
+          this.id = this.countTotal.notStart
+          this.showPop = true
+        })
+      } else {
+        // 无未开始试卷
+        const mid = this.examPopup
+        this.createPaper({ ...mid }, this.info)
+      }
+    },
+
+    async getExamCount(id) {
+      const param = id ? `exam_id_ = '${id}'` : 'exam_id_ is null'
+      const sql = `select id_, zhuang_tai_ from t_examination where ${param} and kao_shi_ren_ = '${this.userId}' and zhuang_tai_ != '已取消' order by bao_ming_shi_jian asc`
+      return new Promise((resolve, reject) => {
+        this.$common.request('sql', sql).then(res => {
+          const { data = [] } = res.variables || {}
+          const temp = data.find(item => item.zhuang_tai_ === '未开始')
+          resolve({
+            count: data.length,
+            notStart: temp ? temp.id_ : ''
+          })
+        }).catch(error => {
+          reject(error)
+        })
+      })
+    },
+    // 当没有未开始的时候创建一条未开始数据
+    createPaper(data, examinees) {
+      const that = this
+      // const { first, second } = uni.getStorageSync('level') || {}
+      const { first = '', second = '' } = this.$store.getters.level
+      const { examId, bankId, examName, questionCount, totalScore, duration, qualifiedRadio, limitDate, limitCount } = data || {}
+      const examineeList = examinees.user.id.split(',')
+      const time = this.$common.getDateNow(19)
+      const paramWhere = examineeList.map(i => ({
+        exam_id_: examId,
+        ti_ku_id_: bankId,
+        di_dian_: second || first,
+        kao_shi_ren_: i,
+        bu_men_: '',
+        bao_ming_shi_jian: time,
+        kai_shi_shi_jian_: time,
+        ti_ku_zong_fen_: totalScore,
+        zhuang_tai_: '未开始',
+        sheng_yu_shi_chan: duration,
+        da_biao_zhan_bi_: qualifiedRadio
+      }))
+      const addParams = {
+        tableName: 't_examination',
+        paramWhere
+      }
+
+      if (that.examPopup.bankId !== '') {
+        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
+          }
+        })
+      }
+    },
+    updataSet(v) {
+      this.showPop = v
+      this.onRefresh()
+    },
+    generateTitle(name, title) { // generateTitle by vue-i18n
+      return i18n.generateTitle(name, title)
+    },
+    toCheckMode() {
+      if (this.$utils.isEmpty(this.listData)) {
+        return
+      }
+      if (this.checkMode) {
+        // this.show = true
+        this.checkedIds = []
+      }
+      this.checkMode = !this.checkMode
+    },
+    clickType() {
+      this.typeTreePopup = true
+    },
+    onSearch() {
+      this.stateActive = false
+      ActionUtils.initListData(this)
+      this.current = 0
+      this.listData = []
+      this.loadData()
+    },
+    clickMoreSearch() {
+      this.moreSearchPopup = true
+      this.stateActive = false
+    },
+    clickTypeNode(data) {
+      this.typeId = data.id
+      this.onMoreSearch({})
+    },
+    // 高级查询
+    onMoreSearch(params) {
+      if (this.$utils.isNotEmpty(this.typeId)) {
+        params['Q^type_id_^SL'] = this.typeId
+      }
+      this.moreParams = params
+      this.onSearch()
+      if (this.$utils.isNotEmpty(params)) {
+        this.stateActive = true
+      }
+    },
+    resetForm() {
+      this.typeId = ''
+      this.name = ''
+      this.moreSubject = ''
+      this.moreParams = {}
+    },
+    // 下拉刷新
+    onRefresh() {
+      this.footText = false
+      this.noData = false
+      this.refreshing = true
+      this.finished = false
+      this.loading = true
+      this.onSearch()
+    },
+    onRefreshPage() {
+      this.checkedIds = []
+      this.checkMode = false
+      this.onRefresh()
+    },
+    searchGao() {
 
-        },
-        /**
+    },
+    /**
        * 加载数据
        */
-        loadData() {
-            this.loading = true
-            this.noData = false
-            this.footText = false
-            let page = 0
-            if (this.current === 0) {
-                page = 0
-            } else {
-                page = this.current * 10
-            }
-            const aa = JSON.parse(JSON.stringify(this.moreParams))
-            let canshu3 = ''
-            let canshu4 = ''
-            if ((aa !== '' && aa !== null && aa !== undefined && (typeof aa !== 'object' || Object.keys(aa).length > 0)) ||
+    loadData() {
+      this.loading = true
+      this.noData = false
+      this.footText = false
+      let page = 0
+      if (this.current === 0) {
+        page = 0
+      } else {
+        page = this.current * 10
+      }
+      const aa = JSON.parse(JSON.stringify(this.moreParams))
+      let canshu3 = ''
+      let canshu4 = ''
+      if ((aa !== '' && aa !== null && aa !== undefined && (typeof aa !== 'object' || Object.keys(aa).length > 0)) ||
           (aa instanceof Array && aa.length > 0)) {
-                if (aa.examName !== '' && aa.examName !== undefined && aa.examName !== null) {
-                    this.moreSubject = aa.examName
-                }
-                if (aa.bankName !== '' && aa.bankName !== undefined && aa.bankName !== null) {
-                    this.subjectTitle = aa.bankName
-                }
-                if (aa.examType !== '' && aa.examType !== undefined && aa.examType !== null) {
-                    this.name = aa.examType === 'trainingExam' ? '培训考试' : aa.examType === 'POCTtraining' ? 'POCT培训' : aa.examType === 'selfAssessment' ? '自主考核' : aa.examType === 'routine' ? '常规' : '全部'
-                }
-                this.startTime = []
-                if (aa.limitDateDL || aa.limitDateDG) {
-                    if (aa.limitDateDL && aa.limitDateDG) {
-                        canshu4 = `AND limitDate BETWEEN '${aa.limitDateDL}' AND '${aa.limitDateDG}'`
-                    } else if (aa.limitDateDL) {
-                        canshu4 = `AND limitDate>= '${aa.limitDateDL}'`
-                    } else if (aa.limitDateDG) {
-                        canshu4 = `AND limitDate<='${aa.limitDateDG}'`
-                    }
-                }
-                if (aa.startDateDL || aa.startDateDG) {
-                    if (aa.startDateDL && aa.startDateDG) {
-                        canshu3 = `AND startDate BETWEEN '${aa.startDateDL}' AND '${aa.startDateDG}'`
-                    } else if (aa.startDateDL) {
-                        canshu3 = `AND startDate>= '${aa.startDateDL}'`
-                    } else if (aa.startDateDG) {
-                        canshu3 = `AND startDate<='${aa.startDateDG}'`
-                    }
-                }
-            } else {
-                this.moreSubject = ''
-                this.subjectTitle = ''
-            }
-            const key = this.subject
-            const key1 = this.moreSubject
-            const key2 = this.subjectTitle
-            const canshu1 = key1 !== '' ? `and examName like '%${key1}%'` : ''
-            const canshu2 = key2 !== '' ? `and bankName like '%${key2}%'` : ''
-            const canshu = (key1 !== '' || key2 !== '') ? `${canshu1} ${canshu2}`.trim() : key !== '' ? `and (examName like '%${key}%' or bankName like '%${key}%')` : ''
-            // 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`
-            // 已考待考(已0为区分点)
-            // 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_ where num = 1 AND paperState='未开始' AND examState='已发布' `
-            // 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_ where num>=1 AND paperState='已完成' ORDER BY startDate DESC LIMIT ${page},10`
-            // 和pc端保持一致
-            const sql1 = `select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu}${canshu3}${canshu4}  AND paperState='未开始' AND examState='已发布' ORDER BY startDate DESC LIMIT ${page},10 `
-            const sql2 = `select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu}${canshu3}${canshu4} AND paperState!='未开始' AND examState='已发布' 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_`
-            // 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
-                    } else {
-                        this.footText = true
-                    }
-                    this.finished = true
-                    this.loading = false
-                    this.refreshing = false
-                    return
-                }
+        if (aa.examName !== '' && aa.examName !== undefined && aa.examName !== null) {
+          this.moreSubject = aa.examName
+        }
+        if (aa.bankName !== '' && aa.bankName !== undefined && aa.bankName !== null) {
+          this.subjectTitle = aa.bankName
+        }
+        if (aa.examType !== '' && aa.examType !== undefined && aa.examType !== null) {
+          this.name = aa.examType === 'trainingExam' ? '培训考试' : aa.examType === 'POCTtraining' ? 'POCT培训' : aa.examType === 'selfAssessment' ? '自主考核' : aa.examType === 'routine' ? '常规' : '全部'
+        }
+        this.startTime = []
+        if (aa.limitDateDL || aa.limitDateDG) {
+          if (aa.limitDateDL && aa.limitDateDG) {
+            canshu4 = `AND limitDate BETWEEN '${aa.limitDateDL}' AND '${aa.limitDateDG}'`
+          } else if (aa.limitDateDL) {
+            canshu4 = `AND limitDate>= '${aa.limitDateDL}'`
+          } else if (aa.limitDateDG) {
+            canshu4 = `AND limitDate<='${aa.limitDateDG}'`
+          }
+        }
+        if (aa.startDateDL || aa.startDateDG) {
+          if (aa.startDateDL && aa.startDateDG) {
+            canshu3 = `AND startDate BETWEEN '${aa.startDateDL}' AND '${aa.startDateDG}'`
+          } else if (aa.startDateDL) {
+            canshu3 = `AND startDate>= '${aa.startDateDL}'`
+          } else if (aa.startDateDG) {
+            canshu3 = `AND startDate<='${aa.startDateDG}'`
+          }
+        }
+      } else {
+        this.moreSubject = ''
+        this.subjectTitle = ''
+      }
+      const key = this.subject
+      const key1 = this.moreSubject
+      const key2 = this.subjectTitle
+      const canshu1 = key1 !== '' ? `and examName like '%${key1}%'` : ''
+      const canshu2 = key2 !== '' ? `and bankName like '%${key2}%'` : ''
+      const canshu = (key1 !== '' || key2 !== '') ? `${canshu1} ${canshu2}`.trim() : key !== '' ? `and (examName like '%${key}%' or bankName like '%${key}%')` : ''
+      // 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`
+      // 已考待考(已0为区分点)
+      // 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_ where num = 1 AND paperState='未开始' AND examState='已发布' `
+      // 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_ where num>=1 AND paperState='已完成' ORDER BY startDate DESC LIMIT ${page},10`
+      // 和pc端保持一致
+      const sql1 = `select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu}${canshu3}${canshu4}  AND paperState='未开始' AND examState='已发布' ORDER BY startDate DESC LIMIT ${page},10 `
+      const sql2 = `select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu}${canshu3}${canshu4} AND paperState!='未开始' AND examState='已发布' 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_`
+      // 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
+          } else {
+            this.footText = true
+          }
+          this.finished = true
+          this.loading = false
+          this.refreshing = false
+          return
+        }
 
-                this.listData.push(...res.variables.data)
+        this.listData.push(...res.variables.data)
 
-                // 判断是否还有更多数据
-                if ((this.listData.length) % 10 !== 0) {
-                    this.footText = true
-                    this.finished = true
-                } else {
-                    this.current++
-                }
+        // 判断是否还有更多数据
+        if ((this.listData.length) % 10 !== 0) {
+          this.footText = true
+          this.finished = true
+        } else {
+          this.current++
+        }
 
-                this.loading = false
-                this.refreshing = false
-            }).catch(err => {
-                console.log(err)
-            })
-        },
-        // 获取格式化参数
-        getSearcFormData() {
-            let params = {}
-            if (this.$utils.isNotEmpty(this.subject)) {
-                params['Q^subject_^SL'] = this.subject
-            }
-            if (this.$utils.isNotEmpty(this.moreParams)) {
-                params = Object.assign(params, this.moreParams)
-            }
-            return ActionUtils.formatParams(
-                params,
-                this.pagination,
-                this.sorts)
-        },
+        this.loading = false
+        this.refreshing = false
+      }).catch(err => {
+        console.log(err)
+      })
+    },
+    // 获取格式化参数
+    getSearcFormData() {
+      let params = {}
+      if (this.$utils.isNotEmpty(this.subject)) {
+        params['Q^subject_^SL'] = this.subject
+      }
+      if (this.$utils.isNotEmpty(this.moreParams)) {
+        params = Object.assign(params, this.moreParams)
+      }
+      return ActionUtils.formatParams(
+        params,
+        this.pagination,
+        this.sorts)
+    },
 
-        transformTime(timeStamp) {
-            const hours = Math.floor(parseInt(timeStamp) / 3600000)
-            const minutes = Math.floor((parseInt(timeStamp) % 3600000) / 60000)
-            return hours + '小时' + minutes + '分钟'
-        }
+    transformTime(timeStamp) {
+      const hours = Math.floor(parseInt(timeStamp) / 3600000)
+      const minutes = Math.floor((parseInt(timeStamp) % 3600000) / 60000)
+      return hours + '小时' + minutes + '分钟'
     }
+  }
 }
 </script>
 <style scoped lang="scss">