浏览代码

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

CrazyIter_Bin 3 年之前
父节点
当前提交
ba40e90e6d

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

@@ -333,8 +333,6 @@
 				}
 				
 			},
-
-
 			/* 保存答题卡模板数据 */
 			doSaveSheet() {
 				return new Promise((r, j) => {
@@ -384,6 +382,7 @@
 						paper: JSON.parse(curEditPaper)
 					}
 				}
+				console.log(params)
 				// 如果是从试卷库预览试卷跳转过来的 就返回试卷库
 				if (this.$route.params.paper && (this.fromRouter === 'schoolBank' || this.fromRouter === 'personalBank')) {
 					params = {

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

@@ -5,7 +5,7 @@
 		 :isFilterPaper="isFilterPaper"
 		 @onSearchChange="onSearchChange"
 		 @onCloseSearch="onCloseSearch"
-		   v-if="!isPreview"></BaseFilter>
+		   v-show="!isPreview"></BaseFilter>
 
 		<!-- 空数据展示 -->
 		<div v-if="paperList.length === 0" class="no-data-text">

+ 0 - 12
TEAMModelOS/ClientApp/src/view/evaluation/bank/index.vue

@@ -165,18 +165,6 @@
 			}
 			next();
 		},
-		watch: {
-			paperScrollTop: {
-				handler(n) {
-					// console.log(n)
-				}
-			},
-			// $route( to , from ){   
-			//    if(from.name !== 'answerSheet' && (to.name === 'schoolBank' || to.name === 'personalBank')){
-			// 	  this.onShowPaperList()
-			//    }
-			//  }
-		}
 	}
 </script>
 <style src="./index.less" lang="less" scoped></style>

+ 7 - 5
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue

@@ -63,7 +63,7 @@
 					</div>
 					<div class="item-btn-toggle" @click.stop v-show="isShowTools && !isPreview">
 						<template v-if="!isExamPaper">
-							<InputNumber v-if="item.type !== 'compose'" :max="item.score + surPlusScore" :min="0" :step="0.5" v-model="item.score" style="display: inline-block ;width: 50px;margin-right: 10px;height: 30px;"
+							<InputNumber v-if="item.type !== 'compose'" :max="item.score + surPlusScore" :min="0" :step="0.5" v-model="item.score" style="display: inline-block ;width: 60px;margin-right: 10px;height: 30px;"
 							 @click.stop></InputNumber>
 							 <span style="margin-right: 10px;" v-if="item.type === 'compose'">{{ getComposeScore(item) }}</span>
 							<span style="margin-right: 10px;">{{$t('evaluation.paperList.score')}}</span>
@@ -520,9 +520,9 @@
 							} else {
 								// 如果不能整除 则前面所有取整 最后一题加上余数 即可完成配分
 								let integerScore = parseInt(item.score / item.list.length)
-								let lastItem = exerciseIndex === item.list.length - 1
+								// let lastItem = exerciseIndex === item.list.length - 1
 								// exercise.score = lastItem ? integerScore + remainder : integerScore
-								exercise.score = exerciseIndex > remainder ? integerScore : integerScore + 1
+								exercise.score = exerciseIndex + 1 > remainder ? integerScore : integerScore + 1
 							}
 							listItem.score = exercise.score
 							
@@ -530,9 +530,9 @@
 								exercise.children.forEach((child,childIndex) => {
 									let remainder = exercise.score % exercise.children.length
 									let integerScore = parseInt(exercise.score / exercise.children.length)
-									let lastItem = childIndex === exercise.children.length - 1
+									// let lastItem = childIndex === exercise.children.length - 1
 									// child.score = lastItem ? integerScore + remainder : integerScore
-									child.score = childIndex > remainder ? integerScore : integerScore + 1
+									child.score = childIndex + 1 > remainder ? integerScore : integerScore + 1
 								})
 							}
 							
@@ -544,6 +544,8 @@
 					this.$parent.viewModel = 'type'
 					this.$parent.paperInfo.multipleRule = this.multipleRule || 1
 					this.typeScoreModel = false
+					console.log(this.groupList)
+					console.log(this.surPlusScore)
 					this.$emit('scoreUpdate', this.surPlusScore)
 				}
 

+ 12 - 5
TEAMModelOS/ClientApp/src/view/evaluation/index/CreatePaper.vue

@@ -737,7 +737,7 @@
 							this.isLoading = true
 							let isPaperExist = await this.isPaperExist(this.evaluationInfo.name)
 							let isContainerFull = await this.isContainerFull()
-							if (!isPaperExist) {
+							if (!isPaperExist || (this.isEditPaper && this.evaluationInfo.name === this.oldPaper.name)) {
 								if (list.length) {
 									// 拿到题型顺序的试题数组进行拼接
 									let arr = []
@@ -1204,9 +1204,15 @@
 			},
 			/* 渲染需要编辑的试卷信息 */
 			async doRender(paper) {
-				console.log('传进来的paper')
-				console.log(paper)
-				localStorage.setItem('c_edit_paper',JSON.stringify(paper))
+				if(paper.paperGrade){
+					console.log('传进来缓存的paper')
+					console.log(paper)
+					this.evaluationInfo = paper
+					this.oldPaper = JSON.parse(JSON.stringify(this.evaluationInfo))
+					return 
+				}
+				console.log('渲染的试卷',paper)
+				// localStorage.setItem('c_edit_paper',JSON.stringify(paper))
 				let schoolInfo = null
 				if (paper.scope === 'school') {
 					schoolInfo = await this.getSchoolBaseInfo()
@@ -1254,6 +1260,7 @@
 			this.$EventBus.$on('onBackToTop', () => {
 				this.handleBackToTop()
 			})
+			
 		},
 
 		computed: {
@@ -1286,7 +1293,7 @@
 		beforeRouteLeave(to, from, next) {
 			if(to.name === 'answerSheet'){
 				// 设置下一个路由的 meta
-				from.meta.isKeep = true;  // 让 A 缓存,即不刷新
+				// from.meta.isKeep = true;  // 让 A 缓存,即不刷新
 			}
 			if(to.name === 'schoolBank' || to.name === 'personalBank'){
 				to.meta.isKeep = false

+ 8 - 2
TEAMModelOS/ClientApp/src/view/evaluation/index/TestPaper.vue

@@ -161,13 +161,16 @@
 		},
 		methods: {
 			goAnswerSheet(){
+				if(!this.isExamPaper){
+					localStorage.setItem('c_edit_paper',JSON.stringify(this.paperInfo))
+				}
+				console.log(this.paperInfo)
 				this.$router.push({
 					name: 'answerSheet',
 					params: {
 						paper: this.paperInfo
 					}
 				})
-				// this.isShowAnswerSheet = true
 			},
 			/**
 			 * 标题切换
@@ -313,7 +316,10 @@
 			},
 			ruleType() {
 				return this.paperInfo.markConfig ? this.paperInfo.markConfig.type : 0
-			}
+			},
+			isSchool() {
+				return this.$route.name === 'newSchoolPaper'
+			},
 		},
 		watch: {
 			paper: {

+ 1 - 1
TEAMModelOS/ClientApp/src/view/settings/BaseApplyForm.vue

@@ -242,7 +242,7 @@
 		},
 		computed:{
 			isChinaSite(){
-				return this.$store.state.config.srvAdr !== 'China'
+				return this.$store.state.config.srvAdr === 'China'
 			}
 		}
 	}