|
@@ -7,7 +7,7 @@
|
|
|
|
|
|
<span class="btn-back" @click="handleBackTo" ref="btnBack"><Icon type="ios-arrow-back" />{{$t('totalAnalysis.ql_text13')}}</span>
|
|
|
<Loading :top="300" v-show="dataLoading" type="3"></Loading>
|
|
|
- <div class="ql-item" v-for="(question,index) in questionList" :key="index">
|
|
|
+ <div class="ql-item" v-for="(question,index) in questionList" :key="index" :ref="'q'+index">
|
|
|
<div>
|
|
|
<div class="item-question">
|
|
|
<p>
|
|
@@ -51,7 +51,7 @@
|
|
|
</div>
|
|
|
</div>-->
|
|
|
|
|
|
- <!--<Collapse simple @on-change="handleCollapseChange">
|
|
|
+ <Collapse simple @on-change="handleCollapseChange">
|
|
|
<Panel :name="index+'answer'">
|
|
|
<span>{{$t('totalAnalysis.ql_text9')}}</span>
|
|
|
<div class="answerAndExplain" slot="content" style="margin-top:10px;margin-left: 25px;">
|
|
@@ -78,7 +78,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</Panel>
|
|
|
- </Collapse>-->
|
|
|
+ </Collapse>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
@@ -93,37 +93,37 @@
|
|
|
<div class="ql-right-part" v-if="SingleList.length">
|
|
|
<span class="ql-right-part-title"><span class="ql-line"></span>{{$t('totalAnalysis.ql_text2')}}({{sumArr(SingleList.map(item => item.score))}}{{$t('totalAnalysis.ql_text8')}})</span>
|
|
|
<div class="ql-right-items">
|
|
|
- <span class="ql-right-item" v-for="(item,index) in SingleList" :key="index" @click="handleItemClick(item,$event)">{{index + 1}}</span>
|
|
|
+ <span class="ql-right-item" v-for="(item,index) in SingleList" :key="index" @click="handleItemClick(item,$event)" :ref="'indexRef' + questionList.indexOf(item)">{{questionList.indexOf(item) + 1}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="ql-right-part" v-if="MultipleList.length">
|
|
|
<span class="ql-right-part-title"><span class="ql-line"></span>{{$t('totalAnalysis.ql_text3')}}({{sumArr(MultipleList.map(item => item.score))}}{{$t('totalAnalysis.ql_text8')}})</span>
|
|
|
<div class="ql-right-items">
|
|
|
- <span class="ql-right-item" v-for="(item,index) in MultipleList" :key="index" @click="handleItemClick(item,$event)">{{index + 1}}</span>
|
|
|
+ <span class="ql-right-item" v-for="(item,index) in MultipleList" :key="index" @click="handleItemClick(item,$event)" :ref="'indexRef' + questionList.indexOf(item)">{{questionList.indexOf(item) + 1}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="ql-right-part" v-if="JudgeList.length">
|
|
|
<span class="ql-right-part-title"><span class="ql-line"></span>{{$t('totalAnalysis.ql_text4')}}({{sumArr(JudgeList.map(item => item.score))}}{{$t('totalAnalysis.ql_text8')}})</span>
|
|
|
<div class="ql-right-items">
|
|
|
- <span class="ql-right-item" v-for="(item,index) in JudgeList" :key="index" @click="handleItemClick(item,$event)">{{index + 1}}</span>
|
|
|
+ <span class="ql-right-item" v-for="(item,index) in JudgeList" :key="index" @click="handleItemClick(item,$event)" :ref="'indexRef' + questionList.indexOf(item)">{{questionList.indexOf(item) + 1}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="ql-right-part" v-if="CompleteList.length">
|
|
|
<span class="ql-right-part-title"><span class="ql-line"></span>{{$t('totalAnalysis.ql_text5')}}({{sumArr(CompleteList.map(item => item.score))}}{{$t('totalAnalysis.ql_text8')}})</span>
|
|
|
<div class="ql-right-items">
|
|
|
- <span class="ql-right-item" v-for="(item,index) in CompleteList" :key="index" @click="handleItemClick(item,$event)">{{index + 1}}</span>
|
|
|
+ <span class="ql-right-item" v-for="(item,index) in CompleteList" :key="index" @click="handleItemClick(item,$event)" :ref="'indexRef' + questionList.indexOf(item)">{{questionList.indexOf(item) + 1}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="ql-right-part" v-if="SubjectiveList.length">
|
|
|
<span class="ql-right-part-title"><span class="ql-line"></span>{{$t('totalAnalysis.ql_text6')}}({{sumArr(SubjectiveList.map(item => item.score))}}{{$t('totalAnalysis.ql_text8')}})</span>
|
|
|
<div class="ql-right-items">
|
|
|
- <span class="ql-right-item" v-for="(item,index) in SubjectiveList" :key="index" @click="handleItemClick(item,$event)">{{index + 1}}</span>
|
|
|
+ <span class="ql-right-item" v-for="(item,index) in SubjectiveList" :key="index" @click="handleItemClick(item,$event)" :ref="'indexRef' + questionList.indexOf(item)">{{questionList.indexOf(item) + 1}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="ql-right-part" v-if="ComposeList.length">
|
|
|
<span class="ql-right-part-title"><span class="ql-line"></span>{{$t('totalAnalysis.ql_text7')}}({{sumArr(ComposeList.map(item => item.score))}}{{$t('totalAnalysis.ql_text8')}})</span>
|
|
|
<div class="ql-right-items">
|
|
|
- <span class="ql-right-item" v-for="(item,index) in ComposeList" :key="index" @click="handleItemClick(item,$event)">{{index + 1}}</span>
|
|
|
+ <span class="ql-right-item" v-for="(item,index) in ComposeList" :key="index" @click="handleItemClick(item,$event)" :ref="'indexRef' + questionList.indexOf(item)">{{questionList.indexOf(item) + 1}}</span>
|
|
|
</div>
|
|
|
</div><div style="margin-top:30px">注:标红题号为班级易错题目</div>
|
|
|
</vuescroll>
|
|
@@ -312,12 +312,15 @@
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
- scrollTop: 0
|
|
|
+ scrollTop: 0,
|
|
|
+ fromRoutePath: null
|
|
|
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- console.log("初次加载")
|
|
|
+ let that = this
|
|
|
+ let parentVm = this.$parent.$parent.$parent
|
|
|
+ parentVm.isShowQuestions = true
|
|
|
this.$store.dispatch('getExamPaper').then(res => {
|
|
|
this.rightTableData = this.$store.state.totalAnalysis.classList
|
|
|
this.questionList = res[0].item
|
|
@@ -328,6 +331,24 @@
|
|
|
this.SubjectiveList = this.questionList.filter(item => item.type === 'Subjective')
|
|
|
this.ComposeList = this.questionList.filter(item => item.type === 'Compose')
|
|
|
this.dataLoading = false
|
|
|
+
|
|
|
+ // 如果是试题页面过来带有题序 则获取指定题目并进行滚动
|
|
|
+ if (this.$route.query.QIndex) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let index = +this.$route.query.QIndex - 1
|
|
|
+ this.handleCollapseChange([index.toString()])
|
|
|
+ this.activeCollapseIndex.push(index + 'answer')
|
|
|
+ setTimeout(function () {
|
|
|
+ that.$refs['indexRef' + index][0].click() //根据路由携带的题序 来触发对应题序的点击事件 完成滚动
|
|
|
+ },1000)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.indexRef0[0].click()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
})
|
|
|
|
|
|
let testScatter = this.$store.state.totalAnalysis.testScatter
|
|
@@ -391,8 +412,6 @@
|
|
|
let itemIndex = this.questionList.indexOf(item)
|
|
|
let questionDom = questionList[itemIndex]
|
|
|
let scrollDistance = questionDom.offsetTop + 134 // 相对父级容器高度加上头部高度即为滚动距离
|
|
|
- console.log(scrollDistance)
|
|
|
- console.log(questionDom)
|
|
|
parentVm.$refs['vs'].scrollTo(
|
|
|
{
|
|
|
y: scrollDistance
|
|
@@ -439,21 +458,6 @@
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
- let parentVm = this.$parent.$parent.$parent
|
|
|
- parentVm.isShowQuestions = true
|
|
|
- let that = this
|
|
|
-
|
|
|
-
|
|
|
- if (this.$route.query.QIndex) {
|
|
|
- let index = +this.$route.query.QIndex - 1
|
|
|
- let allList = document.getElementsByClassName('ql-right-item')
|
|
|
- this.handleCollapseChange([index.toString()])
|
|
|
- this.activeCollapseIndex.push(index + 'answer')
|
|
|
-
|
|
|
- setTimeout(function() {
|
|
|
- that.handleItemClick(that.questionList[index], allList[index])
|
|
|
- }, 200)
|
|
|
- }
|
|
|
|
|
|
if (this.getExerciseData) {
|
|
|
this.tableData = this.getExerciseData
|
|
@@ -493,7 +497,7 @@
|
|
|
if (!val) return
|
|
|
console.log(val)
|
|
|
this.tableData = JSON.parse(JSON.stringify(val))
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|