<template>
    <el-container class="default-body default-body-detail">
        <el-header>
            <back-box class="detailBack">
                <template slot="title">
                    <span class="default-title">
                        {{ title }}
                    </span>
                </template>
            </back-box>
        </el-header>
        <div class="default-filter">
            <el-row class="row-type">
                <label>报表类型</label>
                <el-select @change="_changeType" v-if="dataType && currentType" class="opration-select"
                    v-model="currentType">
                    <el-option v-for="(item, index) in types" :lable="item.name" :key="index" :value="item.name" />
                </el-select>
                <div style="float: right;">
                    <span v-if="(dataType == '2' && currentType == '测验成绩单') || (dataType == '2' && currentType == '试题分析') ">
                        单题低分率：
                        <el-input-number class="parent-number" v-model="lowLevel" :min="1" :max="100" label="低分率">
                        </el-input-number>
                    </span>

                    <el-button v-if="(dataType == '3' && currentType == '班级对比情况表') ||  (dataType == '3' && currentType == '学生成绩排名')" @click="_studentLevelSet"
                        class="green-el-button">
                        设置学生成绩等级
                    </el-button>
                    <el-button type="primary" style="margin-left:10px;" @click="_export" class="opration-btn"
                        icon="el-icon-upload2">导出报表</el-button>
                    <el-button type="primary" @click="_print" class="opration-btn"
                        icon="el-icon-printer">打印报表</el-button>
                </div>
            </el-row>
        </div>
        <el-main v-loading="loading">
            <div style=" padding: 20px;" id="print-content">
                <div style="margin-bottom:20px;background:#ffb3b3;padding:10px 20px;" class="tips print-hidden"
                    v-if="paperModifyLog.modifiedTime && !status">
                    <p class="tips-p">
                        <i class="fa fa-bell-o"></i>
                        {{ `${paperModifyLog.modifiedTime} ${paperModifyLog.realName}` }}修改了试卷，是否重新记分？
                        <el-button type="danger" round @click="_reScore" size="mini">重新计分</el-button>
                        <el-button type="danger" round plain size="mini"
                            @click="paperModifyLog.modifiedTime = ''">暂时不计</el-button>
                    </p>
                </div>
                <div v-if="dataType == '1' && currentType == '试题分析'">
                    <el-row class="row-subfix">
                        <div class="row-line">
                            <span class="line-subfix">班级：</span>
                            <span class="line-value">{{ detail.className }}</span>
                        </div>
                        <div class="row-line">
                            <span class="line-subfix">科目：</span>
                            <span class="line-value">{{ detail.subjectName }}</span>
                        </div>
                        <div class="row-line">
                            <span class="line-subfix">课时数：</span>
                            <span class="line-value">{{ ids.length }}</span>
                        </div>
                        <div class="row-line">
                            <span class="line-subfix">上课时间：</span>
                            <span class="line-value">{{ detail.startTime }}</span>
                        </div>
                        <div class="row-line">
                            <span class="line-subfix">下课时间：</span>
                            <span class="line-value">{{ detail.endTime }}</span>
                        </div>
                    </el-row>
                    <el-row class="row-subfix">
                        <div class="row-line  row-line-5">
                            <span class="line-subfix">班级人数：</span>
                            <span class="line-value">{{ detail.classPersonNum }}</span>
                        </div>
                        <div class="row-line  row-line-5">
                            <span class="line-subfix">签到人数：</span>
                            <span class="line-value">{{ detail.checkInCount }}</span>
                        </div>
                        <div class="row-line  row-line-5">
                            <span class="line-subfix">题目总数：</span>
                            <span class="line-value">{{ detail.questionNum }}</span>
                        </div>
                        <div class="row-line  row-line-5">
                            <span class="line-subfix">答题总数：</span>
                            <span class="line-value">{{ detail.totalAnswersNum }}</span>
                        </div>
                        <div class="row-line  row-line-5">
                            <span class="line-subfix">课时时长：</span>
                            <span class="line-value">{{ setDuration(detail.duration) }}</span>
                        </div>
                    </el-row>
                    <el-row class="row-subfix">
                        <div class="row-line  row-line-5">
                            <span class="line-subfix">答对总数：</span>
                            <span class="line-value">{{ detail.totalCorrectAnswersNum }}</span>
                        </div>
                        <div class="row-line  row-line-5">
                            <span class="line-subfix">总参与度：</span>
                            <span class="line-value">{{ detail.participationRate }}%</span>
                        </div>
                        <div class="row-line  row-line-5">
                            <span class="line-subfix">班级正确率：</span>
                            <span class="line-value">{{ detail.classCorrectRate }}%</span>
                        </div>
                        <div class="row-line  row-line-5">
                            <span class="line-subfix">已答正确率：</span>
                            <span class="line-value">{{ detail.answerCorrectRate }}%</span>
                        </div>
                        <div class="row-line  row-line-5">
                            <span class="line-subfix">反馈时长：</span>
                            <span class="line-value">{{ setDuration1000(detail.consumingDuration) }}</span>
                        </div>
                    </el-row>
                    <el-row class="row-table">
                        <el-table class="default-table" :data="askItemAnalysis">
                            <el-table-column prop="title" label="课时-题号" />
                            <el-table-column label="题干" class-name="print-hidden" width="80">
                                <template slot-scope="scoped">
                                    <el-button type="text" size="mini" @click="openStem(scoped.row)">查看</el-button>
                                </template>
                            </el-table-column>
                            <el-table-column prop="questionType" label="题型" width="100">
                                <template slot-scope="scoped">{{ setSubPro(scoped.row.questionType) }}</template>
                            </el-table-column>
                            <el-table-column prop="answeredNum" label="答题人数" width="100" />
                            <el-table-column prop="correctAnswerNum" label="答对人数" width="100" />
                            <el-table-column prop="participationRate" label="班级参与度(单题)" width="170">
                                <template slot-scope="scoped">{{ scoped.row.participationRate }}%</template>
                            </el-table-column>
                            <el-table-column prop="classCorrectRate" label="班级正确率(单题)" width="170">
                                <template slot-scope="scoped">{{ scoped.row.classCorrectRate }}%</template>
                            </el-table-column>

                            <el-table-column prop="answerCorrectRate" label="已答正确率(单题)" width="170">
                                <template slot-scope="scoped">{{ scoped.row.answerCorrectRate }}%</template>
                            </el-table-column>

                            <el-table-column prop="knowledge" label="知识点(单题)" width="150">
                                <template slot-scope="scoped">
                                    <el-tooltip effect="dark" :content="_knowledge(scoped.row.knowledge)"
                                        placement="bottom">
                                        <span class="overflowText">
                                            {{ _knowledge(scoped.row.knowledge) }}
                                        </span>
                                    </el-tooltip>
                                </template>
                            </el-table-column>
                            <el-table-column prop="correctAnswer" label="正确答案(单题)" width="150">
                                <template slot-scope="scoped">
                                    {{
                            scoped.row.correctAnswer == 1 && scoped.row.questionType == 4 ? "✓" :
                                scoped.row.correctAnswer == 2 && scoped.row.questionType == 4 ? "✗" :
                                    scoped.row.correctAnswer
                        }}
                                </template>
                            </el-table-column>
                            <el-table-column prop="fallible" label="干扰选项(单题)" width="150">
                                <template slot-scope="scoped">
                                    {{
                                scoped.row.fallible == 1 && scoped.row.questionType == 4 ? "✓" :
                                    scoped.row.fallible == 2 && scoped.row.questionType == 4 ? "✗" :
                                        scoped.row.fallible
                            }}
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-row>
                </div>
                <div v-if="dataType == '1' && currentType == '学生作答表现'">
                    <el-row class="row-table" style="margin-top:0px;">
                        <el-table class="default-table" :data="askPeriodQuestionItems">
                            <el-table-column prop="studentCode" label="学号"></el-table-column>
                            <el-table-column prop="studentName" label="姓名"></el-table-column>
                            <el-table-column prop="answerTimes" label="答题次数"></el-table-column>
                            <el-table-column prop="consumingDuration" label="答题耗时"><template slot-scope="scoped">
                                    {{ setDuration1000(scoped.row.consumingDuration) }}
                                </template></el-table-column>
                            <el-table-column prop="correctAnswerTimes" label="答对次数">
                                <template slot-scope="scoped">
                                    {{ scoped.row.correctAnswerTimes || Number(scoped.row.correctAnswerTimes) === 0 ?
                            scoped.row.correctAnswerTimes : "-" }}
                                </template>
                            </el-table-column>
                            <el-table-column prop="participationRate" label="参与度"><template slot-scope="scoped">{{
                            scoped.row.participationRate ||
                                Number(scoped.row.participationRate) === 0
                                ? scoped.row.participationRate + "%"
                                : "-"
                        }}</template></el-table-column>
                            <el-table-column prop="correctRate" label="正确率"><template slot-scope="scoped">{{
                                scoped.row.correctRate || Number(scoped.row.correctRate) === 0
                                    ? scoped.row.correctRate + "%"
                                    : "-"
                            }}</template></el-table-column>
                            <el-table-column prop="answerCorrectRate" label="已答正确率"><template slot-scope="scoped">{{
                                scoped.row.answerCorrectRate ||
                                    Number(scoped.row.answerCorrectRate) === 0
                                    ? scoped.row.answerCorrectRate + "%"
                                    : "-"
                            }}</template></el-table-column>
                            <el-table-column class-name="anwser-column"
                                v-for="(item, index) in askPeriodQuestionItemOptions" :key="index"
                                :label="'Q' + (index + 1)"><template slot-scope="scoped">
                                    <div :class="scoped.row['isRight' + index] ? '' : 'red'">{{ scoped.row["answer" +
                            index] || "-" }}</div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-row>
                </div>
                <div v-if="dataType == '1' && currentType == '学生互动表现'">
                    <el-row class="row-table" style="margin-top:0px;">
                        <el-table class="default-table" :data="askInteractives">
                            <el-table-column prop="studentCode" label="学号"></el-table-column>
                            <el-table-column prop="studentName" label="姓名"></el-table-column>
                            <el-table-column prop="interactionsNum" label="参与得分"></el-table-column>
                            <el-table-column prop="interactionsCorrectNum" label="对错得分"></el-table-column>
                            <el-table-column prop="rushAnswerTimes" label="抢答成功次数"></el-table-column>
                            <el-table-column prop="rushAnswerCorrectTimes" label="抢答答对次数"></el-table-column>
                            <el-table-column prop="checkAnswerTimes" label="被抽答次数"></el-table-column>
                            <el-table-column prop="checkAnswerCorrectTimes" label="被抽答答对次数"></el-table-column>
                        </el-table>
                    </el-row>
                </div>
                <div v-if="dataType == '1' && currentType == '学生签到表现'">
                    <el-row class="row-subfix">
                        <div class="row-line row-line-5">
                            <span class="line-subfix">应到人数：</span>
                            <span class="line-value">{{ detail.classPersonNum }}</span>
                        </div>
                        <div class="row-line row-line-5">
                            <span class="line-subfix">实到人数：</span>
                            <span class="line-value">{{ detail.checkInCount }}</span>
                        </div>
                        <div class="row-line row-line-5">
                            <span class="line-subfix">迟到人数：</span>
                            <span class="line-value">{{ detail.classPersonNum - detail.checkInCount }}</span>
                        </div>
                        <div class="row-line row-line-5">
                            <span class="line-subfix">未到人数：</span>
                            <span class="line-value">{{ detail.classPersonNum - detail.checkInCount }}</span>
                        </div>
                    </el-row>
                    <el-row class="row-table" style="margin-top:20px;">
                        <el-table class="default-table" :data="askCheckinStatus">
                            <el-table-column prop="studentCode" label="学号"></el-table-column>
                            <el-table-column prop="studentName" label="姓名"></el-table-column>
                            <el-table-column prop="checkInTime" label="签到时间"></el-table-column>
                            <el-table-column prop="makeUpTime" label="补签时间"></el-table-column>
                            <el-table-column prop="rushAnswerTimes" label="是否迟到"></el-table-column>
                        </el-table>
                    </el-row>
                </div>
                <div v-if="dataType == '2' && currentType == '测验成绩单'">
                    <el-row class="row-subfix" :key="index" v-for="(item, index) in titleInfo">
                        <div class="row-line">
                            <span class="line-subfix">班级：</span>
                            <span class="line-value">{{ item.className }}</span>
                        </div>
                        <div class="row-line">
                            <span class="line-subfix">试卷名称：</span>
                            <span class="line-value">{{ item.paperName }}</span>
                        </div>
                        <div class="row-line">
                            <span class="line-subfix">测验时间：</span>
                            <span class="line-value">{{ item.testTime }}</span>
                        </div>
                    </el-row>
                    <el-row class="row-subfix">
                        <el-table class="default-table" style="margin-top: 10px" :data="titleInfo">
                            <el-table-column prop="testCount" label="测验人数" width="120" />
                            <el-table-column prop="avg" label="平均分" width="120" />
                            <el-table-column prop="hight" label="最高分" width="120" />
                            <el-table-column prop="low" label="最低分" width="120" />
                            <el-table-column prop="title" label="缺考名单">
                                <template slot-scope="scoped">
                                    {{ scoped.row.miss.join("/") }}
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-row>
                    <el-row class="row-subfix">
                        <el-table class="default-table" style="margin-top: 10px" :data="studentList" ref="table">
                            <el-table-column :width="item.label == '学号' ? 90 : 0" :prop="item.prop" :label="item.label"
                                :key="index" v-for="(item, index) in studentHeader" />
                        </el-table>
                    </el-row>
                    <el-row class="row-subfix" style="margin-top:10px">
                        <el-table class="default-table" v-if="question4List && question4List.length >= 1"
                            :data="question4List">
                            <el-table-column prop="column0" width="100" label="题号&答案" />
                            <el-table-column prop="column1" label="得分率">
                                <template slot-scope="scoped">
                                    <div
                                        :class="Number(scoped.row.column1?.replace('%', '')) <= lowLevel ? 'lowLevelClass' : ''">
                                        {{ scoped.row.column1 }}
                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="column2" label="选项1" />
                            <el-table-column prop="column3" label="选项2" />
                            <el-table-column prop="column4" label="选项3" />
                            <el-table-column prop="column5" label="选项4" />
                            <el-table-column prop="column6" width="100" label="题号&答案" />
                            <el-table-column prop="column7" label="得分率">
                                <template slot-scope="scoped">
                                    <div
                                        :class="Number(scoped.row.column7?.replace('%', '')) <= lowLevel ? 'lowLevelClass' : ''">
                                        {{ scoped.row.column7 }}
                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="column8" label="选项1" />
                            <el-table-column prop="column9" label="选项2" />
                            <el-table-column prop="column10" label="选项3" />
                            <el-table-column prop="column11" label="选项4" />
                            <el-table-column prop="column12" width="100" label="题号&答案" />
                            <el-table-column prop="column13" label="得分率">
                                <template slot-scope="scoped">
                                    <div
                                        :class="Number(scoped.row.column13?.replace('%', '')) <= lowLevel ? 'lowLevelClass' : ''">
                                        {{ scoped.row.column13 }}
                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="column14" label="选项1" />
                            <el-table-column prop="column15" label="选项2" />
                            <el-table-column prop="column16" label="选项3" />
                            <el-table-column prop="column17" label="选项4" />
                        </el-table>
                    </el-row>
                    <el-row class="row-subfix" style="margin-top:10px">
                        <el-table class="default-table" v-if="question7List && question7List.length >= 1"
                            :data="question7List">
                            <el-table-column prop="column0" width="100" label="题号&答案" />
                            <el-table-column prop="column1" label="得分率">
                                <template slot-scope="scoped">
                                    <div
                                        :class="Number(scoped.row.column1?.replace('%', '')) <= lowLevel ? 'lowLevelClass' : ''">
                                        {{ scoped.row?.column1 }}
                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="column2" label="选项1" />
                            <el-table-column prop="column3" label="选项2" />
                            <el-table-column prop="column4" label="选项3" />
                            <el-table-column prop="column5" label="选项4" />
                            <el-table-column prop="column6" label="选项5" />
                            <el-table-column prop="column7" label="选项6" />
                            <el-table-column prop="column8" label="选项7" />
                            <el-table-column prop="column9" width="100" label="题号&答案" />
                            <el-table-column prop="column10" label="得分率">
                                <template slot-scope="scoped">
                                    <div
                                        :class="Number(scoped.row.column10?.replace('%', '')) <= lowLevel ? 'lowLevelClass' : ''">
                                        {{ scoped.row?.column10 }}
                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="column11" label="选项1" />
                            <el-table-column prop="column12" label="选项2" />
                            <el-table-column prop="column13" label="选项3" />
                            <el-table-column prop="column14" label="选项4" />
                            <el-table-column prop="column15" label="选项5" />
                            <el-table-column prop="column16" label="选项6" />
                            <el-table-column prop="column17" label="选项7" />
                        </el-table>
                    </el-row>
                    <el-row class="row-subfix">
                        <el-table class="default-table" v-if="question10List && question10List.length >= 1"
                            :data="question10List">
                            <el-table-column prop="column0" width="100" label="题号&答案" />
                            <el-table-column prop="column1" label="得分率">
                                <template slot-scope="scoped">
                                    <div
                                        :class="Number(scoped.row.column1?.replace('%', '')) <= lowLevel ? 'lowLevelClass' : ''">
                                        {{ scoped.row?.column1 }}
                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="column2" label="选项1" />
                            <el-table-column prop="column3" label="选项2" />
                            <el-table-column prop="column4" label="选项3" />
                            <el-table-column prop="column5" label="选项4" />
                            <el-table-column prop="column6" label="选项5" />
                            <el-table-column prop="column7" label="选项6" />
                            <el-table-column prop="column8" label="选项7" />
                            <el-table-column prop="column9" label="选项8" />
                            <el-table-column prop="column10" label="选项9" />
                            <el-table-column prop="column11" label="选项10" />
                        </el-table>
                    </el-row>
                    <el-row class="row-subfix">
                        <el-table class="default-table" style="margin-top: 10px" :data="questionTotal">
                            <el-table-column prop="quesion" label="题号" width="120" />
                            <el-table-column prop="anwser" label="答案" width="120" />
                            <el-table-column prop="student" label="答错学生">
                                <template slot-scope="scoped">
                                    <span>总计 <span style="color:red;">
                                            {{ scoped.row.missPeopleNumber }}</span> 人
                                    </span>
                                    <span style="margin: 10px 0;"
                                        v-if="item.students && item.students?.length >= 1"
                                        v-for="(item, index) in scoped.row.details.filter(item => item.option.indexOf('未答') < 0 && !item.right)">
                                        选{{ item.option }}：{{ item.students.join("/") }}
                                    </span>
                                    <span></span>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-row>
                </div>
                <div v-if="dataType == '2' && currentType == '试题分析'">
                    <el-table class="default-table" :data="testQuestions" :span-method="singgleSpanMethod">
                        <el-table-column prop="questionIndex" label="题号" width="60"></el-table-column>
                        <el-table-column prop="questionType" label="题型" width="100">
                            <template slot-scope="scope">
                                {{ setSubPro(scope.row.questionType) }}
                            </template>
                        </el-table-column>
                        <el-table-column prop="knowledge" width="100" label="知识点">
                            <template slot-scope="scoped">
                                <el-tooltip effect="dark" :content="_knowledge(scoped.row.knowledge)"
                                    placement="bottom">
                                    <span class="overflowText">
                                        {{ _knowledge(scoped.row.knowledge) }}
                                    </span>
                                </el-tooltip>
                            </template>
                        </el-table-column>
                        <el-table-column prop="score" width="100" label="满分值"></el-table-column>
                        <el-table-column width="110" prop="highestScore" label="班最高分"></el-table-column>
                        <el-table-column width="110" prop="lowestScore" label="班最低分"></el-table-column>
                        <el-table-column width="110" prop="avgScore" label="班平均分">
                            <template slot-scope="scoped">
                                <div v-if="scoped.row.type != 'colspan'">
                                    {{ scoped.row.avgScore }}
                                </div>
                                <div :class="scoped.row.avgScore <= lowLevel ? 'lowLevelClass' : ''" v-else>
                                    {{ Number(scoped.row.avgScore).toFixed(2) }}%
                                </div>
                            </template>
                        </el-table-column>
                        <el-table-column prop="classScoringRate" width="120" label="已考得分率">
                            <template slot-scope="scoped">
                                <div v-if="scoped.row.type == 'colspan'">
                                    {{ scoped.row.scoringRate }}
                                </div>
                                <div :class="scoped.row.scoringRate <= lowLevel ? 'lowLevelClass' : ''" v-else>
                                    {{ Number(scoped.row.scoringRate).toFixed(2) }}%
                                </div>
                            </template>
                        </el-table-column>
                        <el-table-column prop="correctAnswer" label="答案"><template slot-scope="scoped">{{
                            scoped.row.correctAnswer == 1 && scoped.row.questionType == 4
                                ? "✓"
                                : scoped.row.correctAnswer == 2 && scoped.row.questionType == 4
                                    ? "✗"
                                    : scoped.row.correctAnswer
                        }}</template>
                        </el-table-column>
                        <el-table-column v-for="(item, index) in testQuestionOptions" :key="index" :label="item.title"
                            :prop="'count' + index" width="120"><template slot-scope="scope">
                                <p class="persent">
                                    {{
                            scope.row["option" + index] == "?" ? "未答" : scope.row.questionType == "5" ? "" :
                                scope.row["option" + index]
                                    ? `${scope.row["option" + index]}(${scope.row["persent" + index]
                                    })`
                                    : "" }}
                                </p>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
                <div v-if="dataType == '2' && currentType == '成绩排名'" ref="studentRank">
                    <el-table :key="studentRank.length" class="default-table" :data="studentRank">
                        <el-table-column prop="studentCode" label="学号" width="120"></el-table-column>
                        <el-table-column prop="studentName" label="姓名"></el-table-column>
                        <el-table-column prop="examScore" label="总分"></el-table-column>
                        <el-table-column prop="scoringRate" label="得分率">
                            <template slot-scope="scope">
                                {{ scope.row.scoringRate }}%
                            </template>
                        </el-table-column>
                        <el-table-column prop="classRank" label="班名"></el-table-column>
                        <el-table-column label="客观题">
                            <el-table-column prop="objectiveExamScore" label="总分"></el-table-column>
                            <el-table-column prop="objectiveScoringRate" label="得分率">
                                <template slot-scope="scope">
                                    {{ scope.row.objectiveScoringRate }}%
                                </template>
                            </el-table-column>
                        </el-table-column>
                        <el-table-column label="主观题">
                            <el-table-column prop="subjectiveExamScore" label="总分"></el-table-column>
                            <el-table-column prop="subjectiveScoringRate" label="得分率">
                                <template slot-scope="scope">
                                    {{ scope.row.subjectiveScoringRate }}%
                                </template>
                            </el-table-column>
                        </el-table-column>
                    </el-table>
                </div>
                <div v-if="dataType == '2' && currentType == '小题分报表'" ref="studentQuestions">
                    <el-table :key="studentQuestions.length" class="default-table" :data="studentQuestions">
                        <el-table-column prop="studentCode" label="学号" width="120"></el-table-column>
                        <el-table-column prop="studentName" label="姓名"></el-table-column>
                        <el-table-column prop="examScore" label="总分"></el-table-column>
                        <el-table-column label="分数组成">
                            <el-table-column prop="objectiveExamScore" label="客观题分"></el-table-column>
                            <el-table-column prop="subjectiveExamScore" label="主观题分"></el-table-column>
                        </el-table-column>
                        <el-table-column v-for="(item, index) in studentQuestionOptions" :key="index"
                            :label="'Q' + item.questionIndex" :prop="'score' + item.id">
                        </el-table-column>
                    </el-table>
                </div>
                <div v-if="dataType == '2' && currentType == '作答明细'" ref="studentAnsered">
                    <el-table :key="studentAnsered.length" class="default-table" :data="studentAnsered">
                        <el-table-column prop="studentCode" width="120" label="学号"></el-table-column>
                        <el-table-column prop="studentName" label="姓名"></el-table-column>
                        <el-table-column prop="className" label="班级"></el-table-column>
                        <el-table-column prop="examScore" label="总分"></el-table-column>
                        <el-table-column class-name="anwser-column" v-for="(item, index) in studentAnseredOptions"
                            :key="index" :label="'Q' + item.questionIndex">
                            <template slot-scope="scope">
                                <span v-if="studentAnsered[index]?.questionType == 5">*</span>
                                <span v-else-if="scope.row['answer' + item.id]"
                                    :class="scope.row['isRight' + item.id] ? '' : 'red'">
                                    {{ scope.row["answer" + item.id] }}
                                </span>
                                <span v-else :class="scope.row['questionType' + item.id] == 5 ? '' : 'red'">-</span>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
                <div v-if="dataType == '3' && currentType == '班级对比情况表'">
                    <el-table class="default-table" :data="classdiffExamReport">
                        <el-table-column prop="index" label="序号" width="120" />
                        <el-table-column prop="className" label="班级" width="120" />
                        <el-table-column label="测验人数/班级人数">
                            <template slot-scope="scoped">
                                {{ scoped.row.testCount }} / {{ scoped.row.classCount }}
                            </template>
                        </el-table-column>
                        <el-table-column prop="title" label="参与度" width="120">
                            <template slot-scope="scoped">
                                {{ Number(scoped.row.testCount * 100 / scoped.row.classCount).toFixed(2) }}%

                            </template>
                        </el-table-column>
                        <el-table-column prop="avg" label="班平均分" width="120" />
                        <el-table-column prop="hight" label="班最高分" width="120" />
                        <el-table-column prop="low" label="班最低分" width="120" />
                        <el-table-column prop="front20" label="前20名均分" width="120" />
                        <el-table-column prop="last20" label="后20名均分" width="120" />
                        <el-table-column v-for="(item, index) in defaultLevels.levels" :key="index"
                            :label="item[0] ? item[0] + '数(率)' : ''">
                            <template slot-scope="scoped">
                                {{ scoped.row.leverValues[item[0]] }}
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
                <div v-if="dataType == '3' && currentType == '试题分析'">
                    <el-table class="default-table" :data="testPaperExamReport" :span-method="arraySpanMethod">
                        <el-table-column prop="questionIndex" label="题号" width="120" />
                        <el-table-column prop="questionType" label="题型" width="100">
                            <template slot-scope="scope">
                                {{ setSubPro(scope.row.questionType) }}
                            </template>
                        </el-table-column>
                        <el-table-column prop="knowledge" label="知识点">
                            <template slot-scope="scoped">
                                <el-tooltip effect="dark" :content="_knowledge(scoped.row.knowledge)"
                                    placement="bottom">
                                    <span class="overflowText">
                                        {{ _knowledge(scoped.row.knowledge) }}
                                    </span>
                                </el-tooltip>
                            </template>
                        </el-table-column>
                        <el-table-column prop="score" label="满分值" width="120" />
                        <el-table-column prop="avgScore" label="年级平均分" width="120">
                            <template slot-scope="scoped">
                                <div v-if="scoped.row.type == 'colspan'">
                                    {{ Number(scoped.row.avgScore).toFixed(2) }} %
                                </div>
                                <div v-else>
                                    {{ scoped.row.avgScore }}
                                </div>
                            </template>
                        </el-table-column>
                        <el-table-column prop="gradeScoringRate" label="年级已考得分率" width="120">
                            <template slot-scope="scoped">
                                <div v-if="scoped.row.questionIndex == '汇总'">
                                    {{ scoped.row.gradeScoringRate.toFixed(2) }} %
                                </div>
                                <div v-else-if="scoped.row.type == 'colspan'">
                                    {{ scoped.row.gradeScoringRate.toFixed(2) }}
                                </div>
                                <div v-else="scoped.row.gradeScoringRate">
                                    {{ Number(scoped.row.gradeScoringRate * 100).toFixed(2) }} %
                                </div>
                            </template>
                        </el-table-column>
                        <el-table-column prop="correctAnswer" label="答案" width="120">
                            <template slot-scope="scoped">
                                {{
                            scoped.row.correctAnswer == 1 && scoped.row.questionType == 4 ? "✓" :
                                scoped.row.correctAnswer == 2 && scoped.row.questionType == 4 ? "✗" :
                                    scoped.row.correctAnswer
                        }}
                            </template>
                        </el-table-column>
                        <el-table-column v-for="(item, index) in testPaperExamReportOptions" :key="index"
                            :label="item.title" :prop="'count' + index" width="120">
                            <template slot-scope="scope">
                                <p class="persent">
                                    {{
                            scope.row.questionType == "5" ? "" : scope.row["option" + index]
                                ? `${scope.row["option" + index]}(${scope.row["persent" + index] ?? "0"
                                })`
                                : ""
                        }}
                                </p>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
                <div v-if="dataType == '3' && currentType == '学生成绩排名'">
                    <el-table class="default-table" :data="testStudentExamReport">
                        <el-table-column prop="gradeRank" label="年级排行" />
                        <el-table-column prop="code" label="学号" />
                        <el-table-column prop="name" label="姓名" />
                        <el-table-column prop="className" label="班级" />
                        <el-table-column prop="exam" label="分数" />
                        <el-table-column prop="lever" label="成绩等级" />
                    </el-table>
                </div>
            </div>
        </el-main>
        <el-dialog class="stem" :visible.sync="stem.visible" :title="'题干'" width="800" :append-to-body="true">
            <Preview v-if="stem && stem.src" :src="stem.src" :key="stem.src" />
            <!-- <iframe v-if="stem && stem.src" :src="stem.src" style="width: 100%;min-height: 400px;" /> -->
        </el-dialog>
        <el-dialog :append-to-body="true" :close-on-click-modal="false" title="学生等级设置"
            :visible.sync="studentLevelDialog" width="900px" @closed="_studentLevelClose">
            <el-container class="default-body" style="background: transparent !important;">
                <el-main>
                    <div class="default-main">
                        <el-form class="use-form">
                            <el-form-item class="use-form-item-box">
                                <el-form-item label="等级设置模式" class="use-form-item">
                                    <el-select size="small" v-model="fromData.levelType">
                                        <el-option label="按分数比例" :value="0"></el-option>
                                        <el-option label="按已考人数比例" :value="1"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-form-item>
                            <el-form-item>
                                <div class="dia-tab-box">
                                    <p class="dia-tab-tit">
                                        <span class="item1 boxitem">序号</span>
                                        <span class="item2 boxitem"><i>*</i>等级名称</span>
                                        <span class="item3 boxitem"><i>*</i>等级最高</span>
                                        <span class="item3 boxitem"><i>*</i>等级最低</span>
                                        <span class="item boxitem">操作</span>
                                    </p>
                                    <div class="dia-tab-item" v-for="(item, index) in fromData.levels" :key="index">
                                        <span class="item1 boxitem">{{ index + 1 }}</span>
                                        <p class="item2 boxitem">
                                            <el-input class="score-ipt" v-model="item[0]" :maxlength="12"
                                                @keydown.native="keydownRange($event)"></el-input>
                                        </p>
                                        <p class="item3 boxitem">
                                            <el-input class="score-ipt" type="number" v-model="item[1]" :min="item[2]"
                                                :max="index == 0 ? 100 : fromData.levels[index - 1][2]"
                                                @keydown.native="keydownRange($event)"></el-input>
                                            <span class="descption">
                                                %
                                                <template v-if="fromData.levelType == 0">
                                                    (
                                                    {{ index != 0 ? "不含" : "" }}
                                                    {{ Number(((item[1] / 100) * examPaperScore).toFixed(1)) }}分
                                                    )
                                                </template>
                                                <template v-else>{{ index != 0 ? "不含" : "" }}</template>
                                            </span>
                                        </p>
                                        <p class="item3 boxitem">
                                            <el-input class="score-ipt" type="number" v-model="item[2]" :min="0"
                                                :max="item[1]" @keydown.native="keydownRange($event)"></el-input>
                                            <span class="descption">
                                                %
                                                <template v-if="fromData.levelType == 0">
                                                    ({{ Number(((item[2] / 100) * examPaperScore).toFixed(1)) }}分)
                                                </template>
                                            </span>
                                        </p>
                                        <p class="item boxitem">
                                            <el-link type="danger" :underline="false"
                                                @click="fromData.levels.splice(index, 1)">删除</el-link>
                                        </p>
                                    </div>
                                    <div class="add">
                                        <p @click="fromData.levels.push(['', '', ''])">
                                            <el-button size="mini" icon="el-icon-plus" circle
                                                type="primary"></el-button>添加一行
                                        </p>
                                    </div>
                                </div>
                            </el-form-item>
                        </el-form>
                    </div>
                </el-main>
            </el-container>
            <div class="dialog-footer" slot="footer" align="right">
                <el-button type="info" :size="'small'" @click="studentLevelDialog = false">取 消</el-button>
                <el-button type="primary" class="green-el-button" :size="'small'" @click="_savefrom">保存</el-button>
            </div>
        </el-dialog>
    </el-container>
