Compare commits
3 Commits
9af025869e
...
f296e06098
| Author | SHA1 | Date |
|---|---|---|
|
|
f296e06098 | |
|
|
92e5e18113 | |
|
|
c3df092d3c |
|
|
@ -34,7 +34,7 @@ class ArticleCategoryController extends AdminController
|
|||
->columns([
|
||||
TableColumn::make()->name('id')->label(__('article-category.id')),
|
||||
TableColumn::make()->name('name')->label(__('article-category.name')),
|
||||
TableColumn::make()->name('icon')->label(__('article-category.icon'))->type('image')->width(60),
|
||||
// TableColumn::make()->name('icon')->label(__('article-category.icon'))->type('image')->width(60),
|
||||
TableColumn::make()->name('sort')->label(__('article-category.sort'))->align('center')
|
||||
->quickEdit(
|
||||
Components::make()->sortControl('sort', __('article-category.sort'))->saveImmediately(true)),
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class MonitorModeController extends AdminController
|
|||
public function form(): Form
|
||||
{
|
||||
return $this->baseForm()->body([
|
||||
TextControl::make()->name('name')->label('名称'),
|
||||
TextControl::make()->name('name')->label('名称')->required(),
|
||||
\amisMake()->RadiosControl()->name('type')->label('类型')->options(MonitorMode::typeMap())->required(true)->disabledOn('data.id > 0'),
|
||||
Components::make()->keywordsTagControl('group_tags', '分组', 'monitor-mode-group'),
|
||||
// Components::make()->sortControl('sort', __('admin.order')),
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class RegionController extends AdminController
|
|||
'aspectRatio'=> 1.1,
|
||||
'scalable' => true,
|
||||
])->autoUpload(true),
|
||||
Components::make()->fuEditorControl('description', '介绍'),
|
||||
Components::make()->fuEditorControl('description', '介绍', 300),
|
||||
Components::make()->decimalControl('area', '面积m²'),
|
||||
Components::make()->sortControl(),
|
||||
\amisMake()->SwitchControl()->name('is_enable')->value(1)->label('显示'),
|
||||
|
|
|
|||
|
|
@ -22,6 +22,12 @@ class WarningNoticeController extends AdminController
|
|||
->filterTogglable(false)
|
||||
->headerToolbar([
|
||||
])
|
||||
->filter($this->baseFilter()->actions([])->body([
|
||||
amisMake()->SelectControl()->name('lv')->label('报警等级')->options(WarningNotice::lvMap())->clearable()->size('md'),
|
||||
amisMake()->SelectControl()->name('status')->label('状态')->options(WarningNotice::stateMap())->clearable()->size('md'),
|
||||
amis('button')->label(__('admin.reset'))->actionType('clear-and-submit'),
|
||||
amis('submit')->label(__('admin.search'))->level('primary'),
|
||||
]))
|
||||
->columns([
|
||||
TableColumn::make()->name('id')->label('ID')->sortable(true),
|
||||
TableColumn::make()->name('device.modes')->type('each')->items([
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ use EloquentFilter\ModelFilter;
|
|||
|
||||
class WarningNoticeFilter extends ModelFilter
|
||||
{
|
||||
public function lv($lv){
|
||||
public function lv($lv)
|
||||
{
|
||||
return $this->where('lv', $lv);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class WarningNoticeController extends Controller
|
|||
public function warningLogNum(Request $request){
|
||||
$list = WarningNotice::filter($request->input(), WarningNoticeFilter::class)
|
||||
->select(DB::raw('lv, count(1) as num'))
|
||||
->where('status', 0)
|
||||
->groupBy('lv')
|
||||
->get()
|
||||
->pluck('num', 'lv')->toArray();
|
||||
|
|
@ -35,7 +36,9 @@ class WarningNoticeController extends Controller
|
|||
*/
|
||||
public function warningLog(Request $request)
|
||||
{
|
||||
$query = WarningNotice::with(['device.modes'])->filter($request->input(), WarningNoticeFilter::class)->orderBy('created_at', 'desc');
|
||||
$query = WarningNotice::with(['device.modes'])->filter($request->input(), WarningNoticeFilter::class)
|
||||
->where('status', 0)
|
||||
->orderBy('created_at', 'desc');
|
||||
$list = $query->simplePaginate(Paginator::resolvePerPage('per_page', 20, 50));
|
||||
|
||||
return $this->json(WarningNoticeResource::collection($list));
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Services\Admin;
|
||||
|
||||
use App\Models\WarningNotice;
|
||||
use App\Filters\WarningNoticeFilter;
|
||||
|
||||
/**
|
||||
* @method WarningNotice getModel()
|
||||
|
|
@ -13,4 +14,6 @@ class WarningNoticeService extends BaseService
|
|||
protected string $modelName = WarningNotice::class;
|
||||
|
||||
protected array $withRelationships = ['device.modes'];
|
||||
|
||||
protected string $modelFilterName = WarningNoticeFilter::class;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue