import{A as x}from"./AuditDialog.vue_vue_type_style_index_1_lang-8ecac5b8.js";import{u as E}from"./useFormEdit-3c660b22.js";import{r as k}from"./check-597f223a.js";import{d as L,p as $,f as S,i as n,a as d,z as w,m as l,j as C,k as p,v as h,l as _,e as c,a4 as b,c as V,t as I,aj as j,D as A,ak as R,_ as z}from"./index-deffec86.js";const M={class:"center"},T={class:"left"},U={key:0,class:"checkNum"},q={key:0,class:"right"},H={class:"btns"},G=L({__name:"AuditDialog",props:{progressList:{default:()=>[]},visible:{type:Boolean,default:!1},reviewId:{default:""},passStatus:{default:3},noPassStatus:{default:4},isShowProgress:{type:Boolean,default:!0},isShowPassBtn:{type:Boolean,default:!0},isShowNoPassBtn:{type:Boolean,default:!0},resourceCode:{},api:{}},emits:["update:visible","close","hanleSubmitCheck","reset"],setup(P,{emit:D}){const{updateMethod:F}=E(),a=$(""),s=P,u=D,g=S({get:()=>s.visible,set:f=>{u("close")}}),m=S(()=>`${s.reviewId}`.split(",").length),y=()=>{u("close"),u("update:visible",!1)},B=async f=>{const e=f==1?s.passStatus:s.noPassStatus;if(j(),m.value>1){const i=[];`${s.reviewId}`.split(",").forEach(o=>{i.push(k({resource_code:s.resourceCode,review_id:o,des:a.value,status:e}))});const t=await Promise.allSettled(i),v=t.filter(o=>o.status=="rejected");A({type:"warning",message:`\u5BA1\u6838\u6210\u529F${t.length-v.length}\u6761\uFF0C\u5931\u8D25${v.length}\u6761`})}else{const i={review_id:s.reviewId,des:a.value,status:e,resource_code:s.resourceCode};let t=await F(s.api||k,i);t.code!==200&&A({type:"error",message:t.message})}a.value="",setTimeout(()=>{R(),u("reset"),u("close"),u("update:visible",!1)},500)};return(f,e)=>{const i=n("el-input"),t=n("el-form-item"),v=n("el-form"),o=n("el-button"),N=n("el-dialog");return d(),w(N,{width:"900px",title:"\u5BA1\u6838\u6279\u590D",modelValue:c(g),"onUpdate:modelValue":e[3]||(e[3]=r=>b(g)?g.value=r:null),"before-close":y},{footer:l(()=>[C("div",H,[p(o,{onClick:y},{default:l(()=>e[4]||(e[4]=[h("\u53D6\u6D88")])),_:1}),s.isShowPassBtn?(d(),w(o,{key:0,type:"primary",onClick:e[1]||(e[1]=r=>B(1))},{default:l(()=>e[5]||(e[5]=[h("\u901A\u8FC7")])),_:1})):_("v-if",!0),s.isShowNoPassBtn?(d(),w(o,{key:1,onClick:e[2]||(e[2]=r=>B(2))},{default:l(()=>e[6]||(e[6]=[h("\u9A73\u56DE")])),_:1})):_("v-if",!0)])]),default:l(()=>[p(v,null,{default:l(()=>[C("div",M,[C("div",T,[p(t,{label:"\u5907\u6CE8"},{default:l(()=>[p(i,{modelValue:c(a),"onUpdate:modelValue":e[0]||(e[0]=r=>b(a)?a.value=r:null),autosize:{minRows:9,maxRows:12},type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5BA1\u6279\u5907\u6CE8"},null,8,["modelValue"]),c(m)>1?(d(),V("div",U,"\u5171"+I(c(m))+"\u6761",1)):_("v-if",!0)]),_:1})]),c(m)==1&&f.isShowProgress?(d(),V("div",q,[p(x,{"progress-list":s.progressList},null,8,["progress-list"])])):_("v-if",!0)])]),_:1})]),_:1},8,["modelValue"])}}}),W=z(G,[["__scopeId","data-v-35d571db"]]);export{W as A};
