title = "设备详情-$model->station_name 编号: $model->device_id";$this->params['breadcrumbs'][] = ['label' => '自救设备', 'url' => ['index']];$this->params['breadcrumbs'][] = $this->title;if( Yii::$app->getSession()->hasFlash('error') ) { echo Alert::widget([ 'options' => [ 'class' => 'alert-error', ], 'body' => Yii::$app->getSession()->getFlash('error'), ]);}if( Yii::$app->getSession()->hasFlash('success') ) { echo Alert::widget([ 'options' => [ 'class' => 'alert-success', //这里是提示框的class ], 'body' => Yii::$app->getSession()->getFlash('success'), //消息体 ]);}?>设备信息
status == 0){ echo '点击已知道'; }else if($model->status == 1){ echo '您已知道此设备故障情况'; } ?> 'map-modal',// 'header' => '设备地图信息
',// ]); // echo '';// Modal::end();?>$model, 'template' => '', 'options' => ['class' => ''], 'attributes' => [ [ 'label' => '设备详情', 'format' => 'raw', 'value' => '设备号码:'.$model->phone.' 基站名称:'.$model->station_name.' 设备编号:'.$model->device_id.' 设备地址:'.$model->province.' '.$model->city.' '.$model->location.' 长按关注设备微信二维码:'.Html::img('@web/'.$model->wcode, ['width' => 42]),// Html::a('查看设备地图', '#', [// 'id' => 'map',// 'data-toggle' => 'modal',// 'data-target' => '#map-modal',// 'class' => 'weui-btn weui-btn_mini weui-btn_primary',// ]), ], ], ]) ?>{value}设备当前状态 type!=0&&$model->type!=1) { $guzhang='故障:'; switch ($model->type) { case 2: $guzhang.='放电'; break; case 3: $guzhang.='电压小于48V'; break; case 4: $guzhang.='剩余工作时间小于3小时'; break; case 5: $guzhang.='设备失联'; break; case 6: $guzhang.='设备故障'; break; case 0: $guzhang.='运转良好'; break; } echo $guzhang.''; }else{ echo '运转良好'; } ?>
$device_status, 'template' => '', 'options' => ['class' => ''], 'attributes' => [ [ 'label'=>'记录时间', 'attribute'=>'create_time', 'value'=>function($device_status){ return '记录时间:'.date('Y/m/d H:i:s',$device_status->create_time); }, ], [ 'label'=>'IP地址', 'attribute'=>'ip', 'value'=>function($device_status){ return 'ip地址:'.$device_status->ip; }, ], [ 'label'=>'落后电池数量', 'attribute'=>'bad_battery_count', 'value'=>function($device_status){ return '落后电池数量:'.$device_status->bad_battery_count; }, ], [ 'label'=>'落后电池', 'attribute'=>'v1', 'format'=>'raw', 'value'=>function($device_status){ if($device_status->bad_battery_status==0){ return "落后电池: 没有电池落后,运转良好"; }else{ $msg=''; foreach($device_status->bad_battery_status as $key=>$value){ if($value==1) $msg.=($key*2+1).',' . ($key*2+2) .','; } $msg=rtrim($msg,','); if(strlen($msg)<1){ return "落后电池: 没有电池落后,运转良好"; }else{ return "落后电池: 第".$msg."节电池为落后电池,请及时检修。"; } } } ], [ 'label' => '状态详情', 'format' => 'raw', 'value' => '工作状态:'.DeviceStatus::$status_names[$device_status->status]. ' 充电状态:'.DeviceStatus::$charge_names[$device_status->status_charge]. ' 电压:'.$device_status->volt.'V'. ' 电流:'.$device_status->current.'A'. ' 工作时间:'.$device_status->work_min.'分钟(约'.round($device_status->work_min/60,1).'小时)'. ' 均衡电量:'.$device_status->zijiu_ah.'AH'. ' 均衡时间:'.$device_status->zijiu_min.'分钟(约'.round($device_status->zijiu_min/60,1).'小时)'. ' 充放电量:'.$device_status->output_ah.'AH'. ' 充放时间:'.$device_status->output_min.'分钟(约'.round($device_status->output_min/60,1).'小时)'. ' 剩余电量:'.$device_status->remain_ah.'AH'. ' 剩余时间:'.$device_status->remain_min.'分钟(约'.round($device_status->remain_min/60,1).'小时)' ], [ 'label'=>'电池组电压', 'attribute'=>'v1', 'format'=>'raw', 'value'=>function($device_status){ $bad=$device_status->bad_battery_status?$device_status->bad_battery_status:[0=>0,1=>0,2=>0,3=>0,4=>0,5=>0,6=>0,7=>0,8=>0,9=>0,10=>0,11=>0]; $badcount=count($bad); if($badcount<12){ for($i = 0; $i <(12-$badcount); $i++) { array_push($bad,0); } } $dcolor='电池组电压: '; $count=0; foreach($bad as $key=>$value){ $keyv='v'.($key+1); if($value==1){ $dcolor.=' 【'.($key+1).'】'.$device_status->$keyv.'V'; }else{ $dcolor.='【'.($key+1).'】'.$device_status->$keyv.'V'; } $count++; if($count%3==0){ $dcolor.=' ';} } return $dcolor; } ], ], ]) ?>{value}消息通知
$wmsg, 'itemView'=>'_wmsg_item' ]);?>