添加字典管理菜单,添加机构迁移文件

main
vine_liutk 2024-01-17 01:00:19 +08:00
parent 6c763c99c8
commit f34124e307
5 changed files with 68 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class KeywordController extends AdminController
public function list(): Page
{
//区分特殊管理和通用管理
$columnsArr = [];
$columnsArr = [];$parentId = 0;
$parentName = request()->get('parent_name', '');
if(!empty($parentName)){
$parentId = Keyword::where('key', $parentName)->value('id');

View File

@ -0,0 +1,27 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use EloquentFilter\Filterable;
class Institution extends Model
{
use HasFactory;
use Filterable;
protected function serializeDate(\DateTimeInterface $date)
{
return $date->format('Y-m-d H:i:s');
}
protected $fillable = [
'name', 'code',
'parent_id', 'type_id',
'address',
'person_id',
'sort',
'remarks'
];
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('institutions', function (Blueprint $table) {
$table->id();
$table->string('name')->comment('名字');
$table->string('code')->nullable()->comment('简码');
$table->unsignedBigInteger('parent_id')->nullable()->comment('上级');
$table->unsignedBigInteger('type_id')->nullable()->comment('属性keywords.id');
$table->string('address')->nullable()->comment('地址');
$table->unsignedBigInteger('person_id')->nullable()->comment('负责人persons.id');
$table->unsignedInteger('sort')->default(0)->comment('排序');
$table->string('remarks')->nullable()->comment('备注');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('institutions');
}
};

View File

@ -27,6 +27,7 @@ class AdminMenuSeeder extends Seeder
// ['title' => 'admin_permission', 'icon' => 'carbon:user-role', 'url' => '/system/admin_permissions', 'order'=>3],
// ['title' => 'admin_menu', 'icon' => 'fluent-mdl2:permissions', 'url' => '/system/admin_menus', 'order'=>4],
['title' => 'admin_setting', 'icon' => 'akar-icons:settings-horizontal', 'url' => '/system/settings', 'order'=>5],
['title' => 'keywords', 'icon' => 'ph:codesandbox-logo-light', 'url' => '/system/keywords', 'order'=>6],//字典管理
],
],
['title' => 'data_content', 'icon' => 'ph:codesandbox-logo-light', 'url' => '', 'order'=>3,
@ -52,6 +53,7 @@ class AdminMenuSeeder extends Seeder
['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],
]

View File

@ -21,6 +21,8 @@ class KeywordSeeder extends Seeder
//标签value填写色号指定标签颜色
['key' => 'article_tag', 'name' => '文章标签', 'list' => []],
['key' => 'banner_address', 'name' => '广告位置', 'list' => []],
['key' => 'institution_cate', 'name' => '组织属性', 'list' => []],
//菜单
['key' => 'financial_cate', 'name' => '财务报表类型', 'list' => []],
['key' => 'file_cate', 'name' => '档案类型', 'list' => []],
['key' => 'department', 'name' => '部门管理', 'list' => []],