Commit 454432b1 authored by 罗超's avatar 罗超

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

# Conflicts:
#	src/pages/index/workSituation.vue
parents 7e949616 8dc5bb5b
......@@ -98,7 +98,6 @@
url: '/pages/index/workSituation?tabNme=' + '作业情况' +'&courseId=' + item.courseId
});
},500)
},
//计算完成百分比
calcPercentage(item) {
......
<template>
<view class="examList-box">
<view class="examList-import" @click="ImportInformation">
<view class="examList-import" @click.stop="ImportInformation">
<van-icon name="plus" />
<text>导入考试信息</text>
</view>
......@@ -38,7 +38,7 @@
</view>
</view>
<view class="examList-hint-right">
<view @click="clickReimport(item)">重新导入</view>
<view @click.stop="clickReimport(item)">重新导入</view>
</view>
</view>
</view>
......@@ -49,7 +49,7 @@
<van-icon class="examList-popup-closure" name="cross" @click="show=false"/>
<view class="examList-popup-title">导入考试信息</view>
<view class="examList-popup-content">
<input v-model="obj.name" class="examList-popup-name" placeholder="请输入考试名称">
<input v-model="uploadParm.ExamName" class="examList-popup-name" placeholder="请输入考试名称">
<van-uploader
class="examList-popup-fil-box flex"
multiple
......@@ -94,10 +94,12 @@
showPhone: false,
showLogin: false, //多次点击
show:false,
params:{
Uid:'',
CourseId:'',
ExamName:''
uploadParm: {
// Uid:726615,
// CourseId:44977497,
Uid:0,
CourseId:0,
ExamName:'考试测试530'
},
fileList:[],
Msg:{
......@@ -114,22 +116,19 @@
url: '/pages/index/examDetails?examId=' + item
});
},
//获取考试信息列表
getExamPageList(){
proxy.$request("/Exam/GetExamPageList", data.Msg).then(res => {
data.dataList = res.Data;
})
},
// 重新导入
clickReimport(item){
data.uploadParm = {
Uid:item.ExamId,
CourseId:item.CourseId,
ExamName: item.ExamName
}
},
ImportInformation(){
this.show = true
data.show = true
},
uploadFilesBefore(){
},
// 重新导入
clickReimport(item){
},
// 添加导入
customUpload(event){
......@@ -149,26 +148,19 @@
})
return
}
let params = {
// Uid: data.params.Uid,
// CourseId: data.params.CourseId,
// ExamName: data.params.ExamName,
Uid: 1,
CourseId: 1,
ExamName: '',
}
uni.uploadFile({
url: host + '/Upload/UploadStuExamScore',
filePath: file[0].url,
name: 'file',
formData: {
'myfile': file[0],
'params': JSON.stringify(params)
},
myfile:file[0],
params:JSON.stringify(data.uploadParm)
},
success(res) {
uni.hideLoading();
uni.showToast({
title:res.Message,
title: res.Code ==1?'导入成功': '导入失败',
icon:'none',
duration: 500
})
......
......@@ -10,14 +10,14 @@
<view class="index-header-title">
welcome
</view>
<view class="index-header-name">{{userData.AccountName}}</view>
<view class="index-header-name">周一围</view>
</view>
</view>
</navbar>
<view style="margin: 40rpx 0 10rpx 0;">
<view style="padding:0 50rpx;font-weight: 800;color: #282828;">
<view style="font-size: 36rpx;">Good afternoon,</view>
<view style="font-size: 50rpx;">{{userData.AccountName}}老师</view>
<view style="font-size: 50rpx;">老师</view>
</view>
</view>
<courseCard></courseCard>
......@@ -49,7 +49,6 @@
<Loadmore :state="pageState" />
</scroll-view>
</view>
<van-toast id="van-toast" />
</view>
</template>
......@@ -70,7 +69,6 @@
onMounted,
provide,
nextTick,
inject
} from "vue";
import {
......@@ -95,17 +93,11 @@
let {
proxy
} = getCurrentInstance();
let Toast = inject("$toast")
Toast.loading({
message: '加载中...',
forbidClick: true,
loadingType: 'spinner',
});
let data = reactive({
titleList:[
{name:'学生列表',num:18},
{name:'作业情况',num:5},
{name:'考试信息',num:18},
{name:'学生列表',num:0},
{name:'作业情况',num:0},
{name:'考试信息',num:0},
],
tabNme:'作业情况',
Msg:{
......@@ -121,10 +113,8 @@
timer: null, //防抖
dataList:[],
pageState: "more",
loading:true,
userData:{}
});
data.userData = uni.getStorageSync('userInfo');
let methods = {
back() {
uni.navigateTo({
......@@ -133,9 +123,10 @@
},
toggleTitle(t) {
data.tabNme = t
if(this.tabNme=='学生列表'){
data.dataList = []
if(data.tabNme=='学生列表'){
that.getCourseStuList()
}else if(this.tabNme=='作业情况'){
}else if(data.tabNme=='作业情况'){
that.getGetCourseHomeWorkList()
}else{
that.getExamPageList()
......@@ -143,59 +134,41 @@
},
//获取学生列表
getCourseStuList(){
data.loading=true
proxy.$request("/Teacher/GetCourseStu", data.OperationMsg).then(res => {
if(res){
data.titleList.forEach(item => {
if(item.name=='学生列表'){
item.num = res.Data.length
}
});
data.dataList = res.Data;
data.pageState = "none";
data.loading=false
return
if (data.timer) data.timer = null;
if (data.Msg.PageIndex === 1) {
data.dataList = res.Data.PageData;
} else {
data.dataList = [...res.Data.PageData, ...data.dataList];
}
data.pageCount = res.Data.PageCount;
if (data.Msg.PageIndex >= res.Data.PageCount) {
data.pageState = "none";
} else {
data.pageState = "more";
}
}
})
},
//获取作业情况列表
getGetCourseHomeWorkList(){
data.loading=true
proxy.$request("/Teacher/GetCourseHomeWork", data.OperationMsg).then(res => {
if(res){
data.titleList.forEach(item => {
if(item.name=='作业情况'){
item.num = res.Data.length
}
});
data.dataList = res.Data;
data.pageState = "none";
return
if (data.timer) data.timer = null;
if (data.Msg.PageIndex === 1) {
data.dataList = res.Data.PageData;
} else {
data.dataList = [...res.Data.PageData, ...data.dataList];
}
data.pageCount = res.Data.PageCount;
if (data.Msg.PageIndex >= res.Data.PageCount) {
data.pageState = "none";
} else {
data.pageState = "more";
}
data.loading=false
}
})
},
//获取考试信息列表
getExamPageList(){
data.loading=true
proxy.$request("/Exam/GetExamPageList", data.Msg).then(res => {
if(res){
data.titleList.forEach(item => {
if(item.name=='考试信息'){
item.num = res.Data.RowsCount
}
});
if (data.timer) data.timer = null;
if (data.Msg.PageIndex === 1) {
data.dataList = res.Data.PageData;
......@@ -208,7 +181,6 @@
} else {
data.pageState = "more";
}
data.loading=false
}
})
},
......@@ -218,12 +190,12 @@
data.Msg.PageIndex++;
if (data.timer) clearTimeout(data.timer);
data.timer = setTimeout(() => {
if(this.tabNme=='学生列表'){
this.getCourseStuList()
}else if(this.tabNme=='作业情况'){
this.getGetCourseHomeWorkList()
if(data.tabNme=='学生列表'){
that.getCourseStuList()
}else if(data.tabNme=='作业情况'){
that.getGetCourseHomeWorkList()
}else{
this.getExamPageList()
that.getExamPageList()
}
}, 1000);
} else {
......@@ -247,7 +219,7 @@
this.Msg.courseId = option.courseId
},
onShow() {
//this.userData = uni.getStorageSync('userInfo');
this.dataList = []
if(this.tabNme=='学生列表'){
this.getCourseStuList()
}else if(this.tabNme=='作业情况'){
......@@ -255,6 +227,7 @@
}else{
this.getExamPageList()
}
},
onShareAppMessage() {
return {
......
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