LOGIC.vue.ftl 3.2 KB
Newer Older
ibizdev's avatar
ibizdev committed
1
<#ibizinclude>../../@MACRO/View.ftl</#ibizinclude>
2
<#ibizinclude>../../../@NAVPARAMS/FUNC/PUBLIC.vue.ftl</#ibizinclude>
ibizdev's avatar
ibizdev committed
3 4 5 6 7 8 9 10 11 12 13 14 15
<#if item.getPSAppView()??>

/**
 * ${item.getName()}
 *
 * @param {*} [item={}]
 * @memberof ${srfclassname('${ctrl.codeName}')}
 */
<#assign dataview = item.getPSAppView()/>
protected click${item.codeName}(item: any = {}) {
    <#if dataview.isRedirectView()>
    this.$notify({ type: 'warning', message: '重定向视图暂不支持应用功能打开' });
    <#else>
KK's avatar
KK committed
16 17
    let navigateParam: any = <@getNavigateParams item />;
    let navigateContext: any = <@getNavigateContext item />;
KK's avatar
KK committed
18 19 20
    const { param: _param, context: _context } = this.$viewTool.formatNavigateParam(navigateContext, navigateParam, this.context, this.viewparams, {});
    let context = { ..._context };
    let param = { ..._param };
21
<#if dataview.getOpenMode() == 'POPUPMODAL' || dataview.getOpenMode() == 'POPUPAPP' || dataview.getOpenMode() == 'POPOVER' || dataview.getOpenMode()?index_of('DRAWER') == 0 >
ibizdev's avatar
ibizdev committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
<@outPutViewInfo dataview/>
</#if>
        <#if dataview.getOpenMode() == 'INDEXVIEWTAB' || dataview.getOpenMode() == ''>
    const deResParameters: any[] = [];
            <#--  BEGIN:准备参数  -->
            <#--  BEGIN:是否应用实体视图  -->
            <#if dataview.isPSDEView()>
                <#if dataview.getPSAppDataEntity()??>
                <#assign appDataEntity = dataview.getPSAppDataEntity()/>
    const parameters: any[] = [
        { pathName: '${srfpluralize(appDataEntity.codeName)?lower_case}', parameterName: '${appDataEntity.getCodeName()?lower_case}' },
        { pathName: '${dataview.getPSDEViewCodeName()?lower_case}', parameterName: '${dataview.getPSDEViewCodeName()?lower_case}' },
    ];
                <#else>
    const parameters: any[] = [];
    throw new Error('实体 ${dataview.getPSDataEntity().getCodeName()} 未添加到应用中');
                </#if>
            <#else>
    const parameters: any[] = [
        { pathName: '${dataview.getCodeName()?lower_case}', parameterName: '${dataview.getCodeName()?lower_case}' },
    ];
            </#if>
            <#--  END:是否应用实体视图  -->
            <#--  END:准备参数  -->
KK's avatar
KK committed
46
    const routeParam: any = this.globaluiservice.openService.formatRouteParam(context, deResParameters, parameters, [], param);
ibizdev's avatar
ibizdev committed
47 48 49 50 51 52
    this.globaluiservice.openService.openView(routeParam);
        </#if>
        <#if dataview.getOpenMode() == 'POPUP'>
    console.log('-----POPUP-----非模式弹出,暂时不实现');
        </#if>
        <#if dataview.getOpenMode() == 'POPUPMODAL'>
KK's avatar
KK committed
53
    this.globaluiservice.openService.openModal(view, context, param);
ibizdev's avatar
ibizdev committed
54 55 56 57 58
        </#if>
        <#if dataview.getOpenMode() == 'POPUPAPP'>
    console.log('-----POPUPAPP-----独立程序弹出,暂时不实现');
        </#if>
        <#if dataview.getOpenMode()?index_of('DRAWER') == 0>
KK's avatar
KK committed
59
    this.globaluiservice.openService.openDrawer(view, context, param);
ibizdev's avatar
ibizdev committed
60 61
        </#if>
        <#if dataview.getOpenMode() == 'POPOVER'>
KK's avatar
KK committed
62
    this.globaluiservice.openService.openPopOver(view, context, param);
ibizdev's avatar
ibizdev committed
63 64 65 66 67 68 69
        </#if>
        <#if dataview.getOpenMode()?index_of('USER') == 0>
    console.log('-----${dataview.getOpenMode()}-----用户自定义');
        </#if>
    </#if>
}
</#if>