调整稻田和育秧的菜单
parent
278a41e60f
commit
7ef12f611e
|
|
@ -14,8 +14,18 @@ class CustomRegionController extends AdminController
|
||||||
|
|
||||||
protected string $queryPath = 'custom-region';
|
protected string $queryPath = 'custom-region';
|
||||||
|
|
||||||
public function index()
|
public function regionIndex($type)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
switch($type){
|
||||||
|
case 'yuyang':
|
||||||
|
$this->pageTitle = '育秧列表';
|
||||||
|
break;
|
||||||
|
case 'daotian':
|
||||||
|
$this->pageTitle = '稻田列表';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$page = $this->basePage()->body([
|
$page = $this->basePage()->body([
|
||||||
\amisMake()->GridNav()->options(
|
\amisMake()->GridNav()->options(
|
||||||
$this->regionList()
|
$this->regionList()
|
||||||
|
|
@ -53,31 +63,31 @@ class CustomRegionController extends AdminController
|
||||||
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-monitor?id='.$region['id'])),
|
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-monitor?id='.$region['id'])),
|
||||||
'unmountOnExit' => true//每次切换tab都要销毁
|
'unmountOnExit' => true//每次切换tab都要销毁
|
||||||
],
|
],
|
||||||
// [//有气象设备才有
|
[//有气象设备才有
|
||||||
// 'title' => '气象数据',
|
'title' => '气象数据',
|
||||||
// 'value' => 'qixiang',
|
'value' => 'qixiang',
|
||||||
// 'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=qixiang'))
|
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=qixiang'))
|
||||||
// ],
|
],
|
||||||
// [//有水质设备才有
|
[//有水质设备才有
|
||||||
// 'title' => '水质数据',
|
'title' => '水质数据',
|
||||||
// 'value' => 'shuizi',
|
'value' => 'shuizi',
|
||||||
// 'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=shuizi'))
|
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=shuizi'))
|
||||||
// ],
|
],
|
||||||
// [//有土壤设备才有
|
[//有土壤设备才有
|
||||||
// 'title' => '土壤数据',
|
'title' => '土壤数据',
|
||||||
// 'value' => 'turang',
|
'value' => 'turang',
|
||||||
// 'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=turang'))
|
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=turang'))
|
||||||
// ],
|
],
|
||||||
// [//有通风设备才有
|
[//有通风设备才有
|
||||||
// 'title' => '通风设备',
|
'title' => '通风设备',
|
||||||
// 'value' => 'tongfeng',
|
'value' => 'tongfeng',
|
||||||
// 'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=tongfeng'))
|
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=tongfeng'))
|
||||||
// ],
|
],
|
||||||
// [//有喷灌设备才有
|
[//有喷灌设备才有
|
||||||
// 'title' => '喷灌设备',
|
'title' => '喷灌设备',
|
||||||
// 'value' => 'penguan',
|
'value' => 'penguan',
|
||||||
// 'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=penguan'))
|
'tab'=>\amisMake()->Service()->schemaApi(admin_url('custom-region-detail?type=penguan'))
|
||||||
// ],
|
],
|
||||||
|
|
||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ Route::group([
|
||||||
$router->resource('regions', \App\Admin\Controllers\RegionController::class);
|
$router->resource('regions', \App\Admin\Controllers\RegionController::class);
|
||||||
|
|
||||||
//特殊菜单
|
//特殊菜单
|
||||||
$router->get('custom-region', '\App\Admin\Controllers\CustomRegionController@index');
|
$router->get('custom-region/{type}', '\App\Admin\Controllers\CustomRegionController@regionIndex');
|
||||||
$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->post('custom-region-monitor', '\App\Admin\Controllers\DeviceController@monitorList');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,13 +39,13 @@ class AdminMenuSeeder extends Seeder
|
||||||
['title' => '育秧中心', 'icon' => 'icon-park:lotus', 'url' => '',
|
['title' => '育秧中心', 'icon' => 'icon-park:lotus', 'url' => '',
|
||||||
'children' => [
|
'children' => [
|
||||||
['title' => '大棚控制', 'icon' => 'icon-park:link-one', 'url' => 'https://www.baidu.com', 'url_type'=>2],
|
['title' => '大棚控制', 'icon' => 'icon-park:link-one', 'url' => 'https://www.baidu.com', 'url_type'=>2],
|
||||||
['title' => '育秧列表', 'icon' => 'icon-park:more-app', 'url' => '/custom-region'],
|
['title' => '育秧列表', 'icon' => 'icon-park:more-app', 'url' => '/custom-region/yuyang'],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
['title' => '实验稻田', 'icon' => 'icon-park:four-leaves', 'url' => '',
|
['title' => '实验稻田', 'icon' => 'icon-park:four-leaves', 'url' => '',
|
||||||
'children' => [
|
'children' => [
|
||||||
['title' => '农机控制', 'icon' => 'icon-park:link-one', 'url' => 'https://www.baidu.com', 'url_type'=>2],
|
['title' => '农机控制', 'icon' => 'icon-park:link-one', 'url' => 'https://www.baidu.com', 'url_type'=>2],
|
||||||
['title' => '稻田列表', 'icon' => 'icon-park:more-app', 'url' => '/custom-region'],
|
['title' => '稻田列表', 'icon' => 'icon-park:more-app', 'url' => '/custom-region/daotian'],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue