tongshanglei преди 2 години
родител
ревизия
7cf6636b09
променени са 3 файла, в които са добавени 183 реда и са изтрити 70 реда
  1. 118 0
      src/views/dashboard/rladmin/components/MaintenanceAlarmChart.vue
  2. 49 38
      src/views/dashboard/rladmin/index.vue
  3. 16 32
      src/views/wind/worklocation/index.vue

+ 118 - 0
src/views/dashboard/rladmin/components/MaintenanceAlarmChart.vue

@@ -0,0 +1,118 @@
+<template>
+    <base-line
+        :options="lineOptions"
+        :width="width"
+    />
+</template>
+
+<script>
+import BaseLine from '@/components/Charts/BaseLineChart'
+
+export default {
+    name: 'TotalAlarmGrowth',
+    props: {
+        width: {
+            type: String,
+            default: '50%'
+        }
+    },
+    components: {
+        BaseLine,
+    },
+    data() {
+        return {
+            // 总增长趋势数据
+            lineData: [],
+            lineDataX: [],
+            lineOptions: {},
+            level1Data: [],
+            level2Data: [],
+            level3Data: [],
+            level4Data: [],
+            handledData: [],
+            menuItems: [
+                {
+                    name: '全屏',
+                    command: 'full',
+                    icon: 'full-screen',
+                }
+            ],
+            seriesData: [],
+        }
+    },
+    created() {
+        this.getData()
+    },
+    methods: {
+        getData() {
+            this.$http.get('WorkLocationChart/total')
+                    .then(resp => {
+                        if (resp.code === 10000) {
+                            Object.keys(resp.data).forEach(index => {
+                                let data = [];
+                                this.lineDataX = resp.data[index].map(item => {
+                                    data.push(item.value)
+                                    return item.date;
+                                })
+                                this.seriesData.push({
+                                    name: index,
+                                    type: 'line',
+                                    data: data,
+                                    smooth: false,
+                                })
+                            })
+
+                            this.lineOptions = this.getOption()
+                        }
+                    }).catch(()=>{
+                        console.error('TotalAlarmGrowth get data error!');
+                    })
+        },
+        getOption() {
+            return {
+                title: {
+                    text: '告警总量趋势',
+                    textStyle: {
+                        fontWeight: '600',
+                        fontSize: '15',
+                        color: '#000'
+                    },
+                },
+                tooltip: {
+                    trigger: 'axis',
+                },
+                /* toolbox: {
+                    show: true,
+                    feature: {
+                        dataZoom: {
+                            yAxisIndex: 'none'
+                        },
+                        magicType: {type: ['line', 'bar']},
+                    }
+                }, */
+                xAxis: {
+                    type: "category",
+                    data: this.lineDataX,
+                    boundaryGap: false,
+                    axisTick: {
+                        show: false,
+                    }
+                },
+                yAxis: {
+                    minInterval: 1,
+                    axisTick: {
+                        show: false,
+                    }
+                },
+                series: this.seriesData
+            }
+        },
+        
+    }
+}
+
+</script>
+
+<style lang="scss">
+ 
+</style>

+ 49 - 38
src/views/dashboard/rladmin/index.vue

@@ -52,37 +52,7 @@
             </div>
         </el-col>
 
-      <!-- <el-col class="gutter-row item item4" :span="8">
-            <div class="gutter-box">
-              <div class="gutter-box-title">基站设备</div>
-              <div class="count-to-box">
-                <span class="text">总数</span>
-
-                <el-popover
-                  placement="bottom"
-                  width="600"
-                  trigger="hover">
-                  <div>
-                    <station-table :tableData="countData.station_type_data" />
-                  </div>
-                  <span slot="reference" class="number">
-                    <i class="el-icon-loading" v-if="showLoading"></i>
-                    <countTo v-else :startVal='startVal' :endVal='countData.station_total_count' :duration='duration'></countTo>
-                  </span>
-                </el-popover>
-                台
-
-              </div>
-              <div class="count-to-box">
-                <span class="text">在线数</span>
-                <span class="number" @click="redirectPage('school')">
-                  <i class="el-icon-loading" v-if="showLoading"></i>
-                  <countTo v-else :startVal='startVal' :endVal='countData.station_online_count' :duration='duration'></countTo>
-                </span>台
-              </div>
-            </div>
-        </el-col>  -->
-
+      
       </el-row>
     </div>
 
@@ -100,13 +70,6 @@
         </el-col>
       </el-row>
 
