Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thinkApp
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
游洁
thinkApp
Commits
e2d0552f
Commit
e2d0552f
authored
Jun 06, 2022
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
临时提交
parent
36d983b4
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
689 additions
and
25 deletions
+689
-25
courseCard.vue
src/components/index/workSituation/courseCard.vue
+1
-1
operation.vue
src/components/setComments/operation.vue
+238
-0
rules.vue
src/components/setComments/rules.vue
+238
-0
setComments.vue
src/components/setComments/setComments.vue
+5
-4
studentsPopu.vue
src/components/setComments/studentsPopu.vue
+11
-11
pages.json
src/pages.json
+5
-0
index.vue
src/pages/index/index.vue
+4
-4
workSituation.vue
src/pages/index/workSituation.vue
+4
-3
setComments.vue
src/pages/setComments/setComments.vue
+2
-2
teacher-commit.vue
src/pages/setComments/teacher-commit.vue
+181
-0
No files found.
src/components/index/workSituation/courseCard.vue
View file @
e2d0552f
...
...
@@ -174,7 +174,7 @@
queryTecherCourse
(){
getTeacherCourse
().
then
(
r
=>
{
data
.
courses
=
r
.
Data
data
.
titleList
[
0
].
data
=
r
.
Data
.
AllCourseList
data
.
titleList
[
0
].
data
=
r
.
Data
.
AllCourseList
.
reverse
()
data
.
titleList
[
1
].
data
=
r
.
Data
.
NotFinishList
data
.
titleList
[
2
].
data
=
r
.
Data
.
FinishList
data
.
currentCourse
=
r
.
Data
.
AllCourseList
.
length
>
0
?
r
.
Data
.
AllCourseList
[
0
]:
null
...
...
src/components/setComments/operation.vue
0 → 100644
View file @
e2d0552f
<
template
>
<view
class=
"operation-box flex"
style=
"height: 100%;flex-direction: column;"
>
<view
style=
"font-size: 36rpx;font-weight:400;color:#282828;margin: 50rpx;"
>
选择参考作业
</view>
<view
style=
"flex:1;height: 1px;overflow-y: auto;"
v-if=
"workList && workList.length>0"
>
<view
class=
"operation activeOne flex"
style=
"align-items: center;"
v-for=
"(item,index) in workList"
:key=
"index"
>
<van-checkbox
:value=
"item.checked"
@
change=
"onChangeSelect"
:data-index=
"index"
></van-checkbox>
<view
class=
"operation-center-box"
:class=
"[
{'active':item.checked}]" style="flex:1;width:1px;margin-left:20rpx" @click="changeByBoxHandler(index)">
<view
class=
"operation-center-line"
></view>
<view
class=
"operation-center flex"
>
<view
class=
"operation-left"
>
<view
class=
"operation-name"
>
{{
item
.
HomeWorkTitle
}}
</view>
<view
class=
"operation-state flex"
>
<view
class=
"operation-state-point"
></view>
<view
class=
"operation-state-text"
>
{{
item
.
Status
==
0
?
'未开始'
:(
item
.
Status
==
1
?
'进行中'
:
'已结束'
)
}}
</view>
</view>
</view>
<view
class=
"operation-right flex"
>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
学生数
</view>
<view
class=
"homework-score-num flex"
>
{{
item
.
StuNum
}}
</view>
</view>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
已提交
</view>
<view
class=
"homework-score-num flex"
>
{{
item
.
SubmitNum
}}
</view>
</view>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
已批阅
</view>
<view
class=
"homework-score-num flex"
>
{{
item
.
ReviewNum
}}
</view>
</view>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
优 秀
</view>
<view
class=
"homework-score-num flex"
>
{{
item
.
ExcellentNum
}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view
class=
"noData"
v-else
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653902791000_806.png"
mode=
"widthFix"
></image>
<view>
暂无课程信息
</view>
</view>
<view
style=
"padding: 20rpx 50rpx;"
v-if=
"workList && workList.length>0"
>
<van-button
type=
"danger"
round
block
@
click=
"selectWorkHandler"
>
确认选择
</van-button>
</view>
</view>
</
template
>
<
script
>
import
{
reactive
,
toRefs
,
onMounted
,
getCurrentInstance
,
inject
,
watch
}
from
"vue"
;
export
default
{
props
:
{
dataList
:[]
},
components
:
{},
emits
:[
'selected'
],
setup
(
props
,
ctx
)
{
let
data
=
reactive
({
workList
:
props
.
dataList
});
watch
(
()
=>
props
.
dataList
,
(
newValue
,
oldValue
)
=>
{
data
.
workList
=
newValue
}
)
let
methods
=
{
onChangeSelect
(
e
){
console
.
log
(
e
,
data
.
workList
[
e
.
target
.
dataset
.
index
],
data
.
workList
[
e
.
target
.
dataset
.
index
].
checked
)
data
.
workList
[
e
.
target
.
dataset
.
index
].
checked
=
e
.
detail
},
changeByBoxHandler
(
i
){
data
.
workList
[
i
].
checked
=!
data
.
workList
[
i
].
checked
},
selectWorkHandler
(){
let
temp
=
data
.
workList
.
filter
(
x
=>
{
return
x
.
checked
==
true
});
ctx
.
emit
(
'selected'
,
temp
)
}
}
return
{
...
toRefs
(
data
),
...
methods
};
}
};
</
script
>
<
style
scoped
>
.operation-box
.noData
{
text-align
:
center
;
flex
:
1
;
width
:
100%
;
}
.operation-box
.noData
image
{
width
:
200
rpx
;
margin-bottom
:
40
rpx
;
}
.operation-box
.noData
view
{
font-size
:
24
rpx
;
color
:
#cecece
;
text-align
:
center
;
}
.homework-score-num
view
:last-child
{
font-size
:
23
rpx
;
margin-top
:
25
rpx
;
}
.homework-score-num
view
:first-child
{
margin-right
:
10
rpx
;
font-size
:
46
rpx
;
font-weight
:
800
;
}
.homework-score-num
{
font-weight
:
800
;
font-style
:
italic
;
font-size
:
36
rpx
;
}
.homework-score-title
{
font-size
:
20
rpx
;
margin-bottom
:
0
rpx
;
font-weight
:
400
;
letter-spacing
:
1px
;
margin-bottom
:
15
rpx
;
}
.homework-score
:last-child
{
margin-right
:
0
rpx
;
}
.homework-score
{
margin-right
:
16
rpx
;
flex-direction
:
column
;
justify-content
:
center
;
}
.operation-right
{
height
:
122
rpx
;
background
:
#FCEEEF
;
padding
:
23
rpx
46
rpx
15
rpx
46
rpx
;
border-radius
:
30
rpx
;
justify-content
:
space-between
;
flex-shrink
:
0
;
margin-left
:
11
rpx
;
color
:
#CE8086
;
}
.operation.activeOne
.operation-state-text
{
color
:
#08be42
;
}
.operation-state-text
{
font-size
:
20
rpx
;
letter-spacing
:
2px
;
}
.operation.activeOne
.operation-state-point
{
background
:
#08be42
;
}
.operation-state-point
{
width
:
12
rpx
;
height
:
12
rpx
;
border-radius
:
50%
;
margin-right
:
9
rpx
;
margin-top
:
11
rpx
;
}
.operation-state
{
margin-top
:
35
rpx
;
font-size
:
20
rpx
;
}
.operation.activeOne
.operation-name
{
color
:
#282828
;
}
.operation-name
{
height
:
70
rpx
;
font-size
:
26
rpx
;
word-break
:
break-all
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-box-orient
:
vertical
;
-webkit-line-clamp
:
2
;
overflow
:
hidden
;
margin-top
:
9
rpx
;
letter-spacing
:
1px
;
font-weight
:
bold
;
}
.operation-left
{
flex-grow
:
1
;
}
.operation-center
{
justify-content
:
space-between
;
}
.operation-center-line
{
width
:
4
rpx
;
height
:
23
rpx
;
background
:
#282828
;
position
:
absolute
;
left
:
0
;
top
:
46
rpx
;
}
.operation.activeOne
.operation-center-box
{
background
:
#FFFFFF
;
}
.operation-center-box
{
flex-grow
:
1
;
position
:
relative
;
border-radius
:
30
rpx
;
padding
:
31
rpx
40
rpx
21
rpx
22
rpx
;
margin-bottom
:
50
rpx
;
box-shadow
:
0px
6px
29px
0px
rgba
(
76
,
76
,
76
,
0.09
);
border-radius
:
30
rpx
;
}
.operation-center-box.active
{
background-color
:
dodgerblue
!important
;
}
.operation-center-box.active
.operation-center-line
{
background
:
#FFF
!important
;
}
.operation-center-box.active
.operation-state-text
,
.operation-center-box.active
.operation-name
{
color
:
#FFF
!important
;
}
.operation
{
margin
:
0
50
rpx
;
}
.operation-box
{
}
</
style
>
src/components/setComments/rules.vue
0 → 100644
View file @
e2d0552f
<
template
>
<view
class=
"operation-box flex"
style=
"height: 100%;flex-direction: column;"
>
<view
style=
"font-size: 36rpx;font-weight:400;color:#282828;margin: 50rpx;"
>
选择参考作业
</view>
<view
style=
"flex:1;height: 1px;overflow-y: auto;"
v-if=
"workList && workList.length>0"
>
<view
class=
"operation activeOne flex"
style=
"align-items: center;"
v-for=
"(item,index) in workList"
:key=
"index"
>
<van-checkbox
:value=
"item.checked"
@
change=
"onChangeSelect"
:data-index=
"index"
></van-checkbox>
<view
class=
"operation-center-box"
:class=
"[
{'active':item.checked}]" style="flex:1;width:1px;margin-left:20rpx" @click="changeByBoxHandler(index)">
<view
class=
"operation-center-line"
></view>
<view
class=
"operation-center flex"
>
<view
class=
"operation-left"
>
<view
class=
"operation-name"
>
{{
item
.
HomeWorkTitle
}}
</view>
<view
class=
"operation-state flex"
>
<view
class=
"operation-state-point"
></view>
<view
class=
"operation-state-text"
>
{{
item
.
Status
==
0
?
'未开始'
:(
item
.
Status
==
1
?
'进行中'
:
'已结束'
)
}}
</view>
</view>
</view>
<view
class=
"operation-right flex"
>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
学生数
</view>
<view
class=
"homework-score-num flex"
>
{{
item
.
StuNum
}}
</view>
</view>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
已提交
</view>
<view
class=
"homework-score-num flex"
>
{{
item
.
SubmitNum
}}
</view>
</view>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
已批阅
</view>
<view
class=
"homework-score-num flex"
>
{{
item
.
ReviewNum
}}
</view>
</view>
<view
class=
"homework-score flex"
>
<view
class=
"homework-score-title"
>
优 秀
</view>
<view
class=
"homework-score-num flex"
>
{{
item
.
ExcellentNum
}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view
class=
"noData"
v-else
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653902791000_806.png"
mode=
"widthFix"
></image>
<view>
暂无课程信息
</view>
</view>
<view
style=
"padding: 20rpx 50rpx;"
v-if=
"workList && workList.length>0"
>
<van-button
type=
"danger"
round
block
@
click=
"selectWorkHandler"
>
确认选择
</van-button>
</view>
</view>
</
template
>
<
script
>
import
{
reactive
,
toRefs
,
onMounted
,
getCurrentInstance
,
inject
,
watch
}
from
"vue"
;
export
default
{
props
:
{
dataList
:[]
},
components
:
{},
emits
:[
'selected'
],
setup
(
props
,
ctx
)
{
let
data
=
reactive
({
workList
:
props
.
dataList
});
watch
(
()
=>
props
.
dataList
,
(
newValue
,
oldValue
)
=>
{
data
.
workList
=
newValue
}
)
let
methods
=
{
onChangeSelect
(
e
){
console
.
log
(
e
,
data
.
workList
[
e
.
target
.
dataset
.
index
],
data
.
workList
[
e
.
target
.
dataset
.
index
].
checked
)
data
.
workList
[
e
.
target
.
dataset
.
index
].
checked
=
e
.
detail
},
changeByBoxHandler
(
i
){
data
.
workList
[
i
].
checked
=!
data
.
workList
[
i
].
checked
},
selectWorkHandler
(){
let
temp
=
data
.
workList
.
filter
(
x
=>
{
return
x
.
checked
==
true
});
ctx
.
emit
(
'selected'
,
temp
)
}
}
return
{
...
toRefs
(
data
),
...
methods
};
}
};
</
script
>
<
style
scoped
>
.operation-box
.noData
{
text-align
:
center
;
flex
:
1
;
width
:
100%
;
}
.operation-box
.noData
image
{
width
:
200
rpx
;
margin-bottom
:
40
rpx
;
}
.operation-box
.noData
view
{
font-size
:
24
rpx
;
color
:
#cecece
;
text-align
:
center
;
}
.homework-score-num
view
:last-child
{
font-size
:
23
rpx
;
margin-top
:
25
rpx
;
}
.homework-score-num
view
:first-child
{
margin-right
:
10
rpx
;
font-size
:
46
rpx
;
font-weight
:
800
;
}
.homework-score-num
{
font-weight
:
800
;
font-style
:
italic
;
font-size
:
36
rpx
;
}
.homework-score-title
{
font-size
:
20
rpx
;
margin-bottom
:
0
rpx
;
font-weight
:
400
;
letter-spacing
:
1px
;
margin-bottom
:
15
rpx
;
}
.homework-score
:last-child
{
margin-right
:
0
rpx
;
}
.homework-score
{
margin-right
:
16
rpx
;
flex-direction
:
column
;
justify-content
:
center
;
}
.operation-right
{
height
:
122
rpx
;
background
:
#FCEEEF
;
padding
:
23
rpx
46
rpx
15
rpx
46
rpx
;
border-radius
:
30
rpx
;
justify-content
:
space-between
;
flex-shrink
:
0
;
margin-left
:
11
rpx
;
color
:
#CE8086
;
}
.operation.activeOne
.operation-state-text
{
color
:
#08be42
;
}
.operation-state-text
{
font-size
:
20
rpx
;
letter-spacing
:
2px
;
}
.operation.activeOne
.operation-state-point
{
background
:
#08be42
;
}
.operation-state-point
{
width
:
12
rpx
;
height
:
12
rpx
;
border-radius
:
50%
;
margin-right
:
9
rpx
;
margin-top
:
11
rpx
;
}
.operation-state
{
margin-top
:
35
rpx
;
font-size
:
20
rpx
;
}
.operation.activeOne
.operation-name
{
color
:
#282828
;
}
.operation-name
{
height
:
70
rpx
;
font-size
:
26
rpx
;
word-break
:
break-all
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-box-orient
:
vertical
;
-webkit-line-clamp
:
2
;
overflow
:
hidden
;
margin-top
:
9
rpx
;
letter-spacing
:
1px
;
font-weight
:
bold
;
}
.operation-left
{
flex-grow
:
1
;
}
.operation-center
{
justify-content
:
space-between
;
}
.operation-center-line
{
width
:
4
rpx
;
height
:
23
rpx
;
background
:
#282828
;
position
:
absolute
;
left
:
0
;
top
:
46
rpx
;
}
.operation.activeOne
.operation-center-box
{
background
:
#FFFFFF
;
}
.operation-center-box
{
flex-grow
:
1
;
position
:
relative
;
border-radius
:
30
rpx
;
padding
:
31
rpx
40
rpx
21
rpx
22
rpx
;
margin-bottom
:
50
rpx
;
box-shadow
:
0px
6px
29px
0px
rgba
(
76
,
76
,
76
,
0.09
);
border-radius
:
30
rpx
;
}
.operation-center-box.active
{
background-color
:
dodgerblue
!important
;
}
.operation-center-box.active
.operation-center-line
{
background
:
#FFF
!important
;
}
.operation-center-box.active
.operation-state-text
,
.operation-center-box.active
.operation-name
{
color
:
#FFF
!important
;
}
.operation
{
margin
:
0
50
rpx
;
}
.operation-box
{
}
</
style
>
src/components/setComments/setComments.vue
View file @
e2d0552f
<
template
>
<view
class=
"setComments-box"
>
<
!--
<
view
class=
"setComments-add"
@
click=
"addComments"
>
<view
class=
"setComments-add"
@
click=
"addComments"
>
<van-icon
name=
"plus"
/><text>
创建评价
</text>
</view>
-->
</view>
<view
class=
"index-student-information"
>
<view
class=
"setComments-content-box"
v-if=
"dataList.length>0"
>
<template
v-for=
"(item,index) in dataList"
>
...
...
@@ -57,7 +57,7 @@
}
from
"vue"
;
import
navbar
from
'../../components/navbar.vue'
export
default
{
props
:
[
"CourseCommentTimesList"
],
props
:
[
"CourseCommentTimesList"
,
"courseId"
],
emits
:
[
'refreshData'
],
components
:
{
navbar
,
...
...
@@ -74,8 +74,9 @@
});
let
methods
=
{
addComments
(){
console
.
log
(
props
.
courseId
)
uni
.
navigateTo
({
url
:
'/pages/setComments/
commentRulesList?show='
+
true
url
:
'/pages/setComments/
teacher-commit?courseId='
+
props
.
courseId
})
},
showActionHandler
(
item
){
...
...
src/components/setComments/studentsPopu.vue
View file @
e2d0552f
...
...
@@ -84,17 +84,17 @@
}
};
//监听属性数组
//
watch(() => props["courseStuList"], (newValue, oldValue) => {
//
if (newValue != oldValue && newValue && newValue.length > 0) {
//
let addList = function(arr) {
//
arr.forEach((item) => {item.state = false;})
//
}
//
addList(newValue);
//
data.stuList = newValue;
//
}
//
}, {
//
deep: true,
//
});
watch
(()
=>
props
[
"courseStuList"
],
(
newValue
,
oldValue
)
=>
{
if
(
newValue
!=
oldValue
&&
newValue
&&
newValue
.
length
>
0
)
{
let
addList
=
function
(
arr
)
{
arr
.
forEach
((
item
)
=>
{
item
.
state
=
false
;})
}
addList
(
newValue
);
data
.
stuList
=
newValue
;
}
},
{
deep
:
true
,
});
let
that
=
methods
;
return
{
...
toRefs
(
data
),
...
...
src/pages.json
View file @
e2d0552f
...
...
@@ -66,6 +66,11 @@
"style"
:
{
"navigationStyle"
:
"custom"
}
},{
"path"
:
"pages/setComments/teacher-commit"
//
"style"
:
{
//
"navigationStyle"
:
"custom"
//
}
}
],
...
...
src/pages/index/index.vue
View file @
e2d0552f
...
...
@@ -145,16 +145,16 @@
},
onShareAppMessage
()
{
return
{
title
:
"
学情反馈信息
"
,
title
:
"
进阶思维学情反馈
"
,
query
:
"/pages/index/index"
,
imageUrl
:
""
,
imageUrl
:
"
https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1654483222000_317.png
"
,
};
},
onShareTimeline
()
{
return
{
title
:
"
学情反馈信息
"
,
title
:
"
进阶思维学情反馈
"
,
query
:
"/pages/index/index"
,
imageUrl
:
""
,
imageUrl
:
"
https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1654483222000_317.png
"
,
};
},
};
...
...
src/pages/index/workSituation.vue
View file @
e2d0552f
...
...
@@ -131,7 +131,8 @@
data
.
showPopu
=
status
==
1
},
goSet
(){
let
url
=
'/pages/setComments/setComments?CourseId='
+
data
.
currentCourseId
;
//let url='/pages/setComments/setComments?CourseId='+data.currentCourseId;
let
url
=
'/pages/setComments/teacher-commit?courseId='
+
data
.
currentCourseId
;
console
.
log
(
"url"
,
url
);
uni
.
navigateTo
({
url
:
url
...
...
@@ -260,14 +261,14 @@
return
{
title
:
"进阶思维学情反馈"
,
query
:
"/pages/index/index"
,
imageUrl
:
""
,
imageUrl
:
"
https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1654483222000_317.png
"
,
};
},
onShareTimeline
()
{
return
{
title
:
"进阶思维学情反馈"
,
query
:
"/pages/index/index"
,
imageUrl
:
""
,
imageUrl
:
"
https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1654483222000_317.png
"
,
};
},
};
...
...
src/pages/setComments/setComments.vue
View file @
e2d0552f
...
...
@@ -30,7 +30,7 @@
</view>
</view>
</view>
<setComments
:CourseCommentTimesList=
"courseTimeList
"
@
refreshData=
"getCourseCommentTimes"
></setComments>
<setComments
v-if=
"Msg.CourseId!=''"
:CourseCommentTimesList=
"courseTimeList"
:courseId=
"Msg.CourseId
"
@
refreshData=
"getCourseCommentTimes"
></setComments>
</view>
</view>
...
...
@@ -120,7 +120,7 @@
},
onLoad
(
option
)
{
this
.
Msg
.
CourseId
=
option
.
CourseId
;
console
.
log
(
option
)
},
onShow
()
{
this
.
getCourseRule
();
...
...
src/pages/setComments/teacher-commit.vue
0 → 100644
View file @
e2d0552f
<
template
>
<page-meta>
<view
style=
"height: 100vh;background-color: #f5f5f5;"
>
<van-cell-group
title=
"基本信息"
inset
>
<van-field
v-model=
"msg.Title"
placeholder=
"输入本次评价名称"
label=
"评语标题"
:border=
"false"
@
change=
"changeTitle"
input-align=
"right"
/>
<van-cell
title=
"参与学员"
:value=
"showStusStr"
is-link
@
click=
"showStus=StuList.length>0"
/>
</van-cell-group>
<van-cell-group
title=
"生成参数"
inset
>
<van-cell
title=
"参考作业"
:value=
"showWorkStr"
is-link
@
click=
"showWorks=homeWorks.length>0"
/>
<van-cell
title=
"使用模板"
>
<view
slot=
""
>
<van-switch
:checked=
"msg.UseTemplate"
@
change=
"changeCreateMethod"
active-color=
"#C91727"
inactive-color=
"#282828"
size=
"24px"
/>
</view>
</van-cell>
<van-cell
title=
"选择模板"
v-if=
"msg.UseTemplate"
:value=
"showWorkStr"
is-link
@
click=
"showWorks=homeWorks.length>0"
/>
</van-cell-group>
<van-cell-group
title=
"评语内容"
inset
v-if=
"!msg.UseTemplate"
>
<textarea
placeholder=
"请填写评论内容"
class=
"user-pingyu"
v-model=
"msg.Info"
></textarea>
</van-cell-group>
</view>
<van-popup
:z-index=
"1000"
:show=
"showStus"
:round=
"true"
position=
"bottom"
custom-style=
"height: 70vh"
@
close=
"closepopup"
>
<studentsPopu
:courseStuList=
"StuList"
@
getdata=
"getChosenStus"
></studentsPopu>
</van-popup>
<van-popup
:z-index=
"1000"
:show=
"showWorks"
:close-on-click-overlay=
"false"
:round=
"true"
position=
"bottom"
custom-style=
"height: 70vh"
@
close=
"closepopupWork"
>
<operation
:dataList=
"homeWorks"
@
selected=
"selectedWorkHandler"
></operation>
</van-popup>
</page-meta>
</
template
>
<
script
>
import
{
reactive
,
toRefs
,
onMounted
,
getCurrentInstance
,
inject
}
from
"vue"
;
import
studentsPopu
from
'@/components/setComments/studentsPopu'
import
operation
from
'@/components/setComments/operation'
export
default
{
props
:
{},
components
:
{
studentsPopu
,
operation
},
setup
()
{
let
{
proxy
}
=
getCurrentInstance
();
uni
.
setNavigationBarTitle
({
title
:
'手动创建评语'
})
let
data
=
reactive
({
msg
:{
Title
:
''
,
StuId
:
''
,
CourseId
:
0
,
UseTemplate
:
true
,
TemplateId
:
0
,
Info
:
''
},
chosenStus
:[],
StuList
:[],
showStusStr
:
'全班'
,
showWorkStr
:
'请选择'
,
showStus
:
false
,
showWorks
:
false
,
homeWorks
:[],
chosenHomeWork
:[],
showTemplate
:[],
showTemplateStr
:
'请选择'
,
});
let
methods
=
{
changeTitle
({
detail
}){
data
.
msg
.
Title
=
detail
},
closepopup
(){
data
.
showStus
=
false
},
closepopupWork
(){
data
.
showWorks
=
false
},
changeCreateMethod
({
detail
}){
data
.
msg
.
UseTemplate
=
detail
},
getChosenStus
(
array
)
{
data
.
chosenStus
=
array
if
(
data
.
chosenStus
&&
data
.
chosenStus
.
length
>
0
){
if
(
data
.
chosenStus
.
length
==
data
.
StuList
.
length
){
data
.
showStusStr
=
`全班(
${
data
.
StuList
.
length
}
人)`
}
else
{
let
tempStr
=
""
data
.
chosenStus
.
forEach
((
x
,
i
)
=>
{
if
(
i
<
3
){
tempStr
=
`
${
tempStr
}
、
${
StuName
}
`
}
})
data
.
showStusStr
=
tempStr
.
substring
(
1
,
tempStr
.
length
-
1
)
data
.
showStusStr
+=
data
.
chosenStus
.
length
>
3
?
`等¥{data.chosenStus.length}人`
:
""
}
}
else
{
data
.
showStusStr
=
'请选择'
}
data
.
msg
.
StuId
=
[]
array
.
forEach
(
x
=>
{
data
.
msg
.
StuId
.
push
(
x
.
StuId
)
})
methods
.
closepopup
()
},
getCourseStu
()
{
uni
.
showLoading
()
let
stuMsg
=
{
courseId
:
data
.
msg
.
CourseId
};
proxy
.
$request
(
"/Teacher/GetCourseStu"
,
stuMsg
).
then
(
res
=>
{
console
.
log
(
"res"
,
res
);
if
(
res
)
{
data
.
StuList
=
res
.
Data
;
data
.
showStusStr
=
data
.
StuList
.
length
>
0
?
`请选择`
:
'暂无可选学员'
}
uni
.
hideLoading
()
})
},
getCourseHomeWorkList
(){
data
.
pageState
=
"loading"
;
proxy
.
$request
(
"/Teacher/GetCourseHomeWork"
,
{
'courseId'
:
data
.
msg
.
CourseId
}).
then
(
res
=>
{
if
(
res
){
res
.
Data
.
forEach
(
x
=>
{
x
.
checked
=
false
})
data
.
homeWorks
=
res
.
Data
;
data
.
showWorkStr
=
data
.
homeWorks
.
length
>
0
?
`请选择`
:
'暂无可选作业'
}
})
},
selectedWorkHandler
(
arr
){
data
.
chosenHomeWork
=
arr
data
.
showWorkStr
=
data
.
chosenHomeWork
.
length
>
0
?
`已选择
${
data
.
chosenHomeWork
.
length
}
个作业`
:
'请选择'
data
.
homeWorks
.
forEach
(
x
=>
{
x
.
checked
=
arr
.
find
(
y
=>
y
.
HomeWorkId
==
x
.
HomeWorkId
)?
true
:
false
})
methods
.
closepopupWork
()
}
};
return
{
...
toRefs
(
data
),
...
methods
};
},
onLoad
(
option
)
{
console
.
log
(
option
)
this
.
msg
.
CourseId
=
option
.
courseId
;
this
.
getCourseStu
()
this
.
getCourseHomeWorkList
()
},
onShow
()
{
}
};
</
script
>
<
style
scoped
>
.user-pingyu
{
width
:
100%
;
font-size
:
30
rpx
;
font-weight
:
400
;
color
:
#282828
;
background
:
#FFF
;
padding
:
20
rpx
;
line-height
:
48
rpx
;
}
</
style
>
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