Browse Source

合并tjj分支

mw_666 3 years ago
parent
commit
c22e6a523b

+ 10 - 1
src/App.vue

@@ -249,7 +249,16 @@ l16.229-16.229l16.229,16.229l42.867-42.867C115.034,45.228,109.133,42.189,102.956
     </div>
   </div>
   <login-page v-if="!showSisView && !isLogined" @onLogin="login" />
-  <sisView v-if="showSisView" />
+  <div v-else-if="!isLogined" class="login">
+    <login-page />
+  </div>
+  <!-- <login-page v-if="!showSisView && !isLogined" @onLogin="login" /> -->
+   <!-- <div v-else-if="token == ''">
+    {{token}}
+ <login-page  @onLogin="login" />
+   </div> -->
+ 
+  <sisView v-else-if="showSisView" />
 </template>
 
 <script>

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

@@ -295,7 +295,8 @@ export default {
             });
         },
         xdata() {
-            return this.list[0].value.map((t) => {
+            console.log('this.list[0].value:',this.list)
+            return this.list[0]?.value.map((t) => {
                 return t.text;
             });
         },
@@ -303,6 +304,7 @@ export default {
             let result = [];
             let p = {left: 0, right: 0};
             this.yAxises.forEach((item, index) => {
+                console.log('yitem:',item)
                 result.push({
                     type: "value",
                     name: `${item.name}${item.unit}`,
@@ -332,13 +334,16 @@ export default {
                 });
                 p[item.position]++;
             });
-
+console.log('yResult:',result)
             return result;
+            
         },
         series() {
             let result = [];
-
+           console.log('list:',this.list)
             this.list.forEach((value, index) => {
+                console.log('seriesValue:',value)
+                console.log('seriesIndex:',index)
                 result.push({
                     name: value.title,
                     type: "line",
@@ -368,7 +373,9 @@ export default {
 
             let option = this.option();
             chart.clear();
+          
             chart.setOption(option);
+              console.log('111111111111111111111',option);
 
             this.resize = function() {
                 chart.resize();
@@ -429,6 +436,7 @@ export default {
             const chart = echarts.getInstanceByDom(this.$el);
             chart.clear();
             let option = this.option();
+            console.log('111111111111111111111',option);
             chart.setOption(option);
         },
     },

+ 155 - 24
src/views/MalfunctionWarning/MalfunctionWarning.vue

@@ -4,17 +4,17 @@
     <div class="query mg-b-8">
       <div class="query-items">
         <div class="query-item">
-          <div class="lable">场站:</div>
+          <div class="lable">算法类型:</div>
           <div class="search-input">
             <el-select
               v-model="value1"
-              @change="ChangZhanChange(value1)"
+              @change="algorithmChange(value1)"
               clearable
               placeholder="请选择"
               popper-class="select"
             >
               <el-option
-                v-for="item in ChangZhan"
+                v-for="item in algorithm"
                 :key="item.id"
                 :value="item.id"
                 :label="item.name"
@@ -34,39 +34,42 @@
       <button
         class="btn"
         :class="TypeClass == 1 ? 'green' : ''"
-        @click="TypeClick(1)"
+        @click="TypeClick(1,'sjdr')"
       >
-        风场
+        数据导入
       </button>
       <button
         class="btn"
         :class="TypeClass == 2 ? 'green' : ''"
-        @click="TypeClick(2)"
+        @click="TypeClick(2,'sjfl')"
       >
-        项目
+       数据分类
       </button>
       <button
         class="btn"
         :class="TypeClass == 3 ? 'green' : ''"
-        @click="TypeClick(3)"
+        @click="TypeClick(3,'mxxl')"
       >
-        集电线路
+        模型训练
+      </button>
+        <button
+        class="btn"
+        :class="TypeClass == 4 ? 'green' : ''"
+        @click="TypeClick(4,'mxdc')"
+      >
+        模型导出
+      </button>
+        <button
+        class="btn"
+        :class="TypeClass == 5 ? 'green' : ''"
+        @click="TypeClick(5,'mxcc')"
+      >
+        模型存储
       </button>
     </div>
     <el-row :type="'flex'" class="content">
-      <el-col :span="12" class="pd-r-8">
-        <toolbar-panel title="风机绩效榜" :showLine="false">
-          <!-- <bar-line-chart
-            :height="'calc(100vh - 180px)'"
-            :bardata="bardata"
-            :lineData="lineData"
-            :color="barColor"
-            lineName="理论发电量"
-          /> -->
-        </toolbar-panel>
-      </el-col>
       <el-col :span="12" class="pd-l-8">
-        <panel :title="'项目列表'" :showLine="false">
+        <panel :title="'训练记录'" :showLine="false">
           <!-- <div class="project-table">
             <Table :data="tableData" :height="'calc(80vh - 50px)'">
               <template v-slot:tr v-if="tableData.data.length > 0">
@@ -110,6 +113,85 @@
           </div> -->
         </panel>
       </el-col>
+      <el-col :span="12" class="pd-l-8">
+        <panel :title="'故障预警'" :showLine="false">
+           <el-scrollbar>
+      <div class="panel-box">
+        <div v-for="(mItem,mIndex) in exportModels" :key="mIndex">
+          <!-- <div class="panel-title">
+            <div class="panel-title-name">
+              <i class="svg-icon svg-icon-sm svg-icon-green">
+                <SvgIcon :svgid="'svg-wind-site'"></SvgIcon>
+              </i>
+              <span>{{ sourceMap.fczbmap[pItem[pIndex].wpId].name }}</span>
+              <div
+                class="sub-title-item"
+                v-for="(data, index) of tables[0].subTitleDatas"
+                :key="index"
+              >
+                <span class="sub-title">{{ data.text }}</span>
+                <span class="sub-count" :class="data.color">{{
+                  sourceMap.fczbmap[pItem[pIndex].wpId][data.key]
+                }}</span>
+              </div>
+            </div>
+          </div> -->
+          <div class="panel-body">
+            <div
+              class="card"
+            >
+              <div class="card-panel">
+                <div class="card-left">
+                  <div class="tag"></div>
+                  <div class="icon">
+                    <span
+                      class="svg-icon svg-icon-sm"
+      
+                    >
+                      
+                    </span>
+                  </div>
+                </div>
+                <div class="card-right">
+                  <div class="num">
+                    <i
+                      class="svg-icon svg-icon-sm"
+                      
+                    >
+                    
+                    </i>
+                    <span></span>
+                  </div>
+
+                  <div class="num">
+                    <i
+                      class="svg-icon svg-icon-sm"
+                     
+                    >
+                     
+                    </i>
+                    <span></span>
+                  </div>
+
+                  <div class="num">
+                    <i
+                      class="svg-icon svg-icon-sm"
+                     
+                    >
+                    
+                    </i>
+                    <span></span>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+          </div>
+
+      </div>
+    </el-scrollbar>
+        </panel>
+      </el-col>
     </el-row>
   </div>
 </template>
@@ -122,10 +204,59 @@ export default{
     partten,
   },
   data(){
-      return{}
+      return{
+        algorithm:[], //算法
+        value1:[],
+         TypeClass: 1, //数据导入,数据分类,模型训练,模型导出,模型存储 的按钮颜色,默认第一个
+      exportModels:[]
+      }
+  },
+  created(){
+    this.algorithmVal()
+    this.exportModels = [
+     {
+       modelName:'2019dbscan.pkl',
+       modelId:'dbscan'
+     },  {
+       modelName:'2020mdjl.pkl',
+       modelId:'mdjl'
+     }
+     ]
+    
+  },
+  methods:{
+    algorithmVal(){
+      let that = this;
+      let algorithmArr = [{
+        id:"dbscan",
+        name:"DBscan"
+      },{
+        id:"mdjl",
+        name:"密度聚类"
+      }];
+      that.algorithm = algorithmArr;
+    },
+    algorithmChange(val){
+       this.TypeClass = "";
+       this.value1 = val;
+    },
+    TypeClick(val,btnType){
+      // console.log(val,btnType)
+      this.TypeClass = val;
+      if(btnType == 'sjdr'){
+
+      }else if(btnType == 'sjfl'){
+
+      }else if(btnType == 'mxxl'){
+
+      }else if(btnType == 'mxdc'){
+           
+      }else if(btnType == 'mxcc'){
+
+      }
+    }
   },
-  created(){},
-  methods:{},
+
 }
 </script>
 <style lang="less">

+ 204 - 254
src/views/NewPages/alarm-center-1.vue

@@ -72,7 +72,7 @@
           <div class="bar">
             <div
               class="bar-percent"
-              @click="showChart()"
+              @click="showChart(scope)"
               :style="{
                 width:
                   (scope.data.count &&
@@ -88,7 +88,7 @@
           <div class="bar">
             <div
               class="bar-percent"
-              @click="showChart()"
+              @click="showChart(scope)"
               :style="{
                 width:
                   (scope.data.count &&
@@ -105,7 +105,7 @@
       </table-3>
     </panel-3>
     <el-dialog
-      :title="'对比'"
+      :title="dialogTitle"
       v-model="dialogVisible"
       width="70%"
       top="10vh"
@@ -114,8 +114,8 @@
     >
       <multiple-y-line-chart-normal
         height="500px"
-        :list="Powertrend"
-        :yAxises="PowertrendYAxises"
+        :list="Analysis"
+        :yAxises="AnalysisYAxises"
         :showLegend="true"
       />
     </el-dialog>
@@ -130,28 +130,32 @@ export default {
   components: { Panel3, Table3, MultipleYLineChartNormal },
   data() {
     return {
+      dialogTitle:"",
       dialogVisible: false,
       wpvalue: "",
-      Powertrend: [
+      wpid: "",
+      AnalysisName: "",
+      AnalysisUnit: "",
+      Analysis: [
         {
           title: "",
           yAxisIndex: 0, // 使用单位
           value: [],
         },
       ],
-      PowertrendYAxises: [
+      AnalysisYAxises: [
         {
-          name: "功率",
-          min: 0,
-          max: null,
-          unit: "(万kWh)",
+          name: "",
+          min: "",
+          max: "",
+          unit: "",
           position: "left",
         },
         {
-          name: "风速",
-          min: 0,
-          max: 25,
-          unit: "(m/s)",
+          name: "",
+          min: "",
+          max: "",
+          unit: "",
           position: "right",
         },
       ],
@@ -257,248 +261,189 @@ export default {
   },
   methods: {
     //对比
-    showChart() {
+    showChart(column) {
       let that = this;
+      that.dialogTitle =  column.column.name
+      // console.log('column:',column)
+      // console.log('name:',column.column.name)
+      // console.log('wtid:',column.row.name)
+      // console.log('starttime:',new Date(that.startdate).getTime())
+      // console.log('endtime:',new Date(that.enddate).getTime())
       that.dialogVisible = true;
-      let Powertrend = [
-        {
-          title: "实发功率",
-          smooth: true,
-          value: [],
-        },
-        {
-          title: "理论功率",
-          smooth: true,
-          value: [],
-        },
-        {
-          title: "保证功率",
-          smooth: true,
-          value: [],
-        },
-        {
-          title: "4小时预测功率",
-          smooth: true,
-          value: [],
-        },
-        {
-          title: "24小时预测功率",
-          smooth: true,
-          value: [],
+      that.API.requestData({
+        method: "GET",
+        subUrl: "/analysis/detail",
+        data: {
+          station: that.wpvalue,
+          startTs: new Date(that.startdate).getTime(),
+          endTs: new Date(that.enddate).getTime(),
+          interval: 360,
+          wtId: column.row.name,
+          name: column.column.name,
         },
-        {
-          title: "平均风速",
-          smooth: true,
-          value: [],
+        success(res) {
+          console.log("resAnalysis:", res);
+          let anKey = ["doubleValue"];
+          if (res.data.length == 1) {
+            let yaxises = [
+              {
+                name: "",
+                min: 0,
+                max: null,
+                unit: "",
+                position: "left",
+              },
+            ];
+            // yaxises.name = res.data[0].name;
+            yaxises.unit = res.data[0].unit;
+            that.AnalysisYAxises = yaxises;
+            console.log("AnalysisYAxises:", that.AnalysisYAxises);
+            let aKey1 = ["doubleValue"];
+            let aList1 = [
+              {
+                title: "",
+                smooth: true,
+                value: [],
+              },
+            ];
+            aKey1.forEach((keyEle, keyIndex) => {
+              res.data.forEach((rEle) => {
+                rEle.data.forEach((tEle) => {
+                  aList1[keyIndex].title = res.data[0].name
+                  aList1[keyIndex].value.push({
+                    text: new Date(tEle.ts).formatDate("hh:mm"),
+                    value: tEle[keyEle],
+                  });
+                });
+              });
+            });
+            that.Analysis = aList1;
+            console.log("that.Analysis1:", that.Analysis);
+          } else if (res.data.length == 2) {
+            let aKey2 = ["doubleValue", "doubleValue"];
+            let aList2 = [
+              {
+                title: "",
+                smooth: true,
+                value: [],
+              },
+              {
+                title: "",
+                smooth: true,
+                value: [],
+              },
+            ];
+            let yaxises1 = [
+              {
+                name: "",
+                min: 0,
+                max: null,
+                unit: "",
+                position: "left",
+              },
+              {
+                name: "",
+                min: 0,
+                max: null,
+                unit: "",
+                position: "right",
+              },
+            ];
+            yaxises1.forEach((aEle, aIndex) => {
+              res.data.forEach((rEle) => {
+                //  console.log('rEleName:',rEle.name)
+                //   console.log('rEle.unit:',rEle.unit)
+                // aEle.name = rEle.name;
+                aEle.unit = rEle.unit;
+              });
+            });
+            that.AnalysisYAxises = yaxises1;
+            console.log("AnalysisYAxises:", that.AnalysisYAxises);
+            aKey2.forEach((keyEle, keyIndex) => {
+              res.data.forEach((rEle) => {
+                aList2[keyIndex].title=res.data[keyIndex].name
+                rEle.data.forEach((tEle) => {
+                  aList2[keyIndex].value.push({
+                    text: new Date(tEle.ts).formatDate("hh:mm"),
+                    value: tEle[keyEle],
+                  });
+                });
+              });
+            });
+
+            that.Analysis = aList2;
+            console.log("that.Analysis2:", that.Analysis);
+          } else if (res.data.length == 4) {
+            let aKey4 = [
+              "doubleValue",
+              "doubleValue",
+              "doubleValue",
+              "doubleValue",
+            ];
+            let aList4 = [
+              {
+                title: "",
+                smooth: true,
+                value: [],
+              },
+              {
+                title: "",
+                smooth: true,
+                value: [],
+              },
+              {
+                title: "",
+                smooth: true,
+                value: [],
+              },
+              {
+                title: "",
+                smooth: true,
+                value: [],
+              },
+            ];
+            let yaxises2 = [
+              {
+                name: "",
+                min: 0,
+                max: null,
+                unit: "",
+                position: "left",
+              },
+              {
+                name: "",
+                min: 0,
+                max: null,
+                unit: "",
+                position: "right",
+              },
+            ];
+            yaxises2.forEach((aEle, aIndex) => {
+              res.data.forEach((rEle) => {
+                //  console.log('rEleName:',rEle.name)
+                //   console.log('rEle.unit:',rEle.unit)
+                // aEle.name = rEle.name;
+                aEle.unit = rEle.unit;
+              });
+            });
+            that.AnalysisYAxises = yaxises2;
+            console.log("AnalysisYAxises:", that.AnalysisYAxises);
+            aKey4.forEach((keyEle, keyIndex) => {
+              res.data.forEach((rEle) => {
+                aList4[keyIndex].title = res.data[keyIndex].name
+                rEle.data.forEach((tEle) => {
+                  aList4[keyIndex].value.push({
+                    text: new Date(tEle.ts).formatDate("hh:mm"),
+                    value: tEle[keyEle],
+                  });
+                });
+              });
+            });
+            that.Analysis = aList4;
+            console.log("that.Analysis4:", that.Analysis);
+          }
         },
-      ];
-      let glKey = ["value2", "value1", "value5", "value4", "value7", "value6"];
-      let resData = {
-        glvos: [
-          {
-            time: 1631721600000,
-            timestr: null,
-            value1: 17,
-            value2: 9.18,
-            value3: 11,
-            value4: 7.27,
-            value5: 16,
-            value6: 1.95,
-            value7: 0,
-            value8: null,
-            value9: 31,
-            value10: null,
-            value11: null,
-            value12: null,
-            value13: null,
-            speed: null,
-            name: null,
-            url: null,
-            aName: null,
-            desc: null,
-            datefomat: null,
-            minRange: null,
-            pointInterval: null,
-            year: null,
-            month: null,
-            day: null,
-            id: null,
-            hours: null,
-            minutes: null,
-            seconds: null,
-            beginDate: null,
-            endDate: null,
-            beginDateDay: null,
-            endDateDay: null,
-            value: null,
-            valueObjVo: null,
-          },
-          {
-            time: 1631725200000,
-            timestr: null,
-            value1: 14,
-            value2: 5.17,
-            value3: 8,
-            value4: 0.1,
-            value5: 12,
-            value6: 2.49,
-            value7: 11.94,
-            value8: null,
-            value9: 29,
-            value10: null,
-            value11: null,
-            value12: null,
-            value13: null,
-            speed: null,
-            name: null,
-            url: null,
-            aName: null,
-            desc: null,
-            datefomat: null,
-            minRange: null,
-            pointInterval: null,
-            year: null,
-            month: null,
-            day: null,
-            id: null,
-            hours: null,
-            minutes: null,
-            seconds: null,
-            beginDate: null,
-            endDate: null,
-            beginDateDay: null,
-            endDateDay: null,
-            value: null,
-            valueObjVo: null,
-          },
-          {
-            time: 1631728800000,
-            timestr: null,
-            value1: 13,
-            value2: 5.07,
-            value3: 8,
-            value4: 0.07,
-            value5: 11,
-            value6: 2.32,
-            value7: 0,
-            value8: null,
-            value9: 26,
-            value10: null,
-            value11: null,
-            value12: null,
-            value13: null,
-            speed: null,
-            name: null,
-            url: null,
-            aName: null,
-            desc: null,
-            datefomat: null,
-            minRange: null,
-            pointInterval: null,
-            year: null,
-            month: null,
-            day: null,
-            id: null,
-            hours: null,
-            minutes: null,
-            seconds: null,
-            beginDate: null,
-            endDate: null,
-            beginDateDay: null,
-            endDateDay: null,
-            value: null,
-            valueObjVo: null,
-          },
-          {
-            time: 1631732400000,
-            timestr: null,
-            value1: 11,
-            value2: 3.3,
-            value3: 6,
-            value4: 0,
-            value5: 9,
-            value6: 2.28,
-            value7: 0,
-            value8: null,
-            value9: 21,
-            value10: null,
-            value11: null,
-            value12: null,
-            value13: null,
-            speed: null,
-            name: null,
-            url: null,
-            aName: null,
-            desc: null,
-            datefomat: null,
-            minRange: null,
-            pointInterval: null,
-            year: null,
-            month: null,
-            day: null,
-            id: null,
-            hours: null,
-            minutes: null,
-            seconds: null,
-            beginDate: null,
-            endDate: null,
-            beginDateDay: null,
-            endDateDay: null,
-            value: null,
-            valueObjVo: null,
-          },
-          {
-            time: 1631736000000,
-            timestr: null,
-            value1: 3.91,
-            value2: 1.67,
-            value3: 1.91,
-            value4: 0.3,
-            value5: 2.91,
-            value6: 1.88,
-            value7: 0,
-            value8: null,
-            value9: 9,
-            value10: null,
-            value11: null,
-            value12: null,
-            value13: null,
-            speed: null,
-            name: null,
-            url: null,
-            aName: null,
-            desc: null,
-            datefomat: null,
-            minRange: null,
-            pointInterval: null,
-            year: null,
-            month: null,
-            day: null,
-            id: null,
-            hours: null,
-            minutes: null,
-            seconds: null,
-            beginDate: null,
-            endDate: null,
-            beginDateDay: null,
-            endDateDay: null,
-            value: null,
-            valueObjVo: null,
-          },
-         
-        ],
-     
-      };
-      glKey.forEach((keyEle, keyIndex) => {
-        resData.glvos.forEach((cEle) => {
-          Powertrend[keyIndex].value.push({
-            text: new Date(cEle.time).formatDate("hh:mm"),
-            value: cEle[keyEle],
-          });
-        });
       });
-
-      that.Powertrend = Powertrend;
     },
     tabSelect(tab) {},
 
@@ -550,7 +495,7 @@ export default {
       });
       ////////
       const resData = data.data;
-      console.log("resData:", resData);
+      // console.log("resData:", resData);
       // const resData =this.resdata;
       const column = this.columnObj;
       let dataAll = []; // 总数据集合
@@ -559,6 +504,8 @@ export default {
           name: Object.keys(e)[0],
         };
         let wpid = Object.keys(e)[0];
+        this.wpid = wpid;
+
         e[wpid].forEach((k) => {
           column.forEach((c) => {
             if (k.alertText == c.name) {
@@ -572,8 +519,11 @@ export default {
         });
         dataAll.push(obj);
       });
+      //  console.log('wpid:',this.wpid)
       this.tableData.column = column;
+      // console.log('column:',column)
       this.tableData.data = dataAll;
+      // console.log('dataAll:',dataAll)
       ///////////////////// 获取规则list
       const map = {};
       var windNum = [];
@@ -632,7 +582,7 @@ export default {
           root[f].fobj = fobj;
         }
       }
-      console.log("cascaderOptions:", cascaderOptions);
+      // console.log("cascaderOptions:", cascaderOptions);
       this.cascaderOptions = cascaderOptions;
     },
   },

+ 1 - 1
src/views/layout/login-page.vue

@@ -5,7 +5,7 @@
       :src="url"
       :fit="fit"
     ></el-image> -->
-    <img src="../../assets/sislogo.png" />
+    <!-- <img src="../../assets/sislogo.png" /> -->
     <el-form class="mg-b-16">
       <el-form-item class="mg-b-8">
         <el-input v-model="username" placeholder="请输入登录名"></el-input>