Explorar el Código

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

CrazyIter_Bin hace 3 años
padre
commit
fc3bdf719d

+ 87 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/Study.cs

@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json;
+
+namespace TEAMModelOS.SDK.Models.Cosmos.School
+{
+    public class Study : CosmosEntity
+    {
+        //教研活动
+        public Study()
+        {
+            pk = "Study";
+        }
+
+        public string name { get; set; }
+        public string school { get; set; }
+        //详细信息
+        public Detail detail { get; set; } = new Detail();
+        //高级设置
+        public List<string> settings { get; set; } = new List<string>();
+        public string creatorId { get; set; }
+        public long createTime { get; set; }
+        public long updateTime { get; set; }
+        public int hour { get; set; }
+        //教研类型
+        public int type { get; set; } = 0;
+        /// <summary>
+        ///  行政班  
+        /// </summary>
+        public List<string> classes { get; set; } = new List<string>();
+        /// <summary>
+        /// 学生名单(包含自定义个人学生名单,学校教学班)
+        /// </summary>
+        public List<string> stuLists { get; set; } = new List<string>();
+        /// <summary>
+        /// 教研组名单
+        /// </summary>
+        public List<string> tchLists { get; set; } = new List<string>();
+        /// <summary>
+        /// student 学生名单类型    research 教研组名单
+        /// </summary>
+        public string targetType { get; set; }
+        /// <summary>
+        /// 发布对象全部信息。由前端操作,用于前端回显发布对象的格式。
+        /// </summary>
+        public List<JsonElement> targets { get; set; } = new List<JsonElement>();
+        public List<Setting> teachers { get; set; } = new List<Setting>();
+        public string progress { get; set; }
+        public string scope { get; set; }
+        public int? status { get; set; } = 0;
+        //记录该评测内容下blob大小
+        public long? size { get; set; } = 0;
+        /// <summary>
+        ///发布层级 类型 school  area
+        /// </summary>
+        public string owner { get; set; }
+        public string areaId { get; set; }
+        public string pId { get; set; }
+    }
+    public class Setting {
+        public string id { get; set; }
+        public string name { get; set; }
+        public string groupName { get; set; }
+        public string sign { get; set; }
+        public long signTime { get; set; }
+        public string hw { get; set; }
+        public long hwTime { get; set; }
+        //0未审核 1 通过 2 未通过
+        public int status { get; set; }
+        public long aTime { get; set; }
+    }
+    public class Detail { 
+        public string presenter { get; set; }
+        public string topic { get; set; }
+        public long startTime { get; set; }
+        public long endTime { get; set; }
+        public string address { get; set; }
+        public string desc { get; set; }
+        public string img { get; set; }
+        public string hwName { get; set; }
+        public string hwDesc { get; set; }
+        public long hwTime { get; set; }
+        public string surveyId { get; set; }
+        public string examId { get; set; }
+    }
+}

+ 1 - 2
TEAMModelOS.SDK/Models/Cosmos/Common/Survey.cs

@@ -18,7 +18,6 @@ namespace TEAMModelOS.SDK.Models
             // questions = new List<Question>();
             classes = new List<string>();
             stuLists = new List<string>();
-            tmdids = new List<string>();
             tchLists = new List<string>();
         }
         /// <summary>
@@ -55,7 +54,7 @@ namespace TEAMModelOS.SDK.Models
         public string progress { get; set; }
         public string scope { get; set; }
 
-        public List<string> tmdids { get; set; } = new List<string>();
+        //public List<string> tmdids { get; set; } = new List<string>();
         /// <summary>
         ///  行政班  
         /// </summary>

+ 1 - 1
TEAMModelOS.SDK/Models/Service/TriggerStuActivity.cs

@@ -151,7 +151,7 @@ namespace TEAMModelOS.SDK
                        // item.from = "TchStuList";
                         classInfos.Add(item);
                     }
