ReplyForm-be4935c1.js 2.0 KB

1
  1. import{d as z,P as D,r as d,x as U,o as i,C as c,A as s,f as m,a,D as p,k as R,a9 as j,a2 as q,V as A,W as J,J as S,Z as W,_ as Z,__tla as B}from"./index-f6fb8e95.js";import{_ as E,__tla as G}from"./Dialog-ac2b0e4e.js";import{r as H,__tla as I}from"./comment-c38e2a30.js";import{u as K,__tla as L}from"./useMessage-3b767a67.js";let f,M=Promise.all([(()=>{try{return B}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return I}catch{}})(),(()=>{try{return L}catch{}})()]).then(async()=>{f=Z(z({name:"ProductComment",__name:"ReplyForm",emits:["success"],setup(N,{expose:y,emit:v}){const C=K(),{t:x}=D(),l=d(!1),u=d(!1),t=d({id:void 0,replyContent:void 0}),V=U({replyContent:[{required:!0,message:"\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),o=d();y({open:async e=>{w(),t.value.id=e,l.value=!0}});const b=v,h=async()=>{var e;if(await((e=o==null?void 0:o.value)==null?void 0:e.validate())){u.value=!0;try{await H(t.value),C.success(x("common.createSuccess")),l.value=!1,b("success")}finally{u.value=!1}}},w=()=>{var e;t.value={id:void 0,replyContent:void 0},(e=o.value)==null||e.resetFields()};return(e,r)=>{const k=A,g=J,_=S,F=E,P=W;return i(),c(F,{title:"\u56DE\u590D",modelValue:a(l),"onUpdate:modelValue":r[2]||(r[2]=n=>q(l)?l.value=n:null)},{footer:s(()=>[m(_,{onClick:h,type:"primary",disabled:a(u)},{default:s(()=>[p("\u786E \u5B9A ")]),_:1},8,["disabled"]),m(_,{onClick:r[1]||(r[1]=n=>l.value=!1)},{default:s(()=>[p("\u53D6 \u6D88")]),_:1})]),default:s(()=>[R((i(),c(g,{ref_key:"formRef",ref:o,model:a(t),rules:a(V),"label-width":"100px"},{default:s(()=>[m(k,{label:"\u56DE\u590D\u5185\u5BB9",prop:"replyContent"},{default:s(()=>[m(a(j),{type:"textarea",modelValue:a(t).replyContent,"onUpdate:modelValue":r[0]||(r[0]=n=>a(t).replyContent=n)},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[P,a(u)]])]),_:1},8,["modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/product/comment/ReplyForm.vue"]])});export{M as __tla,f as default};