添加标记处理功能
parent
098b787a30
commit
b903c4a053
|
|
@ -37,7 +37,7 @@ class KeywordController extends AdminController
|
||||||
TableColumn::make()->name('key')->label('KEY'),
|
TableColumn::make()->name('key')->label('KEY'),
|
||||||
TableColumn::make()->name('value')->label('值'),
|
TableColumn::make()->name('value')->label('值'),
|
||||||
TableColumn::make()->name('created_at')->label('创建时间')->type('datetime')->sortable(true),
|
TableColumn::make()->name('created_at')->label('创建时间')->type('datetime')->sortable(true),
|
||||||
$this->rowActionsOnlyEditAndDelete(true),
|
// $this->rowActionsOnlyEditAndDelete(true),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this->baseList($crud);
|
return $this->baseList($crud);
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,9 @@ class WarningNoticeController extends AdminController
|
||||||
|
|
||||||
TableColumn::make()->name('status')->label('状态')->type('mapping')->map(WarningNotice::stateMapLabel())->className('text-primary'),
|
TableColumn::make()->name('status')->label('状态')->type('mapping')->map(WarningNotice::stateMapLabel())->className('text-primary'),
|
||||||
TableColumn::make()->name('created_at')->label('报警时间')->type('datetime')->sortable(true),
|
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);
|
return $this->baseList($crud);
|
||||||
|
|
@ -53,9 +56,21 @@ class WarningNoticeController extends AdminController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//标记已处理警报内容;
|
private function updateState(){
|
||||||
public function updateNotice()
|
return amisMake()->AjaxAction()
|
||||||
{
|
->label('标记处理')
|
||||||
|
->level('link')
|
||||||
|
->confirmText('是否确认标记处理')
|
||||||
|
->api('put:'.admin_url('warning-notice-mark').'/${id}');
|
||||||
|
}
|
||||||
|
|
||||||
|
//标记已处理警报内容;
|
||||||
|
public function updateNotice($id)
|
||||||
|
{
|
||||||
|
$rows = WarningNotice::where('id', $id)->update([
|
||||||
|
'status'=> 1
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $this->autoResponse($rows, '保存成功');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -56,6 +56,7 @@ Route::group([
|
||||||
$router->get('warning-setting', '\App\Admin\Controllers\WarningSettingController@settingIndex');
|
$router->get('warning-setting', '\App\Admin\Controllers\WarningSettingController@settingIndex');
|
||||||
$router->post('warning-setting-save', '\App\Admin\Controllers\WarningSettingController@saveSettingConfig');
|
$router->post('warning-setting-save', '\App\Admin\Controllers\WarningSettingController@saveSettingConfig');
|
||||||
$router->get('warning-notice', '\App\Admin\Controllers\WarningNoticeController@index');
|
$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);
|
$router->resource('monitor-modes', \App\Admin\Controllers\MonitorModeController::class);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue