提交 067fab76 编写于 作者: KK's avatar KK

地图加载逻辑调整 --fix3

上级 c2348c3d
......@@ -37,6 +37,71 @@
</#list>
</#if>
/**
* 地图项配置集合
*
* @protected
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected mapItemConfig: any = {
<#if ctrl.getPSSysMapItems()??>
<#list ctrl.getPSSysMapItems() as mapItem>
<#if mapItem.getPSAppDataEntity()?? && mapItem.getPSDEDataSet()??>
'${mapItem.getItemType()?lower_case}': {
itemName : '${mapItem.getName()}',
itemType : '${mapItem.getItemType()?lower_case}',
bkcolor : '<#if mapitem.getBKColorPSAppDEField?? && mapitem.getBKColorPSAppDEField()??>${mapitem.getBKColorPSAppDEField().getCodeName()?lower_case}</#if>',
tips : '<#if mapitem.getTipsPSAppDEField?? && mapitem.getTipsPSAppDEField()??>${mapitem.getTipsPSAppDEField().getCodeName()?lower_case}</#if>',
color : '<#if mapitem.getColorPSAppDEField?? && mapitem.getColorPSAppDEField()??>${mapitem.getColorPSAppDEField().getCodeName()?lower_case}</#if>',
content : '<#if mapitem.getContentPSDEField?? && mapitem.getContentPSDEField()??>${mapitem.getContentPSDEField().getCodeName()?lower_case}</#if>',
text : '<#if mapitem.getTextPSAppDEField?? && mapitem.getTextPSAppDEField()??>${mapitem.getTextPSAppDEField().getCodeName()?lower_case}</#if>',
code:'${mapitem_index}'
}<#if mapitem_has_next>,</#if>
</#if>
</#list>
</#if>
};
/**
* 查询数据
*
* @param {string} itemType
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isLoading]
* @returns {Promise<HttpResponse>}
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public async search2(itemType: string, context: any = {}, data: any = {}, isLoading?: boolean): Promise<HttpResponse> {
let item: any = {};
try {
<#if ctrl.getPSSysMapItems()??>
<#list ctrl.getPSSysMapItems() as mapItem>
<#if mapItem.getPSAppDataEntity()?? && mapItem.getPSDEDataSet()??>
<#assign _appde = mapItem.getPSAppDataEntity() />
<#assign deDataSet = mapItem.getPSDEDataSet() />
this.model.itemType = '${mapItem.getItemType()?lower_case}';
const _${mapItem.getItemType()?lower_case}_data = this.handleRequestData('', context, data);
await this.onBeforeAction('', context, _${mapItem.getItemType()?lower_case}_data, isLoading);
<#if _appde.getId() == appde.getId()>
const _${mapItem.getItemType()?lower_case} = await this.loadDEDataSet('Fetch${deDataSet.getCodeName()}', context, _${mapItem.getItemType()?lower_case}_data, '${mapItem.getItemType()?lower_case}');
<#else>
const _${mapItem.getItemType()?lower_case} = await this.loadDEDataSet('Fetch${deDataSet.getCodeName()}', context, _${mapItem.getItemType()?lower_case}_data, '${mapItem.getItemType()?lower_case}', '${_appde.getCodeName()?lower_case}');
</#if>
Object.assign(item, { ${mapItem.getItemType()?lower_case}: _${mapItem.getItemType()?lower_case} });
</#if>
</#list>
</#if>
} catch (response) {
return new HttpResponse(response.status);
}
return new HttpResponse(200, item);
}
<#ibizinclude>
../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl
</#ibizinclude>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册