MODEL.ts.ftl 2.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
<#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()}',
21
    </#if>
22
    <#if dataitem.getFrontPSCodeList?? && dataitem.getFrontPSCodeList()??>
23
        <#assign codelist=dataitem.getFrontPSCodeList() />
24
        codelist:{tag:'${codelist.codeName}',codelistType:'${codelist.getCodeListType()}'},
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
    </#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}',
				prop: '${majorAppDataEntity.getKeyPSAppDEField().getCodeName()?lower_case}'
			},
      </#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>
</#if>
      {
        name:'size',
        prop:'size'
      },
      {
        name:'query',
        prop:'query'
      },
68 69 70 71
      {
        name:'sort',
        prop:'sort'
      },
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
      {
        name:'page',
        prop:'page'
      },
      // 前端新增修改标识,新增为"0",修改为"1"或未设值
      {
        name: 'srffrontuf',
        prop: 'srffrontuf',
        dataType: 'TEXT',
      },
		]
	}

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