1
0
Fork 0

Compare commits

...

2 Commits

Author SHA1 Message Date
vine_liutk b903c4a053 添加标记处理功能 2023-08-07 17:15:14 +08:00
vine_liutk 098b787a30 添加canvasbox容器大小返回 2023-08-07 16:47:50 +08:00
4 changed files with 19 additions and 2 deletions

View File

@ -37,7 +37,7 @@ class KeywordController extends AdminController
TableColumn::make()->name('key')->label('KEY'),
TableColumn::make()->name('value')->label('值'),
TableColumn::make()->name('created_at')->label('创建时间')->type('datetime')->sortable(true),
$this->rowActionsOnlyEditAndDelete(true),
// $this->rowActionsOnlyEditAndDelete(true),
]);
return $this->baseList($crud);

View File

@ -35,6 +35,9 @@ class WarningNoticeController extends AdminController
TableColumn::make()->name('status')->label('状态')->type('mapping')->map(WarningNotice::stateMapLabel())->className('text-primary'),
TableColumn::make()->name('created_at')->label('报警时间')->type('datetime')->sortable(true),
amisMake()->Operation()->label(__('admin.actions'))->buttons([
$this->updateState()->visibleOn('${status == 0}'),
]),
]);
return $this->baseList($crud);
@ -53,9 +56,21 @@ class WarningNoticeController extends AdminController
]);
}
private function updateState(){
return amisMake()->AjaxAction()
->label('标记处理')
->level('link')
->confirmText('是否确认标记处理')
->api('put:'.admin_url('warning-notice-mark').'/${id}');
}
//标记已处理警报内容;
public function updateNotice()
public function updateNotice($id)
{
$rows = WarningNotice::where('id', $id)->update([
'status'=> 1
]);
return $this->autoResponse($rows, '保存成功');
}
}

View File

@ -56,6 +56,7 @@ Route::group([
$router->get('warning-setting', '\App\Admin\Controllers\WarningSettingController@settingIndex');
$router->post('warning-setting-save', '\App\Admin\Controllers\WarningSettingController@saveSettingConfig');
$router->get('warning-notice', '\App\Admin\Controllers\WarningNoticeController@index');
$router->put('warning-notice-mark/{id}', '\App\Admin\Controllers\WarningNoticeController@updateNotice');
//监测点位
$router->resource('monitor-modes', \App\Admin\Controllers\MonitorModeController::class);

View File

@ -26,6 +26,7 @@ class RegionResource extends JsonResource
'current_plant' => RegionPlantResource::make($this->whenLoaded('currentPlant')),
'position_x'=> $this->position_x,
'position_y'=> $this->position_y,
'canvasbox'=> '1350,900',
];
}
}