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

4 месяцев назад
1
  1. var T=(U,v,h)=>new Promise((_,c)=>{var S=u=>{try{p(h.next(u))}catch(O){c(O)}},D=u=>{try{p(h.throw(u))}catch(O){c(O)}},p=u=>u.done?_(u.value):Promise.resolve(u.value).then(S,D);p((h=h.apply(U,v)).next())});import z from"./childFlow.d8fc98a0.js";import{p as G}from"./playCircle.1a554fd4.js";import H from"./approvalDialog.62cbd97a.js";import K from"./conditionDialog.470937e9.js";import{b as L,s as Q,c as W}from"./flowConfiguration.65ccb757.js";import{d as X,A as Z,z as ee,b as x,r as P,o as ne,ap as b,c as g,e as te,f as se,h as l,i as f,g as d,t as ae,u as R,j as N,F as oe,N as E,x as re}from"./index.3fb2f955.js";import ie from"./concurrentDialog.83daa6c2.js";import"./index.08840ed2.js";import"./unitManage.fc54fd4b.js";const le={class:"flex justify-between items-center"},de={class:"overflow-x-auto flex"},ce={class:"node flex flex-1 flex-col items-center justify-center"},pe={class:"start_box node_box text-white flex items-center justify-center"},fe=["src"],ue={class:"flex flex-col"},he=d("div",{class:"end_box node_box text-white flex items-center justify-center"}," \u6D41\u7A0B\u7ED3\u675F ",-1),_e=X({name:"configEdit"}),De=Object.assign(_e,{setup(U){const{proxy:v}=re(),h=Z(),_=ee(),c=({key:n,type:e,item:s})=>{let t={};const a=e==="SUB"?"\u5BA1\u6279":e==="CONDITIONS"?"\u6761\u4EF6":e==="CONCURRENTS"?"\u5E76\u884C\u5206\u652F":"\u7A7A\u8282\u70B9";e==="SUB"||e==="EMPTY"?t={name:a,type:e,props:void 0,id:""}:e==="CONCURRENTS"?t={name:a,type:"CONCURRENTS",branchs:[{name:a,type:"CONCURRENT",props:{groups:[]},children:[{type:"AUTO_PASS"}]},{name:"\u5E76\u884C\u5206\u652F",type:"CONCURRENT",props:{groups:[]},children:[{type:"AUTO_PASS"}]}],id:""}:t={name:a,type:"CONDITIONS",branchs:[{name:"\u6240\u6709\u6570\u636E\u53EF\u8FDB\u5165\u8BE5\u5206\u652F",type:"CONDITION",props:{groups:[]},children:[{type:"AUTO_PASS"}]},{name:"\u6240\u6709\u6570\u636E\u53EF\u8FDB\u5165\u8BE5\u5206\u652F",type:"CONDITION",props:{groups:[]},children:[{type:"AUTO_PASS"}]}],id:""},n===-1?(m.value.splice(0,0,t),(e==="CONDITIONS"||e==="CONCURRENTS")&&c({key:n+1,type:"EMPTY",item:m.value})):s.children===void 0?(s.splice(n+1,0,t),(e==="CONDITIONS"||e==="CONCURRENTS")&&c({key:n+1,type:"EMPTY",item:s})):(s.children.splice(0,0,t),(e==="CONDITIONS"||e==="CONCURRENTS")&&c({key:n,type:"EMPTY",item:s.children}))},S=(n,e)=>{const s={name:e==="CONDITIONS"?"\u6240\u6709\u6570\u636E\u53EF\u8FDB\u5165\u8BE5\u5206\u652F":"\u5E76\u884C\u5206\u652F",type:e==="CONDITIONS"?"CONDITION":"CONCURRENT",props:{groups:[]},children:[{type:"AUTO_PASS"}]};n.push(s)},D=(n,e,s,t)=>T(this,null,function*(){e.branchs?e.branchs.length===2?t.splice(s,2):e.branchs.splice(n,1):e.children===void 0?e.splice(n,1):e.children.splice(0,1)}),p=x({visible:!1,data:{name:void 0}}),u=({key:n,item:e})=>{p.visible=!0,p.data=e[n]},O=n=>{p.visible=!1},j=n=>{E(()=>{Object.entries(n).forEach(e=>{p.data[e[0]]=e[1]})})},y=x({visible:!1,data:void 0}),k=({item:n})=>{y.visible=!0,y.data=n},$=n=>{y.visible=!1},M=n=>{E(()=>{Object.entries(n).forEach(e=>{y.data[e[0]]=e[1]})})},C=x({visible:!1,data:void 0}),B=({item:n})=>{C.visible=!0,C.data=n},J=n=>{C.visible=!1},q=n=>{E(()=>{Object.entries(n).forEach(e=>{C.data[e[0]]=e[1]})})},Y=P(),m=P([]),F=()=>T(this,null,function*(){const n=yield L({formId:_.query.formId});Y.value=n.data.processDefId,m.value=I([],n.data.process,!0)}),I=(n,e,s)=>{if(e!=null&&e.branchs){const t=[];e.branchs.forEach(a=>{let r={};if(r={name:a.name,type:a.type,props:a.props,id:s?a.id:void 0,parentType:a.parentType||void 0},(a==null?void 0:a.children)&&JSON.stringify(a.children)!=="{}"){const i=[];a.children.branchs||i.push({name:a.children.name,type:a.children.type,props:a.children.props,id:s?a.children.id:void 0,parentType:a.children.parentType||void 0}),I(i,a.children,s),r.children=i}else r.children=[];t.push(r)}),n.push({type:e.type,props:{},branchs:t})}return(e==null?void 0:e.children)&&JSON.stringify(e.children)!=="{}"&&(e.children.branchs||n.push({name:e.children.name,type:e.children.type,props:e.children.props,id:s?e.children.id:void 0,parentType:e.children.parentType||void 0}),I(n,e.children,s)),n},w=()=>{const n=[],e="0123456789abcdef";for(let t=0;t<36;t++)n[t]=e.substr(Math.floor(Math.random()*16),1);return n[14]="4",n[19]=e.substr(n[19]&3|8,1),n[8]=n[13]=n[18]=n[23]="-","node_"+n.join("")},A=(n,e)=>(n=n.reverse(),n.reduce((s,t,a)=>{const r=t.id||w(),i=t.type;return e&&a===n.length-1&&(t.parentId=e.id,t.parentType=e.type),t.branchs?(t.branchs.forEach(o=>{o.parentId=r,o.parentType=i,o.id=o.id||w(),o.children&&o.children.length?o.children=A(o.children,o):o.children&&!o.children.length&&delete o.children}),a?(s.parentId=r,s.parentType=i,{type:i,id:r,branchs:t.branchs,children:s}):(t.id=r,t.type=i,t)):a?(s.parentId=r,s.parentType=i,t.id=r,t.type=i,t.children=s,t):(t.id=r,t.type=i,t)},null)),V=()=>T(this,null,function*(){let n={};const e=JSON.parse(JSON.stringify(m.value));e.splice(0,0,{name:"\u53D1\u8D77\u4EBA",type:"ROOT",id:"root"}),n=n.children=JSON.parse(JSON.stringify(A(e)));const s={process:n,formId:_.query.formId,groupId:1};yield Q(s),yield W(_.query.formId),v.$message.success("\u53D1\u5E03\u6210\u529F")});return ne(()=>{F()}),b("showApprovalDialog",u),b("showConditionDialog",k),b("showConcurrentDialog",B),b("addNode",c),b("removeNode",D),b("addCondition",S),(n,e)=>{const s=g("el-button"),t=g("Plus"),a=g("el-icon"),r=g("el-popover"),i=g("el-card");return te(),se(oe,null,[l(i,{shadow:"never"},{header:f(()=>[d("div",le,[d("span",null,ae(R(_).query.bizFormName),1),d("div",null,[l(s,{onClick:e[0]||(e[0]=o=>R(h).go(-1))},{default:f(()=>[N("\u8FD4\u56DE")]),_:1}),l(s,{type:"primary",onClick:V},{default:f(()=>[N("\u53D1\u5E03")]),_:1})])])]),default:f(()=>[d("div",de,[d("div",ce,[d("div",pe,[N(" \u5F00\u59CB "),d("img",{src:R(G)},null,8,fe)]),l(r,{placement:"right",width:100,trigger:"hover"},{reference:f(()=>[l(a,{class:"add_icon mt-20 mb-20 cursor-pointer"},{default:f(()=>[l(t)]),_:1})]),default:f(()=>[d("div",ue,[d("p",null,[l(s,{class:"mb-8 w-full",onClick:e[1]||(e[1]=o=>c({key:-1,type:"SUB"}))},{default:f(()=>[N(" \u5355\u4F4D ")]),_:1})]),d("p",null,[l(s,{class:"ml-1 w-full mb-8",onClick:e[2]||(e[2]=o=>c({key:-1,type:"CONDITIONS"}))},{default:f(()=>[N(" \u6570\u636E\u7B5B\u9009 ")]),_:1})]),d("p",null,[l(s,{class:"ml-1 w-full",onClick:e[3]||(e[3]=o=>c({key:-1,type:"CONCURRENTS"}))},{default:f(()=>[N(" \u5E76\u884C\u5206\u652F ")]),_:1})])])]),_:1}),l(z,{"node-data":m.value},null,8,["node-data"]),he])])]),_:1}),l(H,{visible:p.visible,data:p.data,onClose:O,"onUpdate:data":j},null,8,["visible","data"]),l(K,{visible:y.visible,data:y.data,onClose:$,"onUpdate:data":M},null,8,["visible","data"]),l(ie,{visible:C.visible,data:C.data,onClose:J,"onUpdate:data":q},null,8,["visible","data"])],64)}}});export{De as default};