UNPKG

@jecloud/plugin

Version:

JECloud 插件库

1 lines 2.47 kB
import{resolveDirective as t,withDirectives as e,vShow as n,createVNode as l,createTextVNode as i}from"vue";import{defineComponent as o,h as a,ref as r,onMounted as d,nextTick as s}from"vue";import{isNotEmpty as u}from"@jecloud/utils";import{getWorkflowHistory as c}from"../../data/api";export default o({name:"WorkflowHistory",inheritAttrs:!1,props:{params:Object},emits:["rendered","collapsed"],setup:function(o,p){var m=p.expose,h=p.emit,f=r(!0),v=r([]);m({refresh:function(t){var e=t.beanId,n=t.clearType;f.value=!0,n&&(v.value=[]),function(t){u(t)?c({beanId:t}).then((function(t){v.value=t,f.value=!1,h("collapsed",{flag:v.value.length>0})})):v.value=[]}(e)}}),d((function(){s((function(){h("rendered")}))}));var w=function(t){var e=[];if(u(t)&&t.length>0&&t.forEach((function(t){e.push(a("div",{textContent:t}))})),e.length>0)return e};return function(){return v.value.length>0?l("div",{class:"je-workflow-history"},[e(l("table",{class:"history-table"},[l("thead",null,[l("tr",null,[l("th",{width:"140px"},[i("节点名称")]),l("th",{width:"80px"},[i("执行人")]),l("th",{width:"80px"},[i("操作")]),l("th",{"min-width":"220px"},[i("审批意见")]),l("th",{width:"80px"},[i("状态")]),l("th",{width:"110px"},[i("接收时间")]),l("th",{width:"110px"},[i("审核时间")]),l("th",{width:"80px"},[i("耗时")])])]),l("tbody",null,[v.value.map((function(t,o){var a;return"inclusiveGateway"==t.nodeType?l("tr",{key:o},[l("td",{colspan:"8",class:"gateway"},[i("----- "),t.nodeName,i(" -----")])]):l("tr",{key:o,style:{color:"正在处理"==t.operationType?"#7F7F7F":""}},[l("td",null,[t.nodeName]),l("td",null,[w(t.assignees)]),l("td",null,[t.operationType]),u(t.title)||t.comments.length>1?l("td",{class:"opinion-td"},[l("table",{class:"opinion-table"},[e(l("tr",null,[l("td",{colspan:"4",class:"countersign-title",innerHTML:t.title},null)]),[[n,"1"==t.isShowTitle]]),t.comments.map((function(i,o){return l("tr",{style:{color:"未处理"==i.commentType?"#7F7F7F":"#3f3f3f"}},[l("td",{width:"80px"},[i.userName]),e(l("td",{width:"80px"},[i.commentType]),[[n,"kaiteCounterSignUserTask"==t.nodeType]]),l("td",{"min-width":"220px"},[i.comment]),l("td",{width:"110px"},[i.endTime])])}))])]):l("td",null,[null===(a=t.comments[0])||void 0===a?void 0:a.comment]),l("td",{style:{color:"NORMAL"==t.state?"#0A7900":"#D8001B"}},[t.stateName]),l("td",null,[t.startTime]),l("td",null,[t.endTime]),l("td",null,[t.durationInMillis])])}))])]),[[t("loading"),f.value]])]):null}}});