添加喷灌配置
parent
b8ab64b5e4
commit
c7d2d8fcd7
|
|
@ -90,8 +90,8 @@ class CustomRegionController extends AdminController
|
||||||
],
|
],
|
||||||
[//有喷灌设备才有
|
[//有喷灌设备才有
|
||||||
'title' => '喷灌设备',
|
'title' => '喷灌设备',
|
||||||
'value' => 'penguan',
|
'value' => 'wasserstrahl',
|
||||||
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=penguan')),
|
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-wasserstrahl?id='.$region['id'])),
|
||||||
'unmountOnExit' => true//每次切换tab都要销毁
|
'unmountOnExit' => true//每次切换tab都要销毁
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
@ -113,12 +113,12 @@ class CustomRegionController extends AdminController
|
||||||
->labelWidth(100)
|
->labelWidth(100)
|
||||||
->className('Panel--success')
|
->className('Panel--success')
|
||||||
->body([
|
->body([
|
||||||
\amisMake()->TextControl()->static(true)->label('名称')->value('试验田1'),
|
\amisMake()->TextControl()->static(true)->name('name')->label('名称')->value('试验田1'),
|
||||||
\amisMake()->TextControl()->static(true)->label('负责人')->value('负责人'),
|
\amisMake()->TextControl()->static(true)->name('name1')->label('负责人')->value('负责人'),
|
||||||
\amisMake()->TextControl()->static(true)->label('分类')->value($region->category?->name ?? ''),
|
\amisMake()->TextControl()->static(true)->name('category')->label('分类')->value($region->category?->name ?? ''),
|
||||||
\amisMake()->TextControl()->static(true)->label('面积m²')->value($region->area),
|
\amisMake()->TextControl()->static(true)->name('area')->label('面积m²')->value($region->area),
|
||||||
\amisMake()->TextControl()->static(true)->label('排序')->value($region->sort),
|
\amisMake()->TextControl()->static(true)->name('sort')->label('排序')->value($region->sort),
|
||||||
\amisMake()->SwitchControl()->static(true)->name('is_enable')->label('显示')->value($region->is_enable),
|
\amisMake()->SwitchControl()->static(true)->name('is_enable')->name('is_enable')->label('显示')->value($region->is_enable),
|
||||||
]),
|
]),
|
||||||
amisMake()->Panel()->title('基础介绍')
|
amisMake()->Panel()->title('基础介绍')
|
||||||
->className('Panel--success')
|
->className('Panel--success')
|
||||||
|
|
|
||||||
|
|
@ -428,14 +428,14 @@ class DeviceController extends AdminController
|
||||||
*/
|
*/
|
||||||
public function airDetail(){
|
public function airDetail(){
|
||||||
return amisMake()->Grid()->columns([
|
return amisMake()->Grid()->columns([
|
||||||
amisMake()->Wrapper()->sm(4)->body([
|
amisMake()->Wrapper()->sm(6)->body([
|
||||||
amisMake()->Panel()->title('智能开关设置')
|
amisMake()->Panel()->title('智能开关设置')
|
||||||
->subFormMode('horizontal')
|
->subFormMode('horizontal')
|
||||||
->labelWidth(100)
|
->labelWidth(100)
|
||||||
->className('Panel--success')
|
->className('Panel--success')
|
||||||
->body([
|
->body([
|
||||||
amisMake()->FieldSetControl()->title('智能开启')->body([
|
amisMake()->FieldSetControl()->title('智能开启')->body([
|
||||||
\amisMake()->SwitchControl()->label('开关'),
|
\amisMake()->SwitchControl()->name('is_enable')->label('开关'),
|
||||||
\amisMake()->ConditionBuilderControl()->label('条件')->fields([
|
\amisMake()->ConditionBuilderControl()->label('条件')->fields([
|
||||||
[
|
[
|
||||||
'label' => '温度', 'type'=>'number','step'=>'0.01',
|
'label' => '温度', 'type'=>'number','step'=>'0.01',
|
||||||
|
|
@ -454,7 +454,7 @@ class DeviceController extends AdminController
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
amisMake()->FieldSetControl()->title('智能关闭')->body([
|
amisMake()->FieldSetControl()->title('智能关闭')->body([
|
||||||
\amisMake()->SwitchControl()->label('开关'),
|
\amisMake()->SwitchControl()->name('is_enable')->label('开关'),
|
||||||
\amisMake()->ConditionBuilderControl()->label('条件')->fields([
|
\amisMake()->ConditionBuilderControl()->label('条件')->fields([
|
||||||
[
|
[
|
||||||
'label' => '温度', 'type'=>'number','step'=>'0.01',
|
'label' => '温度', 'type'=>'number','step'=>'0.01',
|
||||||
|
|
@ -474,7 +474,7 @@ class DeviceController extends AdminController
|
||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
amisMake()->Wrapper()->sm(8)->body([
|
amisMake()->Wrapper()->sm(6)->body([
|
||||||
amisMake()->Panel()->title('开关记录')
|
amisMake()->Panel()->title('开关记录')
|
||||||
->className('Panel--success')
|
->className('Panel--success')
|
||||||
->body([
|
->body([
|
||||||
|
|
@ -500,4 +500,53 @@ class DeviceController extends AdminController
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 喷灌
|
||||||
|
*/
|
||||||
|
public function wasserstrahlDetail(){
|
||||||
|
return amisMake()->Grid()->columns([
|
||||||
|
amisMake()->Wrapper()->sm(6)->body([
|
||||||
|
amisMake()->Panel()->title('智能喷灌设置')
|
||||||
|
->subFormMode('horizontal')
|
||||||
|
->labelWidth(80)
|
||||||
|
->className('Panel--success')
|
||||||
|
->body([
|
||||||
|
amisMake()->FieldSetControl()->title('定时喷灌')->body([
|
||||||
|
\amisMake()->SwitchControl()->name('is_enable')->label('开关'),
|
||||||
|
\amisMake()->ArrayControl()->name('config')->label('定时')->items([
|
||||||
|
amisMake()->ComboControl()->items([
|
||||||
|
\amisMake()->InputTimeRange(),
|
||||||
|
\amisMake()->TextControl()->label('喷灌量')->labelWidth(30),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
]),
|
||||||
|
amisMake()->Wrapper()->sm(6)->body([
|
||||||
|
amisMake()->Panel()->title('开关记录')
|
||||||
|
->className('Panel--success')
|
||||||
|
->body([
|
||||||
|
\amisMake()->Table()->title('')
|
||||||
|
->data([
|
||||||
|
'items' => [
|
||||||
|
[
|
||||||
|
'name'=> '定时喷灌',
|
||||||
|
'name1'=> '关闭',
|
||||||
|
'time1'=> '2023-03-21 10:00:00',
|
||||||
|
]
|
||||||
|
]
|
||||||
|
])
|
||||||
|
->columns([
|
||||||
|
amisMake()->TableColumn()->name('name')->label('触发条件'),
|
||||||
|
amisMake()->TableColumn()->name('name1')->label('状态'),
|
||||||
|
amisMake()->TableColumn()->name('time1')->label('执行时间'),
|
||||||
|
])
|
||||||
|
->itemActions([
|
||||||
|
// amisMake()->DialogAction()->label('收获记录')->level('link')
|
||||||
|
])
|
||||||
|
])
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,9 @@ Route::group([
|
||||||
$router->get('custom-region-soil', '\App\Admin\Controllers\DeviceController@soilChart');
|
$router->get('custom-region-soil', '\App\Admin\Controllers\DeviceController@soilChart');
|
||||||
$router->post('custom-region-soil', '\App\Admin\Controllers\DeviceController@soilChart');
|
$router->post('custom-region-soil', '\App\Admin\Controllers\DeviceController@soilChart');
|
||||||
|
|
||||||
$router->get('custom-region-air', '\App\Admin\Controllers\DeviceController@airDetail');
|
|
||||||
$router->post('custom-region-air', '\App\Admin\Controllers\DeviceController@airDetail');
|
$router->post('custom-region-air', '\App\Admin\Controllers\DeviceController@airDetail');
|
||||||
|
|
||||||
|
$router->post('custom-region-wasserstrahl', '\App\Admin\Controllers\DeviceController@wasserstrahlDetail');
|
||||||
|
|
||||||
$router->resource('system/settings', \App\Admin\Controllers\SettingController::class);
|
$router->resource('system/settings', \App\Admin\Controllers\SettingController::class);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue