tongshanglei 2 anos atrás
pai
commit
b026e47421
1 arquivos alterados com 28 adições e 18 exclusões
  1. 28 18
      catch/report/controller/Report.php

+ 28 - 18
catch/report/controller/Report.php

@@ -76,6 +76,7 @@ class Report extends CatchController
             ['type'=>'液压泵','name'=>'测试设备2','number'=>20210618,'online_time'=>'2022-06-03 11:10:11','address'=>'杭州滨江','unused_days'=>22,'remarks'=>''],
             ['type'=>'液压泵','name'=>'测试设备2','number'=>20210618,'online_time'=>'2022-06-03 11:10:11','address'=>'杭州滨江','unused_days'=>22,'remarks'=>''],
             ['type'=>'液压泵','name'=>'测试设备2','number'=>20210618,'online_time'=>'2022-06-03 11:10:11','address'=>'杭州滨江','unused_days'=>22,'remarks'=>''],
+            ['type'=>'液压泵','name'=>'测试设备2','number'=>20210618,'online_time'=>'2022-06-03 11:10:11','address'=>'杭州滨江','unused_days'=>22,'remarks'=>''],
         );
 
         $list40 =array(
@@ -84,12 +85,15 @@ class Report extends CatchController
             ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
             ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
             ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
+            ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
+            ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
+            ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
         );
 
         $pie_data=array(
-            ['name'=>'正常使用','value'=>113],
-            ['name'=>'20+天未使用','value'=>17],
-            ['name'=>'40+天未使用','value'=>18],
+            ['name'=>'正常使用','value'=>5],
+            ['name'=>'20+天未使用','value'=>6],
+            ['name'=>'40+天未使用','value'=>8],
         );
        
 
@@ -138,28 +142,34 @@ class Report extends CatchController
     public function alarmDeviceCount(Request $request)
     {
         $list =array(
-            ['type'=>'液压泵','name'=>'电量告警','value'=>100],
-            ['type'=>'液压泵','name'=>'液压油偏低','value'=>120],
-            ['type'=>'液压泵','name'=>'液压油偏高','value'=>30],
-            ['type'=>'液压泵','name'=>'总数','value'=>250],
-
+            ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>5,'remarks'=>''],
+            ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>3,'remarks'=>''],
+            ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>2,'remarks'=>''],
+            ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>4,'remarks'=>''],
+            ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>1,'remarks'=>''],
           
         );
-        $pump_bar=array(
-            'xData'=>['总数','电量告警','液压油偏低','液压油偏高'],
-            'yData'=>[250,100,120,30],
+
+        $pie_dataA=array(
+            ['name'=>'有效期内','value'=>15],
+            ['name'=>'已失效(小于15天)','value'=>4],
         );
-        $pump_pie=array(
-            ['name'=>'电量告警','value'=>100],
-            ['name'=>'液压油偏低','value'=>120],
-            ['name'=>'液压油偏高','value'=>30],
+        
+        $pie_dataB=array(
+            ['name'=>'有效使用(大于45天)','value'=>13],
+            ['name'=>'警告失效(15~45天)','value'=>2],
+            ['name'=>'失效(0~15天)','value'=>4],
+        );
+        $pie_dataC=array(
+            ['name'=>'已维护','value'=>15],
+            ['name'=>'未维护','value'=>4],
         );
-    
 
         $data=array(
             'list'=>$list,
-            'pump_bar'=>$pump_bar,
-            'pump_pie'=>$pump_pie,
+            'pie_dataA'=>$pie_dataA,
+            'pie_dataB'=>$pie_dataB,
+            'pie_dataC'=>$pie_dataC,
         );
         return CatchResponse::success($data);
     }