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|}}
        {'value': {{#if appCodeList.codeItemValueNumber}}{{codeItem.value}}{{else}}'{{codeItem.value}}'{{/if}}, 'text': '{{codeItem.text}}','codeName': '{{codeItem.codeName}}' }{{#unless @last}},{{/unless}}
    {{/each}}
    ]
    {{/if}}
  }{{#unless @last}},{{/unless}}
{{/each}}
}