import { IParam } from "@core";

export const AppCodeListConfig:IParam = {
    {{#each app.getAllPSAppCodeLists as |appCodeList|}}
  '{{appCodeList.getCodeListTag}}':{
    'name': '{{appCodeList.getName}}',
    'codeName': '{{appCodeList.getCodeName}}',
    'codeListTag': '{{appCodeList.getCodeListTag}}',
    'codeListType': '{{appCodeList.getCodeListType}}',
    'isEnableCache': {{appCodeList.isEnableCache}},
    'cacheTimeout': {{appCodeList.getCacheTimeout}},
    {{~#if appCodeList.getMinorSortDir}}'minorSortDir': '{{appCodeList.getMinorSortDir}}',{{/if~}}
    {{~#if appCodeList.getMinorSortPSAppDEField}}'minorSortPSAppDEField': '{{lowerCase appCodeList.getMinorSortPSAppDEField.codeName}}',{{/if~}}
    {{~#if appCodeList.getPredefinedType}}'predefinedType': '{{appCodeList.getPredefinedType}}',{{/if~}}
    {{~#if appCodeList.getPSAppDataEntity}}'appDataEntity': '{{appCodeList.getPSAppDataEntity.codeName}}',{{/if~}}
    {{~#if appCodeList.getPSAppDEDataSet}}'appDEDataSet': '{{appCodeList.getPSAppDEDataSet.codeName}}',{{/if~}}
    {{~#if appCodeList.getTextPSAppDEField}}'textPSAppDEField': '{{lowerCase appCodeList.getTextPSAppDEField.codeName}}',{{/if~}}
    {{~#if appCodeList.getValuePSAppDEField}}'valuePSAppDEField': '{{lowerCase appCodeList.getValuePSAppDEField.codeName}}',{{/if~}}
    {{~#if appCodeList.getPValuePSAppDEField}}'pValuePSAppDEField': '{{lowerCase appCodeList.getPValuePSAppDEField.codeName}}',{{/if~}}
    {{~#if appCodeList.getDisablePSAppDEField}}'disablePSAppDEField': '{{lowerCase appCodeList.getDisablePSAppDEField.codeName}}',{{/if~}}
    {{~#if appCodeList.getIconPathPSAppDEField}}'iconPathPSAppDEField': '{{lowerCase appCodeList.getIconPathPSAppDEField.codeName}}',{{/if~}}
    {{~#if appCodeList.getIconClsPSAppDEField}}'iconClsPSAppDEField': '{{lowerCase appCodeList.getIconClsPSAppDEField.codeName}}',{{/if}}
    'emptyText': '{{appCodeList.getEmptyText}}',
    {{#if appCodeList.getPSCodeItems}}
    'items':[
    {{#each appCodeList.getPSCodeItems as |codeItem|}}
        {'value': {{#if appCodeList.isCodeItemValueNumber}}{{codeItem.getValue}}{{else}}'{{codeItem.getValue}}'{{/if}}, 'text': '{{codeItem.getText}}','codeName': '{{codeItem.codeName}}' }{{#unless @last}},{{/unless}}
    {{/each}}
    ]
    {{/if}}
  }{{#unless @last}},{{/unless}}
{{/each}}
}