SanHQin 4 months ago
parent
commit
f3ff624873

+ 36 - 40
src/components/components/eChartsView.vue

@@ -1,54 +1,50 @@
 <template>
-	<div class="chart" id="charts_canvas" ref="chartRef"></div>
+  <div class="chart" id="charts_canvas" ref="chartRef"></div>
 </template>
 
 <script>
-import * as echarts from 'echarts';
+import * as echarts from "echarts";
 // import "echarts-wordcloud";
 export default {
-	props: {
-		data: {
-			type: Object,
-			default: () => {},
-		},
-	},
-	data() {
-		return {
-			chartObj: null,
-			chartData: null,
-		};
-	},
-	watch: {
-		data() {
-			this.getChartData();
-		},
-	},
-	methods: {
-		getChartData() {
-			if(this.chartObj){
-				this.chartObj.setOption(this.data);
-			}else{
-				this.chartObj = echarts.init(this.$refs.chartRef);
-				this.chartObj.setOption(this.data);
-				window.addEventListener("resize", () => {
-					this.chartObj.resize();
+  props: {
+    data: {
+      type: Object,
+      default: () => {}
+    }
+  },
+  data() {
+    return {
+      chartObj: null,
+      chartData: null
+    };
+  },
+  watch: {
+    data() {
+      this.getChartData();
+    }
+  },
+  methods: {
+    getChartData() {
+      if (this.chartObj === null) {
+        this.chartObj = echarts.init(this.$refs.chartRef);
+      }
+      this.chartObj.setOption(this.data);
+      window.addEventListener("resize", () => {
+        this.chartObj.resize();
       });
-			}
-			
-			
-		},
-	},
-	mounted() {
-		this.getChartData();
-	},
+    }
+  },
+  mounted() {
+    this.getChartData();
+  }
 };
 </script>
 
 <style scoped>
 .chart {
-	max-width: 100%;
-	width: 100%;
-	height: 100%;
-	background-color: #fff;
+  max-width: 100%;
+  width: 100%;
+  height: 100%;
+  background-color: #fff;
 }
 </style>

+ 58 - 3
src/components/components/statisticalAnalysis.vue

@@ -56,10 +56,13 @@
             >
           </div>
           <div class="s_b_b_right">
+						<div class=s_b_b_r_btnArea>
+							<div class="s_b_b_r_primaryBtn" @click="refresh">刷新</div>
+						</div>
             <div class="s_b_b_r_item" v-if="showType === 0">
               <div class="itemBox">
                 <div class="ib_title">数据统计图</div>
-                <div class="ib_echarts" style="width:60%;height: 600px">
+                <div class="ib_echarts" style="width:60%;height: 600px;min-width: 600px;">
                   <eChartsView
 										id="problemSituationData"
                     v-if="problemSituationData.eChartsOption && show "
@@ -106,7 +109,7 @@
             <div class="s_b_b_r_item" v-if="showType === 1">
               <div class="itemBox">
                 <div class="ib_title">数据统计图</div>
-                <div class="ib_echarts" style="width:60%;height: 600px">
+                <div class="ib_echarts" style="width:60%;height: 600px;min-width: 600px;">
                   <eChartsView2
 										id="studentSummaryData"
                     v-if="studentSummary.eChartsOption && show"
@@ -222,6 +225,7 @@ export default {
       tType: null,
       worksData: null,
       worksStudent: null,
+			toolIndex:null,
       askData: {
         title: "",
         describe: ""
@@ -230,9 +234,11 @@ export default {
   },
   methods: {
     open(data) {
+			console.log(data)
       this.show = true;
       this.data = data;
       this.worksStudent = data.worksStudent;
+			this.toolIndex = data.toolIndex;
       if (data.worksStudent.length > 0) {
         let works = data.worksStudent[0].works
           ? JSON.parse(data.worksStudent[0].works)
@@ -257,6 +263,7 @@ export default {
       this.showType = 0;
       this.tType = null;
       this.worksData = null;
+			this.toolIndex = null;
       this.askData = {
         title: "",
         describe: ""
@@ -272,7 +279,30 @@ export default {
       } else {
         return index;
       }
-    }
+    },
+		refresh(){
+			this.$emit("refresh",this.toolIndex)
+		},
+		refreshData(data){
+			console.log(data)
+			this.data = data;
+      this.worksStudent = data.worksStudent;
+			this.toolIndex = data.toolIndex;
+      if (data.worksStudent.length > 0) {
+        let works = data.worksStudent[0].works
+          ? JSON.parse(data.worksStudent[0].works)
+          : null;
+        if (works) {
+          works = works[0].askJson;
+          this.worksData = works.askJson;
+          this.askData.title = works.askTitle;
+        } else {
+          this.worksData = [];
+        }
+      } else {
+        this.worksData = [];
+      }
+		},
   },
   computed: {
     // 题目情况
@@ -730,6 +760,31 @@ export default {
 .s_b_b_right {
   width: calc(100% - 300px);
   height: 100%;
+	position: relative;
+}
+
+.s_b_b_r_btnArea{
+	width: auto;
+	height: auto;
+	position: absolute;
+	right: 30px;
+	top: 30px;
+}
+
+.s_b_b_r_primaryBtn{
+	width: auto;
+	height: auto;
+	background-color: #007AFF;
+	
+	color: #fff;
+	font-size: 16px;
+	padding: 10px 30px;
+	border-radius: 25px;
+	cursor: pointer;
+	box-shadow: 0px 2px 5px 0px #1D398314;
+
+box-shadow: 0.5px 0.5px 10px 2px #1D39830D;
+
 }
 
 .s_b_b_r_item {

+ 5 - 2
src/components/easy2/studyStudent.vue

@@ -13319,7 +13319,7 @@
       </div>
       <div>{{TxtMd}}</div>
     </el-dialog>
-		<statisticalAnalysis ref="statisticalAnalysisRef"/>
+		<statisticalAnalysis ref="statisticalAnalysisRef" @refresh="statisticalAnalysisRefresh"/>
   </div>
 </template>
 
@@ -22133,7 +22133,10 @@ export default {
       this.classRoomHelperWidth = width
     },
 		openStatisticalAnalysis(tooC,toolIndex,taskCount){
-			this.$refs.statisticalAnalysisRef.open({worksStudent:this.worksStudent[toolIndex],tType:this.tType})
+			this.$refs.statisticalAnalysisRef.open({worksStudent:this.worksStudent[toolIndex],tType:this.tType,toolIndex:toolIndex})
+		},
+		statisticalAnalysisRefresh(toolIndex){
+			this.$refs.statisticalAnalysisRef.refreshData({worksStudent:this.worksStudent[toolIndex],tType:this.tType,toolIndex:toolIndex})
 		}
   },
   directives: {

+ 5 - 2
src/components/easy3/studyStudent.vue

@@ -11947,7 +11947,7 @@
     :scoreDetail="scoreDetail"
     @selectSWorks="selectSWorks" 
     @selectStudent="selectStudent"></checkEnglishVoice>
-		<statisticalAnalysis ref="statisticalAnalysisRef"/>
+		<statisticalAnalysis ref="statisticalAnalysisRef" @refresh="statisticalAnalysisRefresh"/>
   </div>
 </template>
 
@@ -20068,7 +20068,10 @@ export default {
       this.classRoomHelperWidth = width
     },
 		openStatisticalAnalysis(tooC,toolIndex,taskCount){
-			this.$refs.statisticalAnalysisRef.open({worksStudent:this.worksStudent[toolIndex],tType:this.tType})
+			this.$refs.statisticalAnalysisRef.open({worksStudent:this.worksStudent[toolIndex],tType:this.tType,toolIndex:toolIndex})
+		},
+		statisticalAnalysisRefresh(toolIndex){
+			this.$refs.statisticalAnalysisRef.refreshData({worksStudent:this.worksStudent[toolIndex],tType:this.tType,toolIndex:toolIndex})
 		}
   },
   directives: {

+ 5 - 2
src/components/studyStudent.vue

@@ -11889,7 +11889,7 @@
     :scoreDetail="scoreDetail"
     @selectSWorks="selectSWorks" 
     @selectStudent="selectStudent"></checkEnglishVoice>
-		<statisticalAnalysis ref="statisticalAnalysisRef"/>
+		<statisticalAnalysis ref="statisticalAnalysisRef" @refresh="statisticalAnalysisRefresh"/>
   </div>
 </template>
 
@@ -20055,7 +20055,10 @@ export default {
       this.classRoomHelperWidth = width
     },
 		openStatisticalAnalysis(tooC,toolIndex,taskCount){
-			this.$refs.statisticalAnalysisRef.open({worksStudent:this.worksStudent[toolIndex],tType:this.tType})
+			this.$refs.statisticalAnalysisRef.open({worksStudent:this.worksStudent[toolIndex],tType:this.tType,toolIndex:toolIndex})
+		},
+		statisticalAnalysisRefresh(toolIndex){
+			this.$refs.statisticalAnalysisRef.refreshData({worksStudent:this.worksStudent[toolIndex],tType:this.tType,toolIndex:toolIndex})
 		}
   },
   directives: {