91 lines
4.5 KiB
PHP
91 lines
4.5 KiB
PHP
<?php
|
|
|
|
namespace App\Admin\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
|
|
|
class CropController extends AdminController
|
|
{
|
|
public function planDetail(Request $request)
|
|
{
|
|
$randArr = function () {
|
|
$_arr = [];
|
|
for ($i = 0; $i < 7; $i++) {
|
|
$_arr[] = random_int(10, 200);
|
|
}
|
|
return '[' . implode(',', $_arr) . ']';
|
|
};
|
|
|
|
$random1 = $randArr();
|
|
$random2 = $randArr();
|
|
|
|
return amisMake()->Grid()->columns([
|
|
amisMake()->Wrapper()->sm(6)->body([
|
|
amisMake()->Panel()->title('基础详情')
|
|
->subFormMode('horizontal')
|
|
->labelWidth(100)
|
|
->className('Panel--success')
|
|
->body([
|
|
\amisMake()->TextControl()->static(true)->name('name')->label('名称')->value('试验田1'),
|
|
\amisMake()->TextControl()->static(true)->name('name1')->label('负责人')->value('负责人'),
|
|
\amisMake()->TextControl()->static(true)->name('area')->label('种植面积m²')->value(),
|
|
\amisMake()->TextControl()->static(true)->name('time')->label('种植时间')->value('2023-03-01'),
|
|
]),
|
|
amisMake()->Panel()->title('收割记录')
|
|
->className('Panel--success')
|
|
->body([
|
|
\amisMake()->Button()->className('absolute top-1 right-4')->actionType('dialog')->label('新增')->dialog([
|
|
"title"=> "收割记录",
|
|
"body"=> [
|
|
"type"=> "form",
|
|
"api"=> "",
|
|
"body"=> [
|
|
\amisMake()->TextControl()->label('负责人'),
|
|
\amisMake()->TextControl()->label('收割面积'),
|
|
\amisMake()->TextControl()->label('收割产量'),
|
|
\amisMake()->DateControl()->label('收割时间'),
|
|
]
|
|
]
|
|
])->level('primary'),
|
|
\amisMake()->CRUDTable()->title('')
|
|
->data([
|
|
'items' => [
|
|
[
|
|
'name'=> '负责人',
|
|
'name1'=> '100',
|
|
'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('收割时间'),
|
|
])
|
|
]),
|
|
]),
|
|
amisMake()->Wrapper()->sm(6)->body([
|
|
\amisMake()->grid()->columns([
|
|
\amisMake()->Form()->title('搜索条件')->mode('inline')->body([
|
|
\amisMake()->DateRangeControl()->label('时间范围'),
|
|
amis('submit')->label(__('admin.search'))->level('primary'),
|
|
]),
|
|
]),
|
|
amisMake()->Card()->className('m-r')->body(
|
|
amisMake()->Chart()->config("{
|
|
title:{ text: '种植情况'},
|
|
tooltip: { trigger: 'axis' },
|
|
xAxis: { type: 'category', boundaryGap: false, data: ['2023-03-01', '2023-03-10', '2023-03-15', '2023-03-15', '2023-03-20', '2023-03-25', '2023-03-31'] },
|
|
yAxis: { type: 'value' },
|
|
grid:{ left: '7%', right:'3%', top: 60, bottom: 30, },
|
|
series: [
|
|
{ name:'面积', data: {$random2}, type: 'line', areaStyle: {}, smooth: true, symbol: 'none', },
|
|
{ name:'产量', data: {$random1}, type: 'line', areaStyle: {}, smooth: true, symbol: 'none', },
|
|
]}")
|
|
),
|
|
]),
|
|
]);
|
|
}
|
|
} |