['type' => 'uBigint', 'title' => '分组Id'], 'parent_id' => ['type' => 'uBigint', 'title' => '父级分类'], 'level' => ['type' => 'integer', 'title' => '分类等级'], 'type' => ['type' => 'tinyint', 'title' => '类型', 'remark' => '1 菜单 2 目录 3 功能'], 'title' => ['type' => 'string_60', 'title' => '路由名称'], 'router_path' => ['type' => 'string_60', 'title' => '路径'], 'file_path' => ['type' => 'string', 'title' => '文件路径'], 'is_redirect' => ['type' => 'tinyint', 'title' => '是否重定向'], 'redirect_name' => ['type' => 'string_60', 'title' => '重定向路由'], 'icon' => ['type' => 'string_60', 'title' => '图标'], ]; } public function init() { Eav::table($this->schema)->insert( [ [ 'mid' => Str::random(12), 'group_id' => 1, 'parent_id' => 0, 'level' => 1, 'type' => 1, 'title' => '系统设置', 'router_path' => '/sys', 'file_path' => '', 'is_redirect' => 1, 'redirect_name' => 'web-router', 'created_at' => time(), 'updated_at' => time() ], [ 'mid' => Str::random(12), 'group_id' => 1, 'parent_id' => 1, 'level' => 2, 'type' => 1, 'title' => '管理员', 'router_path' => 'admin', 'file_path' => 'system/manager/index.vue', 'is_redirect' => 0, 'redirect_name' => '', 'created_at' => time(), 'updated_at' => time() ], [ 'mid' => Str::random(12), 'group_id' => 1, 'parent_id' => 1, 'level' => 2, 'type' => 1, 'title' => '角色管理', 'router_path' => 'admin-role', 'file_path' => 'system/role/index.vue', 'is_redirect' => 0, 'redirect_name' => '', 'created_at' => time(), 'updated_at' => time() ], [ 'mid' => Str::random(12), 'group_id' => 1, 'parent_id' => 1, 'level' => 2, 'type' => 1, 'title' => '路由设置', 'router_path' => 'web-router', 'file_path' => 'system/router/index.vue', 'is_redirect' => 0, 'redirect_name' => '', 'created_at' => time(), 'updated_at' => time() ], // [ 'mid' => Str::random(12), 'group_id' => 1, 'parent_id' => 0, 'level' => 1, 'type' => 1, 'title' => '内容管理', 'router_path' => 'con', 'file_path' => '', 'is_redirect' => 0, 'redirect_name' => 'news-list', 'created_at' => time(), 'updated_at' => time() ], [ 'mid' => Str::random(12), 'group_id' => 1, 'parent_id' => 5, 'level' => 2, 'type' => 1, 'title' => '资讯列表', 'router_path' => 'news-list', 'file_path' => 'news/list.vue', 'is_redirect' => 0, 'redirect_name' => '', 'created_at' => time(), 'updated_at' => time() ], [ 'mid' => Str::random(12), 'group_id' => 1, 'parent_id' => 5, 'level' => 2, 'type' => 1, 'title' => '资讯分类', 'router_path' => 'news-category', 'file_path' => 'news/category.vue', 'is_redirect' => 0, 'redirect_name' => '', 'created_at' => time(), 'updated_at' => time() ], [ 'mid' => Str::random(12), 'group_id' => 1, 'parent_id' => 5, 'level' => 2, 'type' => 1, 'title' => '广告列表', 'router_path' => 'position-list', 'file_path' => 'position/list.vue', 'is_redirect' => 0, 'redirect_name' => '', 'created_at' => time(), 'updated_at' => time() ], [ 'mid' => Str::random(12), 'group_id' => 1, 'parent_id' => 5, 'level' => 2, 'type' => 1, 'title' => '广告分类', 'router_path' => 'position-group', 'file_path' => 'position/group.vue', 'is_redirect' => 0, 'redirect_name' => '', 'created_at' => time(), 'updated_at' => time() ], [ 'mid' => Str::random(12), 'group_id' => 1, 'parent_id' => 5, 'level' => 2, 'type' => 1, 'title' => '文件管理', 'router_path' => 'media', 'file_path' => 'media/index.vue', 'is_redirect' => 0, 'redirect_name' => '', 'created_at' => time(), 'updated_at' => time() ], ] ); } /** * Run the database seeds. * * @return void */ public function run() { $this->schema = 'web_router'; $this->title = '路由管理表'; // $this->category_type = 2; $this->start(); } }