Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
22
议题
22
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7
提交
6dae8703
提交
6dae8703
编写于
4月 30, 2020
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
支持批量添加
上级
101e1714
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
264 行增加
和
189 行删除
+264
-189
LOGIC.vue.ftl
@LOGIC/@VIEWLOGIC/新建/LOGIC.vue.ftl
+264
-189
未找到文件。
@LOGIC/@VIEWLOGIC/新建/LOGIC.vue.ftl
浏览文件 @
6dae8703
<#ibizinclude>
<#ibizinclude>
../../../@MACRO/LANG_FUN.ftl
../../../@MACRO/LANG_FUN.ftl
</#ibizinclude>
</#ibizinclude>
<#if item.getPSViewLogic?? && item.getPSViewLogic()??>
<#macro getres tempView>
<#assign viewlogic = item.getPSViewLogic()/>
<#compress>
/**
<#if tempView.getPSAppDataEntity?? && tempView.getPSAppDataEntity()?? && tempView.getPSAppDataEntity().getPSDataEntity?? && tempView.getPSAppDataEntity().getPSDataEntity()??>
* 打开新建数据视图
<#assign dataeneity = tempView.getPSAppDataEntity().getPSDataEntity() />
*
<#if dataeneity.getMajorPSDERs?? && dataeneity.getMajorPSDERs()??>
* @param {any[]} args
[<#list dataeneity.getMajorPSDERs() as psDes>'${psDes.getName()}'<#if psDes_has_next>,</#if></#list>]
* @param {*} [params]
</#if>
* @param {*} [fullargs]
</#if>
* @param {*} [$event]
</#compress>
* @param {*} [xData]
</#macro>
* @memberof ${srfclassname('${view.name}')}
<#if item.getPSViewLogic?? && item.getPSViewLogic()??>
*/
<#assign viewlogic = item.getPSViewLogic()/>
protected newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
/**
<#if viewlogic.isEnableWizardAdd()>
* 打开新建数据视图
this.$Notice.warning({ title: '错误', desc: '向导添加未实现' });
*
<#elseif viewlogic.isEnableBatchAdd()>
* @param {any[]} args
this.$Notice.warning({ title: '错误', desc: '支持批添加未实现' });
* @param {*} [params]
<#elseif viewlogic.isBatchAddOnly()>
* @param {*} [fullargs]
this.$Notice.warning({ title: '错误', desc: '只支持批添加未实现' });
* @param {*} [$event]
<#elseif viewlogic.getNewDataPSAppView()??>
* @param {*} [xData]
<#assign dataview = viewlogic.getNewDataPSAppView()/>
* @memberof ${srfclassname('${view.name}')}
const data: any = {};
*/
let curViewParam = JSON.parse(JSON.stringify(this.context));
protected newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
if(args.length >0){
<#if viewlogic.isEnableWizardAdd()>
Object.assign(curViewParam,args[0]);
this.$Notice.warning({ title: '错误', desc: '向导添加未实现' });
}
<#elseif viewlogic.isEnableBatchAdd()>
<#-- BEGIN:准备参数 -->
<#-- 批量添加 -->
<#-- BEGIN:是否应用实体视图 -->
<#if viewlogic.getBatchAddPSAppViews?? && viewlogic.getBatchAddPSAppViews()??>
<#if dataview.isPSDEView()>
<#assign batchAddPSAppViews = viewlogic.getBatchAddPSAppViews()/>
<#-- 存在关系start -->
const batchAddPSAppViews=[
<#if dataview.getPSAppDERSPathCount() gt 0>
<#list batchAddPSAppViews as batchAddPSAppView>
<#list 1..dataview.getPSAppDERSPathCount() as count>
{view:{viewname:'${srffilepath2(batchAddPSAppView.getCodeName())}',height: ${batchAddPSAppView.getHeight()?c},width: ${batchAddPSAppView.getWidth()?c},title: '${batchAddPSAppView.title}'},
<#assign condition = ''/>
res:<@getres tempView=batchAddPSAppView />}<#if batchAddPSAppView_has_next>,</#if>
<#list dataview.getPSAppDERSPath(count_index) as deRSPath>
</#list>
<#if deRSPath.getMajorPSAppDataEntity?? && deRSPath.getMajorPSAppDataEntity()??>
];
<#assign _dataEntity = deRSPath.getMajorPSAppDataEntity()/>
</#if>
<#assign condition>${condition}curViewParam.${_dataEntity.getCodeName()?lower_case} && </#assign>
const data: any = {};
</#if>
if (args && args.length > 0 && args[0].srfsourcekey) {
</#list>
Object.assign(data, { srfsourcekey: args[0].srfsourcekey })
</#list>
}
let deResParameters: any[] = [];
const _this: any = this;
<#-- 如果是主实体需对context判断start -->
if (_this.srfparentdata) {
<#if dataview.getPSAppDataEntity().isMajor()>
Object.assign(data, { srfparentdata: _this.srfparentdata });
if(${condition}true){
}
deResParameters = [
if(batchAddPSAppViews.length == 0){
<#list dataview.getPSAppDERSPath(dataview.getPSAppDERSPathCount() - 1) as deRSPath>
this.$Notice.warning({ title: '错误', desc: '批量添加需添加N:N关系' });
<#assign majorPSAppDataEntity = deRSPath.getMajorPSAppDataEntity()/>
return;
{ pathName: '${srfpluralize(majorPSAppDataEntity.codeName)?lower_case}', parameterName: '${majorPSAppDataEntity.getCodeName()?lower_case}' },
}
</#list>
batchAddPSAppViews.forEach((item:any,index:number) =>{
]
if(item.res){
}
item.res.forEach((curRes:any) =>{
<#else>
if(Object.is(curRes,_this.srfparentdata.srfparentmode)){
deResParameters = [
item.curRes = true;
<#list dataview.getPSAppDERSPath(dataview.getPSAppDERSPathCount() - 1) as deRSPath>
}
<#assign majorPSAppDataEntity = deRSPath.getMajorPSAppDataEntity()/>
})
{ pathName: '${srfpluralize(majorPSAppDataEntity.codeName)?lower_case}', parameterName: '${majorPSAppDataEntity.getCodeName()?lower_case}' },
}
</#list>
})
];
const openPopupModal = (view: any, data: any) => {
</#if>
let container: Subject<any> = this.$appmodal.openModal(view, data);
<#-- 如果是主实体需对context判断end -->
container.subscribe((result: any) => {
<#else>
if (!result || !Object.is(result.ret, 'OK')) {
const deResParameters: any[] = [];
return;
</#if>
}
<#-- 存在关系end -->
// 处理参数
<#else>
if(result.datas && result.datas.length == 0){
const deResParameters: any[] = [];
return;
</#if>
}
<#-- END:是否应用实体视图 -->
let keys = '';
<#if dataview.getOpenMode() == 'INDEXVIEWTAB' || dataview.getOpenMode() == ''>
const viewParam:any = {};
<#-- BEGIN:是否应用实体视图 -->
if (_this.srfparentdata) {
<#if dataview.isPSDEView()>
Object.assign(viewParam,{ srfparentdata: _this.srfparentdata});
<#assign appDataEntity = dataview.getPSAppDataEntity()/>
}
const parameters: any[] = [
result.datas.forEach((record:any) => {
{ pathName: '${srfpluralize(appDataEntity.codeName)?lower_case}', parameterName: '${appDataEntity.getCodeName()?lower_case}' },
let key = record.srfkey;
{ pathName: '${dataview.getPSDEViewCodeName()?lower_case}', parameterName: '${dataview.getPSDEViewCodeName()?lower_case}' },
if (!Object.is(keys, '')) {
];
keys += ';';
<#else>
}
const parameters: any[] = [
keys += key;
{ pathName: '${dataview.getCodeName()?lower_case}', parameterName: '${dataview.getCodeName()?lower_case}' },
});
];
Object.assign(viewParam,{srfkeys:keys});
</#if>
// 调用发送批处理请求
<#-- END:是否应用实体视图 -->
<#else>
});
<#-- BEGIN:是否应用实体视图 -->
}
<#if dataview.isPSDEView()>
let curView:any ={};
<#assign appDataEntity = dataview.getPSAppDataEntity()/>
batchAddPSAppViews.forEach((item:any) =>{
const parameters: any[] = [
if(!item.curRes){
{ pathName: '${srfpluralize(appDataEntity.codeName)?lower_case}', parameterName: '${appDataEntity.getCodeName()?lower_case}' },
Object.assign(curView,item.view)
];
}
<#else>
})
const parameters: any[] = [];
const view: any = curView;
</#if>
openPopupModal(view, data);
<#-- END:是否应用实体视图 -->
<#elseif viewlogic.isBatchAddOnly()>
</#if>
this.$Notice.warning({ title: '错误', desc: '只支持批添加未实现' });
<#-- END:准备参数 -->
<#elseif viewlogic.getNewDataPSAppView()??>
<#if dataview.getOpenMode() == 'INDEXVIEWTAB' || dataview.getOpenMode() == ''>
<#assign dataview = viewlogic.getNewDataPSAppView()/>
<#-- 打开顶级分页视图 -->
const data: any = {};
const _this: any = this;
let curViewParam = JSON.parse(JSON.stringify(this.context));
const openIndexViewTab = (data: any) => {
if(args.length >0){
const _data: any = { w: (new Date().getTime()) };
Object.assign(curViewParam,args[0]);
Object.assign(_data, data);
}
const routePath = this.$viewTool.buildUpRoutePath(this.$route, curViewParam, deResParameters, parameters, args, _data);
<#-- BEGIN:准备参数 -->
this.$router.push(routePath);
<#-- BEGIN:是否应用实体视图 -->
}
<#if dataview.isPSDEView()>
openIndexViewTab(data);
<#-- 存在关系start -->
<#elseif dataview.getOpenMode() == 'POPUPAPP'>
<#if dataview.getPSAppDERSPathCount() gt 0>
<#-- 打开独立程序弹出 -->
<#list 1..dataview.getPSAppDERSPathCount() as count>
const _this: any = this;
<#assign condition = ''/>
const routePath = this.$viewTool.buildUpRoutePath(this.$route, curViewParam, deResParameters, parameters, args, data);
<#list dataview.getPSAppDERSPath(count_index) as deRSPath>
window.open('./#'+routePath, '_blank');
<#if deRSPath.getMajorPSAppDataEntity?? && deRSPath.getMajorPSAppDataEntity()??>
<#elseif dataview.getOpenMode() = 'POPUPMODAL'>
<#assign _dataEntity = deRSPath.getMajorPSAppDataEntity()/>
<#-- 打开模态 -->
<#assign condition>${condition}curViewParam.${_dataEntity.getCodeName()?lower_case} && </#assign>
const _this: any = this;
</#if>
const openPopupModal = (view: any, data: any) => {
</#list>
let container: Subject<any> = this.$appmodal.openModal(view, curViewParam, data);
</#list>
container.subscribe((result: any) => {
let deResParameters: any[] = [];
if (!result || !Object.is(result.ret, 'OK')) {
<#-- 如果是主实体需对context判断start -->
return;
<#if dataview.getPSAppDataEntity().isMajor()>
}
if(${condition}true){
if (!xData || !(xData.refresh instanceof Function)) {
deResParameters = [
return;
<#list dataview.getPSAppDERSPath(dataview.getPSAppDERSPathCount() - 1) as deRSPath>
}
<#assign majorPSAppDataEntity = deRSPath.getMajorPSAppDataEntity()/>
xData.refresh(result.datas);
{ pathName: '${srfpluralize(majorPSAppDataEntity.codeName)?lower_case}', parameterName: '${majorPSAppDataEntity.getCodeName()?lower_case}' },
});
</#list>
}
]
const view: any = {
}
viewname: '${srffilepath2(dataview.getCodeName())}',
<#else>
height: ${dataview.getHeight()?c},
deResParameters = [
width: ${dataview.getWidth()?c},
<#list dataview.getPSAppDERSPath(dataview.getPSAppDERSPathCount() - 1) as deRSPath>
title: this.<@getViewLanguageTitle dataview />,
<#assign majorPSAppDataEntity = deRSPath.getMajorPSAppDataEntity()/>
};
{ pathName: '${srfpluralize(majorPSAppDataEntity.codeName)?lower_case}', parameterName: '${majorPSAppDataEntity.getCodeName()?lower_case}' },
openPopupModal(view, data);
</#list>
<#elseif dataview.getOpenMode()?index_of('DRAWER') == 0>
];
<#-- 打开抽屉 -->
</#if>
const _this: any = this;
<#-- 如果是主实体需对context判断end -->
const openDrawer = (view: any, data: any) => {
<#else>
let container: Subject<any> = this.$appdrawer.openDrawer(view, curViewParam, data);
const deResParameters: any[] = [];
container.subscribe((result: any) => {
</#if>
if (!result || !Object.is(result.ret, 'OK')) {
<#-- 存在关系end -->
return;
<#else>
}
const deResParameters: any[] = [];
if (!xData || !(xData.refresh instanceof Function)) {
</#if>
return;
<#-- END:是否应用实体视图 -->
}
<#if dataview.getOpenMode() == 'INDEXVIEWTAB' || dataview.getOpenMode() == ''>
xData.refresh(result.datas);
<#-- BEGIN:是否应用实体视图 -->
});
<#if dataview.isPSDEView()>
}
<#assign appDataEntity = dataview.getPSAppDataEntity()/>
const view: any = {
const parameters: any[] = [
viewname: '${srffilepath2(dataview.getCodeName())}',
{ pathName: '${srfpluralize(appDataEntity.codeName)?lower_case}', parameterName: '${appDataEntity.getCodeName()?lower_case}' },
height: ${dataview.getHeight()?c},
{ pathName: '${dataview.getPSDEViewCodeName()?lower_case}', parameterName: '${dataview.getPSDEViewCodeName()?lower_case}' },
width: ${dataview.getWidth()?c},
];
title: this.<@getViewLanguageTitle dataview />,
<#else>
placement: '${dataview.getOpenMode()}',
const parameters: any[] = [
};
{ pathName: '${dataview.getCodeName()?lower_case}', parameterName: '${dataview.getCodeName()?lower_case}' },
openDrawer(view, data);
];
<#elseif dataview.getOpenMode() == 'POPOVER'>
</#if>
<#-- 打开气泡卡片 -->
<#-- END:是否应用实体视图 -->
const _this: any = this;
<#else>
const openPopOver = (view: any, data: any) => {
<#-- BEGIN:是否应用实体视图 -->
let container: Subject<any> = this.$apppopover.openPop($event, view, curViewParam,data);
<#if dataview.isPSDEView()>
container.subscribe((result: any) => {
<#assign appDataEntity = dataview.getPSAppDataEntity()/>
if (!result || !Object.is(result.ret, 'OK')) {
const parameters: any[] = [
return;
{ pathName: '${srfpluralize(appDataEntity.codeName)?lower_case}', parameterName: '${appDataEntity.getCodeName()?lower_case}' },
}
];
if (!xData || !(xData.refresh instanceof Function)) {
<#else>
return;
const parameters: any[] = [];
}
</#if>
xData.refresh(result.datas);
<#-- END:是否应用实体视图 -->
});
</#if>
}
<#-- END:准备参数 -->
const view: any = {
<#if dataview.getOpenMode() == 'INDEXVIEWTAB' || dataview.getOpenMode() == ''>
viewname: '${srffilepath2(dataview.getCodeName())}',
<#-- 打开顶级分页视图 -->
height: ${dataview.getHeight()?c},
const _this: any = this;
width: ${dataview.getWidth()?c},
const openIndexViewTab = (data: any) => {
title: this.<@getViewLanguageTitle dataview />,
const _data: any = { w: (new Date().getTime()) };
placement: '${dataview.getOpenMode()}',
Object.assign(_data, data);
};
const routePath = this.$viewTool.buildUpRoutePath(this.$route, curViewParam, deResParameters, parameters, args, _data);
openPopOver(view, data);
this.$router.push(routePath);
<#else>
}
this.$Notice.warning({ title: '错误', desc: this.<@getViewLanguageTitle dataview />+'不支持该模式打开' });
openIndexViewTab(data);
</#if>
<#elseif dataview.getOpenMode() == 'POPUPAPP'>
<#else>
<#-- 打开独立程序弹出 -->
this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
const _this: any = this;
</#if>
const routePath = this.$viewTool.buildUpRoutePath(this.$route, curViewParam, deResParameters, parameters, args, data);
}
window.open('./#'+routePath, '_blank');
</#if>
<#elseif dataview.getOpenMode() = 'POPUPMODAL'>
<#-- 打开模态 -->
const _this: any = this;
const openPopupModal = (view: any, data: any) => {
let container: Subject<any> = this.$appmodal.openModal(view, curViewParam, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
if (!xData || !(xData.refresh instanceof Function)) {
return;
}
xData.refresh(result.datas);
});
}
const view: any = {
viewname: '${srffilepath2(dataview.getCodeName())}',
height: ${dataview.getHeight()?c},
width: ${dataview.getWidth()?c},
title: this.<@getViewLanguageTitle dataview />,
};
openPopupModal(view, data);
<#elseif dataview.getOpenMode()?index_of('DRAWER') == 0>
<#-- 打开抽屉 -->
const _this: any = this;
const openDrawer = (view: any, data: any) => {
let container: Subject<any> = this.$appdrawer.openDrawer(view, curViewParam, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
if (!xData || !(xData.refresh instanceof Function)) {
return;
}
xData.refresh(result.datas);
});
}
const view: any = {
viewname: '${srffilepath2(dataview.getCodeName())}',
height: ${dataview.getHeight()?c},
width: ${dataview.getWidth()?c},
title: this.<@getViewLanguageTitle dataview />,
placement: '${dataview.getOpenMode()}',
};
openDrawer(view, data);
<#elseif dataview.getOpenMode() == 'POPOVER'>
<#-- 打开气泡卡片 -->
const _this: any = this;
const openPopOver = (view: any, data: any) => {
let container: Subject<any> = this.$apppopover.openPop($event, view, curViewParam,data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
if (!xData || !(xData.refresh instanceof Function)) {
return;
}
xData.refresh(result.datas);
});
}
const view: any = {
viewname: '${srffilepath2(dataview.getCodeName())}',
height: ${dataview.getHeight()?c},
width: ${dataview.getWidth()?c},
title: this.<@getViewLanguageTitle dataview />,
placement: '${dataview.getOpenMode()}',
};
openPopOver(view, data);
<#else>
this.$Notice.warning({ title: '错误', desc: this.<@getViewLanguageTitle dataview />+'不支持该模式打开' });
</#if>
<#else>
this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
</#if>
}
</#if>
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录