Files
account/modules/Account/database/seeders/AccountDatabaseSeeder.php
2026-01-19 14:52:08 +08:00

54 lines
2.9 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace Modules\Account\Database\Seeders;
use Illuminate\Database\Seeder;
use App\Services\Auth\MenuService;
class AccountDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$this->addAccountMenu();
}
/**
* @title 记账模块菜单导入
*
* @return void
*/
public function addAccountMenu(){
$menuService = app(MenuService::class);
$menuService->importMenu([
['title' => '账单', 'name' => 'account', 'path' => '/account', 'component' => 'account', 'type' => 'menu', 'children' => [
['title' => '账单管理', 'name' => 'account.lists', 'path' => '/account/lists', 'component' => 'account/lists', 'type' => 'menu', 'children' => [
['title' => '查看账单', 'name' => 'account.bill.view', 'path' => '', 'component' => '', 'type' => 'button'],
['title' => '添加账单', 'name' => 'account.bill.add', 'path' => '', 'component' => '', 'type' => 'button'],
['title' => '编辑账单', 'name' => 'account.bill.edit', 'path' => '', 'component' => '', 'type' => 'button'],
['title' => '删除账单', 'name' => 'account.bill.delete', 'path' => '', 'component' => '', 'type' => 'button'],
]
],
['title' => '家庭管理', 'name' => 'account.family', 'path' => '/account/family', 'component' => 'account/family', 'type' => 'menu', 'children' => [
['title' => '查看家庭', 'name' => 'account.family.view', 'path' => '', 'component' => '', 'type' => 'button'],
['title' => '添加家庭', 'name' => 'account.family.add', 'path' => '', 'component' => '', 'type' => 'button'],
['title' => '编辑家庭', 'name' => 'account.family.edit', 'path' => '', 'component' => '', 'type' => 'button'],
['title' => '删除家庭', 'name' => 'account.family.delete', 'path' => '', 'component' => '', 'type' => 'button'],
['title' => '管理成员', 'name' => 'account.family.manage', 'path' => '', 'component' => '', 'type' => 'button'],
]],
['title' => '统计报表', 'name' => 'account.statistics', 'path' => '/account/statistics', 'component' => 'account/statistics', 'type' => 'menu', 'children' => [
['title' => '查看统计', 'name' => 'account.statistics.view', 'path' => '', 'component' => '', 'type' => 'button'],
['title' => '导出报表', 'name' => 'account.statistics.export', 'path' => '', 'component' => '', 'type' => 'button'],
]],
]]], 0);
}
}