Selaa lähdekoodia

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10000/TEAMMODEL/TEAMModelOS into develop5.0-tmd

zhouj1203@hotmail.com 3 vuotta sitten
vanhempi
commit
a1e82a7b26

+ 1 - 1
TEAMModelOS/ClientApp/src/api/courseMgmt.js

@@ -96,7 +96,7 @@ export default {
     },
     //我的课程页面查询班级相关的校本活动和老师发布的个人活动
     findTchAc: function (data) {
-        return post('/teacher/tch-activity', data)
+        return post('/teacher/comment/tch-activity', data)
     },
     //删除自定义名单
     delStuList: function (data) {

+ 5 - 0
TEAMModelOS/ClientApp/src/api/schoolSetting.js

@@ -55,6 +55,11 @@ export default {
     getClassroomStudent: function (data) {
         return post('/school/classroom/find-students', data)
     },
+	
+	/* 根据班级ID查询所有的学生名单 */
+	getStusByClassId: function (data) {
+        return post('/school/classroom/find-new-students', data)
+    },
 
     //保存分组信息
     upsertGroup: function (data) {

+ 3 - 0
TEAMModelOS/ClientApp/src/common/BaseClassSelect.vue

@@ -20,6 +20,9 @@
 		data() {
 			return {
 				defaultArr:[],
+				evaluationInfo: {
+				    scope: 'school'
+				},
 				props: {
 					multiple: true,
 					value: 'id',

+ 10 - 1
TEAMModelOS/ClientApp/src/common/BaseClassSelectPri.vue

@@ -4,7 +4,7 @@
             <Radio label="private">{{ $t('survey.form.privateClass') }}</Radio>
             <Radio label="school" v-if="hasSchool">{{ $t('survey.form.schoolClass') }}</Radio>
         </RadioGroup>
-        <el-cascader :props="props" :options="curCusList" @change="treeChange" :show-all-levels="false" clearable filterable></el-cascader>
+        <el-cascader v-model="defaultArr" :props="props" :options="curCusList" @change="treeChange" :show-all-levels="false" clearable filterable></el-cascader>
     </div>
 </template>
 
@@ -26,6 +26,7 @@ export default {
             schoolBase: {
                 period: []
             },
+			defaultArr:[],
             courseList: [],
             stuList: [],
 			classIds:[],
@@ -178,6 +179,7 @@ export default {
         treeChange(data) {
             let classIds = data.map(i => i[i.length - 1])
             this.classIds = classIds
+			console.log(data)
             this.$emit('onChange', classIds)
         },
         onClassTypeChange(val) {
@@ -200,6 +202,11 @@ export default {
                 this.schoolClassList = res.school_classes
             }
         )
+		
+		this.$EventBus.$off('onCreateVote')
+		this.$EventBus.$on('onCreateVote',() => {
+			this.defaultArr = []
+		})
     },
     computed: {
         curCusList() {
@@ -234,6 +241,8 @@ export default {
 					// let curYear = new Date().getFullYear()
 					// this.defaultArr = n.map(i => [i.periodId,'class',curYear - i.year - 1,i.id])
 					console.log(n);
+					// this.defaultArr = [['5b913f17-4253-be90-b2e1-90eaf4a09505',n[0].id]]
+					// console.log(this.defaultArr);
 				}
 			},
 			immediate:true,

+ 18 - 18
TEAMModelOS/ClientApp/src/components/questionnaire/BaseQuestionnaire.vue

@@ -322,25 +322,25 @@
 						obj = {};
 					});
 					item.result.count = resultArr;
-					let curItemRecord = result.question[index]
-					if(item.type === 'subjective'){
-						let result = []
-						for(let key in curItemRecord.other){
-							result.push({
-								id:key,
-								name:this.students.filter(i => i.id === key)[0].name,
-								value:curItemRecord.other[key]
+					// let curItemRecord = result.question[index]
+					// if(item.type === 'subjective'){
+					// 	let result = []
+					// 	for(let key in curItemRecord.other){
+					// 		result.push({
+					// 			id:key,
+					// 			name:this.students.filter(i => i.id === key)[0].name,
+					// 			value:curItemRecord.other[key]
 								
-							})
-						}
-						item.result.details = result
-					}else{
-						console.log(this.students)
-						for(let key in curItemRecord.opt){
-							curItemRecord.opt[key] = curItemRecord.opt[key].map(id => this.students.filter(i => i.id === id)[0].name) 
-						}
-						item.result.details = curItemRecord.opt
-					}
+					// 		})
+					// 	}
+					// 	item.result.details = result
+					// }else{
+					// 	console.log(this.students)
+					// 	for(let key in curItemRecord.opt){
+					// 		curItemRecord.opt[key] = curItemRecord.opt[key].map(id => this.students.filter(i => i.id === id)[0].name) 
+					// 	}
+					// 	item.result.details = curItemRecord.opt
+					// }
 				});
 				this.items = items
 			},

+ 3 - 1
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestReport.vue

@@ -565,7 +565,9 @@
                 if (data.blob.indexOf('https://teammodelstorage') > -1) {
                     a = data.blob
                 } else {
-                    let blobUrl = JSON.parse(decodeURIComponent(localStorage.student_profile, "utf-8")).blob_uri
+                    let profile = localStorage.student_profile || localStorage.user_profile
+			        let blobUrl = JSON.parse(decodeURIComponent(profile, "utf-8")).blob_uri
+                    // let blobUrl = JSON.parse(decodeURIComponent(localStorage.student_profile, "utf-8")).blob_uri
                     let studentBlob = blobUrl.split('/')
                     let url = data.scope == 'school' ? blobUrl : "https://" + studentBlob[studentBlob.length - 2] + '/' + this.getItemTitle.creatorId
                     a = `${url}/exam/${data.blob}`

+ 42 - 29
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/PaperView.vue

@@ -20,7 +20,7 @@
                         <h2 class="title-rect-name">{{$t("studentWeb.exam.examLink")}}</h2>
                     </div>
                     <!--多學科試卷-->
-                    <div v-if="paperData.length > 0 ">
+                    <div v-if="paperData.length ">
                         <div class="item-box">
                             <div v-for="(item, index) in paperData"
                                  :key="index"
@@ -28,8 +28,10 @@
                                  @click="opentestWithSubject(item)">
                                 <svg-icon icon-class="test" class="title-icon" />
                                 <span style="margin-top:5px">{{ item.subject.name }}{{getItemTitle.scope == 'school' ? $t('studentWeb.exam.isSubject'):''}}</span>
-                                <div :class="{ unfinished: item.stuAns.length == 0 ,finished:item.stuAns.length != 0 }">
-                                    <Icon style="margin-top:-10px;margin-left:-8px;" type="ios-checkmark" size="36" />
+                                <div v-show="item.stuAns != undefined">
+                                    <div :class="{ unfinished: item.stuAns.length == 0 ,finished:item.stuAns.length != 0 }">
+                                        <Icon style="margin-top: -10px; margin-left: -8px;" type="ios-checkmark" size="36" />
+                                    </div>
                                 </div>
                             </div>
                         </div>
@@ -135,29 +137,35 @@
                             for (let i = 0; i < this.paperData.length; i++) {
                                 this.paperData[i].subject = resData.subjects[i]
                                 this.paperData[i].allClass = resData.claId
-                                if (resData.stuAns[i].length == 0) {
-                                    this.paperData[i].stuAns = []
-                                    this.paperData[i].stuScore = []
-                                } else {
-                                    this.paperData[i].stuAns = resData.stuAns[i]
-                                    /* if (resData.mark[i].length != 0) {
-                                        this.paperData[i].stuAns = [resData.mark[i]]
-                                    } else {
+                                if(resData.stuAns.length) {
+                                    if (resData.stuAns[i].length == 0) {
                                         console.log(resData.stuAns[i]);
+                                        this.paperData[i].stuAns = []
+                                        this.paperData[i].stuScore = []
+                                    } else {
                                         this.paperData[i].stuAns = resData.stuAns[i]
-                                    } */
-                                    this.paperData[i].stuScore = resData.stuScore[i]
-                                    if (resData.stuAns[i].length != 0) {
-                                        let k = 0
-                                        for (let item of resData.stuScore[i]) {
-                                            if (item == -1) {   //有未打分
-                                                k++ // 没有打分+1
+                                        /* if (resData.mark[i].length != 0) {
+                                            this.paperData[i].stuAns = [resData.mark[i]]
+                                        } else {
+                                            console.log(resData.stuAns[i]);
+                                            this.paperData[i].stuAns = resData.stuAns[i]
+                                        } */
+                                        this.paperData[i].stuScore = resData.stuScore[i]
+                                        if (resData.stuAns[i].length) {
+                                            let k = 0
+                                            for (let item of resData.stuScore[i]) {
+                                                if (item == -1) {   //有未打分
+                                                    k++ // 没有打分+1
+                                                }
+                                            }
+                                            if (k == 0 && this.paperData[i].progress == 'finish') {
+                                                isTest++
                                             }
-                                        }
-                                        if (k == 0 && this.paperData[i].progress == 'finish') {
-                                            isTest++
                                         }
                                     }
+                                } else {
+                                    this.paperData[i].stuAns = []
+                                    this.paperData[i].stuScore = []
                                 }
                             }
                             if (isTest == this.paperData.length) {
@@ -184,7 +192,7 @@
                 if(this.$store.state.userInfo.roles.indexOf('student') > -1) {
                     roles = 'student'
                 } else {
-                    roles = 'taecher'
+                    roles = 'teacher'
                 }
                 let param = {
                     'id': this.getItemTitle.id,
@@ -197,7 +205,9 @@
 							this.$Message.success('评测已删除!')
 							this.$EventBus.$emit('delNotFound', this.getItemTitle.id)
                             this.$store.commit("ChangeItemName", {})
-						}
+						} else {
+                            this.$Message.warning('删除失败!')
+                        }
 					}
                 })
             },
@@ -206,6 +216,7 @@
                     this.getPaper(item)
                 }
             },
