Browse Source

Merge branch 'yx' of ssh://61.161.152.110:29418/electronic-map into tjj2

darker 3 years ago
parent
commit
0ce2e37f63

+ 4 - 0
src/assets/styles/el-override/el-table.less

@@ -113,4 +113,8 @@
     background: transparent;
     color: @green;
   }
+
+  .el-table__footer-wrapper tbody td {
+    background: #1a1f2fCC;
+  }
 }

+ 464 - 0
src/components/chart/line/multiple-y-line-chart-normal.vue

@@ -0,0 +1,464 @@
+<template>
+    <div class="chart" :id="id"></div>
+</template>
+
+<script>
+import util from "@/helper/util.js";
+import partten from "@/helper/partten.js";
+import * as echarts from "echarts";
+
+export default {
+    name: "multiple-y-line-chart-normal",
+    componentName: "multiple-y-line-chart-normal",
+    props: {
+        width: {
+            type: String,
+            default: "100%",
+        },
+        height: {
+            type: String,
+            default: "13.889vh",
+        },
+        // 数据
+        list: {
+            type: Array,
+            default: () => [
+                {
+                    title: "机舱震动x方向",
+                    yAxisIndex: 0,
+                    value: [
+                        {
+                            text: "-0.003",
+                            value: -0.003,
+                        },
+                        {
+                            text: "-0.002",
+                            value: -0.002,
+                        },
+                        {
+                            text: "-0.003",
+                            value: -0.006,
+                        },
+                        {
+                            text: "-0.003",
+                            value: -0.003,
+                        },
+                        {
+                            text: "-0.002",
+                            value: -0.002,
+                        },
+                        {
+                            text: "-0.003",
+                            value: -0.006,
+                        },
+                        {
+                            text: "-0.003",
+                            value: -0.003,
+                        },
+                        {
+                            text: "-0.002",
+                            value: -0.002,
+                        },
+                        {
+                            text: "-0.003",
+                            value: -0.006,
+                        },
+                    ],
+                },
+                {
+                    title: "机舱震动y方向",
+                    yAxisIndex: 1,
+                    value: [
+                        {
+                            text: "-0.01",
+                            value: -0.01,
+                        },
+                        {
+                            text: "-0.005",
+                            value: -0.005,
+                        },
+                        {
+                            text: "-0.008",
+                            value: -0.008,
+                        },
+                        {
+                            text: "-0.01",
+                            value: -0.01,
+                        },
+                        {
+                            text: "-0.005",
+                            value: -0.005,
+                        },
+                        {
+                            text: "-0.008",
+                            value: -0.008,
+                        },
+                        {
+                            text: "-0.01",
+                            value: -0.01,
+                        },
+                        {
+                            text: "-0.005",
+                            value: -0.005,
+                        },
+                        {
+                            text: "-0.008",
+                            value: -0.008,
+                        },
+                    ],
+                },
+                {
+                    title: "机舱震动最大偏移值",
+                    yAxisIndex: 2,
+                    value: [
+                        {
+                            text: "1",
+                            value: 1,
+                        },
+                        {
+                            text: "0.05",
+                            value: 0.05,
+                        },
+                        {
+                            text: "0.5",
+                            value: 0.5,
+                        },
+                        {
+                            text: "1",
+                            value: 1,
+                        },
+                        {
+                            text: "0.05",
+                            value: 0.05,
+                        },
+                        {
+                            text: "0.5",
+                            value: 0.5,
+                        },
+                        {
+                            text: "1",
+                            value: 1,
+                        },
+                        {
+                            text: "0.05",
+                            value: 0.05,
+                        },
+                        {
+                            text: "0.5",
+                            value: 0.5,
+                        },
+                    ],
+                },
+                {
+                    title: "风速1",
+                    yAxisIndex: 3,
+                    value: [
+                        {
+                            text: "1",
+                            value: 1,
+                        },
+                        {
+                            text: "5",
+                            value: 5,
+                        },
+                        {
+                            text: "3",
+                            value: 1,
+                        },
+                        {
+                            text: "1",
+                            value: 1,
+                        },
+                        {
+                            text: "5",
+                            value: 5,
+                        },
+                        {
+                            text: "3",
+                            value: 1,
+                        },
+                        {
+                            text: "1",
+                            value: 1,
+                        },
+                        {
+                            text: "5",
+                            value: 5,
+                        },
+                        {
+                            text: "3",
+                            value: 1,
+                        },
+                    ],
+                },
+                {
+                    title: "风速2",
+                    yAxisIndex: 4,
+                    value: [
+                        {
+                            text: "1",
+                            value: 1,
+                        },
+                        {
+                            text: "2",
+                            value: 2,
+                        },
+                        {
+                            text: "3",
+                            value: 1,
+                        },
+                        {
+                            text: "1",
+                            value: 1,
+                        },
+                        {
+                            text: "2",
+                            value: 2,
+                        },
+                        {
+                            text: "3",
+                            value: 1,
+                        },
+                        {
+                            text: "1",
+                            value: 1,
+                        },
+                        {
+                            text: "2",
+                            value: 2,
+                        },
+                        {
+                            text: "3",
+                            value: 1,
+                        },
+                    ],
+                },
+            ],
+        },
+        showLegend: {
+            type: Boolean,
+            default: false,
+        },
+        // 轴
+        yAxises: {
+            type: Array,
+            default: () => [
+                {
+                    name: '机舱震动x方向',
+                    min: -0.01,
+                    max: 0,
+                    unit: "",
+                    position: "left",
+                },
+                {
+                    name: '机舱震动y方向',
+                    min: -0.01,
+                    max: 0,
+                    unit: "",
+                    position: "right",
+                },
+                {
+                    name: '机舱震动最大偏移值',
+                    min: 0,
+                    max: 1,
+                    unit: "",
+                    position: "left",
+                },
+                {
+                    name: '风速1',
+                    min: 0,
+                    max: 10,
+                    unit: "",
+                    position: "right",
+                },
+                {
+                    name: '风速2',
+                    min: 0,
+                    max: 10,
+                    unit: "",
+                    position: "left",
+                },
+            ],
+        },
+    },
+    data() {
+        return {
+            id: "",
+            chart: null,
+            color: ["#323E6F", "#1DA0D7", "#05BB4C", "#EDB32F", "#DB5520"],
+        };
+    },
+    computed: {
+        legend() {
+            return this.list.map((t) => {
+                return t.title;
+            });
+        },
+        xdata() {
+            return this.list[0].value.map((t) => {
+                return t.text;
+            });
+        },
+        yAxis() {
+            let result = [];
+            let p = {left: 0, right: 0};
+            this.yAxises.forEach((item, index) => {
+                result.push({
+                    type: "value",
+                    name: `${item.name}${item.unit}`,
+                    nameLocation: p[item.position] % 2 == 0 ? "end" : "start",
+                    min: item.min,
+                    max: item.max,
+                    position: item.position,
+                    offset: p[item.position] * 60,
+                    axisLabel: {
+                        formatter: "{value}",
+                        fontSize: util.vh(14),
+                    },
+                    //分格线
+                    splitLine: {
+                        lineStyle: {
+                            color: partten.getColor("gray"),
+                            type: "dashed",
+                        },
+                    },
+                    axisLine: {
+                      show: true,
+                    },
+                    axisTick: {
+                      show: true
+                    }
+                });
+                p[item.position]++;
+            });
+
+            return result;
+        },
+        series() {
+            let result = [];
+
+            this.list.forEach((value, index) => {
+                result.push({
+                    name: value.title,
+                    type: "line",
+                    smooth: true,
+                    zlevel: index,
+                    lineStyle: {
+                        normal: {
+                            color: this.color[index],
+                            width: 1,
+                        },
+                    },
+                    itemStyle: {
+                        opacity: 0,
+                    },
+                    yAxisIndex: value.yAxisIndex,
+                    data: value.value.map((t) => {
+                        return t.value;
+                    }),
+                });
+            });
+
+            return result;
+        },
+    },
+    methods: {
+        resize() {},
+        initChart() {
+            const chart = echarts.init(this.$el);
+
+            let option = this.option();
+            console.log(option)
+            chart.clear();
+            chart.setOption(option);
+
+            this.resize = function() {
+                chart.resize();
+            };
+
+            window.addEventListener("resize", this.resize);
+        },
+        option: function () {
+            return {
+                color: this.color,
+                tooltip: {
+                    trigger: "axis",
+                    backgroundColor: "rgba(0,0,0,0.4)",
+                    borderColor: partten.getColor("gray"),
+                    textStyle: {
+                        color: "#fff",
+                        fontSize: 14,
+                    },
+                },
+                legend: {
+                    show: this.showLegend,
+                    data: this.legend,
+                    top: 0,
+                    icon: "circle",
+                    itemWidth: 6,
+                    inactiveColor: partten.getColor("gray"),
+                    textStyle: {
+                        color: partten.getColor("grayl"),
+                        fontSize: 12,
+                    },
+                },
+                grid: {
+                    top: util.vh(32),
+                    left: util.vh(50),
+                    right: util.vh(50),
+                    bottom: util.vh(20),
+                    containLabel: true,
+                },
+                xAxis: [
+                    {
+                        type: "category",
+                        boundaryGap: false,
+                        axisLabel: {
+                            formatter: "{value}",
+                            fontSize: util.vh(14),
+                            textStyle: {
+                                color: partten.getColor("gray"),
+                            },
+                        },
+                        data: this.xdata,
+                    },
+                ],
+                yAxis: this.yAxis,
+                series: this.series,
+            };
+        },
+        reload: function () {
+            const chart = echarts.getInstanceByDom(this.$el);
+            chart.clear();
+            let option = this.option();
+            chart.setOption(option);
+        },
+    },
+    created() {
+        this.id = "pie-chart-" + util.newGUID();
+    },
+    mounted() {
+        this.$nextTick(() => {
+            this.$el.style.width = this.width;
+            this.$el.style.height = this.height;
+            this.initChart();
+        });
+    },
+    updated() {
+        this.$nextTick(() => {
+            this.initChart();
+        });
+    },
+    unmounted() {
+        window.removeEventListener("resize", this.resize);
+    },
+};
+</script>
+
+<style lang="less">
+.chart {
+    width: 100%;
+    height: 100%;
+    display: inline-block;
+}
+</style>

