PANEL.ftl 22.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424
<#--  面板逻辑  -->
<#macro panelLogic item>
<@compress single_line=true>
<#if item.getLogicType() == 'GROUP'>
<#if item.isNotMode()>
!(
</#if>
<#if item.getPSPanelItemLogics()??>
<#list item.getPSPanelItemLogics() as subLogic>
<#if subLogic_index gt 0>
<#if item.getGroupOP() == 'AND'> 
&&
</#if>
<#if item.getGroupOP() == 'OR'>
||
</#if>
</#if>
<@panelLogic subLogic/>
</#list>
</#if>
<#if item.isNotMode()>
)
</#if>
<#elseif item.getLogicType() == 'SINGLE'>
this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp()}", "${item.getValue()}")
</#if>
</@compress>
</#macro>

<#--  面板动态逻辑  -->
<#macro panelDynamicLogic panelItems item>

    /**
     * 面板逻辑
     *
     * @public
     * @params name 改变项名称
     * @params index 多数据容器下标
     * @memberof ${srfclassname('${item.codeName}')}Base
     */
    public panelLogic(name: string, index?: number): void {
        if (name && (index || index === 0)) {
            <#noparse>name = name.replace(`_${index}`,"");</#noparse>
        }
        <#list panelItems as panelItem>
        <#if panelItem.getPSPanelItemGroupLogic('ITEMBLANK')??>
            <#assign ITEMBLANK = panelItem.getPSPanelItemGroupLogic('ITEMBLANK')/>
            if (Object.is(name, '')<#if ITEMBLANK.getRelatedItemNames()??><#list ITEMBLANK.getRelatedItemNames() as detailName> || Object.is(name, '${detailName}')</#list></#if>) {
                let ret = true;
                <#if ITEMBLANK.getRelatedItemNames()??>
                <#list ITEMBLANK.getRelatedItemNames() as detailName>
                let _${detailName} = '';
                if (index || index === 0) {
                    _${detailName} = this.layoutData[`${detailName}<#noparse>_${index}</#noparse>`];
                } else {
                    _${detailName} = this.layoutData['${detailName}'];
                }
                </#list>
                </#if>
                if (<@panelLogic ITEMBLANK/>) {
                    ret = false;
                }
                if (index || index === 0) {
                    this.layoutModelDetails[`${panelItem.name}<#noparse>_${index}</#noparse>`].required = ret;
                } else {
                    this.layoutModelDetails['${panelItem.name}'].required = ret;
                }
            }
            </#if>
            <#if panelItem.getPSPanelItemGroupLogic('ITEMENABLE')??>
            <#assign ITEMENABLE = panelItem.getPSPanelItemGroupLogic('ITEMENABLE')/>
            if (Object.is(name, '')<#if ITEMENABLE.getRelatedItemNames()??><#list ITEMENABLE.getRelatedItemNames() as detailName> || Object.is(name, '${detailName}')</#list></#if>) {
                let ret = false;
                <#if ITEMENABLE.getRelatedItemNames()??>
                <#list ITEMENABLE.getRelatedItemNames() as detailName>
                let _${detailName} = '';
                if (index || index === 0) {
                    _${detailName} = this.layoutData[`${detailName}<#noparse>_${index}</#noparse>`];
                } else {
                    _${detailName} = this.layoutData['${detailName}'];
                }
                </#list>
                </#if>
                if (<@panelLogic ITEMENABLE/>) {
                    ret = true;
                }
                if (index || index === 0) {
                    this.layoutModelDetails[`${panelItem.name}<#noparse>_${index}</#noparse>`].disabled = !ret;
                } else {
                    this.layoutModelDetails['${panelItem.name}'].disabled = !ret;
                }
            }
            </#if>
            <#if panelItem.getPSPanelItemGroupLogic('PANELVISIBLE')??>
            <#assign PANELVISIBLE = panelItem.getPSPanelItemGroupLogic('PANELVISIBLE')/>
            if (Object.is(name, '')<#if PANELVISIBLE.getRelatedItemNames()??><#list PANELVISIBLE.getRelatedItemNames() as detailName> || Object.is(name, '${detailName}')</#list></#if>) {
                let ret = false;
                <#if PANELVISIBLE.getRelatedItemNames()??>
                <#list PANELVISIBLE.getRelatedItemNames() as detailName>
                let _${detailName} = '';
                if (index || index === 0) {
                    _${detailName} = this.layoutData[`${detailName}<#noparse>_${index}</#noparse>`];
                } else {
                    _${detailName} = this.layoutData['${detailName}'];
                }
                </#list>
                </#if>
                if (<@panelLogic PANELVISIBLE/>) {
                    ret = true;
                }
                if (index || index === 0) {
                    this.layoutModelDetails[`${panelItem.name}<#noparse>_${index}</#noparse>`].visible = ret;
                } else {
                    this.layoutModelDetails['${panelItem.name}'].visible = ret;
                }
            }
            </#if>
        </#list>
    }