+            // 获取试卷信息
             async getPaper(data) {
                 this.isExamDown = false
                 this.isLoad = true
@@ -231,14 +242,16 @@
                     } else {
                         this.selectData = exam
                     }
-                    if (data.stuScore[0] == undefined) {
-                        let score = []
-                        for (let item of this.selectData.slides) {
-                            if (item.type !== 'compose') {
-                                score.push(-1)
+                    if(data.stuScore != undefined) {
+                        if (data.stuScore[0] == undefined) {
+                            let score = []
+                            for (let item of this.selectData.slides) {
+                                if (item.type !== 'compose') {
+                                    score.push(-1)
+                                }
                             }
+                            data.stuScore = score
                         }
-                        data.stuScore = score
                     }
                     this.chooseData = data
                     this.isLoad = false

+ 13 - 4
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/QuesNaire.vue

@@ -270,7 +270,7 @@
                 if(this.$store.state.userInfo.roles.indexOf('student') > -1) {
                     roles = "student"
                 } else {
-                    roles = "taecher"
+                    roles = "teacher"
                 }
                 let param = {
                     "id": this.getItemTitle.id,
@@ -395,14 +395,20 @@
 		},
 
 		watch: {
-			$route: {
+			/* $route: {
 				handler() {
 					this.alreadyAnswered = false
 					this.getSurveyInfo()
 				},
 				// 深度观察监听
 				deep: true
-			},
+			}, */
+			nowActive: {
+				handler() {
+					this.alreadyAnswered = false
+					this.getSurveyInfo()
+				}
+			}
 		},
 		
 		computed: {
@@ -410,7 +416,10 @@
 				"getItemTitle",
 				"getResetSurvey",
 				"getFinishedItem"
-			])	
+			]),
+			nowActive() {
+                return this.getItemTitle
+            },
 		},
 	};
 </script>

