Просмотр исходного кода

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

yangxiao 3 лет назад
Родитель
Сommit
8c1eba1809

+ 1 - 0
package.json

@@ -9,6 +9,7 @@
     "lint": "vue-cli-service lint"
   },
   "dependencies": {
+    "@antv/x6": "^1.24.4",
     "@arcgis/core": "^4.19.3",
     "axios": "^0.21.1",
     "core-js": "^3.6.5",

+ 34 - 19
src/views/HealthControl/HealthTab1.vue

@@ -17,7 +17,7 @@
         <div class="empty"></div>
       </div>
       <div class="info-chart">
-        <panel class="info-chart-panel" :title="'损失电量分析'">
+        <panel class="info-chart-panel" :title="'健康趋势'">
           <vertival-bar-line-chart
             :height="'310px'"
             :bardata="bardata"
@@ -27,7 +27,7 @@
       </div>
     </div>
     <div class="health-report">
-      <panel class="health-report-panel" :title="'健康报告'" :showLine="false">
+      <panel class="health-report-panel" :title="'推荐检修风机'" :showLine="false">
         <div class="actions mg-b-16">
           <div class="item green" @click="onClickRecommon(1)">当日内推荐</div>
           <div class="item purple" @click="onClickRecommon(2)">三日内推荐</div>
@@ -39,20 +39,15 @@
         </div>
         <div class="report-items scroll">
           <div class="item" v-for="(item, index) in recommenList" :key="index">
-            <div class="title">风机编号:{{ item.wtid }}</div>
+            <div class="title">
+              <div>风机编号:{{ item.wtid }}</div>
+              <span @click="onClickReport(item)">健康报告</span>
+            </div>
             <div class="info">
               <p>推荐理由:{{ item.reason }}</p>
-              <p>
-                推荐检修时间:{{
-                  new Date(item.recodedate).formatDate("yyyy-MM-dd hh:mm:ss")
-                }}
-              </p>
+              <p>推荐检修时间:{{new Date(item.recodedate).formatDate("yyyy-MM-dd hh:mm:ss")}}</p>
               <p>推荐时间对应风速:{{ item.speed }}</p>
-              <p>
-                判断时间:{{
-                  new Date(item.createdate).formatDate("yyyy-MM-dd hh:mm:ss")
-                }}
-              </p>
+              <p>判断时间:{{new Date(item.createdate).formatDate("yyyy-MM-dd hh:mm:ss")}}</p>
               <div class="actions mg-t-16">
                 <button class="btn success" @click="onClickCofirm(item)">
                   <i class="fa fa-check"></i>
@@ -68,6 +63,7 @@
         </div>
       </panel>
     </div>
+    <health-report :show="reportshow" :params="reportparams" @closed="closed"/>
   </div>
 </template>
 
@@ -75,9 +71,10 @@
 import VertivalBarLineChart from "../../components/chart/combination/vertival-bar-line-chart.vue";
 import SvgIcon from "../../components/coms/icon/svg-icon.vue";
 import Panel from "../../components/coms/panel/panel.vue";
+import HealthReport from "../../components/other/healthReport/index.vue"
 
 export default {
-  components: { SvgIcon, Panel, VertivalBarLineChart },
+  components: { SvgIcon, Panel, VertivalBarLineChart, HealthReport},
   data() {
     return {
       infoList: [
@@ -85,10 +82,12 @@ export default {
         { title: "7日健康趋势", svgid: "svg-h-day", active: true, type: "day" },
         { title: "30日健康趋势", svgid: "svg-h-month", active: false, type: "month"},
       ],
-      bardata: { area: [], legend: ["健康情况", "差", "良", "优"], data: [] }, // 损失电量分析echart数值
+      bardata: { area: [], legend: [], data: [] }, // 损失电量分析echart数值
       lineData: [],
       recommenList: [], // 健康报告推荐
       recommenIndex: 1, // 记录当前是那个推荐
+      reportshow: false, //是否显示健康报告
+      reportparams: undefined
     };
   },
   created() {
@@ -128,6 +127,15 @@ export default {
           break;
       }
     },
+    // 查看健康报告
+    onClickReport(item){
+      this.reportshow = true
+      this.reportparams = {wtId: item.wtid, recorddate: new Date(item.recodedate).formatDate("yyyy-MM-dd")}
+    },
+    // 关闭健康报告
+    closed(){
+      this.reportshow = false
+    },
     // 健康推荐提交
     onClickCofirm(item) {
       // this.requestOption("recommen/confirpush", item.rid);
@@ -188,12 +196,12 @@ export default {
         data: { wpId: 0, type: type },
         success(res) {
           if (res.code == 200) {
+            that.bardata.legend = ["优数量", "良数量", "差数量"];
             that.lineData = res.data.lvchart;
             that.bardata.area = res.data.datechart;
-            that.bardata.data[0] = res.data.lvchart;
-            that.bardata.data[1] = res.data.cslchart;
-            that.bardata.data[2] = res.data.lslchart;
-            that.bardata.data[3] = res.data.yslchart;
+            that.bardata.data[2] = res.data.cslchart;
+            that.bardata.data[1] = res.data.lslchart;
+            that.bardata.data[0] = res.data.yslchart;
           }
         },
       });
@@ -351,7 +359,14 @@ export default {
           color: @gray-l;
           line-height: 37px;
           padding-left: 16px;
+          padding-right: 16px;
           font-size: @fontsize-s;
+          display: flex;
+          flex-direction: row;
+          justify-content: space-between;
+          span {
+             cursor: pointer; 
+          }
         }
 
         .info {

+ 10 - 23
src/views/HealthControl/HealthTab2.vue

@@ -17,7 +17,7 @@
         <div class="empty"></div>
       </div>
       <div class="info-chart">
-        <panel class="info-chart-panel" :title="'损失电量分析'">
+        <panel class="info-chart-panel" :title="'健康趋势'">
           <vertival-bar-line-chart
             :height="'310px'"
             :bardata="bardata"
@@ -27,23 +27,15 @@
       </div>
     </div>
     <div class="health-report">
-      <panel class="health-report-panel" :title="'健康报告'" :showLine="false">
+      <panel class="health-report-panel" :title="'已推荐风机'" :showLine="false">
         <div class="report-items scroll">
           <div class="item" v-for="(item, index) in recommenList" :key="index">
             <div class="title">风机编号:{{ item.wtid }}</div>
             <div class="info">
               <p>推荐理由:{{ item.reason }}</p>
-              <p>
-                推荐检修时间:{{
-                  new Date(item.recodedate).formatDate("yyyy-MM-dd hh:mm:ss")
-                }}
-              </p>
+              <p>推荐检修时间:{{ new Date(item.recodedate).formatDate("yyyy-MM-dd hh:mm:ss") }}</p>
               <p>推荐时间对应风速:{{ item.speed }}</p>
-              <p>
-                判断时间:{{
-                  new Date(item.createdate).formatDate("yyyy-MM-dd hh:mm:ss")
-                }}
-              </p>
+              <p>判断时间:{{ new Date(item.createdate).formatDate("yyyy-MM-dd hh:mm:ss")}}</p>
             </div>
           </div>
         </div>
@@ -64,14 +56,9 @@ export default {
       infoList: [
         // {title: '24小时健康趋势', svgid: 'svg-24-houre', active: false, type: 'houre'},
         { title: "7日健康趋势", svgid: "svg-h-day", active: true, type: "day" },
-        {
-          title: "30日健康趋势",
-          svgid: "svg-h-month",
-          active: false,
-          type: "month",
-        },
+        { title: "30日健康趋势", svgid: "svg-h-month", active: false, type: "month"},
       ],
-      bardata: { area: [], legend: ["健康情况", "差", "良", "优"], data: [] }, // 损失电量分析echart数值
+      bardata: { area: [], legend: [], data: [] }, // 损失电量分析echart数值
       lineData: [],
       recommenList: [], // 健康报告推荐
     };
@@ -107,12 +94,12 @@ export default {
         data: { wpId: 0, type: type },
         success(res) {
           if (res.code == 200) {
+            that.bardata.legend = ["优数量", "良数量", "差数量"];
             that.lineData = res.data.lvchart;
             that.bardata.area = res.data.datechart;
-            that.bardata.data[0] = res.data.lvchart;
-            that.bardata.data[1] = res.data.cslchart;
-            that.bardata.data[2] = res.data.lslchart;
-            that.bardata.data[3] = res.data.yslchart;
+            that.bardata.data[2] = res.data.cslchart;
+            that.bardata.data[1] = res.data.lslchart;
+            that.bardata.data[0] = res.data.yslchart;
           }
         },
       });

+ 13 - 13
src/views/HealthControl/HealthTab3.vue

@@ -83,14 +83,14 @@
         </thead>
         <tbody>
           <tr v-for="(row, index) of tableData.data" :key="index">
-            <td class="white">{{ row.wfname }}</td>
-            <td class="white">{{ row.wtid }}</td>
-            <td class="white">{{new Date(row.operationdate).formatDate("yyyy-MM-dd hh:mm:ss")}}</td>
-            <td class="white">{{row.departuretime ? new Date().formatDate("yyyy-MM-dd hh:mm:ss") : ""}}</td>
-            <td class="white">{{ row.reason }}</td>
-            <td class="white">{{ row.ismain }}</td>
-            <td class="white">{{ row.status }}</td>
-            <td class="white">
+            <td>{{ row.wfname }}</td>
+            <td>{{ row.wtid }}</td>
+            <td>{{row.operationdate ? new Date(row.operationdate).formatDate("yyyy-MM-dd hh:mm:ss") : ""}}</td>
+            <td>{{row.departuretime ? new Date(row.departuretime).formatDate("yyyy-MM-dd hh:mm:ss") : ""}}</td>
+            <td>{{ row.reason }}</td>
+            <td>{{ row.ismain }}</td>
+            <td>{{ row.status }}</td>
+            <td>
               <button class="btn success" @click="onClickTrack(row)">消缺跟踪</button>
             </td>
           </tr>
@@ -98,19 +98,19 @@
       </table>
     </div>
     <div>
-      <el-dialog title="日信息对比" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal" :close-on-click-modal="false">
-        <dayinfo />
+      <el-dialog title="消缺跟踪" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal" :close-on-click-modal="false">
+        <info-track />
       </el-dialog>   
     </div> 
   </div>
 </template>
 
 <script>
-import Dayinfo from "./dayinfo.vue";
+import InfoTrack from "./infotrack.vue";
 import SvgIcon from "../../components/coms/icon/svg-icon.vue";
 
 export default {
-  components: { Dayinfo, SvgIcon },
+  components: { InfoTrack, SvgIcon },
   data() {
     return {
       stations: [], // 场站
@@ -127,7 +127,7 @@ export default {
     };
   },
   created() {
-    this.starts = new Date(new Date().setMonth(new Date().getMonth()-1)).formatDate("yyyy-MM-dd");
+    this.starts = new Date(new Date().setMonth(new Date().getMonth()-40)).formatDate("yyyy-MM-dd");
     this.requestStations();
   },
   methods: {

+ 275 - 0
src/views/HealthControl/infohistory.vue

@@ -0,0 +1,275 @@
+<template>
+  <div class="health-tab-3">
+    <div class="query mg-b-8">
+      <div class="query-items">
+        <div class="query-item">
+          <div class="lable">场站:</div>
+          <div class="search-input">
+            <el-select
+              v-model="station"
+              clearable
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in stations"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="query-item">
+          <div class="lable">机组</div>
+          <div class="search-input">
+            <el-select
+              v-model="windturbine"
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in windturbines"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+
+        <div class="query-item">
+          <div class="lable">开始日期:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="starts"
+              type="date"
+              placeholder="选择日期"
+              popper-class="date-select"
+            >
+            </el-date-picker>
+          </div>
+        </div>
+        <div class="query-item">
+          <div class="lable">结束日期:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="endts"
+              type="date"
+              placeholder="选择日期"
+              popper-class="date-select"
+            >
+            </el-date-picker>
+            <div class="unit svg-icon svg-icon-gray">
+              <svg-icon :svgid="''" />
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="query-actions" style="margin-right: 500px">
+        <button class="btn green" @click="onClickSearch">搜索</button>
+      </div>
+    </div>
+    <div class="table-box">
+      <table class="com-table">
+        <thead>
+          <tr>
+            <th v-for="(col, index) of tableData.column" :key="index">
+              {{ col }}
+            </th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr v-for="(row, index) of tableData.data" :key="index">
+            <td>{{ row.wfname }}</td>
+            <td>{{ row.wtid }}</td>
+            <td>{{row.operationdate ? new Date(row.operationdate).formatDate("yyyy-MM-dd hh:mm:ss") : ""}}</td>
+            <td>{{row.departuretime ? new Date(row.departuretime).formatDate("yyyy-MM-dd hh:mm:ss") : ""}}</td>
+            <td>{{ row.reason }}</td>
+            <td>{{ row.ismain }}</td>
+            <td>{{ row.status }}</td>
+            <td>
+              <button class="btn success" @click="onClickTrack(row)">消缺跟踪</button>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div>
+      <el-dialog title="消缺跟踪" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal" :close-on-click-modal="false">
+        <info-track />
+      </el-dialog>   
+    </div> 
+  </div>
+</template>
+
+<script>
+import InfoTrack from "./infotrack.vue";
+import SvgIcon from "../../components/coms/icon/svg-icon.vue";
+
+export default {
+  components: { InfoTrack, SvgIcon },
+  data() {
+    return {
+      stations: [], // 场站
+      windturbines: [], // 风机
+      station: "",
+      windturbine: "",
+      starts: "",
+      endts: new Date(),
+      tableData: {
+        column: ["场站", "风机编号", "任务开始时间", "任务接受时间", "检修原因", "受否下单", "任务状态", "操作"],
+        data: [],
+      },
+      dialogVisible: false
+    };
+  },
+  created() {
+    this.starts = new Date(new Date().setMonth(new Date().getMonth()-40)).formatDate("yyyy-MM-dd");
+    this.requestStations();
+  },
+  methods: {
+    // 搜索按钮
+    onClickSearch() {
+      this.requestUnfinishedList();
+    },
+    // 消缺跟踪
+    onClickTrack(row){
+      this.dialogVisible = true
+    },
+    // 获取场站
+    requestStations() {
+      let that = this;
+      that.API.requestData({
+        method: "GET",
+        subUrl: "powercompare/windfarmAjax",
+        success(res) {
+          if (res.code == 200) {
+            that.stations = res.data;
+            that.station = that.stations[3].id;
+          }
+        },
+      });
+    },
+    // 获取风机
+    requestWindturbines(wpid) {
+      let that = this;
+      that.API.requestData({
+        method: "GET",
+        subUrl: "powercompare/windturbineAjax",
+        data: { wpId: wpid },
+        success(res) {
+          if (res.code == 200) that.windturbines = res.data;
+        },
+      });
+    },
+    // 获取未完成消缺单列表
+    requestUnfinishedList() {
+      let that = this;
+      that.API.requestData({
+        method: "POST",
+        subUrl: "recommen/unfinishedList",
+        data: {
+          wpId: that.station,
+          wtId: that.windturbine,
+          beginDate: new Date(that.starts).formatDate("yyyy-MM-dd"),
+          endDate: new Date(that.endts).formatDate("yyyy-MM-dd"),
+        },
+        success(res) {
+          if (res.code == 200) {
+            that.tableData.data = res.data;
+          }
+        },
+      });
+    },
+  },
+  watch: {
+    station(val) {
+      this.windturbine = "";
+      this.requestWindturbines(val);
+    },
+  },
+};
+</script>
+
+<style lang="less" scope>
+@titleGray: #9ca5a8;
+@rowGray: #606769;
+@darkBack: #536268;
+.health-tab-3 {
+  .table-box {
+    border: 0.093vh solid @darkgray;
+    position: relative;
+    overflow: auto;
+    flex-grow: 1;
+    top: 1vh;
+  }
+  .com-table {
+    width: 100%;
+    border-collapse: collapse;
+    display: flex;
+    flex-direction: column;
+    max-height: calc(100vh - 175px);
+  
+    thead {
+      tr {
+        position: relative;
+        display: table;
+        table-layout: fixed;
+        width: 100%;
+
+        th {
+          background-color: fade(@darkBack, 20%);
+          padding: 1.481vh 0;
+          color: @titleGray;
+          font-weight: 400;
+          font-size: @fontsize-s;
+          position: sticky;
+          // top: 0;
+
+          &.light {
+            color: @green;
+          }
+        }
+      }
+    }
+
+    tbody {
+      display: block;
+      max-height: 100%; 
+      overflow-y: scroll;
+
+      tr {
+        display: table;
+        table-layout: fixed;
+        width: 100%;
+
+        &:nth-child(2n) {
+          background-color: fade(@rowGray, 20%);
+        }
+
+        td {
+          padding: 0.556vh 0;
+          color: @rowGray;
+          text-align: center;
+          font-size: @fontsize-s;
+          overflow: hidden; //隐藏文字
+          text-overflow: ellipsis; //显示 ...
+          white-space: nowrap; //不换行
+
+          &.light {
+            color: @green !important;
+          }
+
+          &.num {
+            font-family: "Bicubik";
+            font-weight: 400;
+          }
+        }
+      }
+    }
+  }
+}
+</style>

+ 31 - 0
src/views/HealthControl/infotrack.vue

@@ -0,0 +1,31 @@
+<template>
+  <div class="info-track">
+
+  </div>
+</template>
+
+
+<script>
+export default {
+  name: "info-track",
+  props:{id: String}
+
+};
+</script>
+
+
+<style lang="less" scoped>
+.info-track{
+     display: flex;
+     flex-direction: column;
+     
+     .track-map{
+          flex-direction: row;
+          justify-content: flex-end;
+     }
+
+     .track-line{
+
+     }
+}
+</style>