MODEL.ts.ftl 2.7 KB
Newer Older
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
<#ibizinclude>
../@MACRO/MODEL/MODEL_HEADER.ts.ftl
</#ibizinclude>

	/**
	 * 日历项类型
	 *
	 * @returns {any[]}
	 * @memberof ${srfclassname('${ctrl.getCodeName()}')}${srfclassname('${ctrl.name}')}Mode
	 */
	public itemType: string = "";

	/**
	 * 获取数据项集合
	 *
	 * @returns {any[]}
	 * @memberof ${srfclassname('${ctrl.getCodeName()}')}${srfclassname('${ctrl.name}')}Mode
	 */
	public getDataItems(): any[] {
     let dataItems: any = [
<#--  关联主实体的主键  -->
<#if ctrl.getPSAppDataEntity()??>
  <#assign appDataEntity = ctrl.getPSAppDataEntity() />
  <#if appDataEntity.isMajor() == false && appDataEntity.getMinorPSAppDERSs()??>
    <#list appDataEntity.getMinorPSAppDERSs() as minorAppDERSs>
      <#if minorAppDERSs.getMajorPSAppDataEntity()??>
      <#assign majorAppDataEntity = minorAppDERSs.getMajorPSAppDataEntity() />
          {
            name: '${majorAppDataEntity.getCodeName()?lower_case}',
            prop: '${majorAppDataEntity.getKeyPSAppDEField().getCodeName()?lower_case}'
          },
      </#if>
    </#list>
  </#if>
</#if>
          // 前端新增修改标识,新增为"0",修改为"1"或未设值
          {
            name: 'srffrontuf',
            prop: 'srffrontuf',
            dataType: 'TEXT',
          },
          {
JunZai's avatar
JunZai committed
43
            name: 'style',
44 45 46 47 48 49 50
          },
          {
            name: 'textColor',
          },
          {
            name: 'itemType',
          },
JunZai's avatar
JunZai committed
51 52 53
          {
            name: 'parentId'
          },
54 55 56 57 58 59
          {
            name: 'query',
            prop: 'query',
          },
      ];
      switch(this.itemType){
JunZai's avatar
JunZai committed
60
    <#--  甘特项实体映射  -->
JunZai's avatar
JunZai committed
61 62 63 64
<#if ctrl.getPSDETreeNodes()??>
  <#list ctrl.getPSDETreeNodes() as ganttItem>
    <#if ganttItem.getTreeNodeType() == "DE">
          case "${ganttItem.getNodeType()}":
65
              dataItems = [...dataItems,
JunZai's avatar
JunZai committed
66
                  <#if ganttItem.getIdPSAppDEField()??>
67
                  {
JunZai's avatar
JunZai committed
68
                    name: 'id',
JunZai's avatar
JunZai committed
69
                    prop: '${ganttItem.getIdPSAppDEField().getCodeName()?lower_case}'
70
                  },
JunZai's avatar
JunZai committed
71 72 73
                  </#if>
                  <#if ganttItem.getPSDETreeNodeDataItems()??>
                  <#list ganttItem.getPSDETreeNodeDataItems() as dataItem>
74
                  {
JunZai's avatar
JunZai committed
75 76
                    name: '<#if dataItem.getName() == 'begin'>start<#else>${dataItem.getName()?lower_case}</#if>',
                    prop: '<#if dataItem.getPSDEField()??>${dataItem.getPSDEField().getCodeName()?lower_case}</#if>'
77
                  },
JunZai's avatar
JunZai committed
78
                  </#list>
JunZai's avatar
JunZai committed
79
                  </#if>
80 81 82 83 84 85 86 87 88 89 90 91
              ];
              break;
    </#if>
  </#list>
</#if>
      }
      return dataItems;
	}

<#ibizinclude>
../@MACRO/MODEL/MODEL_BOTTOM.ts.ftl
</#ibizinclude>