dd/app/Http/Controllers/Api/Nasa/V1/SettingNavController.php
2026-06-14 17:40:56 +08:00

108 lines
3.6 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
declare(strict_types=1);
namespace App\Http\Controllers\Api\Nasa\V1;
use Illuminate\Http\Request;
use App\Http\Controllers\Api\Nasa\V1\Base\ListController;
final class SettingNavController extends ListController
{
protected string $sModelName = 'Navigation';
protected array $aFilterFields = [ // 允许where的字段不设视为全允许
// 's_name',
// 'i_status'
];
protected string $sPageName = "导航";
protected array $aListFields = [ // list展示的字段和名字映射
'id' => 'id',
'iParentId' => 'pid',
'sName' => 'name',
'sPermissionSlug' => '真slug',
'sComponentType' => '菜单类型',
'sGroup' => 'group',
'sIcon' => 'icon',
'iSort' => 'sort',
'iStatus' => '状态',
// 'sTestArticle' => '测试article',
// 'sTestJson' => '测试json',
'dtUpdatedAt'=> '更新时间',
];
protected array $aValueStyle = [ // 特定文字渲染样式
'关闭' => "<span class='text-danger'>关闭</span>",
'开启' => "<span class='text-success'>开启</span>"
];
protected array $aFieldTypes = [
// 'sTestArticle' => 'article',
// 'sTestJson' => 'json'
];
protected array $aOrderBy = [
[
"sField" => "id",
"sSort" => "desc",
],
[
"sField" => "iStatus",
"sSort" => "desc",
]
];
protected array $aJsonFields = [ // json字段
];
protected array $aDateFields = [ // date字段
'dtUpdatedAt'
];
protected array $aLenthFields = [ // 限制长度的字段
// "xx" => 100,
];
protected array $aSelectFields = [ // 作为默认select的字段
'iStatus',
'sComponentType',
];
// protected array $aValueFields = [ // 值映射
// 'sComponentType' => [
// 'TOP_BAR' => '顶级菜单',
// 'SIDEBAR_MENU' => '次级菜单',
// 'INNER_PAGE_TAB' => '页内菜单',
// ]
// ];
protected array $aCcExtFields = [
'dtCreatedAt' => '创建时间'
];
// protected array $aLimit = [3, 15, 40, 100]; // list长度第一个为默认
}
//CREATE TABLE `nasa_navigation` (
// `iId` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
// `iParentId` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '父级ID0代表顶级导航',
// `sName` varchar(64) NOT NULL COMMENT '导航菜单名称',
// `sSlug` varchar(128) NOT NULL DEFAULT '' COMMENT 'Laravel 路由别名(Route Name)',
// `sIcon` varchar(64) NOT NULL DEFAULT '' COMMENT '图标 Class/Svg 标识',
// `sGroup` varchar(128) NOT NULL DEFAULT '',
// `sComponentType` varchar(32) NOT NULL DEFAULT 'SIDEBAR_MENU' COMMENT '渲染组件类型TOP_BAR, SIDEBAR_MENU, INNER_PAGE_TAB',
// `iSort` int(11) NOT NULL DEFAULT 0 COMMENT '排序权重(数值越小越靠前)',
// `iStatus` tinyint(4) NOT NULL DEFAULT 1 COMMENT '是否可见1-显示, 0-隐藏',
// `sPermissionSlug` varchar(64) DEFAULT NULL COMMENT '权限标识(用于中间件拦截校验)',
// `dtCreatedAt` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',
// `dtUpdatedAt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT '更新时间',
// PRIMARY KEY (`iId`),
// KEY `idx_status_parent_sort` (`iStatus`,`iParentId`,`iSort`),
// KEY `idx_permission` (`sPermissionSlug`)
//) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统功能导航路由表';