import { IParam } from "@core";

export const AppCodeListConfig:IParam = {
    {{#each app.allPSAppCodeLists as |appCodeList|}}
  '{{appCodeList.codeListTag}}':{
    'name': '{{appCodeList.name}}',
    'codeName': '{{appCodeList.codeName}}',
    'codeListTag': '{{appCodeList.codeListTag}}',
    'codeListType': '{{appCodeList.codeListType}}',
    'isEnableCache': {{appCodeList.enableCache}},
    'cacheTimeout': {{appCodeList.cacheTimeout}},
    {{~#if appCodeList.minorSortDir}}'minorSortDir': '{{appCodeList.minorSortDir}}',{{/if~}}
    {{~#if appCodeList.minorSortPSAppDEField}}'minorSortPSAppDEField': '{{lowerCase appCodeList.minorSortPSAppDEField.codeName}}',{{/if~}}
    {{~#if appCodeList.predefinedType}}'predefinedType': '{{appCodeList.predefinedType}}',{{/if~}}
    {{~#if appCodeList.psAppDataEntity}}'appDataEntity': '{{appCodeList.psAppDataEntity.codeName}}',{{/if~}}
    {{~#if appCodeList.psAppDEDataSet}}'appDEDataSet': '{{appCodeList.psAppDEDataSet.codeName}}',{{/if~}}
    {{~#if appCodeList.textPSAppDEField}}'textPSAppDEField': '{{lowerCase appCodeList.textPSAppDEField.codeName}}',{{/if~}}
    {{~#if appCodeList.valuePSAppDEField}}'valuePSAppDEField': '{{lowerCase appCodeList.valuePSAppDEField.codeName}}',{{/if~}}
    {{~#if appCodeList.pValuePSAppDEField}}'pValuePSAppDEField': '{{lowerCase appCodeList.pValuePSAppDEField.codeName}}',{{/if~}}
    {{~#if appCodeList.disablePSAppDEField}}'disablePSAppDEField': '{{lowerCase appCodeList.disablePSAppDEField.codeName}}',{{/if~}}
    {{~#if appCodeList.iconPathPSAppDEField}}'iconPathPSAppDEField': '{{lowerCase appCodeList.iconPathPSAppDEField.codeName}}',{{/if~}}
    {{~#if appCodeList.iconClsPSAppDEField}}'iconClsPSAppDEField': '{{lowerCase appCodeList.iconClsPSAppDEField.codeName}}',{{/if}}
    'emptyText': '{{appCodeList.emptyText}}',
    {{#if appCodeList.psCodeItems}}
    'items':[
    {{#each appCodeList.psCodeItems as |codeItem|}}
      {{#codeItem}}
        {'value': {{#if appCodeList.codeItemValueNumber}}{{value}}{{else}}'{{value}}'{{/if}}, 'text': '{{text}}','codeName': '{{codeName}}', {{#if data}}'data': `{{data}}`, {{/if}}{{#if color}}'color': '{{color}}', {{/if}}'textClass': '{{#if textCls}}{{textCls}}{{else if psSysCss}}{{psSysCss.cssName}}{{/if}}',{{#if psSysImage}}{{#if psSysImage.cssClass}}'cssClass': '{{psSysImage.cssClass}}',{{/if}}{{#if psSysImage.imagePath}}'imagePath': '{{psSysImage.imagePath}}'{{/if}}{{/if}} }{{#unless @last}},{{/unless}}
      {{/codeItem}}
    {{/each}}
    ]
    {{/if}}
  }{{#unless @last}},{{/unless}}
{{/each}}
}