Преглед изворни кода

逆变器分析页面接口调试

baiyanting пре 2 година
родитељ
комит
f2a84e9257

+ 34 - 15
src/components/chart/scatter/simple-scatter.vue

@@ -21,7 +21,6 @@ export default {
     data: {
       type: Array,
       default: () => [
-       
         {
           title: "女",
           value: [
@@ -278,18 +277,18 @@ export default {
     },
     xTitle: {
       type: String,
-      default: "x轴标题",
+      default: "电压",
     },
     yTitle: {
       type: String,
-      default: "Y轴标题",
+      default: "效率离散率",
     },
     showLegend: {
       type: Boolean,
       default: true,
     },
   },
-  data () {
+  data() {
     return {
       id: "",
       chart: null,
@@ -297,7 +296,7 @@ export default {
     };
   },
   computed: {
-    series () {
+    series() {
       let result = [];
       this.data.forEach((element, index) => {
         result.push({
@@ -307,6 +306,10 @@ export default {
             focus: "series",
           },
           data: element.value,
+          symbolSize: 3,
+          itemStyle: {
+            color: "#216de8",
+          },
         });
       });
       return result;
@@ -344,14 +347,16 @@ export default {
             fontSize: util.vh(16),
             color: "#fff",
           },
-          formatter: function(params) {
+          formatter: function (params) {
             if (params.componentType == "markLine") {
               return params.name + "<br />" + params.value;
             }
 
             var msg = params.seriesName + "<br />";
-            msg += params.marker + that.xTitle + ":" + params.value[0] + "<br />";
-            msg += params.marker + that.yTitle + ":" + params.value[1] + "<br />";
+            msg +=
+              params.marker + that.xTitle + ":" + params.value[0] + "<br />";
+            msg +=
+              params.marker + that.yTitle + ":" + params.value[1] + "<br />";
             return msg;
           },
           axisPointer: {
@@ -383,15 +388,22 @@ export default {
             scale: true,
             axisLabel: {
               formatter: "{value}",
+              color: "#b3b3b3",
             },
             splitLine: {
               show: false,
             },
+            axisLine: {
+              show: true,
+              lineStyle: {
+                color: "#b3b3b3",
+              },
+            },
           },
         ],
         // xAxis: {
         //     show: true,    // 是否显示 x 轴
-        //     position: 'top',    // x 轴的位置('top','bottom') 
+        //     position: 'top',    // x 轴的位置('top','bottom')
         //     name: "ceshia",
         //     type: 'value',    // 坐标轴类型
         //     // nameRotate: 90,    // 坐标轴名字旋转,角度值
@@ -426,7 +438,7 @@ export default {
         //     //     margin: 10,    // 刻度标签与轴线之间的距离
         //     //     // formatter 刻度标签的内容格式器,支持字符串模板和回调函数两种形式
         //     //     color: '#FFF',     // 刻度标签文字的颜色
-        //     //     fontStyle: 'normal',    // 文字字体的风格('normal',无样式;'italic',斜体;'oblique',倾斜字体) 
+        //     //     fontStyle: 'normal',    // 文字字体的风格('normal',无样式;'italic',斜体;'oblique',倾斜字体)
         //     //     fontWeight: 'normal',    // 文字字体的粗细('normal',无样式;'bold',加粗;'bolder',加粗的基础上再加粗;'lighter',变细;数字定义粗细也可以,取值范围100至700)
         //     //     fontSize: '20',    // 文字字体大小
         //     //     align: 'left',     // 文字水平对齐方式,默认自动('left','center','right')
@@ -452,7 +464,7 @@ export default {
         //     // data: {
         //     //     textStyle: {
         //     //         color: '#FFF',     // 文字的颜色
-        //     //         fontStyle: 'normal',    // 文字字体的风格('normal',无样式;'italic',斜体;'oblique',倾斜字体) 
+        //     //         fontStyle: 'normal',    // 文字字体的风格('normal',无样式;'italic',斜体;'oblique',倾斜字体)
         //     //         fontWeight: 'normal',    // 文字字体的粗细('normal',无样式;'bold',加粗;'bolder',加粗的基础上再加粗;'lighter',变细;数字定义粗细也可以,取值范围100至700)
         //     //         fontSize: '20',    // 文字字体大小
         //     //         align: 'left',     // 文字水平对齐方式,默认自动('left','center','right')
@@ -469,6 +481,13 @@ export default {
             scale: true,
             axisLabel: {
               formatter: "{value}",
+              color: "#b3b3b3",
+            },
+            axisLine: {
+              show: true,
+              lineStyle: {
+                color: "#b3b3b3",
+              },
             },
             splitLine: {
               show: false,
@@ -488,22 +507,22 @@ export default {
       window.addEventListener("resize", this.resize);
     },
   },
-  created () {
+  created() {
     this.id = "pie-chart-" + util.newGUID();
   },
-  mounted () {
+  mounted() {
     this.$nextTick(() => {
       this.$el.style.width = this.width;
       this.$el.style.height = this.height;
       this.initChart();
     });
   },
-  updated () {
+  updated() {
     this.$nextTick(() => {
       this.initChart();
     });
   },
-  unmounted () {
+  unmounted() {
     window.removeEventListener("resize", this.resize);
   },
 };

+ 6 - 6
src/views/layout/economicsOperation/analyse/inverterAnalyse/components/historyDetail.vue

@@ -9,7 +9,7 @@
             type="datetime"
             size="mini"
             placeholder="选择日期"
-            format="YYYY-MM-DD HH:mm:ss"
+            value-format="YYYY-MM-DD HH:mm:ss"
           >
           </el-date-picker>
         </div>
@@ -22,7 +22,7 @@
             size="mini"
             type="datetime"
             placeholder="选择日期"
-            format="YYYY-MM-DD HH:mm:ss"
+            value-format="YYYY-MM-DD HH:mm:ss"
           >
           </el-date-picker>
         </div>
@@ -47,7 +47,7 @@
       </el-button>
     </div>
     <div class="chart-wrapper">
-      <simpleScatter width="100%" height="100%" :list="lineData" />
+      <simpleScatter width="100%" height="100%" :data="lineData" />
     </div>
   </div>
 </template>
@@ -88,8 +88,8 @@ export default {
         {
           title: this.title,
           value: data.map((item) => [
-            item.inputVoltage.toFixed(2),
-            item.conversionRate.toFixed(2),
+            Number(item.inputVoltage.toFixed(2)),
+            Number(item.conversionRate.toFixed(2)),
           ]),
         },
       ];
@@ -98,7 +98,7 @@ export default {
 };
 </script>
 <style lang="less" scoped>
-::v-deep .body-wrapper {
+.body-wrapper ::v-deep {
   height: 100%;
   display: flex;
   flex-direction: column;

+ 0 - 2
src/views/layout/economicsOperation/analyse/inverterAnalyse/index.vue

@@ -336,8 +336,6 @@ export default {
   },
   components: { HistoryDetail },
   created() {
-    this.starttime = dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss");
-    this.endtime = dayjs().format("YYYY-MM-DD HH:mm:ss");
     this.getCompanyData();
   },
   methods: {