Просмотр исходного кода

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

CrazyIter_Bin 3 лет назад
Родитель
Сommit
2c4d4aa468

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

@@ -25,6 +25,7 @@
 				},
 				props: {
 					multiple: true,
+					emitPath:false,
 					value: 'id',
 					label: 'name',
 				}

+ 56 - 160
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 v-if="isShowCascader" v-model="defaultArr"  :key="modelKey" :props="props" :options="curCusList" @change="treeChange" :show-all-levels="false" clearable filterable></el-cascader>
+        <el-cascader v-model="defaultArr"  :key="evaluationInfo.scope" :props="props" :options="evaluationInfo.scope === 'private' ? privateList : schoolList" @change="treeChange" :show-all-levels="false" clearable filterable></el-cascader>
     </div>
 </template>
 
@@ -23,8 +23,6 @@ export default {
     data() {
         const _this = this
         return {
-			modelKey:1,
-			isShowCascader:true,
             schoolBase: {
                 period: []
             },
@@ -38,153 +36,21 @@ export default {
             },
             props: {
                 multiple: true,
-                lazy: true,
-                lazyLoad(node, resolve) {
-                    const { level } = node
-                    let scope = _this.evaluationInfo.scope
-                    // 一级菜单首次加载
-                    if (level == 0 && _this.courseList.length == 0) {
-                        let requestData = {
-                            'code': _this.$store.state.userInfo.TEAMModelId,
-                            'schoolId': _this.$store.state.userInfo.schoolCode,
-                            'scope': 'private'
-                        }
-                        _this.$api.courseMgmt.findCourse(requestData).then(
-                            (res) => {
-                                if (res.error) {
-                                    _this.$Message.error('API ERROR!')
-                                    return
-                                }
-                                _this.courseList = res.courses
-                                let scope = _this.evaluationInfo.scope
-                                let curCus = _this.courseList.filter(item => {
-                                    return item.scope == scope
-                                })
-                                let nodes = curCus.map(item => {
-                                    return {
-                                        value: item.id,
-                                        label: item.name,
-                                        leaf: level >= 1
-                                    }
-                                })
-                                resolve(nodes)
-                            },
-                            (err) => {
-                                _this.$Message.error('API ERROR!')
-                            }
-                        )
-                    }
-                    // 一级菜单非首次加载
-                    else if (level == 0 && _this.courseList.length > 0) {
-                        let curCus = _this.courseList.filter(item => {
-                            return item.scope == scope
-                        })
-                        let nodes = curCus.map(item => {
-                            return {
-                                value: item.id,
-                                label: item.name,
-                                leaf: true
-                            }
-                        })
-                        resolve(nodes)
-                    }
-                    // 加载二级菜单
-                    else if (level == 1) {
-                        console.log(node)
-                        let course = node.data
-                        let requestData = {
-                            'code': scope == 'school' ? _this.$store.state.userInfo.schoolCode : _this.$store.state.userInfo.TEAMModelId,
-                            'scope': scope,
-                            'id': course.value
-                        }
-                        _this.$api.courseMgmt.findCusInfo(requestData).then(
-                            async (res) => {
-                                if (res.error) {
-                                    resolve([])
-                                    return
-                                }
-                                // 获取自定义名单信息
-                                let ids = res.courses[0].schedule.map(item => {
-                                    return item.stulist
-                                })
-                                for (let i = 0; i < ids.length; i++) {
-                                    if (!ids[i]) {
-                                        ids.splice(i, 1)
-                                        i--
-                                    }
-                                }
-                                if (ids.length) {
-                                    try {
-                                        let listRes = await _this.getListInfo([...ids])
-                                        if (listRes) _this.stuList.push(...listRes.stuList)
-                                    } catch (e) {
-                                        console.log(e)
-                                        _this.$Message.error('API error')
-                                    }
-                                }
-                                //一个名单被安排到不同教室上课会出现重复数据,这里需要去重
-                                let list = []
-                                if (res.courses && res.courses.length > 0) {
-                                    res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
-                                    res.courses[0].schedule.forEach(item => {
-                                        // 补充教室信息
-                                        if (item.classId) {
-                                            let classInfo = _this.schoolClassList.find(classItem => {
-                                                return classItem.id == item.classId
-                                            })
-                                            item.classInfo = {
-                                                id: item.classId,
-                                                name: classInfo ? `${classInfo.name}` : ' - -'
-                                            }
-                                        }
-                                        // 补充名单信息
-                                        if (item.stulist) {
-                                            let listInfo = _this.stuList.find(listItem => {
-                                                return listItem.id == item.stulist
-                                            })
-                                            item.listName = listInfo ? `${listInfo.name}` : ' - -'
-                                        }
-                                        //统一数据格式
-                                        item.classId = item.classId || undefined
-                                        item.stulist = item.stulist || undefined
-                                        // 一个名单被安排到不同教室上课会出现重复数据,这里做去重操作
-                                        let has = list.find(listItem => {
-                                            return listItem.classId == item.classId && item.stulist == listItem.stulist
-                                        })
-                                        if (!has) {
-                                            list.push(item)
-                                        }
-                                    })
-                                    res.courses[0].teaClasses = list.filter(item => {
-                                        return item.classId || item.stulist
-                                    })
-                                }
-
-                                let nodes = res.courses[0].teaClasses.map(item => {
-                                    return {
-                                        value: item.stulist || item.classId,
-                                        label: item.listName || item.classInfo.name,
-                                        leaf: level >= 1
-                                    }
-                                })
-                                resolve(nodes)
-                            }
-                        )
-                    } else {
-                        resolve([])
-                    }
-                }
+				emitPath:false,
+				value: 'id',
+				label: 'name',
             },
+			curCusList:[],
+			privateList:[],
+			schoolList:[]
         };
     },
     methods: {
         treeChange(data) {
-            let classIds = data.map(i => i[i.length - 1])
-            this.classIds = classIds
-			console.log(data)
             this.$emit('onChange', data)
         },
         onClassTypeChange(val) {
+			this.defaultArr = []
             this.evaluationInfo.scope = val
         },
         //根据id获取stulist信息
@@ -196,8 +62,41 @@ export default {
             }
             return this.$api.courseMgmt.findListSummary(requestData)
         },
+		// 获取当前教师所有可以选择的课程(包括个人课程和学校分配给自己的课程)
+		getCourseList(){
+			return new Promise((r,j) => {
+				this.$api.courseMgmt.findAllByTeahcer({
+					code:this.$store.state.userInfo.TEAMModelId,
+					scope:'private',
+					schoolId:this.$store.state.userInfo.schoolCode,
+				}).then((res) => {
+					if(res.obj.length){
+						r(res.obj.map(j =>  {
+							return { 
+								id:j.id,
+								name:j.name,
+								scope:j.scope,
+								children:j.classes
+							}
+						}))
+					}
+				}).catch((err) => {
+					j(err)
+				});
+			})
+		},
+		async getCourseData(){
+			if(this.curCusList.length) return
+			this.curCusList = await this.getCourseList()
+			this.privateList = this.curCusList.filter(i => i.scope === 'private')
+			this.schoolList = this.curCusList.filter(i => i.scope === 'school')
+			console.error(this.privateList);
+		}
     },
     mounted() {
+		
+		console.log('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+		
         this.$store.dispatch('user/getSchoolProfile').then(
             res => {
                 this.schoolBase = res.school_base
@@ -209,21 +108,23 @@ export default {
 		this.$EventBus.$on('onCreateVote',() => {
 			this.defaultArr = []
 		})
+		
+		this.getCourseData()
     },
     computed: {
-        curCusList() {
-            let cus = this.courseList.filter(item => {
-                return item.scope == this.evaluationInfo.scope
-            })
-            let nodes = cus.map(item => {
-                return {
-                    value: item.id,
-                    label: item.name,
-                    leaf: false
-                }
-            })
-            return nodes
-        },
+        // curCusList() {
+        //     let cus = this.courseList.filter(item => {
+        //         return item.scope == this.evaluationInfo.scope
+        //     })
+        //     let nodes = cus.map(item => {
+        //         return {
+        //             value: item.id,
+        //             label: item.name,
+        //             leaf: false
+        //         }
+        //     })
+        //     return nodes
+        // },
 		hasSchool() {
 		  return this.$store.state.userInfo.schoolCode !== 'SYSTEM_NO_SCHOOL'
 		},
@@ -234,11 +135,6 @@ export default {
 				if(n.length){
 					console.log(n);
 					this.defaultArr = n
-					this.modelKey++
-					// this.isShowCascader = false
-					// setTimeout(() => {
-					// 	this.isShowCascader = true
-					// },500)
 				}
 			},
 			immediate:true,

+ 1 - 1
TEAMModelOS/ClientApp/src/components/evaluation/ExerciseList.vue

@@ -115,7 +115,7 @@
 					<span class="item-tools-info">{{$t('evaluation.filter.type')}}:{{ exersicesType[item.type] }}</span>
 					<span class="item-tools-info">{{$t('evaluation.filter.diff')}}:{{ exersicesDiff[item.level - 1] }}</span>
 					<span class="item-tools-info">{{$t('evaluation.filter.level')}}:{{ exersicesField[item.field - 1] }}</span>
-					<span class="item-tools-info">{{$t('evaluation.filter.useCount')}}:{{ item.usageCount || 0 }} {{ $t('unit.text4') }}</span>
+					<!-- <span class="item-tools-info">{{$t('evaluation.filter.useCount')}}:{{ item.usageCount || 0 }} {{ $t('unit.text4') }}</span> -->
 					<!-- <span class="item-tools-info">{{$t('evaluation.updateTime')}}:{{ $tools.formatTime(item.createTime)  || 0 }} </span> -->
 					<Button type="info" v-if="!isAnalysis" :style="{backgroundColor:selectList.map(i => i.id).indexOf(item.id) > -1 ? '#bbbbbb' : '#2db7f5'}"
 					 @click.stop="onSelectItem(item,index)">{{ selectList.map(i => i.id).indexOf(item.id) > -1 ? $t('evaluation.remove') : $t('evaluation.choose')}}</Button>

+ 6 - 9
TEAMModelOS/ClientApp/src/components/questionnaire/BaseQnForm.vue

@@ -12,7 +12,7 @@
 					<Radio label="school">{{ $t('survey.form.schoolClass') }}</Radio>
 				</RadioGroup> -->
 				<div v-if="!qnFormEdit && curQnItem" class="vote-class">
-					<span v-for="item in classIds" class="vote-class-item">{{ getTargetName(item) }}</span>
+					<span v-for="item in classNameArr" class="vote-class-item">{{ item.name }}</span>
 				</div>
 				<!-- <Select multiple v-model="qnForm.classes" :class="!qnFormEdit ? 'qn-form-disabled':''"
 					:placeholder="$t('survey.form.targetPlace')" v-else>
@@ -20,8 +20,8 @@
 						:key="index">{{ item.name }}</Option>
 				</Select> -->
 				<div v-else>
-					<BaseClassSelect :classes="classNameArr" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'school'"></BaseClassSelect>
-					<BaseClassSelectPri :classes="classNameArr" ref="classSelectRef" @onChange="onTargetChange" v-else></BaseClassSelectPri>
+					<BaseClassSelect :classes="classTargets" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'school' && curQnItem"></BaseClassSelect>
+					<BaseClassSelectPri :classes="classTargets" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'private' && curQnItem"></BaseClassSelectPri>
 				</div>
 			</FormItem>
 
@@ -83,6 +83,7 @@
 		data(vm) {
 			 const _this = this
 			return {
+				classTargets:[],
 				curQnItem: null,
 				classType: 'private',
 				isFalse: false,
@@ -315,17 +316,13 @@
 			 */
 			async doRender(item) {
 				console.log(item)
-				// if (!this.classRooms.length) {
-				// 	this.classRooms = await this.getClassrooms(this.userInfo.TEAMModelId)
-				// }
 				if(item.id){
 					this.classNameArr = item.classes.length ? await this.getClassNameByIds(item.classes) : await this.getClassNameByIds(item.stuLists)
-					this.classIds = item.classes.length ? item.classes : item.stuLists
 				}
-				
+				this.classTargets = item.classes.length ? item.classes : item.stuLists
 				this.qnForm = {
 					name: item.name,
-					classes: this.classIds || [],
+					classes: this.classTargets || [],
 					startTime: item.startTime ? new Date(item.startTime) : '',
 					endTime: item.endTime ? new Date(item.endTime) : '',
 					description: item.description,

+ 7 - 13
TEAMModelOS/ClientApp/src/components/vote/BaseVoteForm.vue

@@ -11,15 +11,15 @@
 					<Radio label="school">{{ $t('vote.form.schoolClass') }}</Radio>
 				</RadioGroup> -->
 				<div v-if="!voteFormEdit && curVoteItem" class="vote-class">
-					<span v-for="item in classIds" class="vote-class-item">{{ getTargetName(item) }}</span>
+					<span v-for="item in classNameArr" class="vote-class-item">{{ item.name }}</span>
 				</div>
 				<!-- <Select multiple v-model="voteForm.classes" :class="!voteFormEdit ? 'vote-form-disabled':''" :placeholder="$t('vote.form.targetPlace')"
 				 :not-found-text="$t('vote.form.noFoundText')" v-else>
 					<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="classTargets" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'school'"></BaseClassSelect>
-					<BaseClassSelectPri :classes="classTargets" @onChange="onTargetChange" ref="classSelectRef" v-else></BaseClassSelectPri>
+					<BaseClassSelect :classes="classTargets" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'school' && curVoteItem"></BaseClassSelect>
+					<BaseClassSelectPri :classes="classTargets" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'private' && curVoteItem"></BaseClassSelectPri>
 				</div>
 				
 				<!-- <el-cascader size="small" :show-all-levels="false" clearable filterable v-model="voteForm.classes" :options="csOptions" :props="props" @change="treeChange" style="width:100%;">
@@ -230,11 +230,7 @@
 			},
 			
 			onTargetChange(data){
-				let classIds = data.map(i => i[i.length - 1])
-				console.log(data);
-				console.log(classIds);
-				this.voteForm.targets = data
-				this.voteForm.classes = classIds
+				this.voteForm.classes = data
 			},
 			
 			onChangeSTime(val) {
@@ -288,7 +284,6 @@
 							params.creatorId = this.$store.state.userInfo.TEAMModelId
 							params.voteNum = this.voteForm.selectMax
 							params.times = this.voteForm.times
-							params.targets = this.voteForm.targets
 							params.school = params.scope === 'school' ?  this.$store.state.userInfo.schoolCode : null
 							
 							if (this.isEdit && this.editInfo.id && this.editInfo.code) {
@@ -300,7 +295,6 @@
 								params.stuLists = this.voteForm.classes
 							}
 							console.log('提交的投票对象',params)
-							// return
 							/* 保存BLOB以及COSMOS */
 							this.saveorUpdateVote(params).then(res => {
 								this.$Message.success((this.isEdit && this.editInfo.id) ? this.$t('vote.form.editSuc') : this.$t(
@@ -538,8 +532,8 @@
 				// }
 				if(item.id){
 					this.classNameArr = item.classes.length ? await this.getClassNameByIds(item.classes) : await this.getClassNameByIds(item.stuLists)
-					this.classTargets = item.targets
-					this.classIds = item.classes.length ? item.classes : item.stuLists
+					// this.classTargets = item.targets
+					this.classTargets = item.classes.length ? item.classes : item.stuLists
 				}
 				console.log(this.classNameArr)
 				this.voteForm = null
@@ -549,7 +543,7 @@
 				this.voteForm = {
 					name: item.name,
 					code: item.code,
-					classes: this.classIds,
+					classes: this.classTargets,
 					startTime: item.startTime ? new Date(item.startTime) : '',
 					endTime: item.endTime ? new Date(item.endTime) : '',
 					description: item.description,

+ 3 - 3
TEAMModelOS/ClientApp/src/view/evaluation/bank/ExerciseList.vue

@@ -70,9 +70,9 @@
 					<Radio label="createTime">{{$t('evaluation.filter.createTime')}}
 						<Icon type="md-arrow-round-down" />
 					</Radio>
-					<Radio label="useCount">{{$t('evaluation.filter.useCount')}}
+					<!-- <Radio label="useCount">{{$t('evaluation.filter.useCount')}}
 						<Icon type="md-arrow-round-down" />
-					</Radio>
+					</Radio> -->
 				</RadioGroup>
 			</div>
 		</div>
@@ -168,7 +168,7 @@
 					<span class="item-tools-info">{{$t('evaluation.filter.type')}}:{{ exersicesType[item.type] }}</span>
 					<span class="item-tools-info">{{$t('evaluation.filter.diff')}}:{{ exersicesDiff[item.level - 1] }}</span>
 					<span class="item-tools-info">{{$t('evaluation.filter.level')}}:{{ exersicesField[item.field - 1] }}</span>
-					<span class="item-tools-info">{{$t('evaluation.filter.useCount')}}:{{ item.usageCount || 0 }} {{ $t('unit.text4') }}</span>
+					<!-- <span class="item-tools-info">{{$t('evaluation.filter.useCount')}}:{{ item.usageCount || 0 }} {{ $t('unit.text4') }}</span> -->
 					<span class="item-tools-info">{{$t('evaluation.updateTime')}}:{{ $tools.formatTime(item.createTime)  || 0 }} </span>
 
 					<!--<span class="item-tools-info" style="border:0">更新时间:{{ formatDateTime(new Date(item.createTime * 1000)) }}</span>-->

+ 2 - 2
TEAMModelOS/ClientApp/src/view/evaluation/bank/TestPaperList.vue

@@ -31,8 +31,8 @@
 								<span v-show="gIndex !== paper.gradeIds.length - 1"> / </span></span></span>
 						<span class="info-item">{{$t('evaluation.paperList.itemCount')}}:<span
 								class="info-bold">{{ paper.scoring ? paper.scoring.length : 0 }}</span></span>
-						<span class="info-item">{{$t('evaluation.filter.useCount')}}:<span
-								class="info-bold">{{ paper.useCount || 0 }}</span></span>
+						<!-- <span class="info-item">{{$t('evaluation.filter.useCount')}}:<span
+								class="info-bold">{{ paper.useCount || 0 }}</span></span> -->
 						<span class="info-item">{{$t('evaluation.updateTime')}}:<span
 								class="info-bold">{{ $tools.formatTime(paper.createTime)  || 0 }} </span></span>
 						<!-- <span class="info-item">难度系数:<span class="info-bold">{{ paper.item ? handleDiffCalc(paper.item) : 0 }}</span></span> -->

+ 2 - 2
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseFilter.vue

@@ -34,9 +34,9 @@
 				<Radio label="createTime">{{$t('evaluation.filter.createTime')}}
 					<Icon type="md-arrow-round-down" />
 				</Radio>
-				<Radio label="useCount">{{$t('evaluation.filter.useCount')}}
+				<!-- <Radio label="useCount">{{$t('evaluation.filter.useCount')}}
 					<Icon type="md-arrow-round-down" />
-				</Radio>
+				</Radio> -->
 			</RadioGroup>
 			<!-- 试卷列表的搜索功能 -->
 			<Input v-model="searchVal" clearable  :placeholder="$t('evaluation.paperList.searchPaper')" style="width: 300px" @on-click="onCloseSearch" @on-change="onSearchChange"/>

+ 1 - 1
TEAMModelOS/ClientApp/src/view/evaluation/index/CommonExercise.less

@@ -314,7 +314,7 @@
       }
     }
     span {
-      &:nth-child(5) {
+      &:nth-child(4) {
         border-right-width: 0;
       }
     }

+ 68 - 21
TEAMModelOS/ClientApp/src/view/learnactivity/CreateSchoolEva.vue

@@ -46,7 +46,7 @@
                             </FormItem>
                             <!-- 校园评测施测对象为教学班或行政班 -->
                             <FormItem :label="$t('learnActivity.createEv.evTarget')" prop="targets">
-                                <el-cascader size="small" :show-all-levels="false" clearable filterable v-model="evaluationInfo.targets" :options="csOptions" :props="props" @change="treeChange" style="width:100%;">
+                                <el-cascader @visible-change="visibleChange" size="small" :show-all-levels="false" clearable filterable v-model="evaluationInfo.targets" :options="csOptions" :props="props" @change="treeChange" style="width:100%;">
                                 </el-cascader>
                             </FormItem>
                             <FormItem :label="$t('learnActivity.createEv.publishType')" prop="publish">
@@ -123,6 +123,7 @@ export default {
     data() {
         let _this = this
         return {
+            selectBefore: [],
             showBack: false,
             schoolClasses: [],
             props: {
@@ -190,6 +191,7 @@ export default {
                 name: '',
                 targets: [],
                 classes: [],
+                stuLists: [],
                 grades: [],
                 type: '',  //测试类别
                 source: '',
@@ -218,6 +220,7 @@ export default {
         })
     },
     methods: {
+
         //获取答题卡id
         getSheetId(id) {
             console.log('答题卡id:', id)
@@ -306,27 +309,68 @@ export default {
                 this.befPeriod = this._.cloneDeep(this.evaluationInfo.period)
             }
         },
-
+        visibleChange(status) {
+            if (status) {
+                this.selectBefore = this._.cloneDeep(this.evaluationInfo.targets)
+            }
+        },
         treeChange(data) {
-            //这里暂时只处理了行政班情况,暂无处理教学班
             console.log('选择数据', data)
-            //获取classIds
-            this.evaluationInfo.classes = data.map(item => {
-                return item[2]
-            })
-            //获取年级对象
-            let graIds = new Set(data.map(item => {
-                return item[1]
-            }))
-            graIds = Array.from(graIds)
-
-            this.evaluationInfo.grades = graIds.map(item => {
-                return {
-                    id: item + '',
-                    name: this.curGrades[item]
+            // 实现教学班和行政班二选一
+            let finalData = data
+            if (this.selectBefore.length) {
+                let curType = new Set()
+                data.forEach(item => {
+                    curType.add(item[0])
+                })
+                if (curType.size > 1) {
+                    let oldType = this.selectBefore[0][0]
+                    let newData = data.filter(item => {
+                        return item[0] != oldType
+                    })
+                    this.selectBefore = newData
+                    this.evaluationInfo.targets = newData
+                    finalData = newData
                 }
+            } else {
+                this.selectBefore = data
+            }
+
+            let classData = finalData.filter(item => {
+                return item[0] == 'class'
+            })
+            let listData = finalData.filter(item => {
+                return item[0] == 'stulist'
             })
 
+            // 如果是行政班
+            if (classData.length) {
+                //获取classIds
+                this.evaluationInfo.classes = classData.map(item => {
+                    return item[2]
+                })
+                //获取年级对象
+                let graIds = new Set(classData.map(item => {
+                    return item[1]
+                }))
+                graIds = Array.from(graIds)
+
+                this.evaluationInfo.grades = graIds.map(item => {
+                    return {
+                        id: item + '',
+                        name: this.curGrades[item]
+                    }
+                })
+                this.evaluationInfo.stuLists = []
+            }
+            //教学班
+            else if (listData.length) {
+                // 处理教学班对象
+                this.evaluationInfo.stuLists = listData.map(item => {
+                    return item[1]
+                })
+                this.evaluationInfo.classes = []
+            }
         },
         /*
          * 返回上一级
@@ -600,6 +644,7 @@ export default {
                 range: this.mode,
                 source: this.evaluationInfo.source,
                 classes: this.evaluationInfo.classes,
+                stuLists: this.evaluationInfo.stuLists,
                 // publish: this.evaluationInfo.publish,//后端去掉此字段,立即发布由后端获取时间
                 startTime: this.evaluationInfo.publish == 0 ? -1 : this.evaluationInfo.startTime,//立即发布由后端获取时间
                 endTime: this.evaluationInfo.endTime,
@@ -608,7 +653,6 @@ export default {
                 // blobcntr: this.$store.state.userInfo.schoolCode //后面新增字段 (废弃)
                 owner: 'school' //后面新增字段
             }
-            console.log('API数据:', requestData)
 
             this.$api.learnActivity.SaveExamInfo(requestData).then(
                 res => {
@@ -804,7 +848,7 @@ export default {
                     {
                         id: 'stulist',
                         name: '教学班',
-                        disabled: true,
+                        // disabled: true,
                         children: []
                     }
                 ]
@@ -835,7 +879,10 @@ export default {
                     })
                 }
                 // 填充教学班数据
-                data[1].children.push(...this.stuList)
+                let curStuList = this.stuList.filter(item => {
+                    return item.periodId == this.evaluationInfo.period.id
+                })
+                data[1].children.push(...curStuList)
                 console.log('data数据', data)
             }
             return data
@@ -886,7 +933,7 @@ export default {
         console.log(arguments)
         if (to.name == 'answerSheet') {
             from.meta.isKeep = true
-        }else{
+        } else {
             from.meta.isKeep = false
         }
         next()

+ 7 - 3
TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.vue

@@ -232,7 +232,6 @@
 						questionUrl: [],
 						other: [],
 					};
-
 					this.qnList.unshift(defaultQn);
 					this.currentQn = defaultQn;
 					this.activeQnIndex = 0;
@@ -241,6 +240,7 @@
 					this.$refs.qnForm.qnFormEdit = true;
 					this.onChangeResultTab('result')
 					this.$refs.qnForm.classNameArr = []
+					this.$refs.qnForm.classTargets = []
 					this.$EventBus.$emit('onCreateVote')
 				}
 			},
@@ -579,8 +579,12 @@
 			getAnswerdRecord(surveyItem){
 				return new Promise(async (r,j) => {
 					try{
-						let curItemRecord = await this.getBlobJsonFile(surveyItem.scope,surveyItem.recordUrl)
-						r(curItemRecord.userids)
+						if(surveyItem.recordUrl){
+							let curItemRecord = await this.getBlobJsonFile(surveyItem.scope,surveyItem.recordUrl)
+							r(curItemRecord.userids)
+						}else{
+							r([])
+						}
 					}catch(e){
 						j(e)
 					}

+ 10 - 9
TEAMModelOS/Controllers/School/CourseController.cs

@@ -1103,7 +1103,7 @@ namespace TEAMModelOS.Controllers
                 List<object> courses = new List<object>();
                 List<(string id, string name, string scope)> teacherCourse = new();
                 List<(string id, string name, string scope)> tcCourse = new();
-                List<(string name, string scope,List<(string id, string name)> stuName)> ps = new();
+                List<(string id, string name,string scope,List<(string id, string name, string type)> stuName)> ps = new();
                 var query = $"select c.id,c.name,c.scope from c";
 
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{code.GetString()}") }))
@@ -1121,7 +1121,7 @@ namespace TEAMModelOS.Controllers
                 }
                 foreach ((string s, string n,string sc) in teacherCourse)
                 {
-                    List<(string id, string name)> sName = new();
+                    List<(string id, string name,string type)> sName = new();
                     List<Schedule> schedules = new List<Schedule>();
                     var querySc = $"SELECT A0.room,A0.classId,A0.teacherId,A0.stulist,A0.time FROM c join A0 in c.schedule where c.id = '{s}'";
                     await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Schedule>(queryText: querySc, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{code.GetString()}") }))
@@ -1138,11 +1138,11 @@ namespace TEAMModelOS.Controllers
                             while (accounts.MoveNext())
                             {
                                 JsonElement account = accounts.Current;
-                                sName.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString()));
+                                sName.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString(),"stuList"));
                             }
                         }
                     }
-                    ps.Add((n,sc, sName));
+                    ps.Add((s,n,sc, sName));
                 }
                 if (requert.TryGetProperty("schoolId", out JsonElement schoolId))
                 {
@@ -1168,7 +1168,7 @@ namespace TEAMModelOS.Controllers
                         {
                             schedules.Add(item);
                         }
-                        List<(string id, string name)> sName = new();
+                        List<(string id, string name,string type)> sName = new();
                         var queryInfo = $"select c.id ,c.name from c where c.id in ({string.Join(",", schedules.Select(o => $"'{o.stulist}'"))})";
                         await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: queryInfo, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StuList-{schoolId.GetString()}") }))
                         {
@@ -1179,7 +1179,7 @@ namespace TEAMModelOS.Controllers
                                 while (accounts.MoveNext())
                                 {
                                     JsonElement account = accounts.Current;
-                                    sName.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString()));
+                                    sName.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString(), "stuList"));
                                 }
                             }
                         }
@@ -1193,11 +1193,11 @@ namespace TEAMModelOS.Controllers
                                 while (accounts.MoveNext())
                                 {
                                     JsonElement account = accounts.Current;
-                                    sName.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString()));
+                                    sName.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString(),"class"));
                                 }
                             }
                         }
-                        ps.Add((n, sc,sName));
+                        ps.Add((s,n, sc,sName));
                     }
                 }
 
@@ -1205,9 +1205,10 @@ namespace TEAMModelOS.Controllers
 
                 var obj = ps.Select(p => new
                 {
+                    p.id,
                     p.name,
                     p.scope,
-                    classes = p.stuName.Select(s => new { s.id, s.name })
+                    classes = p.stuName.Select(s => new { s.id, s.name,s.type })
                 });