@jecloud/func
Version:
JECloud 功能库
1 lines • 1.45 kB
JavaScript
import{createVNode as n}from"vue";import{getDeveloper as e,getGlobalConfig as o}from"../../config-provider";import{clearFuncStaticize as u}from"../../data/api/function";import c from"../src/func-config-menu";import{getFuncCache as f,clearFuncCache as i}from"../../func-util";export function useFuncConfig(u){var f,i=u.parent;if(u.disabled)return{configMenuSlot:function(){}};var t=e(),a=i.getFuncData(),l=a.info,d=l.funcId,C=l.funcCode,m=l.tableCode;a.hasConfigPerm()&&(null===(f=o("initFuncMicroApp"))||void 0===f||f());return{configMenuSlot:function(){var e=t.value?t.value.MenuConfig:[];return e.length&&a.hasConfigPerm()?n(c,{onClick:function(n){r({key:n.key,funcId:d,funcCode:C,tableCode:m,parent:i})},menus:e},null):null}}}export function useFuncFieldConfig(n){var o=n.$func,u=e(),c=o.getFuncData();return{labelDblclick:function(n){u.value&&c.hasConfigPerm()&&r({key:"FuncFormField",funcId:n.funcId,code:n.name})}}}function r(n){var o,u,c=n.key,f=n.funcId,i=n.funcCode,r=n.tableCode,a=n.code,l=n.parent,d=e();"FuncRefresh"===c?t({funcCode:i,tableCode:r,parent:l}):null===(u=(o=d.value).showFuncConfig)||void 0===u||u.call(o,{key:c,funcId:f,code:a})}function t(n){var e=n.funcCode,o=n.tableCode,c=n.parent,r=f(e),t=[e];r.fields.childFunc.forEach((function(n){i(n.funcCode),t.includes(n.funcCode)||t.push(n.funcCode)})),u({funcCode:t.join(","),tableCode:o}).then((function(){var n;null===(n=null==c?void 0:c.reload)||void 0===n||n.call(c)}))}