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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/**
* 代码表--所属区域
*
* @export
* @class EhrCodeList0250
*/
export default class EhrCodeList0250 {
/**
* 是否启用缓存
*
* @type boolean
* @memberof EhrCodeList0250
*/
public isEnableCache:boolean = true;
/**
* 过期时间
*
* @type any
* @memberof EhrCodeList0250
*/
public expirationTime:any;
/**
* 缓存超长时长
*
* @type any
* @memberof EhrCodeList0250
*/
public cacheTimeout:any = -1;
/**
* 代码表模型对象
*
* @type any
* @memberof EhrCodeList0250
*/
public codelistModel:any = {
codelistid:"EhrCodeList0250"
};
/**
* 自定义参数集合
*
* @type any
* @memberof EhrCodeList0250
*/
public userParamNames:any ={
codelistid:"1DBB5651-9059-4B12-AE48-751F183233FA"
}
/**
* 查询参数集合
*
* @type any
* @memberof EhrCodeList0250
*/
public queryParamNames:any ={
}
/**
* 获取数据项
*
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EhrCodeList0250
*/
public getItems(data: any={}, isloading?: boolean): Promise<any> {
return Promise.reject([]);
}
/**
* 处理查询参数
* @param data 传入data
* @memberof EhrCodeList0250
*/
public handleQueryParam(data:any){
let tempData:any = data?JSON.parse(JSON.stringify(data)):{};
if(this.userParamNames && Object.keys(this.userParamNames).length >0){
Object.keys(this.userParamNames).forEach((name: string) => {
if (!name) {
return;
}
let value: string | null = this.userParamNames[name];
if (value && value.startsWith('%') && value.endsWith('%')) {
const key = value.substring(1, value.length - 1);
if (this.codelistModel && this.codelistModel.hasOwnProperty(key)) {
value = (this.codelistModel[key] !== null && this.codelistModel[key] !== undefined) ? this.codelistModel[key] : null;
} else {
value = null;
}
}
Object.assign(tempData, { [name]: value });
});
}
Object.assign(tempData,{page: 0, size: 1000});
if(this.queryParamNames && Object.keys(this.queryParamNames).length > 0){
Object.assign(tempData,this.queryParamNames);
}
return tempData;
}
}