<!-- 继承公共的 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">
            <div class="am-padding-sm">
                {{if !empty($data['power'])}}
                    {{foreach $data.power as $v}}
                        <div class="am-padding-bottom-sm">
                            <p>
                                <strong>{{$v.name}}</strong>
                            </p>
                            {{if !empty($v['item'])}}
                                {{foreach $v.item as $vs}}
                                    <div class="am-padding-left-lg">
                                        <p>{{$vs.name}}</p>
                                        {{if !empty($vs['power_data'])}}
                                            <ul class="am-flex am-flex-items-center am-flex-warp am-gap-1 am-margin-top-xs am-padding-bottom-sm">
                                                {{foreach $vs.power_data as $vss}}
                                                    <li class="am-padding-horizontal-sm am-padding-vertical-xs am-radius bk-cr-f8">
                                                        <div class="am-gallery-item">{{$vss}}</div>
                                                    </li>
                                                {{/foreach}}
                                            </ul>
                                        {{/if}}
                                    </div>
                                {{/foreach}}
                            {{/if}}
                        </div>
                    {{/foreach}}
                {{else /}}
                    {{:ModuleInclude('public/not_data')}}
                {{/if}}
            </div>
        </div>

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