+ 6 - 2
src/components/coms/table/group-table.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-table class="custom-table" :class="customClass" stripe :data="data.data" :height="height" style="width: 100%" @cell-click="onClick" @header-click="onHeaderClick">
+  <el-table class="custom-table" :show-summary="summary" :class="customClass" stripe :data="data.data" :height="height" style="width: 100%" @cell-click="onClick" @header-click="onHeaderClick">
     <template v-for="(col, cIndex) in data.column" :key="col">
       <el-table-column v-if="col.child && col.child.length > 0" :label="col.name" :key="col">
         <el-table-column
@@ -95,6 +95,10 @@ export default {
       type: Boolean,
       default: true,
     },
+    summary: {
+      type: Boolean,
+      default: false,
+    },
   },
   emits: {
     onPagging: null,
@@ -154,7 +158,7 @@ export default {
         this.headerIndex = column.index;
         this.subIndex = column.no;
       }
-      this.$emit("headerClick", { event: event, col: column.rawColumnKey, data: this.data.data });
+      this.$emit("headerClick", { level: column.level,  event: event, col: column.rawColumnKey, data: this.data.data });
     },
     handleCurrentChange(val) {
       this.currentPage = val;

+ 17 - 2
src/components/coms/table/table2.vue

@@ -6,9 +6,10 @@
     :height="height"
     style="width: 100%"
     @cell-click="onClick"
+    @header-click="onHeaderClick"
   >
     <el-table-column
-      v-for="col in data.column"
+      v-for="(col, cindex) of data.column"
       :key="col"
       :prop="col.field"
       :label="col.name"
@@ -20,6 +21,7 @@
       :align="'center'"
       :resizable="col.resizable"
       :header-align="'center'"
+      :class-name="getClassName(cindex)"
     >
       <template v-if="col.slot == true" #default="item">
         <slot
@@ -71,7 +73,7 @@ export default {
     data: Object,
     height: {
       type: String,
-      default: "",
+      default: "100%",
     },
     pageSize: {
       type: Number,
@@ -86,6 +88,10 @@ export default {
         };
       },
     },
+    isColumnLight: {
+      type: Boolean,
+      default: true,
+    },
   },
   // 自定义事件
   emits: {
@@ -96,6 +102,7 @@ export default {
   data() {
     return {
       currentPage: 1,
+      headerIndex: -1,
     };
   },
   computed: {
@@ -148,6 +155,14 @@ export default {
         end: this.endRow,
       });
     },
+    onHeaderClick(column, event) {
+      this.headerIndex = column.no;
+      this.$emit("headerClick", { index: column.no, event: event, col: column.rawColumnKey, data: this.data.data });
+    },
+    getClassName(cindex) {
+      if (this.isColumnLight == true && cindex == this.headerIndex) return "light";
+      return "";
+    },
   },
   // 生命周期钩子
   beforeCreate() {

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

@@ -136,10 +136,10 @@
           </div>
         </template> -->
           <template v-slot:default>
-            <multiple-line-chart
+            <multiple-y-line-chart-normal
               height="100%"
               :list="Powertrend"
-              units="(MW)"
+              :yAxises="PowertrendYAxises"
               :showLegend="true"
               :hoverType="'axis'"
               @click="
@@ -794,7 +794,7 @@ import ComPanel from "../../components/coms/panel/panel";
 // import ListBarChart from "../../components/chart/bar/list-bar-chart.vue";
 import ToolbarPanel from "../../components/coms/panel/toolbar-panel.vue";
 import MultipleBarChart from "../../components/chart/bar/multiple-bar-chart.vue";
-import MultipleLineChart from "../../components/chart/line/double-line-chart.vue";
+import MultipleYLineChartNormal from "../../components/chart/line/multiple-y-line-chart-normal.vue";
 import Panel3 from "../../components/coms/panel/panel3.vue";
 import SvgIcon from "../../components/coms/icon/svg-icon.vue";
 import CoulometricAnalysis from "./components/coulometric-analysis.vue";
@@ -820,7 +820,7 @@ export default {
     ToolbarPanel,
     PowerPlan,
     MultipleBarChart,
-    MultipleLineChart,
+    MultipleYLineChartNormal,
     Panel3,
     SvgIcon,
     Map,
@@ -908,6 +908,15 @@ export default {
           value: [],
         },
       ],
+      PowertrendYAxises: [
+          {
+              name: '',
+              min: 0,
+              max: 60,
+              unit: "(MW)",
+              position: "left",
+          },
+      ],
     };
   },
 

