From 6c763c99c8d0ff1c694c66f623376ab00e293ce0 Mon Sep 17 00:00:00 2001 From: vine_liutk <961510893@qq.com> Date: Tue, 16 Jan 2024 18:08:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=95=B0=E6=8D=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/KeywordController.php | 11 +++++++---- app/Admin/routes.php | 15 ++++++++++++++- database/seeders/AdminMenuSeeder.php | 12 ++++++++++++ database/seeders/KeywordSeeder.php | 11 +++++++++++ lang/zh_CN/menu.php | 12 ++++++++++++ 5 files changed, 56 insertions(+), 5 deletions(-) diff --git a/app/Admin/Controllers/KeywordController.php b/app/Admin/Controllers/KeywordController.php index 37c411a..7bc2d94 100644 --- a/app/Admin/Controllers/KeywordController.php +++ b/app/Admin/Controllers/KeywordController.php @@ -16,6 +16,8 @@ class KeywordController extends AdminController { protected string $serviceName = KeywordService::class; + protected array $menuData = ['financial_cate', 'file_cate', 'department', 'area_cate', 'organized_body', 'housing_estate', 'domicile', 'nation', 'political_face','educational_level','oral_disputes','sanitary_inspection', 'book_cate', 'business_area','money_cate', 'welfare_cate', 'job_cate']; + public function list(): Page { //区分特殊管理和通用管理 @@ -24,12 +26,13 @@ class KeywordController extends AdminController if(!empty($parentName)){ $parentId = Keyword::where('key', $parentName)->value('id'); } - if($parentId > 0 && in_array($parentName, ['financial_cate', 'file_cate', 'department', 'area_cate', 'organized_body', 'housing_estate'])){ + if($parentId > 0 && in_array($parentName, $this->menuData)){ $columnsArr [] = TableColumn::make()->name('name')->label('名称'); if($parentName == 'department'){ $columnsArr [] = TableColumn::make()->name('value')->label('类型')->type('mapping')->map([ - '1'=> '发文部门', '2'=>'收文部门', - ]); + 1=>"发文部门", + 2=>"收文部门", + ])->className('text-primary'); } }else{ $columnsArr [] = TableColumn::make()->name('name')->label('名称'); @@ -79,7 +82,7 @@ class KeywordController extends AdminController $formBody = [ TextControl::make()->name('name')->label('名称')->required(true), ]; - if($parentId > 0 && in_array($parentName, ['financial_cate', 'file_cate', 'department', 'area_cate', 'organized_body', 'housing_estate'])){ + if($parentId > 0 && in_array($parentName, $this->menuData)){ $formBody[] = Components::make()->sortControl('parent_id')->value($parentId)->hidden(true)->readOnly(true); if($parentName == 'department'){ $formBody[] = amisMake()->RadiosControl('value', '类型')->options([ diff --git a/app/Admin/routes.php b/app/Admin/routes.php index cbf6e53..0cc5c48 100644 --- a/app/Admin/routes.php +++ b/app/Admin/routes.php @@ -40,7 +40,20 @@ Route::group([ $router->resource('area_cate', \App\Admin\Controllers\KeywordController::class); $router->resource('organized_body', \App\Admin\Controllers\KeywordController::class); $router->resource('housing_estate', \App\Admin\Controllers\KeywordController::class); - $router->resource('building', \App\Admin\Controllers\BuildingController::class); + $router->resource('building', \App\Admin\Controllers\BuildingController::class);//楼栋管理 + $router->resource('domicile', \App\Admin\Controllers\KeywordController::class); + $router->resource('nation', \App\Admin\Controllers\KeywordController::class); + $router->resource('political_face', \App\Admin\Controllers\KeywordController::class); + $router->resource('educational_level', \App\Admin\Controllers\KeywordController::class); + $router->resource('institution', \App\Admin\Controllers\KeywordController::class);//机构管理-todo + $router->resource('oral_disputes', \App\Admin\Controllers\KeywordController::class); + $router->resource('sanitary_inspection', \App\Admin\Controllers\KeywordController::class); + $router->resource('book_cate', \App\Admin\Controllers\KeywordController::class); + $router->resource('business_area', \App\Admin\Controllers\KeywordController::class); + $router->resource('money_cate', \App\Admin\Controllers\KeywordController::class); + $router->resource('welfare_cate', \App\Admin\Controllers\KeywordController::class); + $router->resource('job_cate', \App\Admin\Controllers\KeywordController::class); + //修改上传 $router->post('upload_file', [\App\Admin\Controllers\IndexController::class, 'uploadFile']); diff --git a/database/seeders/AdminMenuSeeder.php b/database/seeders/AdminMenuSeeder.php index 0203cc9..f0d2c5e 100644 --- a/database/seeders/AdminMenuSeeder.php +++ b/database/seeders/AdminMenuSeeder.php @@ -39,6 +39,18 @@ class AdminMenuSeeder extends Seeder ['title' => 'organized_body', 'icon' => 'ic:baseline-people-outline', 'url' => '/organized_body?parent_name=organized_body&has_owner=0', 'order'=>4],//社别管理 ['title' => 'housing_estate', 'icon' => 'bx:building-house', 'url' => '/housing_estate?parent_name=housing_estate&has_owner=0', 'order'=>5],//小区管理 ['title' => 'building', 'icon' => 'fe:building', 'url' => '/building', 'order'=>6],//楼栋管理 + ['title' => 'domicile', 'icon' => 'solar:people-nearby-line-duotone', 'url' => '/domicile?parent_name=domicile&has_owner=0', 'order'=>7],//户籍管理 + ['title' => 'nation', 'icon' => 'fluent:people-community-16-regular', 'url' => '/nation?parent_name=nation&has_owner=0', 'order'=>8],//民族管理 + ['title' => 'political_face', 'icon' => 'fluent:people-star-24-regular', 'url' => '/political_face?parent_name=political_face&has_owner=0', 'order'=>9],//政治面貌 + ['title' => 'educational_level', 'icon' => 'fluent:people-edit-24-regular', 'url' => '/educational_level?parent_name=educational_level&has_owner=0', 'order'=>10],//文化程度 + ['title' => 'institution', 'icon' => 'fluent:people-call-20-regular', 'url' => '/institution', 'order'=>11],//机构管理-todo + ['title' => 'oral_disputes', 'icon' => 'icon-park-outline:people-speak', 'url' => '/oral_disputes?parent_name=oral_disputes&has_owner=0', 'order'=>12],//口头纠纷 + ['title' => 'sanitary_inspection', 'icon' => 'carbon:clean', 'url' => '/sanitary_inspection?parent_name=sanitary_inspection&has_owner=0', 'order'=>13],//卫生检查 + ['title' => 'book_cate', 'icon' => 'ic:twotone-menu-book', 'url' => '/book_cate?parent_name=book_cate&has_owner=0', 'order'=>14],//图书类型 + ['title' => 'business_area', 'icon' => 'mdi:land-plots-marker', 'url' => '/business_area?parent_name=business_area&has_owner=0', 'order'=>15],//企业地区管理 + ['title' => 'money_cate', 'icon' => 'streamline:subscription-cashflow', 'url' => '/money_cate?parent_name=money_cate&has_owner=0', 'order'=>16],//收支情况类型 + ['title' => 'welfare_cate', 'icon' => 'material-symbols:redeem-rounded', 'url' => '/welfare_cate?parent_name=welfare_cate&has_owner=0', 'order'=>17],//福利类型 + ['title' => 'job_cate', 'icon' => 'gravity-ui:person-worker', 'url' => '/job_cate?parent_name=job_cate&has_owner=0', 'order'=>18],//工种管理 // ['title'=>'articles', 'icon'=>'ic:outline-article','url'=>'/articles', 'order'=>1], // ['title'=>'ads', 'icon'=>'lets-icons:img-box','url'=>'/ads', 'order'=>2], diff --git a/database/seeders/KeywordSeeder.php b/database/seeders/KeywordSeeder.php index 5fc967c..d3a7898 100644 --- a/database/seeders/KeywordSeeder.php +++ b/database/seeders/KeywordSeeder.php @@ -27,6 +27,17 @@ class KeywordSeeder extends Seeder ['key' => 'area_cate', 'name' => '地区类型', 'list' => []], ['key' => 'organized_body', 'name' => '社别管理', 'list' => []], ['key' => 'housing_estate', 'name' => '小区管理', 'list' => []], + ['key' => 'domicile', 'name' => '户籍管理', 'list' => []], + ['key' => 'nation', 'name' => '民族管理', 'list' => []], + ['key' => 'political_face', 'name' => '政治面貌', 'list' => []], + ['key' => 'educational_level', 'name' => '文化程度', 'list' => []], + ['key' => 'oral_disputes', 'name' => '口头纠纷类型', 'list' => []], + ['key' => 'sanitary_inspection', 'name' => '卫生检查类型', 'list' => []], + ['key' => 'book_cate', 'name' => '图书类型', 'list' => []], + ['key' => 'business_area', 'name' => '企业地区管理', 'list' => []], + ['key' => 'money_cate', 'name' => '收支类型', 'list' => []], + ['key' => 'welfare_cate', 'name' => '福利类型', 'list' => []], + ['key' => 'job_cate', 'name' => '工种管理', 'list' => []], ]; foreach ($list as $item) { diff --git a/lang/zh_CN/menu.php b/lang/zh_CN/menu.php index 7acf7ca..340876f 100644 --- a/lang/zh_CN/menu.php +++ b/lang/zh_CN/menu.php @@ -21,4 +21,16 @@ return [ 'organized_body' => '社别管理', 'housing_estate' => '小区管理', 'building' => '楼栋管理', + 'domicile' => '户籍管理', + 'nation' => '民族管理', + 'political_face' => '政治面貌', + 'educational_level' => '文化程度', + 'institution' => '机构管理', + 'oral_disputes' => '口头纠纷类型', + 'sanitary_inspection'=> '卫生检查类型', + 'book_cate' => '图书类型', + 'business_area' => '企业地区管理', + 'money_cate' => '收支类型', + 'welfare_cate' => '福利类型', + 'job_cate' => '工种管理', ];