<!-- 继承公共的 form -->
{{extend name="../../../module/view/form_table/detail" /}}

<!-- 重写数据模块 -->
{{block name="detail_data"}}
    {{:ModuleInclude('public/detail_nav_switch_tabs', [
        'nav_data' => [
            [
                'name' => MyLang('form_base_data_title'),
                'key'  => 'base',
            ],
            [
                'name' => MyLang('common_service.role.form_item_menu'),
                'key'  => 'form-item-menu',
            ],
            [
                'name' => MyLang('common_service.role.form_item_plugins'),
                'key'  => 'form-item-plugins',
            ],
        ]
    ])}}
    <div class="detail-content-switch-data-item">
        <!-- 父级内容 -->
        <div class="item am-active" data-key="base">
            {__block__}
        </div>
        
        <!-- 菜单权限 -->
        <div class="item" data-key="form-item-menu">
            <ul class="am-flex am-flex-items-center am-flex-warp am-gap-1 am-padding-sm">
                {{if !empty($data['power'])}}
                    {{foreach $data.power as $item}}
                        <li class="am-padding-horizontal-sm am-padding-vertical-xs am-radius bk-cr-f8">
                            <div class="am-gallery-item">{{$item}}</div>
                        </li>
                    {{/foreach}}
                {{else /}}
                    {{:ModuleInclude('public/not_data')}}
                {{/if}}
            </ul>
        </div>

        <!-- 插件权限 -->
        <div class="item" data-key="form-item-plugins">
            <ul class="am-flex am-flex-items-center am-flex-warp am-gap-1 am-padding-sm">
                {{if !empty($data['power_plugins'])}}
                    {{foreach $data.power_plugins as $item}}
                        <li class="am-padding-horizontal-sm am-padding-vertical-xs am-radius bk-cr-f8">
                            <div class="am-gallery-item">{{$item}}</div>
                        </li>
                    {{/foreach}}
                {{else /}}
                    {{:ModuleInclude('public/not_data')}}
                {{/if}}
            </ul>
        </div>
            
    </div>
{{/block}}