Bladeren bron

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

CrazyIter_Bin 3 jaren geleden
bovenliggende
commit
84ecc9b2dd

+ 2 - 2
TEAMModelOS/ClientApp/src/components/questionnaire/BaseProgress.vue

@@ -21,7 +21,7 @@
 				let option = {
 					// backgroundColor: 'rgba(255,255,255,0.05)',
 					title: {
-						text: (((this.total - this.noAnswerdCount) / this.total) * 100).toFixed(2)+ '%',
+						text: this.total > 0 ? (((this.total - this.noAnswerdCount) / this.total) * 100).toFixed(2)+ '%' : '0.00%',
 						textStyle: {
 							color: color[2],
 							fontSize: 20
@@ -105,7 +105,7 @@
 						}, {
 							type: 'bar',
 							z: 10,
-							data: [((this.total - this.noAnswerdCount) / this.total).toFixed(2) * 100 ],
+							data: this.total > 0 ? [((this.total - this.noAnswerdCount) / this.total).toFixed(2) * 100 ] : [0],
 							showBackground: false,
 							backgroundStyle: {
 								color: "blue",

+ 19 - 10
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 curQnItem.classes" class="vote-class-item">{{ getTargetName(item) }}</span>
+					<span v-for="item in classIds" class="vote-class-item">{{ getTargetName(item) }}</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" v-if="getCurScope === 'school'"></BaseClassSelect>
-					<BaseClassSelectPri ref="classSelectRef" @onChange="onTargetChange" v-else></BaseClassSelectPri>
+					<BaseClassSelect :classes="classNameArr" @onChange="onTargetChange" ref="classSelectRef" v-if="getCurScope === 'school'"></BaseClassSelect>
+					<BaseClassSelectPri :classes="classNameArr" ref="classSelectRef" @onChange="onTargetChange" v-else></BaseClassSelectPri>
 				</div>
 			</FormItem>
 
@@ -122,6 +122,7 @@
 					code: "",
 					name: "",
 					classes: [],
+					stuLists:[],
 					startTime: 0,
 					endTime: 0,
 					resource: []
@@ -166,7 +167,8 @@
 						let data = _this.qnForm.startTime ? _this.qnForm.startTime : Date.now()
 					    return data && data > date.valueOf() + 86400000
 					}
-				}
+				},
+				classIds:[]
 			}
 		},
 		methods: {
@@ -207,9 +209,11 @@
 				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 isPersonal = this.$route.name === 'personalVote' && this.$refs.classSelectRef.evaluationInfo.scope  === 'private'
+							let classSelectScope = this.$refs.classSelectRef.evaluationInfo.scope
+							let isPersonal = this.$route.name === 'personalVote' && classSelectScope  === 'private'
 							params.code = this.getCurCode
 							// 如果个人问卷的班级是校本班级 那么也要把scope置为school
 							params.scope = isPersonal ? 'private' : 'school'
@@ -223,7 +227,6 @@
 							params.creatorId = this.$store.state.userInfo.TEAMModelId
 							params.school = params.scope === 'school' ? this.$store.state.userInfo
 								.schoolCode : null
-
 							// 如果是编辑状态 则直接复制ID 如果是新增 则直接赋值新ID
 							if (this.isEdit && this.editInfo.id && this.editInfo.code) {
 								params.id = this.editInfo.id
@@ -231,7 +234,11 @@
 							} else {
 								params.id = this.$tools.guid()
 							}
-							params.classes = this.qnForm.classes
+							if(classSelectScope === 'school'){
+								params.classes = this.qnForm.classes
+							}else{
+								params.stuLists = this.qnForm.classes
+							}
 							console.log(params)
 							resolve(params)
 						} else {
@@ -311,12 +318,14 @@
 				// if (!this.classRooms.length) {
 				// 	this.classRooms = await this.getClassrooms(this.userInfo.TEAMModelId)
 				// }
-				if(item.classes.length){
-					this.classNameArr = await this.getClassNameByIds(item.classes)
+				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.qnForm = {
 					name: item.name,
-					classes: item.classes || [],
+					classes: this.classIds || [],
 					startTime: item.startTime ? new Date(item.startTime) : '',
 					endTime: item.endTime ? new Date(item.endTime) : '',
 					description: item.description,

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

@@ -14,7 +14,7 @@
     background: #fff;
     padding: 30px 6%;
 	padding-bottom: 100px;
-	
+	font-family: 'NotoSerif', '微软正黑体', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Sans-serif;
 
 	
 	.tools-bar{

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

@@ -542,7 +542,7 @@
 				this.voteForm = {
 					name: item.name,
 					code: item.code,
-					classes: item.classes || [],
+					classes: this.classIds,
 					startTime: item.startTime ? new Date(item.startTime) : '',
 					endTime: item.endTime ? new Date(item.endTime) : '',
 					description: item.description,

+ 1 - 0
TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.less

@@ -14,6 +14,7 @@
     height: 100%;
     display: flex;
     flex-direction: column;
+	font-family: 'NotoSerif', '微软正黑体', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Sans-serif;
 	
 	.qn-header{
 		height: 50px;

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

@@ -214,6 +214,7 @@
 					let defaultQn = {
 						name: this.$t('survey.defaultName'),
 						classes: [],
+						stuLists: [],
 						endTime: new Date(new Date().toLocaleDateString()).getTime() + 2 * 24 * 60 * 60 * 1000 - 1,
 						startTime:new Date().getTime(),
 						description: "",
@@ -449,7 +450,7 @@
 					//  先查找 投票发布对象关联的学生清单 然后再去判断学生的作答情况
 					this.$api.schoolSetting.getClassroomStudent({
 						school_code: this.$store.state.userInfo.schoolCode,
-						ids: surveyItem.classes,
+						ids: surveyItem.classes.length ? surveyItem.classes : surveyItem.stuLists,
 						scope:surveyItem.scope
 					}).then(res => {
 						if (!res.error) {

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

@@ -411,7 +411,7 @@
 					console.log('当前投票的作答数据======', records)
 					this.$api.schoolSetting.getClassroomStudent({
 						school_code: this.$store.state.userInfo.schoolCode,
-						ids: voteItem.classes,
+						ids: voteItem.classes.length ? voteItem.classes : voteItem.stuLists,
 						scope: voteItem.scope
 					}).then(res => {
 						if (!res.error && res.stus.length) {