init
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace plugin\admin\app\controller;
|
||||
|
||||
use plugin\admin\app\service\DeviceStatusService;
|
||||
use support\Response;
|
||||
|
||||
/**
|
||||
* 设备情况管理(参照旧系统 device.tpl.html)
|
||||
*/
|
||||
class DeviceStatusController extends Base
|
||||
{
|
||||
private DeviceStatusService $service;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->service = new DeviceStatusService();
|
||||
}
|
||||
|
||||
public function index(): Response
|
||||
{
|
||||
return raw_view('device-status/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备按钮列表(带数据权限)
|
||||
*/
|
||||
public function getDeviceNameList(): Response
|
||||
{
|
||||
return json(['code' => 0, 'data' => $this->service->getDeviceNameList()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备基本信息
|
||||
*/
|
||||
public function getDeviceBasicInfo(): Response
|
||||
{
|
||||
$deviceId = request()->get('id') ? (int)request()->get('id') : null;
|
||||
return json(['code' => 0, 'data' => $this->service->getDeviceBasicInfo($deviceId)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备灭菌次数及合规次数
|
||||
*/
|
||||
public function getDeviceRunInfo(): Response
|
||||
{
|
||||
$deviceId = request()->get('id') ? (int)request()->get('id') : null;
|
||||
return json(['code' => 0, 'data' => $this->service->getDeviceRunInfo($deviceId)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备预警次数(按类型分)
|
||||
*/
|
||||
public function getDeviceWarnInfo(): Response
|
||||
{
|
||||
$deviceId = request()->get('id') ? (int)request()->get('id') : null;
|
||||
return json(['code' => 0, 'data' => $this->service->getDeviceWarnInfo($deviceId)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备最近周期运行折线图数据
|
||||
*/
|
||||
public function getDeviceCycleRunLine(): Response
|
||||
{
|
||||
$deviceId = request()->get('id') ? (int)request()->get('id') : null;
|
||||
return json(['code' => 0, 'data' => $this->service->getDeviceCycleRunLine($deviceId)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备最近周期运行列表(右侧小表格)
|
||||
*/
|
||||
public function getDeviceCycleRunList(): Response
|
||||
{
|
||||
$deviceId = request()->get('id') ? (int)request()->get('id') : null;
|
||||
return json(['code' => 0, 'data' => $this->service->getDeviceCycleRunList($deviceId)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取该设备下所有周期运行信息(操作记录)
|
||||
*/
|
||||
public function getDeviceAllCycleInfo(): Response
|
||||
{
|
||||
$deviceId = request()->get('id') ? (int)request()->get('id') : null;
|
||||
return json(['code' => 0, 'data' => $this->service->getDeviceAllCycleInfo($deviceId)]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user