提交 ee01c950 编写于 作者: Mosher's avatar Mosher

新增列表操作栏界面行为权限计算

上级 0b9de23d
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
${ListContent} ${ListContent}
<div class="app-list-item-action"> <div class="app-list-item-action">
<template v-for="(action,index) in Object.keys(actionModel)"> <template v-for="(action,index) in Object.keys(actionModel)">
<a :key="index" style="display: inline-block;margin: 0 12px;" @click="uiAction(item, action, $event)"> <a :key="index" style="display: inline-block;margin: 0 12px;" v-show="item[action].visabled" :disabled="item[action].disabled" @click="uiAction(item, action, $event)">
<i :class="actionModel[action].icon" style="margin-right:2px;"></i> <i :class="actionModel[action].icon" style="margin-right:2px;"></i>
<span>{{actionModel[action].caption}}</span> <span>{{actionModel[action].caption}}</span>
</a> </a>
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
${ListContent} ${ListContent}
<div calss="app-list-item-action"> <div calss="app-list-item-action">
<template v-for="(action,index) in Object.keys(actionModel)"> <template v-for="(action,index) in Object.keys(actionModel)">
<a :key="index" style="display: inline-block;margin: 0 12px;" @click="uiAction(item, action, $event)"> <a :key="index" style="display: inline-block;margin: 0 12px;" v-show="item[action].visabled" :disabled="item[action].disabled" @click="uiAction(item, action, $event)">
<i :class="actionModel[action].icon" style="margin-right:2px;"></i> <i :class="actionModel[action].icon" style="margin-right:2px;"></i>
<span>{{actionModel[action].caption}}</span> <span>{{actionModel[action].caption}}</span>
</a> </a>
...@@ -136,6 +136,14 @@ import CodeListService from "@/codelist/codelist-service"; ...@@ -136,6 +136,14 @@ import CodeListService from "@/codelist/codelist-service";
*/ */
public codeListService:CodeListService = new CodeListService({ $store: this.$store }); public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 界面UI服务对象
*
* @type {${srfclassname('${appde.getCodeName()}')}UIService}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appUIService:${srfclassname('${appde.getCodeName()}')}UIService = new ${srfclassname('${appde.getCodeName()}')}UIService(this.$store);
/** /**
* 获取多项数据 * 获取多项数据
* *
...@@ -660,6 +668,9 @@ import CodeListService from "@/codelist/codelist-service"; ...@@ -660,6 +668,9 @@ import CodeListService from "@/codelist/codelist-service";
this.items = this.arrayNonRepeatfy(this.items); this.items = this.arrayNonRepeatfy(this.items);
} }
this.isAddBehind = false; this.isAddBehind = false;
this.items.forEach((item: any) => {
Object.assign(item,this.getActionState(item));
})
this.$emit('load', this.items); this.$emit('load', this.items);
//在导航视图中,如已有选中数据,则右侧展开已选中数据的视图,如无选中数据则默认选中第一条 //在导航视图中,如已有选中数据,则右侧展开已选中数据的视图,如无选中数据则默认选中第一条
if(this.isSelectFirstDefault){ if(this.isSelectFirstDefault){
...@@ -968,6 +979,19 @@ import CodeListService from "@/codelist/codelist-service"; ...@@ -968,6 +979,19 @@ import CodeListService from "@/codelist/codelist-service";
</#if> </#if>
} }
/**
* 获取界面行为权限状态
*
* @param {*} data 当前列表行数据
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getActionState(data:any){
let tempActionModel:any = JSON.parse(JSON.stringify(this.actionModel));
let targetData:any = this.transformData(data);
ViewTool.calcActionItemAuthState(targetData,tempActionModel,this.appUIService);
return tempActionModel;
}
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册