MODEL.ts.ftl 4.1 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
<#ibizinclude>
../@MACRO/MODEL/MODEL_HEADER.ts.ftl
</#ibizinclude>

	/**
	 * 是否是实体数据导出
	 *
	 * @returns {any[]}
	 * @memberof ${srfclassname('${ctrl.getCodeName()}')}${srfclassname('${ctrl.name}')}Mode
	 */
	public isDEExport: boolean = false;

	/**
	 * 获取数据项集合
	 *
	 * @returns {any[]}
	 * @memberof ${srfclassname('${ctrl.getCodeName()}')}${srfclassname('${ctrl.name}')}Mode
	 */
	public getDataItems(): any[] {
    if(this.isDEExport){
		  return [
<#--  实体导出数据项  -->
<#if ctrl.getPSDEDataExport?? && ctrl.getPSDEDataExport()?? && ctrl.getPSDEDataExport().getPSDEDataExportItems()??>
  <#list ctrl.getPSDEDataExport().getPSDEDataExportItems() as dataitem>
        {
          name: '${dataitem.getName()}',
    <#if dataitem.getPSDEField()??>
          prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
          dataType: '${dataitem.getPSDEField().getDataType()}',
30 31 32 33 34 35 36 37 38
    </#if>
    <#if ctrl.getPSDEGridEditItems()??>
    <#list ctrl.getPSDEGridEditItems() as editItem>
    <#if editItem.getName() == dataitem.getName()>
    <#if editItem.isEditable()>
          isEditable:${editItem.isEditable()?c}
    </#if>
    </#if>
    </#list>
39 40 41 42 43 44 45 46 47 48 49 50
    </#if>
        },
  </#list>
</#if>
      ]
    }else{
		  return [
<#--  表格数据项  -->
<#if ctrl.getPSDEGridDataItems()??>
  <#list ctrl.getPSDEGridDataItems() as dataitem>
        {
          name: '${dataitem.getName()}',
51 52 53
    <#if dataitem.getPSDEField()??>
          prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
          dataType: '${dataitem.getPSDEField().getDataType()}',
54 55 56
    </#if>
    <#if ctrl.getPSDEGridEditItems()??>
    <#list ctrl.getPSDEGridEditItems() as editItem>
57
    <#if editItem.getName() == dataitem.getName()>
58 59 60 61 62
    <#if editItem.isEditable()>
          isEditable:${editItem.isEditable()?c}
    </#if>
    </#if>
    </#list>
63 64 65 66 67 68 69 70 71 72 73 74 75
    </#if>
        },
  </#list>
</#if>
<#--  关联主实体的主键  -->
<#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}',
76
          prop: '<#if majorAppDataEntity.getPSDER1N?? && majorAppDataEntity.getPSDER1N()??>${majorAppDataEntity.getPSDER1N().getPSPickupDEField().getCodeName()?lower_case}<#else>${majorAppDataEntity.getKeyPSAppDEField().getCodeName()?lower_case}</#if>',
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
          dataType: 'FONTKEY',
        },
      </#if>
    </#list>
  </#if>
</#if>
<#if ctrl.getPSDEGridDataItems()??>
  <#list ctrl.getPSDEGridDataItems() as dataitem>
	<#-- 界面主键标识 -->
  <#if dataitem.getPSDEField?? && dataitem.getPSDEField()??>
	<#if !P.exists("importService", dataitem.getPSDEField().getId(), "")>
	 	<#if dataitem.getPSDEField().isKeyDEField() == true>
        {
          name: '${ctrl.getPSAppDataEntity().getCodeName()?lower_case}',
          prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
        },
	 	</#if>
	</#if>
  </#if>
  </#list>
</#if>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'MODEL_CONTENT.ts').code}
</#if>
        {
          name:'size',
103 104
          prop:'size',
          dataType: 'QUERYPARAM'
105 106 107
        },
        {
          name:'query',
108 109
          prop:'query',
          dataType: 'QUERYPARAM'
110
        },
JunZai's avatar
JunZai committed
111 112
        {
          name:'filter',
113 114
          prop:'filter',
          dataType: 'QUERYPARAM'
JunZai's avatar
JunZai committed
115
        },
116 117
        {
          name:'page',
118 119
          prop:'page',
          dataType: 'QUERYPARAM'
120 121 122
        },
        {
          name:'sort',
123 124
          prop:'sort',
          dataType: 'QUERYPARAM'
125 126 127
        },
        {
          name:'srfparentdata',
128 129
          prop:'srfparentdata',
          dataType: 'QUERYPARAM'
130 131 132 133 134 135 136 137 138 139 140 141 142 143
        },
        // 前端新增修改标识,新增为"0",修改为"1"或未设值
        {
          name: 'srffrontuf',
          prop: 'srffrontuf',
          dataType: 'TEXT',
        },
      ]
    }
  }

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