+ 15 - 2
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/Vote.vue

@@ -239,7 +239,7 @@
                 if(this.$store.state.userInfo.roles.indexOf('student') > -1) {
                     roles = 'student'
                 } else {
-                    roles = 'taecher'
+                    roles = 'teacher'
                 }
                 let param = {
                     'id': this.getItemTitle.id,
@@ -441,6 +441,9 @@
             ...mapGetters([
                 "getItemTitle",
             ]),
+            nowActive() {
+                return this.getItemTitle
+            },
             listData() {
                 return this.getItemTitle.id;
             },
@@ -463,8 +466,9 @@
                 }
             }
         },
+
         watch: {
-            $route: {
+            /* $route: {
                 handler() {
                     this.isVote = false
                     this.showResult = false
@@ -473,6 +477,15 @@
                     this.getVoteInfo()
                 },
                 deep: true
+            }, */
+            nowActive: {
+                handler() {
+                    this.isVote = false
+                    this.showResult = false
+                    this.isExamDown = false
+                    this.voteInfo = {}
+                    this.getVoteInfo()
+                }
             },
             //判断投票数量是否有变化
             voteInfo: {

+ 1 - 1
TEAMModelOS/ClientApp/src/components/vote/BaseVoteForm.vue

@@ -18,7 +18,7 @@
 					<Option v-for="(item,index) in classRooms.filter(i=>i.scope === classType)" :value="item.id" :key="index">{{ item.name }}</Option>
 				</Select> -->
 				<div v-else>
-					<BaseClassSelect :classes="classNameArr" @onChange="onTargetChange" v-if="getCurScope === 'school'"></BaseClassSelect>
+					<BaseClassSelect :classes="classNameArr" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'school'"></BaseClassSelect>
 					<BaseClassSelectPri :classes="classNameArr" ref="classSelectRef" @onChange="onTargetChange" v-else></BaseClassSelectPri>
 				</div>
 				

+ 0 - 2
TEAMModelOS/ClientApp/src/view/learnactivity/PaperScore.vue

@@ -401,8 +401,6 @@ export default {
             answerIframe.onload = () => { }
         },
         saveMark(data) {
-            let img = document.createElement('img')
-            img.src = data.base64
             let fileName = this.$jsFn.uuid() + '.png'
             let markPng = this.$jsFn.dataURLtoFile(data.base64, fileName)
             //保存批注图片

+ 3 - 1
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue

@@ -642,7 +642,8 @@ export default {
                 let slist = this.stuList.find(item => {
                     return item.id == schedule.stulist
                 })
-                this.stuLoading = true
+                // this.stuLoading = true
+                this.listLoading = true
                 this.$api.courseMgmt.findStuSummary({
                     students: slist ? slist.students.filter(item => {
                         return !item.type
@@ -669,6 +670,7 @@ export default {
                 ).finally(() => {
                     setTimeout(() => {
                         this.stuLoading = false
+                        this.listLoading = false
                     }, 500)
                 })
                 return

+ 56 - 2
TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.vue

@@ -317,7 +317,7 @@
 				}
 				this.currentQn = item.id ? await this.getQnDetails(item) : this.currentQn;
 				this.currentQn.progress = item.progress;
-				if (item.id) this.getSurveyStudents(this.currentQn)
+				if (item.id) this.getSurveyStusByClassId(this.currentQn)
 				if(item.progress === 'pending'){
 					this.onChangeResultTab('result')
 				}else{
@@ -486,7 +486,61 @@
 					this.$Message.error(this.$t('vote.getDataFailTip'))
 					this.isLoading = false
 				}
-				
+			},
+			
+			/* 获取当前问卷活动学生作答数据 */
+			async getSurveyStusByClassId(surveyItem) {
+				this.isLoading = true
+				try{
+					let answerdList = await this.getAnswerdRecord(surveyItem)
+					let params = {
+						school_code: this.$store.state.userInfo.schoolCode,
+						ids: surveyItem.classes.length ? surveyItem.classes : surveyItem.stuLists,
+					}
+					//  先查找 投票发布对象关联的学生清单 然后再去判断学生的作答情况
+					this.$api.schoolSetting.getStusByClassId(params).then(res => {
+						if (!res.error) {
+							let list = []
+							res.list.forEach(classStus => {
+								classStus.class.stuInfos.forEach(i => {
+									list.push({
+										id: i.id,
+										name: i.name,
+										no: i.no || 0,
+										classroomName: classStus.class.name
+									})
+								})
+								classStus.class.tmdInfos.forEach(i => {
+									list.push({
+										id: i.id,
+										name: i.name,
+										no: i.no || 0,
+										classroomName: classStus.class.name
+									})
+								})
+							})
+							console.log(list)
+							this.allSsList = list
+							// 要根据作答情况 结合两张表 处理表格显示的数据 
+							if (answerdList.length) {
+								this.noFinishStudents = this.getNoFinishList(answerdList,list)
+							} else {
+								this.noFinishStudents = list
+							}
+							this.isLoading = false
+						} else {
+							this.$Message.error(this.$t('vote.getDataFailTip'))
+							this.isLoading = false
+						}
+					}).catch(err => {
+						console.log(err)
+						this.$Message.error(this.$t('vote.getClassDataFailTip'))
+						this.isLoading = false
+					})
+				}catch(e){
+					this.$Message.error(this.$t('vote.getDataFailTip'))
+					this.isLoading = false
+				}
 			},
 			
 			/* 根据学生ID集合 来换取学生详细数据 */

+ 2 - 1
TEAMModelOS/ClientApp/src/view/task/index.vue

@@ -229,7 +229,8 @@ export default {
                 })
                 stuData = stuInfo
                 let index = stuInfo.tIds.indexOf(this.$store.state.userInfo.TEAMModelId)
-                let ansBlob = index > -1 ? stuInfo.marks[index] || stuInfo.blob : stuInfo.blob
+                // let ansBlob = index > -1 ? stuInfo.marks[index] || stuInfo.blob : stuInfo.blob
+                let ansBlob = stuInfo.blob
                 answer = ansBlob ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${ansBlob}?${sas}`)) : []
                 score = stuInfo.item.map(scoreItem => {
                     return scoreItem.sc

+ 57 - 8
TEAMModelOS/ClientApp/src/view/task/mark/ByStu.vue

@@ -42,7 +42,7 @@
                 <Icon custom="iconfont icon-fresh" class="tool-icon" :title="$t('learnActivity.mark.clear')" @click="clear" />
             </div>
             <div class="mark-stage">
-                <MarkCanvas ref="markCanvas" @getImg="saveMark" :status="mouseStatus" :bgImg="ansImg" :drawImgData="drawImgData" style="padding-bottom:85px"></MarkCanvas>
+                <MarkCanvas ref="markCanvas" @getImg="getMarkData" :status="mouseStatus" :bgImg="ansImg" :drawImgData="drawImgData" style="padding-bottom:85px"></MarkCanvas>
                 <!-- 题号显示部分 -->
                 <div class="qu-index-box">
                     <div class="qu-tips-box">
@@ -215,10 +215,10 @@ export default {
                 }
                 this.$api.mark.saveErr(requestData).then(
                     res => {
-
+                        this.$Message.success('上报成功')
                     },
                     err => {
-
+                        this.$Message.error('上报失败')
                     }
                 )
             } else {
@@ -229,10 +229,6 @@ export default {
                 this.$Message.warning('请选择异常原因')
             }
         },
-        //保存批注
-        saveMark(data) {
-            this.markImg = data.base64
-        },
         drawImg(imgIndex) {
             let curImg = new Image()
             curImg.src = this.imgs[imgIndex]
@@ -313,6 +309,58 @@ export default {
                 this.$Message.warning(this.$t('learnActivity.mark.noSocreErr'))
             }
         },
+        //保存批注
+        getMarkData(data) {
+            this.markImg = data.base64
+        },
+        saveMark() {
+            let fileName = this.$jsFn.uuid() + '.png'
+            let markPng = this.$jsFn.dataURLtoFile(this.markImg, fileName)
+            //保存批注图片
+            let sas = this.$store.state.user.schoolProfile.blob_sas
+            let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri
+            let host = blobUrl.substring(0, blobUrl.lastIndexOf('/'))
+            let cont = blobUrl.substring(blobUrl.lastIndexOf('/') + 1)
+            let blobTool = new BlobTool(host, cont, '?' + sas, this.examScope)
+            let path = `exam/${this.taskInfo.id}/${this.taskInfo.subject}/${this.stuId}`
+            blobTool.upload(markPng, path).then(
+                res => {
+                    this.studentAnswer.mark[this.curAnIndex].push({
+                        mark: path + '/' + fileName
+                    })
+                    this.markStatus = false
+                    //保存批注数据
+                    this.$api.learnActivity.upsertAnswer({
+                        "id": this.taskInfo.id,
+                        "studentId": this.stuId,
+                        "subjectId": this.taskInfo.subject,
+                        // "classId": this.studentAnswer.classId, //阅卷这边没有班级信息
+                        "code": this.$store.state.userInfo.schoolCode,
+                        "tmdId": this.$store.state.userInfo.TEAMModelId,
+                        "index": this.quIndex,//题号
+                        "mark": {
+                            sc: 0,//分数
+                            tmdId: this.$store.state.userInfo.TEAMModelId,
+                            mark: path + '/' + fileName,//批注BLOB地址
+                            identity: this.taskInfo.type == 1 ? 'reviewer' : '',//老师身份,这是是固定管理员身份
+                            index: this.quIndex //题号
+                        }
+                    }).then(
+                        res => {
+                            this.$Message.success(this.$t('learnActivity.score.markOk'))
+                        },
+                        err => {
+                            this.$Message.error(this.$t('learnActivity.score.markErr'))
+                        }
+                    ).finally(() => {
+                        this.curAnIndex = -1
+                    })
+                },
+                err => {
+                    console.log('保存失败', err)
+                }
+            )
+        },
         nextQuestion() {
             //首先判断是否都已评分
             let s = this._.cloneDeep(this.stuScore)
@@ -382,7 +430,8 @@ export default {
                     let sas = this.$store.state.user.schoolProfile.blob_sas //目前只有校本评测安排阅卷任务
                     let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri //目前只有校本评测安排阅卷任务
                     let index = stuInfo.tIds.indexOf(this.$store.state.userInfo.TEAMModelId)
-                    let ansBlob = index > -1 ? stuInfo.marks[index] || stuInfo.blob : stuInfo.blob
+                    // let ansBlob = index > -1 ? stuInfo.marks[index] || stuInfo.blob : stuInfo.blob //批注结构已调整
+                    let ansBlob = stuInfo.blob
                     stuInfo.answer = ansBlob ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${ansBlob}?${sas}`)) : []
                 }
                 this.stuAnswer = stuInfo.answer

+ 6 - 5
TEAMModelOS/ClientApp/src/view/teachcontent/index.vue

@@ -90,12 +90,13 @@
                             <b class="title">{{ filterPeriodName }}</b>
                             <Icon type="ios-arrow-down" style="margin-left:8px;"></Icon>
                         </span>
-                        <DropdownMenu slot="list" value="all">
-                            <DropdownItem name="all">全部</DropdownItem>
-                        </DropdownMenu>
+                        
                         <DropdownMenu slot="list" v-for="(item,index) in schoolBase.period" :value="item.id" :key="index">
                             <DropdownItem :name="item.id">{{ item.name }}</DropdownItem>
                         </DropdownMenu>
+                        <DropdownMenu slot="list" value="all">
+                            <DropdownItem name="all">通用</DropdownItem>
+                        </DropdownMenu>
                     </Dropdown>
                     <div class="content-filter-wrap" :style="{left: routerScope == 'school' ? '180px':'30px'}">
                         <Input v-model="keyWord" search size="small" :placeholder="$t('teachContent.searchText')" class="key-word-search" @on-change="searchKeyWord" @on-search="searchKeyWord" />
@@ -184,7 +185,7 @@
                     </div>
                     <div v-else class="card-box">
                         <!--card形式-->
-                        <VueWaterfall v-if="fileListShow.length > 0" ref="vueWaterfall" :imgsArr="fileListShow" :maxCols="10" :gap="15" :imgWidth="240" :width="waterfallWidth" :loadingDotCount="0" srcKey="thum" @scrollReachBottom="scrollReachBottom()" :reachBottomDistance="0">
+                        <VueWaterfall v-if="fileListShow.length > 0" ref="vueWaterfall" :imgsArr="fileListShow" :maxCols="10" :gap="15" :imgWidth="240" :width="waterfallWidth" :loadingDotCount="0" srcKey="thum" :reachBottomDistance="0">
                             <div class="img-mask" slot-scope="props" @click="openPreviewFile(props.index)">
                                 <span class="file-name">{{props.value.name}}</span>
                                 <div class="item-tools">
@@ -1362,7 +1363,7 @@ export default {
                 let pId = this.filterPeriod
                 let name = ''
                 if (pId == 'all') {
-                    return '全部'
+                    return '通用'
                 } else {
                     let temp = data.filter(item => {
                         return pId == item.id

+ 3 - 2
TEAMModelOS/ClientApp/src/view/vote/ManageVote.vue

@@ -136,7 +136,7 @@
 				hasNewAdd: false,
 				isLoading: false,
 				isLoadList: false,
-				isOptionView: true,
+				isOptionView: false,
 				isEdit: false,
 				editable: false,
 				voteList: [],
@@ -426,7 +426,8 @@
 									})
 								})
 							})
-
+							console.log(list)
+							this.studentsTable = list
 							// 要根据作答情况 结合两张表 处理表格显示的数据 
 							if (records.options.length) {
 								let arr = []

+ 1 - 1
TEAMModelOS/Controllers/School/ClassController.cs

@@ -226,7 +226,7 @@ namespace TEAMModelOS.Controllers
                 foreach (string cls in classes) {
                     (List<TmdInfo> tmdids, List<StuInfo> students, List<ClassListInfo> classLists) = await TriggerStuActivity.GetStuListInStu(client, _dingDing, new List<string> { cls }, $"{schoolId}");
                     if (classLists.IsNotEmpty()) {
-                        list.Add(new { tmdids, students, classLists });
+                        list.Add(new { tmdids, students,@class= classLists.First() });
                     }
                 }
                 return Ok(new { list });

+ 199 - 0
TEAMModelOS/Controllers/Teacher/CommentController.cs

@@ -248,7 +248,206 @@ namespace TEAMModelOS.Controllers
             }
 
         }
