| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726 |
- <!-- 工作台任务卡片 -->
- <template>
- <div class="task-card">
- <div class="top-title-box">
- <p>工作台任务</p>
- </div>
- <div class="card-max-big-box">
- <div class="year-card-box for-max-big-box">
- <div class="year-card-top-title-box">
- <p>学年数据统计</p>
- <p>按学年统计历年考试通过情况与成绩</p>
- </div>
- <div class="bottom-content-box scrollbar-box">
- <p class="null-p" v-if="!yearMinList[0]">暂无数据</p>
- <div class="bottom-big-box-1" v-for="(item,index) in yearMinList">
- <p>{{item.academicYear}}</p>
- <p>{{item.statusCode==0?'未开始':(item.statusCode==2?'通过丨'+item.score:(item.statusCode==1?'进行中':'未通过'))}}</p>
- </div>
- </div>
- </div>
- <!--任务卡列表-->
- <div class="year-card-box for-max-big-box">
- <div class="year-card-top-title-box">
- <p>学习考试任务</p>
- <p>待完成的学习任务</p>
- </div>
- <div class="bottom-content-box scrollbar-box">
- <p class="null-p" v-if="!dataList2[0]">暂无数据</p>
- <div class="bottom-big-box-5" v-for="(item,index) in dataList2" @click="tableButtonOne(item.conditionType,item)">
- <p class="text-name-p">{{item.examName}}</p>
- <div class="text-flex-box" v-if="item.conditionType == 1">
- <p>考前学习</p>
- <p>{{item.completedStudyHours}} / {{item.studyHoursRequirement}} 学时</p>
- </div>
- <div class="text-flex-box" v-if="item.conditionType == 2">
- <p>考前学习</p>
- <p>未完成</p>
- </div>
- <div class="text-flex-box" v-if="item.conditionType == 3">
- <p>模拟考试</p>
- <p>未完成</p>
- </div>
- <div class="text-flex-box" v-if="item.examKind==1&&item.conditionType == 4">
- <p>在线考试</p>
- <p>
- <span :class="!item.isPassed&&item.attemptCount==0?'color-A':(!item.isPassed&&item.attemptCount>0?'color-B':(item.isPassed?'color-C':''))">{{!item.isPassed&&item.attemptCount==0?'未开始':(!item.isPassed&&item.attemptCount>0?'未通过':(item.isPassed?'已通过':''))}}</span>
- <span style="margin-left:20px;">{{item.attemptCount>0?'成绩:'+item.maxScore+'分':''}}</span>
- </p>
- </div>
- <div class="text-flex-box" v-if="item.examKind==2&&item.conditionType == 4">
- <p>补考</p>
- <p>未完成</p>
- </div>
- <p class="time-p">{{parseTime(item.startTime,"{y}-{m}-{d} {h}:{i}")}} 至 {{parseTime(item.endTime,"{y}-{m}-{d} {h}:{i}")}}</p>
- </div>
- </div>
- </div>
- <!--模拟练习卡-->
- <div class="examination-card-box for-max-big-box">
- <div class="year-card-top-title-box">
- <p>模拟练习</p>
- <p>刷题进度和正确率</p>
- </div>
- <div class="bottom-content-box scrollbar-box" style="cursor: pointer;" @click="goPracticeQuestions()">
- <div class="bottom-big-box-6">
- <p>{{summaryData.completedCount}} / {{summaryData.totalCount}}</p>
- <p >已完成题目数 / 题库总数</p>
- </div>
- <div class="bottom-big-box-6">
- <p>{{summaryData.correctRate}}%</p>
- <p >当前模拟练习正确率</p>
- </div>
- </div>
- </div>
- <!--在线任务卡-->
- <div class="for-max-big-box" v-for="(item,index) in dataList" :key="index">
- <div class="year-card-top-title-box">
- <p>{{item.examName}}</p>
- <p v-if="item.examKind==1&&item.conditionType != 4">满足前置条件后可参加考试</p>
- <p v-if="item.examKind==1&&item.conditionType == 4">
- <span>{{parseTime(item.startTime,"{y}-{m}-{d} {h}:{i}")}} 至 {{parseTime(item.endTime,"{y}-{m}-{d} {h}:{i}")}}</span>
- </p>
- <p v-if="item.examKind==1&&item.conditionType == 4">
- <span :class="!item.isPassed&&item.attemptCount==0?'color-A':(!item.isPassed&&item.attemptCount>0?'color-B':(item.isPassed?'color-C':''))">{{!item.isPassed&&item.attemptCount==0?'未考试':(!item.isPassed&&item.attemptCount>0?'未通过':(item.isPassed?'已通过':''))}}</span>
- <span v-if="item.maxScore>0" style="margin-left:15px;">{{item.attemptCount>0?'成绩:'+item.maxScore+'分':''}}</span>
- </p>
- </div>
- <div class="bottom-content-box scrollbar-box">
- <div class="bottom-big-box-4">
- <p :class="item.completedStudyHours<item.studyHoursRequirement?'text-name':''">学时要求</p>
- <p class="colorA" v-if="item.needStudy" @click="tableButton(1,item)">开始学习</p>
- <p class="position-p-1" v-if="item.completedStudyHours<item.studyHoursRequirement">{{item.completedStudyHours}} / {{item.studyHoursRequirement}} 学时</p>
- <p class="text-type" v-if="item.completedStudyHours>=item.studyHoursRequirement">已达标</p>
- </div>
- <div class="bottom-big-box-4" v-if="item.examStudy">
- <p>考前学习</p>
- <p class="colorA" @click="tableButton(2,item)">开始学习</p>
- <!--<p class="colorA" v-if="!item.needStudy" @click="tableButton(2,item)">开始学习</p>-->
- <!--<p class="colorC" v-if="item.needStudy">待满足学时要求后解锁</p>-->
- </div>
- <div class="bottom-big-box-4" v-if="item.mockExam">
- <p>模拟考试</p>
- <p class="colorA" v-if="!item.examStudy" @click="tableButton(3,item)">开始考试</p>
- <p class="colorC" v-if="item.examStudy">待完成学习任务后解锁</p>
- </div>
- <div class="bottom-big-box-4">
- <p>在线考试</p>
- <p class="colorA" v-if="item.examKind==1&&item.conditionType == 4" @click="tableButton(4,item)">开始考试</p>
- <p class="colorC" v-if="item.examKind==1&&item.conditionType != 4">待通过模拟考试后解锁</p>
- <p class="colorB" v-if="item.examKind==2">考试未通过</p>
- </div>
- <div class="bottom-big-box-4" v-if="item.examKind == 2">
- <p>参加补考</p>
- <p class="colorA" @click="tableButton(4,item)">开始考试</p>
- </div>
- </div>
- </div>
- </div>
- <el-dialog class="preExam-dialog"
- :modal-append-to-body="false"
- :close-on-click-modal="false" :close-on-press-escape="false"
- title="考试承诺书"
- :visible.sync="preExamDialogType"
- v-if="preExamDialogType"
- width="840px"
- append-to-body>
- <div style="height:600px;" class="scrollbar-box">
- <richTextPdf ref="richTextPdf" :content="richTextHtml" />
- </div>
- <div slot="footer" class="dialog-footer dialog-footer-box">
- <p class="dialog-footer-button-null"></p>
- <p class="dialog-footer-button-border" v-if="preButtonType" @click="preExamDialogCancel">下载</p>
- <p class="dialog-footer-button-primary" @click="examUserExamStart">确认</p>
- <p class="dialog-footer-button-null"></p>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { Encrypt,Decrypt} from '@/utils/secret'
- import {
- examUserCoursewareLearningRestart,examElLabEduRelationAcademicYearProgress,
- examUserExamStudyTaskList,examUserExamStart,examUserPracticeSummary,
- examUserExamCommitmentConfirm,
- } from "@/api/safetyEducationExaminationNew/index";
- import richTextPdf from '@/views/safetyEducationExaminationNew/components/richTextPdf.vue';
- export default {
- name: 'TaskCard',
- components: { richTextPdf },
- data() {
- return {
- //学年数据
- yearType:true,
- yearMinList:[],
- studyMinList:[],
- examinationMinList:[],
- dataList:[],
- dataList2:[],
- summaryData:{
- totalCount:0,
- completedCount:0,
- correctRate:0,
- },
- //考前承诺相关
- preExamDialogType:false,
- preButtonType:false,
- richTextHtml: '',
- preData:null,
- }
- },
- created() {
- },
- mounted() {
- this.initialization();
- },
- methods: {
- initialization(){
- this.examUserPracticeSummary();
- this.examElLabEduRelationAcademicYearProgress();
- this.examUserExamStudyTaskList();
- this.examUserExamStudyTaskList2();
- },
- //下载承诺书
- preExamDialogCancel(){
- this.msgSuccess('正在下载,请耐心等候')
- this.$refs['richTextPdf'].downloadPDF();
- },
- //确认承诺-并考试
- examUserExamStart(){
- if(this.preData.attemptId){
- this.examUserExamCommitmentConfirm(1,this.preData.attemptId);
- }else{
- examUserExamStart({examId:this.preData.examId,examScene:1,}).then(response => {
- if(response.data.attemptId){
- this.examUserExamCommitmentConfirm(2,response.data.attemptId);
- }else{
- this.msgError(response.message)
- }
- })
- }
- },
- examUserExamCommitmentConfirm(type,attemptId){
- examUserExamCommitmentConfirm({attemptId:attemptId}).then(response => {
- if(type == 1){
- this.$router.push({
- path: '/startTheExam',
- query: {
- attemptId: attemptId,
- type: '1',
- examKind:this.preData.examKind,
- }
- })
- }else if(type == 2){
- this.$router.push({
- path: '/startTheExam',
- query: {
- examId: this.preData.examId,
- attemptId: attemptId,
- type: '1',
- examKind:this.preData.examKind,
- }
- })
- }
- })
- },
- //开始考试判断是否有承诺书
- setRichExamData(item){
- if(item.commitmentEnabled == 1 && !item.commitmentConfirmed){
- this.$set(this,'preButtonType',item.commitmentPrintEnabled == 1?true:false);
- this.$set(this,'richTextHtml',item.commitmentContent);
- this.$set(this,'preData',item);
- this.$set(this,'preExamDialogType',true);
- }else{
- if(item.attemptId){
- this.$router.push({
- path: '/startTheExam',
- query: {
- attemptId: item.attemptId,
- type: '1',
- examKind:item.examKind,
- }
- })
- }else{
- examUserExamStart({examId:item.examId,examScene:1,}).then(response => {
- if(response.data.attemptId){
- this.$router.push({
- path: '/startTheExam',
- query: {
- examId: item.examId,
- attemptId: response.data.attemptId,
- type: '1',
- examKind:item.examKind,
- }
- })
- }else{
- this.msgError(response.message)
- }
- })
- }
- }
- },
- //跳转刷题练习
- goPracticeQuestions(){
- this.$router.push({
- path: '/safetyEducationExaminationNew/safetyTest/practiceQuestions',
- query: {}
- })
- },
- //考试跳转
- tableButtonOne(type,item){
- let self = this;
- if(type == 1){
- if(item.examStudy&&item.courseId){
- //学习课程
- this.$router.push({
- path: '/learningCourse',
- query: {
- courseId: item.courseId,
- examId: item.examId,
- }
- })
- }else{
- //学时要求
- let obj = {
- examName:item.examName,
- knowledgePointIds:item.knowledgePointIds,
- completedStudyHours:item.completedStudyHours,
- studyHoursRequirement:item.studyHoursRequirement,
- }
- let text = Encrypt(JSON.stringify(obj))
- self.$router.push({
- path: '/safetyEducationExaminationNew/safetyEducation/knowledgeLearning',
- query: {
- text : text
- }
- })
- }
- }else if(type == 2){
- //学习课程
- this.$router.push({
- path: '/learningCourse',
- query: {
- courseId: item.courseId,
- examId: item.examId,
- }
- })
- }else if(type == 3){
- //模拟考试
- if(item.mockExamId){
- this.$router.push({
- path: '/mockExam',
- query: {
- examId: item.examId,
- attemptId: item.mockExamId,
- }
- })
- }else{
- examUserExamStart({examId:item.examId,examScene:2,}).then(response => {
- if(response.data.attemptId){
- this.$router.push({
- path: '/mockExam',
- query: {
- examId: item.examId,
- attemptId: response.data.attemptId,
- }
- })
- }else{
- this.msgError(response.message)
- }
- })
- }
- }else if(type == 4){
- //在线考试//补考
- this.setRichExamData(item);
- }
- },
- //考试跳转
- tableButton(type,item){
- let self = this;
- if(type == 1){
- if(item.examStudy&&item.courseId){
- //学习课程
- this.$router.push({
- path: '/learningCourse',
- query: {
- courseId: item.courseId,
- examId: item.examId,
- }
- })
- }else{
- //学时要求
- let obj = {
- examName:item.examName,
- knowledgePointIds:item.knowledgePointIds,
- completedStudyHours:item.completedStudyHours,
- studyHoursRequirement:item.studyHoursRequirement,
- }
- let text = Encrypt(JSON.stringify(obj))
- self.$router.push({
- path: '/safetyEducationExaminationNew/safetyEducation/knowledgeLearning',
- query: {
- text : text
- }
- })
- }
- }else if(type == 2){
- //学习课程
- this.$router.push({
- path: '/learningCourse',
- query: {
- courseId: item.courseId,
- examId: item.examId,
- }
- })
- }else if(type == 3){
- //模拟考试
- if(item.mockExamId){
- this.$router.push({
- path: '/mockExam',
- query: {
- examId: item.examId,
- attemptId: item.mockExamId,
- }
- })
- }else{
- examUserExamStart({examId:item.examId,examScene:2,}).then(response => {
- if(response.data.attemptId){
- this.$router.push({
- path: '/mockExam',
- query: {
- examId: item.examId,
- attemptId: response.data.attemptId,
- }
- })
- }else{
- this.msgError(response.message)
- }
- })
- }
- }else if(type == 4){
- //在线考试//补考
- this.setRichExamData(item);
- }
- },
- //查询学年进度列表
- examElLabEduRelationAcademicYearProgress(){
- examElLabEduRelationAcademicYearProgress({}).then(response => {
- this.$set(this, 'yearMinList', response.data)
- })
- },
- //特殊考试
- examUserExamStudyTaskList(){
- let obj = {
- page:1,
- pageSize:5,
- examStatus:2,
- isSpecialExam:true,
- }
- examUserExamStudyTaskList(obj).then(response => {
- this.$set(this, 'dataList', response.data.records)
- })
- },
- //在线考试
- examUserExamStudyTaskList2(){
- let obj = {
- page:1,
- pageSize:5,
- examStatus:2,
- isSpecialExam:false,
- }
- examUserExamStudyTaskList(obj).then(response => {
- this.$set(this, 'dataList2', response.data.records)
- })
- },
- //在线考试
- examUserPracticeSummary(){
- examUserPracticeSummary({}).then(response => {
- this.$set(this, 'summaryData', response.data)
- })
- },
- },
- }
- </script>
- <style scoped lang="scss">
- .task-card {
- background: #fff;
- /*border-radius: 6px;*/
- padding: 16px 0 0 0;
- margin-bottom: 12px;
- /*box-shadow: 0 1px 4px rgba(0,0,0,0.06);*/
- background: rgba(255, 255, 255, 0.95);
- border: 1px solid #e8edf5;
- border-radius: 16px;
- box-shadow: 0 4px 20px rgba(37, 50, 74, 0.06);
- .top-title-box{
- display: flex;
- flex-direction: column;
- padding-left:20px;
- p{
- flex:1;
- line-height:20px;
- }
- p:nth-child(1){
- font-size:16px;
- font-weight:700;
- }
- p:nth-child(2){
- font-size:14px;
- }
- p:nth-child(3){
- font-size:14px;
- }
- }
- .card-max-big-box{
- margin-top:20px;
- .year-card-box{
- }
- .study-card-box{
- }
- .examination-card-box{
- }
- .for-max-big-box{
- display: inline-block;
- width:360px;
- height:300px;
- margin: 0 0 20px 20px;
- /*border-radius:6px;*/
- /*border:1px solid #dedede;*/
- /*box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);*/
- overflow: hidden;
- background: linear-gradient(180deg, #fff, #f7faff);
- border: 1px solid #eaf0f8;
- border-radius: 14px;
- .year-card-top-title-box{
- padding:20px 20px 0 20px;
- position: relative;
- height:64px;
- p:nth-child(1){
- font-size:15px;
- font-weight:700;
- line-height:20px;
- display:block;
- overflow:hidden;
- text-overflow:ellipsis;
- white-space:nowrap;
- }
- p:nth-child(2){
- font-size:14px;
- line-height:20px;
- margin-top:6px;
- color:#60708a;
- }
- p:nth-child(3){
- cursor: pointer;
- font-size:12px;
- line-height:26px;
- color:#60708a;
- text-align: right;
- position: absolute;
- top:0;
- right:10px;
- }
- .color-A{
- color:#999;
- }
- .color-B{
- color:#f56c6c;
- }
- .color-C{
- color:#4fbe7e;
- }
- }
- .bottom-content-box{
- height:208px;
- margin-top:6px;
- padding:8px 14px 0 20px;
- .null-p{
- text-align: center;
- font-size: 14px;
- color:#999;
- line-height: 100px;
- }
- .bottom-big-box-1{
- display: flex;
- /*background-color: rgba(1, 131, 250, 0.1);*/
- border-radius:6px;
- padding:12px 14px;
- margin-bottom:12px;
- height:68px;
- border: 1px solid #e5edf8;
- background-color: #fff;
- p{
- font-size:14px;
- line-height:44px;
- }
- p:nth-child(1){
- flex:1;
- font-size:15px;
- font-weight:700;
- }
- p:nth-child(2){
- width:80px;
- text-align: center;
- }
- }
- .bottom-big-box-2{
- /*background-color: rgba(1, 131, 250, 0.1);*/
- border-radius:6px;
- padding:12px 14px;
- margin-bottom:12px;
- height:68px;
- cursor: pointer;
- border: 1px solid #e5edf8;
- background-color: #fff;
- p{
- font-size:14px;
- line-height:22px;
- }
- p:nth-child(1){
- font-size:15px;
- font-weight:700;
- }
- }
- .bottom-big-box-3{
- /*background-color: rgba(1, 131, 250, 0.1);*/
- border-radius:6px;
- padding:12px 14px;
- margin-bottom:12px;
- height:68px;
- cursor: pointer;
- border: 1px solid #e5edf8;
- background-color: #fff;
- p{
- font-size:14px;
- line-height:22px;
- }
- p:nth-child(1){
- font-size:15px;
- font-weight:700;
- }
- }
- .bottom-big-box-4{
- /*background-color: rgba(1, 131, 250, 0.1);*/
- border-radius:6px;
- padding:12px 14px;
- margin-bottom:12px;
- height:68px;
- display: flex;
- position: relative;
- border: 1px solid #e5edf8;
- background-color: #fff;
- p{
- font-size:14px;
- line-height:44px;
- }
- p:nth-child(1){
- }
- p:nth-child(2){
- flex: 1;
- text-align: right;
- }
- .colorA{
- color:#0183fa;
- cursor: pointer;
- }
- .colorB{
- color:#D9001B;
- }
- .colorC{
- color:#60708a;
- }
- .position-p-1{
- position: absolute;
- bottom:0;
- left:15px;
- width: 120px;
- font-size:12px;
- color:#60708a;
- }
- .text-name{
- margin-top:-10px;
- }
- .text-type{
- color: #4fbe7e;
- }
- }
- .bottom-big-box-5{
- /*background-color: rgba(1, 131, 250, 0.1);*/
- border-radius:6px;
- padding:8px 14px;
- margin-bottom:12px;
- height:76px;
- position: relative;
- border: 1px solid #e5edf8;
- background-color: #fff;
- cursor: pointer;
- .text-name-p{
- font-size:14px;
- font-weight:700;
- line-height:20px;
- }
- .text-flex-box{
- display: flex;
- color:#60708a;
- p{
- font-size:14px;
- line-height:20px;
- }
- p:nth-child(1){
- margin-right:20px;
- }
- p:nth-child(2){
- color:#60708a;
- .color-A{
- color:#999;
- }
- .color-B{
- color:#f56c6c;
- }
- .color-C{
- color:#4fbe7e;
- }
- }
- }
- .time-p{
- color:#60708a;
- font-size:14px;
- line-height:20px;
- }
- }
- .bottom-big-box-6{
- /*background-color: rgba(1, 131, 250, 0.1);*/
- border-radius:6px;
- padding:13px 14px;
- margin-bottom:12px;
- height:78px;
- position: relative;
- border: 1px solid #e5edf8;
- background-color: #fff;
- p:nth-child(1){
- display: block;
- font-size: 22px;
- color: #25324a;
- font-weight:700;
- line-height:26px;
- }
- p:nth-child(2){
- font-size:14px;
- line-height:26px;
- color:#60708a;
- }
- }
- }
- }
- }
- }
- </style>
|