Karsa 1 жил өмнө
parent
commit
7846e86bc2

+ 18 - 2
src/views/chartRelevance_manage/crossVarietyAnalysis/chartEditor.vue

@@ -163,6 +163,7 @@
           :tagList="tagOptions"
           :chartInfo="chartInfo"
           ref="chartFormRef"
+          @getData="getChartPreviewData"
         />
       </div> 
 
@@ -291,13 +292,26 @@ export default {
     },
 
     checkParmas(type='') {
-      if(!this.checkedVarietys.length || !this.$refs.chartFormRef.form.CalculateValue || !this.$refs.chartFormRef.form.TagX ||!this.$refs.chartFormRef.form.TagY||!this.$refs.chartFormRef.form.DateConfigList.length){
-        type && this.$message.warning(message)
+      if(!this.checkedVarietys.length || !this.$refs.chartFormRef.form.CalculateValue || !this.$refs.chartFormRef.form.TagX ||!this.$refs.chartFormRef.form.TagY){
+        
+        type && this.dealWarnings()
         return false
       }
       return true
     },
 
+    dealWarnings() {
+      const {CalculateValue,TagX,TagY } = this.$refs.chartFormRef.form;
+      let message = '';
+      
+      if(!this.checkedVarietys.length) message = '请选择品种'
+      else if(!CalculateValue) message = '请输入时间长度'
+      else if(!TagX) message = '请选择X轴坐标'
+      else if(!TagY) message = '请选择Y轴坐标'
+
+      this.$message.warning(message)
+    },
+
     /* 获取标签列表 */
     async getTagList() {
       let res = await crossVarietyInterface.getTagList()
@@ -363,6 +377,8 @@ export default {
 
     /* 保存图表 */
     async saveChartHandle() {
+      if(!this.checkParmas('warning')) return;
+
       let { min,max,x_min,x_max } = this.chartLimit;
       let params = {
         VarietyList: this.checkedVarietys,

+ 7 - 4
src/views/chartRelevance_manage/crossVarietyAnalysis/components/chartFormSection.vue

@@ -77,6 +77,7 @@
             v-model="item.DateType"
             style="width: 150px"
             placeholder="请选择"
+            @change="changeParams"
           >
             <el-option
               v-for="item in dateOptions"
@@ -92,7 +93,7 @@
             style="width: 140px"
             :step="1"
             type="number"
-            @change="(val) => {item.Num = Number(val)}"
+            @change="(val) => {item.Num = Number(val);changeParams()}"
           />
 
           <el-button type="text" v-if="index===0" @click="addDateHandle">
@@ -106,7 +107,7 @@
             v-else 
             class="el-icon-delete" 
             style="cursor:pointer;color:#f00;"
-            @click="form.DateConfigList.splice(index,1)"
+            @click="() => {form.DateConfigList.splice(index,1);changeParams()}"
           />
 
         </li>
@@ -127,7 +128,7 @@ export default {
   data() {
     return {
       form: {
-        ChartName:'图表标题',
+        ChartName:'',
         Source: 10,
         CalculateValue: '',
         CalculateUnit: '天',
@@ -156,6 +157,8 @@ export default {
       this.form.DateConfigList.push({
         DateType: 1,Num: 1
       })
+      
+      this.changeParams()
     },
 
     initData(data) {
@@ -171,7 +174,7 @@ export default {
     },
 
     changeParams() {
-      // this.$emit('')
+      this.$emit('getData')
     },
   },
 };

+ 4 - 0
src/views/dataEntry_manage/mixins/chartPublic.js

@@ -1768,6 +1768,10 @@ export const chartSetMixin = {
 
     /* 跨品种分析 */
     setCrossVarietyChart() {
+      this.leftIndex = -1;
+      this.rightIndex = -1;
+      this.rightTwoIndex = -1;
+      
       const { min,max,x_min,x_max }  = this.chartLimit;
 
       const { DataList,XName,YName,XNameEn,YNameEn } = this.crossVarietyChartData;

+ 15 - 1
src/views/mychart_manage/components/chartDetailDia.vue

@@ -122,7 +122,7 @@
               class="span-item"
               style="margin-left: 7px"
               @click="saveChartMapHandle"
-              v-if="![3,4,6,7,8,9].includes(chartInfo.Source)"
+              v-if="![3,4,6,7,8,9,10].includes(chartInfo.Source)"
             >
               <span> <i class="el-icon-collection" />&nbsp;保存 </span>
             </span>
@@ -750,6 +750,16 @@ export default {
             this.tableData = res.Data.EdbInfoList;
             this.statisticFrequencyData = res.Data.DataResp;
             this.setStatisticFrequency();
+          }else if(this.chartInfo.Source===10) { //跨品种分析
+            this.tableData = res.Data.EdbInfoList;
+            this.crossVarietyChartData = res.Data.DataResp;
+            this.chartLimit = {
+              min: Number(res.Data.DataResp.YMinValue),
+              max: Number(res.Data.DataResp.YMaxValue),
+              x_min: Number(res.Data.DataResp.XMinValue),
+              x_max: Number(res.Data.DataResp.XMaxValue)
+            }
+            this.setCrossVarietyChart();
           }
         });
     },
@@ -915,6 +925,8 @@ export default {
         res=await fittingEquationInterface.refreshChart({ ChartInfoId })
       }else if([7,8,9].includes(Source)) {
         res=await statisticFeatureInterface.refreshChart({ ChartInfoId })
+      }else if(Source===10) {
+        res=await crossVarietyInterface.refreshChart({ ChartInfoId })
       }
      
         this.refreshLoading = false;
@@ -1324,6 +1336,8 @@ export default {
         path='/fittingEquationChartEditor'
       }else if([7,8,9].includes(this.chartInfo.Source)) {
         path='/statisticFeatureChartEditor'
+      }else if(this.chartInfo.Source===10) {
+        path='/crossVarietyChartList'
       }