1
0
Fork 0

添加标记处理功能

develop
vine_liutk 2023-08-07 17:15:14 +08:00
parent 098b787a30
commit b903c4a053
3 changed files with 18 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);