</template>
<script>
import Preview from "@/components/preview";
import { formatDate, downloadFile, tablePrint, getKnowledge } from "utils";
export default {
    name: "reportDetail",
    components: { testScoreSet: () => import("./components/testScoreSet.vue"), Preview },
    async created() {
        this.role =

            this.$store.getters.info.showRole ||

            this.$store.getters.info.permissions[0].role;

        this.dataType = this.$route.query.dataType || "";

        this.classIds = (this.$route.query.classIds || "").split(',');

        this.subjects = (this.$route.query.subjects || "").split(',');

        this.ids = [this.$route.query.id];

        this.title = this.$route.query.title;

        this.types = this.types.filter(fl => { return fl.dataType == this.dataType });

        this.currentType = this.types[0]?.name ?? ""

        await this._changeType();

        await this._queryDefaultLevels();

        await this._examDetail();
    },
    data() {
        return {
            loading: true,
            status: 0,
            //导出相关
            paperModifyLog: {},
            diaShow: false,
            exportStudent: [],
            showSelect: true, //是否显示录总分
            showAllSetScore: false, //当前操作试卷可录总分分状态
            showSetScore: false, //当前操作试卷可录小题分状态 
            lowLevel: 20,
            defaultLevels: [],
            examPaperScore: 100, //卷面最高分
            fromData: {
                levelType: 0,
                levels: [
                    ["优秀", 100, 90],
                    ["良好", 89.9, 70],
                    ["合格", 69.9, 60],
                    ["不合格", 59.9, 0],
                ],
            },
            studentLevelDialog: false,
            titleInfo: [],
            studentList: [],
            studentHeader: [],
            studentMapping: [
                {
                    key: "code",
                    label: "学号",
                },
                {
                    key: "name",
                    label: "姓名",
                },
                {
                    key: "gradeRank",
                    label: "排名",
                },
                {
                    key: "exam",
                    label: "总分",
                },
                {
                    key: "objective",
                    label: "客观分",
                },
                {
                    key: "subjective",
                    label: "主观分",
                },
            ],
            question4List: [],
            question7List: [],
            question10List: [],
            questionTotal: [],
            dataType: null,
            classIds: [],
            subjects: [],
            ids: [],
            // 试题分析对象
            askItemAnalysis: [],
            // 作答情况对象
            askPeriodQuestionItems: [],
            // 作答情况选项对象
            askPeriodQuestionItemOptions: [],
            // 学生互动问答对象
            askInteractives: [],
            // 学生签到情况
            askCheckinStatus: [],
            // 报表详情
            examReport: {
                subjectiveScore: 0,
                subjectiveHighestScore: "",
                subjectiveLowestScore: "",
                subjectiveAvgScore: "",
                subjectiveClassScoringRate: "",
                objectiveScore: "",
                objectiveHighestScore: "",
                objectiveLowestScore: "",
                objectiveAvgScore: "",
                objectiveClassScoringRate: "",
                examPaperScore: "",
                highestScore: "",
                lowestScore: "",
                avgScore: "",
                classScoringRate: "",
            },
            // 报表学生详情
            testStudents: [],
            // 报表学生选项
            testStudentOptions: [],
            studentAnsered: [],
            studentAnseredOptions: [],
            studentRank: [],
            studentQuestions: [],
            studentQuestionOptions: [],
            // 报表题目详情
            testQuestions: [],
            // 报表题目选项
            testQuestionOptions: [],
            setSubPro(type) {
                let tit;
                switch (type) {
                    case 2:
                        tit = "单选题";
                        break;
                    case 3:
                        tit = "多选题";
                        break;
                    case 4:
                        tit = "判断题";
                        break;
                    case 5:
                        tit = "主观题";
                        break;
                    default:
                        tit = type;
                }
                return tit;
            },
            setDuration(times) {
                let m = parseInt(times / 60);
                let s = parseInt(times % 60);
                console.log(times)
                let aTime;
                if (times == 0) {
                    aTime = `0`;
                } else {
                    if (m == 0 && times != 0) {
                        aTime = `${times}秒`;
                    } else if (m != 0 && times != 0) {
                        aTime = `${m}分${s}秒`;
                    }
                }
                return aTime;
            },
            setDuration1000(times) {
                let m = parseInt(times / 1000 / 60);
                let s = parseInt((times / 1000) % 60);
                let ms = times;
                let aTime;
                if (times == 0) {
                    aTime = `0`;
                } else {
                    if (m == 0 && s == 0) {
                        aTime = `${ms}毫秒`;
                    } else if (m == 0 && s != 0) {
                        aTime = `${s}秒`;
                    } else if (m != 0 && s != 0) {
                        aTime = `${m}分${s}秒`;
                    }
                }
                return aTime;
            },
            title: "",
            types: [{
                dataType: "3",
                name: "班级对比情况表"
            }, {
                dataType: "3",
                name: "试题分析"
            }, {
                dataType: "3",
                name: "学生成绩排名"
            }, {
                dataType: "2",
                name: "测验成绩单"
            }, {
                dataType: "2",
                name: "试题分析"
            }, {
                dataType: "2",
                name: "成绩排名"
            }, {
                dataType: "2",
                name: "小题分报表"
            }, {
                dataType: "2",
                name: "作答明细"
            }, {
                dataType: "1",
                name: "试题分析"
            }, {
                dataType: "1",
                name: "学生作答表现"
            }, {
                dataType: "1",
                name: "学生互动表现"
            }, {
                dataType: "1",
                name: "学生签到表现"
            }],
            detail: {},
            currentType: null,
            classdiffExamReport: [],
            classdiffLevelOptions: [],
            testPaperExamReport: [],
            testStudentExamReport: [],
            testPaperExamReportOptions: [],
            diffType: 0,
            //题干数据对象
            stem: {
                visible: false,
                src: null
            }
        }
    },
    methods: {
        _knowledge(param) {
            return getKnowledge(param);
        },
        async _examDetail() {
            if (this.dataType == 2) {
                const examDetail =
                    this.role == "ROLE_PERSONAL"
                        ? this.$request.pExamDetail
                        : this.$request.examDetail;

                let { data, info, status } = await examDetail({
                    examId: this.ids[0],
                });

                if (status === 0) {
                    this.examReport = { ...data?.examReport };

                    if (data.paperModifyLog) {
                        this.paperModifyLog = { ...data?.paperModifyLog };
                    }
                } else {
                    this.$message.error(info);
                }
            }
            else if (this.dataType == 3) {
                let paramObj = JSON.parse(JSON.stringify(this.fromData))
                if (paramObj.levelType == 0) {
                    paramObj.levels = paramObj.levels.map((item) => {
                        item[1] = ((item[1] / 100) * this.examPaperScore).toFixed(1);
                        item[2] = ((item[2] / 100) * this.examPaperScore).toFixed(1);
                        return item;
                    });
                }

                let { data, info, status } = await this.$request.classdiffreport({
                    paperId: this.ids[0],
                    classIds: this.classIds,
                    reportRange: paramObj
                });

                if (status != 0) {
                    this.$message.error(info);
                    return;
                }

                this.examReport = { ...data };
            }
        },
        async _reScore() {
            //重新记分 
            let { data, info, status } = await this.$request.reScore({
                examId: this.ids[0],
            });
            if (status === 0) {
                this.$message.success(info);
                await this._changeType();
                this.paperModifyLog.modifiedTime = "";
                this.paperModifyLog.realName = "";
                location.reload();
            } else {
                this.$message.error(info);
            }
        },
        _closeScoreSet() {
            this.scoreSet.diaScoreSet = false;
        },
        _successScoreSet() {
            this._changeType();
            this._closeScoreSet();
        },
        async _queryDefaultLevels() {

            const { data, info, status } = await this.$request.defaultLevels();

            if (status != 0) {
                this.$message.error(info);
                return;
            }

            this.defaultLevels = { ...data } || {
                levelType: 0,
                levels: [
                    ["优秀", 100, 90],
                    ["良好", 89.9, 70],
                    ["合格", 69.9, 60],
                    ["不合格", 59.9, 0],
                ],
            };

            this.defaultLevels.type = 0

            this.fromData.levelType = this.defaultLevels.levelType;

            this.fromData.levels = [...this.defaultLevels.levels];

            sessionStorage.setItem(
                "levelFromData",
                JSON.stringify(this.defaultLevels)
            );
        },
        singgleSpanMethod({ row, column, rowIndex, columnIndex }) {
            if (rowIndex == this.testQuestions?.length - 3) {
                if (columnIndex == 0) {
                    return [3, 1];
                }
                else if (columnIndex == 8) {
                    return [3, 1];
                }
                else if (columnIndex == 9) {
                    return [3, this.testQuestionOptions.length];
                }
                else if (columnIndex >= 9) {
                    return [0, 0];
                }
                else {
                    return [1, 1]
                }
            } else if (rowIndex > this.testQuestions?.length - 3) {
                if (columnIndex >= 7) {
                    return [0, 0];
                }
            }
            else {
                return [1, 1]
            }
        },
        arraySpanMethod({ row, column, rowIndex, columnIndex }) {
            if (rowIndex == this.testPaperExamReport?.length - 3) {
                if (columnIndex == 0) {
                    return [3, 1];
                }
                else if (columnIndex == 6) {
                    return [3, 1];
                }
                else if (columnIndex == 7) {
                    return [3, this.testPaperExamReportOptions.length];
                }
                else if (columnIndex >= 7) {
                    return [0, 0];
                }
                else {
                    return [1, 1]
                }
            } else if (rowIndex > this.testPaperExamReport?.length - 3) {
                if (columnIndex >= 5) {
                    return [0, 0];
                }
            }
            else {
                return [1, 1]
            }

        },
        async _savefrom() {
            for (let i = 0; i < this.fromData.levels.length; i++) {
                if (this.fromData.levels[i].includes("")) {
                    this.$message.warning("请补全编号" + (i + 1) + "设置信息！");
                    return;
                }
            }
            if (this.fromData.levels.length == 0) {
                this.$message.warning("请添加等级设置！");
                return;
            }
            let nums = [];
            let ERR_OK = false;
            this.fromData.levels.map((item) => {
                nums.push(Number(item[1]));
                nums.push(Number(item[2]));
            });
            for (let i = 0; i < nums.length; i++) {
                if (nums[i + 1] && nums[i + 1] > nums[i]) {
                    ERR_OK = true;
                    this.$message.warning("高等级比例不能低于低等级比例！请检查");
                    break;
                }
            }
            if (ERR_OK) return;
            this.tableData = [];
            this.tableData2 = [];
            this.defaultLevels.type = this.fromData.type;
            this.defaultLevels.levelType = this.fromData.levelType;
            this.defaultLevels.levels = [...this.fromData.levels];
            sessionStorage.setItem("levelFromData", JSON.stringify(this.fromData));
            this.studentLevelDialog = false;
            await this._changeType();
        },
        _studentLevelClose() {
            let levelFromData = sessionStorage.getItem("levelFromData");
            if (levelFromData) {
                levelFromData = JSON.parse(levelFromData);
                this.fromData.type = levelFromData.type;
                this.fromData.levelType = levelFromData.levelType;
                this.fromData.levels = [...levelFromData.levels];
            } else {
                this.fromData.type = 0;
                this.fromData.levelType = this.defaultLevels.levelType;
                this.fromData.levels = [...this.defaultLevels.levels];
            }
        },
        _studentLevelSet() {
            this.studentLevelDialog = true;
        },
        async _export() {
            if (this.dataType == "1") {

                let exportPeriodReport = "";

                var query = {};

                query.periodId = this.ids[0];

                exportPeriodReport =
                    this.role == "ROLE_PERSONAL"
                        ? this.$request.pExportPeriodReport
                        : this.$request.exportPeriodReport;

                const data = await exportPeriodReport({
                    ...query,
                });

                if (data) {
                    let blob = new Blob([data], {
                        type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
                    });
                    let name = `随堂问-单课时报表.xlsx`
                    downloadFile(this.status ? "随堂问-已归档单课时报表.xlsx" : name, blob);
                } else {
                    this.$message.error("下载失败");
                }
            }
            else if (this.dataType == "2") {
                const exportExamReport =
                    this.role == "ROLE_PERSONAL"
                        ? this.$request.pExportExamReport
                        : this.$request.exportExamReport;

                const data = await exportExamReport({
                    examId: this.ids[0]
                });

                if (!data.status) {
                    let blob = new Blob([data], {
                        type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
                    });
                    downloadFile(
                        this.status
                            ? "即时测-已归档单卷测练报表.xlsx"
                            : "即时测-单卷测练报表.xlsx",
                        blob
                    );
                } else {
                    this.$message.error(data.info);
                }
            }
            else if (this.dataType == '3') {
                let paramObj = JSON.parse(JSON.stringify(this.fromData))

                if (paramObj.levelType == 0) {
                    paramObj.levels = paramObj.levels.map((item) => {
                        item[1] = ((item[1] / 100) * this.examPaperScore).toFixed(1);
                        item[2] = ((item[2] / 100) * this.examPaperScore).toFixed(1);
                        return item;
                    });
                }

                const data = await this.$request.exportExamMultiReport({
                    examIds: this.classdiffExamReport?.map(item => item.examId) ?? [],
                    levels: paramObj.levels,
                    levelType: paramObj.levelType,
                });


                if (!data.status) {
                    let blob = new Blob([data], {
                        type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
                    });
                    downloadFile(
                        '多班对比.xlsx',
                        blob
                    );
                } else {
                    this.$message.error(data.info);
                }
            }

        },
        _print() {
            var splitNumber = null;
            var index = null;
            var printType = 0;
            var fixedColumn = null;
            var diffNumber = null;
            var diffStNumber = null;
            if (this.dataType == '1' && this.currentType == '学生作答表现') {
                splitNumber = 18;
                fixedColumn = 2;
                diffNumber = 2;
                diffStNumber = 17;
            }
            else if (this.dataType == '2' && this.currentType == '小题分报表') {
                splitNumber = 18;
                index = 0;
                fixedColumn = 2;
                diffNumber = 2;
                diffStNumber = 3;
                printType = '即时测-小题分报表';
            }
            else if (this.dataType == '2' && this.currentType == '试题分析') {
                splitNumber = 17;
            }
            else if (this.dataType == '2' && this.currentType == '作答明细') {
                fixedColumn = 3;
                diffNumber = 3;
                diffStNumber = 17;
                splitNumber = 18;
            }
            tablePrint({
                id: "print-content",
                title: this.title + "_" + this.currentType,
                lindex: index,
                splitParam: splitNumber,
                printType: printType,
                fixedColumn: fixedColumn,
                diffNumber: diffNumber,
                diffStNumber: diffStNumber
            });
        },
        async _changeType() {
            this.loading = true;
            if (this.dataType == "1") {
                if (this.currentType == "试题分析") {
                    await this._loadAskItemAnalysis();
                }
                else if (this.currentType == "学生作答表现") {
                    await this._loadAskAnwserItems();
                }
                else if (this.currentType == "学生互动表现") {
                    await this._loadAskInteractives();
                }
                else if (this.currentType == "学生签到表现") {
                    await this._loadAskCheckinStatus();
                }
            }
            else if (this.dataType == "2") {
                if (this.currentType == "测验成绩单") {
                    await this._testExamReport();
                }
                else if (this.currentType == "试题分析") {
                    await this._loadTestQuestionReport();
                }
                else if (this.currentType == "成绩排名") {
                    await this._loadTestStudentReport();
                }
                else if (this.currentType == "小题分报表") {
                    await this._loadTestStudentReport();
                }
                else if (this.currentType == "作答明细") {
                    await this._loadTestStudentReport();
                }
            }
            else if (this.dataType == "3") {

                if (this.currentType == "班级对比情况表") {
                    await this._classdiffExamReport();
                }
                else if (this.currentType == "试题分析") {
                    await this._testPaperExamReport();
                }
                else if (this.currentType == "学生成绩排名") {
                    await this._testStudentExamReport();
                }
            }
            this.loading = false;
        },
        async _testPaperExamReport() {
            //主观
            var subjective = {
                sum: 0.0,
                avg: 0.0,
                rate: 0.0,
                number: 0
            };

            //客观
            var objective = {
                sum: 0.0,
                avg: 0.0,
                rate: 0.0,
                number: 0
            };

            //汇总
            var summary = {
                sum: 0.0,
                avg: 0.0,
                rate: 0.0,
                number: 0
            };

            const request = this.$request.tPaperExamReport;

            let response = await request({
                paperId: this.ids[0],
                classIds: this.classIds,
                size: 9999
            });

            if (response.status != 0) {
                this.$message.error(response.info);
                return;
            }

            var maxOption = 0;
            response.data.forEach((item) => {
                if (item.details) {
                    if (maxOption < item.details.length) {
                        maxOption = item.details.length;
                    }
                }

            })

            let optionsList = [];

            for (var io = 0; io < maxOption; io++) {
                optionsList.push({})
            }


            let tableData = response.data?.map((item) => {

                summary.sum += parseFloat(item.score);
                summary.avg += parseFloat(item.avgScore);
                summary.rate += parseFloat(item.gradeScoringRate);
                summary.number += 1;
                if (item.questionType == 5) {
                    subjective.sum += parseFloat(item.score);
                    subjective.rate += parseFloat(item.gradeScoringRate);
                    subjective.avg += parseFloat(item.avgScore);
                    subjective.number += 1;
                }
                else {
                    objective.sum += parseFloat(item.score);
                    objective.rate += parseFloat(item.gradeScoringRate);
                    objective.avg += parseFloat(item.avgScore);
                    objective.number += 1;
                }

                let params = {};


                const detail = item?.details ?? [];

                let lastOPtion = detail?.find((item) => {
                    return item.option == "未答";
                });
                let defaultArr = detail?.filter((item) => {
                    return item.option != "未答";
                });

                optionsList.map((items, index) => {
                    if (index < maxOption - 1) {
                        params["count" + index] =
                            defaultArr[index]?.option != "未答"
                                ? defaultArr[index]?.count
                                : "";
                        params["persent" + index] =
                            defaultArr[index]?.option != "未答"
                                ? defaultArr[index]?.persent
                                : "";
                        params["option" + index] =
                            defaultArr[index]?.option != "未答"
                                ? defaultArr[index]?.option == 1 && item.questionType == 4
                                    ? "✓"
                                    : defaultArr[index]?.option == 2 && item.questionType == 4
                                        ? "✗"
                                        : defaultArr[index]?.option
                                : "";
                        items["title"] = "选项" + (index + 1);
                    } else {
                        items["title"] = "未答";
                        params["count" + index] = lastOPtion?.count ?? "";
                        params["persent" + index] = lastOPtion?.persent ?? "";
                        params["option" + index] = "未答";
                    }
                });

                return {
                    ...item,
                    ...params,
                };
            });

            this.testPaperExamReport = tableData?.sort((a, b) => {
                return a.questionIndex - b.questionIndex;
            });

            this.testPaperExamReportOptions = [...optionsList];
            this.testPaperExamReport.push({
                questionIndex: "汇总",
                questionType: "主观题",
                score: this.examReport.subjectiveScore,
                avgScore: this.examReport.subjectiveAvgScore,
                gradeScoringRate: this.examReport.subjectiveRate,
                correctAnswer: "备注"
            })

            this.testPaperExamReport.push({
                questionIndex: "客观题",
                type: "colspan",
                knowledge: this.examReport.objectiveScore,
                score: this.examReport.objectiveAvgScore,
                avgScore: this.examReport.objectiveRate
            })

            this.testPaperExamReport.push({
                questionIndex: "合计",
                type: "colspan",
                knowledge: this.examReport.examPaperScore,
                score: this.examReport.avg,
                avgScore: this.examReport.rate
            })
        },
        async _testStudentExamReport() {
            const request = this.$request.tgStudentExamReport;

            let paramObj = JSON.parse(JSON.stringify(this.fromData))
            if (paramObj.levelType == 0) {
                paramObj.levels = paramObj.levels.map((item) => {
                    item[1] = ((item[1] / 100) * this.examPaperScore).toFixed(1);
                    item[2] = ((item[2] / 100) * this.examPaperScore).toFixed(1);
                    return item;
                });
            }


            let response = await request({
                paperId: this.ids[0],
                classIds: this.classIds,
                reportRange: paramObj
            });

            if (response.status != 0) {
                this.$message.error(response.info);
                return;
            }

            this.testStudentExamReport = response.data;
        },
        async _classdiffExamReport() {
            this.classdiffExamReport = [];
            this.classdiffLevelOptions = [];
            const classDiffRequest = this.$request.tClassdiffExamReport;

            let paramObj = JSON.parse(JSON.stringify(this.fromData))
            if (paramObj.levelType == 0) {
                paramObj.levels = paramObj.levels.map((item) => {
                    item[1] = ((item[1] / 100) * this.examPaperScore).toFixed(1);
                    item[2] = ((item[2] / 100) * this.examPaperScore).toFixed(1);
                    return item;
                });
            }

            let classDiffResponse = await classDiffRequest({
                paperId: this.ids[0],
                classIds: this.classIds,
                reportRange: paramObj
            });

            if (classDiffResponse.status != 0) {
                this.$message.error(classDiffResponse.info);
                return;
            }

            var index = 0;

            this.classdiffExamReport = classDiffResponse.data.map((item) => {
                item.index = index + 1;
                index += 1;
                var cols = 0;
                item.keys.forEach(toam => {
                    this.classdiffLevelOptions.push(toam);
                    item[toam] = item.leverValues[cols];
                    cols += 1;
                })
                return item;
            });

            console.log(this.fromData)
        },
        openStem(stemRow) {
            this.stem.src = stemRow.screenshot ?? "";
            this.stem.visible = true;
        },
        async _testExamReport() {

            this.questionTotal = [];

            const request = this.$request.tTestExamReport;

            let response = await request({
                examIds: [this.ids[0]],
                classIds: this.classIds
            });

            if (response.status != 0) {
                this.$message.error(response.info);
                return;
            }

            this.titleInfo = response.data.titleInfos;

            var studentHeaders = [];

            var studentResults = [];

            for (var iheader = 0; iheader < 18; iheader++) {
                studentHeaders.push({
                    prop: "column" + iheader,
                    label: this.studentMapping[iheader % this.studentMapping.length].label,
                    key: this.studentMapping[iheader % this.studentMapping.length].key,
                });
            }

            var studentList = response.data.gradeExamStudentReports;

            this.studentHeader = [...studentHeaders];

            var stuRow = Math.ceil(studentList.length * 1.00 / 3);

            for (var isp = 0; isp < studentList.length; isp++) {

                var row = isp % stuRow;

                var col = parseInt(isp / stuRow);

                var item = {};

                if (studentResults.length <= row)
                    studentResults.push({});

                item = studentResults[row];

                var studentResult = studentList[isp];

                item["column" + (6 * col)] = studentResult.code;
                item["column" + (6 * col + 1)] = studentResult.name;
                item["column" + (6 * col + 2)] = studentResult.gradeRank;
                item["column" + (6 * col + 3)] = studentResult.exam;
                item["column" + (6 * col + 4)] = studentResult.objective;
                item["column" + (6 * col + 5)] = studentResult.subjective;
            }
            console.log(studentResults)
            this.studentList = [...studentResults];

            var show4Area = true;  //显示4选项区域

            var show7Area = true;  //显示7选项区域

            var show10Area = true;  //显示10选项区域

            var optionNumList = [];

            var maxOptions = 4;

            var minOptions = 10;  //最多10个选项

            var questionList = response.data.questionInfos;

            questionList = questionList.sort((prev, next) => { return prev.questionIndex - next.questionIndex });

            for (var i = 0; i < questionList.length; i++) {

                var correctAnswerValue =
                    questionList[i].questionType == 4 && questionList[i].correctAnswer == "1" ? "✓" :
                        questionList[i].questionType == 4 && questionList[i].correctAnswer == "2" ? "✗" : questionList[i].correctAnswer;

                var missCount = 0;

                var missI = questionList[i].details.filter(item => item.option.indexOf('未答') < 0 && !item.right);

                missI.forEach(itemsa => {
                    missCount = Number(missCount) + Number(itemsa.students?.length ?? 0)
                });
                this.questionTotal.push({
                    quesion: "Q" + (questionList[i].questionIndex),
                    anwser: correctAnswerValue ?? "-----",
                    details: questionList[i].details,
                    missPeopleNumber: missCount
                })
                if ((questionList[i].questionType == 2)) {
                    //单选题可能有超过4个选项，多选题是固定的
                    if (questionList[i].details?.length > maxOptions) {
                        maxOptions = questionList[i].details.filter(iam => { return iam.option.indexOf('未答') < 0 })?.length;
                    }
                    //单选题可能有超过4个选项，多选题是固定的
                    if (questionList[i].details?.length < minOptions) {
                        minOptions = questionList[i].details.filter(iam => { return iam.option.indexOf('未答') < 0 })?.length;
                    }

                    optionNumList.push(questionList[i].details.filter(iam => { return iam.option.indexOf('未答') < 0 })?.length);
                }

                if (questionList[i].questionType == 4) {
                    minOptions = 2;
                    optionNumList.push(2);
                }
                if (questionList[i].questionType == 3) {
                    if (minOptions > 4) minOptions = 4;
                }

            }

            show4Area = minOptions <= 4;

            show7Area = optionNumList.filter(o => o > 4 && o <= 7);

            show10Area = optionNumList.filter(o => o > 7);


            var currentRow = {};

            if (show4Area) {

                var areaList = [];

                var quesRow = Math.ceil(questionList?.length * 1.00 / 3);

                for (var irow = 0; irow < quesRow; irow++) {
                    areaList.push({});
                }

                for (var i = 0; i < questionList?.length; i++) {

                    var col = parseInt(i / quesRow);

                    var row = parseInt(i % quesRow);

                    var question = questionList[i];

                    var currentRow = areaList[row];

                    var correctAnswerValue =
                        question.questionType == 4 && question.correctAnswer == "1" ? "✓" :
                            question.questionType == 4 && question.correctAnswer == "2" ? "✗" : question.correctAnswer;

                    var details = question.details.filter(fl => {
                        return fl.option.indexOf('未答') < 0;
                    });


                    for (var ilr = 0; ilr < 6; ilr++) {

                        if (ilr == 0) {
                            currentRow['column' + Number(6 * col + ilr)] = question.questionIndex + correctAnswerValue;
                        }
                        else if (ilr == 1) {
                            currentRow['column' + Number(6 * col + ilr)] = (question.gradeScoringRate * 100).toFixed(2) + '%';
                        }
                        else {

                            var questionDetail = details[ilr - 2];

                            var questionColumn = 'column' + Number(6 * col + ilr);

                            if (details.length <= 4) {
                                var questionOption = questionDetail ? (question.questionType == 4 && questionDetail.option == "1" ? "✓" :
                                    question.questionType == 4 && questionDetail.option == "2" ? "✗" : questionDetail.option) : "- -"

                                if (questionOption != "- -") questionOption += "(" + questionDetail.persent + ")";

                                currentRow[questionColumn] = questionOption;
                            }
                            else {
                                currentRow[questionColumn] = "--";
                            }
                        }
                    }
                }

                this.question4List = [...areaList]

            }


            if (show7Area && show7Area.length > -1) {

                var areaList = [];

                var quesRow = Math.ceil(show7Area.length * 1.00 / 2);

                var num = 0;

                for (var irow = 0; irow < quesRow; irow++) {
                    areaList.push({});
                }

                for (var i = 0; i < questionList?.length; i++) {

                    var question = questionList[i];

                    var details = question.details.filter(fl => {
                        return fl.option.indexOf('未答') < 0;
                    });

                    if (question.questionType == 2 && details.length > 4 && details.length <= 7) {

                        var col = parseInt(num / quesRow);

                        var row = parseInt(num % quesRow);

                        var currentRow = areaList[row];

                        var correctAnswerValue = question.questionType == 4 && question.correctAnswer == "1" ? "✓" :
                            question.questionType == 4 && question.correctAnswer == "2" ? "✗" : question.correctAnswer;

                        for (var ilr = 0; ilr < 9; ilr++) {

                            if (ilr == 0) {
                                currentRow['column' + Number(9 * col + ilr)] = question.questionIndex + correctAnswerValue;
                            }
                            else if (ilr == 1) {

                                currentRow['column' + Number(9 * col + ilr)] = (question.gradeScoringRate * 100).toFixed(2) + '%';
                            }
                            else {

                                var questionDetail = details[ilr - 2];

                                var questionColumn = 'column' + Number(9 * col + ilr);

                                currentRow[questionColumn] = questionDetail ? questionDetail.option + "(" + questionDetail.persent + ")" : "- -";
                            }
                        }

                        num = num + 1;
                    }

                }

                this.question7List = [...areaList]
            }


            if (show10Area && show10Area.length > -1) {

                var areaList = [];

                var quesRow = show10Area.length;

                var num = 0;

                for (var irow = 0; irow < quesRow; irow++) {
                    areaList.push({});
                }

                for (var i = 0; i < questionList?.length; i++) {

                    var question = questionList[i];

                    var details = question.details.filter(fl => {
                        return fl.option.indexOf('未答') < 0;
                    });

                    if (question.questionType == 2 && details.length > 7) {
                        var col = parseInt(num / quesRow);

                        var row = num;

                        var currentRow = areaList[row];

                        var correctAnswerValue = question.questionType == 4 && question.correctAnswer == "1" ? "✓" :
                            question.questionType == 4 && question.correctAnswer == "2" ? "✗" : question.correctAnswer;

                        for (var ilr = 0; ilr < 12; ilr++) {

                            if (ilr == 0) {
                                currentRow['column' + Number(12 * col + ilr)] = question.questionIndex + correctAnswerValue;
                            }
                            else if (ilr == 1) {
                                currentRow['column' + Number(12 * col + ilr)] = (question.gradeScoringRate * 100).toFixed(2) + '%';
                            }
                            else {

                                var questionDetail = details[ilr - 2];

                                var questionColumn = 'column' + Number(12 * col + ilr);

                                currentRow[questionColumn] = questionDetail ? questionDetail.option + "(" + questionDetail.persent + ")" : "- -";
                            }
                        }

                        num = num + 1;
                    }

                }

                this.question10List = [...areaList]
            }


        },
        async _loadAskInteractives() {
            const request =
                this.role == "ROLE_PERSONAL"
                    ? this.$request.pPhaseInteractiveReport
                    : this.$request.phaseInteractiveReport;

            let response = await request({
                periodIds: this.ids,
                classIds: this.classIds
            });

            if (response.status != 0) {
                this.$message.error(response.info);
                return;
            }

            this.askInteractives = response.data.list;
        },
        async _loadAskItemAnalysis() {
            const request =
                this.role == "ROLE_PERSONAL"
                    ? this.$request.pPeriodDetail
                    : this.$request.periodDetail;

            let response = await request({
                periodIds: this.ids,
                size: 9999
            });

            if (response.status != 0) {
                this.$message.error(response.info);
                return;
            }

            this.detail = response.data;

            this.detail.selectDate = formatDate(new Date(), "yyyy-MM-dd");

            const listRequest =
                this.role == "ROLE_PERSONAL"
                    ? this.$request.pPeriodQuestionReport
                    : this.$request.periodQuestionReport;


            let listResponse = await listRequest({
                periodIds: this.ids,
                classIds: this.classIds,
                size: 9999
            });

            if (listResponse.status != 0) {
                this.$message.error(listResponse.info);
                return;
            }

            this.askItemAnalysis = listResponse.data.list;

        },
        async _loadAskAnwserItems() {
            const request =
                this.role == "ROLE_PERSONAL"
                    ? this.$request.pPeriodStudentReport
                    : this.$request.periodStudentReport;

            let response = await request({
                periodId: this.ids[0],
                classId: this.classIds[0]
            });

            if (response.status != 0) {
                this.$message.error(response.info);
                return;
            }

            this.askPeriodQuestionItems = response.data.list.map((item) => {
                let params = {};
                const detail = item.detail ? JSON.parse(item.detail) : [];
                if (detail.length > this.askPeriodQuestionItemOptions.length) {
                    this.askPeriodQuestionItemOptions = [...detail];
                }

                detail.map((items, index) => {
                    params["isRight" + index] = items.isRight;
                    params["answer" + index] =
                        items.answer == "1" && items.questionType == 4
                            ? "✓"
                            : items.answer == "2" && items.questionType == 4
                                ? "✗"
                                : items.answer;
                });
                return {
                    ...item,
                    ...params
                };
            });
        },
        async _loadAskCheckinStatus() {

            const detailRequest =
                this.role == "ROLE_PERSONAL"
                    ? this.$request.pPeriodDetail
                    : this.$request.periodDetail;

            let detailResponse = await detailRequest({
                periodIds: this.ids
            });

            if (detailResponse.status != 0) {
                this.$message.error(response.info);
                return;
            }

            this.detail = detailResponse.data;

            const request =
                this.role == "ROLE_PERSONAL"
                    ? this.$request.pPeriodStudentReport
                    : this.$request.periodStudentReport;

            let response = await request({
                periodId: this.ids[0],
                classId: this.classIds[0],
                type: 3
            });

            if (response.status != 0) {
                this.$message.error(response.info);
                return;
            }

            this.askCheckinStatus = response.data.list;


        },
        async _loadTestDetail() {
            //详情 
            const examDetail =
                this.role == "ROLE_PERSONAL"
                    ? this.$request.pExamDetail
                    : this.$request.examDetail;

            let { data, info, status } = await examDetail({
                examId: this.ids[0],
            });

            if (status != 0) {
                this.$message.error(info);
                return;
            }

            this.testReport = { ...data?.examReport };
        },
        async _loadTestStudentReport() {

            this.testStudents = [];
            this.testStudentOptions = [];
            this.studentAnsered = [];
            this.studentAnseredOptions = [];
            this.studentRank = [];
            this.studentQuestions = [];
            this.studentQuestionOptions = [];

            const examStudentReport =
                this.role == "ROLE_PERSONAL"
                    ? this.$request.pExamStudentReport
                    : this.$request.examStudentReport;

            let { data, info, status } = await examStudentReport({
                examId: this.ids[0],
            });

            if (status != 0) {
                this.$message.error(info);
                return;
            }

            let optionsList = [];

            let rTestStudents = data?.list.map((item) => {
                let params = {};
                const detail = JSON.parse(item.detail);
                if (detail.length) {
                    this.showSelect = false;
                }
                if (detail.length > optionsList.length) {
                    optionsList = [...detail];
                }

                detail.map((items, index) => {
                    params["que" + items.id] = items.id;
                    params["score" + items.id] = String(items.score).includes(".")
                        ? Number(items.score)
                        : items.score;
                    params["answer" + items.id] =
                        items.questionType == 4 && items.answer == "1" ? "✓" : items.questionType == 4 && items.answer == "2" ? "✗" : items.answer;
                    params["isRight" + items.id] = items.isRight;
                    params["questionType" + items.id] = item.questionType;
                });
                return {
                    ...item,
                    ...params,
                };
            });

            let rtestStudentOptions = optionsList.sort((a, b) => {
                return a.id - b.id;
            });

            if (this.currentType == "成绩排名") {
                this.studentRank = [...rTestStudents]
            }
            else if (this.currentType == "小题分报表") {
                this.studentQuestions = [...rTestStudents]
                this.studentQuestionOptions = [...rtestStudentOptions]
            }
            else if (this.currentType == "作答明细") {
                this.studentAnsered = [...rTestStudents]
                this.studentAnseredOptions = [...rtestStudentOptions]
            }
        },
        async _loadTestQuestionReport() {
            //试题分析
            this.loading = true;
            const examQuestionReport =
                this.role == "ROLE_PERSONAL"
                    ? this.$request.pExamQuestionReport
                    : this.$request.examQuestionReport;

            let { data, info, status } = await examQuestionReport({
                examId: this.ids[0],
                page: 1,
                size: 9999,
            });

            if (status != 0) {
                this.$message.error(info);
                return;
            }

            //主观
            var subjective = {
                sum: 0.0,
                avg: 0.0,
                rate: 0.0,
                number: 0,
                max: 0,
                min: 9999,
                answeredRate: 0
            };

            //客观
            var objective = {
                sum: 0.0,
                avg: 0.0,
                rate: 0.0,
                number: 0,
                max: 0,
                min: 9999,
                answeredRate: 0
            };

            //汇总
            var summary = {
                sum: 0.0,
                avg: 0.0,
                rate: 0.0,
                number: 0,
                max: 0,
                min: 9999,
                answeredRate: 0
            };

            var maxOption = 0;

            data?.list?.forEach((item) => {

                const detail = JSON.parse(item.detail);

                if (maxOption < detail.length) {

                    maxOption = detail.length;
                }
            })

            let optionsList = [];

            for (var io = 0; io < maxOption; io++) {
                optionsList.push({})
            }

            let tableData = data?.list?.map((item) => {
                let params = {};

                const detail = JSON.parse(item.detail);

                let lastOPtion = detail?.find((item) => {
                    return item.option == "未答";
                });
                let defaultArr = detail?.filter((item) => {
                    return item.option != "未答";
                });

                optionsList.map((items, index) => {
                    params["count" + index] =
                        defaultArr[index]?.option != "未答"
                            ? defaultArr[index]?.count
                            : "";
                    params["persent" + index] =
                        defaultArr[index]?.option != "未答"
                            ? defaultArr[index]?.persent
                            : "";
                    params["option" + index] =
                        defaultArr[index]?.option != "未答"
                            ? defaultArr[index]?.option == "1" && item?.questionType == 4
                                ? "✓"
                                : defaultArr[index]?.option == "2" && item?.questionType == 4
                                    ? "✗"
                                    : defaultArr[index]?.option
                            : "";

                    items["title"] = "选项" + (index + 1);
                    if (index >= optionsList.length - 1) {
                        items["title"] = "未答";
                        params["count" + index] = lastOPtion.count;
                        params["persent" + index] = lastOPtion.persent;
                        params["option" + index] = "未答";
                    }

                });

                summary.sum += parseFloat(item.score);
                summary.avg += parseFloat(item.avgScore);
                summary.rate += parseFloat(item.classScoringRate);
                summary.number += 1;
                summary.max = item.highestScore > summary.max ? item.highestScore : summary.max;
                summary.min = item.lowestScore < summary.min ? item.lowestScore : summary.min;

                if (item.questionType == 5) {
                    subjective.sum += parseFloat(item.score);
                    subjective.avg += parseFloat(item.avgScore);
                    subjective.rate += parseFloat(item.classScoringRate);
                    subjective.number += 1;
                    subjective.max = item.highestScore > summary.max ? item.highestScore : summary.max;
                    subjective.min = item.lowestScore < summary.min ? item.lowestScore : summary.min;
                }

                else {
                    objective.sum += parseFloat(item.score);
                    objective.avg += parseFloat(item.avgScore);
                    objective.rate += parseFloat(item.classScoringRate);
                    objective.number += 1;
                    objective.max = item.highestScore > summary.max ? item.highestScore : summary.max;
                    objective.min = item.lowestScore < summary.min ? item.lowestScore : summary.min;
                }

                return {
                    ...item,
                    ...params,
                };
            });

            this.testQuestions = tableData?.sort((a, b) => {
                return a.questionIndex - b.questionIndex;
            });

            this.testQuestionOptions = [...optionsList];

            this.testQuestions.push({
                questionIndex: "汇总",
                questionType: "主观题",
                //满分值
                score: this.examReport.subjectiveScore,
                //最高分
                highestScore: this.examReport.subjectiveHighestScore,
                //最低分
                lowestScore: this.examReport.subjectiveLowestScore,
                //平均分
                avgScore: this.examReport.subjectiveAvgScore,
                //已考得分率
                scoringRate: this.examReport.subjectiveScoringRate,
                correctAnswer: "备注"
            })

            this.testQuestions.push({
                questionIndex: "客观题",
                type: "colspan",
                //满分值
                knowledge: this.examReport.objectiveScore,
                //最高分
                score: this.examReport.objectiveHighestScore,
                //最低分
                highestScore: this.examReport.objectiveLowestScore,
                //平均分
                lowestScore: this.examReport.objectiveAvgScore,
                //已考得分率
                avgScore: this.examReport.objectiveScoringRate
            })

            this.testQuestions.push({
                questionIndex: "合计",
                type: "colspan",
                //满分值
                knowledge: this.examReport.examPaperScore,
                //最高分
                score: this.examReport.highestScore,
                //最低分
                highestScore: this.examReport.lowestScore,
                //平均分
                lowestScore: this.examReport.avgScore,
                //已考得分率
                avgScore: this.examReport.scoringRate
            })
        },
        keydownRange(event) {
            if (event.key == "-" || event.key == "e") {
                event.returnValue = "";
            }
        }
    }
}
</script>
<style lang="scss">
.opration-select {
    margin-left: 10px !important;
}

.row-line {
    overflow: hidden;
    width: calc(20% - 4px);
    border: 1px solid #ebeef5;
    background: #f5f7fa;
    display: inline-block;
    height: 40px;
    line-height: 40px;

    .line-subfix {
        margin-left: 10px;

    }
}

.row-table {
    margin-top: 20px;
}




// .red {
//     color: #f30;
// }

.dia-tab-box {
    font-size: 14px;

    .boxitem {
        border: 1px solid #DCDFE6;
        margin: 0px !important;

        * {
            border: none;
        }
    }

    .dia-tab-tit,
    .dia-tab-item {


        i {
            color: #f30;
            padding-right: 5px;
        }

        display: flex;

        .item {
            width: 80px;
        }

        .item1 {
            padding-left: 10px;
            width: 10%;
        }

        .item2 {
            width: 18%;
        }

        .item3 {
            padding-left: 12px;
            flex: 1;
        }

        .score-ipt {
            width: 100px;
        }
    }

    .dia-tab-tit {
        background: rgb(245, 247, 250) !important
    }

    .add {
        display: flex;
        justify-content: center;
        margin: 0 auto;

        p {
            cursor: pointer;
        }

        .el-button {
            margin-right: 6px;
        }
    }
}
</style>