提交 22a2596d 编写于 作者: WodahsOrez's avatar WodahsOrez

Merge branch 'dev' of http://demo.ibizlab.cn/ibizr7pfstdtempl/ibizvuer7 into dev

<#ibizinclude>
../../../@MACRO/LANG_FUN.ftl
</#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()??>
<#assign viewlogic = item.getPSViewLogic()/>
/**
......@@ -17,7 +27,82 @@
<#if viewlogic.isEnableWizardAdd()>
this.$Notice.warning({ title: '错误', desc: '向导添加未实现' });
<#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});
// 发送批处理请求
const url:string ="${app.getPKGCodeName()?lower_case}/${de.getPSSystemModule().codeName?lower_case}/${de.codeName?lower_case}/addbatch";
this.$http.post(url,viewParam).then((response:any) =>{
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '批处理操作失败' });
return;
}
if (!xData || !(xData.refresh instanceof Function)) {
return;
}
xData.refresh(result.datas);
})
});
}
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()>
this.$Notice.warning({ title: '错误', desc: '只支持批添加未实现' });
<#elseif viewlogic.getNewDataPSAppView()??>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册