|  | @@ -1,78 +1,15 @@
 | 
											
												
													
														|  |  <template>
 |  |  <template>
 | 
											
												
													
														|  |    <div>
 |  |    <div>
 | 
											
												
													
														|  | -    <mx-condition ref="condition" :query-params="queryParams" :require-fields="requireFields" @query="handleQuery"
 |  | 
 | 
											
												
													
														|  | -                  @invalid="handleInvalidQuery"
 |  | 
 | 
											
												
													
														|  | -    ></mx-condition>
 |  | 
 | 
											
												
													
														|  | 
 |  | +    <mx-condition ref="condition" :query-params="queryParams" :require-fields="requireFields" @query="handleQuery"/>
 | 
											
												
													
														|  |      <!-- 试题收藏 -->
 |  |      <!-- 试题收藏 -->
 | 
											
												
													
														|  |      <div class="mt20">
 |  |      <div class="mt20">
 | 
											
												
													
														|  |        <div class="topic" v-show="queryParams.favCollectType == 'question'">
 |  |        <div class="topic" v-show="queryParams.favCollectType == 'question'">
 | 
											
												
													
														|  |          <!-- 题目 -->
 |  |          <!-- 题目 -->
 | 
											
												
													
														|  | -        <div class="paper_questions" id="collect-question">
 |  | 
 | 
											
												
													
														|  | -          <div
 |  | 
 | 
											
												
													
														|  | -            class="que_item"
 |  | 
 | 
											
												
													
														|  | -            v-for="(item, index) in collectQue"
 |  | 
 | 
											
												
													
														|  | -            :key="item.id"
 |  | 
 | 
											
												
													
														|  | -          >
 |  | 
 | 
											
												
													
														|  | -            <div class="que_content" style="display: flex">
 |  | 
 | 
											
												
													
														|  | -              <div>{{ index + 1 }}.</div>
 |  | 
 | 
											
												
													
														|  | -              <div v-html="item.title"></div>
 |  | 
 | 
											
												
													
														|  | -            </div>
 |  | 
 | 
											
												
													
														|  | -            <div class="option" v-if="item.optionA">
 |  | 
 | 
											
												
													
														|  | -              <div style="margin-right: 5px">A:</div>
 |  | 
 | 
											
												
													
														|  | -              <div v-html="item.optionA"></div>
 |  | 
 | 
											
												
													
														|  | -            </div>
 |  | 
 | 
											
												
													
														|  | -            <div class="option" v-if="item.optionB">
 |  | 
 | 
											
												
													
														|  | -              <div style="margin-right: 5px">B:</div>
 |  | 
 | 
											
												
													
														|  | -              <div v-html="item.optionB"></div>
 |  | 
 | 
											
												
													
														|  | -            </div>
 |  | 
 | 
											
												
													
														|  | -            <div class="option" v-if="item.optionC">
 |  | 
 | 
											
												
													
														|  | -              C:
 |  | 
 | 
											
												
													
														|  | -              <div v-html="item.optionC"></div>
 |  | 
 | 
											
												
													
														|  | -            </div>
 |  | 
 | 
											
												
													
														|  | -            <div class="option" v-if="item.optionD">
 |  | 
 | 
											
												
													
														|  | -              <div style="margin-right: 5px">D:</div>
 |  | 
 | 
											
												
													
														|  | -              <div v-html="item.optionD"></div>
 |  | 
 | 
											
												
													
														|  | -            </div>
 |  | 
 | 
											
												
													
														|  | -            <div class="que_footer">
 |  | 
 | 
											
												
													
														|  | -              <div class="spans">
 |  | 
 | 
											
												
													
														|  | -                <span class="id">ID: {{ item.id }}</span>
 |  | 
 | 
											
												
													
														|  | -                <span>题型: {{ item.qtpye }}</span>
 |  | 
 | 
											
												
													
														|  | -                <span>难度: 一般</span>
 |  | 
 | 
											
												
													
														|  | -              </div>
 |  | 
 | 
											
												
													
														|  | -              <div class="operation">
 |  | 
 | 
											
												
													
														|  | -                <div class="shoucan">
 |  | 
 | 
											
												
													
														|  | -                  <div
 |  | 
 | 
											
												
													
														|  | -                    v-show="item.collect"
 |  | 
 | 
											
												
													
														|  | -                    @click="toCancelCollectQue(item)"
 |  | 
 | 
											
												
													
														|  | -                    style="display: flex; align-items: center"
 |  | 
 | 
											
												
													
														|  | -                  >
 |  | 
 | 
											
												
													
														|  | -                    <img
 |  | 
 | 
											
												
													
														|  | -                      src="@/assets/images/icon_shoucang_s.png"
 |  | 
 | 
											
												
													
														|  | -                      style="margin-right: 8px"
 |  | 
 | 
											
												
													
														|  | -                    />
 |  | 
 | 
											
												
													
														|  | -                    <span>已收藏</span>
 |  | 
 | 
											
												
													
														|  | -                  </div>
 |  | 
 | 
											
												
													
														|  | -                  <div
 |  | 
 | 
											
												
													
														|  | -                    v-show="!item.collect"
 |  | 
 | 
											
												
													
														|  | -                    @click="toCollectQue(item)"
 |  | 
 | 
											
												
													
														|  | -                    style="display: flex; align-items: center"
 |  | 
 | 
											
												
													
														|  | -                  >
 |  | 
 | 
											
												
													
														|  | -                    <img
 |  | 
 | 
											
												
													
														|  | -                      src="@/assets/images/icon_shoucang_n.png"
 |  | 
 | 
											
												
													
														|  | -                      style="margin-right: 8px"
 |  | 
 | 
											
												
													
														|  | -                    />
 |  | 
 | 
											
												
													
														|  | -                    <span>收藏</span>
 |  | 
 | 
											
												
													
														|  | -                  </div>
 |  | 
 | 
											
												
													
														|  | -                </div>
 |  | 
 | 
											
												
													
														|  | -                <div class="detail" @click="viewDetail(item)">
 |  | 
 | 
											
												
													
														|  | -                  <img src="@/assets/images/icon_chakan.png" alt=""/>
 |  | 
 | 
											
												
													
														|  | -                  <span>查看解析>></span>
 |  | 
 | 
											
												
													
														|  | -                </div>
 |  | 
 | 
											
												
													
														|  | -              </div>
 |  | 
 | 
											
												
													
														|  | -            </div>
 |  | 
 | 
											
												
													
														|  | -            <div class="pd20" v-show="item.expand" v-html="'【解答】'+item.answer2"></div>
 |  | 
 | 
											
												
													
														|  | -            <div class="pd20" v-show="item.expand" v-html="'【解析】'+item.parse"></div>
 |  | 
 | 
											
												
													
														|  | -          </div>
 |  | 
 | 
											
												
													
														|  | 
 |  | +        <div class="fx-column gap10" id="collect-question">
 | 
											
												
													
														|  | 
 |  | +          <mx-question-readonly v-for="(q, i) in collectQue" :key="i" :question="q"
 | 
											
												
													
														|  | 
 |  | +                                :seq="(pageForm.pageNum-1)*pageForm.pageSize+i+1"
 | 
											
												
													
														|  | 
 |  | +                                @correct="$refs.correct.open(q.id)"/>
 | 
											
												
													
														|  | 
 |  | +          <el-empty v-if="!loading && !collectQue.length" />
 | 
											
												
													
														|  |          </div>
 |  |          </div>
 | 
											
												
													
														|  |        </div>
 |  |        </div>
 | 
											
												
													
														|  |        <!-- 试卷收藏 -->
 |  |        <!-- 试卷收藏 -->
 | 
											
										
											
												
													
														|  | @@ -119,16 +56,21 @@
 | 
											
												
													
														|  |        @pagination="onChangePage"
 |  |        @pagination="onChangePage"
 | 
											
												
													
														|  |      />
 |  |      />
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +    <correct-question-dialog ref="correct"/>
 | 
											
												
													
														|  |    </div>
 |  |    </div>
 | 
											
												
													
														|  |  </template>
 |  |  </template>
 | 
											
												
													
														|  |  <script>
 |  |  <script>
 | 
											
												
													
														|  |  import MxCondition from '@/components/MxCondition/mx-condition'
 |  |  import MxCondition from '@/components/MxCondition/mx-condition'
 | 
											
												
													
														|  | -import { favPapers, favQuestions, favQueTypes, favSubjects } from '@/api/webApi/webQue.js'
 |  | 
 | 
											
												
													
														|  | 
 |  | +import {favPapers, favQuestions, favSubjects} from '@/api/webApi/webQue.js'
 | 
											
												
													
														|  |  import PaperActionsMixin from "@/views/questioncenter/components/paper-actions-mixin";
 |  |  import PaperActionsMixin from "@/views/questioncenter/components/paper-actions-mixin";
 | 
											
												
													
														|  | 
 |  | +import MxQuestionReadonly from "@/components/MxQuestionReadonly/MxQuestionReadonly.vue";
 | 
											
												
													
														|  | 
 |  | +import CorrectQuestionDialog from "@/components/MxPaper/plus/correct-question-dialog.vue";
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  export default {
 |  |  export default {
 | 
											
												
													
														|  |    mixins: [PaperActionsMixin],
 |  |    mixins: [PaperActionsMixin],
 | 
											
												
													
														|  |    components: {
 |  |    components: {
 | 
											
												
													
														|  | 
 |  | +    CorrectQuestionDialog,
 | 
											
												
													
														|  | 
 |  | +    MxQuestionReadonly,
 | 
											
												
													
														|  |      MxCondition,
 |  |      MxCondition,
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |    created() {
 |  |    created() {
 | 
											
										
											
												
													
														|  | @@ -136,25 +78,26 @@ export default {
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |    data() {
 |  |    data() {
 | 
											
												
													
														|  |      return {
 |  |      return {
 | 
											
												
													
														|  | 
 |  | +      loading: false,
 | 
											
												
													
														|  |        form: {
 |  |        form: {
 | 
											
												
													
														|  |          type: 'question',
 |  |          type: 'question',
 | 
											
												
													
														|  |          subjectName: '',
 |  |          subjectName: '',
 | 
											
												
													
														|  |          wrongType: ''
 |  |          wrongType: ''
 | 
											
												
													
														|  |        },
 |  |        },
 | 
											
												
													
														|  | -      queryParams:{
 |  | 
 | 
											
												
													
														|  | -        favCollectType:'',
 |  | 
 | 
											
												
													
														|  | -        favSubject:'',
 |  | 
 | 
											
												
													
														|  | -        favQueType:''
 |  | 
 | 
											
												
													
														|  | 
 |  | +      queryParams: {
 | 
											
												
													
														|  | 
 |  | +        favCollectType: '',
 | 
											
												
													
														|  | 
 |  | +        favSubject: '',
 | 
											
												
													
														|  | 
 |  | +        favQueType: ''
 | 
											
												
													
														|  |        },
 |  |        },
 | 
											
												
													
														|  | -      requireFields:['favCollectType','favSubject','favQueType'],
 |  | 
 | 
											
												
													
														|  | 
 |  | +      requireFields: ['favCollectType', 'favSubject', 'favQueType'],
 | 
											
												
													
														|  |        pageForm: {
 |  |        pageForm: {
 | 
											
												
													
														|  |          total: 0,
 |  |          total: 0,
 | 
											
												
													
														|  |          pageSize: 10,
 |  |          pageSize: 10,
 | 
											
												
													
														|  |          pageNum: 1
 |  |          pageNum: 1
 | 
											
												
													
														|  |        },
 |  |        },
 | 
											
												
													
														|  |        types: [
 |  |        types: [
 | 
											
												
													
														|  | -        { type: 'question', name: '试题收藏' },
 |  | 
 | 
											
												
													
														|  | -        { type: 'paper', name: '试卷收藏' }
 |  | 
 | 
											
												
													
														|  | 
 |  | +        {type: 'question', name: '试题收藏'},
 | 
											
												
													
														|  | 
 |  | +        {type: 'paper', name: '试卷收藏'}
 | 
											
												
													
														|  |        ],
 |  |        ],
 | 
											
												
													
														|  |        subjects: [],
 |  |        subjects: [],
 | 
											
												
													
														|  |        queTypes: [],
 |  |        queTypes: [],
 | 
											
										
											
												
													
														|  | @@ -162,17 +105,16 @@ export default {
 | 
											
												
													
														|  |        collectPaper: []
 |  |        collectPaper: []
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  | -  watch:{
 |  | 
 | 
											
												
													
														|  | -    'queryParams.favCollectType':{
 |  | 
 | 
											
												
													
														|  | -      immediate:false,
 |  | 
 | 
											
												
													
														|  | -      handler(data){
 |  | 
 | 
											
												
													
														|  | -        console.log(data)
 |  | 
 | 
											
												
													
														|  | -        if(data == 'question') {
 |  | 
 | 
											
												
													
														|  | 
 |  | +  watch: {
 | 
											
												
													
														|  | 
 |  | +    'queryParams.favCollectType': {
 | 
											
												
													
														|  | 
 |  | +      immediate: false,
 | 
											
												
													
														|  | 
 |  | +      handler(data) {
 | 
											
												
													
														|  | 
 |  | +        if (data == 'question') {
 | 
											
												
													
														|  |            this.queryParams['favQueType'] = ''
 |  |            this.queryParams['favQueType'] = ''
 | 
											
												
													
														|  | -          if(!this.requireFields.find(item => item == 'favQueType')){
 |  | 
 | 
											
												
													
														|  | 
 |  | +          if (!this.requireFields.find(item => item == 'favQueType')) {
 | 
											
												
													
														|  |              this.requireFields.push('favQueType')
 |  |              this.requireFields.push('favQueType')
 | 
											
												
													
														|  |            }
 |  |            }
 | 
											
												
													
														|  | -        }else {
 |  | 
 | 
											
												
													
														|  | 
 |  | +        } else {
 | 
											
												
													
														|  |            delete this.queryParams['favQueType']
 |  |            delete this.queryParams['favQueType']
 | 
											
												
													
														|  |            this.requireFields.remove('favQueType')
 |  |            this.requireFields.remove('favQueType')
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
										
											
												
													
														|  | @@ -180,22 +122,20 @@ export default {
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |    methods: {
 |  |    methods: {
 | 
											
												
													
														|  | -    handleQuery(){
 |  | 
 | 
											
												
													
														|  | -      if(this.queryParams.favCollectType == 'question') {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    handleQuery() {
 | 
											
												
													
														|  | 
 |  | +      if (this.queryParams.favCollectType == 'question') {
 | 
											
												
													
														|  |          this.getFavQuestions()
 |  |          this.getFavQuestions()
 | 
											
												
													
														|  | -      }else {
 |  | 
 | 
											
												
													
														|  | 
 |  | +      } else {
 | 
											
												
													
														|  |          this.getFavPapers()
 |  |          this.getFavPapers()
 | 
											
												
													
														|  |        }
 |  |        }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -    },
 |  | 
 | 
											
												
													
														|  | -    handleInvalidQuery(){
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  |      onChangePage() {
 |  |      onChangePage() {
 | 
											
												
													
														|  |        this.getFavQuestions()
 |  |        this.getFavQuestions()
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  |      // 收藏的问题列表
 |  |      // 收藏的问题列表
 | 
											
												
													
														|  |      getFavQuestions() {
 |  |      getFavQuestions() {
 | 
											
												
													
														|  | 
 |  | +      this.loading = true
 | 
											
												
													
														|  |        favQuestions({
 |  |        favQuestions({
 | 
											
												
													
														|  |          subjectName: this.queryParams.favSubject,
 |  |          subjectName: this.queryParams.favSubject,
 | 
											
												
													
														|  |          qtype: this.queryParams.favQueType,
 |  |          qtype: this.queryParams.favQueType,
 | 
											
										
											
												
													
														|  | @@ -203,34 +143,16 @@ export default {
 | 
											
												
													
														|  |          pageSize: this.pageForm.pageSize
 |  |          pageSize: this.pageForm.pageSize
 | 
											
												
													
														|  |        }).then((res) => {
 |  |        }).then((res) => {
 | 
											
												
													
														|  |          this.pageForm.total = res.total
 |  |          this.pageForm.total = res.total
 | 
											
												
													
														|  | -        this.collectQue = res.rows.map(item => {
 |  | 
 | 
											
												
													
														|  | -          item.expand = false
 |  | 
 | 
											
												
													
														|  | -          return item
 |  | 
 | 
											
												
													
														|  | -        })
 |  | 
 | 
											
												
													
														|  | 
 |  | +        this.collectQue = res.rows
 | 
											
												
													
														|  |          this.$nextTick(_ => this.mxGlobal.MathQueue('collect-question'))
 |  |          this.$nextTick(_ => this.mxGlobal.MathQueue('collect-question'))
 | 
											
												
													
														|  | -        console.log(res)
 |  | 
 | 
											
												
													
														|  | -      })
 |  | 
 | 
											
												
													
														|  | -    },
 |  | 
 | 
											
												
													
														|  | -    toCollectQue(item) {
 |  | 
 | 
											
												
													
														|  | -      queCollect({ questionId: item.id }).then((res) => {
 |  | 
 | 
											
												
													
														|  | -        item.collect = !item.collect
 |  | 
 | 
											
												
													
														|  | -        this.msgSuccess('收藏成功')
 |  | 
 | 
											
												
													
														|  | -        console.log(res)
 |  | 
 | 
											
												
													
														|  | -      })
 |  | 
 | 
											
												
													
														|  | -    },
 |  | 
 | 
											
												
													
														|  | -    toCancelCollectQue(item) {
 |  | 
 | 
											
												
													
														|  | -      queCancelCollect({ questionId: item.id }).then((res) => {
 |  | 
 | 
											
												
													
														|  | -        item.collect = !item.collect
 |  | 
 | 
											
												
													
														|  | -        this.msgSuccess('取消收藏成功')
 |  | 
 | 
											
												
													
														|  | -        console.log(res)
 |  | 
 | 
											
												
													
														|  | -      })
 |  | 
 | 
											
												
													
														|  | 
 |  | +      }).finally(() => this.loading = false)
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  |      viewDetail(item) {
 |  |      viewDetail(item) {
 | 
											
												
													
														|  |        item.expand = !item.expand
 |  |        item.expand = !item.expand
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  |      // 收藏涉及的学科
 |  |      // 收藏涉及的学科
 | 
											
												
													
														|  |      getSubjects() {
 |  |      getSubjects() {
 | 
											
												
													
														|  | -      favSubjects({ type: this.form.type }).then((res) => {
 |  | 
 | 
											
												
													
														|  | 
 |  | +      favSubjects({type: this.form.type}).then((res) => {
 | 
											
												
													
														|  |          console.log(res)
 |  |          console.log(res)
 | 
											
												
													
														|  |          this.form.subjectName = res.data[0]
 |  |          this.form.subjectName = res.data[0]
 | 
											
												
													
														|  |          this.subjects = res.data
 |  |          this.subjects = res.data
 | 
											
										
											
												
													
														|  | @@ -261,20 +183,25 @@ export default {
 | 
											
												
													
														|  |    .el-dialog__header .el-dialog__title {
 |  |    .el-dialog__header .el-dialog__title {
 | 
											
												
													
														|  |      color: #47c6a2;
 |  |      color: #47c6a2;
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |    .radio_contianer .el-radio-button__inner {
 |  |    .radio_contianer .el-radio-button__inner {
 | 
											
												
													
														|  |      border-left: 1px solid #dcdfe6;
 |  |      border-left: 1px solid #dcdfe6;
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |    .radio_contianer .el-radio-button .el-radio-button__inner {
 |  |    .radio_contianer .el-radio-button .el-radio-button__inner {
 | 
											
												
													
														|  |      border-radius: 16px;
 |  |      border-radius: 16px;
 | 
											
												
													
														|  |      margin-bottom: 5px;
 |  |      margin-bottom: 5px;
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |    .radio_contianer .el-radio-button:first-child:last-child .el-radio-button__inner {
 |  |    .radio_contianer .el-radio-button:first-child:last-child .el-radio-button__inner {
 | 
											
												
													
														|  |      border-radius: 16px;
 |  |      border-radius: 16px;
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |    .radio_contianer .el-radio-button {
 |  |    .radio_contianer .el-radio-button {
 | 
											
												
													
														|  |      margin-right: 8px;
 |  |      margin-right: 8px;
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  .radio_contianer > div {
 |  |  .radio_contianer > div {
 | 
											
												
													
														|  |    margin-bottom: 16px;
 |  |    margin-bottom: 16px;
 | 
											
												
													
														|  |    display: flex;
 |  |    display: flex;
 |