|
|
|
@ -6,6 +6,8 @@ use Illuminate\Database\Console\Seeds\WithoutModelEvents; |
|
|
|
use Illuminate\Database\Seeder; |
|
|
|
use Illuminate\Support\Facades\DB; |
|
|
|
|
|
|
|
use function Illuminate\Events\queueable; |
|
|
|
|
|
|
|
class AdminMenuSeeder extends Seeder |
|
|
|
{ |
|
|
|
/** |
|
|
|
@ -19,158 +21,313 @@ class AdminMenuSeeder extends Seeder |
|
|
|
|
|
|
|
private function data(): array |
|
|
|
{ |
|
|
|
$not_datetime = date("Y-m-d H:i:s", time()); |
|
|
|
$data = []; |
|
|
|
|
|
|
|
$array = $this->returnArray(); |
|
|
|
$id = 0; |
|
|
|
foreach ($array as $key => $value) { |
|
|
|
$id += 1; |
|
|
|
$data[] = $this->insertData($id, $key, 1); |
|
|
|
if (is_array($value)) { |
|
|
|
foreach ($value as $k => $v) { |
|
|
|
$parent_id = $id; |
|
|
|
$id += 1; |
|
|
|
$data[] = $this->insertData($id, $k, 1, $parent_id, $v['uri']); |
|
|
|
|
|
|
|
$order = 0; |
|
|
|
foreach ($v['child'] as $title => $uri) { |
|
|
|
$parent_id = $id; |
|
|
|
$id += 1; |
|
|
|
$data[] = $this->insertData($id, $title, 0, $parent_id, $uri, $order); |
|
|
|
$order += 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return $data; |
|
|
|
} |
|
|
|
|
|
|
|
private function returnArray():array |
|
|
|
{ |
|
|
|
return [ |
|
|
|
[ |
|
|
|
'id' => 1, |
|
|
|
'parent_id' => 0, |
|
|
|
'order' => 0, |
|
|
|
'title' => '模式管理', |
|
|
|
'icon' => '', |
|
|
|
'model_manage' => [ |
|
|
|
'event_calendar' => [ |
|
|
|
'uri' => '', |
|
|
|
'show' => 1, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 2, |
|
|
|
'parent_id' => 0, |
|
|
|
'order' => 0, |
|
|
|
'title' => '车位状态', |
|
|
|
'icon' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '', |
|
|
|
'add' => '', |
|
|
|
'edit' => '', |
|
|
|
'import' => '', |
|
|
|
'export' => '', |
|
|
|
'delete' => '', |
|
|
|
'batch_delete' => '', |
|
|
|
'download_template' => '', |
|
|
|
'end' => '' |
|
|
|
] |
|
|
|
], |
|
|
|
'model_manage' => [ |
|
|
|
'uri' => '', |
|
|
|
'show' => 1, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 3, |
|
|
|
'parent_id' => 0, |
|
|
|
'order' => 0, |
|
|
|
'title' => '特别车位管理', |
|
|
|
'icon' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '', |
|
|
|
'add' => '', |
|
|
|
'edit' => '', |
|
|
|
'batch_import' => '', |
|
|
|
'view_details' => '', |
|
|
|
'download_template' => '', |
|
|
|
'reserved_parking' => '', |
|
|
|
'departure_reminder' => '', |
|
|
|
'add_parking_space' => '', |
|
|
|
'edit_parking_space' => '', |
|
|
|
'delete_parking_space' => '' |
|
|
|
] |
|
|
|
] |
|
|
|
], |
|
|
|
'cat_status' => [ |
|
|
|
'cat_map' => [ |
|
|
|
'uri' => '', |
|
|
|
'show' => 1, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 4, |
|
|
|
'parent_id' => 0, |
|
|
|
'order' => 0, |
|
|
|
'title' => '信息中心', |
|
|
|
'icon' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '', |
|
|
|
'view' => '' |
|
|
|
] |
|
|
|
], |
|
|
|
'cat_list' => [ |
|
|
|
'uri' => '', |
|
|
|
'show' => 1, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 5, |
|
|
|
'parent_id' => 0, |
|
|
|
'order' => 0, |
|
|
|
'title' => '统计报表', |
|
|
|
'icon' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '', |
|
|
|
'add_new_energy' => '', |
|
|
|
'delete_new_energy' => '' |
|
|
|
] |
|
|
|
], |
|
|
|
'cat_type' => [ |
|
|
|
'uri' => 'spaceType', |
|
|
|
'child' => [ |
|
|
|
'read_only' => 'spaceType.index', |
|
|
|
'add' => 'spaceType.store', |
|
|
|
'delete' => 'spaceType.delete', |
|
|
|
'view_details' => 'spaceType.show', |
|
|
|
'edit' => 'spaceType.update', |
|
|
|
'download_template' => '', |
|
|
|
'license_plate_management' => 'licensePlate.index', |
|
|
|
'batch_import' => '', |
|
|
|
'add_license_plate' => 'licensePlate.store', |
|
|
|
'delete_license_plate' => 'licensePlate.destroy', |
|
|
|
'edit_license_plate' => 'licensePlate.update', |
|
|
|
'clear_license_plate' => '' |
|
|
|
] |
|
|
|
], |
|
|
|
'cat_attr' => [ |
|
|
|
'uri' => 'spaceAttr', |
|
|
|
'child' => [ |
|
|
|
'read_only' => 'spaceAttr.index', |
|
|
|
'add' => 'spaceAttr.store', |
|
|
|
'edit' => 'spaceAttr.update', |
|
|
|
'delete' => 'spaceAttr.destroy' |
|
|
|
] |
|
|
|
], |
|
|
|
'draw_map' => [ |
|
|
|
'uri' => '', |
|
|
|
'show' => 1, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 6, |
|
|
|
'parent_id' => 0, |
|
|
|
'order' => 0, |
|
|
|
'title' => '设备管理', |
|
|
|
'icon' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '' |
|
|
|
] |
|
|
|
], |
|
|
|
'parking_information' => [ |
|
|
|
'uri' => '', |
|
|
|
'show' => 1, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 7, |
|
|
|
'parent_id' => 0, |
|
|
|
'order' => 0, |
|
|
|
'title' => '系统管理', |
|
|
|
'icon' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '', |
|
|
|
'add' => '', |
|
|
|
'clear' => '', |
|
|
|
'delete' => '' |
|
|
|
] |
|
|
|
] |
|
|
|
], |
|
|
|
'special_car_manage' => [ |
|
|
|
'vip_list' => [ |
|
|
|
'uri' => 'vipList', |
|
|
|
'child' => [ |
|
|
|
'read_only' => 'vipList.index', |
|
|
|
'add' => 'vipList.store', |
|
|
|
'edit' => 'vipList.update', |
|
|
|
'delete' => 'vipList.destroy', |
|
|
|
'import' => 'vipList.import', |
|
|
|
'export' => 'vipList.export', |
|
|
|
'download_template' => 'vipList.importTemplate' |
|
|
|
] |
|
|
|
], |
|
|
|
'vip_access_record' => [ |
|
|
|
'uri' => 'vipAccessRecord', |
|
|
|
'child' => [ |
|
|
|
'read_only' => 'vipAccessRecord.index', |
|
|
|
'view_details' => 'vipAccessRecord.show' |
|
|
|
] |
|
|
|
] |
|
|
|
], |
|
|
|
'information_center' => [ |
|
|
|
'alarm_notice' => [ |
|
|
|
'uri' => '', |
|
|
|
'show' => 1, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 8, |
|
|
|
'parent_id' => 0, |
|
|
|
'order' => 0, |
|
|
|
'title' => '用户管理', |
|
|
|
'icon' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '', |
|
|
|
'view_details' => '', |
|
|
|
'export' => '', |
|
|
|
'alarm_settings' => '' |
|
|
|
] |
|
|
|
] |
|
|
|
], |
|
|
|
'gate_management' => [ |
|
|
|
'stop_on_duty' => [ |
|
|
|
'uri' => '', |
|
|
|
'show' => 1, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 9, |
|
|
|
'parent_id' => 8, |
|
|
|
'order' => 0, |
|
|
|
'title' => '用户列表', |
|
|
|
'icon' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '' |
|
|
|
] |
|
|
|
], |
|
|
|
'lane_video' => [ |
|
|
|
'uri' => '', |
|
|
|
'show' => 1, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 10, |
|
|
|
'parent_id' => 8, |
|
|
|
'order' => 0, |
|
|
|
'title' => '角色管理', |
|
|
|
'icon' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '' |
|
|
|
] |
|
|
|
] |
|
|
|
], |
|
|
|
'statistics_report' => [ |
|
|
|
'recognition_rate' => [ |
|
|
|
'uri' => '', |
|
|
|
'show' => 1, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 11, |
|
|
|
'parent_id' => 9, |
|
|
|
'order' => 0, |
|
|
|
'title' => '只读', |
|
|
|
'icon' => '', |
|
|
|
'uri' => 'users.index', |
|
|
|
'show' => 0, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 12, |
|
|
|
'parent_id' => 9, |
|
|
|
'order' => 0, |
|
|
|
'title' => '查看', |
|
|
|
'icon' => '', |
|
|
|
'uri' => 'users.show', |
|
|
|
'show' => 0, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 13, |
|
|
|
'parent_id' => 9, |
|
|
|
'order' => 0, |
|
|
|
'title' => '添加', |
|
|
|
'icon' => '', |
|
|
|
'uri' => 'users.store', |
|
|
|
'show' => 0, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 14, |
|
|
|
'parent_id' => 9, |
|
|
|
'order' => 0, |
|
|
|
'title' => '编辑', |
|
|
|
'icon' => '', |
|
|
|
'uri' => 'users.update', |
|
|
|
'show' => 0, |
|
|
|
'created_at' => $not_datetime |
|
|
|
], |
|
|
|
[ |
|
|
|
'id' => 15, |
|
|
|
'parent_id' => 9, |
|
|
|
'order' => 0, |
|
|
|
'title' => '删除', |
|
|
|
'icon' => '', |
|
|
|
'uri' => 'users.destroy', |
|
|
|
'show' => 0, |
|
|
|
'created_at' => $not_datetime |
|
|
|
'child' => [ |
|
|
|
'read_only' => '', |
|
|
|
'export' => '' |
|
|
|
] |
|
|
|
], |
|
|
|
'parking_behavior' => [ |
|
|
|
'uri' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '', |
|
|
|
'export' => '', |
|
|
|
'view_details' => '' |
|
|
|
] |
|
|
|
], |
|
|
|
'utilization_rate' => [ |
|
|
|
'uri' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '', |
|
|
|
'export' => '' |
|
|
|
] |
|
|
|
], |
|
|
|
'occupancy_rate' => [ |
|
|
|
'uri' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '', |
|
|
|
'export' => '' |
|
|
|
] |
|
|
|
], |
|
|
|
'manual_correction' => [ |
|
|
|
'uri' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '', |
|
|
|
'view_details' => '', |
|
|
|
'export' => '' |
|
|
|
] |
|
|
|
] |
|
|
|
], |
|
|
|
'system_log' => [ |
|
|
|
'system_log' => [ |
|
|
|
'uri' => 'operationLog', |
|
|
|
'child' => [ |
|
|
|
'read_only' => 'operationLog.index', |
|
|
|
'export' => 'operationLog.export' |
|
|
|
] |
|
|
|
] |
|
|
|
], |
|
|
|
'device_manage' => [ |
|
|
|
'camera_management' => [ |
|
|
|
'uri' => '', |
|
|
|
'child' => [ |
|
|
|
'read_only' => '', |
|
|
|
'add' => '', |
|
|
|
'edit' => '', |
|
|
|
'delete' => '', |
|
|
|
'import' => '', |
|
|
|
'export' => '', |
|
|
|
'debug' => '', |
|
|
|
'download_template' => '' |
|
|
|
] |
|
|
|
] |
|
|
|
], |
|
|
|
'system_manage' => [ |
|
|
|
'total_configuration' => [ |
|
|
|
'uri' => 'config', |
|
|
|
'child' => [ |
|
|
|
'read_only' => 'config.index', |
|
|
|
'edit' => 'config.update' |
|
|
|
] |
|
|
|
], |
|
|
|
'floor_plan' => [ |
|
|
|
'uri' => 'floors', |
|
|
|
'child' => [ |
|
|
|
'read_only' => 'floors.index', |
|
|
|
'add_floor' => 'floors.store', |
|
|
|
'edit_floor' => 'floors.update', |
|
|
|
'delete' => 'floors.destroy' |
|
|
|
] |
|
|
|
], |
|
|
|
'translation' => [ |
|
|
|
'uri' => 'translations', |
|
|
|
'child' => [ |
|
|
|
'read_only' => 'translations.index', |
|
|
|
'add' => 'translations.store', |
|
|
|
'edit' => 'translations.update', |
|
|
|
'delete' => 'translations.destroy' |
|
|
|
] |
|
|
|
] |
|
|
|
], |
|
|
|
'user_manage' => [ |
|
|
|
'user_list' => [ |
|
|
|
'uri' => 'users', |
|
|
|
'child' => [ |
|
|
|
'read_only' => 'users.index', |
|
|
|
'add' => 'users.store', |
|
|
|
'edit' => 'users.update', |
|
|
|
'delete' => 'users.destroy' |
|
|
|
] |
|
|
|
], |
|
|
|
'role_manage' => [ |
|
|
|
'uri' => 'roles', |
|
|
|
'child' => [ |
|
|
|
'read_only' => 'roles.index', |
|
|
|
'add' => 'roles.store', |
|
|
|
'view' => 'roles.show', |
|
|
|
'edit' => 'roles.update', |
|
|
|
'delete' => 'roles.destroy' |
|
|
|
] |
|
|
|
] |
|
|
|
] |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param int $id |
|
|
|
* @param string $title |
|
|
|
* @param int $show |
|
|
|
* @param int $parent_id |
|
|
|
* @param string $uri |
|
|
|
* @param int $order |
|
|
|
* @return array |
|
|
|
*/ |
|
|
|
private function insertData( |
|
|
|
int $id, |
|
|
|
string $title, |
|
|
|
int $show = 0, |
|
|
|
int $parent_id = 0, |
|
|
|
string $uri = '#', |
|
|
|
int $order = 0 |
|
|
|
): array { |
|
|
|
return [ |
|
|
|
'id' => $id, |
|
|
|
'parent_id' => $parent_id, |
|
|
|
'order' => $order, |
|
|
|
'title' => $title, |
|
|
|
'icon' => '', |
|
|
|
'uri' => $uri, |
|
|
|
'show' => $show, |
|
|
|
'created_at' => date("Y-m-d H:i:s", time()) |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
|