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

优化拷贝功能

上级 c9e4c5c0
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* @memberof ${srfclassname('${view.name}')}Base * @memberof ${srfclassname('${view.name}')}Base
*/ */
public ${item.getFullCodeName()}(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) { public ${item.getFullCodeName()}(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) { <#-- if (args.length === 0) {
return; return;
} }
const _this: any = this; const _this: any = this;
...@@ -28,5 +28,20 @@ ...@@ -28,5 +28,20 @@
xData.copy(args[0].srfkey); xData.copy(args[0].srfkey);
} else { } else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' }); _this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
} -->
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.opendata && _this.opendata instanceof Function) {
const data: any = { };
if (args.length > 0) {
<#if appde??>Object.assign(data, { ${appde.codeName?lower_case}: args[0].${appde.codeName?lower_case} });</#if>
}
if(!params) params = {};
Object.assign(params,{copymode:true});
_this.opendata([{ ...data }], params, $event, xData);
} else {
Object.assign(this.viewparams,{copymode:true});
} }
} }
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* @param {*} [xData] * @param {*} [xData]
* @memberof ${srfclassname('${view.name}')} * @memberof ${srfclassname('${view.name}')}
*/ */
public ${item.name}(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) { public ${item.name}(args: any[],fullargs?:any,params?: any, $event?: any, xData?: any) {
<#if item.getPSControlContainer().getViewType??> <#if item.getPSControlContainer().getViewType??>
if(!this.viewDefaultUsage){ if(!this.viewDefaultUsage){
if(Object.is(this.navModel,"route")){ if(Object.is(this.navModel,"route")){
...@@ -156,6 +156,9 @@ ...@@ -156,6 +156,9 @@
<#elseif dataview.getOpenMode() == 'INDEXVIEWTAB' || dataview.getOpenMode() == ''> <#elseif dataview.getOpenMode() == 'INDEXVIEWTAB' || dataview.getOpenMode() == ''>
<#-- 打开顶级分页视图 --> <#-- 打开顶级分页视图 -->
const _this: any = this; const _this: any = this;
if(fullargs && fullargs.copymode){
Object.assign(data,{copymode:true});
}
const openIndexViewTab = (data: any) => { const openIndexViewTab = (data: any) => {
const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, data); const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, data);
<#if dataview.getViewType() == "DEWFDYNAEDITVIEW" > <#if dataview.getViewType() == "DEWFDYNAEDITVIEW" >
...@@ -168,11 +171,17 @@ ...@@ -168,11 +171,17 @@
<#elseif dataview.getOpenMode() == 'POPUPAPP'> <#elseif dataview.getOpenMode() == 'POPUPAPP'>
<#-- 打开独立程序弹出 --> <#-- 打开独立程序弹出 -->
const _this: any = this; const _this: any = this;
if(fullargs && fullargs.copymode){
Object.assign(data,{copymode:true});
}
const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, data); const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, data);
window.open('./#'+routePath, '_blank'); window.open('./#'+routePath, '_blank');
<#elseif dataview.getOpenMode() = 'POPUPMODAL'> <#elseif dataview.getOpenMode() = 'POPUPMODAL'>
<#-- 打开模态 --> <#-- 打开模态 -->
const _this: any = this; const _this: any = this;
if(fullargs && fullargs.copymode){
Object.assign(data,{copymode:true});
}
const openPopupModal = (view: any, data: any) => { const openPopupModal = (view: any, data: any) => {
let container: Subject<any> = this.$appmodal.openModal(view, tempContext, data); let container: Subject<any> = this.$appmodal.openModal(view, tempContext, data);
container.subscribe((result: any) => { container.subscribe((result: any) => {
...@@ -195,6 +204,9 @@ ...@@ -195,6 +204,9 @@
<#elseif dataview.getOpenMode()?index_of('DRAWER') == 0> <#elseif dataview.getOpenMode()?index_of('DRAWER') == 0>
<#-- 打开抽屉 --> <#-- 打开抽屉 -->
const _this: any = this; const _this: any = this;
if(fullargs && fullargs.copymode){
Object.assign(data,{copymode:true});
}
const openDrawer = (view: any, data: any) => { const openDrawer = (view: any, data: any) => {
let container: Subject<any> = this.$appdrawer.openDrawer(view, tempContext, data); let container: Subject<any> = this.$appdrawer.openDrawer(view, tempContext, data);
container.subscribe((result: any) => { container.subscribe((result: any) => {
...@@ -218,6 +230,9 @@ ...@@ -218,6 +230,9 @@
<#elseif dataview.getOpenMode() == 'POPOVER'> <#elseif dataview.getOpenMode() == 'POPOVER'>
<#-- 打开气泡卡片 --> <#-- 打开气泡卡片 -->
const _this: any = this; const _this: any = this;
if(fullargs && fullargs.copymode){
Object.assign(data,{copymode:true});
}
const openPopOver = (view: any, data: any) => { const openPopOver = (view: any, data: any) => {
let container: Subject<any> = this.$apppopover.openPop($event, view, tempContext, data); let container: Subject<any> = this.$apppopover.openPop($event, view, tempContext, data);
container.subscribe((result: any) => { container.subscribe((result: any) => {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册