import{u as D}from"./useFormEdit-3c660b22.js";import{d as w,p as x,f as A,i as p,a as v,z as g,m as u,j as B,k as m,v as c,e as i,l as L,a4 as C,ag as N,aj as S,ak as h}from"./index-deffec86.js";const T={class:"align_center"},j={class:"dialog-footer"},I=w({__name:"BraingDialog",props:{visible:{type:Boolean,default:!1},resourceId:{},resourceCode:{},isGive:{type:Boolean,default:!0},api:{},areaLevel:{default:0}},emits:["update:visible","close","hanleSubmitCheck"],setup(F,{emit:_}){const{updateMethod:b,loading:f}=D(),l=x(""),t=F,o=_,s=A({get:()=>t.visible,set:n=>{o("close")}}),y=()=>{o("close"),o("update:visible",!1)},V=()=>{t.areaLevel==1?N.confirm("\u5982\u6709\u586B\u62A5\u7591\u95EE\uFF0C\u8BF7\u54A8\u8BE2\uFF080871\uFF0963163670","\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",showCancelButton:!1,type:"info"}).then(()=>{d(2)}):d(2)},d=async n=>{const e={is_auto:n,des:l.value,resource_id:t.resourceId,resource_code:t.resourceCode};await b(t.api,e),l.value="",S(),setTimeout(()=>{h(),o("close"),o("hanleSubmitCheck"),o("update:visible",!1)},1e3)};return(n,e)=>{const k=p("el-input"),r=p("el-button"),E=p("el-dialog");return v(),g(E,{class:"audit-dialog",title:"\u9009\u62E9\u5BA1\u6838\u7C7B\u578B",width:"30%",modelValue:i(s),"onUpdate:modelValue":e[3]||(e[3]=a=>C(s)?s.value=a:null),"before-close":y},{footer:u(()=>[B("span",j,[m(r,{onClick:e[1]||(e[1]=a=>s.value=!1)},{default:u(()=>e[4]||(e[4]=[c("\u53D6\u6D88")])),_:1}),n.isGive?(v(),g(r,{key:0,type:"primary",loading:i(f),onClick:V},{default:u(()=>e[5]||(e[5]=[c(" \u9700\u56DE\u590D ")])),_:1},8,["loading"])):L("v-if",!0),m(r,{type:"primary",loading:i(f),onClick:e[2]||(e[2]=a=>d(1))},{default:u(()=>e[6]||(e[6]=[c(" \u4EC5\u5907\u6848 ")])),_:1},8,["loading"])])]),default:u(()=>[B("div",T,[m(k,{modelValue:i(l),"onUpdate:modelValue":e[0]||(e[0]=a=>C(l)?l.value=a:null),type:"textarea",autosize:{minRows:4},placeholder:"\u8BF7\u8F93\u5165\u9700\u8981\u6279\u590D\u4E8B\u9879"},null,8,["modelValue"])])]),_:1},8,["modelValue"])}}});export{I as _};
