提交 f730ddd0 authored 作者: lihuihui's avatar lihuihui

能力自测文案修改,错题列表修改

上级 1b2128c8
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<!-- <div class="title">能力自测 测试说明</div> --> <!-- <div class="title">能力自测 测试说明</div> -->
<img src="../../assets/images/tab1bg.png" alt=""> <img src="../../assets/images/tab1bg.png" alt="">
<p class="ti">自测考试时间20分钟</p> <p class="ti">自测考试时间20分钟</p>
<p class="tx">考试题目共33题,分四部分</p> <p class="tx">考试题目共43题,分四部分</p>
<p class="tx">单选题共15</p> <p class="tx">单选题共16</p>
<p class="tx">多选题共10</p> <p class="tx">多选题共16</p>
<p class="tx">判断题共5</p> <p class="tx">判断题共10</p>
<p class="tx">案例题共1题</p> <p class="tx">案例题共1题</p>
<p class="ti2">了解自己知识掌握情况</p> <p class="ti2">了解自己知识掌握情况</p>
<p class="ti2">成绩报告准确分析定位</p> <p class="ti2">成绩报告准确分析定位</p>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="text" v-html="item.question_content"></div> <div class="text" v-html="item.question_content"></div>
<template v-if="!batchDel.selectShow"> <template v-if="!batchDel.selectShow">
<div class="del"> <div class="del">
<div class="dels" @click.prevent.stop.stop="del(item.question_id)"></div> <div class="dels" @click.prevent.stop.stop="del(item.question_id, 1)"></div>
<!-- <div :class="item.is_collection ? 'collect active' : 'collect'" @click.prevent.stop.stop="collectQuestion(item.question_id)"></div> --> <!-- <div :class="item.is_collection ? 'collect active' : 'collect'" @click.prevent.stop.stop="collectQuestion(item.question_id)"></div> -->
</div> </div>
</template> </template>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<template v-else> <template v-else>
<div class="z-btn" @click="batchDel.selectShow = false">返回</div> <div class="z-btn" @click="batchDel.selectShow = false">返回</div>
<div class="z-btn mar" @click="allSelect">{{ batchDel.isAllSelect ? '取消全选' : '全选' }}</div> <div class="z-btn mar" @click="allSelect">{{ batchDel.isAllSelect ? '取消全选' : '全选' }}</div>
<div :class="!batchDel.isDelBtn ? 'z-btn col' : 'z-btn'" @click="batchDel.isPopShow = true">删除</div> <div :class="!batchDel.isDelBtn ? 'z-btn col' : 'z-btn'" @click="!batchDel.isDelBtn ? batchDel.isPopShow = false : batchDel.isPopShow = true">删除</div>
</template> </template>
</div> </div>
<div class="exam_submit" v-if="batchDel.isPopShow"> <div class="exam_submit" v-if="batchDel.isPopShow">
...@@ -232,7 +232,7 @@ export default { ...@@ -232,7 +232,7 @@ export default {
this.initData() this.initData()
} }
}, },
del(ids) { del(ids, n) {
const idGroup = Array.isArray(ids) ? ids : [ids] const idGroup = Array.isArray(ids) ? ids : [ids]
const param = { const param = {
question_id: idGroup.toString(), question_id: idGroup.toString(),
...@@ -240,24 +240,23 @@ export default { ...@@ -240,24 +240,23 @@ export default {
} }
api.deleteQuestion(param).then(res => { api.deleteQuestion(param).then(res => {
if (res.code === 0) { if (res.code === 0) {
idGroup.map(id => { if (n === 1) {
const index = this.question.list.findIndex(item => { return item.question_id === id }) idGroup.map(id => {
this.question.list.splice(index, 1) const index = this.question.list.findIndex(item => { return item.question_id === id })
}) this.question.list.splice(index, 1)
})
this.initData()
} else {
this.params.page = 1
this.initData(2)
document.documentElement.scrollTop = 0
}
if (this.question.list.length === 0) { if (this.question.list.length === 0) {
this.clear() this.clear()
} }
this.batchDel.isDelBtn = false this.batchDel.isDelBtn = false
this.batchDel.isPopShow = false this.batchDel.isPopShow = false
Toast('删除成功') Toast('删除成功')
this.batchDel.isAllSelect = false
console.log(this.question.list)
if (this.question.list.length < 5) {
this.params.page = this.params.page + 1
this.initData()
} else {
this.initData(true)
}
} }
}) })
}, },
...@@ -338,9 +337,14 @@ export default { ...@@ -338,9 +337,14 @@ export default {
initData(isDel) { initData(isDel) {
api.getMyQuestion(this.params).then(res => { api.getMyQuestion(this.params).then(res => {
if (!isDel) { if (!isDel) {
res.list.map(item => { if (this.question.list.length === 0) {
this.question.list.push(item) res.list.map(item => {
}) this.question.list.push(item)
})
}
}
if (isDel === 2) {
this.question.list = res.list
} }
this.question.total = res.total this.question.total = res.total
this.question.errorTotal = res.error_total this.question.errorTotal = res.error_total
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<div class="text" v-html="item.question_content"></div> <div class="text" v-html="item.question_content"></div>
<template v-if="!batchDel.selectShow"> <template v-if="!batchDel.selectShow">
<div class="del"> <div class="del">
<div class="dels" @click.prevent.stop.stop="del(item.question_id)"></div> <div class="dels" @click.prevent.stop.stop="del(item.question_id, 1)"></div>
<div :class="item.is_collection ? 'collect active' : 'collect'" @click.prevent.stop.stop="collectQuestion(item.question_id)"></div> <div :class="item.is_collection ? 'collect active' : 'collect'" @click.prevent.stop.stop="collectQuestion(item.question_id)"></div>
</div> </div>
</template> </template>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<template v-else> <template v-else>
<div class="z-btn" @click="batchDel.selectShow = false">返回</div> <div class="z-btn" @click="batchDel.selectShow = false">返回</div>
<div class="z-btn mar" @click="allSelect">{{ batchDel.isAllSelect ? '取消全选' : '全选' }}</div> <div class="z-btn mar" @click="allSelect">{{ batchDel.isAllSelect ? '取消全选' : '全选' }}</div>
<div :class="!batchDel.isDelBtn ? 'z-btn col' : 'z-btn'" @click="batchDel.isPopShow = true">删除</div> <div :class="!batchDel.isDelBtn ? 'z-btn col' : 'z-btn'" @click="!batchDel.isDelBtn ? batchDel.isPopShow = false : batchDel.isPopShow = true">删除</div>
</template> </template>
</div> </div>
<div class="exam_submit" v-if="batchDel.isPopShow"> <div class="exam_submit" v-if="batchDel.isPopShow">
...@@ -242,7 +242,7 @@ export default { ...@@ -242,7 +242,7 @@ export default {
this.initData() this.initData()
} }
}, },
del(ids) { del(ids, n) {
const idGroup = Array.isArray(ids) ? ids : [ids] const idGroup = Array.isArray(ids) ? ids : [ids]
const param = { const param = {
question_id: idGroup.toString(), question_id: idGroup.toString(),
...@@ -250,24 +250,23 @@ export default { ...@@ -250,24 +250,23 @@ export default {
} }
api.deleteQuestion(param).then(res => { api.deleteQuestion(param).then(res => {
if (res.code === 0) { if (res.code === 0) {
idGroup.map(id => { if (n === 1) {
const index = this.question.list.findIndex(item => { return item.question_id === id }) idGroup.map(id => {
this.question.list.splice(index, 1) const index = this.question.list.findIndex(item => { return item.question_id === id })
}) this.question.list.splice(index, 1)
})
this.initData()
} else {
this.params.page = 1
this.initData(2)
document.documentElement.scrollTop = 0
}
if (this.question.list.length === 0) { if (this.question.list.length === 0) {
this.clear() this.clear()
} }
this.batchDel.isDelBtn = false this.batchDel.isDelBtn = false
this.batchDel.isPopShow = false this.batchDel.isPopShow = false
Toast('删除成功') Toast('删除成功')
this.batchDel.isAllSelect = false
console.log(this.question.list)
if (this.question.list.length < 5) {
this.params.page = this.params.page + 1
this.initData()
} else {
this.initData(true)
}
} }
}) })
}, },
...@@ -348,9 +347,14 @@ export default { ...@@ -348,9 +347,14 @@ export default {
initData(isDel) { initData(isDel) {
api.getMyQuestion(this.params).then(res => { api.getMyQuestion(this.params).then(res => {
if (!isDel) { if (!isDel) {
res.list.map(item => { if (this.question.list.length === 0) {
this.question.list.push(item) res.list.map(item => {
}) this.question.list.push(item)
})
}
}
if (isDel === 2) {
this.question.list = res.list
} }
this.question.total = res.total this.question.total = res.total
this.question.errorTotal = res.error_total this.question.errorTotal = res.error_total
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<div class="text" v-html="item.question_content"></div> <div class="text" v-html="item.question_content"></div>
<template v-if="!batchDel.selectShow"> <template v-if="!batchDel.selectShow">
<div class="del"> <div class="del">
<div class="dels" @click.prevent.stop.stop="del(item.question_id)"></div> <div class="dels" @click.prevent.stop.stop="del(item.question_id, 1)"></div>
<div :class="item.is_collection ? 'collect active' : 'collect'" @click.prevent.stop.stop="collectQuestion(item.question_id)"></div> <div :class="item.is_collection ? 'collect active' : 'collect'" @click.prevent.stop.stop="collectQuestion(item.question_id)"></div>
</div> </div>
</template> </template>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<template v-else> <template v-else>
<div class="z-btn" @click="batchDel.selectShow = false">返回</div> <div class="z-btn" @click="batchDel.selectShow = false">返回</div>
<div class="z-btn mar" @click="allSelect">{{ batchDel.isAllSelect ? '取消全选' : '全选' }}</div> <div class="z-btn mar" @click="allSelect">{{ batchDel.isAllSelect ? '取消全选' : '全选' }}</div>
<div :class="!batchDel.isDelBtn ? 'z-btn col' : 'z-btn'" @click="batchDel.isPopShow = true">删除</div> <div :class="!batchDel.isDelBtn ? 'z-btn col' : 'z-btn'" @click="!batchDel.isDelBtn ? batchDel.isPopShow = false : batchDel.isPopShow = true">删除</div>
</template> </template>
</div> </div>
<div class="exam_submit" v-if="batchDel.isPopShow"> <div class="exam_submit" v-if="batchDel.isPopShow">
...@@ -261,7 +261,7 @@ export default { ...@@ -261,7 +261,7 @@ export default {
// const bottomView = document.getElementById('bottom-view') // const bottomView = document.getElementById('bottom-view')
// bottomView.style.height = (clientHeight - topViewH) + 'px' // bottomView.style.height = (clientHeight - topViewH) + 'px'
// }, // },
del(ids) { del(ids, n) {
const idGroup = Array.isArray(ids) ? ids : [ids] const idGroup = Array.isArray(ids) ? ids : [ids]
const param = { const param = {
question_id: idGroup.toString(), question_id: idGroup.toString(),
...@@ -269,23 +269,23 @@ export default { ...@@ -269,23 +269,23 @@ export default {
} }
api.deleteQuestion(param).then(res => { api.deleteQuestion(param).then(res => {
if (res.code === 0) { if (res.code === 0) {
idGroup.map(id => { if (n === 1) {
const index = this.question.list.findIndex(item => { return item.question_id === id }) idGroup.map(id => {
this.question.list.splice(index, 1) const index = this.question.list.findIndex(item => { return item.question_id === id })
}) this.question.list.splice(index, 1)
})
this.initData()
} else {
this.params.page = 1
this.initData(2)
document.documentElement.scrollTop = 0
}
if (this.question.list.length === 0) { if (this.question.list.length === 0) {
this.clear() this.clear()
} }
this.batchDel.isDelBtn = false this.batchDel.isDelBtn = false
this.batchDel.isPopShow = false this.batchDel.isPopShow = false
Toast('删除成功') Toast('删除成功')
this.batchDel.isAllSelect = false
if (this.question.list.length < 8) {
this.params.page = this.params.page + 1
this.initData()
} else {
this.initData(true)
}
} }
}) })
}, },
...@@ -367,9 +367,14 @@ export default { ...@@ -367,9 +367,14 @@ export default {
initData(isDel) { initData(isDel) {
api.getMyQuestion(this.params).then(res => { api.getMyQuestion(this.params).then(res => {
if (!isDel) { if (!isDel) {
res.list.map(item => { if (this.question.list.length === 0) {
this.question.list.push(item) res.list.map(item => {
}) this.question.list.push(item)
})
}
}
if (isDel === 2) {
this.question.list = res.list
} }
this.question.total = res.total this.question.total = res.total
this.question.errorTotal = res.error_total this.question.errorTotal = res.error_total
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论