-      <!-- 基站设备数据 -->
-      <!-- <el-row :gutter="16">
-        <el-col class="gutter-row item" :span="24">
-          <station-data-chart :countData="countData" :total="countData.station_total_count" />
-        </el-col>
-      </el-row> -->
-
       <!-- 告警图表 -->
       <el-row :gutter="16">
         <!-- 告警提醒 -->
@@ -131,8 +94,49 @@
         </normal-card>
         </el-col>
       </el-row>
+       <!-- 维保记录 -->
+      <el-row :gutter="16">
+      
+         <!--扭矩分析-->
+        <el-col class="gutter-row item" :span="12">
+          <!-- <device-alarm-chart :statsData="statsData" /> -->
+          <normal-card
+            showHeader
+            showMenu
+            title="压力分析"
+            shadow="always"
+            trigger="hover"
+            :menuItems="alarmGrowthMenuItems"
+            :bodyStyle="{height: '310px'}"
+          >
+              <template v-slot:content>
+                  <maintenance-alarm-chart width="100%" />
+              </template>
+          </normal-card>
+        </el-col>
+        <!--压力分析-->
+        <el-col class="gutter-row item" :span="12">
+          <!-- <device-alarm-chart :statsData="statsData" /> -->
+          <normal-card
+            showHeader
+            showMenu
+            title="扭矩分析"
+            shadow="always"
+            trigger="hover"
+            :menuItems="alarmGrowthMenuItems"
+            :bodyStyle="{height: '310px'}"
+          >
+              <template v-slot:content>
+                  <maintenance-alarm-chart width="100%" />
+              </template>
+          </normal-card>
+        </el-col>
+      </el-row>
 
     </div>
+    
+
+
 
   </div>
 </template>
@@ -148,6 +152,7 @@ import DeviceAlarmMessage from './components/DeviceAlarmMessage'
 import TotalAlarmGrowth from './components/TotalAlarmGrowth'
 import StationTable from './components/StationTable'
 import DeviceTable from './components/DeviceTable'
+import MaintenanceAlarmChart from './components/MaintenanceAlarmChart'
 
 export default {
   name: 'DashboardAdmin',
@@ -161,6 +166,7 @@ export default {
     DeviceAlarmMessage,
     StationTable,
     DeviceTable,
+    MaintenanceAlarmChart
   },
   deactivated() {
     // 选中本页面时重新加载,以便获取最新数据
@@ -192,6 +198,11 @@ export default {
          }
        ]
       },
+      //维保记录规律统计
+      Maintenance:{
+
+      },
+
       countData: {
        department_count:24,
        device_online_count:31,

+ 16 - 32
src/views/wind/worklocation/index.vue

@@ -17,22 +17,16 @@
           ></el-cascader>
         </div>
         <div class="search-item">
-          <el-select
-            v-model="queryParam.wind_id"
-            placeholder="请输入风场关键词"
-            filterable
-            remote
-            clearable
-            :remote-method="remoteMethod"
-            :loading="loading"
-            class="filter-item form-search-input fl"
-          >
-             <el-option
-                v-for="item in windoptions"
-                :key="item.value"
-                :label="item.text"
-                :value="item.value">
-              </el-option>
+         <el-select
+                  v-model="queryParam.wind_id"
+                  placeholder="风场名称"
+                  class="filter-item form-search-input fl"
+                  clearable
+                >
+             <el-option v-for="item in wind_options" 
+             :key="item.value" 
+             :label="item.text" 
+             :value="item.value"></el-option>
           </el-select>
           
         </div>
@@ -376,6 +370,8 @@ export default {
       bolt_style_options:[],
       //螺栓型号
       bolt_type_options:[],
+      //风场型号
+      wind_options:[],
 
       queryParam: {
         number: "",
@@ -429,6 +425,9 @@ export default {
     };
   },
   created() {
+     this.$http.get("wind/getWindOptions").then((response) => {
+            this.wind_options = response.data;
+      });
     this.$http.get("departments").then((response) => {
       this.departments = response.data;
     });
@@ -464,22 +463,7 @@ export default {
       this.queryParam.page = this.paginate.current;
       this.getList();
     },
-    //风场模糊查询
-    remoteMethod(query)
-    {
-        this.loading=true;
-        if(query!=='')
-        {
-           this.$http.get("wind/getWindOptions?name="+query).then((response) => {
-               this.windoptions = response.data;
-           });
-        }
-        else
-        {
-          this.windoptions=[];
-        }
-        this.loading=false
-    },
+    
     searchDis() {
       this.searchDisplay = !this.searchDisplay;
       var searchBoxHeght = document.getElementById("searchBox");