import{aN as _,aO as Z,_ as ee,d as te,E as v,af as C,br as y,x as d,aA as ue,o as r,N as p,K as l,O as ae,u as s,aK as le,y as n,c as F,M as E,L as x,a as oe,b as se,W as R,T as ne}from"./index.743f0c80.js";const re=[{value:"1",label:"\u5F00\u59CB\u8282\u70B9"},{value:"2",label:"\u8FC7\u7A0B\u8282\u70B9"},{value:"3",label:"\u4E2D\u65AD\u8282\u70B9"},{value:"4",label:"\u7ED3\u675F\u8282\u70B9"}],ie=[{value:"1",label:"\u5BA1\u6279\u8282\u70B9"},{value:"2",label:"\u7CFB\u7EDF\u8282\u70B9"}],de={action_type:{trigger:"blur",message:"\u8BF7\u9009\u62E9\u8282\u70B9\u7C7B\u578B",required:!0},operation_type:{trigger:"blur",message:"\u8BF7\u9009\u62E9\u64CD\u4F5C\u7C7B\u578B",required:!0},status_name:{trigger:"blur",message:"\u8BF7\u8F93\u5165\u8282\u70B9\u540D\u79F0",required:!0},order_process:{trigger:"blur",message:"\u8BF7\u8F93\u5165\u8282\u70B9\u503C",required:!0},next_action_ids:{trigger:"blur",message:"\u8BF7\u9009\u62E9\u4E0B\u4E00\u8282\u70B9",required:!0}},{VITE_PROXY_DOMAIN_REAL:De,VITE_PROXY_USER_REAL:ce}=Z(),m=ce+"/admin/",pe=(a={})=>_.request("post",`${m}action_process_getlist`,{data:a}),_e=(a={})=>_.request("post",`${m}action_process_add`,{data:a}),me=(a={})=>_.request("post",`${m}action_process_read`,{data:a}),ve=(a={})=>_.request("post",`${m}action_process_update`,{data:a}),Ve=(a={})=>_.request("post",`${m}action_process_update`,{data:a}),Ce=a=>_.request("post",`${m}action_process_update`,{data:{...a,is_del:"1"}}),fe={flex:"","w-full":"","justify-end":""},Be=R("\u4FDD\u5B58 "),be=te({__name:"process-modal",props:{currentProcess:{type:Object,required:!0}},emits:["reload"],setup(a,{expose:w,emit:L}){const D=a,c=v(""),V=v(!1),f=v(!1),A=v(null),k=C(()=>!c.value),u=v({action_type:"",operation_type:"",status_name:"",order_process:"",next_action_ids:[]}),q=()=>{f.value=!1,L("reload")},P=C(()=>u.value.action_type==="1"||u.value.action_type==="2"),{run:N,data:O,listLoading:U}=y({initalData:[],isList:[]}),{run:T,data:$,loading:M}=y({initalData:{},success:()=>{const{order_process:o,status_name:t,operation_type:B,action_type:b,next_action_ids:i}=$.value;u.value={order_process:o,status_name:t,operation_type:B,action_type:b,next_action_ids:i.filter(g=>g)}}}),{run:S,loading:h}=y({success:()=>q()}),{run:j,loading:I}=y({success:()=>q()});function K(){const{currentProcess:o}=D;S(_e({process_id:o.id,...u.value}))}function X(){const{currentProcess:o}=D;j(ve({id:c.value,process_id:o.id,...u.value}))}function Y(){A.value.validate(o=>{if(!!o){if(k.value)return K();X()}})}const z=C(()=>V.value?"\u6D41\u7A0B\u8282\u70B9\u8BE6\u60C5":k.value?"\u521B\u5EFA\u6D41\u7A0B\u8282\u70B9":"\u7F16\u8F91\u6D41\u7A0B\u8282\u70B9");return w({onDisplay(o,t=!1){if(f.value=!0,c.value=o,V.value=t,N(pe({process_id:D.currentProcess.id})),c.value)return T(me({id:c.value}))}}),(o,t)=>{const B=d("el-option"),b=d("el-select"),i=d("el-form-item"),g=d("el-input"),W=d("el-checkbox"),G=d("el-checkbox-group"),H=d("el-button"),J=d("el-dialog"),Q=ue("loading");return r(),p(J,{modelValue:f.value,"onUpdate:modelValue":t[6]||(t[6]=e=>f.value=e),title:s(z),center:"",onClose:t[7]||(t[7]=()=>u.value={...o.initalData}),rules:s(de)},{default:l(()=>[ae((r(),p(s(le),{"label-width":"100px",model:u.value,disabled:V.value,ref_key:"formRef",ref:A},{default:l(()=>[n(i,{label:"\u8282\u70B9\u7C7B\u578B",prop:"action_type"},{default:l(()=>[n(b,{"w-full":"",modelValue:u.value.action_type,"onUpdate:modelValue":t[0]||(t[0]=e=>u.value.action_type=e)},{default:l(()=>[(r(!0),F(x,null,E(s(re),e=>(r(),p(B,{key:e.value,value:e.value,label:e.label},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),n(i,{label:"\u64CD\u4F5C\u7C7B\u578B",prop:"operation_type"},{default:l(()=>[n(b,{"w-full":"",modelValue:u.value.operation_type,"onUpdate:modelValue":t[1]||(t[1]=e=>u.value.operation_type=e)},{default:l(()=>[(r(!0),F(x,null,E(s(ie),e=>(r(),p(B,{key:e.value,value:e.value,label:e.label},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),n(i,{label:"\u8282\u70B9\u540D\u79F0",prop:"status_name"},{default:l(()=>[n(g,{modelValue:u.value.status_name,"onUpdate:modelValue":t[2]||(t[2]=e=>u.value.status_name=e)},null,8,["modelValue"])]),_:1}),n(i,{label:"\u8282\u70B9\u503C",prop:"order_process"},{default:l(()=>[n(g,{modelValue:u.value.order_process,"onUpdate:modelValue":t[3]||(t[3]=e=>u.value.order_process=e)},null,8,["modelValue"])]),_:1}),s(P)?(r(),p(i,{key:0,label:"\u4E0B\u4E00\u8282\u70B9",prop:"next_action_ids"},{default:l(()=>[n(G,{modelValue:u.value.next_action_ids,"onUpdate:modelValue":t[4]||(t[4]=e=>u.value.next_action_ids=e)},{default:l(()=>[(r(!0),F(x,null,E(s(O),e=>(r(),p(W,{label:e.id,key:e.id,disabled:e.id===c.value},{default:l(()=>[R(ne(e.status_name),1)]),_:2},1032,["label","disabled"]))),128))]),_:1},8,["modelValue"])]),_:1})):oe("v-if",!0),n(i,null,{default:l(()=>[se("div",fe,[n(H,{loading:s(I)||s(h),type:"primary",onClick:t[5]||(t[5]=()=>Y())},{default:l(()=>[Be]),_:1},8,["loading"])])]),_:1})]),_:1},8,["model","disabled"])),[[Q,s(M)||s(U)]])]),_:1},8,["modelValue","title","rules"])}}});var ge=ee(be,[["__file","D:/work/accout-vue3-ui/src/views/parameter/setActionProcess/components/process-modal.vue"]]),Fe=Object.freeze(Object.defineProperty({__proto__:null,default:ge},Symbol.toStringTag,{value:"Module"}));export{ge as P,re as a,pe as b,Ve as c,Ce as d,_e as h,ie as o,Fe as p};