LOGIC.vue.ftl 1.3 KB
Newer Older
Mosher's avatar
Mosher committed
1 2 3 4 5
    /**
     * <#if item.getPSAppDEUILogic?? && item.getPSAppDEUILogic()??>${item.getPSAppDEUILogic().name}</#if>
     *
     * @memberof ${srfclassname('${view.name}')}
     */
tony001's avatar
tony001 committed
6 7
    public ${item.name}(params: any = {}, tag?: any, $event?: any) {
        const { data, context, viewparams, xData, event } = params;
Mosher's avatar
Mosher committed
8 9 10 11
        //  合并当前激活部件
        if (xData) {
            Object.assign(this.viewCtx, { ctrl: xData, xData });
        }
Mosher's avatar
Mosher committed
12
<#if item.getPSAppDEUILogic?? && item.getPSAppDEUILogic()?? && item.getPSAppDEUILogic().getPSAppDataEntity()??>
Mosher's avatar
Mosher committed
13 14 15 16 17 18 19 20 21 22 23
        window.uiServiceRegister.getService('${item.getPSAppDEUILogic().getPSAppDataEntity().codeName?lower_case}').then((uiService: any) => {
            if (uiService) {
                uiService.executeUILogic(
                    '${item.getPSAppDEUILogic().codeName}',
                    data,
                    context,
                    viewparams,
                    event,
                    xData,
                    this,
                    context && context.srfparentdename ? context.srfparentdename : ''
Mosher's avatar
Mosher committed
24 25 26 27
                ).then(() => {
                    delete this.viewCtx['ctrl'];
                    delete this.viewCtx['xData'];
                });
Mosher's avatar
Mosher committed
28 29 30
            }
        });
</#if>        
Mosher's avatar
Mosher committed
31
    }