소스 검색

完成文档61、63、64、65、66、67

SanHQin 1 년 전
부모
커밋
8202afe983
2개의 변경된 파일50개의 추가작업 그리고 31개의 파일을 삭제
  1. 28 18
      src/components/pages/disAdmin/score.vue
  2. 22 13
      src/components/pages/race/eventCenter/anliDetail.vue

+ 28 - 18
src/components/pages/disAdmin/score.vue

@@ -318,7 +318,8 @@
 						<div class="ri-card" :style="`background-color: ${Math.abs(30-ratingData.one[1])<=5?'#E2F0D9':'#FCE4D6'}`">90分以上:{{ratingData.one[0]}}个 {{ratingData.one[1]}}%</div>
 						<div class="ri-card" :style="`background-color: ${Math.abs(40-ratingData.two[1])<=5?'#E2F0D9':'#FCE4D6'}`">89-75分:{{ratingData.two[0]}}个 {{ratingData.two[1]}}%</div>
 						<div class="ri-card" :style="`background-color: ${Math.abs(30-ratingData.three[1])<=5?'#E2F0D9':'#FCE4D6'}`">74-60分以上:{{ratingData.three[0]}}个 {{ratingData.three[1]}}%</div>
-						<div class="ri-card" style="background-color: #E7E6E6;">未评分:{{ratingData.four[0]}}个 {{ratingData.four[1]}}%</div>
+						<div class="ri-card" :style="`background-color: #FCE4D6`" v-if="ratingData.four[0]!=0">60分以下:{{ratingData.four[0]}}个 {{ratingData.four[1]}}%</div>
+						<div class="ri-card" style="background-color: #E7E6E6;">未评分:{{ratingData.five[0]}}个 {{ratingData.five[1]}}%</div>
 					</div>
 				</el-tooltip>
 
@@ -327,7 +328,8 @@
 						<div class="ri-card" :style="`background-color: ${Math.abs(30-ratingData.one[1])<=5?'#E2F0D9':'#FCE4D6'}`">90分以上:{{ratingDataAdmin.one[0]}}个 {{ratingDataAdmin.one[1]}}%</div>
 						<div class="ri-card" :style="`background-color: ${Math.abs(40-ratingData.two[1])<=5?'#E2F0D9':'#FCE4D6'}`">89-75分:{{ratingDataAdmin.two[0]}}个 {{ratingDataAdmin.two[1]}}%</div>
 						<div class="ri-card" :style="`background-color: ${Math.abs(30-ratingData.three[1])<=5?'#E2F0D9':'#FCE4D6'}`">74-60分以上:{{ratingDataAdmin.three[0]}}个 {{ratingDataAdmin.three[1]}}%</div>
-						<div class="ri-card" style="background-color: #E7E6E6;">未评分:{{ratingDataAdmin.four[0]}}个 {{ratingDataAdmin.four[1]}}%</div>
+						<div class="ri-card" :style="`background-color: #FCE4D6`" v-if="ratingDataAdmin.four[0]!=0">60分以下:{{ratingDataAdmin.four[0]}}个 {{ratingDataAdmin.four[1]}}%</div>
+						<div class="ri-card" style="background-color: #E7E6E6;">未评分:{{ratingDataAdmin.five[0]}}个 {{ratingDataAdmin.five[1]}}%</div>
 					</div>
 				</el-tooltip>
       </div>