</#macro>

<#--  处理按钮点击  -->
<#macro handleButtonClick panelItems item>
    /**
     * 处理按钮点击
     *
     * @public
     * @memberof ${srfclassname('${item.name}')}Base
     */
    public handleButtonClick(name: string, $event?: any) {
        let datas: any[] = [];
        const data: any = this.layoutModelDetails[name].getData();
        if (data) {
            if (data instanceof Array) {
                datas = [...data];
            } else {
                datas = [data];
            }
        }
        const xData: any = this.layoutModelDetails[name].getDataArea();
        const paramJO: any = {};
        const contextJO: any = {};
        const _this: any = this;
        <#list panelItems as panelItem>
        <#if panelItem.getItemType()  == 'BUTTON' && panelItem.getPSUIAction?? && panelItem.getPSUIAction()??>
        if (Object.is(name, '${panelItem.name}')) {
            <#if panelItem.getPSUIAction().getPSAppDataEntity?? && panelItem.getPSUIAction().getPSAppDataEntity()?? && panelItem.getPSUIAction().getUIActionMode()?? && (panelItem.getPSUIAction().getUIActionMode() == "FRONT" || panelItem.getPSUIAction().getUIActionMode() == "BACKEND" || panelItem.getPSUIAction().getUIActionMode() == "WFFRONT" || panelItem.getPSUIAction().getUIActionMode() == "WFBACKEND")>
            <#assign curAppEntity = panelItem.getPSUIAction().getPSAppDataEntity() />
            window.uiServiceRegister.getService('${curAppEntity.getCodeName()?lower_case}').then((UIService: any) => {
                if (UIService && UIService[`${panelItem.getPSUIAction().getFullCodeName()}`] && UIService[`${panelItem.getPSUIAction().getFullCodeName()}`] instanceof Function) {
                    UIService[`${panelItem.getPSUIAction().getFullCodeName()}`](datas, contextJO, paramJO,  $event, xData, this, undefined);
                }
            })
            <#else>
            _this.${panelItem.getPSUIAction().getFullCodeName()}(datas, contextJO, paramJO,  $event, xData, this, undefined);
            </#if>
        }
        </#if>
        </#list>
    }
</#macro>

