Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz4jVue
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
iBiz4jVue
提交
e7cf26f0
提交
e7cf26f0
编写于
8月 31, 2020
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加计算面板按钮权限状态逻辑
上级
397ede00
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
51 行增加
和
16 行删除
+51
-16
CONTROL-BASE.vue.ftl
@CONTROL/面板/CONTROL-BASE.vue.ftl
+51
-16
未找到文件。
@CONTROL/面板/CONTROL-BASE.vue.ftl
浏览文件 @
e7cf26f0
...
...
@@ -50,24 +50,20 @@ import CodeListService from "@service/app/codelist-service";
@Prop() public inputData?: any;
/**
*
代码表服务
对象
*
UI数据
对象
*
* @type {
CodeListService
}
* @type {
*
}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public
codeListService:CodeListService = new CodeListService({ $store:this.$store })
;
public
data:any = {}
;
/**
*
详情模型集合
*
面板数据对象
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public detailsModel: any = {
<#list ctrl.getAllPSPanelItems() as panelItem>
${panelItem.name}: ${P.getPartCode(panelItem, 'ITEM_MODEL').code},
</#list>
};
public panelData:any = null;
/**
* 数据模型对象
...
...
@@ -78,20 +74,34 @@ import CodeListService from "@service/app/codelist-service";
public dataModel:${srfclassname('${ctrl.codeName}')}Model = new ${srfclassname('${ctrl.codeName}')}Model();
/**
*
UI数据
对象
*
代码表服务
对象
*
* @type {
*
}
* @type {
CodeListService
}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public
data:any = {}
;
public
codeListService:CodeListService = new CodeListService({ $store:this.$store })
;
<#if appde??>
/**
* 面板数据对象
* 界面UI服务对象
*
* @type {${srfclassname('${appde.getCodeName()}')}UIService}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appUIService:${srfclassname('${appde.getCodeName()}')}UIService = new ${srfclassname('${appde.getCodeName()}')}UIService(this.$store);
</#if>
/**
* 详情模型集合
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public panelData:any = null;
public detailsModel: any = {
<#list ctrl.getAllPSPanelItems() as panelItem>
${panelItem.name}: ${P.getPartCode(panelItem, 'ITEM_MODEL').code},
</#list>
};
/**
* 值规则对象
...
...
@@ -122,6 +132,7 @@ import CodeListService from "@service/app/codelist-service";
if(newVal){
this.computedUIData(newVal);
this.panelData = Util.deepCopy(newVal);
this.computeButtonState(newVal);
this.panelLogic({ name: '', newVal: null, oldVal: null });
this.$forceUpdate();
}
...
...
@@ -141,6 +152,31 @@ import CodeListService from "@service/app/codelist-service";
}
}
/**
* 计算面板按钮权限状态
*
* @param {*} [data] 传入数据
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public computeButtonState(data:any){
// 若为项布局面板,存在parentRef
if(this.parentRef){
let targetData:any = this.parentRef.transformData(data);
if(this.detailsModel && Object.keys(this.detailsModel).length >0){
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].itemType,"BUTTON")){
this.detailsModel[name].isPower = true;
let tempUIAction:any = JSON.parse(JSON.stringify(this.detailsModel[name].uiaction));
let result: any[] = ViewTool.calcActionItemAuthState(targetData,[tempUIAction],this.appUIService?this.appUIService:null);
this.detailsModel[name].visible = tempUIAction.visabled;
this.detailsModel[name].disabled = tempUIAction.disabled;
this.detailsModel[name].isPower = result[0] === 1 ? true : false;
}
})
}
}
}
/**
* 界面行为
*
...
...
@@ -203,7 +239,7 @@ import CodeListService from "@service/app/codelist-service";
* 刷新
*
* @param {*} [opt={}]
* @memberof
Main
* @memberof
${srfclassname('${ctrl.codeName}')}Base
*/
public refresh(opt: any = {}) {
if (this.parentRef.refresh && this.parentRef.refresh instanceof Function) {
...
...
@@ -211,7 +247,6 @@ import CodeListService from "@service/app/codelist-service";
}
}
/**
* 设置变更面板编辑项的值
*
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录