import{F as O,G as B,h as N}from"./elementPlus.CSBdF9Zt.js";import{u as U}from"./useResponse.DqThFJSa.js";import{u as j}from"./api.BCMjIqCN.js";import{d as I,aJ as v,r as w,aK as T,aI as h,Z as V,ai as l,o as z,c as G,U as o,O as n,u as t,a as J,S as x}from"./vue.1RczIYhx.js";import{_ as K}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.K_MFulpu.js";const L={class:"drawer-container"},S={class:"flex flex-1 justify-end"},Z=I({__name:"EditDrawer",props:v({rowData:Object},{modelValue:{default:!1},modelModifiers:{}}),emits:v(["refresh"],["update:modelValue"]),setup(c,{emit:y}){const f=w(!1),i=T(c,"modelValue"),p=h("editDrawer"),g=c,{rowData:a}=g,k=y,_=w(),r=V({brand_name:a==null?void 0:a.brand_name}),C=V({}),F=async m=>{m&&await m.validate(async(e,u)=>{if(e)try{const s=await U(j,{id:a==null?void 0:a.id,...r},f);s&&s.code==2e3&&(i.value=!1,N.success({message:"编辑成功",plain:!0,icon:"Operation"}),k("refresh"))}catch(s){console.error("Error==>",s)}else console.log("error submit!",u)})};function R(){p.value.handleClose()}return(m,e)=>{const u=l("el-input"),s=l("el-form-item"),D=l("el-divider"),b=l("el-button"),E=l("el-form"),M=l("el-drawer");return z(),G("div",L,[o(M,{ref_key:"editDrawer",ref:p,modelValue:i.value,"onUpdate:modelValue":e[2]||(e[2]=d=>i.value=d),"close-on-click-modal":!1,"close-on-press-escape":!1,title:"产品品牌 - 编辑 ",size:"25%"},{default:n(()=>[o(E,{ref_key:"ruleFormRef",ref:_,model:t(r),rules:t(C),class:"mx-2.5 mt-7","label-position":"top","label-width":"auto","status-icon":""},{default:n(()=>[o(s,{class:"font-medium",label:"品牌名称",prop:"name"},{default:n(()=>[o(u,{modelValue:t(r).brand_name,"onUpdate:modelValue":e[0]||(e[0]=d=>t(r).brand_name=d)},null,8,["modelValue"])]),_:1}),o(s,null,{default:n(()=>[o(D),J("div",S,[o(b,{icon:t(O),onClick:R},{default:n(()=>e[3]||(e[3]=[x("取 消")])),_:1},8,["icon"]),o(b,{icon:t(B),loading:t(f),type:"primary",onClick:e[1]||(e[1]=d=>F(t(_)))},{default:n(()=>e[4]||(e[4]=[x(" 确 定 ")])),_:1},8,["icon","loading"])])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])])}}}),W=K(Z,[["__scopeId","data-v-fe68562d"]]);export{W as default};
