MODEL.ts.ftl 2.7 KB
Newer Older
1
// 基于 @CONTROL/列表/MODEL.ts.ftl 生成
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<#ibizinclude>
../@MACRO/MODEL/MODEL_HEADER.ts.ftl
</#ibizinclude>

	/**
	 * 获取数据项集合
	 *
	 * @returns {any[]}
	 * @memberof ${srfclassname('${ctrl.getCodeName()}')}${srfclassname('${ctrl.name}')}Mode
	 */
	public getDataItems(): any[] {
		return [
<#--  列表数据项  -->
<#if ctrl.getPSListDataItems()??>
  <#list ctrl.getPSListDataItems() as dataitem>
			{
				name: '${dataitem.getName()}',
    <#if dataitem.getPSDEField()??>
				prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
				dataType: '${dataitem.getPSDEField().getDataType()}',
tony001's avatar
tony001 committed
22 23 24 25
    </#if>
    <#if dataitem.getFrontPSCodeList?? && dataitem.getFrontPSCodeList()??>
        <#assign codelist=dataitem.getFrontPSCodeList() />
        codelist:{tag:'${codelist.codeName}',codelistType:'${codelist.getCodeListType()}'},
26 27 28 29 30 31 32 33 34 35 36 37 38
    </#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}',
39
				prop: '<#if majorAppDataEntity.getPSDER1N?? && majorAppDataEntity.getPSDER1N()??>${majorAppDataEntity.getPSDER1N().getPSPickupDEField().getCodeName()?lower_case}<#else>${majorAppDataEntity.getKeyPSAppDEField().getCodeName()?lower_case}</#if>'
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
			},
      </#if>
    </#list>
  </#if>
</#if>
<#if ctrl.getPSListDataItems()??>
  <#list ctrl.getPSListDataItems() 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}',
				dataType: 'FONTKEY',
			},
	 	</#if>
	</#if>
  </#if>
  </#list>
tony001's avatar
tony001 committed
60 61 62
</#if>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'MODEL_CONTENT.ts').code}
63 64 65 66 67 68 69 70 71
</#if>
      {
        name:'size',
        prop:'size'
      },
      {
        name:'query',
        prop:'query'
      },
72 73 74 75
      {
        name:'sort',
        prop:'sort'
      },
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
      {
        name:'page',
        prop:'page'
      },
      // 前端新增修改标识,新增为"0",修改为"1"或未设值
      {
        name: 'srffrontuf',
        prop: 'srffrontuf',
        dataType: 'TEXT',
      },
		]
	}

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