|
@@ -1,900 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="manage-evaluation-container custom-iview-split">
|
|
|
- <Loading :top="200" type="1" style="text-align:center" v-show="isLoading"></Loading>
|
|
|
- <Split v-model="split1">
|
|
|
- <!--评测列表-->
|
|
|
- <div class="evaluation-list-wrap" slot="left">
|
|
|
- <div class="evaluation-list-title">
|
|
|
- <b class="title">{{ $t('system.menu.scEv') }}</b>
|
|
|
- <div style="float:right" v-if="!isSearch">
|
|
|
- <Icon type="md-add" class=" to-create-icon" @click="goToCreate" :title="$t('learnActivity.mgtScEv.create')" v-if="$access.can('admin.*|schoolAc-upd')" />
|
|
|
- <Icon type="md-copy" class=" to-create-icon" @click="copyEv" :title="$t('learnActivity.mgtScEv.copy')" />
|
|
|
- <Icon type="md-trash" v-show="evaListShow.length" class="to-create-icon" :title="$t('learnActivity.mgtScEv.delete')" @click="deleteEvaluation" v-if="$access.can('admin.*|schoolAc-upd')" />
|
|
|
- <Icon type="md-create" v-show="evaListShow.length && evaListShow[curEvaIndex] && evaListShow[curEvaIndex].progress == 'pending'" class="to-create-icon" @click="editEvaluation" :title="$t('learnActivity.mgtScEv.edit')" v-if="$access.can('admin.*|schoolAc-upd')" />
|
|
|
- <!-- 筛选 -->
|
|
|
- <Poptip style="float:right" trigger="click" :offset="-10" theme="light">
|
|
|
- <Icon type="ios-funnel" class="to-create-icon" />
|
|
|
- <div slot="content">
|
|
|
- <div class="filter-item">
|
|
|
- <span>{{$t('learnActivity.mgtScEv.ftStatus')}}</span>
|
|
|
- <Select v-model="filter.status" style="width:100px" size="small" clearable @on-change="filterEv">
|
|
|
- <Option value="pending">{{$t('learnActivity.mgtScEv.pending')}}</Option>
|
|
|
- <Option value="going">{{$t('learnActivity.mgtScEv.going')}}</Option>
|
|
|
- <Option value="finish">{{$t('learnActivity.mgtScEv.finish')}}</Option>
|
|
|
- </Select>
|
|
|
- </div>
|
|
|
- <div class="filter-item">
|
|
|
- <span>{{$t('learnActivity.mgtScEv.ftMode')}}</span>
|
|
|
- <Select v-model="filter.mode" style="width:100px" size="small" clearable @on-change="filterEv">
|
|
|
- <Option v-for="(item,index) in $GLOBAL.EV_MODE()" :value="item.value" :key="index">{{ item.label }}</Option>
|
|
|
- </Select>
|
|
|
- </div>
|
|
|
- <div class="filter-item">
|
|
|
- <span>{{$t('learnActivity.mgtScEv.ftType')}}</span>
|
|
|
- <Select v-model="filter.type" style="width:100px" size="small" clearable @on-change="filterEv">
|
|
|
- <Option v-for="(item,index) in $GLOBAL.EV_TYPE()" :value="item.value" :key="index">{{ item.label }}</Option>
|
|
|
- </Select>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </Poptip>
|
|
|
- <Icon type="md-search" class="to-create-icon" @click="isSearch = !isSearch" :title="$t('learnActivity.mgtScEv.search')" />
|
|
|
- </div>
|
|
|
- <div v-else style="float:right;width:calc(100% - 150px);padding-right:10px;" class="light-iview-input">
|
|
|
- <Input v-special-char icon="ios-close" v-model="keyword" :placeholder="$t('schoolBaseInfo.codeSearchHolder')" autofocus style="width:100%" @on-click="closeKeySearch" @on-change="filterByName" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="evaluation-list-main">
|
|
|
- <vuescroll>
|
|
|
- <div v-for="(item,index) in evaListShow" @click.capture="selectEvaluation(index)" :class="['evaluation-item','block-bg',index == curEvaIndex ? 'block-bg-active':'']" :key="index">
|
|
|
- <p class="evaluation-name">
|
|
|
- {{item.name}}
|
|
|
- <!-- 修改评测名称 -->
|
|
|
- <Icon type="md-create" class="edit-end-time" @click="editEvName(index)" :title="$t('learnActivity.mgtScEv.edName')" />
|
|
|
- </p>
|
|
|
- <p class="evaluation-type">
|
|
|
- <Icon type="md-time" style="margin-right:5px;" size="16" />
|
|
|
- <span>{{$t('learnActivity.mgtScEv.createTime')}}{{dateFormat(item.startTime)}}</span>
|
|
|
- </p>
|
|
|
- <p class="evaluation-type">
|
|
|
- <Icon type="md-time" style="margin-right:5px;" size="16" />
|
|
|
- <span>{{$t('learnActivity.mgtScEv.endTime')}}{{dateFormat(item.endTime)}}</span>
|
|
|
- <!-- 修改评测结束时间 -->
|
|
|
- <Icon type="md-create" class="edit-end-time" v-if="item.progress == 'going'" @click="editEvEndtime(index)" :title="$t('learnActivity.mgtScEv.editEndTime')" />
|
|
|
- </p>
|
|
|
- <div class="tags-wrap">
|
|
|
- <!-- 评测模式 -->
|
|
|
- <span class="ev-info-tag ev-tag-common">{{getModeLabel(item.source)}}</span>
|
|
|
- <span class="ev-info-tag ev-tag-common">{{getTypeLabel(item.type)}}</span>
|
|
|
- <!-- 活动进度状态 -->
|
|
|
- <span class="evaluation-status-tag ev-tag-common" :style="{ borderColor: item.progColor, color: item.progColor}">
|
|
|
- {{ item.progText }}
|
|
|
- </span>
|
|
|
- <!-- 活动评分状态 -->
|
|
|
- <span class="evaluation-status-tag ev-tag-common" :style="{ borderColor: item.scoreColor, color: item.scoreColor}">
|
|
|
- {{ item.scoreText }}
|
|
|
- </span>
|
|
|
- <!-- 立即结束 -->
|
|
|
- <span v-if="item.progress == 'going'" class="handle-end-tag ev-tag-common" @click="handleEnd(index)">
|
|
|
- {{$t('learnActivity.mgtScEv.stop')}}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <!-- 二维码分享 -->
|
|
|
- <span class="ev-qr-tag" @click="openQrcode(index)" v-show="item.source != '1'">
|
|
|
- <Icon size="25" custom="iconfont icon-qr-code" class="qr-code-icon" />
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <!-- <EmptyData v-if="evaListShow.length == 0" style="margin-top:100px;" :textContent="`${scope == 'school' ? curPdInfo.name || '' : ''}${$t('learnActivity.mgtScEv.nodata')}`"></EmptyData> -->
|
|
|
- <EmptyData v-if="evaListShow.length == 0" style="margin-top:100px;" :textContent="`${$t('learnActivity.mgtScEv.nodata')}`"></EmptyData>
|
|
|
- </vuescroll>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div slot="right" class="evaluation-detail-wrap">
|
|
|
- <!--顶部菜单-->
|
|
|
- <div class="evaluation-detail-bar">
|
|
|
- <!-- 评测数据 -->
|
|
|
- <span :class="curBarIndex == 0 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(0)">
|
|
|
- {{$t('learnActivity.mgtScEv.tab1')}}
|
|
|
- </span>
|
|
|
- <!-- 评测试卷 -->
|
|
|
- <span :class="curBarIndex == 1 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(1)">
|
|
|
- {{$t('learnActivity.mgtScEv.tab2')}}
|
|
|
- </span>
|
|
|
- <!-- 阅卷设置-->
|
|
|
- <span :class="curBarIndex == 2 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(2)">
|
|
|
- {{$t('learnActivity.mgtScEv.markSetting')}}
|
|
|
- </span>
|
|
|
-
|
|
|
- <!-- 启动扫描助手 -->
|
|
|
- <!-- <div style="float:right;" v-if="$access.ability('admin','mock-eva').validateAll" v-show="evaListShow[curEvaIndex] && evaListShow[curEvaIndex].source == '2'">
|
|
|
- <Button type="success" size="small" :loading="answerLoading" class="mock-stu-answer" @click="startUp">
|
|
|
- 启动扫描助手
|
|
|
- </Button>
|
|
|
- </div> -->
|
|
|
-
|
|
|
- </div>
|
|
|
- <!--试卷信息-->
|
|
|
- <div :class="curBarIndex == 1 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-show="curBarIndex == 1">
|
|
|
- <div class="evaluation-test-paper-header" v-if="evaListShow[curEvaIndex]">
|
|
|
- <span>{{$t('learnActivity.mgtScEv.evSubject')}}</span>
|
|
|
- <span v-for="(item,index) in evaListShow[curEvaIndex].subjects" :key="index" :class="index == curSubIndex ? 'subject-item subject-item-active':'subject-item'" @click="selectSubject(index)">
|
|
|
- {{item.name}}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <div class="test-paper-detail">
|
|
|
- <vuescroll ref="test-paper-detail" @handle-scroll="checkBackTop">
|
|
|
- <!--试卷题目信息-->
|
|
|
- <TestPaper v-if="evaListShow[curEvaIndex] && evaListShow[curEvaIndex].papers && evaListShow[curEvaIndex].papers[curSubIndex] && evaListShow[curEvaIndex].papers[curSubIndex].item" :paper="evaListShow[curEvaIndex].papers[curSubIndex]" style="color:#515a6e;margin-top:-30px;" :isShowTools="false" isExamPaper :examId="evaListShow[curEvaIndex].id" canFix></TestPaper>
|
|
|
- <EmptyData v-else style="margin-top:60px;"></EmptyData>
|
|
|
- <!--返回顶部-->
|
|
|
- <!-- <div class="back-to-top fl-col-center" :title="$t('learnActivity.mgtScEv.returnTop')" v-if="showBack" @click="handleBackToTop">
|
|
|
- <Icon type="ios-arrow-up" />
|
|
|
- </div> -->
|
|
|
- <BackToTop v-if="showBack" @on-to-top="handleBackToTop"></BackToTop>
|
|
|
- </vuescroll>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- 试卷数据 -->
|
|
|
- <div :class="curBarIndex == 0 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-show="curBarIndex == 0">
|
|
|
- <Scoring v-if="evaListShow.length" :examInfo="examDetaiInfo" :periodId="filterPeriod" ref="score-box"></Scoring>
|
|
|
- <EmptyData v-show="!evaListShow.length" :top="100"></EmptyData>
|
|
|
- </div>
|
|
|
- <!-- 阅卷助手 -->
|
|
|
- <div :class="curBarIndex == 2 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-show="curBarIndex == 2">
|
|
|
- <MarkSetting ref="markSetting" v-if="evaListShow[curEvaIndex]" :evInfo="evaListShow[curEvaIndex]" v-model="isSetting"></MarkSetting>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </Split>
|
|
|
- <!-- 修改评测时间 -->
|
|
|
- <Modal v-model="editTimeStatus" footer-hide className="ed-name-modal">
|
|
|
- <div slot="header" class="modal-header">
|
|
|
- {{$t('learnActivity.mgtScEv.editEndTime')}}
|
|
|
- </div>
|
|
|
- <div class="edit-name-content">
|
|
|
- <p class="edit-name-label">
|
|
|
- {{$t('cusMgt.listName')}}
|
|
|
- </p>
|
|
|
- <DatePicker v-model="editTime" :options="dateOpt1" type="datetime" @on-change="handleTime" format="yyyy-MM-dd HH:mm" :placeholder="$t('learnActivity.mgtScEv.endTimeHolder')" style="width: 100%"></DatePicker>
|
|
|
- <Button :loading="btnLoading" @click="confirmEditEndtime" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
|
|
|
- </div>
|
|
|
- </Modal>
|
|
|
- <!-- 修改评测名称 -->
|
|
|
- <Modal v-model="editNameStatus" footer-hide className="ed-name-modal" @on-ok="confirmEditName" :loading="modalLoading">
|
|
|
- <div slot="header" class="modal-header">
|
|
|
- {{$t('learnActivity.mgtScEv.edName')}}
|
|
|
- </div>
|
|
|
- <div class="edit-name-content">
|
|
|
- <p class="edit-name-label">
|
|
|
- {{$t('cusMgt.listName')}}
|
|
|
- </p>
|
|
|
- <Input v-model="editName" :placeholder="$t('learnActivity.mgtScEv.edNameHolder')" />
|
|
|
- <Button :loading="btnLoading" @click="confirmEditName" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
|
|
|
- </div>
|
|
|
- </Modal>
|
|
|
- <div class="qr-code-wrap" v-show="showQrStatus" @click="showQrStatus = false">
|
|
|
- <div class="qr-code-info" @click.stop>
|
|
|
- <p class="qr-code-title">
|
|
|
- {{$t('learnActivity.mgtScEv.shareText8')}}
|
|
|
- </p>
|
|
|
- <div id="qrcode" :class="showQrStatus ? 'animated fadeIn':'animated fadeOut'" ref="qrcode" style="padding:15px 25px 20px 25px;background-color:white;width:330px;margin:auto;">
|
|
|
- </div>
|
|
|
- <p class="invite-url-text" @click="copyUrl">
|
|
|
- <Icon type="md-copy" class="copy-link-icon" :title="$t('cusMgt.copyUrl')" />
|
|
|
- <span style="font-size:14px">{{$t('cusMgt.inviteUrl')}}</span>
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-<script>
|
|
|
-import QRCode from 'qrcodejs2'
|
|
|
-import TestPaper from '@/view/evaluation/index/TestPaper.vue'
|
|
|
-import Scoring from './Scoring.vue'
|
|
|
-// import MarkSetting from './markpaper/MarkSetting.vue'
|
|
|
-import MarkData from './markpaper/MarkData.vue'
|
|
|
-export default {
|
|
|
- components: {
|
|
|
- TestPaper, Scoring, MarkData
|
|
|
- },
|
|
|
- inject: ['reload'],
|
|
|
- data() {
|
|
|
- return {
|
|
|
- btnLoading: false,
|
|
|
- shareUrl: '',
|
|
|
- showQrStatus: false,
|
|
|
- modalLoading: true,
|
|
|
- editTime: null,
|
|
|
- editTimeStatus: false,
|
|
|
- editName: '',
|
|
|
- editNameStatus: false,
|
|
|
- isSetting: false,
|
|
|
- keyword: '',
|
|
|
- isSearch: false,
|
|
|
- answerLoading: false,
|
|
|
- scoreLoading: false,
|
|
|
- split1: 0.2,
|
|
|
- scope: '',//school 校本 private 个人
|
|
|
- showBack: false,
|
|
|
- curSubIndex: 0,
|
|
|
- curBarIndex: 0,
|
|
|
- curEvaIndex: 0,
|
|
|
- evaluationList: [],
|
|
|
- evaListShow: [],
|
|
|
- examDetaiInfo: {},
|
|
|
- targetList: [],
|
|
|
- isLoading: false,
|
|
|
- filterPeriod: undefined,
|
|
|
- curPdInfo: {},
|
|
|
- filter: {
|
|
|
- status: '',
|
|
|
- mode: '',
|
|
|
- type: ''
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- dateOpt1() {
|
|
|
- let _this = this
|
|
|
- return {
|
|
|
- disabledDate(date) {
|
|
|
- let d = _this.evaListShow[_this.curEvaIndex]?.startTime ? _this.evaListShow[_this.curEvaIndex].startTime : Date.now()
|
|
|
- return d && d > date.valueOf() + 86400000
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 复制评测
|
|
|
- copyEv() {
|
|
|
- // 课中评测不提供复制操作
|
|
|
- if (this.evaListShow[this.curEvaIndex]?.source === '1') {
|
|
|
- this.$Modal.info({
|
|
|
- title: this.$t('learnActivity.mgtScEv.copyTitle'),
|
|
|
- content: this.$t('learnActivity.mgtScEv.copyContent1')
|
|
|
- })
|
|
|
- } else if (this.evaListShow[this.curEvaIndex]) {
|
|
|
- this.$Modal.confirm({
|
|
|
- title: this.$t('learnActivity.mgtScEv.copyTitle'),
|
|
|
- content: this.$t('learnActivity.mgtScEv.copyContent'),
|
|
|
- onOk: () => {
|
|
|
- console.log(this.evaListShow[this.curEvaIndex])
|
|
|
- this.$router.push({
|
|
|
- name: 'createSchoolEva',
|
|
|
- params: {
|
|
|
- evaluationInfo: this.evaListShow[this.curEvaIndex]
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- async copyUrl() {
|
|
|
- let evName = this.evaListShow[this.curEvaIndex].name
|
|
|
- let evType = this.getModeLabel(this.evaListShow[this.curEvaIndex].source)
|
|
|
- let soc = this.evaListShow[this.curEvaIndex].owner === 'school' ? this.$t('learnActivity.mgtScEv.shareText4') : this.$t('learnActivity.mgtScEv.shareText5')
|
|
|
- let socName = this.evaListShow[this.curEvaIndex].subjects.map(item => item.name).join('、')
|
|
|
- let shortUrl = await this.$api.getShortUrl(encodeURI(this.shareUrl))
|
|
|
- let shareText = `${this.$t('learnActivity.mgtScEv.shareText1')}\n\n${soc}${socName}\n${this.$t('learnActivity.mgtScEv.shareText3')}${evType}\n${this.$t('cusMgt.inviteInfo8')}${this.$store.state.userInfo.name}\n${this.$t('learnActivity.mgtScEv.shareText2')}${evName}\n\n${this.$t('learnActivity.mgtScEv.shareText6')}\n${shortUrl.result || encodeURI(this.shareUrl)}\n\n${this.$t('learnActivity.mgtScEv.shareText7')}\nURL:https://${window.location.host}/login/student`
|
|
|
- this.$copyText(shareText).then(
|
|
|
- ok => {
|
|
|
- this.$Message.success(this.$t("settings.copyModal1"))
|
|
|
- },
|
|
|
- fail => {
|
|
|
- this.$Message.error(this.$t("settings.copyModal2"))
|
|
|
- }
|
|
|
- )
|
|
|
- },
|
|
|
- openQrcode() {
|
|
|
- this.$nextTick(async () => {
|
|
|
- this.shareUrl = `https://${window.location.host}/studentWeb/eventView?aId=${this.evaListShow[this.curEvaIndex].id}`
|
|
|
- let shortUrl = await this.$api.getShortUrl(encodeURI(this.shareUrl))
|
|
|
- // 此时已经渲染完成
|
|
|
- if (this.shareQRcode == undefined) {
|
|
|
- let qrcode = new QRCode('qrcode', {
|
|
|
- width: 280, // 设置宽度,单位像素
|
|
|
- height: 280, // 设置高度,单位像素
|
|
|
- // text: shortUrl.result || encodeURI(this.shareUrl), // 编码处理
|
|
|
- text: encodeURI(this.shareUrl), // 编码处理
|
|
|
- correctLevel: QRCode.CorrectLevel.Q //解决编码后网址太长的问题
|
|
|
- })
|
|
|
- this.shareQRcode = qrcode
|
|
|
- } else {
|
|
|
- this.shareQRcode.clear()
|
|
|
- // this.shareQRcode.makeCode(shortUrl.result || encodeURI(this.shareUrl))
|
|
|
- this.shareQRcode.makeCode(encodeURI(this.shareUrl))
|
|
|
- }
|
|
|
- let dom = document.getElementById('qrcode')
|
|
|
- if (dom) dom.title = ''
|
|
|
- })
|
|
|
- this.showQrStatus = true
|
|
|
- },
|
|
|
- handleTime(value) {
|
|
|
- if (value.indexOf('00:00') > 0) {
|
|
|
- value = value.replace('00:00', '23:59:59')
|
|
|
- this.editTime = value
|
|
|
- }
|
|
|
- },
|
|
|
- confirmEditEndtime() {
|
|
|
- if (this.editTime) {
|
|
|
- this.evaListShow[this.curEvaIndex].code = this.evaListShow[this.curEvaIndex].code.replace('Exam-', '')
|
|
|
- this.btnLoading = true
|
|
|
- this.$api.learnActivity.updExamEndtime({
|
|
|
- id: this.evaListShow[this.curEvaIndex].id,
|
|
|
- code: this.evaListShow[this.curEvaIndex].code,
|
|
|
- time: this.editTime.getTime()
|
|
|
- }).then(
|
|
|
- res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.evaListShow[this.curEvaIndex].endTime = this.editTime.getTime()
|
|
|
- this.$Message.success(this.$t('learnActivity.mgtScEv.updOk'))
|
|
|
- } else {
|
|
|
- this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
|
|
|
- }
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
|
|
|
- }
|
|
|
- ).finally(() => {
|
|
|
- this.editTimeStatus = false
|
|
|
- this.btnLoading = false
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$Message.warning(this.$t('learnActivity.mgtScEv.endTimeHolder'))
|
|
|
- this.modalLoading = false
|
|
|
- setTimeout(() => {
|
|
|
- this.modalLoading = true
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- editEvEndtime(index) {
|
|
|
- this.editTimeStatus = true
|
|
|
- this.editTime = new Date(this.evaListShow[index]?.endTime)
|
|
|
- },
|
|
|
- confirmEditName() {
|
|
|
- if (this.editName) {
|
|
|
- this.evaListShow[this.curEvaIndex].code = this.evaListShow[this.curEvaIndex].code.replace('Exam-', '')
|
|
|
- this.btnLoading = true
|
|
|
- this.$api.learnActivity.updExamEndtime({
|
|
|
- id: this.evaListShow[this.curEvaIndex].id,
|
|
|
- code: this.evaListShow[this.curEvaIndex].code,
|
|
|
- name: this.editName
|
|
|
- }).then(
|
|
|
- res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.evaListShow[this.curEvaIndex].name = this.editName
|
|
|
- this.$Message.success(this.$t('learnActivity.mgtScEv.updOk'))
|
|
|
- } else {
|
|
|
- this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
|
|
|
- }
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
|
|
|
- }
|
|
|
- ).finally(() => {
|
|
|
- this.editNameStatus = false
|
|
|
- this.btnLoading = false
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$Message.warning(this.$t('learnActivity.mgtScEv.edNameHolder'))
|
|
|
- this.modalLoading = false
|
|
|
- setTimeout(() => {
|
|
|
- this.modalLoading = true
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- editEvName(index) {
|
|
|
- this.editNameStatus = true
|
|
|
- this.editName = this.evaListShow[index]?.name
|
|
|
- },
|
|
|
- // 启动扫描助手
|
|
|
- startUp() {
|
|
|
- //1、直接启动
|
|
|
- // window.open("tencent://message/?uin=346915968")
|
|
|
- window.open("hitools://")
|
|
|
- //2、如果没有启动成功,判断是否下载安装
|
|
|
- },
|
|
|
- filterByName() {
|
|
|
- let curPdEv = this.evaluationList.filter(item => item.period.id === this.filterPeriod)
|
|
|
- this.evaListShow = curPdEv.filter(item => {
|
|
|
- return item.name.indexOf(this.keyword) > -1
|
|
|
- })
|
|
|
- },
|
|
|
- closeKeySearch() {
|
|
|
- this.isSearch = false
|
|
|
- this.keyword = ''
|
|
|
- this.filterByName()
|
|
|
- },
|
|
|
- //根据学段筛选评测
|
|
|
- filterByPeriod() {
|
|
|
- this.curEvaIndex = 0
|
|
|
- sessionStorage.setItem('evPeriod', this.filterPeriod)
|
|
|
- if (this.filterPeriod) {
|
|
|
- this.evaListShow = this.evaluationList.filter(item => item.period.id === this.filterPeriod)
|
|
|
- } else {
|
|
|
- this.evaListShow = [...this.evaluationList]
|
|
|
- }
|
|
|
- if (this.evaListShow.length) {
|
|
|
- this.selectEvaluation(0)
|
|
|
- } else {
|
|
|
- this.isLoading = false
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- //筛选评测
|
|
|
- filterEv() {
|
|
|
- let curPdEv = this.evaluationList.filter(item => item.period.id === this.filterPeriod)
|
|
|
- this.evaListShow = curPdEv.filter(item => {
|
|
|
- let status = !this.filter.status || (this.filter.status == item.progress)
|
|
|
- let type = !this.filter.type || (this.filter.type == item.type)
|
|
|
- let mode = !this.filter.mode || (this.filter.mode == item.source)
|
|
|
- return status && type && mode
|
|
|
- })
|
|
|
- },
|
|
|
- // 模拟教师评分数据
|
|
|
- mockScoring() {
|
|
|
- this.scoreLoading = true
|
|
|
- this.$api.learnActivity.mockScoring({
|
|
|
- id: this.evaListShow[this.curEvaIndex].id,
|
|
|
- code: this.evaListShow[this.curEvaIndex].code.replace('Exam-', '')
|
|
|
- }).then(
|
|
|
- res => {
|
|
|
- setTimeout(() => {
|
|
|
- this.$Message.success(this.$t('learnActivity.mgtScEv.mockOk'))
|
|
|
- }, 500)
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.error(this.$t('learnActivity.mgtScEv.mockErr'))
|
|
|
- }
|
|
|
- ).finally(() => {
|
|
|
- setTimeout(() => {
|
|
|
- this.scoreLoading = false
|
|
|
- this.reload()
|
|
|
- }, 500)
|
|
|
- })
|
|
|
- },
|
|
|
- // 模拟学生作答数据
|
|
|
- mockAnswer() {
|
|
|
- this.answerLoading = true
|
|
|
- this.$api.learnActivity.mockAnswer({
|
|
|
- id: this.evaListShow[this.curEvaIndex].id,
|
|
|
- code: this.evaListShow[this.curEvaIndex].code.replace('Exam-', '')
|
|
|
- }).then(
|
|
|
- res => {
|
|
|
- setTimeout(() => {
|
|
|
- this.$Message.success(this.$t('learnActivity.mgtScEv.mockOk'))
|
|
|
- }, 500)
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.error(this.$t('learnActivity.mgtScEv.mockErr'))
|
|
|
- }
|
|
|
- ).finally(() => {
|
|
|
- setTimeout(() => {
|
|
|
- this.answerLoading = false
|
|
|
- this.reload()
|
|
|
- }, 500)
|
|
|
- })
|
|
|
- },
|
|
|
- handleEnd(index) {
|
|
|
- this.$Modal.confirm({
|
|
|
- title: this.$t('learnActivity.mgtScEv.stopTitle'),
|
|
|
- content: `${this.$t('learnActivity.mgtScEv.stopContent')}${this.evaListShow[index].name}?`,
|
|
|
- onOk: () => {
|
|
|
- let code = this.evaListShow[index].code
|
|
|
- this.$api.learnActivity.FinishEva({
|
|
|
- id: this.evaListShow[index].id,
|
|
|
- code: code.includes('Exam') ? code : `Exam-${code}`
|
|
|
- // code: this.evaListShow[index].code.replace('Exam-', '')
|
|
|
- }).then(
|
|
|
- res => {
|
|
|
- if (!res.error) {
|
|
|
- this.$Message.success(this.$t('learnActivity.mgtScEv.stopOk'))
|
|
|
- this.evaListShow[index].progress = 'finish'
|
|
|
- this.reload()
|
|
|
- } else {
|
|
|
- // this.$Message.error('API ERROR!')
|
|
|
- this.$Message.error(this.$t('learnActivity.mgtScEv.actionErr'))
|
|
|
- }
|
|
|
- },
|
|
|
- err => {
|
|
|
- // this.$Message.error('API ERROR!')
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- dropdownStates(flag) {
|
|
|
- if (!flag) this.filterByPeriod()
|
|
|
- },
|
|
|
- /**获取type对应的label */
|
|
|
- getTypeLabel(code) {
|
|
|
- for (let item of this.$GLOBAL.EV_TYPE()) {
|
|
|
- if (item.value == code) {
|
|
|
- return item.label
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- /**获取mode对应的label */
|
|
|
- getModeLabel(code) {
|
|
|
- for (let item of this.$GLOBAL.EV_MODE()) {
|
|
|
- if (item.value == code) {
|
|
|
- return item.label
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * 查找班级课程下的班级
|
|
|
- * */
|
|
|
- findClassroom() {
|
|
|
- if (this.targetList.length == 0) {
|
|
|
- let requestData = this.$store.state.userInfo.TEAMModelId
|
|
|
- this.$api.learnActivity.FindClassroomByTeacherId({
|
|
|
- code: requestData
|
|
|
- }).then(
|
|
|
- res => {
|
|
|
- if (!res.error) {
|
|
|
- this.targetList = res.result.data
|
|
|
- } else {
|
|
|
- // this.$Message.error('API ERROR!')
|
|
|
- this.$Message.error(this.$t('learnActivity.mgtScEv.classInfoErr'))
|
|
|
- }
|
|
|
- },
|
|
|
- err => {
|
|
|
-
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * 判断是否显示回到顶部按钮
|
|
|
- * @param vertical
|
|
|
- * @param horizontal
|
|
|
- * @param nativeEvent
|
|
|
- */
|
|
|
- checkBackTop(vertical, horizontal, nativeEvent) {
|
|
|
- if (vertical.scrollTop > 100) {
|
|
|
- this.showBack = true
|
|
|
- } else {
|
|
|
- this.showBack = false
|
|
|
- }
|
|
|
- },
|
|
|
- /**vuescroll回到顶部 */
|
|
|
- handleBackToTop() {
|
|
|
- this.$refs['test-paper-detail'].scrollTo(
|
|
|
- {
|
|
|
- y: '0'
|
|
|
- },
|
|
|
- 300
|
|
|
- )
|
|
|
- },
|
|
|
- /**删除评测信息 */
|
|
|
- deleteEvaluation() {
|
|
|
- this.$Modal.confirm({
|
|
|
- title: this.$t('learnActivity.mgtScEv.deleteTitle'),
|
|
|
- content: `${this.$t('learnActivity.mgtScEv.deleteContent')}${this.evaListShow[this.curEvaIndex].name}?`,
|
|
|
- onOk: () => {
|
|
|
- let params = {
|
|
|
- id: this.evaListShow[this.curEvaIndex].id,
|
|
|
- scope: this.evaListShow[this.curEvaIndex].scope,
|
|
|
- code: this.evaListShow[this.curEvaIndex].code.replace('Exam-', '')
|
|
|
- }
|
|
|
- this.isLoading = true
|
|
|
- this.$api.learnActivity.DeleteExamInfo(params).then(
|
|
|
- res => {
|
|
|
- if (res.error == null) {
|
|
|
- let index = this.curEvaIndex
|
|
|
- this.selectEvaluation(0)
|
|
|
- this.evaListShow.splice(index, 1)
|
|
|
- this.$Message.success(this.$t('learnActivity.mgtScEv.deleteOk'))
|
|
|
- } else {
|
|
|
- this.$Message.error(this.$t('learnActivity.mgtScEv.deleteErr'))
|
|
|
- }
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.error(this.$t('learnActivity.mgtScEv.deleteErr'))
|
|
|
- }
|
|
|
- ).finally(() => {
|
|
|
- setTimeout(() => {
|
|
|
- this.isLoading = false
|
|
|
- }, 500)
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- goToCreate() {
|
|
|
- if (this.$store.state.user.schoolProfile.school_base != undefined) {
|
|
|
- if (this.scope == 'school') {
|
|
|
- this.$router.push({
|
|
|
- name: 'createSchoolEva'
|
|
|
- })
|
|
|
- } else if (this.scope == 'private') {
|
|
|
- this.$router.push({
|
|
|
- name: 'createPrivEva'
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.$Message.warning(this.$t('learnActivity.mgtScEv.noJoin'))
|
|
|
- }
|
|
|
- },
|
|
|
- editEvaluation() {
|
|
|
- this.$router.push({
|
|
|
- name: 'createSchoolEva',
|
|
|
- params: {
|
|
|
- evaluationInfo: this.examDetaiInfo
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- selectSubject(index) {
|
|
|
- this.curSubIndex = index
|
|
|
- },
|
|
|
-
|
|
|
- dateFormat(timestamp) {
|
|
|
- let date = new Date(timestamp)
|
|
|
- let Y = date.getFullYear()
|
|
|
- let M = date.getMonth()
|
|
|
- let D = date.getDate()
|
|
|
- let H = date.getHours()
|
|
|
- let MIN = date.getMinutes()
|
|
|
- return `${Y}-${M < 9 ? '0' + (M + 1) : M + 1}-${D} ${H < 10 ? '0' + H : H}:${MIN < 10 ? '00' : MIN}`
|
|
|
- },
|
|
|
- getEvStatusInfo(progress, isScore) {
|
|
|
- let info = {}
|
|
|
- if (progress == 'pending') {
|
|
|
- info.progText = this.$t('learnActivity.mgtScEv.pending')
|
|
|
- info.progColor = '#2d8cf0'
|
|
|
- } else if (progress == 'going') {
|
|
|
- info.progText = this.$t('learnActivity.mgtScEv.going')
|
|
|
- info.progColor = '#19be6b'
|
|
|
- } else if (progress == 'finish') {
|
|
|
- info.progText = this.$t('learnActivity.mgtScEv.finish')
|
|
|
- info.progColor = '#515a6e'
|
|
|
- }
|
|
|
- if (isScore === 0) {
|
|
|
- info.scoreText = this.$t('learnActivity.mgtScEv.scoreStatus')
|
|
|
- info.scoreColor = '#ff9900'
|
|
|
- } else if (isScore === 1) {
|
|
|
- info.scoreText = this.$t('learnActivity.mgtScEv.scoreStatus1')
|
|
|
- info.scoreColor = '#515a6e'
|
|
|
- }
|
|
|
- return info
|
|
|
- },
|
|
|
- //查询评测列表
|
|
|
- findEvaluation() {
|
|
|
- this.isLoading = true
|
|
|
- let requestData = {
|
|
|
- code: this.scope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
|
|
|
- }
|
|
|
- this.$api.learnActivity.FindExamList(requestData).then(
|
|
|
- res => {
|
|
|
- if (!res.error) {
|
|
|
- res.examInfo = res.examInfo.sort((a, b) => {
|
|
|
- return a.createTime - b.createTime > 0 ? -1 : 1
|
|
|
- })
|
|
|
- res.examInfo.forEach(item => {
|
|
|
- let statusInfo = this.getEvStatusInfo(item.progress, item.sStatus)
|
|
|
- item.progText = statusInfo.progText
|
|
|
- item.progColor = statusInfo.progColor
|
|
|
- item.scoreText = statusInfo.scoreText
|
|
|
- item.scoreColor = statusInfo.scoreColor
|
|
|
- })
|
|
|
- this.evaluationList = res.examInfo
|
|
|
- this.evaListShow = res.examInfo
|
|
|
- if (this.scope == 'school') {
|
|
|
- this.filterByPeriod()
|
|
|
- } else {
|
|
|
- if (res.examInfo.length) {
|
|
|
- this.selectEvaluation(0)
|
|
|
- } else {
|
|
|
- this.isLoading = false
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- // this.$Message.error('API ERROR!')
|
|
|
- this.$Message.error(this.$t('learnActivity.mgtScEv.evListErr'))
|
|
|
- this.isLoading = false
|
|
|
- }
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.isLoading = false
|
|
|
- }
|
|
|
- )
|
|
|
- },
|
|
|
- checkScoreSave(fn, index) {
|
|
|
- let compStu = this.$refs['score-box'] ? this.$refs['score-box'].$refs['byStuMark'] : null
|
|
|
- let compQu = this.$refs['score-box'] ? this.$refs['score-box'].$refs['byQuMark'] : null
|
|
|
- if ((compStu && compStu.isUpd) || (compQu && compQu.isUpd)) {
|
|
|
- this.$Modal.confirm({
|
|
|
- title: this.$t('learnActivity.score.saveScoreTitle'),
|
|
|
- content: this.$t('learnActivity.score.saveScoreContent'),
|
|
|
- okText: this.$t('learnActivity.mark.yes'),
|
|
|
- cancelText: this.$t('learnActivity.mark.no'),
|
|
|
- onOk: () => {
|
|
|
- if (compStu && compStu.isUpd) {
|
|
|
- compStu.saveScore()
|
|
|
- } else if (compQu && compQu.isUpd) {
|
|
|
- compQu.saveScore()
|
|
|
- }
|
|
|
- if (fn) fn(index)
|
|
|
- },
|
|
|
- onCancel: () => {
|
|
|
- if (compStu && compStu.isUpd) {
|
|
|
- compStu.isUpd = false
|
|
|
- } else if (compQu && compQu.isUpd) {
|
|
|
- compStu.preSaveList = {}
|
|
|
- }
|
|
|
- if (fn) fn(index)
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- if (fn) fn(index)
|
|
|
- }
|
|
|
- },
|
|
|
- selectEvaluation(index) {
|
|
|
- this.checkScoreSave(this.toEvaluation, index)
|
|
|
- },
|
|
|
- selectBar(index) {
|
|
|
- this.checkScoreSave(this.handleSelectBar, index)
|
|
|
- },
|
|
|
- handleSelectBar(index) {
|
|
|
- this.curBarIndex = index
|
|
|
- this.$nextTick(() => {
|
|
|
- if (this.$refs['score-box']) this.$refs['score-box'].showTest = false
|
|
|
- })
|
|
|
- },
|
|
|
- toEvaluation(index) {
|
|
|
- this.curSubIndex = 0
|
|
|
- this.curEvaIndex = index
|
|
|
- sessionStorage.setItem('examScope', this.evaListShow[index].scope)
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['score-box'].showTest = false
|
|
|
- })
|
|
|
- if (this.evaListShow[this.curEvaIndex] && this.evaListShow[this.curEvaIndex].papers.length == 0) {
|
|
|
- this.findExamInfo()
|
|
|
- } else {
|
|
|
- this.examDetaiInfo = this.evaListShow[this.curEvaIndex]
|
|
|
- }
|
|
|
- },
|
|
|
- //查询当前评测的详细信息
|
|
|
- findExamInfo() {
|
|
|
- let requestData = {
|
|
|
- id: this.evaListShow[this.curEvaIndex].id,
|
|
|
- code: this.evaListShow[this.curEvaIndex].code
|
|
|
- }
|
|
|
- this.isLoading = true
|
|
|
- this.$api.learnActivity.FindExamInfo(requestData).then(
|
|
|
- async res => {
|
|
|
- if (!res.error) {
|
|
|
- let resData = res.examInfo[0]
|
|
|
- resData.score = 0
|
|
|
- for (let index in resData.papers) {
|
|
|
- let blob = resData.papers[index].blob
|
|
|
- let sheetNo = resData.papers[index].sheetNo
|
|
|
- resData.papers[index].examScope = this.evaListShow[this.curEvaIndex].scope
|
|
|
- resData.papers[index].examCode = this.evaListShow[this.curEvaIndex].code
|
|
|
- resData.papers[index].examId = this.evaListShow[this.curEvaIndex].id
|
|
|
- resData.papers[index].owner = this.evaListShow[this.curEvaIndex].owner
|
|
|
- resData.papers[index].sheetNo = sheetNo
|
|
|
- resData.papers[index] = await this.$evTools.getFullPaper(resData.papers[index])
|
|
|
- resData.papers[index].examScope = this.evaListShow[this.curEvaIndex].scope
|
|
|
- resData.papers[index].examCode = this.evaListShow[this.curEvaIndex].code
|
|
|
- resData.papers[index].examId = this.evaListShow[this.curEvaIndex].id
|
|
|
- resData.papers[index].owner = this.evaListShow[this.curEvaIndex].owner
|
|
|
- resData.papers[index].sheetNo = sheetNo
|
|
|
- if (!resData.papers[index].subjectId) {
|
|
|
- resData.papers[index].subjectId = blob.substring(blob.lastIndexOf('/') + 1)
|
|
|
- }
|
|
|
- resData.papers[index].blob = blob
|
|
|
- resData.score += resData.papers[index].score
|
|
|
-
|
|
|
- //补充评测状态信息
|
|
|
- let statusInfo = this.getEvStatusInfo(resData.progress, resData.sStatus)
|
|
|
- resData.progText = statusInfo.progText
|
|
|
- resData.progColor = statusInfo.progColor
|
|
|
- resData.scoreText = statusInfo.scoreText
|
|
|
- resData.scoreColor = statusInfo.scoreColor
|
|
|
- }
|
|
|
- this.evaListShow.splice(this.curEvaIndex, 1, resData)
|
|
|
- this.examDetaiInfo = resData
|
|
|
- } else {
|
|
|
- this.$Message.error(this.$t('learnActivity.mgtScEv.exInfoErr'))
|
|
|
- // this.$Message.error('API ERROR!')
|
|
|
- }
|
|
|
- },
|
|
|
- err => {
|
|
|
- // this.$Message.error('API ERROR!')
|
|
|
- }
|
|
|
- ).finally(() => {
|
|
|
- this.isLoading = false;
|
|
|
- })
|
|
|
- },
|
|
|
- beforeunloadHandler(e) {
|
|
|
- let compStu = this.$refs['score-box'] ? this.$refs['score-box'].$refs['byStuMark'] : null
|
|
|
- let compQu = this.$refs['score-box'] ? this.$refs['score-box'].$refs['byQuMark'] : null
|
|
|
- if ((compStu && compStu.isUpd) || (compQu && compQu.isUpd)) {
|
|
|
- e = e || window.event
|
|
|
- if (e) {
|
|
|
- e.returnValue = '关闭提示'
|
|
|
- }
|
|
|
- return '关闭提示'
|
|
|
- }
|
|
|
- },
|
|
|
- // goBack(){}
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- // 监听浏览器刷新事件
|
|
|
- window.addEventListener('beforeunload', e => this.beforeunloadHandler(e))
|
|
|
- // 处理浏览器返回事件
|
|
|
- // if (window.history && window.history.pushState) {
|
|
|
- // // 向历史记录中插入了当前页
|
|
|
- // history.pushState(null, null, document.URL);
|
|
|
- // window.addEventListener('popstate', this.goBack, false);
|
|
|
- // }
|
|
|
- },
|
|
|
- destroyed() {
|
|
|
- window.removeEventListener('beforeunload', e => this.beforeunloadHandler(e))
|
|
|
- window.removeEventListener('popstate', this.goBack, false);
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.scope = 'school'
|
|
|
- this.findEvaluation()
|
|
|
- },
|
|
|
- watch: {
|
|
|
- curBarIndex(n, o) {
|
|
|
- if (n == 0) {
|
|
|
- if (this.$refs['score-box'] && this.$refs['score-box'].$refs['score-table']) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['score-box'].$refs['score-table'].handleResize()
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- '$store.state.user.curPeriod': {
|
|
|
- deep: true,
|
|
|
- immediate: true,
|
|
|
- handler(n, o) {
|
|
|
- if (n) {
|
|
|
- this.filterPeriod = n.id
|
|
|
- this.curPdInfo = n
|
|
|
- this.filterByPeriod()
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- beforeRouteLeave(to, from, next) {
|
|
|
- this.checkScoreSave(next)
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-<style lang="less" scoped>
|
|
|
-@import "./MgtSchoolEva.less";
|
|
|
-</style>
|
|
|
-<style lang="less">
|
|
|
-.evalustion-base-attr .ivu-form .ivu-form-item-label {
|
|
|
- color: #a5a5a5;
|
|
|
-}
|
|
|
-.evaluation-attr-form .ivu-select-disabled .ivu-select-selection {
|
|
|
- background: none;
|
|
|
-}
|
|
|
-.sort-dropdown {
|
|
|
- .title {
|
|
|
- color: var(--primary-text-color);
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
- .ivu-select-dropdown {
|
|
|
- // background-color: #2d2d2d;
|
|
|
- border-radius: 2px;
|
|
|
- // border: 1px #464646 solid;
|
|
|
- .ivu-dropdown-menu {
|
|
|
- li {
|
|
|
- // color: #ccc;
|
|
|
- font-size: 12px !important;
|
|
|
- &:hover {
|
|
|
- color: #2d2d2d;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-// .test-paper-detail .paper-container {
|
|
|
-// padding-bottom: 30px;
|
|
|
-// }
|
|
|
-</style>
|