@@ -527,6 +529,7 @@ export default {
 			let two = [0,0];
 			let three = [0,0];
 			let four = [0,0];
+			let five = [0,0]
 
 			myScore.forEach(i=>{
 				let score = JSON.parse(i.score);
@@ -537,17 +540,20 @@ export default {
 					two[0]++;
 				}else if(total>=60 && total<=74){
 					three[0]++;
+				}else{
+					four[0]++;
 				}
 			})
 
-			four[0] = this.total-myScore.length;
+			five[0] = this.total-myScore.length;
 
-			one[1] = (one[0]/this.total).toFixed(4)*100
-			two[1] = (two[0]/this.total).toFixed(4)*100
-			three[1] = (three[0]/this.total).toFixed(4)*100
-			four[1] = (four[0]/this.total).toFixed(4)*100
+			one[1] = (one[0]/this.total*100).toFixed(2)
+			two[1] = (two[0]/this.total*100).toFixed(2)
+			three[1] = (three[0]/this.total*100).toFixed(2)
+			four[1] = (four[0]/this.total*100).toFixed(2)
+			five[1] = (five[0]/this.total*100).toFixed(2)
 			
-			return {one:one,two:two,three:three,four:four}
+			return {one:one,two:two,three:three,four:four,five:five}
 		},
 		ratingDataAdmin(){
 			const score = this.scoreListData;
@@ -556,27 +562,31 @@ export default {
 			let two = [0,0];
 			let three = [0,0];
 			let four = [0,0];
+			let five = [0,0]
 
 			score.forEach(i=>{
 				let sum = i.sum;
-				if(sum===0){
-					four[0]++
+				if(!sum){
+					return five[0]++
 				}
 				if(parseFloat(sum)>=90){
-					one[0]++
+					return one[0]++
 				}else if(parseFloat(sum)>=75 && parseFloat(sum)<=89){
-					two[0]++;
+					return two[0]++;
 				}else if(parseFloat(sum)>=60 && parseFloat(sum)<=74){
-					three[0]++;
+					return three[0]++;
+				}else{
+					return four[0]++;
 				}
 			})
 
-			one[1] = (one[0]/this.total).toFixed(4)*100
-			two[1] = (two[0]/this.total).toFixed(4)*100
-			three[1] = (three[0]/this.total).toFixed(4)*100
-			four[1] = (four[0]/this.total).toFixed(4)*100
+			one[1] = (one[0]/this.total*100).toFixed(2)
+			two[1] = (two[0]/this.total*100).toFixed(2)
+			three[1] = (three[0]/this.total*100).toFixed(2)
+			four[1] = (four[0]/this.total*100).toFixed(2)
+			five[1] = (five[0]/this.total*100).toFixed(2)
 			
-			return {one:one,two:two,three:three,four:four}
+			return {one:one,two:two,three:three,four:four,five:five}
 		}
 	},
   mounted() {

+ 22 - 13
src/components/pages/race/eventCenter/anliDetail.vue

@@ -2420,8 +2420,7 @@
                 v-model="scoreDetail[0].scoreAll.first"
                 @change="setScore"
                 :controls="false"
-                :min="0"
-                :max="100"
+								:min="0"
               ></el-input-number>
             </div>
             <div class="reviewDescription">
@@ -2430,8 +2429,8 @@
 								border
 								width="90%"
 								:cell-style="{borderColor:'black'}"
-								:header-cell-style="{borderColor:'black'}"
-    					  style="width: 90%;margin-right:20px;border:solid 1px black">
+								:header-cell-style="{borderColor:'black',textAlign:'center'}"
+    					  style="width: 90%;border:solid 1px black">
     					  <el-table-column
     					    prop="class"
     					    label="类别"
@@ -2440,8 +2439,10 @@
     					  </el-table-column>
     					  <el-table-column
     					    prop="ask"
-    					    label="要求"
-									align="center">
+    					    label="要求">
+									<!-- <template slot-scope="scope">
+										<span style="text-align:left">{{scope.row.ask}}</span>
+									</template> -->
     					  </el-table-column>
     					  <el-table-column
     					    prop="score"
@@ -2834,8 +2835,10 @@ export default {
     handleClose(done) {
       done();
     },
-    goTo(path) {
-      this.$router.push(path);
+    async goTo(path) {
+			if(this.tType == 1 || await this.addScore('back')){
+				this.$router.push(path);
+			}
     },
     goToX() {
       this.$message("暂未开放");
@@ -2854,7 +2857,11 @@ export default {
     //     this.goTo("/anliList");
     //   }
     // },
-    setScore() {
+    setScore(e) {
+			if(e>100){
+				this.$message.error("当前评分超出最高分,请重新评分")
+				this.scoreDetail[0].scoreAll.first = 0;
+			}
       this.scoreDetail[0].scoreAll.second = this.scoreDetail[0].scoreAll.first;
       this.scoreDetail[0].scoreAll.third = this.scoreDetail[0].scoreAll.first;
       this.$forceUpdate();
@@ -2995,7 +3002,8 @@ export default {
     addScore(showInfo=true) {
 			return new Promise((resolve,reject)=>{
 				if (this.scoreDetail[0].scoreAll.first == "") {
-      	  this.$message.error("请将信息填写完整");
+					if(showInfo==="back")return resolve(true);
+      	  this.$message.error("请填写案例评分");
       	  return reject(false);
       	}
       //  else if (this.scoreDetail[0].scoreAll.second == "") {
@@ -3015,7 +3023,8 @@ export default {
       this.ajax
         .post(this.$store.state.api + "addScore", params)
         .then((res) => {
-					if(showInfo){
+					console.log(showInfo)
+					if(showInfo==="back"?false:showInfo){
 						this.$message({
             	message: "评分成功",
             	type: "success",
@@ -5283,8 +5292,8 @@ ol {
 	bottom:0;
 	width: 450px;
   height: auto;
-	max-height:calc(100% - 100px);
-  z-index: 2015;
+	max-height:calc(100% - 250px);
+  z-index: 3000;
   background: #fff;
   border-radius: 15px;
   border-top-right-radius: 0px;