likang hace 2 años
padre
commit
2b908763d1

+ 62 - 25
src/views/dashboard/rladmin/components/MaintenanceAlarmChart.vue

@@ -1,4 +1,5 @@
 <template>
+<!-- <el-input v-model="input" placeholder="请输入内容"></el-input> -->
     <base-line
         :options="lineOptions"
         :width="width"
@@ -9,13 +10,16 @@
 import BaseLine from '@/components/Charts/BaseLineChart'
 
 export default {
-    name: 'TotalAlarmGrowth',
+    name: 'MaintenanceAlarmChart',
     props: {
         width: {
             type: String,
             default: '50%'
-        }
-    },
+        },
+        options:{type:Object}
+        
+        
+        },
     components: {
         BaseLine,
     },
@@ -45,33 +49,66 @@ export default {
     },
     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.lineDataX=['2020-05-06','2020-05-06 09:49:01','2020-05-06 09:49:02','2020-05-06 09:49:03','2020-05-07','2020-05-08','2020-05-09','2020-05-10','2020-05-11','2020-05-12']
+            this.seriesData=[
+                {
+                     name: 'SWT-4.0-146',
+                    type: 'line',
+                    smooth: false,
+                    data:[20,18,20,20,20,20,20]
+                },
+                 {
+                     name: 'SWT-2.38-101',
+                    type: 'line',
+                    smooth: false,
+                    data:[12,12,12,12,11,12,12]
+                },
+                {
+                     name: 'SWT-6.0-154',
+                    type: 'line',
+                    smooth: false,
+                    data:[10,10,10,10,10,10,11]
+                },
+                {
+                     name: 'SG-8.0-167',
+                    type: 'line',
+                    smooth: false,
+                    data:[8,9,5,8,7,8,9,9,9]
+                },
+
+
+            ];
+            this.lineOptions = this.getOption();
+            // this.$http.get('WorkLocationChart/total')
+            //         .then(resp => {
+                        
+            //             if (resp.code === 10000) {
+            //                 console.log(resp.data);
+            //                 Object.keys(resp.data).forEach(index => {
+            //                     let data = [];
+            //                     console.log(index.name)
+            //                     this.lineDataX = resp.data[index].map(item => {
+            //                         data.push(item.value)
+            //                         return item.date;
+            //                     })
+            //                     this.seriesData.push({
+            //                         name: index.name,
+            //                         type: 'line',
+            //                         data: data,
+            //                         smooth: false,
+            //                     })
+            //                 })
 
-                            this.lineOptions = this.getOption()
-                        }
-                    }).catch(()=>{
-                        console.error('TotalAlarmGrowth get data error!');
-                    })
+            //                 this.lineOptions = this.getOption()
+            //             }
+            //         }).catch(()=>{
+            //             console.error('TotalAlarmGrowth get data error!');
+            //         })
         },
         getOption() {
             return {
                 title: {
-                    text: '告警总量趋势',
+                    text: this.options.name,
                     textStyle: {
                         fontWeight: '600',
                         fontSize: '15',

+ 24 - 9
src/views/dashboard/rladmin/index.vue

@@ -91,8 +91,15 @@
       </el-row>
        <!-- 维保记录 -->
       <el-row :gutter="16">
-      
-         <!--扭矩分析-->
+       <normal-card 
+        trigger="hover"
+        shadow="always"
+        title="维保记录"
+        showMenu
+        :bodyStyle="{height: '500px'}"
+    >
+    <template v-slot:content>
+         <!--压力分析-->
         <el-col class="gutter-row item" :span="12">
           <!-- <device-alarm-chart :statsData="statsData" /> -->
           <normal-card
@@ -102,10 +109,10 @@
             shadow="always"
             trigger="hover"
             :menuItems="alarmGrowthMenuItems"
-            :bodyStyle="{height: '310px'}"
+            :bodyStyle="{height: '400px'}"
           >
               <template v-slot:content>
-                  <maintenance-alarm-chart width="100%" />
+                  <maintenance-alarm-chart width="100%" :options="pressure" />
               </template>
           </normal-card>
         </el-col>
@@ -119,13 +126,15 @@
             shadow="always"
             trigger="hover"
             :menuItems="alarmGrowthMenuItems"
-            :bodyStyle="{height: '310px'}"
+            :bodyStyle="{height: '400px'}"
           >
               <template v-slot:content>
-                  <maintenance-alarm-chart width="100%" />
+                  <maintenance-alarm-chart width="100%"  :options="torque" />
               </template>
           </normal-card>
         </el-col>
+        </template>
+         </normal-card>
       </el-row>
 
     </div>
@@ -177,10 +186,16 @@ export default {
       // showAddLoading: true,
       startVal: 0,
       //维保记录规律统计
-      Maintenance:{
-
-      },
+       torque:{
+         name:"扭矩",
+         url:'',
+       },
+       pressure:{
+         name:'压力',
+         url:''
+       },
 
+//
       countData: {
        department_count:24,
        device_online_count:31,