+ 1 - 3
src/views/LightMatrix3/LightMatrix3.vue

@@ -788,15 +788,13 @@ export default {
 
         .sub-title-item {
           display: flex;
-          flex: 0 0 110px;
+          flex: 1;
 
           .sub-title {
             flex: 0 0 auto;
             color: @gray;
             font-size: 12px;
             margin: 0 0.556vh 0 1.481vh;
-            padding-top: 1px;
-            width: 50px;
           }
 
           .sub-count {

+ 6 - 3
src/views/NewPages/power-benchmarking.vue

@@ -177,7 +177,7 @@
             <span class="right-btn">光伏</span>
           </div>
         </div>
-        <group-table :customClass="'table'" :data="eltableData" :height="'290px'" :elPaggingProps='null' @headerClick="headerClick"></group-table>
+        <group-table :summary="true" :customClass="'table'" :data="eltableData" :height="'310px'" :elPaggingProps='null' @headerClick="headerClick"></group-table>
       </div>
       <div class="top-right">
         <div class="rank-title">
@@ -188,7 +188,7 @@
           排行榜
         </div>
         <div class="rank-block"></div>
-        <group-table :customClass="'rank-table'" :data="greenTable" :height="'290px'" :elPaggingProps='null'>
+        <group-table :customClass="'rank-table'" :data="greenTable" :height="'310px'" :elPaggingProps='null'>
           <template v-slot:rank="scope">
             <div class="rank-index" :class="'index-' + scope.row.rank">
               {{ scope.row.rank }}
@@ -199,7 +199,7 @@
     </div>
     <div class="bottom">
       <panel :title="'指标分析'">
-        <multiple-bar-chart :list="barData" :height="'calc(100vh - 660px)'" :units="['']" />
+        <multiple-bar-chart :list="barData" :height="'calc(100vh - 680px)'" :units="['']" />
       </panel>
     </div>
   </div>
@@ -496,6 +496,9 @@ export default {
       }
     },
     headerClick(param) {
+      if (param.level == 1) {
+        console.log(param); // 点击一级标题事件
+      }
       if (param.col.field != undefined && param.col.name != "区域公司") {
         this.setRank(param.col.field, param.col.name);
         this.echartData(param.col.field, param.col.name);

+ 16 - 10
src/views/SandTable/component/p-panel.vue

@@ -21,12 +21,10 @@
         </div>
       </div>
       <div class="pp-data">
-        <div class="pp-tip" :style="'margin-left: ' + data * 100 + '%'">
+        <div class="pp-tip" :style="'margin-left: ' + mLeft(data) + '%'">
           <div class="pp-tip-data font-sm">
             {{
-              flip
-                ? ((1 - data) * 100).toFixed(2) + "%"
-                : (data * 100).toFixed(2) + "%"
+              (data * 100).toFixed(2)
             }}
           </div>
           <div class="pp-tip-icon">
@@ -46,7 +44,7 @@
           <div
             class="pp-data-num"
             :style="
-              'width: ' + data * 100 + '%; background: ' + dataColor + ';'
+              'width: ' + mLeft(data) + '%; background: ' + dataColor + ';'
             "
           ></div>
         </div>
@@ -106,10 +104,6 @@ export default {
       type: Number,
       default: 0.75,
     },
-    flip: {
-      type: Boolean,
-      default: false,
-    },
     dataColor: {
       type: String,
       default: "#05BB4C",
@@ -125,7 +119,19 @@ export default {
     return {};
   },
   // 函数
-  methods: {},
+  methods: {
+    mLeft: function (data) {
+        if (data > 0) {
+            const r = data * 100 / 2 + 50;
+            return r > 100 ? 100 : r;
+        } else if (data < 0) {
+            const r = 50 - ((0-data*100) / 2);
+            return r < 0 ? 0 : r;
+        } else {
+            return 50;
+        }
+    }
+  },
   // 生命周期钩子
   beforeCreate() {
     // 创建前

+ 8 - 8
src/views/SandTable/component/st-back.vue

@@ -12,7 +12,7 @@
                     type="rotate"
                     from="359 436 436"
                     to="0 436 436"
-                    dur="50s"
+                    dur="100s"
                     repeatCount="indefinite"
                 />
             </circle>
@@ -23,7 +23,7 @@
                     type="rotate"
                     from="0 436 436"
                     to="359 436 436"
-                    dur="25s"
+                    dur="50s"
                     repeatCount="indefinite"
                 />
             </circle>
@@ -35,7 +35,7 @@
                     type="rotate"
                     from="0 436 436"
                     to="359 436 436"
-                    dur="5s"
+                    dur="30s"
                     repeatCount="indefinite"
                 />
             </use>
@@ -46,7 +46,7 @@
                     type="rotate"
                     from="0 436 436"
                     to="359 436 436"
-                    dur="5s"
+                    dur="30s"
                     repeatCount="indefinite"
                 />
             </use>
@@ -57,7 +57,7 @@
                     type="rotate"
                     from="0 436 436"
                     to="359 436 436"
-                    dur="5s"
+                    dur="30s"
                     repeatCount="indefinite"
                 />
             </use>
@@ -68,7 +68,7 @@
                     type="rotate"
                     from="359 436 436"
                     to="0 436 436"
-                    dur="5s"
+                    dur="30s"
                     repeatCount="indefinite"
                 />
             </use>
@@ -79,7 +79,7 @@
                     type="rotate"
                     from="135 436 436"
                     to="-224 436 436"
-                    dur="5s"
+                    dur="30s"
                     repeatCount="indefinite"
                 />
             </use>
@@ -90,7 +90,7 @@
                     type="rotate"
                     from="225 436 436"
                     to="-134 436 436"
-                    dur="5s"
+                    dur="30s"
                     repeatCount="indefinite"
                 />
             </use>

+ 29 - 3
src/views/WindSite/pages/DraughtFanList.vue

@@ -4,20 +4,20 @@
         <BtnGroup2 :btnGroups="btnGroupsss" :rowIndex="rowIndex" :index="selectIndex" @select="select"></BtnGroup2>
     </div>
     <div class="df-table">
-      <ComTable :data="data"></ComTable>
+      <table-2 :data="data" :height="'100%'" @headerClick="headerClick"></table-2>
     </div>
   </div>
 </template>
 
 <script>
-import ComTable from "@com/coms/table/table.vue";
+import Table2 from "@com/coms/table/table2.vue";
 import BtnGroup2 from "@com/coms/btn/btn-group-double.vue";
 export default {
   // 名称
   name: "DraughtFanList",
   // 使用组件
   components: {
-    ComTable,
+    Table2,
     BtnGroup2,
   },
   // 数据
@@ -76,119 +76,139 @@ export default {
           {
             name: "风机名称",
             field: "code",
+            sortable: false,
             is_num: false,
             is_light: false,
           },
           {
             name: "冷却风温度",
             field: "FDJLQFWD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "有功功率",
             field: "FJGL",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "液压油温度",
             field: "YYYW",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "Pcspp温度",
             field: "PCS_WD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "U1绕组温度",
             field: "U1YZWD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "U2绕组温度",
             field: "U2YZWD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "V1绕组温度",
             field: "V1YZWD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "V2绕组温度",
             field: "V2YZWD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "W1绕组温度",
             field: "W1YZWD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "W2绕组温度",
             field: "W2YZWD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "轴承A温度",
             field: "FDJZCAWD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "轴承B温度",
             field: "FDJZCBWD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "齿轮箱温度",
             field: "CLXWD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "齿轮箱轴1温度",
             field: "CLXSRZ1WD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "齿轮箱轴2温度",
             field: "CLXSRZ2WD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "机舱温度",
             field: "JCWD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "滑环温度",
             field: "FDJHHWD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
           {
             name: "环境温度",
             field: "JCWWD",
+            sortable: false,
             is_num: true,
             is_light: false,
           },
         ],
         data: [],
+        total: 1000,
       },
     };
   },
@@ -416,6 +436,12 @@ export default {
       });
     },
 
+    headerClick(param) {
+      this.data.column.forEach(item => {
+        item.sortable = false;
+      });
+      this.data.column[param.index].sortable = true;
+    },
   },
 
   created() {

+ 5 - 2
src/views/WindSite/pages/LightMatrix.vue

@@ -612,15 +612,18 @@ export default {
 
       .sub-title-item {
         display: flex;
+        flex: 1;
 
         .sub-title {
+          flex: 0 0 auto;
           color: @gray;
-          font-size: @fontsize-s;
+          font-size: 12px;
           margin: 0 0.556vh 0 1.481vh;
         }
 
         .sub-count {
-          font-size: @fontsize-s;
+          flex: 1 0 auto;
+          font-size: 14px;
           font-family: "Bicubik";
           font-weight: 500;