MODEL.ts.ftl 2.8 KB
Newer Older
ibizdev's avatar
ibizdev committed
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
<#ibizinclude>
../@MACRO/MODEL/MODEL_HEADER.ts.ftl
</#ibizinclude>

    /**
     * 菜单项集合
     *
     * @private
     * @type {any[]}
     * @memberof ${srfclassname('${ctrl.codeName}')}Model
     */
    private items: any[] = [
        <#list ctrl.getPSAppMenuItems() as child>
        ${P.getPartCode(child,"ITEM").code},
        </#list>
    ];

	/**
	 * 应用功能集合
	 *
	 * @private
	 * @type {any[]}
	 * @memberof ${srfclassname('${ctrl.codeName}')}Model
	 */
	private funcs: any[] = [
        <#if view.isDefaultPage?? && view.isDefaultPage()>
        <#list ctrl.getPSAppFuncs() as appFuncs>
        {
            appfunctag: '${appFuncs.getCodeName()}',
            appfuncyype: '${appFuncs.getAppFuncType()}',
            <#if appFuncs.getAppFuncType() == 'APPVIEW'>
            <#assign dataview = appFuncs.getPSAppView()/>
            openmode: '${dataview.getOpenMode()}', 
            componentname: '${srffilepath2(dataview.getCodeName())}', 
            codename: '${dataview.getCodeName()?lower_case}',
            deResParameters: [],
            <#--  BEGIN:是否应用实体视图  -->
            <#if dataview.isPSDEView()>
            <#assign appDataEntity = dataview.getPSAppDataEntity()/>
            routepath: '/${view.getCodeName()?lower_case}/:${view.getCodeName()?lower_case}?/${srfpluralize(appDataEntity.codeName)?lower_case}/:${appDataEntity.getCodeName()?lower_case}?/${dataview.getPSDEViewCodeName()?lower_case}/:${dataview.getPSDEViewCodeName()?lower_case}?',
            parameters: [
                { pathName: '${srfpluralize(appDataEntity.codeName)?lower_case}', parameterName: '${appDataEntity.getCodeName()?lower_case}' },
                { pathName: '${dataview.getPSDEViewCodeName()?lower_case}', parameterName: '${dataview.getPSDEViewCodeName()?lower_case}' },
            ],
            <#else>
            routepath: '/${view.getCodeName()?lower_case}/:${view.getCodeName()?lower_case}?/${dataview.getCodeName()?lower_case}/:${dataview.getCodeName()?lower_case}?',
            parameters: [
                { pathName: '${dataview.getCodeName()?lower_case}', parameterName: '${dataview.getCodeName()?lower_case}' },
            ],
            </#if>
            <#--  END:是否应用实体视图  -->
            </#if>
        },
        </#list>
        </#if>
	];

    /**
     * 获取所有菜单项集合
     *
     * @returns {any[]}
     * @memberof ${srfclassname('${ctrl.codeName}')}Model
     */
    public getAppMenuItems(): any[] {
        return this.items;
    }

    /**
     * 获取所有应用功能集合
     *
     * @returns {any[]}
     * @memberof ${srfclassname('${ctrl.codeName}')}Model
     */
    public getAppFuncs(): any[] {
        return this.funcs;
    }
<#ibizinclude>
../@MACRO/MODEL/MODEL_BOTTOM.ts.ftl
</#ibizinclude>