1
0
Fork 0

Compare commits

..

No commits in common. "f296e06098cdb40c162dc40996b978a1a62c9644" and "9af025869e7c7592ec242c38712d9f55c0833a1e" have entirely different histories.

7 changed files with 5 additions and 18 deletions

View File

@ -34,7 +34,7 @@ class ArticleCategoryController extends AdminController
->columns([ ->columns([
TableColumn::make()->name('id')->label(__('article-category.id')), TableColumn::make()->name('id')->label(__('article-category.id')),
TableColumn::make()->name('name')->label(__('article-category.name')), 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') TableColumn::make()->name('sort')->label(__('article-category.sort'))->align('center')
->quickEdit( ->quickEdit(
Components::make()->sortControl('sort', __('article-category.sort'))->saveImmediately(true)), Components::make()->sortControl('sort', __('article-category.sort'))->saveImmediately(true)),

View File

@ -60,7 +60,7 @@ class MonitorModeController extends AdminController
public function form(): Form public function form(): Form
{ {
return $this->baseForm()->body([ return $this->baseForm()->body([
TextControl::make()->name('name')->label('名称')->required(), TextControl::make()->name('name')->label('名称'),
\amisMake()->RadiosControl()->name('type')->label('类型')->options(MonitorMode::typeMap())->required(true)->disabledOn('data.id > 0'), \amisMake()->RadiosControl()->name('type')->label('类型')->options(MonitorMode::typeMap())->required(true)->disabledOn('data.id > 0'),
Components::make()->keywordsTagControl('group_tags', '分组', 'monitor-mode-group'), Components::make()->keywordsTagControl('group_tags', '分组', 'monitor-mode-group'),
// Components::make()->sortControl('sort', __('admin.order')), // Components::make()->sortControl('sort', __('admin.order')),

View File

@ -78,7 +78,7 @@ class RegionController extends AdminController
'aspectRatio'=> 1.1, 'aspectRatio'=> 1.1,
'scalable' => true, 'scalable' => true,
])->autoUpload(true), ])->autoUpload(true),
Components::make()->fuEditorControl('description', '介绍', 300), Components::make()->fuEditorControl('description', '介绍'),
Components::make()->decimalControl('area', '面积m²'), Components::make()->decimalControl('area', '面积m²'),
Components::make()->sortControl(), Components::make()->sortControl(),
\amisMake()->SwitchControl()->name('is_enable')->value(1)->label('显示'), \amisMake()->SwitchControl()->name('is_enable')->value(1)->label('显示'),

View File

@ -22,12 +22,6 @@ class WarningNoticeController extends AdminController
->filterTogglable(false) ->filterTogglable(false)
->headerToolbar([ ->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([ ->columns([
TableColumn::make()->name('id')->label('ID')->sortable(true), TableColumn::make()->name('id')->label('ID')->sortable(true),
TableColumn::make()->name('device.modes')->type('each')->items([ TableColumn::make()->name('device.modes')->type('each')->items([

View File

@ -6,8 +6,7 @@ use EloquentFilter\ModelFilter;
class WarningNoticeFilter extends ModelFilter class WarningNoticeFilter extends ModelFilter
{ {
public function lv($lv) public function lv($lv){
{
return $this->where('lv', $lv); return $this->where('lv', $lv);
} }

View File

@ -18,7 +18,6 @@ class WarningNoticeController extends Controller
public function warningLogNum(Request $request){ public function warningLogNum(Request $request){
$list = WarningNotice::filter($request->input(), WarningNoticeFilter::class) $list = WarningNotice::filter($request->input(), WarningNoticeFilter::class)
->select(DB::raw('lv, count(1) as num')) ->select(DB::raw('lv, count(1) as num'))
->where('status', 0)
->groupBy('lv') ->groupBy('lv')
->get() ->get()
->pluck('num', 'lv')->toArray(); ->pluck('num', 'lv')->toArray();
@ -36,9 +35,7 @@ class WarningNoticeController extends Controller
*/ */
public function warningLog(Request $request) public function warningLog(Request $request)
{ {
$query = WarningNotice::with(['device.modes'])->filter($request->input(), WarningNoticeFilter::class) $query = WarningNotice::with(['device.modes'])->filter($request->input(), WarningNoticeFilter::class)->orderBy('created_at', 'desc');
->where('status', 0)
->orderBy('created_at', 'desc');
$list = $query->simplePaginate(Paginator::resolvePerPage('per_page', 20, 50)); $list = $query->simplePaginate(Paginator::resolvePerPage('per_page', 20, 50));
return $this->json(WarningNoticeResource::collection($list)); return $this->json(WarningNoticeResource::collection($list));

View File

@ -3,7 +3,6 @@
namespace App\Services\Admin; namespace App\Services\Admin;
use App\Models\WarningNotice; use App\Models\WarningNotice;
use App\Filters\WarningNoticeFilter;
/** /**
* @method WarningNotice getModel() * @method WarningNotice getModel()
@ -14,6 +13,4 @@ class WarningNoticeService extends BaseService
protected string $modelName = WarningNotice::class; protected string $modelName = WarningNotice::class;
protected array $withRelationships = ['device.modes']; protected array $withRelationships = ['device.modes'];
protected string $modelFilterName = WarningNoticeFilter::class;
} }