import{d as W,u as X,Q as Z,J as j,r as y,A as G,dz as ee,b as ae,a1 as le,o as s,c as b,k as a,B as t,a as l,a2 as E,F as g,i as S,g as p,a3 as te,N as R,O as d,P as k,D as Y,C as oe,b9 as re,a7 as se,S as ne,$ as ie,R as pe,T as ue,U as de,V as me,W as ce,X as fe,Y as ye,Z as _e}from"./index-BP6bNRoi.js";import{_ as we}from"./index.vue_vue_type_script_setup_true_lang-sJUY8qtC.js";import{_ as be}from"./DictTag.vue_vue_type_script_lang-DwXPHgid.js";import{_ as ge}from"./ContentWrap.vue_vue_type_script_setup_true_lang-CR_2gECF.js";import{d as z,a as ke}from"./formatTime-DwR9f7DP.js";import{b as ve,c as he}from"./index-DMqCuIfZ.js";import{C as xe}from"./index-qIioACxn.js";import{a as Se}from"./index-C5h6z2YM.js";import"./index-BZESAUPP.js";import"./color-DXkOL5Tu.js";import"./el-card-bU92WWV4.js";const Ce=W({name:"BpmProcessInstanceMy",__name:"index",setup(Te){const C=X(),T=Z(),{t:V}=j(),v=y(!0),I=y(0),D=y([]),o=G({pageNo:1,pageSize:10,name:"",processDefinitionId:void 0,category:void 0,status:void 0,createTime:[]}),P=y(),N=y([]),c=async()=>{v.value=!0;try{const n=await ve(o);D.value=n.list,I.value=n.total}finally{v.value=!1}},_=()=>{o.pageNo=1,c()},O=()=>{P.value.resetFields(),_()},U=async n=>{if(n!=null&&n.id&&(await Se(n.processDefinitionId)).formType===20)return void T.error("\u91CD\u65B0\u53D1\u8D77\u6D41\u7A0B\u5931\u8D25\uFF0C\u539F\u56E0\uFF1A\u8BE5\u6D41\u7A0B\u4F7F\u7528\u4E1A\u52A1\u8868\u5355\uFF0C\u4E0D\u652F\u6301\u91CD\u65B0\u53D1\u8D77");await C.push({name:"BpmProcessInstanceCreate",query:{processInstanceId:n==null?void 0:n.id}})};return ee(()=>{c()}),ae(async()=>{await c(),N.value=await xe.getCategorySimpleList()}),(n,r)=>{const M=se,m=ne,B=ie,q=pe,F=ue,h=de,u=me,H=ce,A=ge,i=fe,$=be,K=ye,J=we,x=le("hasPermi"),L=_e;return s(),b(g,null,[a(A,null,{default:t(()=>[a(H,{class:"-mb-15px",model:l(o),ref_key:"queryFormRef",ref:P,inline:!0,"label-width":"68px"},{default:t(()=>[a(m,{label:"\u6D41\u7A0B\u540D\u79F0",prop:"name"},{default:t(()=>[a(M,{modelValue:l(o).name,"onUpdate:modelValue":r[0]||(r[0]=e=>l(o).name=e),placeholder:"\u8BF7\u8F93\u5165\u6D41\u7A0B\u540D\u79F0",clearable:"",onKeyup:E(_,["enter"]),class:"!w-240px"},null,8,["modelValue"])]),_:1}),a(m,{label:"\u6240\u5C5E\u6D41\u7A0B",prop:"processDefinitionId"},{default:t(()=>[a(M,{modelValue:l(o).processDefinitionId,"onUpdate:modelValue":r[1]||(r[1]=e=>l(o).processDefinitionId=e),placeholder:"\u8BF7\u8F93\u5165\u6D41\u7A0B\u5B9A\u4E49\u7684\u7F16\u53F7",clearable:"",onKeyup:E(_,["enter"]),class:"!w-240px"},null,8,["modelValue"])]),_:1}),a(m,{label:"\u6D41\u7A0B\u5206\u7C7B",prop:"category"},{default:t(()=>[a(q,{modelValue:l(o).category,"onUpdate:modelValue":r[2]||(r[2]=e=>l(o).category=e),placeholder:"\u8BF7\u9009\u62E9\u6D41\u7A0B\u5206\u7C7B",clearable:"",class:"!w-240px"},{default:t(()=>[(s(!0),b(g,null,S(l(N),e=>(s(),p(B,{key:e.code,label:e.name,value:e.code},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(m,{label:"\u6D41\u7A0B\u72B6\u6001",prop:"status"},{default:t(()=>[a(q,{modelValue:l(o).status,"onUpdate:modelValue":r[3]||(r[3]=e=>l(o).status=e),placeholder:"\u8BF7\u9009\u62E9\u6D41\u7A0B\u72B6\u6001",clearable:"",class:"!w-240px"},{default:t(()=>[(s(!0),b(g,null,S(l(te)(l(R).BPM_PROCESS_INSTANCE_STATUS),e=>(s(),p(B,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(m,{label:"\u53D1\u8D77\u65F6\u95F4",prop:"createTime"},{default:t(()=>[a(F,{modelValue:l(o).createTime,"onUpdate:modelValue":r[4]||(r[4]=e=>l(o).createTime=e),"value-format":"YYYY-MM-DD HH:mm:ss",type:"daterange","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F","default-time":[new Date("1 00:00:00"),new Date("1 23:59:59")],class:"!w-240px"},null,8,["modelValue","default-time"])]),_:1}),a(m,null,{default:t(()=>[a(u,{onClick:_},{default:t(()=>[a(h,{icon:"ep:search",class:"mr-5px"}),d(" \u641C\u7D22")]),_:1}),a(u,{onClick:O},{default:t(()=>[a(h,{icon:"ep:refresh",class:"mr-5px"}),d(" \u91CD\u7F6E")]),_:1}),k((s(),p(u,{type:"primary",plain:"",onClick:r[5]||(r[5]=e=>U(void 0))},{default:t(()=>[a(h,{icon:"ep:plus",class:"mr-5px"}),d(" \u53D1\u8D77\u6D41\u7A0B ")]),_:1})),[[x,["bpm:process-instance:query"]]])]),_:1})]),_:1},8,["model"])]),_:1}),a(A,null,{default:t(()=>[k((s(),p(K,{data:l(D)},{default:t(()=>[a(i,{label:"\u6D41\u7A0B\u540D\u79F0",align:"center",prop:"name","min-width":"200px",fixed:"left"}),a(i,{label:"\u6D41\u7A0B\u5206\u7C7B",align:"center",prop:"categoryName","min-width":"100",fixed:"left"}),a(i,{label:"\u6D41\u7A0B\u72B6\u6001",prop:"status",width:"120"},{default:t(e=>[a($,{type:l(R).BPM_PROCESS_INSTANCE_STATUS,value:e.row.status},null,8,["type","value"])]),_:1}),a(i,{label:"\u53D1\u8D77\u65F6\u95F4",align:"center",prop:"startTime",width:"180",formatter:l(z)},null,8,["formatter"]),a(i,{label:"\u7ED3\u675F\u65F6\u95F4",align:"center",prop:"endTime",width:"180",formatter:l(z)},null,8,["formatter"]),a(i,{align:"center",label:"\u8017\u65F6",prop:"durationInMillis",width:"160"},{default:t(e=>[d(Y(e.row.durationInMillis>0?l(ke)(e.row.durationInMillis):"-"),1)]),_:1}),a(i,{label:"\u5F53\u524D\u5BA1\u6279\u4EFB\u52A1",align:"center",prop:"tasks","min-width":"120px"},{default:t(e=>[(s(!0),b(g,null,S(e.row.tasks,f=>(s(),p(u,{type:"primary",key:f.id,link:""},{default:t(()=>[oe("span",null,Y(f.name),1)]),_:2},1024))),128))]),_:1}),a(i,{label:"\u6D41\u7A0B\u7F16\u53F7",align:"center",prop:"id","min-width":"320px"}),a(i,{label:"\u64CD\u4F5C",align:"center",fixed:"right",width:"180"},{default:t(e=>[k((s(),p(u,{link:"",type:"primary",onClick:f=>{return w=e.row,void C.push({name:"BpmProcessInstanceDetail",query:{id:w.id}});var w}},{default:t(()=>[d(" \u8BE6\u60C5 ")]),_:2},1032,["onClick"])),[[x,["bpm:process-instance:cancel"]]]),e.row.status===1?k((s(),p(u,{key:0,link:"",type:"primary",onClick:f=>(async w=>{const{value:Q}=await re.prompt("\u8BF7\u8F93\u5165\u53D6\u6D88\u539F\u56E0","\u53D6\u6D88\u6D41\u7A0B",{confirmButtonText:V("common.ok"),cancelButtonText:V("common.cancel"),inputPattern:/^[\s\S]*.*\S[\s\S]*$/,inputErrorMessage:"\u53D6\u6D88\u539F\u56E0\u4E0D\u80FD\u4E3A\u7A7A"});await he(w.id,Q),T.success("\u53D6\u6D88\u6210\u529F"),await c()})(e.row)},{default:t(()=>[d(" \u53D6\u6D88 ")]),_:2},1032,["onClick"])),[[x,["bpm:process-instance:query"]]]):(s(),p(u,{key:1,link:"",type:"primary",onClick:f=>U(e.row)},{default:t(()=>[d(" \u91CD\u65B0\u53D1\u8D77 ")]),_:2},1032,["onClick"]))]),_:1})]),_:1},8,["data"])),[[L,l(v)]]),a(J,{total:l(I),page:l(o).pageNo,"onUpdate:page":r[6]||(r[6]=e=>l(o).pageNo=e),limit:l(o).pageSize,"onUpdate:limit":r[7]||(r[7]=e=>l(o).pageSize=e),onPagination:c},null,8,["total","page","limit"])]),_:1})],64)}}});export{Ce as default};