import{d as A,r as o,o as _,A as m,B as r,f as n,E as v,a,k as C,c as E,R as B,F as j,a2 as I,S as P,U as S,V as T,a8 as W,W as Z,K as z,Z as G,__tla as H}from"./index-92ad187a.js";import{_ as J,__tla as L}from"./Dialog-44c9fa34.js";import{b as M,c as N,__tla as O}from"./index-ce039456.js";import{u as Q,__tla as X}from"./useMessage-d9788660.js";let g,Y=Promise.all([(()=>{try{return H}catch{}})(),(()=>{try{return L}catch{}})(),(()=>{try{return O}catch{}})(),(()=>{try{return X}catch{}})()]).then(async()=>{g=A({__name:"TaskReturnDialogForm",emits:["success"],setup($,{expose:b,emit:h}){const c=Q(),s=o(!1),u=o(!1),l=o({id:"",targetDefinitionKey:void 0,reason:""}),V=o({targetDefinitionKey:[{required:!0,message:"\u5FC5\u987B\u9009\u62E9\u56DE\u9000\u8282\u70B9",trigger:"change"}],reason:[{required:!0,message:"\u56DE\u9000\u7406\u7531\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),d=o(),f=o([]);b({open:async i=>{if(f.value=await M({taskId:i}),f.value.length===0)return c.warning("\u5F53\u524D\u6CA1\u6709\u53EF\u56DE\u9000\u7684\u8282\u70B9"),!1;s.value=!0,w(),l.value.id=i}});const K=h,k=async()=>{if(d&&await d.value.validate()){u.value=!0;try{await N(l.value),c.success("\u56DE\u9000\u6210\u529F"),s.value=!1,K("success")}finally{u.value=!1}}},w=()=>{var i;l.value={id:"",targetDefinitionKey:void 0,reason:""},(i=d.value)==null||i.resetFields()};return(i,t)=>{const D=P,x=S,y=T,U=W,F=Z,p=z,R=J,q=G;return _(),m(R,{modelValue:a(s),"onUpdate:modelValue":t[3]||(t[3]=e=>I(s)?s.value=e:null),title:"\u56DE\u9000",width:"500"},{footer:r(()=>[n(p,{disabled:a(u),type:"primary",onClick:k},{default:r(()=>[v("\u786E \u5B9A")]),_:1},8,["disabled"]),n(p,{onClick:t[2]||(t[2]=e=>s.value=!1)},{default:r(()=>[v("\u53D6 \u6D88")]),_:1})]),default:r(()=>[C((_(),m(F,{ref_key:"formRef",ref:d,model:a(l),rules:a(V),"label-width":"110px"},{default:r(()=>[n(y,{label:"\u9000\u56DE\u8282\u70B9",prop:"targetDefinitionKey"},{default:r(()=>[n(x,{modelValue:a(l).targetDefinitionKey,"onUpdate:modelValue":t[0]||(t[0]=e=>a(l).targetDefinitionKey=e),clearable:"",style:{width:"100%"}},{default:r(()=>[(_(!0),E(j,null,B(a(f),e=>(_(),m(D,{key:e.definitionKey,label:e.name,value:e.definitionKey},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),n(y,{label:"\u56DE\u9000\u7406\u7531",prop:"reason"},{default:r(()=>[n(U,{modelValue:a(l).reason,"onUpdate:modelValue":t[1]||(t[1]=e=>a(l).reason=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u56DE\u9000\u7406\u7531"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[q,a(u)]])]),_:1},8,["modelValue"])}}})});export{g as _,Y as __tla};
