Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
educationStu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
向伟
educationStu
Commits
b0a67478
Commit
b0a67478
authored
Sep 08, 2021
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
702d38ae
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
411 additions
and
11 deletions
+411
-11
EntryProblem.vue
src/components/subject/EntryProblem.vue
+194
-0
SharingChoose.vue
src/components/subject/SharingChoose.vue
+192
-0
examPaper.vue
src/pages/exam/examPaper.vue
+25
-11
No files found.
src/components/subject/EntryProblem.vue
0 → 100644
View file @
b0a67478
<
template
>
<!-- 计算题 -->
<view>
<view
class=
"item"
style=
"padding:0 20px;"
>
<view
class=
"name"
>
<view>
{{
changeNumToHan
(
sortIndex
)
}}
、
{{
data
.
GroupName
}}
<text
style=
"color:#999999;"
>
(共
{{
data
.
DetailsList
.
length
}}
道,
{{
data
.
GScore
}}
分)
</text>
</view>
<view>
<text
class=
"Single_Before"
>
{{
ExamIndex
}}
</text>
/
<text
class=
"Exam_Total"
>
{{
data
.
DetailsList
.
length
}}
</text>
</view>
</view>
<swiper
class=
"swiper-box"
:autoplay=
"autoplay"
:current=
"current"
@
change=
"onchange"
>
<swiper-item
v-if=
"sortIndex != 1"
></swiper-item>
<swiper-item
v-for=
"(item1, index1) in data.DetailsList"
:key=
"item1.id"
>
<view
class=
"item1"
>
<view
class=
"flex flex_start_center"
>
<view>
{{
index1
+
1
}}
、
</view>
<view
class=
"num"
v-html=
"item1.Title"
></view>
</view>
<view
class=
"chooseName"
>
<textarea
type=
"text"
v-model=
"item1.myAnswer"
class=
"input textarea"
placeholder=
"请填写答案"
placeholder-style=
"textarea-placeholder"
:maxlength=
"-1"
/>
</view>
</view>
</swiper-item>
<swiper-item
v-if=
"sortIndex != sortTotal"
></swiper-item>
</swiper>
</view>
<van-toast
id=
"van-toast"
/>
</view>
</
template
>
<
script
>
import
{
ref
,
reactive
,
toRefs
,
toRef
,
getCurrentInstance
,
watch
,
computed
,
onMounted
,
}
from
"vue"
;
import
{
changeNumToHan
}
from
"../../utils/index"
;
export
default
{
props
:
{
paperData
:
Object
,
sort
:
Number
,
sortTotal
:
Number
,
isLast
:
Boolean
},
setup
(
props
,
context
)
{
let
{
ctx
}
=
getCurrentInstance
();
props
.
paperData
.
DetailsList
.
forEach
((
item
,
index
)
=>
{
item
.
myAnswer
=
""
;
});
let
data
=
reactive
({
data
:
props
.
paperData
,
autoplay
:
false
,
sortIndex
:
props
.
sort
+
1
,
sortTotal
:
props
.
sortTotal
,
current
:
1
,
//默认从第几个开始-用于从快捷菜单点入
ExamIndex
:
1
,
//第几题
});
let
methods
=
{
changeNumToHan
,
jumpPage
()
{
uni
.
navigateTo
({
url
:
"/pages/exam/examPaper"
,
});
},
back
()
{
uni
.
navigateBack
();
},
onchange
(
e
)
{
data
.
ExamIndex
=
e
.
detail
.
current
;
if
(
data
.
ExamIndex
===
data
.
data
.
DetailsList
.
length
+
1
)
{
console
.
log
(
'进入'
)
this
.
$emit
(
'getAfterTopic'
);
}
if
(
e
.
detail
.
current
==
0
)
{
this
.
$emit
(
'getBeforeTopic'
);
}
}
};
onMounted
(()
=>
{
if
(
props
.
isLast
)
{
data
.
current
=
props
.
paperData
.
DetailsList
.
length
;
}
})
let
that
=
methods
;
return
{
...
toRefs
(
data
),
...
methods
,
};
},
};
</
script
>
<
style
scoped
>
.name
{
height
:
90
rpx
;
font-size
:
28
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
800
;
color
:
#111111
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
.Single_Before
{
font-size
:
28
rpx
;
font-weight
:
bold
;
color
:
#DA7878
;
}
.swiper-box
{
height
:
calc
(
100vh
-
270
rpx
);
box-sizing
:
border-box
;
}
.num
{
font-size
:
26
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
color
:
#111111
;
}
.item
{
margin-bottom
:
40
rpx
;
}
.item1
{
margin
:
25
rpx
0
;
align-items
:
center
;
}
.item2
{
/* padding-left: 25rpx; */
margin
:
30
rpx
0
;
}
.choose
{
background-color
:
#00acf9
!important
;
color
:
#ffffff
!important
;
}
.chooseNum
{
width
:
40
rpx
;
height
:
40
rpx
;
text-align
:
center
;
line-height
:
40
rpx
;
border-radius
:
50%
;
border
:
1px
solid
#e2e2e2
;
margin-right
:
30
rpx
;
font-size
:
26
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
color
:
#111111
;
}
.chooseName
{
font-size
:
24
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#111111
;
}
.input
{
box-sizing
:
border-box
;
width
:
690
rpx
;
border-bottom
:
2
rpx
solid
#000
;
color
:
#000
;
font-size
:
22
rpx
;
}
.textarea
{
box-sizing
:
border-box
;
padding
:
20
rpx
0
;
}
/
deep
/
.textarea-placeholder
{
font-size
:
20
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#cccccc
;
}
</
style
>
src/components/subject/SharingChoose.vue
0 → 100644
View file @
b0a67478
<
template
>
<!-- 计算题 -->
<view>
<view
class=
"item"
style=
"padding:0 20px;"
>
<view
class=
"name"
>
<view>
{{
changeNumToHan
(
sortIndex
)
}}
、
{{
data
.
GroupName
}}
<text
style=
"color:#999999;"
>
(共
{{
data
.
DetailsList
.
length
}}
道,
{{
data
.
GScore
}}
分)
</text>
</view>
<view>
<text
class=
"Single_Before"
>
{{
ExamIndex
}}
</text>
/
<text
class=
"Exam_Total"
>
{{
data
.
DetailsList
.
length
}}
</text>
</view>
</view>
<swiper
class=
"swiper-box"
:autoplay=
"autoplay"
:current=
"current"
@
change=
"onchange"
>
<swiper-item
v-if=
"sortIndex != 1"
></swiper-item>
<swiper-item
v-for=
"(item1, index1) in data.DetailsList"
:key=
"item1.id"
>
<view
class=
"item1"
>
<view
class=
"flex flex_start_center"
>
<view>
{{
index1
+
1
}}
、
</view>
<view
class=
"num"
v-html=
"item1.Title"
></view>
</view>
<view
class=
"chooseName"
>
<textarea
type=
"text"
v-model=
"item1.myAnswer"
class=
"input textarea"
placeholder=
"请填写答案"
placeholder-style=
"textarea-placeholder"
:maxlength=
"-1"
/>
</view>
</view>
</swiper-item>
<swiper-item
v-if=
"sortIndex != sortTotal"
></swiper-item>
</swiper>
</view>
<van-toast
id=
"van-toast"
/>
</view>
</
template
>
<
script
>
import
{
ref
,
reactive
,
toRefs
,
toRef
,
getCurrentInstance
,
watch
,
computed
,
onMounted
,
}
from
"vue"
;
import
{
changeNumToHan
}
from
"../../utils/index"
;
export
default
{
props
:
{
paperData
:
Object
,
sort
:
Number
,
sortTotal
:
Number
,
isLast
:
Boolean
},
setup
(
props
,
context
)
{
let
{
ctx
}
=
getCurrentInstance
();
props
.
paperData
.
DetailsList
.
forEach
((
item
,
index
)
=>
{
item
.
myAnswer
=
""
;
});
let
data
=
reactive
({
data
:
props
.
paperData
,
autoplay
:
false
,
sortIndex
:
props
.
sort
+
1
,
sortTotal
:
props
.
sortTotal
,
current
:
1
,
//默认从第几个开始-用于从快捷菜单点入
ExamIndex
:
1
,
//第几题
});
let
methods
=
{
changeNumToHan
,
jumpPage
()
{
uni
.
navigateTo
({
url
:
"/pages/exam/examPaper"
,
});
},
back
()
{
uni
.
navigateBack
();
},
onchange
(
e
)
{
data
.
ExamIndex
=
e
.
detail
.
current
;
if
(
data
.
ExamIndex
===
data
.
data
.
DetailsList
.
length
+
1
)
{
console
.
log
(
'进入'
)
this
.
$emit
(
'getAfterTopic'
);
}
if
(
e
.
detail
.
current
==
0
)
{
this
.
$emit
(
'getBeforeTopic'
);
}
}
};
onMounted
(()
=>
{
if
(
props
.
isLast
)
{
data
.
current
=
props
.
paperData
.
DetailsList
.
length
;
}
})
let
that
=
methods
;
return
{
...
toRefs
(
data
),
...
methods
,
};
},
};
</
script
>
<
style
scoped
>
.name
{
height
:
90
rpx
;
font-size
:
28
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
800
;
color
:
#111111
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
.Single_Before
{
font-size
:
28
rpx
;
font-weight
:
bold
;
color
:
#DA7878
;
}
.swiper-box
{
height
:
calc
(
100vh
-
270
rpx
);
box-sizing
:
border-box
;
}
.num
{
font-size
:
26
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
color
:
#111111
;
}
.item
{
margin-bottom
:
40
rpx
;
}
.item1
{
margin
:
25
rpx
0
;
align-items
:
center
;
}
.item2
{
/* padding-left: 25rpx; */
margin
:
30
rpx
0
;
}
.choose
{
background-color
:
#00acf9
!important
;
color
:
#ffffff
!important
;
}
.chooseNum
{
width
:
40
rpx
;
height
:
40
rpx
;
text-align
:
center
;
line-height
:
40
rpx
;
border-radius
:
50%
;
border
:
1px
solid
#e2e2e2
;
margin-right
:
30
rpx
;
font-size
:
26
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
color
:
#111111
;
}
.chooseName
{
font-size
:
24
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#111111
;
}
.input
{
box-sizing
:
border-box
;
width
:
690
rpx
;
border-bottom
:
2
rpx
solid
#000
;
color
:
#000
;
font-size
:
22
rpx
;
}
.textarea
{
box-sizing
:
border-box
;
padding
:
20
rpx
0
;
}
/
deep
/
.textarea-placeholder
{
font-size
:
20
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#cccccc
;
}
</
style
>
src/pages/exam/examPaper.vue
View file @
b0a67478
...
@@ -147,25 +147,25 @@
...
@@ -147,25 +147,25 @@
@
getBeforeTopic=
"getBeforeTopic()"
@
getBeforeTopic=
"getBeforeTopic()"
v-if=
"item.QuestionTypeKey === 'calculation' && index === changeIndex"
v-if=
"item.QuestionTypeKey === 'calculation' && index === changeIndex"
/>
/>
<!-- 口语
题 -->
<!-- 分录
题 -->
<Spoken
<EntryProblem
:paperData=
"item"
:paperData=
"item"
:isLast=
"isLast"
:isLast=
"isLast"
:sort=
"index"
:sort=
"index"
:sortTotal=
"peaperDetail.Paper.GroupList.length"
:sortTotal=
"peaperDetail.Paper.GroupList.length"
@
getAfterTopic=
"getAfterTopic()"
@
getAfterTopic=
"getAfterTopic()"
@
getBeforeTopic=
"getBeforeTopic()"
@
getBeforeTopic=
"getBeforeTopic()"
v-if=
"item.QuestionTypeKey === 'spoken
' && index === changeIndex"
v-if=
"item.QuestionTypeKey === 'entry-problem
' && index === changeIndex"
/>
/>
<!-- 分录
题 -->
<!-- 口语
题 -->
<EntryProblem
<Spoken
:paperData=
"item"
:paperData=
"item"
:isLast=
"isLast"
:isLast=
"isLast"
:sort=
"index"
:sort=
"index"
:sortTotal=
"peaperDetail.Paper.GroupList.length"
:sortTotal=
"peaperDetail.Paper.GroupList.length"
@
getAfterTopic=
"getAfterTopic()"
@
getAfterTopic=
"getAfterTopic()"
@
getBeforeTopic=
"getBeforeTopic()"
@
getBeforeTopic=
"getBeforeTopic()"
v-if=
"item.QuestionTypeKey === 'entry-problem
' && index === changeIndex"
v-if=
"item.QuestionTypeKey === 'spoken
' && index === changeIndex"
/>
/>
<!-- 其他 -->
<!-- 其他 -->
<Other
<Other
...
@@ -199,6 +199,18 @@
...
@@ -199,6 +199,18 @@
item.QuestionTypeKey === 'data-question' && index === changeIndex
item.QuestionTypeKey === 'data-question' && index === changeIndex
"
"
/>
/>
<!-- 公用选择题 -->
<SharingChoose
:paperData=
"item"
:isLast=
"isLast"
:sort=
"index"
:sortTotal=
"peaperDetail.Paper.GroupList.length"
@
getAfterTopic=
"getAfterTopic()"
@
getBeforeTopic=
"getBeforeTopic()"
v-if=
"
item.QuestionTypeKey === 'sharing-choose' && index === changeIndex
"
/>
<!-- 排序题 -->
<!-- 排序题 -->
<SortingProblem
<SortingProblem
:paperData=
"item"
:paperData=
"item"
...
@@ -258,6 +270,7 @@ import Cloze from "../../components/subject/Cloze.vue";
...
@@ -258,6 +270,7 @@ import Cloze from "../../components/subject/Cloze.vue";
import
Dataquestion
from
"../../components/subject/Dataquestion.vue"
;
import
Dataquestion
from
"../../components/subject/Dataquestion.vue"
;
import
SortingProblem
from
"../../components/subject/SortingProblem.vue"
;
import
SortingProblem
from
"../../components/subject/SortingProblem.vue"
;
import
Connect
from
"../../components/subject/Connect.vue"
;
//"连线题"
import
Connect
from
"../../components/subject/Connect.vue"
;
//"连线题"
import
SharingChoose
from
"../../components/subject/SharingChoose.vue"
import
Sort
from
"../../components/subject/Sort"
;
//"排序题"
import
Sort
from
"../../components/subject/Sort"
;
//"排序题"
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -277,7 +290,8 @@ export default {
...
@@ -277,7 +290,8 @@ export default {
Cloze
,
Cloze
,
Dataquestion
,
Dataquestion
,
SortingProblem
,
SortingProblem
,
EntryProblem
,
SharingChoose
,
Connect
,
Connect
,
Sort
,
Sort
,
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment