Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

2 строки
4.6KB

  1. import J from"./childFlow-f51d5df4.js";import{p as R}from"./playCircle-8f852ac1.js";import T from"./approvalDialog-e1c4e9e8.js";import{g as P,h as V}from"./flowConfiguration-e3261cd3.js";import{_ as L,y as q,x as B,a as M,r as _,o as F,am as y,b as u,c as U,d as z,f as d,h as i,e as a,t as G,u as O,i as c,F as H,k as K,C as Q,s as W}from"./index-dd5fae99.js";import{p as X}from"./flowPathConfiguration-3512bcb6.js";import"./index-4950cfb0.js";import"./unitManage-104cfe86.js";const Y={class:"flex justify-between items-center"},Z={class:"overflow-x-auto flex"},ee={class:"node flex flex-1 flex-col items-center justify-center"},te={class:"start_box node_box text-white flex items-center justify-center"},ne=["src"],se={class:"flex flex-col"},oe=K({name:"configEdit"}),re=Object.assign(oe,{setup(le){const{proxy:w}=W(),S=q(),v=B(),f=({key:t,type:e,item:n})=>{let s={};s={name:e==="APPROVAL"?"审批":e==="CONSTRCTION"?"建设申报审批":e==="CC"?"抄送":e==="SEAL"?"盖章":"",type:e,props:void 0,id:""},t===-1?m.value.splice(0,0,s):n.splice(t+1,0,s)},k=async(t,e,n,s)=>{e.splice(t,1)},p=M({visible:!1,data:{name:void 0}}),A=({key:t,item:e})=>{p.visible=!0,p.data=e[t],p.orgCode=v.query.orgCode||""},I=t=>{p.visible=!1},j=t=>{Q(()=>{Object.entries(t).forEach(e=>{p.data[e[0]]=e[1]})})},g=_(),x=_(),m=_([]),C=_({}),$=async()=>{const t=await X({processDefId:v.query.processDefId});g.value=t.data.processDefId,x.value=t.data.processDefName,C.value=t.data;const e={children:JSON.parse(t.data.process)};m.value=b([],e,!0)},b=(t,e,n)=>{if(e.branchs){const s=[];e.branchs.forEach(o=>{let l={};if(l={name:o.name,type:o.type,props:o.props,id:n?o.id:void 0},o.children&&JSON.stringify(o.children)!=="{}"){const r=[];o.children.branchs||r.push({name:o.children.name,type:o.children.type,props:o.children.props,id:n?o.children.id:void 0}),b(r,o.children,n),l.children=r}else l.children=[];s.push(l)}),t.push({type:"CONDITIONS",props:{},branchs:s})}return e.children&&JSON.stringify(e.children)!=="{}"&&(e.children.branchs||t.push({name:e.children.name,type:e.children.type,props:e.children.props,id:n?e.children.id:void 0}),b(t,e.children,n)),t},D=()=>{const t=[],e="0123456789abcdef";for(let s=0;s<36;s++)t[s]=e.substr(Math.floor(Math.random()*16),1);return t[14]="4",t[19]=e.substr(t[19]&3|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")},N=(t,e)=>(t=t.reverse(),t.reduce((n,s,o)=>{const l=s.id||D();return e&&o===t.length-1&&(s.parent=e.id),s.branchs?(s.branchs.forEach(r=>{r.parentId=l||null,r.id=r.id||D(),r.children&&r.children.length?r.children=N(r.children,r):r.children&&!r.children.length&&delete r.children}),o?(n.parentId=l||null,{type:"route",id:l,children:n}):(s.id=l,s)):o?(n.parentId=l||null,s.id=l,s.children=n,s):(s.id=l,s)},null)),E=async()=>{let t={};const e=JSON.parse(JSON.stringify(m.value));t=t.children=JSON.parse(JSON.stringify(N(e)));const n={...C.value,process:t};delete n.created,delete n.sort,delete n.updated,delete n.version,await P(n),await V(n),w.$message.success("发布成功")};return F(()=>{$(),g.value=v.query.processDefId}),y("showApprovalDialog",A),y("addNode",f),y("removeNode",k),(t,e)=>{const n=u("el-button"),s=u("Plus"),o=u("el-icon"),l=u("el-popover"),r=u("el-card");return U(),z(H,null,[d(r,{shadow:"never"},{header:i(()=>[a("div",Y,[a("span",null,G(x.value),1),a("div",null,[d(n,{onClick:e[0]||(e[0]=h=>O(S).go(-1))},{default:i(()=>e[5]||(e[5]=[c("返回")])),_:1}),d(n,{type:"primary",onClick:E},{default:i(()=>e[6]||(e[6]=[c("发布")])),_:1})])])]),default:i(()=>[a("div",Z,[a("div",ee,[a("div",te,[e[7]||(e[7]=c(" 开始 ")),a("img",{src:O(R)},null,8,ne)]),d(l,{placement:"right",width:100,trigger:"hover"},{reference:i(()=>[d(o,{class:"add_icon mt-20 mb-20 cursor-pointer"},{default:i(()=>[d(s)]),_:1})]),default:i(()=>[a("div",se,[a("p",null,[d(n,{class:"mb-8 w-full",onClick:e[1]||(e[1]=h=>f({key:-1,type:"APPROVAL"}))},{default:i(()=>e[8]||(e[8]=[c(" 审批人 ")])),_:1})]),a("p",null,[d(n,{class:"ml-1 mb-8 w-full",onClick:e[2]||(e[2]=h=>f({key:-1,type:"SEAL"}))},{default:i(()=>e[9]||(e[9]=[c(" 盖章人 ")])),_:1})]),a("p",null,[d(n,{class:"ml-1 mb-8 w-full",onClick:e[3]||(e[3]=h=>f({key:-1,type:"CC"}))},{default:i(()=>e[10]||(e[10]=[c(" 抄送人 ")])),_:1})]),a("p",null,[d(n,{class:"mb-8 w-full",onClick:e[4]||(e[4]=h=>f({key:-1,type:"CONSTRCTION"}))},{default:i(()=>e[11]||(e[11]=[c(" 建设审批人 ")])),_:1})])])]),_:1}),d(J,{"node-data":m.value},null,8,["node-data"]),e[12]||(e[12]=a("div",{class:"end_box node_box text-white flex items-center justify-center"}," 流程结束 ",-1))])])]),_:1}),d(T,{visible:p.visible,data:p.data,"org-code":p.orgCode,onClose:I,"onUpdate:data":j},null,8,["visible","data","org-code"])],64)}}}),he=L(re,[["__scopeId","data-v-76f7f8eb"]]);export{he as default};