提交 1585b568 编写于 作者: WodahsOrez's avatar WodahsOrez

lxm--支持拷贝

上级 7ffee219
......@@ -701,8 +701,12 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
this.load(data);
}
if (Object.is('loaddraft', action)) {
if(this.context.srfsourcekey){
this.copy(this.context.srfsourcekey);
}else{
this.loadDraft(data);
}
}
if (Object.is('save', action)) {
this.save(data,data.showResultInfo);
}
......@@ -773,8 +777,18 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
* @param {*} [arg={}]
* @memberof @memberof ${srfclassname('${ctrl.codeName}')}
*/
public copy(arg: any = {}): void {
this.loadDraft(arg);
public copy(srfkey: string): void {
let copyData = this.$store.getters.getCopyData(srfkey);
copyData.srfkey = Util.createUUID();
copyData.${appde.getCodeName()?lower_case} = copyData.srfkey;
copyData.${appde.getKeyPSAppDEField().getCodeName()?lower_case} = copyData.srfkey;
Object.assign(this.context,{${appde.getCodeName()?lower_case}:copyData.${appde.getCodeName()?lower_case}})
this.data = copyData;
this.$nextTick(() => {
this.formState.next({ type: 'load', data: copyData });
this.data.srfuf = '0';
this.setFormEnableCond(this.data);
});
}
/**
......
......@@ -18,14 +18,14 @@
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
Object.assign(data2, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(data2);
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
......
......@@ -90,6 +90,9 @@
<#elseif viewlogic.getNewDataPSAppView()??>
<#assign dataview = viewlogic.getNewDataPSAppView()/>
const data: any = {};
if(args[0].srfsourcekey){
data.srfsourcekey = args[0].srfsourcekey;
}
let curViewParam = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(curViewParam,args[0]);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册