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

表单按钮、表格操作列单机模式支持

上级 e97e486c
...@@ -13,6 +13,7 @@ ${ctrl.render.code} ...@@ -13,6 +13,7 @@ ${ctrl.render.code}
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail'; import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import schema from 'async-validator'; import schema from 'async-validator';
import { Environment } from '@/environments/environment';
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
...@@ -738,18 +739,20 @@ import schema from 'async-validator'; ...@@ -738,18 +739,20 @@ import schema from 'async-validator';
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public computeButtonState(data:any){ public computeButtonState(data:any){
let targetData:any = this.transformData(data); if(Environment.enablePermissionValid){
if(this.detailsModel && Object.keys(this.detailsModel).length >0){ let targetData:any = this.transformData(data);
Object.keys(this.detailsModel).forEach((name:any) =>{ if(this.detailsModel && Object.keys(this.detailsModel).length >0){
if(this.detailsModel[name] && this.detailsModel[name].uiaction && this.detailsModel[name].uiaction.dataaccaction && Object.is(this.detailsModel[name].detailType,"BUTTON")){ Object.keys(this.detailsModel).forEach((name:any) =>{
this.detailsModel[name].isPower = true; if(this.detailsModel[name] && this.detailsModel[name].uiaction && this.detailsModel[name].uiaction.dataaccaction && Object.is(this.detailsModel[name].detailType,"BUTTON")){
let tempUIAction:any = JSON.parse(JSON.stringify(this.detailsModel[name].uiaction)); this.detailsModel[name].isPower = true;
let result: any[] = ViewTool.calcActionItemAuthState(targetData,[tempUIAction],this.appUIService); let tempUIAction:any = JSON.parse(JSON.stringify(this.detailsModel[name].uiaction));
this.detailsModel[name].visible = tempUIAction.visabled; let result: any[] = ViewTool.calcActionItemAuthState(targetData,[tempUIAction],this.appUIService);
this.detailsModel[name].disabled = tempUIAction.disabled; this.detailsModel[name].visible = tempUIAction.visabled;
this.detailsModel[name].isPower = result[0] === 1 ? true : false; this.detailsModel[name].disabled = tempUIAction.disabled;
} this.detailsModel[name].isPower = result[0] === 1 ? true : false;
}) }
})
}
} }
} }
......
...@@ -107,6 +107,7 @@ ${ctrl.render.code} ...@@ -107,6 +107,7 @@ ${ctrl.render.code}
<#assign import_block> <#assign import_block>
import CodeListService from "@service/app/codelist-service"; import CodeListService from "@service/app/codelist-service";
import { FormItemModel } from '@/model/form-detail'; import { FormItemModel } from '@/model/form-detail';
import { Environment } from '@/environments/environment';
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
...@@ -545,9 +546,11 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -545,9 +546,11 @@ import { FormItemModel } from '@/model/form-detail';
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public getActionState(data:any){ public getActionState(data:any){
let targetData:any = this.transformData(data);
let tempActionModel:any = JSON.parse(JSON.stringify(this.ActionModel)); let tempActionModel:any = JSON.parse(JSON.stringify(this.ActionModel));
ViewTool.calcActionItemAuthState(targetData,tempActionModel,this.appUIService); if(Environment.enablePermissionValid){
let targetData:any = this.transformData(data);
ViewTool.calcActionItemAuthState(targetData,tempActionModel,this.appUIService);
}
return tempActionModel; return tempActionModel;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册