import{r as s,d as r,F as A,j as l}from"./react.6693569e.js";import{a as n}from"./index.ab3d776b.js";/* empty css               */import{T as b}from"./TextArea.69b2867c.js";import{m as k,B as i}from"./antd.e57bc55d.js";import"./dynamicCSS.37df2829.js";const v="_task_12z2q_1",y="_taskText_12z2q_6",T="_buttonGroup_12z2q_9",E="_mb8_12z2q_20",q="_ml16_12z2q_26",z="_title_12z2q_29",B="_label_12z2q_37",C="_value_12z2q_43",F="_groupType_12z2q_52",c={task:v,taskText:y,buttonGroup:T,mb8:E,ml16:q,title:z,label:B,value:C,groupType:F},S=({params:_,onMethod:a})=>{const{status:j,approvalId:u}=_,[e,m]=s.exports.useState(""),g=s.exports.useCallback(()=>{a==null||a("closeWindow",[null,{cancelled:!0}])},[]),[f,p]=s.exports.useState(!1),x=s.exports.useCallback(async()=>{if(!e){k.error("\u8BF7\u8F93\u5165\u539F\u56E0\uFF01");return}try{p(!0);const t={status:2};await n.groupApi.patchApprovalStatus(u,{status:2,note:e}),a==null||a("closeWindow",[null,t])}catch(t){a==null||a("closeWindow",[t])}finally{p(!1)}},[a,u,e]);return s.exports.useEffect(()=>{!u||n.groupApi.getApproval(u).then(t=>{const o={join_group:"\u5165\u7EC4\u5BA1\u6279",create_group:"\u5EFA\u7EC4\u5BA1\u6279"};o[t==null?void 0:t.type]&&a("setTitle",[o[t==null?void 0:t.type]])})},[u]),r(A,{children:[r("div",{className:c.task,children:[l("div",{className:c.taskText,children:"\u60A8\u5C06\u5BA1\u6279\u9A73\u56DE\u8BE5\u7533\u8BF7"}),l(b,{rows:4,placeholder:"\u9A73\u56DE\u9700\u5907\u6CE8\u7406\u7531",value:e,onChange:t=>m(t.target.value)})]}),r("div",{className:c.buttonGroup,children:[l(i,{onClick:g,children:"\u53D6\u6D88"}),l(i,{type:"primary",loading:f,onClick:x,children:"\u786E\u8BA4"})]})]})};export{S as default};
