添加基础信息和直播画面详情
parent
96fbe56898
commit
278a41e60f
|
|
@ -6,6 +6,7 @@ use Illuminate\Http\Request;
|
||||||
use Slowlyo\OwlAdmin\Renderers\Page;
|
use Slowlyo\OwlAdmin\Renderers\Page;
|
||||||
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
||||||
use App\Admin\Components;
|
use App\Admin\Components;
|
||||||
|
use App\Models\Region;
|
||||||
|
|
||||||
class CustomRegionController extends AdminController
|
class CustomRegionController extends AdminController
|
||||||
{
|
{
|
||||||
|
|
@ -39,43 +40,44 @@ class CustomRegionController extends AdminController
|
||||||
'clickAction' => [
|
'clickAction' => [
|
||||||
'actionType'=> 'dialog',
|
'actionType'=> 'dialog',
|
||||||
'dialog' => \amisMake()->Dialog()->title($region['name'])
|
'dialog' => \amisMake()->Dialog()->title($region['name'])
|
||||||
->size('full')->body([
|
->size('full')->actions([])->body([
|
||||||
\amisMake()->Tabs()->tabsMode('simple')->name('detailTab')->tabs([
|
\amisMake()->Tabs()->tabsMode('simple')->name('detailTab')->tabs([
|
||||||
[
|
[
|
||||||
'title' => '基地详情',
|
'title' => '基地详情',
|
||||||
'value' => 'detail',
|
'value' => 'detail',
|
||||||
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=detail'))
|
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?id='.$region['id']))
|
||||||
],
|
],
|
||||||
[//有监控设备才有
|
[//有监控设备才有
|
||||||
'title' => '监控视频',
|
'title' => '监控视频',
|
||||||
'value' => 'video',
|
'value' => 'monitor',
|
||||||
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=video'))
|
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-monitor?id='.$region['id'])),
|
||||||
],
|
'unmountOnExit' => true//每次切换tab都要销毁
|
||||||
[//有气象设备才有
|
|
||||||
'title' => '气象数据',
|
|
||||||
'value' => 'qixiang',
|
|
||||||
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=qixiang'))
|
|
||||||
],
|
|
||||||
[//有水质设备才有
|
|
||||||
'title' => '水质数据',
|
|
||||||
'value' => 'shuizi',
|
|
||||||
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=shuizi'))
|
|
||||||
],
|
|
||||||
[//有土壤设备才有
|
|
||||||
'title' => '土壤数据',
|
|
||||||
'value' => 'turang',
|
|
||||||
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=turang'))
|
|
||||||
],
|
|
||||||
[//有通风设备才有
|
|
||||||
'title' => '通风设备',
|
|
||||||
'value' => 'tongfeng',
|
|
||||||
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=tongfeng'))
|
|
||||||
],
|
|
||||||
[//有喷灌设备才有
|
|
||||||
'title' => '喷灌设备',
|
|
||||||
'value' => 'penguan',
|
|
||||||
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=penguan'))
|
|
||||||
],
|
],
|
||||||
|
// [//有气象设备才有
|
||||||
|
// 'title' => '气象数据',
|
||||||
|
// 'value' => 'qixiang',
|
||||||
|
// 'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=qixiang'))
|
||||||
|
// ],
|
||||||
|
// [//有水质设备才有
|
||||||
|
// 'title' => '水质数据',
|
||||||
|
// 'value' => 'shuizi',
|
||||||
|
// 'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=shuizi'))
|
||||||
|
// ],
|
||||||
|
// [//有土壤设备才有
|
||||||
|
// 'title' => '土壤数据',
|
||||||
|
// 'value' => 'turang',
|
||||||
|
// 'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=turang'))
|
||||||
|
// ],
|
||||||
|
// [//有通风设备才有
|
||||||
|
// 'title' => '通风设备',
|
||||||
|
// 'value' => 'tongfeng',
|
||||||
|
// 'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=tongfeng'))
|
||||||
|
// ],
|
||||||
|
// [//有喷灌设备才有
|
||||||
|
// 'title' => '喷灌设备',
|
||||||
|
// 'value' => 'penguan',
|
||||||
|
// 'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=penguan'))
|
||||||
|
// ],
|
||||||
|
|
||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
|
|
@ -86,6 +88,54 @@ class CustomRegionController extends AdminController
|
||||||
|
|
||||||
public function regionDetail(Request $request)
|
public function regionDetail(Request $request)
|
||||||
{
|
{
|
||||||
return \amisMake()->Wrapper()->body($request->type ?? '找不到type');
|
$id = $request->id;
|
||||||
|
$region = Region::find($id);
|
||||||
|
return amisMake()->Grid()->columns([
|
||||||
|
amisMake()->Wrapper()->sm(4)->body([
|
||||||
|
amisMake()->Panel()->title('基础详情')
|
||||||
|
->subFormMode('horizontal')
|
||||||
|
->labelWidth(100)
|
||||||
|
->className('Panel--success')
|
||||||
|
->body([
|
||||||
|
\amisMake()->TextControl()->static(true)->label('名称')->value('试验田1'),
|
||||||
|
\amisMake()->TextControl()->static(true)->label('负责人')->value('负责人'),
|
||||||
|
\amisMake()->TextControl()->static(true)->label('分类')->value($region->category?->name ?? ''),
|
||||||
|
\amisMake()->TextControl()->static(true)->label('面积m²')->value($region->area),
|
||||||
|
\amisMake()->TextControl()->static(true)->label('排序')->value($region->sort),
|
||||||
|
\amisMake()->SwitchControl()->static(true)->name('is_enable')->label('显示')->value($region->is_enable),
|
||||||
|
]),
|
||||||
|
amisMake()->Panel()->title('基础介绍')
|
||||||
|
->className('Panel--success')
|
||||||
|
->body([
|
||||||
|
amisMake()->Tpl()->tpl($region->content)
|
||||||
|
])
|
||||||
|
]),
|
||||||
|
amisMake()->Wrapper()->sm(8)->body([
|
||||||
|
amisMake()->Panel()->title('种植记录')
|
||||||
|
->className('Panel--success')
|
||||||
|
->body([
|
||||||
|
\amisMake()->Table()->title('')
|
||||||
|
->data([
|
||||||
|
'items' => [
|
||||||
|
[
|
||||||
|
'name'=> '作物名称',
|
||||||
|
'name1'=> '负责人',
|
||||||
|
'area'=> '100',
|
||||||
|
'time1'=> '2023-03-21',
|
||||||
|
]
|
||||||
|
]
|
||||||
|
])
|
||||||
|
->columns([
|
||||||
|
amisMake()->TableColumn()->name('name')->label('名称'),
|
||||||
|
amisMake()->TableColumn()->name('name1')->label('负责人'),
|
||||||
|
amisMake()->TableColumn()->name('area')->label('种植范围'),
|
||||||
|
amisMake()->TableColumn()->name('time1')->label('开始时间'),
|
||||||
|
])
|
||||||
|
->itemActions([
|
||||||
|
// amisMake()->DialogAction()->label('收获记录')->level('link')
|
||||||
|
])
|
||||||
|
])
|
||||||
|
]),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ use Slowlyo\OwlAdmin\Renderers\Page;
|
||||||
use Slowlyo\OwlAdmin\Renderers\Form;
|
use Slowlyo\OwlAdmin\Renderers\Form;
|
||||||
use Slowlyo\OwlAdmin\Renderers\TableColumn;
|
use Slowlyo\OwlAdmin\Renderers\TableColumn;
|
||||||
use Slowlyo\OwlAdmin\Renderers\TextControl;
|
use Slowlyo\OwlAdmin\Renderers\TextControl;
|
||||||
|
use Slowlyo\OwlAdmin\Renderers\CRUDTable;
|
||||||
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
||||||
use App\Services\Admin\DeviceService;
|
use App\Services\Admin\DeviceService;
|
||||||
use App\Models\Device;
|
use App\Models\Device;
|
||||||
|
|
@ -69,4 +70,34 @@ class DeviceController extends AdminController
|
||||||
TextControl::make()->static(true)->name('updated_at')->label('更新时间')
|
TextControl::make()->static(true)->name('updated_at')->label('更新时间')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监控设备列表
|
||||||
|
*/
|
||||||
|
public function monitorList(){
|
||||||
|
return CRUDTable::make()->mode('cards')->columnsCount(3)
|
||||||
|
->data([
|
||||||
|
'items' => [
|
||||||
|
[
|
||||||
|
'id'=>1,
|
||||||
|
'src'=>'ws://183.221.204.29:8100/rtsp?url=cnRzcDovL2FkbWluOjEyMzQ1Njc4OXhAMTE3LjE3NC4xODQuMTE4OjkwMDkvY2FtL3JlYWxtb25pdG9yP2NoYW5uZWw9MSZzdWJ0eXBlPTA='
|
||||||
|
],
|
||||||
|
]
|
||||||
|
])
|
||||||
|
// ->filter([
|
||||||
|
// 'title' => '指定位置',
|
||||||
|
// 'body' => [
|
||||||
|
// \amisMake()->TableControl()->name('name')->label('点位名称')->size('sm')->actions([
|
||||||
|
// ["type"=> "submit","level"=> "primary","label"=> "查询"]
|
||||||
|
// ])
|
||||||
|
// ]
|
||||||
|
// ])
|
||||||
|
->itemClassName('col-sm-4')
|
||||||
|
->card([
|
||||||
|
'header' => [],
|
||||||
|
'body' => amisMake()->Video()
|
||||||
|
->isLive(true)->videoType('video/x-flv')->muted(true)->autoPlay(true)
|
||||||
|
->src('${src}')
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ Route::group([
|
||||||
$router->resource('keywords', \App\Admin\Controllers\KeywordController::class);
|
$router->resource('keywords', \App\Admin\Controllers\KeywordController::class);
|
||||||
//设备管理
|
//设备管理
|
||||||
$router->resource('devices', \App\Admin\Controllers\DeviceController::class);
|
$router->resource('devices', \App\Admin\Controllers\DeviceController::class);
|
||||||
|
|
||||||
//区域分类
|
//区域分类
|
||||||
$router->resource('region-categories', \App\Admin\Controllers\RegionCategoryController::class);
|
$router->resource('region-categories', \App\Admin\Controllers\RegionCategoryController::class);
|
||||||
//区域列表
|
//区域列表
|
||||||
|
|
@ -40,7 +41,7 @@ Route::group([
|
||||||
//特殊菜单
|
//特殊菜单
|
||||||
$router->get('custom-region', '\App\Admin\Controllers\CustomRegionController@index');
|
$router->get('custom-region', '\App\Admin\Controllers\CustomRegionController@index');
|
||||||
$router->post('custom-region-detail', '\App\Admin\Controllers\CustomRegionController@regionDetail');
|
$router->post('custom-region-detail', '\App\Admin\Controllers\CustomRegionController@regionDetail');
|
||||||
|
$router->post('custom-region-monitor', '\App\Admin\Controllers\DeviceController@monitorList');
|
||||||
|
|
||||||
$router->resource('system/settings', \App\Admin\Controllers\SettingController::class);
|
$router->resource('system/settings', \App\Admin\Controllers\SettingController::class);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue