提交 2c38d5e4 编写于 作者: tony001's avatar tony001

2020.4.29 模板初始化

上级 6dae8703
<#ibizinclude> <#ibizinclude>
../../../@MACRO/LANG_FUN.ftl ../../../@MACRO/LANG_FUN.ftl
</#ibizinclude> </#ibizinclude>
<#macro getres tempView>
<#compress>
<#if tempView.getPSAppDataEntity?? && tempView.getPSAppDataEntity()?? && tempView.getPSAppDataEntity().getPSDataEntity?? && tempView.getPSAppDataEntity().getPSDataEntity()??>
<#assign dataeneity = tempView.getPSAppDataEntity().getPSDataEntity() />
<#if dataeneity.getMajorPSDERs?? && dataeneity.getMajorPSDERs()??>
[<#list dataeneity.getMajorPSDERs() as psDes>'${psDes.getName()}'<#if psDes_has_next>,</#if></#list>]
</#if>
</#if>
</#compress>
</#macro>
<#if item.getPSViewLogic?? && item.getPSViewLogic()??> <#if item.getPSViewLogic?? && item.getPSViewLogic()??>
<#assign viewlogic = item.getPSViewLogic()/> <#assign viewlogic = item.getPSViewLogic()/>
/** /**
...@@ -27,72 +17,7 @@ ...@@ -27,72 +17,7 @@
<#if viewlogic.isEnableWizardAdd()> <#if viewlogic.isEnableWizardAdd()>
this.$Notice.warning({ title: '错误', desc: '向导添加未实现' }); this.$Notice.warning({ title: '错误', desc: '向导添加未实现' });
<#elseif viewlogic.isEnableBatchAdd()> <#elseif viewlogic.isEnableBatchAdd()>
<#-- 批量添加 --> this.$Notice.warning({ title: '错误', desc: '支持批添加未实现' });
<#if viewlogic.getBatchAddPSAppViews?? && viewlogic.getBatchAddPSAppViews()??>
<#assign batchAddPSAppViews = viewlogic.getBatchAddPSAppViews()/>
const batchAddPSAppViews=[
<#list batchAddPSAppViews as batchAddPSAppView>
{view:{viewname:'${srffilepath2(batchAddPSAppView.getCodeName())}',height: ${batchAddPSAppView.getHeight()?c},width: ${batchAddPSAppView.getWidth()?c},title: '${batchAddPSAppView.title}'},
res:<@getres tempView=batchAddPSAppView />}<#if batchAddPSAppView_has_next>,</#if>
</#list>
];
</#if>
const data: any = {};
if (args && args.length > 0 && args[0].srfsourcekey) {
Object.assign(data, { srfsourcekey: args[0].srfsourcekey })
}
const _this: any = this;
if (_this.srfparentdata) {
Object.assign(data, { srfparentdata: _this.srfparentdata });
}
if(batchAddPSAppViews.length == 0){
this.$Notice.warning({ title: '错误', desc: '批量添加需添加N:N关系' });
return;
}
batchAddPSAppViews.forEach((item:any,index:number) =>{
if(item.res){
item.res.forEach((curRes:any) =>{
if(Object.is(curRes,_this.srfparentdata.srfparentmode)){
item.curRes = true;
}
})
}
})
const openPopupModal = (view: any, data: any) => {
let container: Subject<any> = this.$appmodal.openModal(view, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
// 处理参数
if(result.datas && result.datas.length == 0){
return;
}
let keys = '';
const viewParam:any = {};
if (_this.srfparentdata) {
Object.assign(viewParam,{ srfparentdata: _this.srfparentdata});
}
result.datas.forEach((record:any) => {
let key = record.srfkey;
if (!Object.is(keys, '')) {
keys += ';';
}
keys += key;
});
Object.assign(viewParam,{srfkeys:keys});
// 调用发送批处理请求
});
}
let curView:any ={};
batchAddPSAppViews.forEach((item:any) =>{
if(!item.curRes){
Object.assign(curView,item.view)
}
})
const view: any = curView;
openPopupModal(view, data);
<#elseif viewlogic.isBatchAddOnly()> <#elseif viewlogic.isBatchAddOnly()>
this.$Notice.warning({ title: '错误', desc: '只支持批添加未实现' }); this.$Notice.warning({ title: '错误', desc: '只支持批添加未实现' });
<#elseif viewlogic.getNewDataPSAppView()??> <#elseif viewlogic.getNewDataPSAppView()??>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册