123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- <?php
- namespace Database\Seeders\Backend;
- use Database\Seeders\BaseSeeder;
- use Illuminate\Support\Str;
- use Txj\Elastic\Facades\Eav;
- class AdminRouterSeeder extends BaseSeeder
- {
- public function getColumnData()
- {
- return [
- 'group_id' => ['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();
- }
- }
|