From ec9f9acad965dd932562b6c045e1e32dc4910bf7 Mon Sep 17 00:00:00 2001 From: vine_liutk <961510893@qq.com> Date: Tue, 28 Mar 2023 14:55:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AE=BE=E5=A4=87=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/DeviceController.php | 87 +++++++++++----------- 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/app/Admin/Controllers/DeviceController.php b/app/Admin/Controllers/DeviceController.php index ddd3683..ca98cde 100644 --- a/app/Admin/Controllers/DeviceController.php +++ b/app/Admin/Controllers/DeviceController.php @@ -430,46 +430,47 @@ class DeviceController extends AdminController return amisMake()->Grid()->columns([ amisMake()->Wrapper()->sm(6)->body([ amisMake()->Panel()->title('智能开关设置') - ->subFormMode('horizontal') ->labelWidth(100) ->className('Panel--success') ->body([ - amisMake()->FieldSetControl()->title('智能开启')->body([ - \amisMake()->SwitchControl()->name('is_enable')->label('开关'), - \amisMake()->ConditionBuilderControl()->label('条件')->fields([ - [ - 'label' => '温度', 'type'=>'number','step'=>'0.01','name'=>'q', - 'operators'=> [ - 'equal', 'not_equal', 'less', 'less_or_equal', 'greater', 'greater_or_equal', 'between', 'not_between', - // 'is_empty', 'is_not_empty' - ] - ], - [ - 'label' => '湿度', 'type'=>'number','step'=>'0.01','name'=>'x', - 'operators'=> [ - 'equal', 'not_equal', 'less', 'less_or_equal', 'greater', 'greater_or_equal', 'between', 'not_between', - // 'is_empty', 'is_not_empty' - ] - ], + \amisMake()->Form()->title('')->mode('horizontal')->body([ + amisMake()->FieldSetControl()->title('智能开启')->body([ + \amisMake()->SwitchControl()->name('open_is_enable')->label('开关'), + \amisMake()->ConditionBuilderControl()->label('条件')->fields([ + [ + 'label' => '温度', 'type'=>'number','step'=>'0.01','name'=>'q', + 'operators'=> [ + 'equal', 'not_equal', 'less', 'less_or_equal', 'greater', 'greater_or_equal', 'between', 'not_between', + // 'is_empty', 'is_not_empty' + ] + ], + [ + 'label' => '湿度', 'type'=>'number','step'=>'0.01','name'=>'x', + 'operators'=> [ + 'equal', 'not_equal', 'less', 'less_or_equal', 'greater', 'greater_or_equal', 'between', 'not_between', + // 'is_empty', 'is_not_empty' + ] + ], + ]), ]), - ]), - amisMake()->FieldSetControl()->title('智能关闭')->body([ - \amisMake()->SwitchControl()->name('is_enable')->label('开关'), - \amisMake()->ConditionBuilderControl()->label('条件')->fields([ - [ - 'label' => '温度', 'type'=>'number','step'=>'0.01','name'=>'q', - 'operators'=> [ - 'equal', 'not_equal', 'less', 'less_or_equal', 'greater', 'greater_or_equal', 'between', 'not_between', - // 'is_empty', 'is_not_empty' - ] - ], - [ - 'label' => '湿度', 'type'=>'number','step'=>'0.01','name'=>'x', - 'operators'=> [ - 'equal', 'not_equal', 'less', 'less_or_equal', 'greater', 'greater_or_equal', 'between', 'not_between', - // 'is_empty', 'is_not_empty' - ] - ], + amisMake()->FieldSetControl()->title('智能关闭')->body([ + \amisMake()->SwitchControl()->name('close_is_enable')->label('开关'), + \amisMake()->ConditionBuilderControl()->label('条件')->fields([ + [ + 'label' => '温度', 'type'=>'number','step'=>'0.01','name'=>'q', + 'operators'=> [ + 'equal', 'not_equal', 'less', 'less_or_equal', 'greater', 'greater_or_equal', 'between', 'not_between', + // 'is_empty', 'is_not_empty' + ] + ], + [ + 'label' => '湿度', 'type'=>'number','step'=>'0.01','name'=>'x', + 'operators'=> [ + 'equal', 'not_equal', 'less', 'less_or_equal', 'greater', 'greater_or_equal', 'between', 'not_between', + // 'is_empty', 'is_not_empty' + ] + ], + ]), ]), ]), ]) @@ -512,12 +513,14 @@ class DeviceController extends AdminController ->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()->name('input')->label('喷灌量')->labelWidth(30), + \amisMake()->Form()->title('')->mode('horizontal')->body([ + amisMake()->FieldSetControl()->title('定时喷灌')->body([ + \amisMake()->SwitchControl()->name('is_enable')->label('开关'), + \amisMake()->ArrayControl()->name('config')->label('定时')->items([ + amisMake()->ComboControl()->items([ + \amisMake()->InputTimeRange(), + \amisMake()->TextControl()->name('input')->label('喷灌量')->labelWidth(30), + ]), ]), ]), ]),