XW před 1 rokem
rodič
revize
25ca2ee776

+ 0 - 223
TEAMModelOS/ClientApp/src/components/student-web/WrongQusetion/QuesList copy.less

@@ -1,223 +0,0 @@
-@import '~@/assets/student-web/component_styles/color.less';
-
-.wrong-ques {
-    width: 100%;
-    height: 100%;
-    overflow: hidden;
-    // position: relative;
-    display: flex;
-
-    .title-box {
-        width: 100%;
-        height: 45px;
-        background-color: #FFFFFF;
-        position: absolute;
-        top: 0;
-        left: 0;
-        z-index: 6;
-        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
-        color: #24b880;
-        font-size: 20px;
-        padding: 5px 15px;
-
-        .logout-icon {
-            cursor: pointer;
-        }
-
-        .test-title {
-            margin-left: 10px;
-            font-weight: bold;
-        }
-    }
-
-    .filter-type {
-        width: 45%;
-        padding: 25px 0;
-        padding-left: 30px;
-
-        .ivu-icon {
-            display: none;
-        }
-
-        &>div {
-            margin-bottom: 12px;
-
-            &:last-child {
-                margin-bottom: 0;
-                // margin-top: 10px;
-            }
-        }
-
-        .type-name {
-            margin-right: 10px;
-            font-weight: bold;
-        }
-
-        .point-box {
-            border: 1px solid #24B880;
-            background-color: @primary;
-            color: #fff;
-            padding: 3px 5px;
-            border-radius: 5px;
-            margin-right: 10px;
-            display: inline-block;
-
-            .ivu-icon {
-                cursor: pointer;
-                margin-left: 5px;
-            }
-        }
-
-        .ivu-icon-md-add-circle {
-            // font-weight: bold;
-            cursor: pointer;
-        }
-
-        .have-total {
-            display: inline-block;
-            // float: right;
-
-            &>span {
-                font-size: 18px;
-                font-weight: bold;
-                color: #de0000;
-                margin: 0 5px;
-            }
-        }
-
-        .filter-radio {
-            display: flex;
-            align-items: center;
-
-            &>span {
-                min-width: 45px;
-            }
-        }
-    }
-
-    .hide-filter {
-        position: absolute;
-        top: 0;
-        left: 0;
-        z-index: 4;
-        background: #fff;
-
-        .ivu-icon {
-            display: block;
-            font-size: 30px;
-            position: absolute;
-            bottom: -34px;
-            left: 50%;
-            transform: translate(-50%, -50%);
-            cursor: pointer;
-        }
-
-        .ivu-icon-md-arrow-dropup {
-            bottom: -27px;
-        }
-    }
-
-    .topic-list {
-        width: 100%;
-        // height: calc(100% - 260px);
-        height: 100%;
-        padding: 25px;
-        padding-bottom: 20px;
-
-        &>div:first-child {
-            // border-bottom: 1px solid #e0e0e0;
-            padding: 10px 1%;
-        }
-
-        .start-btn-primary {
-            border: 1px solid #ccc;
-            margin-left: 30px;
-            padding: 3px 5px;
-            border-radius: 5px;
-            cursor: pointer;
-        }
-
-        .start-btn {
-            border-color: @primary;
-            background-color: @primary;
-            color: #fff;
-        }
-
-        .ivu-checkbox-group-item {
-            display: flex;
-            margin-right: 0;
-
-            &>div {}
-        }
-
-        .topic-box {
-            // border-bottom: 1px solid #e0e0e0;
-            margin-bottom: 10px;
-            padding: 10px 1%;
-            display: flex;
-
-            &>div:first-child {
-                width: 5%;
-                margin-top: 2px;
-            }
-
-            .topic-type {
-                border-top: 1px dashed #ccc;
-                padding-top: 5px;
-                margin-top: 15px;
-                display: flex;
-                justify-content: space-between;
-
-                &>span {
-                    // margin-right: 8%;
-
-                    // vertical-align: sub;
-                    color: #868686;
-                    // border-right: 2px solid #d2d2d2;
-                    font-size: 12px;
-                    padding: 0 15px;
-
-                    &:first-child {
-                        padding-left: 0;
-                    }
-
-                    &:last-child {
-                        border: none;
-                    }
-                }
-            }
-
-            .answer-area {
-                display: flex;
-                // font-size: 17px;
-                margin-top: 10px;
-
-
-                .answer-tip {
-                    color: #68A129;
-                    margin-right: 10px;
-                    min-width: 60px;
-                }
-            }
-
-            .question {
-                width: calc(96% - 40px);
-                display: inline-block;
-
-            }
-        }
-
-        .emptycondition {
-            padding-top: 10%;
-            text-align: center;
-            font-weight: bolder;
-            color: gray;
-        }
-
-    }
-
-    .list-scroll {
-        width: 100%;
-        height: ~"calc(100% - 50px)";
-    }
-}

+ 0 - 600
TEAMModelOS/ClientApp/src/components/student-web/WrongQusetion/QuesList copy.vue

@@ -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>

+ 20 - 5
TEAMModelOS/ClientApp/src/components/student-web/WrongQusetion/QuesList.less

@@ -5,6 +5,7 @@
     height: 100%;
     overflow: hidden;
     // position: relative;
+    display: flex;
 
     .title-box {
         width: 100%;
@@ -30,10 +31,9 @@
     }
 
     .filter-type {
-        padding: 25px 30px;
-        // padding-bottom: 20px;
-        border-bottom: 1px dashed #ccc;
-        width: 100%;
+        width: 45%;
+        padding: 25px 0;
+        padding-left: 30px;
 
         .ivu-icon {
             display: none;
@@ -75,7 +75,7 @@
 
         .have-total {
             display: inline-block;
-            float: right;
+            // float: right;
 
             &>span {
                 font-size: 18px;
@@ -84,6 +84,15 @@
                 margin: 0 5px;
             }
         }
+
+        .filter-radio {
+            display: flex;
+            align-items: center;
+
+            &>span {
+                min-width: 45px;
+            }
+        }
     }
 
     .hide-filter {
@@ -145,6 +154,12 @@
             // border-bottom: 1px solid #e0e0e0;
             margin-bottom: 10px;
             padding: 10px 1%;
+            display: flex;
+
+            &>div:first-child {
+                width: 5%;
+                margin-top: 2px;
+            }
 
             .topic-type {
                 border-top: 1px dashed #ccc;

+ 197 - 153
TEAMModelOS/ClientApp/src/components/student-web/WrongQusetion/QuesList.vue

@@ -1,80 +1,64 @@
 <template>
     <div class="wrong-ques student-check">
         <Loading v-show="isLoading" bgColor="rgba(0, 0, 0, 0.3)"></Loading>
-        <Scroll class="list-scroll" :on-reach-bottom="handleReachTop">
-            <div :class="['filter-type', {'hide-filter': winHeight,}]">
-                <template v-if="!winHeight || isOpen">
-                    <div>
-                        <span class="type-name">{{ $t('syllabus.semester') }}:</span>
-                        <RadioGroup v-model="filtSubject" type="button" button-style="solid" @on-change="subjChange">
-                            <Radio v-for="(item, index) in subjectList" :key="index" :label="index">{{ item.name }}</Radio>
-                        </RadioGroup>
-                    </div>
-                    <div>
-                        <span class="type-name">{{ $t('studentWeb.wrongTopic.type') }}:</span>
-                        <RadioGroup v-model="filtType" type="button" button-style="solid" @on-change="typeChange">
-                            <Radio v-for="(item, index) in typeList" :key="index" :label="index">{{ item }}</Radio>
-                        </RadioGroup>
-                    </div>
-                    <!-- <div>
-                        <span class="type-name">{{ $t('studentWeb.wrongTopic.diff') }}:</span>
-                        <RadioGroup v-model="filtDiff" type="button" button-style="solid" @on-change="diffChange">
-                            <Radio :label="0">{{ $t("studentWeb.type.all") }}</Radio>
-                            <Radio v-for="(item, index) in diffList" :key="index + 1" :label="index + 1">{{ item }}</Radio>
-                        </RadioGroup>
-                    </div>
-                    <div>
-                        <span class="type-name">{{ $t('studentWeb.wrongTopic.level') }}:</span>
-                        <RadioGroup v-model="filtLevel" type="button" button-style="solid" @on-change="levelChange">
-                            <Radio v-for="(item, index) in levelList" :key="index" :label="index">{{ item }}</Radio>
-                        </RadioGroup>
-                    </div> -->
-                    <div>
-                        <span class="type-name">{{ $t("syllabus.save") }}:</span>
-                        <RadioGroup v-model="filtLevel" type="button" button-style="solid" @on-change="levelChange">
-                            <Radio :label="0">{{ $t('schoolBaseInfo.all') }}</Radio>
-                            <Radio :label="1">{{ $t('studentWeb.wrongQues.collect') }}</Radio>
-                            <Radio :label="2">{{ $t('studentWeb.wrongQues.notCollected') }}</Radio>
-                        </RadioGroup>
-                    </div>
-                    <div>
-                        <span class="type-name">{{ $t("evaluation.filter.sort") }}:</span>
-                        <Select v-model="filtLevel" style="width:250px">
-                            <Option :value="0">{{ $t('studentWeb.wrongQues.wrongTime') }}</Option>
-                            <Option :value="1">{{ $t('studentWeb.wrongQues.practiceTime') }}</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> -->
-                </template>
-                <div class="search">
-                    <Input v-model="subTitle" :placeholder="$t('studentWeb.wrongTopic.search')" style="width: 302px" class="light-iview-input"
-                            @on-change="searchChange" clearable />
-                    <!-- <DatePicker type="date" :placeholder="$t('studentWeb.wrongTopic.date')" :options="options" @on-change="dateChange"
-                                style="width: 200px" class="light-iview-input"
-                    /> -->
-                    <span class="have-total">
-                        {{ $t('studentWeb.wrongTopic.word1') }}
-                        <span>{{ topicTotal }}</span>
-                        {{ $t('studentWeb.wrongTopic.topic') }}
+        <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>
-                </div>
-                <Icon type="md-arrow-dropdown" @click="isOpen = !isOpen" v-show="!isOpen" />
-                <Icon type="md-arrow-dropup" @click="isOpen = !isOpen" v-show="isOpen" />
+                </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)">
@@ -84,7 +68,6 @@
                                     <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; margin-top: 1px;" class="tag-style">{{ $t(`studentWeb.exam.queType.${item.type}`) }}</span>
                             <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>
@@ -98,7 +81,7 @@
                                     </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">
+                                    <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;">
@@ -127,13 +110,13 @@
                             </div>
                             <div class="topic-type">
                                 <span>
-                                    {{ $t('studentWeb.wrongQues.nextTime') }}:{{ item.nxtRev }}
+                                    {{ $t('studentWeb.wrongQues.joinTime') }}:{{ item.joinTime }}
                                 </span>
                                 <span>
                                     {{ $t('studentWeb.wrongQues.lately') }}:{{ item.lastTime }}
                                 </span>
                                 <span>
-                                    {{ $t('studentWeb.wrongQues.joinTime') }}:{{ item.joinTime }}
+                                    {{ $t('studentWeb.wrongQues.nextTime') }}:{{ item.nxtRev }}
                                 </span>
                             </div>
                         </div>
@@ -176,20 +159,51 @@ export default {
             isLoading: false,
             animal: "",
             filtSubject: 0,
-            filtType: 0,
+            filtType: 'all',
+            filtCollect: -1, //是否收藏
+            subTitle: "", //搜索字
+            filtTime: 0, //时间排序
+            sortOrder: 0, //倒序还是正序
             filtDiff: 0,
             filtLevel: 0,
             subjectList: [], //学科
             typeList: [ //题型
-                this.$t("studentWeb.type.all"),
-                this.$t("studentWeb.exam.queType.single"),
-                this.$t("studentWeb.exam.queType.multiple"),
-                this.$t("studentWeb.exam.queType.judge"),
-                this.$t("studentWeb.exam.queType.complete"),
-                this.$t("studentWeb.exam.queType.subjective"),
-                this.$t("studentWeb.exam.queType.compose"),
-                this.$t("studentWeb.exam.queType.correct"),
-                this.$t("studentWeb.exam.queType.connector")
+                {
+                    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"),
@@ -212,7 +226,6 @@ export default {
                 this.$t("evaluation.level5"),
                 this.$t("evaluation.level6")
             ],
-            subTitle: "",
             options: {
                 disabledDate (date) {
                     return date && date.valueOf() > Date.now() - 86400000;
@@ -229,7 +242,6 @@ export default {
             checkTopicArr: [],
             pointShow: false, //知识点弹框
             pointField: "",
-            isOpen: false, //控制固定筛选框是否收起
             winHeight: false, //判断筛选框是否固定在顶部
             sasInfo: undefined,
             continuationToken: null,
@@ -255,7 +267,7 @@ export default {
         this.getExceTime()
     },
     mounted () {
-        window.addEventListener('scroll', this.handlerScroll, true)
+        document.addEventListener('scroll', this.handlerScroll, true)
     },
     methods: {
         dateChange(date) {
@@ -279,6 +291,7 @@ export default {
                 if(res.status === 200) {
                     if(res.data.length) {
                         this.exerciseTime = res.data
+                        // this.topicTotal = res.data.length
                         this.getTopicList()
                     }
                 }
@@ -301,42 +314,75 @@ export default {
             if(this.continuationToken) {
                 queryData.token = this.continuationToken
             }
-            this.$api.studentWeb.getErrList(queryData).then(res => {
-                this.topicTotal = res.count
+            this.$api.studentWeb.getErrList(queryData).then(async res => {
+                // this.topicTotal = res.count
                 this.continuationToken = res.token
                 if(res.errorItems) {
-                    this.isLoading = false
+                    // 先将所有题目(以小题为单位)加入到topicList
                     res.errorItems.forEach(paper => {
                         paper.its.map(item => {
-                            // 当前题目没有在之前的试卷中存在才获取信息
-                            let hasEx = this.exerciseList.find(ex => {
-                                return ex.id === item.id
+                            // 当前题目没有在之前的试卷(包含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
+                                }
                             })
-                            if(!hasEx) {
-                                let nxtRev = this.exerciseTime.find(etime => {return etime.qId === 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) {
-                        this.getJson()
+                        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 => {
+                this.topicList.forEach((item, index) => {
                     promiseArr.push(new Promise(async (r, j) => {
                         try {
                             let info = undefined
@@ -356,11 +402,13 @@ export default {
                             jsonData.exercise.pid = jsonData.pid
                             jsonData.exercise.id = jsonData.id
                             jsonData.exercise.children = []
-                            jsonData.exercise.star = false
+                            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}`
@@ -371,11 +419,13 @@ export default {
                                 pData.exercise.parentInfo = undefined
                                 pData.exercise.pid = null
                                 pData.exercise.children = [jsonData.exercise]
-                                pData.exercise.star = false
+                                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 {
@@ -397,21 +447,6 @@ export default {
                 })
             })
         },
-        async getJson() {
-            let data = await this.getAllData()
-            console.log(data);
-            data.forEach(item => {
-                // 查找有没有重复id
-                let needPid = this.exerciseList.findIndex(exe => {
-                    return exe.id === item.id
-                })
-                if(needPid === -1) {
-                    this.exerciseList.push(item)
-                } else {
-                    this.exerciseList[needPid].children.push(item.children[0])
-                }
-            })
-        },
         handleReachTop () {
             return new Promise(resolve => {
                 setTimeout(() => {
@@ -427,7 +462,6 @@ export default {
         },
         //时间格式化处理
         dateFormat(timestamp) {
-            console.log(timestamp);
             var date = new Date(timestamp)
             var Y = date.getFullYear() + '-'
             var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
@@ -453,40 +487,54 @@ export default {
             this.showPoint.splice(index, 1)
             // 重新获取题目
         },
-        // 选择学科
-        subjChange(val) {
-            console.log(val);
-            // 选择学科后要重新获取题目
-        },
-        // 选择题型
-        typeChange(val) {
-            console.log(val);
-            // 一样重新获取题目
-        },
-        // 选择难度
-        diffChange(val) {
-            console.log(val);
-            // 一样重新获取题目
-        },
-        // 选择层次
-        levelChange(val) {
-            console.log(val);
-            // 一样重新获取题目
-        },
-        // 搜索词
-        searchChange() {
-            let val = this.subTitle
-            console.log(val);
-            this.topicList = this.topicRes.filter(i => i.question.indexOf(val) > -1)
-            this.topicTotal = this.topicList.length
-        },
-        startPra() {
-            // this.$router.push({
-            //     name: "eventView/evaluation",
-                /* params: {
-                    papers: this.paperInfo
-                } */
-            // })
+        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) {
@@ -497,10 +545,6 @@ export default {
             const filterHeight = document.getElementsByClassName("filter-type")[0].offsetHeight
             this.winHeight = (filterHeight - scrollHeight) < 95
         },
-        //退出测试
-        quitTest() {
-            this.$router.go(-1)
-        },
     },
     computed: {
         checkNum() {
@@ -534,8 +578,8 @@ export default {
             }
         },
     },
-    destroyed () {
-        document.removeEventListener('scroll', this.handlerScroll)
+    beforeDestroy () {
+        document.removeEventListener('scroll', this.handlerScroll, true)
     }
 }
 </script>