UNPKG

@jecloud/func

Version:

JECloud 功能库

1 lines 827 B
import{computed as t}from"vue";import{FuncButtonTypeEnum as n}from"../../func-util";export function usePermAction(t){return{funcButtonPerm:r.bind(this,t),gridEditPerm:e.bind(this,t),formEditPerm:i.bind(this,t)}}function r(t,n){var r=n.type,i=n.buttons,e=t.store;if("form"===r){var u=i.filter((function(t){return!(t.hidden||isFormBackButton(t)&&e.isFuncForm)}));return u=u.filter((function(t){return!t.hidden}))}}function i(r){var i=r.getFuncData().getData("buttons.grid").find((function(t){return t.code===n.GRID_EDIT_BUTTON&&!t.disabled}));return t((function(){return!!i}))}function e(r){var i=r.getFuncData().getData("buttons.grid").find((function(t){return t.code===n.GRID_UPDATE_BUTTON&&!t.disabled}));return t((function(){return i&&!r.store.gridReadOnly}))}export function isFormBackButton(t){return"formBackBtn"===t.code}