Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-annual-summary
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-annual-summary
提交
c213395a
提交
c213395a
编写于
9月 28, 2020
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
分页获取题目
上级
b1bb00c8
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
34 行增加
和
71 行删除
+34
-71
question-content.vue
src/components/question/question-content.vue
+12
-9
question-footer.vue
src/components/question/question-footer.vue
+3
-1
question.js
src/store/modules/question.js
+15
-12
question-detail.vue
src/views/question-detail.vue
+4
-49
未找到文件。
src/components/question/question-content.vue
浏览文件 @
c213395a
...
@@ -2,10 +2,7 @@
...
@@ -2,10 +2,7 @@
<section
class=
"qeustion-content-wrapper"
>
<section
class=
"qeustion-content-wrapper"
>
<article
class=
"public-title"
v-show=
"currentQuestion.unionType"
>
<article
class=
"public-title"
v-show=
"currentQuestion.unionType"
>
<p
class=
"text"
v-show=
"currentQuestion.unionType == 1"
>
<p
class=
"text"
v-show=
"currentQuestion.unionType == 1"
>
我们建议使用 CDN 引入 Element 的永固在机舱在链接
{{
currentQuestion
.
unionQuestion
}}
地址上锁定版本,以免将来 Element 升级时受到非兼容
性更新的影响。例如,如需锁定版本为 1.4.8如需锁定版
本为 1.4.8
</p>
</p>
<article
<article
class=
"select-wrapper"
class=
"select-wrapper"
...
@@ -32,8 +29,8 @@
...
@@ -32,8 +29,8 @@
</article>
</article>
<article
class=
"select-wrapper"
>
<article
class=
"select-wrapper"
>
<div
class=
"item"
v-for=
"(item, index) in currentQuestion.options"
:key=
"index"
@
click=
"selectOption(index)"
>
<div
class=
"item"
v-for=
"(item, index) in currentQuestion.options"
:key=
"index"
@
click=
"selectOption(index)"
>
<span
v-if=
"!item.isSelected"
class=
"option border"
>
{{
getOrderVac
(
index
)
}}
</span>
<span
v-if=
"!item.isSelected
&& !((item.isSelected && !currentQuestion.commitFlag) || (!item.isSelected && currentQuestion.commitFlag && item.isCorrect))
"
class=
"option border"
>
{{
getOrderVac
(
index
)
}}
</span>
<span
v-if=
"
item.isSelected && !currentQuestion.commitFlag
"
class=
"option bg"
>
{{
getOrderVac
(
index
)
}}
</span>
<span
v-if=
"
(item.isSelected && !currentQuestion.commitFlag) || (!item.isSelected && currentQuestion.commitFlag && item.isCorrect)
"
class=
"option bg"
>
{{
getOrderVac
(
index
)
}}
</span>
<template
v-else
>
<template
v-else
>
<img
v-if=
"item.isSelected && item.isCorrect"
src=
"../../images/question/correct.png"
alt
/>
<img
v-if=
"item.isSelected && item.isCorrect"
src=
"../../images/question/correct.png"
alt
/>
<img
v-if=
"item.isSelected && !item.isCorrect"
src=
"../../images/question/error.png"
alt
/>
<img
v-if=
"item.isSelected && !item.isCorrect"
src=
"../../images/question/error.png"
alt
/>
...
@@ -44,7 +41,7 @@
...
@@ -44,7 +41,7 @@
>
{{currentQuestion.unionType == 2 ? getOrderVac(index) : item.text}}
</span>
>
{{currentQuestion.unionType == 2 ? getOrderVac(index) : item.text}}
</span>
<span
v-else
<span
v-else
class=
"content"
class=
"content"
:class=
"{'select': item.is
Selected && item.is
Correct, 'error': item.isSelected && !item.isCorrect}"
:class=
"{'select': item.isCorrect, 'error': item.isSelected && !item.isCorrect}"
>
{{currentQuestion.unionType == 2 ? getOrderVac(index) : item.text}}
</span>
>
{{currentQuestion.unionType == 2 ? getOrderVac(index) : item.text}}
</span>
</div>
</div>
...
@@ -64,12 +61,12 @@
...
@@ -64,12 +61,12 @@
<article
class=
"c-btn-wrapper"
v-show=
"currentQuestion.typeId == 2 && !currentQuestion.commitFlag"
@
click=
"commitAnswer"
>
<article
class=
"c-btn-wrapper"
v-show=
"currentQuestion.typeId == 2 && !currentQuestion.commitFlag"
@
click=
"commitAnswer"
>
<van-button
size=
"large"
round
color=
"#449284"
>
确 认
</van-button>
<van-button
size=
"large"
round
color=
"#449284"
>
确 认
</van-button>
</article>
</article>
<article
class=
"answer-wrapper"
v-show=
"currentQuestion.isAnalyzed
|| currentQuestion.commitFlag
"
>
<article
class=
"answer-wrapper"
v-show=
"currentQuestion.isAnalyzed"
>
<span
class=
"content"
>
正确答案:{{currentQuestion.answer}}
</span>
<span
class=
"content"
>
正确答案:{{currentQuestion.answer}}
</span>
</article>
</article>
<article
class=
"analysis-wrapper"
v-show=
"currentQuestion.isAnalyzed"
>
<article
class=
"analysis-wrapper"
v-show=
"currentQuestion.isAnalyzed"
>
<span
class=
"title"
>
解析
</span>
<span
class=
"title"
>
解析
</span>
<div
class=
"content"
v-html=
"
analysisContent
"
></div>
<div
class=
"content"
v-html=
"
currentQuestion.intro
"
></div>
</article>
</article>
</section>
</section>
</template>
</template>
...
@@ -132,6 +129,9 @@ export default {
...
@@ -132,6 +129,9 @@ export default {
}
else
{
}
else
{
this
.
currentQuestion
.
commitFlag
=
2
;
this
.
currentQuestion
.
commitFlag
=
2
;
}
}
let
myAnswer
=
this
.
getOrderVac
(
index
);
let
isAnalyzed
=
this
.
currentQuestion
.
commitFlag
&&
myAnswer
!=
this
.
currentQuestion
.
answer
;
this
.
currentQuestion
.
isAnalyzed
=
isAnalyzed
;
this
.
currentQuestion
.
myAnswer
=
this
.
getOrderVac
(
index
);
this
.
currentQuestion
.
myAnswer
=
this
.
getOrderVac
(
index
);
this
.
commitAnswer
();
this
.
commitAnswer
();
}
}
...
@@ -181,6 +181,9 @@ export default {
...
@@ -181,6 +181,9 @@ export default {
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.qeustion-content-wrapper {
.qeustion-content-wrapper {
img {
width: 98% !important;
}
font-size: 14px;
font-size: 14px;
.public-title {
.public-title {
.text {
.text {
...
...
src/components/question/question-footer.vue
浏览文件 @
c213395a
...
@@ -64,6 +64,7 @@ export default {
...
@@ -64,6 +64,7 @@ export default {
"SET_CURRENT_QUESTION"
,
"SET_CURRENT_QUESTION"
,
this
.
questionList
[
cIndex
-
1
]
||
{
answerList
:
[]
}
this
.
questionList
[
cIndex
-
1
]
||
{
answerList
:
[]
}
);
);
console
.
log
(
this
.
currentQuestion
.
isAnalyzed
||
(
this
.
currentQuestion
.
commitFlag
==
2
));
if
(
cIndex
==
1
&&
this
.
currentQuestion
.
titleNo
>
2
)
{
if
(
cIndex
==
1
&&
this
.
currentQuestion
.
titleNo
>
2
)
{
this
.
$emit
(
"pageQuestion"
,
0
,
this
.
questionList
[
0
].
titleNo
);
this
.
$emit
(
"pageQuestion"
,
0
,
this
.
questionList
[
0
].
titleNo
);
}
}
...
@@ -83,6 +84,7 @@ export default {
...
@@ -83,6 +84,7 @@ export default {
"SET_CURRENT_QUESTION"
,
"SET_CURRENT_QUESTION"
,
this
.
questionList
[
cIndex
+
1
]
||
{
answerList
:
[]
}
this
.
questionList
[
cIndex
+
1
]
||
{
answerList
:
[]
}
);
);
console
.
log
(
this
.
currentQuestion
.
isAnalyzed
||
(
this
.
currentQuestion
.
commitFlag
==
2
));
if
((
cIndex
==
this
.
questionList
.
length
-
2
)
&&
(
this
.
questionList
.
length
<
this
.
totalCount
))
{
if
((
cIndex
==
this
.
questionList
.
length
-
2
)
&&
(
this
.
questionList
.
length
<
this
.
totalCount
))
{
this
.
$emit
(
"pageQuestion"
,
1
,
this
.
questionList
[
this
.
questionList
.
length
-
1
].
titleNo
);
this
.
$emit
(
"pageQuestion"
,
1
,
this
.
questionList
[
this
.
questionList
.
length
-
1
].
titleNo
);
}
}
...
@@ -92,7 +94,7 @@ export default {
...
@@ -92,7 +94,7 @@ export default {
// 解析
// 解析
toggleAnalysis
()
{
toggleAnalysis
()
{
this
.
currentQuestion
.
isAnalyzed
=
!
this
.
currentQuestion
.
isAnalyzed
;
this
.
currentQuestion
.
isAnalyzed
=
true
;
// this.$store.commit('SET_CURRENT_QUESTION', this.currentQuestion);
// this.$store.commit('SET_CURRENT_QUESTION', this.currentQuestion);
},
},
...
...
src/store/modules/question.js
浏览文件 @
c213395a
...
@@ -96,7 +96,6 @@ const question = {
...
@@ -96,7 +96,6 @@ const question = {
// 处理返回的数据
// 处理返回的数据
handlerQuestionList
({
commit
,
state
},
rezultData
)
{
handlerQuestionList
({
commit
,
state
},
rezultData
)
{
// debugger
let
questionList
=
rezultData
.
practiseTitleModelList
||
[];
let
questionList
=
rezultData
.
practiseTitleModelList
||
[];
let
handlerList
=
[],
question
,
option
,
optionList
=
[],
myAnswer
=
""
,
answer
=
""
;
let
handlerList
=
[],
question
,
option
,
optionList
=
[],
myAnswer
=
""
,
answer
=
""
;
...
@@ -104,7 +103,8 @@ const question = {
...
@@ -104,7 +103,8 @@ const question = {
myAnswer
=
item
.
myAnswer
;
myAnswer
=
item
.
myAnswer
;
answer
=
item
.
answer
;
answer
=
item
.
answer
;
question
=
JSON
.
parse
(
JSON
.
stringify
(
item
));
question
=
JSON
.
parse
(
JSON
.
stringify
(
item
));
question
.
isAnalyzed
=
false
;
let
isAnalyzed
=
question
.
commitFlag
&&
myAnswer
!=
answer
;
question
.
isAnalyzed
=
isAnalyzed
;
option
=
{};
option
=
{};
optionList
=
[];
optionList
=
[];
question
.
options
.
forEach
(
(
text
,
i
)
=>
{
question
.
options
.
forEach
(
(
text
,
i
)
=>
{
...
@@ -122,18 +122,21 @@ const question = {
...
@@ -122,18 +122,21 @@ const question = {
handlerList
.
push
(
question
);
handlerList
.
push
(
question
);
});
});
console
.
log
(
'in handlerList'
,
handlerList
);
console
.
log
(
'in handlerList'
,
handlerList
);
let
cIndex
=
findQuestionIndexNo
(
handlerList
,
'titleNo'
,
rezultData
.
currentTitleNo
||
1
);
let
newList
=
concatArray
(
state
.
questionList
,
handlerList
,
'titleNo'
);
let
newList
=
concatArray
(
state
.
questionList
,
handlerList
,
'titleNo'
);
let
titleConfig
=
{
bindStatus
:
rezultData
.
bindStatus
,
// 绑卡状态:0未绑卡 1已绑卡
commitKind
:
rezultData
.
commitKind
,
// 答题来源 1:错题集 2:收藏 3:题库
currentTitleNo
:
rezultData
.
currentTitleNo
,
// 定位答题题目id
resultId
:
rezultData
.
resultId
,
// 刷题库轮次ID
totalCount
:
rezultData
.
totalCount
,
// 题目总数
}
commit
(
"SET_CURRENT_QUESTION"
,
newList
[
cIndex
]
||
{
titleNo
:
1
});
commit
(
"SET_QUESTION_LIST"
,
newList
);
commit
(
"SET_QUESTION_LIST"
,
newList
);
commit
(
"SET_TITLE_CONIFG"
,
titleConfig
);
if
(
rezultData
.
isFirst
)
{
let
cIndex
=
findQuestionIndexNo
(
handlerList
,
'titleNo'
,
rezultData
.
currentTitleNo
||
1
);
let
titleConfig
=
{
bindStatus
:
rezultData
.
bindStatus
,
// 绑卡状态:0未绑卡 1已绑卡
commitKind
:
rezultData
.
commitKind
,
// 答题来源 1:错题集 2:收藏 3:题库
currentTitleNo
:
rezultData
.
currentTitleNo
,
// 定位答题题目id
resultId
:
rezultData
.
resultId
,
// 刷题库轮次ID
totalCount
:
rezultData
.
totalCount
,
// 题目总数
}
commit
(
"SET_CURRENT_QUESTION"
,
newList
[
cIndex
]
||
{
titleNo
:
1
});
commit
(
"SET_TITLE_CONIFG"
,
titleConfig
);
}
},
},
},
},
...
...
src/views/question-detail.vue
浏览文件 @
c213395a
...
@@ -123,61 +123,15 @@ export default {
...
@@ -123,61 +123,15 @@ export default {
this
.
init
();
this
.
init
();
let
firstArr
=
[
{
titleNo
:
1
,
name
:
"11"
},
{
titleNo
:
2
,
name
:
"11"
},
{
titleNo
:
3
,
name
:
"11"
},
{
titleNo
:
4
,
name
:
"11"
},
{
titleNo
:
5
,
name
:
"11"
}
];
let
secondArr
=
[
{
titleNo
:
3
,
name
:
"11"
},
{
titleNo
:
4
,
name
:
"11"
},
{
titleNo
:
5
,
name
:
"11"
},
{
titleNo
:
6
,
name
:
"11"
},
{
titleNo
:
7
,
name
:
"11"
}
];
window
.
__getUserInfoForQD
=
function
(
param
)
{
window
.
__getUserInfoForQD
=
function
(
param
)
{
_this
.
token
=
param
.
userToken
;
_this
.
token
=
param
.
userToken
;
_this
.
setUserInfo
(
param
);
_this
.
setUserInfo
(
param
);
this
.
getPractiseTitles
();
this
.
getPractiseTitles
(
true
);
// _this.checkToken();
// _this.checkToken();
};
};
if
(
__isWeb
)
{
if
(
__isWeb
)
{
this
.
getPractiseTitles
();
this
.
getPractiseTitles
(
true
);
}
else
{
}
else
{
_this
.
getUserInfo
();
_this
.
getUserInfo
();
}
}
...
@@ -323,10 +277,11 @@ export default {
...
@@ -323,10 +277,11 @@ export default {
},
},
// 分页获取题目(前、后翻页)
// 分页获取题目(前、后翻页)
getPractiseTitles
()
{
getPractiseTitles
(
isFirst
)
{
this
.
GET
(
`portal/titleTest/practise/titles`
,
this
.
queryParams
).
then
(
this
.
GET
(
`portal/titleTest/practise/titles`
,
this
.
queryParams
).
then
(
({
data
})
=>
{
({
data
})
=>
{
this
.
currentTitleNo
=
data
.
currentTitleNo
;
this
.
currentTitleNo
=
data
.
currentTitleNo
;
data
.
isFirst
=
isFirst
;
this
.
handlerQuestionList
(
data
);
this
.
handlerQuestionList
(
data
);
// this.handlerPractiseData(data.practiseTitleModelList);
// this.handlerPractiseData(data.practiseTitleModelList);
console
.
log
(
data
);
console
.
log
(
data
);
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录