1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
68
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
import { MockAdapter } from '../mock-adapter';
const mock = MockAdapter.getInstance();
import Mock from 'mockjs'
// 获取全部数组
mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
let status = MockAdapter.mockStatus(config);
return [status, [
<#if app.getAllPSAppCodeLists()??>
<#list app.getAllPSAppCodeLists() as codelist>
{
<#if codelist.getCodeListType() == "STATIC" && codelist.getAllPSCodeItems()??>
srfkey: '${codelist.codeName}',
emptytext: '${codelist.getEmptyText()}',
"codelisttype":"static",
items: [
<#if codelist.getAllPSCodeItems()??>
<#list codelist.getAllPSCodeItems() as codeitem>
{
id: '${codeitem.getValue()?j_string}',
label: '${codeitem.getText()?j_string}',
text: '${codeitem.getText()?j_string}',
<#if codeitem.getPSSysImage()??>
<#assign sysimage = codeitem.getPSSysImage()/>
<#if sysimage.getImagePath() == "">
"iconcls":"${sysimage.getCssClass()}",
<#else>
"icon":"${sysimage.getImagePath()}",
</#if>
</#if>
"data":<#if codeitem.getData() != "">${codeitem.getData()}<#else>""</#if>,
<#if codeitem.getCodeName()??>
"codename":"${codeitem.getCodeName()}",
</#if>
<#if codeitem.getColor?? && codeitem.getColor()??>
"color": "${codeitem.getColor()?j_string}",
</#if>
<#comment>判断是否为数值代码项</#comment>
<#if codelist.isCodeItemValueNumber?? && codelist.isCodeItemValueNumber()>
value: ${codeitem.getValue()?j_string},
<#if codeitem.getParentCodeItem()??><#assign parentCodeItem = codeitem.getParentCodeItem() />"pvalue": ${parentCodeItem.getValue()?j_string},</#if>
<#else>
value: '${codeitem.getValue()?j_string}',
<#if codeitem.getParentCodeItem()??><#assign parentCodeItem = codeitem.getParentCodeItem() />"pvalue": "${parentCodeItem.getValue()?j_string}",</#if>
</#if>
disabled: <#if codeitem.isDisableSelect()>true<#else>false</#if>,
},
</#list>
</#if>
]
<#else>
"srfkey": "${codelist.codeName}",
"emptytext": "${codelist.getEmptyText()}",
"codelisttype":"dynamic",
"appdataentity":"<#if codelist.getPSAppDataEntity?? && codelist.getPSAppDataEntity()??>${codelist.getPSAppDataEntity().codeName}</#if>",
"appdedataset":"<#if codelist.getPSAppDEDataSet?? && codelist.getPSAppDEDataSet()??>${codelist.getPSAppDEDataSet().codeName}</#if>",
"items": []
</#if>
}<#if codelist_has_next>,</#if>
</#list>
</#if>
]];
});