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

解决表单动态隐藏和权限控制冲突问题

上级 03958ae3
...@@ -562,6 +562,7 @@ import schema from 'async-validator'; ...@@ -562,6 +562,7 @@ import schema from 'async-validator';
} }
</#if> </#if>
this.setFormEnableCond(data); this.setFormEnableCond(data);
this.computeButtonState(data);
this.fillForm(data,action); this.fillForm(data,action);
<#if ctrl.getControlType() == 'FORM'> <#if ctrl.getControlType() == 'FORM'>
this.oldData = {}; this.oldData = {};
...@@ -741,10 +742,12 @@ import schema from 'async-validator'; ...@@ -741,10 +742,12 @@ import schema from 'async-validator';
if(this.detailsModel && Object.keys(this.detailsModel).length >0){ if(this.detailsModel && Object.keys(this.detailsModel).length >0){
Object.keys(this.detailsModel).forEach((name:any) =>{ Object.keys(this.detailsModel).forEach((name:any) =>{
if(this.detailsModel[name] && this.detailsModel[name].uiaction && this.detailsModel[name].uiaction.dataaccaction && Object.is(this.detailsModel[name].detailType,"BUTTON")){ if(this.detailsModel[name] && this.detailsModel[name].uiaction && this.detailsModel[name].uiaction.dataaccaction && Object.is(this.detailsModel[name].detailType,"BUTTON")){
this.detailsModel[name].isPower = true;
let tempUIAction:any = JSON.parse(JSON.stringify(this.detailsModel[name].uiaction)); let tempUIAction:any = JSON.parse(JSON.stringify(this.detailsModel[name].uiaction));
ViewTool.calcActionItemAuthState(targetData,[tempUIAction],this.appUIService); let result: any[] = ViewTool.calcActionItemAuthState(targetData,[tempUIAction],this.appUIService);
this.detailsModel[name].visible = tempUIAction.visabled; this.detailsModel[name].visible = tempUIAction.visabled;
this.detailsModel[name].disabled = tempUIAction.disabled; this.detailsModel[name].disabled = tempUIAction.disabled;
this.detailsModel[name].isPower = result[0] === 1 ? true : false;
} }
}) })
} }
...@@ -1044,7 +1047,6 @@ import schema from 'async-validator'; ...@@ -1044,7 +1047,6 @@ import schema from 'async-validator';
const data = response.data; const data = response.data;
this.onFormLoad(data,'load'); this.onFormLoad(data,'load');
this.$emit('load', data); this.$emit('load', data);
this.computeButtonState(data);
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'load', data: data }); this.formState.next({ type: 'load', data: data });
}); });
...@@ -1095,7 +1097,6 @@ import schema from 'async-validator'; ...@@ -1095,7 +1097,6 @@ import schema from 'async-validator';
</#list> </#list>
data.${appde.getCodeName()?lower_case} = null; data.${appde.getCodeName()?lower_case} = null;
this.$emit('load', data); this.$emit('load', data);
this.computeButtonState(data);
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'load', data: data }); this.formState.next({ type: 'load', data: data });
}); });
...@@ -1153,7 +1154,6 @@ import schema from 'async-validator'; ...@@ -1153,7 +1154,6 @@ import schema from 'async-validator';
const data = response.data; const data = response.data;
this.onFormLoad(data,'autoSave'); this.onFormLoad(data,'autoSave');
this.$emit('save', data); this.$emit('save', data);
this.computeButtonState(data);
<#if ctrl.getControlType() == 'FORM'> <#if ctrl.getControlType() == 'FORM'>
AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data}); AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if> </#if>
...@@ -1240,7 +1240,6 @@ import schema from 'async-validator'; ...@@ -1240,7 +1240,6 @@ import schema from 'async-validator';
const data = response.data; const data = response.data;
this.onFormLoad(data,'save'); this.onFormLoad(data,'save');
this.$emit('save', data); this.$emit('save', data);
this.computeButtonState(data);
<#if ctrl.getControlType() == 'FORM'> <#if ctrl.getControlType() == 'FORM'>
AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data}); AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if> </#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册