-
+                    classInfos = classInfos.GroupBy(c => c.id).Select(s => s.First()).ToList();
                 }
                 return classInfos;
             } catch (Exception ex) {

+ 41 - 6
TEAMModelOS/ClientApp/src/common/BaseClassSelect.vue

@@ -1,14 +1,21 @@
 <template>
 	<div class="base-class-select dark-el-cascader">
-		<el-cascader v-model="defaultArr" ref="demoCascader" :key="modelKey" :props="props" :options="csOptions" @change="treeChange" :show-all-levels="false" clearable popper-class="myCascader"
+		<RadioGroup v-model="targetType" @on-change="onTargetTypeChange" style="margin-bottom: 10px;">
+		    <Radio label="research">{{ $t('teachermgmt.page.text3') }}</Radio>
+		    <Radio label="student">{{ $t('courseManage.classroom.studentList')}}</Radio>
+		</RadioGroup>
+		<el-cascader v-if="targetType === 'student'" v-model="defaultArr" ref="demoCascader" :key="modelKey" :props="props" :options="csOptions" @change="treeChange" :show-all-levels="false" clearable popper-class="myCascader"
 			filterable></el-cascader>
+		<Select v-model="groupArr" multiple v-if="targetType === 'research'" @on-change="onGroupChange">
+			<Option v-for="(item, index) in groupList" :value="item.id" :key="index">{{ item.name }}</Option>
+		</Select>	
 	</div>
 </template>
 
 <script>
 	export default {
 		props:{
-			scope:{
+			type:{
 				type:String,
 				default:'school'
 			},
@@ -19,6 +26,9 @@
 		},
 		data() {
 			return {
+				groupArr:[],
+				groupList:[],
+				targetType:'research',
 				defaultArr:[],
 				evaluationInfo: {
 				    scope: 'school'
@@ -40,8 +50,28 @@
 		},
 		created() {
 			this.findStuList()
+			this.findResearchList()
 		},
 		methods: {
+			/* 查找学校检验组信息 */
+			findResearchList(){
+				this.$api.schoolUser.getResearchGroup({
+					code:this.$store.state.userInfo.schoolCode,
+					scope:'school'
+				}).then(res => {
+					this.groupList = res.stuList
+				})
+			},
+			/* 选择教研组发生变化 */
+			onGroupChange(){
+				this.$emit('onChange', this.groupArr)
+			},
+			/* 发布对象流程发生变化 */
+			onTargetTypeChange(val){
+				this.defaultArr = []
+				this.groupArr = []
+				this.targetType = val
+			},
 			changeLabel(val) {
 			  // 是否与上次的类型相同
 			  let changeFlag = false
@@ -203,11 +233,16 @@
 			classes:{
 				handler(n,o){
 					if(n.length){
+						this.targetType = this.type
 						setTimeout(() => {
-							this.defaultArr = n
-							this.preCheckList = n
-							this.modelKey++
-						},500)
+							if(this.type === 'research'){
+								this.groupArr = n
+							}else{
+								this.defaultArr = n
+								this.preCheckList = n
+								this.modelKey++
+							}
+						},200)
 					}
 				},
 				immediate:true,

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

@@ -124,6 +124,7 @@ export default {
 		classes:{
 			handler(n,o){
 				if(n.length){
+					console.log('个人班级接收',n);
 					setTimeout(() => {
 						this.defaultArr = n
 						this.preCheckList = n

+ 50 - 12
TEAMModelOS/ClientApp/src/components/questionnaire/BaseQnForm.vue

@@ -20,7 +20,7 @@
 						:key="index">{{ item.name }}</Option>
 				</Select> -->
 				<div v-else>
-					<BaseClassSelect :classes="classTargets" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'school' && curQnItem"></BaseClassSelect>
+					<BaseClassSelect :classes="classTargets" :type="targetType" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'school' && curQnItem"></BaseClassSelect>
 					<BaseClassSelectPri :classes="classTargets" :scope="classType" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'private' && curQnItem"></BaseClassSelectPri>
 				</div>
 			</FormItem>
@@ -169,10 +169,25 @@
 					    return data && data > date.valueOf() + 86400000
 					}
 				},
-				classIds:[]
+				classIds:[],
+				groupList:[],
+				targetType:''
 			}
 		},
+		created() {
+			this.findResearchList()
+		},
 		methods: {
+			/* 查找学校检验组信息 */
+			findResearchList(){
+				this.$api.schoolUser.getResearchGroup({
+					code:this.$store.state.userInfo.schoolCode,
+					scope:'school'
+				}).then(res => {
+					this.groupList = res.stuList
+				})
+			},
+			
 			onClassTypeChange(val) {
 				this.qnForm.classes = []
 			},
@@ -211,12 +226,12 @@
 				return new Promise((resolve, reject) => {
 					this.$refs[name].validate((valid) => {
 						if (valid && this.getSimpleText(this.qnForm.description) && this.qnForm.classes.length) {
-							console.log('1111111111')
 							let params = JSON.parse(JSON.stringify(this.defaultParams))
 							let target = []
 							let classSelectScope = this.$refs.classSelectRef.evaluationInfo.scope
 							let isSchoolClass = this.$refs.classSelectRef.evaluationInfo.scope === 'school' && this.$refs.classSelectRef.privateClassType === 'school'
 							let isPersonal = this.$route.name === 'personalSurvey' && classSelectScope  === 'private'
+							let isSchool = this.$route.name === 'manageQuestionnaire'
 							params.code = this.getCurCode
 							// 如果个人问卷的班级是校本班级 那么也要把scope置为school
 							params.scope = isPersonal ? 'private' : 'school'
@@ -231,6 +246,10 @@
 							params.creatorId = this.$store.state.userInfo.TEAMModelId
 							params.school = params.scope === 'school' ? this.$store.state.userInfo
 								.schoolCode : null
+								
+							params.tchLists = []
+							params.classes = []
+							params.stuLists = []	
 							// 如果是编辑状态 则直接复制ID 如果是新增 则直接赋值新ID
 							if (this.isEdit && this.editInfo.id && this.editInfo.code) {
 								params.id = this.editInfo.id
@@ -238,10 +257,16 @@
 							} else {
 								params.id = this.$tools.guid()
 							}
-							if(isSchoolClass){
+							// 如果是校本投票 则需要进一步确定发布对象是教研组还是学生名单
+							if(isSchool && this.$refs.classSelectRef.targetType === 'research'){
+								params.tchLists = this.qnForm.classes
+								params.targetType = 'research'
+							}else if(isSchoolClass){
 								params.classes = this.qnForm.classes
+								params.targetType = 'student'
 							}else{
 								params.stuLists = this.qnForm.classes
+								params.targetType = 'student'
 							}
 							console.log(params)
 							resolve(params)
@@ -319,27 +344,40 @@
 			 */
 			async doRender(item) {
 				console.log(item)
-				if(item.id){
-					this.classNameArr = item.classes.length ? await this.getClassNameByIds(item.classes) : await this.getClassNameByIds(item.stuLists)
+				// if(item.id){
+				// 	this.classNameArr = item.classes.length ? await this.getClassNameByIds(item.classes) : await this.getClassNameByIds(item.stuLists)
+				// }
+				if(item.targetType === 'research'){
+					console.log(this.groupList);
+					let groupNameArr = []
+					item.tchLists.forEach(i => {
+						let findObj = this.groupList.find(j => j.id === i)
+						if(findObj){
+							groupNameArr.push(findObj)
+						}
+					})
+					this.classNameArr = groupNameArr
+				}else{
+					this.classNameArr = item.classes.length ? await this.getClassNameByIds(item.classes) : item.stuLists.length ? await this.getClassNameByIds(item.stuLists) : []
 				}
-				this.classTargets = this.getCurScope === 'private' ? item.targets : item.classes.length ? item.classes : item.stuLists
+				console.log(this.classNameArr);
+				this.classTargets = item.targetType === 'research' ? item.tchLists :  this.getCurScope === 'school' ? item.classes : item.targets
 				this.classType = item.classes.length ? 'school' : 'private'
+				this.targetType = item.targetType
 				this.qnForm = {
 					name: item.name,
-					classes: this.classTargets || [],
+					targets:item.targets,
+					classes: item.targetType === 'research' ? item.tchLists : item.classes.length ? item.classes : item.stuLists,
 					startTime: item.startTime ? new Date(item.startTime) : '',
 					endTime: item.endTime ? new Date(item.endTime) : '',
 					description: item.description,
 					rangeTime: item.endTime ? [item.startTime, item.endTime] : null
 				}
+				console.log(this.qnForm)
 				this.isImmediate = false
 				this.currentState = item.state
 				this.$nextTick(() => {
 					this.curQnItem = JSON.parse(JSON.stringify(item))
-					// if (item.classes.length) {
-					// 	let isExist = this.classRooms.filter(i => i.id === item.classes[0])
-					// 	this.classType = isExist ? isExist[0].scope : 'private'
-					// }
 					this.$refs.qnForm.validateField('name')
 					this.$refs.qnForm.validateField('classes')
 					this.$refs.qnForm.validateField('description')

+ 1 - 1
TEAMModelOS/ClientApp/src/components/questionnaire/BaseQuestionnaire.less

@@ -12,7 +12,7 @@
     height: 100%;
 	min-height: 100vh;
     background: #fff;
-    padding: 30px 6%;
+    // padding: 30px 6%;
 	padding-bottom: 100px;
 	font-family: 'NotoSerif', '微软正黑体', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Sans-serif;
 

+ 49 - 17
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="classTargets" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'school' && curVoteItem"></BaseClassSelect>
+					<BaseClassSelect :classes="classTargets" :type="targetType" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'school' && curVoteItem"></BaseClassSelect>
 					<BaseClassSelectPri :classes="classTargets" :scope="classType" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'private' && curVoteItem"></BaseClassSelectPri>
 				</div>
 				
@@ -214,7 +214,9 @@
 					    return data && data > date.valueOf() + 86400000
 					}
 				},
-				classIds:[]
+				classIds:[],
+				groupList:[],
+				targetType:''
 			}
 		},
 		created() {
@@ -223,6 +225,8 @@
 				console.log(res)
 				this.classRooms = res
 			})
+			
+			this.findResearchList()
 		},
 		methods: {
 			onClassTypeChange(val) {
@@ -270,11 +274,12 @@
 							let fileName = this.$tools.guid()
 							let isReset = this.voteForm.isReset.length > 0
 							let isPersonal = this.$route.name === 'personalVote' &&  classSelectScope === 'private'
+							let isSchool = this.$route.name === 'manageVote'
+							
 							params.code = this.getCurCode
 							params.scope = isPersonal ? 'private' : 'school'
 							params.name = this.voteForm.name
-							params.startTime = !this.isImmediate ? new Date(this.voteForm.startTime)
-								.getTime() : -1
+							params.startTime = !this.isImmediate ? new Date(this.voteForm.startTime).getTime() : -1
 							params.endTime = new Date(this.voteForm.endTime).getTime()
 							params.description = this.voteForm.description
 							params.targets = this.voteForm.targets
@@ -283,19 +288,27 @@
 							params.repeat = this.voteForm.repeat.indexOf('repeat') > -1
 							params.options = this.voteOptionsContent
 							// 新增参数
-							params.owner = this.$route.name === 'personalVote' ? 'teacher' : 'school'
+							params.owner = isSchool ? 'school' : 'teacher'
 							params.creatorId = this.$store.state.userInfo.TEAMModelId
 							params.voteNum = this.voteForm.selectMax
 							params.times = this.voteForm.times
 							params.school = params.scope === 'school' ?  this.$store.state.userInfo.schoolCode : null
-							
+							params.tchLists = []
+							params.classes = []
+							params.stuLists = []
 							if (this.isEdit && this.editInfo.id && this.editInfo.code) {
 								params.id = this.editInfo.id
 							}
-							if(isSchoolClass){
+							// 如果是校本投票 则需要进一步确定发布对象是教研组还是学生名单
+							if(isSchool && this.$refs.classSelectRef.targetType === 'research'){
+								params.tchLists = this.voteForm.classes
+								params.targetType = 'research'
+							}else if(isSchoolClass){
 								params.classes = this.voteForm.classes
+								params.targetType = 'student'
 							}else{
 								params.stuLists = this.voteForm.classes
+								params.targetType = 'student'
 							}
 							console.log('提交的投票对象',params)
 							/* 保存BLOB以及COSMOS */
@@ -529,16 +542,23 @@
 			 * @param item
 			 */
 			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.classTargets = item.targets
+				console.log('需要渲染的投票对象',item)
+				if(item.targetType === 'research'){
+					console.log(this.groupList);
+					let groupNameArr = []
+					item.tchLists.forEach(i => {
+						let findObj = this.groupList.find(j => j.id === i)
+						if(findObj){
+							groupNameArr.push(findObj)
+						}
+					})
+					this.classNameArr = groupNameArr
+				}else{
+					this.classNameArr = item.classes.length ? await this.getClassNameByIds(item.classes) : item.stuLists.length ? await this.getClassNameByIds(item.stuLists) : []
 				}
 				this.classType = item.classes.length ? 'school' : 'private'
-				this.classTargets = item.classes.length ? item.classes : item.stuLists
+				this.classTargets = item.targetType === 'research' ? item.tchLists : this.getCurScope === 'school' ? item.classes : item.targets
+				this.targetType = item.targetType
 				console.log(this.classNameArr)
 				this.voteForm = null
 				this.voteOptionsContent = []
@@ -547,7 +567,8 @@
 				this.voteForm = {
 					name: item.name,
 					code: item.code,
-					classes: this.classTargets,
+					targets: item.targets,
+					classes: item.targetType === 'research' ? item.tchLists : item.classes.length ? item.classes : item.stuLists,
 					startTime: item.startTime ? new Date(item.startTime) : '',
 					endTime: item.endTime ? new Date(item.endTime) : '',
 					description: item.description,
@@ -600,7 +621,17 @@
 				// }
 				console.log(classId);
 				return this.classNameArr.find(i => i.id === classId) ? this.classNameArr.find(i => i.id === classId).name : this.$t('vote.form.noMatchDataTip')
-			}
+			},
+			
+			/* 查找学校检验组信息 */
+			findResearchList(){
+				this.$api.schoolUser.getResearchGroup({
+					code:this.$store.state.userInfo.schoolCode,
+					scope:'school'
+				}).then(res => {
+					this.groupList = res.stuList
+				})
+			},
 		},
 		mounted() {
 			//this.initEditors()
@@ -611,6 +642,7 @@
 			this.$editorTools.initSimpleEditor(descriptionEditor,this)
 			descriptionEditor.create()
 			this.descriptionEditor = descriptionEditor
+			
 
 			if (this.editItem && this.editItem.name) {
 				console.log(this.editItem)

+ 12 - 4
TEAMModelOS/ClientApp/src/view/newsheet/BaseEditor.vue

@@ -162,13 +162,21 @@
 				} else if (this.curModel === '3') {
 					let wordCount = this.wordCount
 					let singleStr = '<span class="cell-item"></span>';
-					let lines = wordCount / 24
+					let lineWordCount = 24 //每行多少格子
+					let lines = wordCount / lineWordCount
+					let remainder = wordCount % lineWordCount
 					let allHtml = ''
 					for(let i = 0 ; i < lines; i++){
-						allHtml += '<p>' + singleStr.repeat(24) + '</p>'
+						allHtml += '<p style="margin:0">' + singleStr.repeat(lineWordCount) + '</p>'
 					}
-					editor.config.height = lines * 40 + 40
-					newContent = orderStr + '<p><br></p>' + allHtml
+					// 如果有余数,则把剩下的余数格子补充到最后一行
+					if(remainder > 0){
+						allHtml += '<p style="margin:0">' + singleStr.repeat(wordCount % lineWordCount) + '</p>'
+						editor.config.height = (lines + 3) * 40
+					}else{
+						editor.config.height = (lines + 2) * 40
+					}
+					newContent = orderStr + '<p style="margin:0"><br></p>' + allHtml
 				} else {
 					newContent = orderStr
 				}

+ 1 - 1
TEAMModelOS/ClientApp/src/view/vote/ManageVote.vue

@@ -215,7 +215,7 @@
 			changeTableView() {
 				this.isOptionView = !this.isOptionView
 				this.$nextTick(() => {
-					this.$refs.baseQnRef.scrollIntoView()
+					this.$refs.baseQnRef && this.$refs.baseQnRef.scrollIntoView()
 				})
 			},