<#--  获取布局项模型 type-布局项类型('ITEMLAYOUT' | 'VIEWLAYOUT')  -->
<#macro getLayoutItemModel panelItems type view item>

    /**
     * 视图布局面板项模型对象
     *
     * @public
     * @memberof ${srfclassname('${item.name}')}Base
     */
    public layoutItems:any = {
        <#list panelItems as panelItem>
        <#assign detail>
        name: '${panelItem.getName()}',
        type: '${type}',
        caption: '${panelItem.getCaption()}',
        <#if panelItem.getTitleBarCloseMode?? && panelItem.getTitleBarCloseMode()??>titleBarCloseMode: ${panelItem.getTitleBarCloseMode()},</#if>
        isShowCaption: <#if panelItem.isShowCaption?? && panelItem.isShowCaption()??>${panelItem.isShowCaption()?c}</#if>,
        sysCss: '<#if panelItem.getPSSysCss?? && panelItem.getPSSysCss()??>${panelItem.getPSSysCss().getCssName()}</#if>',
        itemType: '${panelItem.getItemType()}',
        itemStyle: '${panelItem.getItemStyle()}',
        <#if panelItem.getPSSysImage?? && panelItem.getPSSysImage()??>sysImage:{
        iconcls: '<#if panelItem.getPSSysImage().getCssClass?? && panelItem.getPSSysImage().getCssClass()??>${panelItem.getPSSysImage().getCssClass()}</#if>',
        imagePath:'<#if panelItem.getPSSysImage().getImagePath?? && panelItem.getPSSysImage().getImagePath()??>${panelItem.getPSSysImage().getImagePath()}</#if>',
        rawContent: '<#if panelItem.getPSSysImage().getRawContent?? && panelItem.getPSSysImage().getRawContent()??>${panelItem.getPSSysImage().getRawContent()}</#if>'
        },</#if> 
        visible: <#if panelItem.getPSPanelItemGroupLogic('PANELVISIBLE')??>false<#else>true</#if>,
        disabled: false,
        layout:'<#if panelItem.getPSLayout?? && panelItem.getPSLayout()?? && panelItem.getPSLayout().getLayout?? && panelItem.getPSLayout().getLayout()??>${panelItem.getPSLayout().getLayout()}</#if>',
        layoutPos:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getLayoutPos?? && panelItem.getPSLayoutPos().getLayoutPos()??>${panelItem.getPSLayoutPos().getLayoutPos()}</#if>',
        layoutHeight:<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getHeight?? && panelItem.getPSLayoutPos().getHeight()??>${panelItem.getPSLayoutPos().getHeight()}<#else>0</#if>,
        heightMode:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getHeightMode?? && panelItem.getPSLayoutPos().getHeightMode()??>${panelItem.getPSLayoutPos().getHeightMode()}</#if>',
        layoutWidth:<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getWidth?? && panelItem.getPSLayoutPos().getWidth()??>${panelItem.getPSLayoutPos().getWidth()}<#else>0</#if>,
        widthMode:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getWidthMode?? && panelItem.getPSLayoutPos().getWidthMode()??>${panelItem.getPSLayoutPos().getWidthMode()}</#if>',
        spacingBottom:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getSpacingBottom?? && panelItem.getPSLayoutPos().getSpacingBottom()??>${panelItem.getPSLayoutPos().getSpacingBottom()}</#if>',
        spacingLeft:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getSpacingLeft?? && panelItem.getPSLayoutPos().getSpacingLeft()??>${panelItem.getPSLayoutPos().getSpacingLeft()}</#if>',
        spacingRight:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getSpacingRight?? && panelItem.getPSLayoutPos().getSpacingRight()??>${panelItem.getPSLayoutPos().getSpacingRight()}</#if>',
        spacingTop:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getSpacingTop?? && panelItem.getPSLayoutPos().getSpacingTop()??>${panelItem.getPSLayoutPos().getSpacingTop()}</#if>',
        hAlignSelf:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getHAlignSelf?? && panelItem.getPSLayoutPos().getHAlignSelf()??>${panelItem.getPSLayoutPos().getHAlignSelf()}</#if>',
        vAlignSelf:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getVAlignSelf?? && panelItem.getPSLayoutPos().getVAlignSelf()??>${panelItem.getPSLayoutPos().getVAlignSelf()}</#if>',
        flexGrow:<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getGrow?? && panelItem.getPSLayoutPos().getGrow()??>${panelItem.getPSLayoutPos().getGrow()}<#else>0</#if>,
        flexParams:{align:'<#if panelItem.getFlexAlign?? && panelItem.getFlexAlign()??>${panelItem.getFlexAlign()}</#if>',dir:'<#if panelItem.getFlexDir?? && panelItem.getFlexDir()??>${panelItem.getFlexDir()}</#if>',vAlign:'<#if panelItem.getFlexVAlign?? && panelItem.getFlexVAlign()??>${panelItem.getFlexVAlign()}</#if>'},
        <#if panelItem.getParentPSPanelItem?? && panelItem.getParentPSPanelItem()??>
        parentName: '${panelItem.getParentPSPanelItem().getName()}',
        </#if>
        panel: this
        </#assign>
        <#if panelItem.getItemType()  == 'CONTAINER'>
        <@compress  single_line=true>${panelItem.name}:{ ${detail}
        <#if panelItem.getPSPanelItems()??>, 
        details:[<#list panelItem.getPSPanelItems() as childPanelItem>'${childPanelItem.getName()}'<#if childPanelItem_has_next>,</#if></#list>]
        </#if>
        <#if panelItem.getDataRegionType()??>,
        dataRegionType: '${panelItem.getDataRegionType()}'
        </#if>
        <#if panelItem.getDataSourceType()??>,
        dataSourceType: '${panelItem.getDataSourceType()}'
        </#if>
        <#if panelItem.getPSAppDataEntity?? && panelItem.getPSAppDataEntity()??>,
        appDataEntityCodeName: '${panelItem.getPSAppDataEntity().getCodeName()?lower_case}'
        </#if>
        <#if panelItem.getPSAppDEMethod?? && panelItem.getPSAppDEMethod()??>,
        appDEMethodCodeName: '${panelItem.getPSAppDEMethod().getCodeName()}'
        </#if>
        }<#if panelItem_has_next>,</#if></@compress>
        <#elseif panelItem.getItemType()  == 'RAWITEM'>
        <#assign rawItem>
        viewType: '${view.getViewType()}',
        predefinedType: '${panelItem.getPSRawItem().getPredefinedType()}',
        contentType: '${panelItem.getPSRawItem().getContentType()}',
        contentStyle: '${panelItem.getPSRawItem().getCssStyle()}',
        rawContent: '<#if panelItem.getRawContent?? && panelItem.getRawContent()??>${panelItem.getRawContent()}</#if>',
        htmlContent: '<#if panelItem.getHtmlContent?? && panelItem.getHtmlContent()??>${panelItem.getHtmlContent()}</#if>',
        <#if panelItem.getPSRawItem().getRenderMode?? && panelItem.getPSRawItem().getRenderMode()??>
        renderMode: '${panelItem.getPSRawItem().getRenderMode()}',
        </#if>
        <#if panelItem.getPSRawItem()?? && panelItem.getPSRawItem().getWrapMode?? && panelItem.getPSRawItem().getWrapMode()??>
        wrapMode:'${panelItem.getPSRawItem().getWrapMode()}',
        </#if>
        <#if panelItem.getPSRawItem()?? && panelItem.getPSRawItem().getVAlign?? && panelItem.getPSRawItem().getVAlign()??>
        vAlign:'${panelItem.getPSRawItem().getVAlign()}',
        </#if>
        <#if panelItem.getPSRawItem()?? && panelItem.getPSRawItem().getHAlign?? && panelItem.getPSRawItem().getHAlign()??>
        hAlign:'${panelItem.getPSRawItem().getHAlign()}',
        </#if>
        </#assign>
        <@compress  single_line=true>${panelItem.name}:{ ${detail}, ${rawItem} }<#if panelItem_has_next>,</#if></@compress>
        <#elseif panelItem.getItemType()  == 'FIELD'>
        <#assign field>
        required: <#if panelItem.isAllowEmpty()>false<#else>true</#if>,
        <#if panelItem.getFieldStates?? && panelItem.getFieldStates()??>
        fieldState: '${panelItem.getFieldStates()}',
        </#if>
        <#if panelItem.getPSEditor?? && panelItem.getPSEditor()??>
        <#if panelItem.getPSEditor().getPredefinedType?? && panelItem.getPSEditor().getPredefinedType()??>
        predefinedType: '${panelItem.getPSEditor().getPredefinedType()}',
        </#if>
        <#if panelItem.getPSEditor().getRenderMode?? && panelItem.getPSEditor().getRenderMode()??>
        renderMode: '${panelItem.getPSEditor().getRenderMode()}',
        </#if>
        </#if>
        <#if panelItem.getViewFieldName?? && panelItem.getViewFieldName()??>
        dataItemName:'${panelItem.getViewFieldName()}',
        </#if>
        <#if panelItem.getEditorType?? && panelItem.getEditorType()?? && (panelItem.getEditorType() == "SPAN")>
        <#if panelItem.getPSEditor?? && panelItem.getPSEditor()??>
        <#assign panelEditor = panelItem.getPSEditor() />
        <#if panelEditor.getWrapMode?? && panelEditor.getWrapMode()??>
        wrapMode:'${panelEditor.getWrapMode()}',
        </#if>
        <#if panelEditor.getVAlign?? && panelEditor.getVAlign()??>
        vAlign:'${panelEditor.getVAlign()}',
        </#if>
        <#if panelEditor.getHAlign?? && panelEditor.getHAlign()??>
        hAlign:'${panelEditor.getHAlign()}',
        </#if>
        </#if>
        </#if>
        </#assign>
        <@compress  single_line=true>${panelItem.name}:{ ${detail}, ${field} }<#if panelItem_has_next>,</#if></@compress>
        <#elseif panelItem.getItemType()  == 'CONTROL'>
        <@compress  single_line=true>${panelItem.name}:{ ${detail} }<#if panelItem_has_next>,</#if></@compress>
        <#elseif panelItem.getItemType()  == 'BUTTON'>
        <#assign button>
        <#if view.getXDataControlName?? && view.getXDataControlName()?? && view.getXDataControlName() != ''>
        xDataControlName: '${view.getXDataControlName()}',
        </#if>
        <#if panelItem.getButtonStyle?? && panelItem.getButtonStyle()??>
        buttonStyle: '${panelItem.getButtonStyle()}',
        </#if>
        <#if panelItem.getBorderStyle?? && panelItem.getBorderStyle()??>
        borderStyle: '${panelItem.getBorderStyle()}',
        </#if>
        iconAlign: '${panelItem.getIconAlign()}',
        <#if panelItem.getPSUIAction?? && panelItem.getPSUIAction()??>
        <#assign uiAction = panelItem.getPSUIAction()/>
        uiAction: { actiontarget: '<#if uiAction.getActionTarget()??>${uiAction.getActionTarget()}</#if>', <#if uiAction.getAppNoPrivDisplayMode()??>noprivdisplaymode: ${uiAction.getAppNoPrivDisplayMode()}</#if>, dataaccaction: '<#if uiAction.getDataAccessAction()??>${uiAction.getDataAccessAction()}</#if>', visabled: true, disabled: false },
        <#if uiAction.getPredefinedType?? && uiAction.getPredefinedType()??>
        predefinedType: '${uiAction.getPredefinedType()}',
        </#if>
        </#if>
        <#if panelItem.getRenderMode?? && panelItem.getRenderMode()??>
        renderMode: '${panelItem.getRenderMode()}',
        </#if>
        </#assign>
        <@compress  single_line=true>${panelItem.name}:{ ${detail}, ${button} }<#if panelItem_has_next>,</#if></@compress>
        <#elseif panelItem.getItemType()  == 'USERCONTROL'>
        <@compress  single_line=true>${panelItem.name}:{ ${detail} }<#if panelItem_has_next>,</#if></@compress>
        <#elseif panelItem.getItemType()  == 'TABPANEL'>
        <@compress  single_line=true>${panelItem.name}:{ ${detail}<#if panelItem.getPSPanelTabPages()??>, 
        details:[<#list panelItem.getPSPanelTabPages() as tabpage>'${tabpage.getName()}'<#if tabpage_has_next>,</#if></#list>]</#if> }<#if panelItem_has_next>,</#if></@compress>
        <#elseif panelItem.getItemType()  == 'CTRLPOS'>
        <@compress  single_line=true>${panelItem.name}:{ ${detail} }<#if panelItem_has_next>,</#if></@compress>
        <#elseif panelItem.getItemType()  == 'TABPAGE'>
        <@compress  single_line=true>${panelItem.name}:{ ${detail}<#if panelItem.getPSPanelItems()??>, 
        details:[<#list panelItem.getPSPanelItems() as childPanelItem>'${childPanelItem.getName()}'<#if childPanelItem_has_next>,</#if></#list>]</#if>}<#if panelItem_has_next>,</#if></@compress>
        </#if>
    </#list> 
    }
</#macro>

<#macro initLayout item>
    /**
     * 布局面板是否加载
     *
     * @public
     * @memberof ${srfclassname('${item.name}')}Base
     */
    public isLayoutLoadding: boolean = false;

    /**
     * 布局面板数据
     *
     * @public
     * @memberof ${srfclassname('${item.name}')}Base
     */
    public layoutData:any = {};

    /**
     * 布局面板模型对象
     *
     * @public
     * @memberof ${srfclassname('${item.name}')}Base
     */
    public layoutModelDetails:any = {};

    /**
     *  初始化布局
     *
     *  @public
     *  @memberof ${srfclassname('${item.name}')}Base
     */
    public async initLayout() {
        if (this.rootLayoutDetailNames.length > 0) {
            for (let i = 0; i < this.rootLayoutDetailNames.length; i++) {
                const name = this.rootLayoutDetailNames[i];
                const rootItem = this.layoutItems[name];
                if (!rootItem) {
                    return;
                }
                await this.initLayoutItem(rootItem);
            }
        }
        return true;
    }

    /**
     *  初始化布局项
     *
     *  @public
     *  @memberof ${srfclassname('${item.name}')}Base
     */
    public async initLayoutItem(layoutModelItem: any, index: number = 0) {
        const { name } = layoutModelItem;
        const layoutModelDetail = Util.getLayoutItemInstance(layoutModelItem);
        if (!index) {
            await layoutModelDetail.load(this.context, this.viewparams);
            this.$set(this.layoutModelDetails, name, layoutModelDetail);
            this.$set(this.layoutData, name, layoutModelDetail.getData());
        } else {
            layoutModelDetail.setIndex(index);
            await layoutModelDetail.load(this.context, this.viewparams);
            <#noparse>this.$set(this.layoutModelDetails, `${name}_${index}`, layoutModelDetail);</#noparse>
            <#noparse>this.$set(this.layoutData, `${name}_${index}`, layoutModelDetail.getData());</#noparse>
        }
        if (layoutModelDetail && layoutModelDetail.details) {
            if (layoutModelDetail.dataRegionType === 'MULTIDATA') {
                const multiData = layoutModelDetail.getData();
                if (multiData && multiData.length > 0) {
                    for (let i = 0; i < multiData.length; i++) {
                        for (let j = 0; j < layoutModelDetail.details.length; j++) {
                            const key = layoutModelDetail.details[j];
                            if (this.layoutItems[key]) {
                                await this.initLayoutItem(this.layoutItems[key], i);
                            }
                        }
                    }
                }
            } else {
                for (let i = 0; i < layoutModelDetail.details.length; i++) {
                    const key = layoutModelDetail.details[i];
                    if (this.layoutItems[key]) {
                        await this.initLayoutItem(this.layoutItems[key],index);
                    }
                }
            }
        }
    }

    /**
     * 计算面板按钮权限状态
     *
     * @public
     * @memberof ${srfclassname('${item.name}')}Base
     */
    public computeButtonAuthState() {
        Object.values(this.layoutModelDetails).forEach((layoutModel: any) => {
            if (layoutModel.itemType == 'BUTTON') {
                layoutModel.computeActionAuthState();
            }
        })
    }
</#macro>