|
@@ -1,600 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="wrong-ques student-check">
|
|
|
- <Loading v-show="isLoading" bgColor="rgba(0, 0, 0, 0.3)"></Loading>
|
|
|
- <div class="filter-type">
|
|
|
- <div class="filter-radio">
|
|
|
- <span class="type-name">{{ $t('studentWeb.wrongTopic.type') }}:</span>
|
|
|
- <RadioGroup v-model="filtType" type="button" button-style="solid" @on-change="filterChange">
|
|
|
- <Radio v-for="item in typeList" :key="item.type" :label="item.type">{{ item.value }}</Radio>
|
|
|
- </RadioGroup>
|
|
|
- </div>
|
|
|
- <div class="filter-radio">
|
|
|
- <span class="type-name">{{ $t("syllabus.save") }}:</span>
|
|
|
- <RadioGroup v-model="filtCollect" type="button" button-style="solid" @on-change="filterChange">
|
|
|
- <Radio :label="-1">{{ $t('schoolBaseInfo.all') }}</Radio>
|
|
|
- <Radio :label="1">{{ $t('studentWeb.wrongQues.collect') }}</Radio>
|
|
|
- <Radio :label="0">{{ $t('studentWeb.wrongQues.notCollected') }}</Radio>
|
|
|
- </RadioGroup>
|
|
|
- </div>
|
|
|
- <div class="filter-radio">
|
|
|
- <span class="type-name">{{ $t("evaluation.filter.sort") }}:</span>
|
|
|
- <Select v-model="filtTime" style="width: 50%" @on-change="filterChange">
|
|
|
- <Option :value="0">{{ $t('studentWeb.wrongQues.wrongTime') }}</Option>
|
|
|
- <Option :value="1">{{ $t('studentWeb.wrongQues.practiceTime') }}</Option>
|
|
|
- </Select>
|
|
|
- <Select v-model="sortOrder" style="width: 20%" @on-change="filterChange">
|
|
|
- <Option :value="0">正序</Option>
|
|
|
- <Option :value="1">倒序</Option>
|
|
|
- </Select>
|
|
|
- </div>
|
|
|
- <!-- <div>
|
|
|
- <span class="type-name">{{ $t('studentWeb.wrongTopic.point') }}:</span>
|
|
|
- <template v-if="showPoint.length">
|
|
|
- <span v-for="(item, index) in showPoint" :key="index" class="point-box">
|
|
|
- {{ item.name }}
|
|
|
- <Icon type="md-close" @click="removePoint(index)" />
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- <Icon type="md-add-circle" size="18" color="#24B880" @click="pointShow = true" />
|
|
|
- </div> -->
|
|
|
- <div class="search">
|
|
|
- <Input v-model="subTitle" :placeholder="$t('studentWeb.wrongTopic.search')" style="width: 72%" class="light-iview-input"
|
|
|
- @on-change="filterChange" clearable />
|
|
|
- <!-- <DatePicker type="date" :placeholder="$t('studentWeb.wrongTopic.date')" :options="options" @on-change="dateChange"
|
|
|
- style="width: 200px" class="light-iview-input"
|
|
|
- /> -->
|
|
|
- </div>
|
|
|
- <p class="have-total">
|
|
|
- {{ $t('studentWeb.wrongTopic.word1') }}
|
|
|
- <span>{{ topicTotal }}</span>
|
|
|
- {{ $t('studentWeb.wrongTopic.topic') }}
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- <Scroll class="list-scroll" :on-reach-bottom="handleReachTop">
|
|
|
- <div style="height: 259px" v-show="winHeight"></div>
|
|
|
- <!-- 题目列表 -->
|
|
|
- <div class="topic-list">
|
|
|
- <template v-if="exerciseList.length">
|
|
|
- <div v-for="(item, index) in exerciseList" :key="index" class="topic-box">
|
|
|
- <div>
|
|
|
- <span style="vertical-align: top; margin-right: 5px; margin-top: 1px;" class="tag-style">{{ $t(`studentWeb.exam.queType.${item.type}`) }}</span>
|
|
|
- </div>
|
|
|
- <div style="width: 100%; position: relative;">
|
|
|
- <div style="position: absolute; top: 0; right: 0;">
|
|
|
- <span v-show="item.open" @click="closeDetail(index)">
|
|
|
- <Icon type="ios-arrow-dropup" class="ansDetail" size="25" :title="$t('studentWeb.exam.report.closeExam')" />
|
|
|
- </span>
|
|
|
- <span v-show="!item.open" @click="closeDetail(index)">
|
|
|
- <Icon type="ios-arrow-dropdown" class="ansDetail" size="25" :title="$t('studentWeb.exam.report.openExam')" />
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <span style="vertical-align: top; margin-right: 5px; cursor: pointer;" @click="onCollection(index)">
|
|
|
- <Icon custom="iconfont icon-shoucang1" size="19" color="#3B660C" v-show="!item.star"></Icon>
|
|
|
- <Icon custom="iconfont icon-shoucang2" size="19" color="#EA8F3E" v-show="item.star"></Icon>
|
|
|
- </span>
|
|
|
- <span style="vertical-align: top;">{{ index + 1 }}. </span>
|
|
|
- <div class="question" v-html="item.question"></div>
|
|
|
- <div v-show="item.open">
|
|
|
- <div>
|
|
|
- <div v-for="(option, oIndex) in item.option" :key="oIndex" style="display: flex; margin-top: 5px; margin-left: 5px;">
|
|
|
- {{option.code}}. <div style="margin-left:10px" v-html="option.value"></div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div v-if="item.children.length" style="margin-left: 20px;">
|
|
|
- <div v-for="(child, cIndex) in item.children" :key="cIndex" class="topic-box" style="display: block;">
|
|
|
- <span style="vertical-align: top;">({{ cIndex + 1 }}). </span>
|
|
|
- <div v-html="child.question" style="width: calc(94% - 40px); display: inline-block;"></div>
|
|
|
- <div v-for="(optionC, indexoptionC) in child.option" :key="indexoptionC" style="display:flex; margin-top:5px; margin-left: 5px;">
|
|
|
- {{optionC.code}}. <div style="margin-left:10px" v-html="optionC.value"></div>
|
|
|
- </div>
|
|
|
- <div class="answer-area">
|
|
|
- <span class="answer-tip">【{{ $t('evaluation.answer') }}】</span>
|
|
|
- <p v-html="child.answer[0]"></p>
|
|
|
- </div>
|
|
|
- <div class="answer-area">
|
|
|
- <span class="answer-tip">【{{ $t('evaluation.explain') }}】</span>
|
|
|
- <p v-html="child.explain"></p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <template v-else>
|
|
|
- <div class="answer-area">
|
|
|
- <span class="answer-tip">【{{ $t('evaluation.answer') }}】</span>
|
|
|
- <p v-html="item.answer[0]"></p>
|
|
|
- </div>
|
|
|
- <div class="answer-area">
|
|
|
- <span class="answer-tip">【{{ $t('evaluation.explain') }}】</span>
|
|
|
- <p v-html="item.explain"></p>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- <div class="topic-type">
|
|
|
- <span>
|
|
|
- {{ $t('studentWeb.wrongQues.joinTime') }}:{{ item.joinTime }}
|
|
|
- </span>
|
|
|
- <span>
|
|
|
- {{ $t('studentWeb.wrongQues.lately') }}:{{ item.lastTime }}
|
|
|
- </span>
|
|
|
- <span>
|
|
|
- {{ $t('studentWeb.wrongQues.nextTime') }}:{{ item.nxtRev }}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <div v-else class="emptycondition">
|
|
|
- <svg-icon icon-class="empty-white-box" class="empty-Icon" />
|
|
|
- <br />
|
|
|
- {{ $t("studentWeb.empty") }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </Scroll>
|
|
|
- <Modal v-model="pointShow" :title="$t('studentWeb.wrongTopic.checkPoint')" @on-ok="okPoint" class="wrong-ques-modal">
|
|
|
- <p>
|
|
|
- <!-- <span style="margin-left: 50px;">学段:初中</span> -->
|
|
|
- <span>{{ $t('studentWeb.wrongTopic.subject') }}:{{ subjectList[filtSubject].name }}</span>
|
|
|
- </p>
|
|
|
- <div class="check-point">
|
|
|
- <Input v-model="pointField" :placeholder="$t('studentWeb.wrongTopic.searchPoint')" class="light-iview-input" />
|
|
|
- <template v-if="allPoint.length">
|
|
|
- <CheckboxGroup v-model="checkPointArr">
|
|
|
- <Checkbox :label="index" border v-for="(item, index) in allPoint" :key="index">
|
|
|
- {{ item.name }}
|
|
|
- </Checkbox>
|
|
|
- </CheckboxGroup>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </Modal>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import { mapGetters, mapState } from 'vuex';
|
|
|
-export default {
|
|
|
- name: "",
|
|
|
- data () {
|
|
|
- return {
|
|
|
- MyNo: "8",
|
|
|
- MyName: "",
|
|
|
- isLoading: false,
|
|
|
- animal: "",
|
|
|
- filtSubject: 0,
|
|
|
- filtType: 'all',
|
|
|
- filtCollect: -1, //是否收藏
|
|
|
- subTitle: "", //搜索字
|
|
|
- filtTime: 0, //时间排序
|
|
|
- sortOrder: 0, //倒序还是正序
|
|
|
- filtDiff: 0,
|
|
|
- filtLevel: 0,
|
|
|
- subjectList: [], //学科
|
|
|
- typeList: [ //题型
|
|
|
- {
|
|
|
- value: this.$t("studentWeb.type.all"),
|
|
|
- type: 'all'
|
|
|
- },
|
|
|
- {
|
|
|
- value: this.$t("studentWeb.exam.queType.single"),
|
|
|
- type: 'single'
|
|
|
- },
|
|
|
- {
|
|
|
- value: this.$t("studentWeb.exam.queType.multiple"),
|
|
|
- type: 'multiple'
|
|
|
- },
|
|
|
- {
|
|
|
- value: this.$t("studentWeb.exam.queType.judge"),
|
|
|
- type: 'judge'
|
|
|
- },
|
|
|
- {
|
|
|
- value: this.$t("studentWeb.exam.queType.complete"),
|
|
|
- type: 'complete'
|
|
|
- },
|
|
|
- {
|
|
|
- value: this.$t("studentWeb.exam.queType.subjective"),
|
|
|
- type: 'subjective'
|
|
|
- },
|
|
|
- {
|
|
|
- value: this.$t("studentWeb.exam.queType.compose"),
|
|
|
- type: 'compose'
|
|
|
- },
|
|
|
- {
|
|
|
- value: this.$t("studentWeb.exam.queType.correct"),
|
|
|
- type: 'correct'
|
|
|
- },
|
|
|
- {
|
|
|
- value: this.$t("studentWeb.exam.queType.connector"),
|
|
|
- type: 'connector'
|
|
|
- },
|
|
|
- ],
|
|
|
- typeObj: {
|
|
|
- all: this.$t("studentWeb.type.all"),
|
|
|
- complete: this.$t("studentWeb.exam.queType.complete"),
|
|
|
- compose: this.$t("studentWeb.exam.queType.compose"),
|
|
|
- connector: this.$t("studentWeb.exam.queType.connector"),
|
|
|
- correct: this.$t("studentWeb.exam.queType.correct"),
|
|
|
- judge: this.$t("studentWeb.exam.queType.judge"),
|
|
|
- multiple: this.$t("studentWeb.exam.queType.multiple"),
|
|
|
- single: this.$t("studentWeb.exam.queType.single"),
|
|
|
- subjective: this.$t("studentWeb.exam.queType.subjective"),
|
|
|
- },
|
|
|
- diffList: this.$GLOBAL.EXERCISE_DIFFS(), //难度
|
|
|
- levelList: [ //层次
|
|
|
- this.$t("studentWeb.type.all"),
|
|
|
- this.$t("evaluation.level1"),
|
|
|
- this.$t("evaluation.level2"),
|
|
|
- this.$t("evaluation.level3"),
|
|
|
- this.$t("evaluation.level4"),
|
|
|
- this.$t("evaluation.level5"),
|
|
|
- this.$t("evaluation.level6")
|
|
|
- ],
|
|
|
- options: {
|
|
|
- disabledDate (date) {
|
|
|
- return date && date.valueOf() > Date.now() - 86400000;
|
|
|
- }
|
|
|
- },
|
|
|
- topicTotal: 0,
|
|
|
- checkAll: false,
|
|
|
- allPoint: [], //所有知识点
|
|
|
- checkPointArr: [], //选择知识点
|
|
|
- showPoint: [],
|
|
|
- topicRes: [], //初始题
|
|
|
- topicList: [], //所有题
|
|
|
- exerciseList: [], //页面展示的题
|
|
|
- checkTopicArr: [],
|
|
|
- pointShow: false, //知识点弹框
|
|
|
- pointField: "",
|
|
|
- winHeight: false, //判断筛选框是否固定在顶部
|
|
|
- sasInfo: undefined,
|
|
|
- continuationToken: null,
|
|
|
- exerciseTime: [],
|
|
|
- }
|
|
|
- },
|
|
|
- async created () {
|
|
|
- this.MyName = this.$t("studentWeb.type.wrongTopic");
|
|
|
- this.$emit("onNavNo", this.MyNo);
|
|
|
- this.$emit("onNavName", this.MyName);
|
|
|
- this.subjectList = [
|
|
|
- { name: "上学期"},
|
|
|
- { name: "下学期"},
|
|
|
- ]
|
|
|
- this.allPoint = [
|
|
|
- { name: "字音"},
|
|
|
- { name: "字形"},
|
|
|
- { name: "文言文释义"},
|
|
|
- { name: "拟人"}
|
|
|
- ]
|
|
|
- this.sasInfo = await this.getSas()
|
|
|
- // 先获取题目的最近联练习时间
|
|
|
- this.getExceTime()
|
|
|
- },
|
|
|
- mounted () {
|
|
|
- document.addEventListener('scroll', this.handlerScroll, true)
|
|
|
- },
|
|
|
- methods: {
|
|
|
- dateChange(date) {
|
|
|
- console.log(date);
|
|
|
- },
|
|
|
- getSas() {
|
|
|
- return new Promise(async (r, j) => {
|
|
|
- let code = this.courseNow.scope === 'school' ? (this.userInfo.scope === 'student' ? this.userInfo.azp : this.userInfo.sub) : this.courseNow.roster.teacherId
|
|
|
- let sasInfo = await this.$tools.getBlobSas(code)
|
|
|
- r(sasInfo)
|
|
|
- })
|
|
|
- },
|
|
|
- getExceTime() {
|
|
|
- let param = {
|
|
|
- sid: this.userInfo.scope === 'tmduser' ? this.userInfo.sub : `${this.userInfo.azp}-${this.userInfo.sub}`,
|
|
|
- unit_id: this.courseNow.subject.id ? this.courseNow.subject.id : this.courseNow.id, //单元id
|
|
|
- mode: '2', //1:需要复习 2:题目练习时间 3:首页的最近练习时间
|
|
|
- // t: Date.now()
|
|
|
- }
|
|
|
- this.$api.studentWeb.getQuery(param).then(res => {
|
|
|
- if(res.status === 200) {
|
|
|
- if(res.data.length) {
|
|
|
- this.exerciseTime = res.data
|
|
|
- // this.topicTotal = res.data.length
|
|
|
- this.getTopicList()
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 获取题目
|
|
|
- getTopicList() {
|
|
|
- this.isLoading = true
|
|
|
- this.topicList = []
|
|
|
- var queryData = {
|
|
|
- stuId: this.userInfo.sub,
|
|
|
- // code: this.courseNow.school,
|
|
|
- subjectId: this.courseNow.subject.id ? this.courseNow.subject.id : this.courseNow.id,
|
|
|
- count: 1,
|
|
|
- // token: '',
|
|
|
- }
|
|
|
- if(this.userInfo.scope === 'student') {
|
|
|
- queryData.code = this.courseNow.school
|
|
|
- }
|
|
|
- if(this.continuationToken) {
|
|
|
- queryData.token = this.continuationToken
|
|
|
- }
|
|
|
- this.$api.studentWeb.getErrList(queryData).then(async res => {
|
|
|
- // this.topicTotal = res.count
|
|
|
- this.continuationToken = res.token
|
|
|
- if(res.errorItems) {
|
|
|
- // 先将所有题目(以小题为单位)加入到topicList
|
|
|
- res.errorItems.forEach(paper => {
|
|
|
- paper.its.map(item => {
|
|
|
- // 当前题目没有在之前的试卷(包含children)中存在才获取信息
|
|
|
- let needAdd = this.topicRes.some(ex => {
|
|
|
- if(item.pId && ex.id === item.pId && ex.children.length) {
|
|
|
- return ex.children.find(child => {
|
|
|
- return child.id === item.id
|
|
|
- })
|
|
|
- } else {
|
|
|
- return ex.id === item.id
|
|
|
- }
|
|
|
- })
|
|
|
- // 在之前保存的列表中有无相同
|
|
|
- let needTopic = this.topicList.some(tpList => {
|
|
|
- return tpList.id === item.id
|
|
|
- })
|
|
|
- if(!needAdd && !needTopic) {
|
|
|
- let nxtRev = this.exerciseTime.find(etime => {return etime.qId === item.id || etime.id === item.pId})
|
|
|
- if(nxtRev) {
|
|
|
- item.nxtRev = this.dateFormat(nxtRev.nxtRev)
|
|
|
- item.nxtRevUnix = nxtRev.nxtRev
|
|
|
- item.lastTime = nxtRev.startTime ? this.dateFormat(nxtRev.startTime) : '-'
|
|
|
- item.lastTimeUnix = nxtRev.startTime
|
|
|
- } else {
|
|
|
- item.nxtRev = '-'
|
|
|
- item.nxtRevUnix = 0
|
|
|
- item.lastTime = '-'
|
|
|
- item.lastTimeUnix = 0
|
|
|
- }
|
|
|
- item.ts = this.dateFormat(paper.time)
|
|
|
- this.topicList.push(item)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- // 下一步获取题目详细信息,并根据pid将题目集合到一起
|
|
|
- if(this.topicList.length) {
|
|
|
- let data = await this.getAllData()
|
|
|
- data.forEach(item => {
|
|
|
- // 查找有没有重复id
|
|
|
- let needPid = this.topicRes.findIndex(exe => {
|
|
|
- return exe.id === item.id
|
|
|
- })
|
|
|
- if(needPid === -1) {
|
|
|
- this.topicRes.push(item)
|
|
|
- } else {
|
|
|
- this.topicRes[needPid].children.push(item.children[0])
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- // 第一次要求已有题目超过10道,后续加载需要有新的题目
|
|
|
- if((this.topicRes.length < 10 || !this.topicList.length) && res.token) {
|
|
|
- this.getTopicList()
|
|
|
- } else {
|
|
|
- this.filterChange()
|
|
|
- this.isLoading = false
|
|
|
- }
|
|
|
- }).catch((e) => {
|
|
|
- })
|
|
|
- },
|
|
|
- getAllData() {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- let promiseArr = []
|
|
|
- this.topicList.forEach((item, index) => {
|
|
|
- promiseArr.push(new Promise(async (r, j) => {
|
|
|
- try {
|
|
|
- let info = undefined
|
|
|
- let codes = this.courseNow.scope === 'private' ? this.courseNow.roster.teacherId : this.courseNow.school
|
|
|
- let fullPath = `${this.sasInfo.url}/${codes}${item.blob}/${item.id}.json?${this.sasInfo.sas}`
|
|
|
- let jsonData = JSON.parse(await this.$tools.getFile(fullPath))
|
|
|
- let paper = {
|
|
|
- blob: item.blob,
|
|
|
- code: codes,
|
|
|
- examId: codes,
|
|
|
- scope: this.courseNow.scope,
|
|
|
- }
|
|
|
- // 调整渲染试题数据结构
|
|
|
- jsonData.exercise.question = jsonData.item[0].question
|
|
|
- jsonData.exercise.option = jsonData.item[0].option
|
|
|
- jsonData.exercise.parentInfo = undefined
|
|
|
- jsonData.exercise.pid = jsonData.pid
|
|
|
- jsonData.exercise.id = jsonData.id
|
|
|
- jsonData.exercise.children = []
|
|
|
- jsonData.exercise.star = 0 //后续与 /api/qsquery 匹配是否收藏
|
|
|
- jsonData.exercise.open = false
|
|
|
- jsonData.exercise.joinTime = item.ts
|
|
|
- jsonData.exercise.nxtRev = item.nxtRev
|
|
|
- jsonData.exercise.nxtRevUnix = item.nxtRevUnix
|
|
|
- jsonData.exercise.lastTime = item.lastTime
|
|
|
- jsonData.exercise.lastTimeUnix = item.lastTimeUnix
|
|
|
- jsonData.exercise = await this.$evTools.doAddHost(jsonData.exercise, paper)
|
|
|
- if(jsonData.pid) {
|
|
|
- let pPath = `${this.sasInfo.url}/${codes}${item.blob}/${jsonData.pid}.json?${this.sasInfo.sas}`
|
|
|
- let pData = JSON.parse(await this.$tools.getFile(pPath))
|
|
|
- pData.exercise.question = pData.item[0].question
|
|
|
- pData.exercise.option = pData.item[0].option
|
|
|
- pData.exercise.id = pData.id
|
|
|
- pData.exercise.parentInfo = undefined
|
|
|
- pData.exercise.pid = null
|
|
|
- pData.exercise.children = [jsonData.exercise]
|
|
|
- pData.exercise.star = 0
|
|
|
- pData.exercise.open = false
|
|
|
- pData.exercise.joinTime = item.ts
|
|
|
- pData.exercise.nxtRev = item.nxtRev
|
|
|
- pData.exercise.nxtRevUnix = item.nxtRevUnix
|
|
|
- pData.exercise.lastTime = item.lastTime
|
|
|
- pData.exercise.lastTimeUnix = item.lastTimeUnix
|
|
|
- pData.exercise = await this.$evTools.doAddHost(pData.exercise, paper)
|
|
|
- info = pData.exercise
|
|
|
- } else {
|
|
|
- info = jsonData.exercise
|
|
|
- }
|
|
|
- r(info)
|
|
|
- } catch (e) {
|
|
|
- j(e)
|
|
|
- }
|
|
|
- }))
|
|
|
- })
|
|
|
- Promise.allSettled(promiseArr).then(result => {
|
|
|
- if (result.length) {
|
|
|
- // resolve(result)
|
|
|
- resolve(result.filter(i => i.status === 'fulfilled').map(j => j.value))
|
|
|
- } else {
|
|
|
- resolve([])
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- handleReachTop () {
|
|
|
- return new Promise(resolve => {
|
|
|
- setTimeout(() => {
|
|
|
- if(this.continuationToken) {
|
|
|
- this.getTopicList()
|
|
|
- // this.getRecordList()
|
|
|
- } else {
|
|
|
- this.$Message.warning("没有更多数据")
|
|
|
- }
|
|
|
- resolve()
|
|
|
- }, 2000);
|
|
|
- });
|
|
|
- },
|
|
|
- //时间格式化处理
|
|
|
- dateFormat(timestamp) {
|
|
|
- var date = new Date(timestamp)
|
|
|
- var Y = date.getFullYear() + '-'
|
|
|
- var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
|
|
|
- var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '
|
|
|
- var H = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ":"
|
|
|
- var Min = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes())
|
|
|
- var S = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()) + " "
|
|
|
- return Y + M + D;
|
|
|
- },
|
|
|
-
|
|
|
- // 控制收缩试卷的按钮
|
|
|
- closeDetail(index) {
|
|
|
- this.exerciseList[index].open = !this.exerciseList[index].open
|
|
|
- },
|
|
|
- okPoint() {
|
|
|
- this.showPoint = []
|
|
|
- this.checkPointArr.forEach(item => {
|
|
|
- this.showPoint.push(this.allPoint[item])
|
|
|
- })
|
|
|
- // 重新获取题目
|
|
|
- },
|
|
|
- removePoint(index) {
|
|
|
- this.showPoint.splice(index, 1)
|
|
|
- // 重新获取题目
|
|
|
- },
|
|
|
- filterChange() {
|
|
|
- this.isLoading = true
|
|
|
- this.exerciseList = []
|
|
|
- if(this.filtType === 'all' && this.filtCollect === -1 && this.subTitle === '') {
|
|
|
- this.exerciseList = this.topicRes
|
|
|
- }
|
|
|
- this.topicRes.map(ques => {
|
|
|
- let needQue = undefined
|
|
|
- let eligible = 0
|
|
|
- let eligibleType = 0
|
|
|
- // 题型
|
|
|
- if(this.filtType != 'all') {
|
|
|
- eligibleType ++
|
|
|
- if(ques.type === this.filtType) {
|
|
|
- needQue = ques
|
|
|
- eligible ++
|
|
|
- }
|
|
|
- }
|
|
|
- // 收藏
|
|
|
- if(this.filtCollect != -1) {
|
|
|
- eligibleType ++
|
|
|
- if(needQue) {
|
|
|
- eligible = needQue.star === this.filtCollect ? eligible + 1 : eligible
|
|
|
- } else if(ques.star === this.filtCollect) {
|
|
|
- eligible ++
|
|
|
- }
|
|
|
- }
|
|
|
- // 题目
|
|
|
- if(this.subTitle != '') {
|
|
|
- eligibleType ++
|
|
|
- if(needQue) {
|
|
|
- eligible = needQue.question.indexOf(this.subTitle) > -1 ? eligible + 1 : eligible
|
|
|
- } else if(ques.question.indexOf(this.subTitle) > -1) {
|
|
|
- eligible ++
|
|
|
- }
|
|
|
- }
|
|
|
- // 当前对象符合条件 && 符合几个条件 == 共有几个条件
|
|
|
- if(needQue && eligible === eligibleType) {
|
|
|
- this.exerciseList.push(needQue)
|
|
|
- }
|
|
|
- })
|
|
|
- this.exerciseList = this.exerciseList.sort((a, b) => {
|
|
|
- return this.filtTime ?
|
|
|
- (this.sortOrder ? (a.lastTimeUnix - b.lastTimeUnix) : (b.lastTimeUnix - a.lastTimeUnix))
|
|
|
- : (this.sortOrder ? (a.createTime - b.createTime) : (b.createTime - a.createTime))
|
|
|
- })
|
|
|
- this.topicTotal = this.exerciseList.length
|
|
|
- this.isLoading = false
|
|
|
- },
|
|
|
- // 收藏题目
|
|
|
- onCollection(index) {
|
|
|
- this.exerciseList[index].star = !this.exerciseList[index].star
|
|
|
- },
|
|
|
- handlerScroll(e) {
|
|
|
- const scrollHeight = document.getElementsByClassName("ivu-scroll-container")[0].scrollTop
|
|
|
- const filterHeight = document.getElementsByClassName("filter-type")[0].offsetHeight
|
|
|
- this.winHeight = (filterHeight - scrollHeight) < 95
|
|
|
- },
|
|
|
- },
|
|
|
- computed: {
|
|
|
- checkNum() {
|
|
|
- var num = 0
|
|
|
- if(this.topicList.length) {
|
|
|
- num = this.checkTopicArr.length
|
|
|
- }
|
|
|
- return num
|
|
|
- },
|
|
|
- ...mapGetters(['getNowCourse']),
|
|
|
- ...mapState({
|
|
|
- userInfo: state => state.userInfo
|
|
|
- }),
|
|
|
- courseNow() {
|
|
|
- return this.getNowCourse || JSON.parse(decodeURIComponent(localStorage.course, "utf-8"))
|
|
|
- },
|
|
|
- },
|
|
|
- watch: {
|
|
|
- checkAll: {
|
|
|
- handler(n, o) {
|
|
|
- if(this.topicList.length) {
|
|
|
- if(n) {
|
|
|
- this.checkTopicArr = []
|
|
|
- this.topicList.forEach((item, index) => {
|
|
|
- this.checkTopicArr.push(index)
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.checkTopicArr = []
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
- beforeDestroy () {
|
|
|
- document.removeEventListener('scroll', this.handlerScroll, true)
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="less" scoped>
|
|
|
-@import "./QuesList copy.less";
|
|
|
-</style>
|
|
|
-
|
|
|
-<style lang="less">
|
|
|
-@import "./iViewStyle.less";
|
|
|
-.list-scroll {
|
|
|
-
|
|
|
- .ivu-scroll-container {
|
|
|
- width: 100%;
|
|
|
- height: 100% !important;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|