+        /// <summary>
+        /// 教师端,查询活动所有活动类型的列表,班主任,任课教师等
+        /// 执教班级
+        /// </summary>
+        /// <param name="request">
+        /// 教师tmdid                          !userid:"1255868536"   
+        ///学校编码                            !school:"hbcn"
+        ///执教的班级信息                      !classes:[{"classid":"S-C-00001","scope":"school"},{"classid":"P-C-00004","scope":"private"}]   TODO  需要排查 对象和班级字符串id设计原因 {"classid":"S-C-00001","scope":"school"}
+        ///执教的科目                          ?subjects:["subjectid1","subjectid2"]
+        ///活动类型                            !"pk":"Vote"/"Exam"/"Homework"/"Learn"/"Survey"" // Vote投票 Survey问卷 Exam评测 Learn学习活动 Homework作业活动
+        ///时间筛选范围开始时间 默认30天之前   ?"stime":1608274766154  
+        ///时间筛选范围结束时间 默认当前时间   ?"etime":1608274766666 
+        ///每页大小     ?"count":10/null/Undefined  
+        ///分页Token    ?"continuationToken":Undefined/null/"[{\"token\":\"+RID:~omxMAP3ipcSEEwAAAAAAAA==#RT:2#TRC:20#ISV:2#IEO:65551#QCF:1#FPC:AYQTAAAAAAAAiRMAAAAAAAA=\",\"range\":{\"min\":\"\",\"max\":\"FF\"}}]"
+        ///当前状态     ?"progress":Undefined/null/"" 表示两种状态都要查询/ "going"/"finish" 表示查询进行中/ 或者已完成 学生端只能查询正在进行或已经结束 going 已发布|finish 已结束  
+        /// </param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("tch-activity")]
+        //[AuthToken(Roles = "teacher")]
+        public async Task<IActionResult> TchActivity(JsonElement requert)
+        {
+            var (id, _, _, school) = HttpContext.GetAuthTokenInfo();
+            if (string.IsNullOrWhiteSpace(school))
+            {
+                if (requert.TryGetProperty("school", out JsonElement schoolcode))
+                {
+                    if (!schoolcode.ValueKind.Equals(JsonValueKind.Undefined) && !schoolcode.ValueKind.Equals(JsonValueKind.Null) && schoolcode.ValueKind.Equals(JsonValueKind.String))
+                    {
+                        school = schoolcode.GetString();
+                    }
+                }
+            }
+            if (string.IsNullOrWhiteSpace(id))
+            {
+                if (requert.TryGetProperty("userid", out JsonElement userid))
+                {
+                    if (!userid.ValueKind.Equals(JsonValueKind.Undefined) && !userid.ValueKind.Equals(JsonValueKind.Null) && userid.ValueKind.Equals(JsonValueKind.String))
+                    {
+                        id = userid.GetString();
+                    }
+                }
+            }
+            //var stimestamp = DateTimeOffset.UtcNow.AddDays(-30).ToUnixTimeMilliseconds();
+            //if (requert.TryGetProperty("stime", out JsonElement stime))
+            //{
+            //    if (!stime.ValueKind.Equals(JsonValueKind.Undefined) && !stime.ValueKind.Equals(JsonValueKind.Null) && stime.TryGetInt64(out long data))
+            //    {
+            //        stimestamp = data;
+            //    }
+            //}
+            //string stimesql = $" c.startTime >= {stimestamp}  ";
+            //var etimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
+            //string etimesql = $" and c.startTime <= {etimestamp}   ";
+            //var progresssql = "";
+            //if (requert.TryGetProperty("progress", out JsonElement progress))
+            //{
+            //    if (!progress.ValueKind.Equals(JsonValueKind.Undefined) && !progress.ValueKind.Equals(JsonValueKind.Null) && progress.ValueKind.Equals(JsonValueKind.String))
+            //    {
+            //        progresssql = $" and c.progress='{progress}' ";
+            //    }
+            //}
+            var pksql = "";
+            string type = null;
+            if (requert.TryGetProperty("pk", out JsonElement pk))
+            {
+                if (!pk.ValueKind.Equals(JsonValueKind.Undefined) && !pk.ValueKind.Equals(JsonValueKind.Null) && pk.ValueKind.Equals(JsonValueKind.String))
+                {
+                    pksql = $"  c.pk='{pk}' ";
+                    type = $"{pk}";
+                }
+            }
+            if (string.IsNullOrEmpty(type)) { return BadRequest("type is required!"); }
+            string continuationTokenSchool = null;
+            //默认不指定返回大小
+            int? topcout = null;
+            if (requert.TryGetProperty("count", out JsonElement jcount))
+            {
+                if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
+                {
+                    topcout = data;
+                }
+            }
+            //是否需要进行分页查询,默认不分页
+            bool iscontinuation = false;
+            if (topcout != null && topcout.Value > 0)
+            {
+                iscontinuation = true;
+            }
+            //如果指定了返回大小
+            if (requert.TryGetProperty("continuationTokenSchool", out JsonElement continuationSchool))
+            {
+                //指定了cancellationToken continuationSchool
+                if (!continuationSchool.ValueKind.Equals(JsonValueKind.Null) && continuationSchool.ValueKind.Equals(JsonValueKind.String))
+                {
+                    continuationTokenSchool = continuationSchool.GetString();
 
+                }
+            }
+            //班级
+            string joinSqlClasses = "";
+            string andSqlClasses = "";
+            List<string> classes = null;
+            if (requert.TryGetProperty("classes", out JsonElement jclasses))
+            {
+                if (jclasses.ValueKind is JsonValueKind.Array)
+                {
+                    classes = jclasses.ToObject<List<string>>();
+                    if (classes.IsNotEmpty())
+                    {
+                        joinSqlClasses = " join A1 in c.classes ";
+                        List<string> sqlList = new List<string>();
+                        classes.ForEach(x => { sqlList.Add($" '{x}' "); });
+                        string sql = string.Join(" , ", sqlList);
+                        andSqlClasses = $"   A1 in ({sql}) ";
+                    }
+                }
+            }
+            string classesSql = "";
+            if (!string.IsNullOrWhiteSpace(joinSqlClasses))
+            {
+                classesSql = $" and    {andSqlClasses }  ";
+            }
+
+            //科目
+            //string joinSqlSubjects = "";
+            //string andSqlSubjects = "";
+            //if (requert.TryGetProperty("subjects", out JsonElement jsubjects))
+            //{
+            //    if (jsubjects.ValueKind is JsonValueKind.Array)
+            //    {
+            //        List<string> subjects = jsubjects.ToObject<List<string>>();
+            //        if (subjects.IsNotEmpty())
+            //        {
+            //            joinSqlSubjects = " join A2 in c.subjects ";
+            //            List<string> sqlList = new List<string>();
+            //            subjects.ForEach(x => { sqlList.Add($" '{x}' "); });
+            //            string sql = string.Join(" , ", sqlList);
+            //            andSqlSubjects = $" and A2 in ({sql}) ";
+            //        }
+            //    }
+            //}
+
+            List<JsonElement> datas = new List<JsonElement>();
+            var client = _azureCosmos.GetCosmosClient();
+            //班主任 ,任课教师只需要查询两种校园活动 和班级活动 ,  不查询私人教室创建的活动。  
+            if (!string.IsNullOrWhiteSpace(school) && classes.IsNotEmpty())
+            {
+                //string querySchool = $" SELECT distinct  value c   FROM c {joinSqlClasses} {joinSqlSubjects}  where {stimesql}  {etimesql}  {progresssql}  {typesql}  {andSqlSubjects}  {tgSql}";
+                string querySchool = $" SELECT distinct c.owner, c.id,c.code, c.classes,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime   FROM c {joinSqlClasses}   where   {pksql}    {classesSql}";
+                //查询数据归属学校的
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(querySchool, continuationToken: continuationTokenSchool, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"{type}-{school}") }))
+                {
+                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                    {
+                        foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                        {
+                            datas.Add(obj.ToObject<JsonElement>());
+                        }
+                        //如果需要分页则跳出
+                        if (iscontinuation)
+                        {
+                            continuationTokenSchool = item.GetContinuationToken();
+                            break;
+                        }
+                    }
+                }
+            }
+            string continuationTokenTeacher = null;
+            //如果指定了返回大小
+            if (requert.TryGetProperty("continuationTokenTeacher", out JsonElement continuationTeacher))
+            {
+                //指定了cancellationToken continuationSchool
+                if (!continuationTeacher.ValueKind.Equals(JsonValueKind.Null) && continuationTeacher.ValueKind.Equals(JsonValueKind.String))
+                {
+                    continuationTokenTeacher = continuationTeacher.GetString();
 
+                }
+            }
+            string queryTeacher = $" SELECT distinct c.owner, c.id,c.code, c.classes,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime  FROM c   where   {pksql}  ";
+            //查询数据归属学校的
+            await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryTeacher, continuationToken: continuationTokenSchool, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"{type}-{id}") }))
+            {
+                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                {
+                    foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                    {
+                        datas.Add(obj.ToObject<JsonElement>());
+                    }
+                    //如果需要分页则跳出
+                    if (iscontinuation)
+                    {
+                        continuationTokenTeacher = item.GetContinuationToken();
+                        break;
+                    }
+                }
+            }
+            return Ok(new { datas, continuationTokenSchool, continuationTokenTeacher });
+        }
     }
 }