shanbinzhang 4 months ago
parent
commit
f77fe14cb7

+ 19 - 17
src/views/dataEntry_manage/chartSetting.vue

@@ -1903,7 +1903,8 @@ export default {
 
     /* 保存当前图表配置 */
     saveChartHandle: _.debounce(function () {
-      if (this.selected_chartid) {
+      if (!this.chartInfo.ChartInfoId)  return
+
         //遍历每条线的指标配置
         let arr = this.tableData.map((item) => {
           return {
@@ -1923,13 +1924,26 @@ export default {
         });
 
         let public_param = {
-          ChartClassifyId: this.selected_chartClassify,
-          ChartInfoId: this.selected_chartid || 0,
+          ChartClassifyId: this.chartInfo.ChartClassifyId,
+          ChartInfoId: this.chartInfo.ChartInfoId || 0,
           ChartEdbInfoList: arr,
         }
 
         let typeChartParam = {};
         switch(this.chartInfo.ChartType) {
+          case 1:
+          case 3:
+          case 4:
+          case 5:
+          case 6:
+            typeChartParam = {
+              ...public_param,
+              DateType: this.year_select,
+              StartYear:this.count_year || 0,
+              StartDate: [5,6].includes(this.year_select) ? this.select_date[0] : '',
+              EndDate: this.year_select === 5 ? this.select_date[1] : '',
+            }
+            break
           case 2:
             typeChartParam = {
               ...public_param,
@@ -1969,19 +1983,8 @@ export default {
             break
         }
 
-        let params = this.sameOptionType.includes(this.selected_chartType)
-          ? {
-              ...public_param,
-              DateType: this.year_select,
-              StartYear:this.count_year || 0,
-              StartDate:
-                this.year_select === 5 || this.year_select === 6
-                  ? this.select_date[0]
-                  : '',
-              EndDate: this.year_select === 5 ? this.select_date[1] : '',
-            }
-          : typeChartParam;
-        if(![7,10,11].includes(this.selected_chartType)){
+        let params = typeChartParam;
+        if(![7,10,11].includes(this.chartInfo.ChartType)){
             const {
                 min,max,rightMin,rightMax,rightTwoMin,rightTwoMax
             } = this.chartLimit
@@ -2011,7 +2014,6 @@ export default {
             this.setChartImage();
           }
         });
-      }
     }, 500),
     // 英文面板时候的判断
     copyChartConfirm(type){

+ 30 - 28
src/views/mychart_manage/components/chartDetailDia.vue

@@ -1076,6 +1076,19 @@ export default {
 
       let typeChartParam = {};
       switch(this.chartInfo.ChartType) {
+        case 1:
+        case 3:
+        case 4:
+        case 5:
+        case 6:
+          typeChartParam = {
+            ...public_param,
+            DateType: this.year_select,
+            StartYear:this.count_year || 0,
+            StartDate: [5,6].includes(this.year_select) ? this.select_date[0] : '',
+            EndDate: this.year_select === 5 ? this.select_date[1] : '',
+          }
+          break
         case 2:
           typeChartParam = {
             ...public_param,
@@ -1111,35 +1124,24 @@ export default {
           break
       }
 
-      let params = this.sameOptionType.includes(this.chartInfo.ChartType)
-        ? {
-            ...public_param,
-            DateType: this.year_select,
-            StartYear:this.count_year || 0,
-            StartDate:
-              this.year_select === 5 || this.year_select === 6
-                ? this.select_date[0]
-                : '',
-            EndDate: this.year_select === 5 ? this.select_date[1] : '',
-          }
-        : typeChartParam;
+      let params = typeChartParam;
         
-        if(![7,10,11].includes(this.selected_chartType)){
-            const {
-                min,max,rightMin,rightMax,rightTwoMin,rightTwoMax
-            } = this.chartLimit
-            params = {
-                ...params,
-                LeftMin:min+'',
-                LeftMax:max+'',
-                RightMin:rightMin+'',
-                RightMax:rightMax+'',
-                Right2Min:rightTwoMin+'',
-                Right2Max:rightTwoMax+'',
-                //手动保存视为更改过上下限
-                MinMaxSave:1
-            }
-        }
+      if(![7,10,11].includes(this.chartInfo.ChartType)){
+          const {
+              min,max,rightMin,rightMax,rightTwoMin,rightTwoMax
+          } = this.chartLimit
+          params = {
+              ...params,
+              LeftMin:min+'',
+              LeftMax:max+'',
+              RightMin:rightMin+'',
+              RightMax:rightMax+'',
+              Right2Min:rightTwoMin+'',
+              Right2Max:rightTwoMax+'',
+              //手动保存视为更改过上下限
+              MinMaxSave:1
+          }
+      }
       dataBaseInterface.chartSave(params).then((res) => {
         if (res.Ret === 200) {
           this.$message.success(this.$t('MsgPrompt.saved_msg'));