Commit 8c12371c authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/youjie/thinkapp

parents b38307c4 dba62eab
<script> <script>
export default { export default {
onLaunch() { onLaunch() {
// console.log('App Launch') //调用定义的更新方法
// this.VersionUpdate();
}, },
onShow() { onShow() {
// console.log('App Show') // console.log('App Show')
...@@ -12,6 +13,63 @@ export default { ...@@ -12,6 +13,63 @@ export default {
onHide() { onHide() {
// console.log('App Hide') // console.log('App Hide')
}, },
methods:{
//定义更新方法
VersionUpdate() {
// 判断应用的 getUpdateManager 是否在当前版本可用
if (uni.canIUse('getUpdateManager')) {
const updateManager = uni.getUpdateManager()
// 向小程序后台请求完新版本信息
updateManager.onCheckForUpdate(function(res) {
if (res.hasUpdate) {
//小程序有新版本,静默下载新版本,新版本下载完成
updateManager.onUpdateReady(function() {
//模态弹窗(确认、取消)
uni.showModal({
title: '更新提示',
content: '小程序已发布新版本,是否重启?',
success: function(res) {
//用户点击确定
if (res.confirm) {
//当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
updateManager.applyUpdate()
} //用户点击取消
else if (res.cancel) {
//强制用户更新,弹出第二次弹窗
uni.showModal({
title: '提示',
content: '小程序已发布新版本,是否重启',
showCancel: false, //隐藏取消按钮
success: function(res) {
//第二次提示后,强制更新
if (res.confirm) {
// 当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
updateManager.applyUpdate()
}
}
})
}
}
})
})
// 当新版本下载失败
updateManager.onUpdateFailed(function() {
uni.showModal({
title: '提示',
content: '请您删除当前小程序,重新打开小程序',
})
})
}
})
} else {
// 提示用户在最新版本的客户端上体验
uni.showModal({
title: '温馨提示',
content: '当前微信版本过低,可能无法使用该功能,请升级到最新版本后重试。'
})
}
}
}
}; };
</script> </script>
......
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
queryTecherCourse(){ queryTecherCourse(){
getTeacherCourse().then(r=>{ getTeacherCourse().then(r=>{
data.courses=r.Data data.courses=r.Data
data.titleList[0].data=r.Data.AllCourseList.reverse() data.titleList[0].data=r.Data.AllCourseList;
data.titleList[1].data=r.Data.NotFinishList data.titleList[1].data=r.Data.NotFinishList
data.titleList[2].data=r.Data.FinishList data.titleList[2].data=r.Data.FinishList
data.currentCourse=r.Data.AllCourseList.length>0?r.Data.AllCourseList[0]:null data.currentCourse=r.Data.AllCourseList.length>0?r.Data.AllCourseList[0]:null
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<van-icon class="commentPopup-closure" name="cross" @click="closepopup" /> <van-icon class="commentPopup-closure" name="cross" @click="closepopup" />
<view class="commentPopup-title">修改评语</view> <view class="commentPopup-title">修改评语</view>
<view class="commentPopup-content"> <view class="commentPopup-content">
<textarea placeholder="请填写评语内容" v-model="stuCommentObj.Info"></textarea> <textarea placeholder="请填写评语内容" v-model="stuCommentObj.Info" maxlength="-1"></textarea>
</view> </view>
<view class="commentPopup-save flex"> <view class="commentPopup-save flex">
......
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
</view> </view>
</view> </view>
<view class="RuleSettings-content"> <view class="RuleSettings-content">
<textarea placeholder="请填写评论内容" v-model="ruleObj.Info"></textarea> <!-- <van-field v-model="ruleObj.Info" rows="10"/> -->
<textarea placeholder="请填写评论内容" v-model="ruleObj.Info" maxlength="-1"></textarea>
</view> </view>
<view class="rulesPopup-save flex"> <view class="rulesPopup-save flex">
<van-loading color="#f5f5f5" v-if="loading" /> <van-loading color="#f5f5f5" v-if="loading" />
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<view class="setComments-content" @click="goComment(item)"> <view class="setComments-content" @click="goComment(item)">
<view class="center-line"></view> <view class="center-line"></view>
<view class="setComments-title flex"> <view class="setComments-title flex">
<text class="setComments-title-left">{{item.Times}}次评价</text> <text class="setComments-title-left">{{item.Title}}</text>
<view class="setComments-title-right"> <view class="setComments-title-right">
<view class="setComments-options flex"> <view class="setComments-options flex">
<view class="setComments-options-title flex" @click.stop="showActionHandler(item)"> <view class="setComments-options-title flex" @click.stop="showActionHandler(item)">
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
} from "vue"; } from "vue";
import navbar from '../../components/navbar.vue' import navbar from '../../components/navbar.vue'
export default { export default {
props: ["CourseCommentTimesList","courseId"], props: ["CourseCommentTimesList","courseId","courseName"],
emits: ['refreshData'], emits: ['refreshData'],
components: { components: {
navbar, navbar,
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
addComments(){ addComments(){
console.log(props.courseId) console.log(props.courseId)
uni.navigateTo({ uni.navigateTo({
url: '/pages/setComments/teacher-commit?courseId=' + props.courseId url: '/pages/setComments/teacher-commit?courseId=' + props.courseId +'&courseName=' + props.courseName
}) })
}, },
showActionHandler(item){ showActionHandler(item){
...@@ -100,11 +100,11 @@ ...@@ -100,11 +100,11 @@
// item.optionsShow = !item.optionsShow; // item.optionsShow = !item.optionsShow;
// }, // },
clickoptions(type) { clickoptions(type) {
console.log("data.currentAction",data.currentAction);
let showTypeMsg = { let showTypeMsg = {
CourseId: data.currentAction.CourseId, CourseId: data.currentAction.CourseId,
Times: data.currentAction.Times, CommentMainId: data.currentAction.Id,
ShowType: type ShowType: type,
}; };
proxy.$request("/Teacher/SetStuCommentShowTypeByTimes", showTypeMsg).then(res => { proxy.$request("/Teacher/SetStuCommentShowTypeByTimes", showTypeMsg).then(res => {
if (res.Code==1) { if (res.Code==1) {
......
<template>
<view class="signOut-box" @click="signOut">
<view class="index-header-signOut flex">
<van-image width="72rpx" height="72rpx" fit="cover" class="img"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1654580469000_635.png" />
<text>退出登录</text>
</view>
</view>
</template>
<script>
import { reactive, toRefs, onMounted } from "vue";
export default {
name: "",
props: {
},
components: {},
setup(props) {
let data = reactive({
});
let methods = {
signOut(){
uni.showModal({
title: '提示',
content: '将退出登录,是否继续',
success: function(res) {
if (res.confirm) {
uni.reLaunch({
url: '/pages/login/accountLogin'
});
uni.removeStorageSync('userInfo')
} else if (res.cancel) {
}
}
});
}
};
onMounted(() => {
});
return {
...toRefs(data),
...methods,
};
},
};
</script>
<style scoped>
.index-header-signOut text{
font-size: 26rpx;
font-weight: bold;
color: #282828;
margin-left: 20rpx;
letter-spacing: 2rpx;
}
.index-header-signOut{
align-items: center;
}
.signOut-box{
padding: 0 30rpx;
}
</style>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<page-meta :page-style="showPopu?'overflow:hidden;':''"> <page-meta :page-style="showPopu?'overflow:hidden;':''">
<view class="indexpage"> <view class="indexpage">
<navbar class="navbarSticky" bg="#F6F6F6"> <navbar class="navbarSticky" bg="#F6F6F6">
<view class="index-header-box"> <!-- <view class="index-header-box">
<view class="index-header-img"> <view class="index-header-img">
<van-image width="100%" height="100%" fit="cover" class="img" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_713.png" /> <van-image width="100%" height="100%" fit="cover" class="img" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_713.png" />
</view> </view>
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
</view> </view>
<view class="index-header-name">{{userData.AccountName}}</view> <view class="index-header-name">{{userData.AccountName}}</view>
</view> </view>
</view> </view> -->
<signOut></signOut>
</navbar> </navbar>
<view style="margin: 40rpx 0 10rpx 0;"> <view style="margin: 40rpx 0 10rpx 0;">
<view style="padding:0 50rpx;font-weight: 800;color: #282828;"> <view style="padding:0 50rpx;font-weight: 800;color: #282828;">
...@@ -47,6 +48,7 @@ ...@@ -47,6 +48,7 @@
import JobComponents from '@/components/index/JobComponents' import JobComponents from '@/components/index/JobComponents'
import examComponents from '@/components/index/examComponents' import examComponents from '@/components/index/examComponents'
import commentsComponents from '@/components/index/commentsComponents' import commentsComponents from '@/components/index/commentsComponents'
import signOut from "@/components/signOut";
import vue, { import vue, {
ref, ref,
reactive, reactive,
...@@ -77,7 +79,8 @@ ...@@ -77,7 +79,8 @@
courseCard, courseCard,
JobComponents, JobComponents,
examComponents, examComponents,
commentsComponents commentsComponents,
signOut
}, },
setup(props) { setup(props) {
let { let {
...@@ -104,7 +107,6 @@ ...@@ -104,7 +107,6 @@
}); });
}, },
changeCourseHandler(id){ changeCourseHandler(id){
console.log(id,',,,,,,,,,,,,,')
methods.getStuHomeWorkAndExam(id) methods.getStuHomeWorkAndExam(id)
}, },
getStuCourse() { getStuCourse() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<page-meta :page-style="showPopu?'overflow:hidden;':''"> <page-meta :page-style="showPopu?'overflow:hidden;':''">
<view class="workSituationpage"> <view class="workSituationpage">
<navbar class="navbarSticky" bg="#F6F6F6"> <navbar class="navbarSticky" bg="#F6F6F6">
<view class="index-header-box" @click="back"> <!-- <view class="index-header-box" @click="back">
<view class="index-header-img"> <view class="index-header-img">
<van-image width="100%" height="100%" fit="cover" class="img" <van-image width="100%" height="100%" fit="cover" class="img"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_713.png" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_713.png" />
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
</view> </view>
<view class="index-header-name">{{userData.AccountName}}</view> <view class="index-header-name">{{userData.AccountName}}</view>
</view> </view>
</view> </view> -->
<signOut></signOut>
</navbar> </navbar>
<view style="margin: 40rpx 0 10rpx 0;" class="workSituationAccountName flex"> <view style="margin: 40rpx 0 10rpx 0;" class="workSituationAccountName flex">
<view style="padding:0 50rpx;font-weight: 800;color: #282828;"> <view style="padding:0 50rpx;font-weight: 800;color: #282828;">
...@@ -63,6 +64,7 @@ ...@@ -63,6 +64,7 @@
import operation from '@/components/index/workSituation/operation' import operation from '@/components/index/workSituation/operation'
import studentList from '@/components/index/workSituation/studentList' import studentList from '@/components/index/workSituation/studentList'
import examList from '@/components/index/workSituation/examList' import examList from '@/components/index/workSituation/examList'
import signOut from "@/components/signOut";
import vue, { import vue, {
ref, ref,
reactive, reactive,
...@@ -92,7 +94,8 @@ ...@@ -92,7 +94,8 @@
operation, operation,
studentList, studentList,
examList, examList,
Loadmore Loadmore,
signOut
}, },
setup(props) { setup(props) {
let { let {
...@@ -167,8 +170,10 @@ ...@@ -167,8 +170,10 @@
//获取学生列表 //获取学生列表
getCourseStuList(){ getCourseStuList(){
data.pageState = "loading"; data.pageState = "loading";
uni.showLoading()
proxy.$request("/Teacher/GetCourseStu", data.OperationMsg).then(res => { proxy.$request("/Teacher/GetCourseStu", data.OperationMsg).then(res => {
if(res){ if(res){
uni.hideLoading()
data.titleList.forEach(item => { data.titleList.forEach(item => {
if(item.name=='学生列表'){ if(item.name=='学生列表'){
item.num = res.Data.length item.num = res.Data.length
...@@ -182,8 +187,10 @@ ...@@ -182,8 +187,10 @@
//获取作业情况列表 //获取作业情况列表
getCourseHomeWorkList(){ getCourseHomeWorkList(){
data.pageState = "loading"; data.pageState = "loading";
uni.showLoading()
proxy.$request("/Teacher/GetCourseHomeWork", data.OperationMsg).then(res => { proxy.$request("/Teacher/GetCourseHomeWork", data.OperationMsg).then(res => {
if(res){ if(res){
uni.hideLoading()
data.titleList.forEach(item => { data.titleList.forEach(item => {
if(item.name=='作业情况'){ if(item.name=='作业情况'){
item.num = res.Data.length item.num = res.Data.length
...@@ -197,8 +204,10 @@ ...@@ -197,8 +204,10 @@
//获取考试信息列表 //获取考试信息列表
getExamPageList(){ getExamPageList(){
data.pageState = "loading"; data.pageState = "loading";
uni.showLoading()
proxy.$request("/Exam/GetExamPageList", data.Msg).then(res => { proxy.$request("/Exam/GetExamPageList", data.Msg).then(res => {
if(res){ if(res){
uni.hideLoading()
data.titleList.forEach(item => { data.titleList.forEach(item => {
if(item.name=='考试信息'){ if(item.name=='考试信息'){
item.num = res.Data.RowsCount item.num = res.Data.RowsCount
...@@ -380,6 +389,7 @@ ...@@ -380,6 +389,7 @@
margin-right: 20rpx; margin-right: 20rpx;
background: #FFFFFF; background: #FFFFFF;
} }
.workSituationpage { .workSituationpage {
min-height: 100vh; min-height: 100vh;
background-color: #f6f6f6; background-color: #f6f6f6;
......
...@@ -13,15 +13,27 @@ ...@@ -13,15 +13,27 @@
<view class="login-title"> <view class="login-title">
账号登录 账号登录
</view> </view>
<view style="margin:60rpx auto;text-align: center;"> <view style="margin:60rpx auto;text-align: center;height: 256rpx;overflow: hidden;">
<div style="display: inline-block;" @click="changeTypeHandler(1)"> <div style="display: inline-block;" @click="changeTypeHandler(1)">
<image :class="{'login-grey-avatar':userLoginType==2}" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653894192000_645.png" mode="widthFix" style="width:142rpx;"></image> <van-image
:class="{'login-grey-avatar':userLoginType==2}"
width="142rpx"
height="142rpx"
lazy-load
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653894192000_645.png"
/>
<view style="color: #282828;font-size: 24rpx;font-weight: 800;"> <view style="color: #282828;font-size: 24rpx;font-weight: 800;">
学员 学员
</view> </view>
</div> </div>
<div style="display: inline-block;margin-left:148rpx;" @click="changeTypeHandler(2)"> <div style="display: inline-block;margin-left:148rpx;" @click="changeTypeHandler(2)">
<image :class="{'login-grey-avatar':userLoginType==1}" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653894197000_691.png" mode="widthFix" style="width:142rpx;"></image> <van-image
:class="{'login-grey-avatar':userLoginType==1}"
width="142rpx"
height="142rpx"
lazy-load
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653894197000_691.png"
/>
<view style="color: #282828;font-size: 24rpx;font-weight: 800;"> <view style="color: #282828;font-size: 24rpx;font-weight: 800;">
教师 教师
</view> </view>
...@@ -226,6 +238,7 @@ ...@@ -226,6 +238,7 @@
.login-background{ .login-background{
position: fixed; position: fixed;
width: 100%; width: 100%;
height: 100%;
top: 0; top: 0;
bottom: 0; bottom: 0;
background: -moz-linear-gradient(top, #C41726 0%, #831D1C 100%); background: -moz-linear-gradient(top, #C41726 0%, #831D1C 100%);
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<view class="addComment-textarea-box"> <view class="addComment-textarea-box">
<view class="hotsopt" @click="expendStatus=!expendStatus"></view> <view class="hotsopt" @click="expendStatus=!expendStatus"></view>
<view class="content-textarea-box"> <view class="content-textarea-box">
<textarea placeholder="请填写评论内容" v-model="postMsg.Info"></textarea> <textarea placeholder="请填写评论内容" v-model="postMsg.Info" maxlength="-1"></textarea>
</view> </view>
</view> </view>
<van-popup :z-index="1000" :show="show" :round="true" position="bottom" custom-style="height: 70vh" @close="closepopup"> <van-popup :z-index="1000" :show="show" :round="true" position="bottom" custom-style="height: 70vh" @close="closepopup">
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<view class="commentDetails-index-setType flex"> <view class="commentDetails-index-setType flex">
<view class="commentDetails-setType-text flex"> <view class="commentDetails-setType-text flex">
<view> <view>
{{topData.Times}}次评价 {{topData.Title}}
</view> </view>
<view class="flex"> <view class="flex">
<text>{{topData.ShowTypeStr}}</text> <text>{{topData.ShowTypeStr}}</text>
...@@ -77,14 +77,16 @@ ...@@ -77,14 +77,16 @@
checked: '1', checked: '1',
Msg: { Msg: {
CourseId: '', CourseId: '',
CommentTimes:1 CommentTimes:1,
CommentMainId:0,
}, },
courseTimeList: [], courseTimeList: [],
topData:{ topData:{
ShowTypeStr:"", ShowTypeStr:"",
Times:1, Times:1,
CreateTime:"", CreateTime:"",
CreateTypeStr:"" CreateTypeStr:"",
Title:"",
} }
}); });
let methods = { let methods = {
...@@ -146,8 +148,9 @@ ...@@ -146,8 +148,9 @@
this.topData.Times = json.Times; this.topData.Times = json.Times;
this.topData.CreateTime = json.CreateTime; this.topData.CreateTime = json.CreateTime;
this.topData.CreateTypeStr = json.CreateTypeStr; this.topData.CreateTypeStr = json.CreateTypeStr;
this.topData.Title=json.Title;
this.Msg.CommentTimes = json.Times; this.Msg.CommentTimes = json.Times;
this.Msg.CommentMainId=json.Id;
}, },
onShow() { onShow() {
this.getStuCommentList(); this.getStuCommentList();
......
...@@ -146,7 +146,6 @@ ...@@ -146,7 +146,6 @@
}, },
//编辑规则 //编辑规则
editRules(item,index) { editRules(item,index) {
data.editor=index data.editor=index
data.show = true data.show = true
}, },
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</view> </view>
</view> </view>
</view> </view>
<setComments v-if="Msg.CourseId!=''" :CourseCommentTimesList="courseTimeList" :courseId="Msg.CourseId" @refreshData="getCourseCommentTimes"></setComments> <setComments v-if="Msg.CourseId!=''" :CourseCommentTimesList="courseTimeList" :courseId="Msg.CourseId" :courseName="CourseName" @refreshData="getCourseCommentTimes"></setComments>
</view> </view>
</view> </view>
......
...@@ -2,14 +2,8 @@ ...@@ -2,14 +2,8 @@
<page-meta> <page-meta>
<view style="height: 100vh;background-color: #f5f5f5;"> <view style="height: 100vh;background-color: #f5f5f5;">
<van-cell-group title="基本信息" inset> <van-cell-group title="基本信息" inset>
<van-field <van-field v-model="msg.Title" placeholder="输入本次评价名称" label="评语标题" :border="false" @change="changeTitle"
v-model="msg.Title" input-align="right" />
placeholder="输入本次评价名称"
label="评语标题"
:border="false"
@change="changeTitle"
input-align="right"
/>
<van-cell title="参与学员" :value="showStusStr" is-link @click="showStus=StuList.length>0" /> <van-cell title="参与学员" :value="showStusStr" is-link @click="showStus=StuList.length>0" />
</van-cell-group> </van-cell-group>
...@@ -17,14 +11,15 @@ ...@@ -17,14 +11,15 @@
<van-cell title="参考作业" :value="showWorkStr" is-link @click="showWorks=homeWorks.length>0" /> <van-cell title="参考作业" :value="showWorkStr" is-link @click="showWorks=homeWorks.length>0" />
<van-cell title="使用模板"> <van-cell title="使用模板">
<view slot=""> <view slot="">
<van-switch :checked="msg.UseTemplate" @change="changeCreateMethod" active-color="#C91727" inactive-color="#282828" size="24px" /> <van-switch :checked="UseTemplate" @change="changeCreateMethod" active-color="#C91727" inactive-color="#282828"
size="24px" />
</view> </view>
</van-cell> </van-cell>
<van-cell title="选择模板" v-if="msg.UseTemplate" :value="showTemplateStr" is-link @click="showTemplate=true" /> <van-cell title="选择模板" v-if="UseTemplate" :value="showTemplateStr" is-link @click="showTemplate=true" />
</van-cell-group> </van-cell-group>
<van-cell-group title="评语内容" inset v-if="!msg.UseTemplate"> <van-cell-group title="评语内容" inset v-if="!UseTemplate">
<textarea placeholder="请填写评论内容" class="user-pingyu" v-model="msg.Info"></textarea> <textarea placeholder="请填写评论内容" class="user-pingyu" v-model="msg.Info" maxlength="-1"></textarea>
</van-cell-group> </van-cell-group>
<view style="margin:32rpx;"> <view style="margin:32rpx;">
...@@ -35,16 +30,11 @@ ...@@ -35,16 +30,11 @@
<van-popup :z-index="1000" :show="showStus" :round="true" position="bottom" custom-style="height: 70vh" @close="closepopup"> <van-popup :z-index="1000" :show="showStus" :round="true" position="bottom" custom-style="height: 70vh" @close="closepopup">
<studentsPopu :courseStuList="StuList" @getdata="getChosenStus"></studentsPopu> <studentsPopu :courseStuList="StuList" @getdata="getChosenStus"></studentsPopu>
</van-popup> </van-popup>
<van-popup :z-index="1000" :show="showWorks" :close-on-click-overlay="false" :round="true" position="bottom" custom-style="height: 70vh" @close="closepopupWork"> <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> <operation :dataList="homeWorks" @selected="selectedWorkHandler"></operation>
</van-popup> </van-popup>
<van-action-sheet <van-action-sheet :show="showTemplate" :actions="actions" @close="closeAction" @select="selectAction" description="选择使用的评语模板" />
:show="showTemplate"
:actions="actions"
@close="closeAction"
@select="selectAction"
description="选择使用的评语模板"
/>
</page-meta> </page-meta>
</template> </template>
<script> <script>
...@@ -59,7 +49,10 @@ ...@@ -59,7 +49,10 @@
import operation from '@/components/setComments/operation' import operation from '@/components/setComments/operation'
export default { export default {
props: {}, props: {},
components: {studentsPopu,operation}, components: {
studentsPopu,
operation
},
setup() { setup() {
let { let {
proxy proxy
...@@ -68,81 +61,215 @@ ...@@ -68,81 +61,215 @@
title: '手动创建评语' title: '手动创建评语'
}) })
let data = reactive({ let data = reactive({
actions: [{name:'第一次评论',type:1},{name:'第二次评论',type:2},{name:'第三次评论',type:3}], actions: [
msg:{ // {name:'第一次评论',type:1},
Title:'', // {name:'第二次评论',type:2},
StuId:'', // {name:'第三次评论',type:3}
CourseId:0, ],
UseTemplate:true, UseTemplate: true,
TemplateId:0, msg: {
Info:'' Title: '',
CourseId: 0, // 课程编号
ChooseStuList: [], // 学员信息
Info: '', // 评论类型=1时使用
CommentType: 2, // 评论类型(1-自定义评价,2-模板评价)
IsDefault: '', // 是否默认规则(评论类型=2时使用)
CommentId: '', // 规则编号(评论类型=2时使用)
StartHomeWorkId: '', // 开始作业编号
HomeWorkId: '', // 结束作业编号
HomeWorkIds: [], // 所有的作业编号
}, },
chosenStus:[], chosenStus: [],
StuList:[], StuList: [],
showStusStr:'全班', showStusStr: '全班',
showWorkStr:'请选择', showWorkStr: '请选择',
showStus:false, showStus: false,
showWorks:false, showWorks: false,
homeWorks:[], homeWorks: [],
chosenHomeWork:[], chosenHomeWork: [],
showTemplate:false, showTemplate: false,
showTemplateStr:'请选择', showTemplateStr: '请选择',
saveLoading:false saveLoading: false,
CourseName: ''
}); });
let methods = { let methods = {
saveHandler(){ saveHandler() {
if(data.saveLoading) return if (data.saveLoading) return
data.saveLoading=true
//验证数据 //验证数据
if (!data.msg.CourseId) {
uni.showToast({
title: '课程编号不能为空',
icon: 'none',
duration: 1000
})
return;
}
if (!data.msg.Title) {
uni.showToast({
title: '请输入评价名称',
icon: 'none',
duration: 1000
})
return;
}
if (data.msg.ChooseStuList.length == 0) {
uni.showToast({
title: '请选择参与学员',
icon: 'none',
duration: 1000
})
return;
}
if (!data.msg.StartHomeWorkId || !data.msg.HomeWorkId || data.msg.HomeWorkIds.length == 0) {
uni.showToast({
title: '请选择参考作业',
icon: 'none',
duration: 1000
})
return;
}
if (data.msg.CommentType == 1) {
data.msg.CommentId = 0
data.msg.IsDefault = 0
if (!data.msg.Info) {
uni.showToast({
title: '请输入评论内容',
icon: 'none',
duration: 1000
})
return;
}
} else {
data.msg.Info = ''
if (!data.msg.CommentId) {
uni.showToast({
title: '请选择评语模板',
icon: 'none',
duration: 1000
})
return;
}
}
data.saveLoading = true
uni.showLoading() uni.showLoading()
//调用接口 //调用接口
proxy.$request("/Teacher/BatchSetStuComment", data.msg).then(res => {
if (res) {
//状态性显示
data.saveLoading = false
uni.hideLoading()
uni.showToast({
title: '操作成功!',
icon: 'none',
duration: 500
})
// let url = '/pages/setComments/setComments?CourseId=' + data.CourseId;
// uni.navigateTo({
// url: url
// })
data.msg = {
Title: '',
CourseId: data.msg.CourseId, // 课程编号
ChooseStuList: [], // 学员信息
Info: '', // 评论类型=1时使用
CommentType: 2, // 评论类型(1-自定义评价,2-模板评价)
IsDefault: '', // 是否默认规则(评论类型=2时使用)
CommentId: '', // 规则编号(评论类型=2时使用)
StartHomeWorkId: '', // 开始作业编号
HomeWorkId: '', // 结束作业编号
HomeWorkIds: [], // 所有的作业编号
}
}
uni.navigateBack({
delta: 1
});
}).catch(error => {
//状态性显示 //状态性显示
data.saveLoading = false
})
}, },
closeAction(){ // 获取模板数据
data.showTemplate=false GetCourseCommentList() {
data.showTemplateList = true
uni.showLoading()
let msg = {
CourseId: data.msg.CourseId,
CourseName: data.CourseName,
}
proxy.$request("/Teacher/GetCourseCommentList", msg).then(res => {
if (res) {
let arr = []
res.Data.forEach(item => {
let dataContent = {
name: `第${item.Times}次评论`,
IsDefault: item.IsDefault,
Id: item.Id
}
arr.push(dataContent)
})
data.actions = arr
}
uni.hideLoading()
})
}, },
selectAction(e){ closeAction() {
let x=e.detail data.showTemplate = false
data.msg.TemplateId=x.type
data.showTemplateStr=x.name
}, },
changeTitle({detail}){ selectAction(e) {
data.msg.Title=detail let x = e.detail
data.msg.CommentId = x.Id
data.msg.IsDefault = x.IsDefault
data.showTemplateStr = x.name
}, },
closepopup(){ changeTitle({
data.showStus=false detail
}) {
data.msg.Title = detail
}, },
closepopupWork(){ closepopup() {
data.showWorks=false data.showStus = false
}, },
changeCreateMethod({detail}){ closepopupWork() {
data.msg.UseTemplate=detail data.showWorks = false
},
changeCreateMethod({
detail
}) {
data.UseTemplate = detail
if (data.UseTemplate) {
data.msg.CommentType = 2
that.GetCourseCommentList()
} else {
data.msg.CommentType = 1
data.actions = []
}
}, },
getChosenStus(array) { getChosenStus(array) {
data.chosenStus = array data.chosenStus = array
if(data.chosenStus && data.chosenStus.length>0){ if (data.chosenStus && data.chosenStus.length > 0) {
if(data.chosenStus.length == data.StuList.length){ if (data.chosenStus.length == data.StuList.length) {
data.showStusStr=`全班(${data.StuList.length}人)` data.showStusStr = `全班(${data.StuList.length}人)`
}else{ } else {
let tempStr="" let tempStr = ""
data.chosenStus.forEach((x,i)=>{ data.chosenStus.forEach((x, i) => {
if(i<3){ if (i < 3) {
tempStr=`${tempStr}${x.StuName}` tempStr = `${tempStr}${x.StuName}`
} }
}) })
data.showStusStr=tempStr.substring(1,tempStr.length-1) data.showStusStr = tempStr.substring(1, tempStr.length - 1)
data.showStusStr+=data.chosenStus.length>3?`等${data.chosenStus.length}人`:"" data.showStusStr += data.chosenStus.length > 3 ? `等${data.chosenStus.length}人` : ""
}
} else {
data.showStusStr = '请选择'
} }
}else{ data.msg.ChooseStuList = []
data.showStusStr='请选择' array.forEach(x => {
let dataContent = {
StuId: x.StuId,
StuName: x.StuName
} }
data.msg.StuId=[] data.msg.ChooseStuList.push(dataContent)
array.forEach(x=>{
data.msg.StuId.push(x.StuId)
}) })
methods.closepopup() methods.closepopup()
}, },
...@@ -152,47 +279,70 @@ ...@@ -152,47 +279,70 @@
courseId: data.msg.CourseId courseId: data.msg.CourseId
}; };
proxy.$request("/Teacher/GetCourseStu", stuMsg).then(res => { proxy.$request("/Teacher/GetCourseStu", stuMsg).then(res => {
console.log("res", res);
if (res) { if (res) {
data.StuList = res.Data; data.StuList = res.Data;
data.showStusStr=data.StuList.length>0?`全班(${data.StuList.length}人)`:'暂无可选学员' data.showStusStr = data.StuList.length > 0 ? `全班(${data.StuList.length}人)` : '暂无可选学员'
data.msg.ChooseStuList = []
data.StuList.forEach(x => {
let dataContent = {
StuId: x.StuId,
StuName: x.StuName
}
data.msg.ChooseStuList.push(dataContent)
})
} }
uni.hideLoading() uni.hideLoading()
}) })
}, },
getCourseHomeWorkList(){ getCourseHomeWorkList() {
data.pageState = "loading"; data.pageState = "loading";
proxy.$request("/Teacher/GetCourseHomeWork", {'courseId':data.msg.CourseId}).then(res => { proxy.$request("/Teacher/GetCourseHomeWork", {
if(res){ 'courseId': data.msg.CourseId
res.Data.forEach(x=>{ }).then(res => {
x.checked=false if (res) {
res.Data.forEach(x => {
x.checked = false
}) })
data.homeWorks = res.Data; data.homeWorks = res.Data;
data.showWorkStr=data.homeWorks.length>0?`请选择`:'暂无可选作业' data.showWorkStr = data.homeWorks.length > 0 ? `请选择` : '暂无可选作业'
} }
}) })
}, },
selectedWorkHandler(arr){ selectedWorkHandler(arr) {
data.chosenHomeWork=arr data.chosenHomeWork = arr
data.showWorkStr=data.chosenHomeWork.length>0?`已选择${data.chosenHomeWork.length}个作业`:'请选择' data.showWorkStr = data.chosenHomeWork.length > 0 ? `已选择${data.chosenHomeWork.length}个作业` : '请选择'
data.homeWorks.forEach(x=>{ data.homeWorks.forEach(x => {
x.checked=arr.find(y=>y.HomeWorkId==x.HomeWorkId)?true:false x.checked = arr.find(y => y.HomeWorkId == x.HomeWorkId) ? true : false
}) })
methods.closepopupWork() methods.closepopupWork()
data.msg.HomeWorkIds = []
if (data.chosenHomeWork.length > 0) {
let i = data.chosenHomeWork.length - 1;
data.msg.StartHomeWorkId = data.chosenHomeWork[i].HomeWorkId
data.chosenHomeWork && data.chosenHomeWork.forEach((item, index) => {
if (index === 0) {
data.msg.HomeWorkId = item.HomeWorkId
}
data.msg.HomeWorkIds.push(item.HomeWorkId)
})
}
} }
}; };
let that = methods
return { return {
...toRefs(data), ...toRefs(data),
...methods ...methods
}; };
}, },
onLoad(option) { onLoad(option) {
console.log(option)
this.msg.CourseId = option.courseId; this.msg.CourseId = option.courseId;
this.CourseName = option.courseName;
this.getCourseStu() this.getCourseStu()
this.getCourseHomeWorkList() this.getCourseHomeWorkList()
if (this.UseTemplate) {
this.GetCourseCommentList()
}
}, },
onShow() { onShow() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment