UNPKG

@jecloud/func

Version:

JECloud 功能库

1 lines 652 B
import{createVNode as e}from"vue";import{WorkflowHistory as n}from"@jecloud/plugin";import{watch as o,ref as r}from"vue";export function useWorkflowHistory(a){var t=r(),u=a.getFuncData(),i=u.info.formOptions.useWfLog,f=a.store,c=u.info.pkCode,l=f.activeBean[c],v=r({beanId:l,refresh:!0}),p=function(e){var n=e[c],o=!1;n!=v.value.beanId&&(v.value.beanId=n,o=!0),t.value&&t.value.refresh({beanId:n,clearType:o})};o((function(){return[f.activeBean,f.activeBeanEmitter]}),(function(){p(f.activeBean)}));return{workflowHistorySlot:function(o){var r=o.colSpan;return i?e(n,{ref:t,params:v.value,colSpan:r,onRendered:function(){p(f.activeBean)}},null):null}}}