Browse Source

Merge branch 'yx' of http://61.161.152.110:10101/r/electronic-map into yx

chenminghua 3 years atrás
parent
commit
92f9fe8d74

+ 11 - 13
src/components/chart/line/multiple-y-line-chart-normal.vue

@@ -307,13 +307,14 @@ export default {
                     type: "value",
                     name: `${item.name}${item.unit}`,
                     nameLocation: p[item.position] % 2 == 0 ? "end" : "start",
+                    nameGap: 10,
                     min: item.min,
                     max: item.max,
                     position: item.position,
-                    offset: p[item.position] * 60,
+                    offset: p[item.position] * 50,
                     axisLabel: {
                         formatter: "{value}",
-                        fontSize: util.vh(14),
+                        fontSize: 12,
                     },
                     //分格线
                     splitLine: {
@@ -349,9 +350,7 @@ export default {
                             width: 1,
                         },
                     },
-                    itemStyle: {
-                        opacity: 0,
-                    },
+                    showSymbol: false,
                     yAxisIndex: value.yAxisIndex,
                     data: value.value.map((t) => {
                         return t.value;
@@ -368,7 +367,6 @@ export default {
             const chart = echarts.init(this.$el);
 
             let option = this.option();
-            console.log(option)
             chart.clear();
             chart.setOption(option);
 
@@ -387,13 +385,13 @@ export default {
                     borderColor: partten.getColor("gray"),
                     textStyle: {
                         color: "#fff",
-                        fontSize: 14,
+                        fontSize: 12,
                     },
                 },
                 legend: {
                     show: this.showLegend,
                     data: this.legend,
-                    top: 0,
+                    top: 'top',
                     icon: "circle",
                     itemWidth: 6,
                     inactiveColor: partten.getColor("gray"),
@@ -403,10 +401,10 @@ export default {
                     },
                 },
                 grid: {
-                    top: util.vh(32),
-                    left: util.vh(50),
-                    right: util.vh(50),
-                    bottom: util.vh(20),
+                    top: 27,
+                    left: 16,
+                    right: 16,
+                    bottom: 0,
                     containLabel: true,
                 },
                 xAxis: [
@@ -415,7 +413,7 @@ export default {
                         boundaryGap: false,
                         axisLabel: {
                             formatter: "{value}",
-                            fontSize: util.vh(14),
+                            fontSize: 12,
                             textStyle: {
                                 color: partten.getColor("gray"),
                             },

+ 4 - 53
src/views/Home/Home.vue

@@ -771,18 +771,6 @@
       </div>
     </el-dialog>
     <el-dialog
-      title="预测电量详情"
-      v-model="showForecastDialog"
-      width="70%"
-      top="10vh"
-      custom-class="modal"
-      :close-on-click-modal="true"
-    >
-      <div style="height: 500px; padding: 50px 0">
-        <ComTable :data="forecastData" height="100%;" />
-      </div>
-    </el-dialog>
-    <el-dialog
       :title="dialogTitle"
       v-model="dialogShow"
       width="70%"
@@ -859,7 +847,6 @@ export default {
       timmer2: null,
       timmer3: null,
       showWeatherDialog: false,
-      showForecastDialog: false,
       weatherChart: [
         {
           title: "温度",
@@ -908,18 +895,6 @@ export default {
       dialogShow: false,
       dialogTitle: "",
       dialogData: {},
-      forecastData: {
-        column: [
-          {
-            name: "风场",
-            field: "name",
-            is_num: false,
-            is_light: false,
-            sortable: true,
-          },
-        ],
-        data: [],
-      },
       // 预测电量
       ForecastPower: [],
       // 日发电量
@@ -1249,6 +1224,7 @@ export default {
 
     showForecastBox() {
       let that = this;
+      that.dialogTitle = "预测电量详情";
       that.API.requestData({
         method: "POST",
         subUrl: "/genreset/getForecastwindspeedInfo",
@@ -1256,34 +1232,9 @@ export default {
           wpId: that.wpId,
         },
         success(res) {
-
-          let forecastData = {
-            column: [
-              {
-                name: "风场名称",
-                field: "name",
-                is_num: false,
-                is_light: false,
-                sortable: true,
-              },
-            ],
-            data: [],
-          };
-
-          res.data.retValue.forEach((ele, index) => {
-            forecastData.column.push({
-              name: res.data.datels[index],
-              field: "value" + (index + 1),
-              is_num: false,
-              is_light: false,
-              sortable: true,
-            });
-          });
-
-          forecastData.data = res.data.retValue;
-          that.forecastData = forecastData;
-
-          that.showForecastDialog = true;
+          that.dialogData = res.data;
+          that.dialogType = "table";
+          that.dialogShow = true;
         },
       });
     },

+ 30 - 22
src/views/Home/dialog/table.vue

@@ -15,18 +15,26 @@
       <div class="left">
         <table class="table-form">
           <tr>
-            <td class="white"></td>
-            <td class="white" v-for="(item, index) in tableData.datels" :key="index">{{item}}</td>
+            <td class="white" v-if="tableData.result && tableData.result.length"></td>
+            <td class="white" v-if="tableData.retValue && tableData.retValue.length">风场</td>
+            <td
+              class="white"
+              v-for="(item, index) in tableData.datels"
+              :key="index"
+            >
+              {{ item }}
+            </td>
           </tr>
-          <tr v-for="(item, index) in tableData.result" :key="index">
-            <td class="white" v-if="item.value1">{{item.value1}}</td>
-            <td class="white" v-if="item.value2">{{item.value2}}</td>
-            <td class="white" v-if="item.value3">{{item.value3}}</td>
-            <td class="white" v-if="item.value4">{{item.value4}}</td>
-            <td class="white" v-if="item.value5">{{item.value5}}</td>
-            <td class="white" v-if="item.value6">{{item.value6}}</td>
-            <td class="white" v-if="item.value7">{{item.value7}}</td>
-            <td class="white" v-if="item.value8">{{item.value8}}</td>
+          <tr v-for="(item, index) in tableData.result || tableData.retValue" :key="index">
+            <td class="white" v-if="tableData.retValue && item.name">{{ item.name }}</td>
+            <td class="white" v-if="item.value1">{{ item.value1 }}</td>
+            <td class="white" v-if="item.value2">{{ item.value2 }}</td>
+            <td class="white" v-if="item.value3">{{ item.value3 }}</td>
+            <td class="white" v-if="item.value4">{{ item.value4 }}</td>
+            <td class="white" v-if="item.value5">{{ item.value5 }}</td>
+            <td class="white" v-if="item.value6">{{ item.value6 }}</td>
+            <td class="white" v-if="item.value7">{{ item.value7 }}</td>
+            <td class="white" v-if="item.value8">{{ item.value8 }}</td>
           </tr>
         </table>
       </div>
@@ -39,26 +47,26 @@ export default {
   data() {
     return {
       value: "",
-      tableData:{}
+      tableData: {},
     };
   },
 
-  props:{
-    data:{
-      type:Object,
-      default:() => {}
-    }
+  props: {
+    data: {
+      type: Object,
+      default: () => {},
+    },
   },
 
-  mounted(){
+  mounted() {
     this.tableData = this.data;
   },
 
-  watch:{
-    data(res){
+  watch: {
+    data(res) {
       this.tableData = res;
-    }
-  }
+    },
+  },
 };
 </script>