Files
aiot-platform-ui/apps/web-antd/dist/js/index-Dq8a7AFD.js

2 lines
5.7 KiB
JavaScript

var R=Object.defineProperty,U=Object.defineProperties;var $=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var S=(o,s,t)=>s in o?R(o,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[s]=t,b=(o,s)=>{for(var t in s||(s={}))F.call(s,t)&&S(o,t,s[t]);if(P)for(var t of P(s))G.call(s,t)&&S(o,t,s[t]);return o},I=(o,s)=>U(o,$(s));var h=(o,s,t)=>new Promise((_,f)=>{var k=n=>{try{a(t.next(n))}catch(e){f(e)}},g=n=>{try{a(t.throw(n))}catch(e){f(e)}},a=n=>n.done?_(n.value):Promise.resolve(n.value).then(k,g);a((t=t.apply(o,s)).next())});import"./vxe-table-C9eY8pUC.js";import{c as O,a as W}from"./index-DP6iB9_a.js";import{h as V,c as q}from"./index-CfpjV3Gn.js";import{_ as L}from"./dict-tag.vue_vue_type_script_setup_true_lang-BZwqGgTH.js";import{at as M,$ as D,ay as T,c4 as x,a9 as v,bS as j}from"./bootstrap-DsjPfOC_.js";import{b as z}from"./index-iYJfC2_m.js";import{g as H}from"./rangePickerProps-CXRhwW6k.js";import{D as E}from"./dict-enum-DRf9W45H.js";import{_ as J}from"./table-action.vue_vue_type_script_setup_true_lang-BCG7vvPF.js";import{B as C}from"./biz-bpm-enum-DQJBn5Qr.js";import{_ as Y}from"./doc-alert.vue_vue_type_script_setup_true_lang-DEHj2GIF.js";import{_ as K}from"./page.vue_vue_type_script_setup_true_lang-BL-xU9lB.js";import{b as Q}from"./AlertBuilder-ElnyTeiq.js";import{m as X,ab as B,b2 as r,bJ as c,j as d,u as i,ad as m,I as A,ai as y,bp as p,bb as Z,ae as w,L as ee}from"../jse/index-index-CO0ZsLf2.js";import{u as te}from"./use-vxe-grid-z_YbcgDZ.js";import{A as N}from"./icons-CieLeI1V.js";import"./index-vahqJcxE.js";import"./circle-check-big-I5cuJCPZ.js";import"./x--itLcJVB.js";function ae(){return[{fieldName:"name",label:"流程名称",component:"Input",componentProps:{placeholder:"请输入流程名称",allowClear:!0}},{fieldName:"processDefinitionId",label:"所属流程",component:"ApiSelect",componentProps:{placeholder:"请选择流程定义",allowClear:!0,api:O,labelField:"name",valueField:"id"}},{fieldName:"category",label:"流程分类",component:"ApiSelect",componentProps:{placeholder:"请输入流程分类",allowClear:!0,api:z,labelField:"name",valueField:"code"}},{fieldName:"status",label:"流程状态",component:"Select",componentProps:{options:M(E.BPM_PROCESS_INSTANCE_STATUS,"number"),placeholder:"请选择流程状态",allowClear:!0}},{fieldName:"createTime",label:"发起时间",component:"RangePicker",componentProps:I(b({},H()),{allowClear:!0})}]}function se(){return[{field:"name",title:"流程名称",minWidth:200,fixed:"left"},{field:"summary",title:"摘要",minWidth:200,slots:{default:"slot-summary"}},{field:"categoryName",title:"流程分类",minWidth:120,fixed:"left"},{field:"status",title:"流程状态",minWidth:250,slots:{default:"slot-status"}},{field:"startTime",title:"发起时间",minWidth:180,formatter:"formatDateTime"},{field:"endTime",title:"结束时间",minWidth:180,formatter:"formatDateTime"},{title:"操作",width:180,fixed:"right",slots:{default:"actions"}}]}const ie={key:0,class:"flex flex-col py-2"},ne={class:"text-gray-500"},oe={key:1},le={key:0},re={key:1},ve=X({name:"BpmProcessInstanceMy",__name:"index",setup(o){function s(){g.query()}function t(a){x.push({name:"BpmProcessInstanceDetail",query:{id:a.id}})}function _(a){return h(this,null,function*(){if(a!=null&&a.id&&(yield W(a.processDefinitionId)).formType===20){v.error("重新发起流程失败,原因:该流程使用业务表单,不支持重新发起");return}yield x.push({name:"BpmProcessInstanceCreate",query:{processInstanceId:a==null?void 0:a.id}})})}function f(a){Q({component:()=>ee(j,{placeholder:"请输入取消原因",allowClear:!0,rows:2}),content:"请输入取消原因",title:"取消流程",modelPropName:"value"}).then(n=>h(null,null,function*(){n&&(yield q(a.id,n),v.success("取消成功"),s())}))}const[k,g]=te({formOptions:{schema:ae()},gridOptions:{columns:se(),height:"auto",keepSource:!0,proxyConfig:{ajax:{query:(e,u)=>h(null,[e,u],function*({page:a},n){return yield V(b({pageNo:a.currentPage,pageSize:a.pageSize},n))})}},rowConfig:{keyField:"id",isHover:!0},toolbarConfig:{refresh:!0,search:!0}}});return(a,n)=>(r(),B(i(K),{"auto-content-height":""},{doc:c(()=>[d(i(Y),{title:"流程发起、取消、重新发起",url:"https://doc.iocoder.cn/bpm/process-instance"})]),default:c(()=>[d(i(k),{"table-title":"流程状态"},{"slot-summary":c(({row:e})=>[e.summary&&e.summary.length>0?(r(),m("div",ie,[(r(!0),m(A,null,Z(e.summary,(u,l)=>(r(),m("div",{key:l},[w("span",ne,p(u.key)+" : "+p(u.value),1)]))),128))])):(r(),m("div",oe,"-"))]),"slot-status":c(({row:e})=>{var u;return[e.status===i(C).RUNNING&&((u=e.tasks)==null?void 0:u.length)>0?(r(),m(A,{key:0},[e.tasks.length===1?(r(),m("span",le,[d(i(T),{type:"link",onClick:l=>t(e)},{default:c(()=>{var l;return[y(p((l=e.tasks[0].assigneeUser)==null?void 0:l.nickname),1)]}),_:2},1032,["onClick"]),y(" ("+p(e.tasks[0].name)+") 审批中 ",1)])):(r(),m("span",re,[d(i(T),{type:"link",onClick:l=>t(e)},{default:c(()=>{var l;return[y(p((l=e.tasks[0].assigneeUser)==null?void 0:l.nickname),1)]}),_:2},1032,["onClick"]),y(" 等 "+p(e.tasks.length)+" 人 ("+p(e.tasks[0].name)+")审批中 ",1)]))],64)):(r(),B(i(L),{key:1,type:i(E).BPM_PROCESS_INSTANCE_STATUS,value:e.status},null,8,["type","value"]))]}),actions:c(({row:e})=>[d(i(J),{actions:[{label:i(D)("common.detail"),type:"link",icon:i(N).VIEW,auth:["bpm:process-instance:query"],onClick:t.bind(null,e)},{label:i(D)("ui.actionTitle.cancel"),type:"link",danger:!0,icon:i(N).DELETE,ifShow:e.status===i(C).RUNNING,auth:["bpm:process-instance:cancel"],onClick:f.bind(null,e)},{label:"重新发起",type:"link",icon:i(N).ADD,ifShow:e.status!==i(C).RUNNING,auth:["bpm:process-instance:create"],onClick:_.bind(null,e)}]},null,8,["actions"])]),_:1})]),_:1}))}});export{ve as default};