diff --git a/admin/src/views/device/index.vue b/admin/src/views/device/index.vue
index 1a39e443..e7d2df53 100644
--- a/admin/src/views/device/index.vue
+++ b/admin/src/views/device/index.vue
@@ -93,7 +93,7 @@
-
+
ID: {{ row.user_id }}
@@ -139,7 +139,7 @@
{{ row.create_time ? timeFormat(row.create_time, 'yyyy-mm-dd hh:MM:ss') : '' }}
-
+
编辑
-
-
- 查看土壤
-
-
-
-
- 查看空气
-
-
-
- 查看视频
-
-
-
-
-
+
+
+
+ ID: {{ row.device_id }}
+ 名称: {{ row.device.name }}
+
+
+
-
+
-
+
- {{ row.create_time ? timeFormat(row.plant_date, 'yyyy-mm-dd hh:MM:ss') : '' }}
+ {{ row.create_time ? timeFormat(row.create_time, 'yyyy-mm-dd hh:MM:ss') : '' }}
@@ -141,6 +145,10 @@ const handleDetail = (data: any) => {
deviceType = dictData['alarm_type'][key]['name']
}
}
+ detailData.gridData.unshift({
+ item: '报警时间',
+ value: data.create_time ? timeFormat(data.create_time, 'yyyy-mm-dd hh:MM:ss') : ''
+ })
detailData.gridData.unshift({
item: '解决方案',
value: data.solution
diff --git a/app/adminapi/logic/device/DeviceLogic.php b/app/adminapi/logic/device/DeviceLogic.php
index bd16e501..151df18b 100644
--- a/app/adminapi/logic/device/DeviceLogic.php
+++ b/app/adminapi/logic/device/DeviceLogic.php
@@ -41,6 +41,7 @@ class DeviceLogic extends BaseLogic
Db::startTrans();
try {
$device = Device::create([
+ 'user_id' => $params['user_id'],
'code' => $params['code'],
'name' => $params['name'],
'type' => $params['type'],
@@ -77,6 +78,7 @@ class DeviceLogic extends BaseLogic
Db::startTrans();
try {
$device = Device::where('id', $params['id'])->update([
+ 'user_id' => $params['user_id'],
'code' => $params['code'],
'name' => $params['name'],
'type' => $params['type'],
diff --git a/app/adminapi/validate/device/DeviceValidate.php b/app/adminapi/validate/device/DeviceValidate.php
index 4e2a8a43..f200577e 100644
--- a/app/adminapi/validate/device/DeviceValidate.php
+++ b/app/adminapi/validate/device/DeviceValidate.php
@@ -31,13 +31,13 @@ class DeviceValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
- 'id' => 'require',
- 'code' => 'require',
- 'name' => 'require',
- 'type' => 'require',
- 'status' => 'require',
- 'is_online' => 'require',
- 'is_bind' => 'require',
+ 'id' => 'require',
+ 'code' => 'require',
+ 'name' => 'require',
+ 'type' => 'require',
+ 'status' => 'require',
+ 'is_online' => 'require',
+ 'is_bind' => 'require',
];
@@ -46,13 +46,13 @@ class DeviceValidate extends BaseValidate
* @var string[]
*/
protected $field = [
- 'id' => 'id',
- 'code' => '设备编码',
- 'name' => '设备名称',
- 'type' => '设备类型',
- 'status' => '设备状态',
- 'is_online' => '是否在线',
- 'is_bind' => '是否绑定土地',
+ 'id' => 'id',
+ 'code' => '设备编码',
+ 'name' => '设备名称',
+ 'type' => '设备类型',
+ 'status' => '设备状态',
+ 'is_online' => '是否在线',
+ 'is_bind' => '是否绑定土地',
];