CommentForm-c9e0437a.js 6.3 KB

1
  1. import{d as B,h as G,r as _,e as H,o as d,c as p,f as r,w as o,a as e,n as U,x as J,v as I,g as K,P as L,O as Q,F as X,A as $,j as Y,V as Z,dc as ee,D as ae,C as te,I as re,_ as le,__tla as se}from"./index-bd9277a1.js";import{_ as oe,__tla as ue}from"./Dialog-eba103da.js";import{_ as _e,__tla as ie}from"./UploadImgs-6d68033c.js";import{_ as ce,__tla as de}from"./UploadImg-be688408.js";import{E as me,__tla as ne}from"./el-image-c6b72263.js";import{__tla as pe}from"./el-image-viewer-995341ab.js";import{g as fe,c as ve,__tla as ye}from"./comment-832df6e1.js";import he,{__tla as ge}from"./SpuShowcase-8c54f426.js";import be,{__tla as Ve}from"./SkuTableSelect-465dc29b.js";import{u as ke,__tla as Ue}from"./useMessage-274788d4.js";import{__tla as Ie}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-fb87e632.js";import{__tla as Se}from"./index-b80ba4d7.js";import{__tla as xe}from"./spu-1de6da31.js";import{__tla as we}from"./SpuTableSelect-8c336949.js";import{__tla as Ce}from"./ContentWrap-7c73ab26.js";import{__tla as qe}from"./ContentWrap.vue_vue_type_script_setup_true_lang-5f6a2d0d.js";import{__tla as Ae}from"./el-card-bc8cec83.js";import{__tla as Ne}from"./index-3118d255.js";import{__tla as Fe}from"./index-49ecf2ef.js";import{__tla as ze}from"./el-tree-select-9425e295.js";import"./tree-0af4953a.js";import{__tla as Re}from"./category-ca717d96.js";let S,De=Promise.all([(()=>{try{return se}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return ie}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return ne}catch{}})(),(()=>{try{return pe}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return ge}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return Ie}catch{}})(),(()=>{try{return Se}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return qe}catch{}})(),(()=>{try{return Ae}catch{}})(),(()=>{try{return Ne}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Re}catch{}})()]).then(async()=>{let f,v;f={key:0},v={key:1,class:"select-box"},S=le(B({__name:"CommentForm",emits:["success"],setup(Pe,{expose:x,emit:w}){const{t:y}=G(),C=ke(),i=_(!1),q=_(""),c=_(!1),h=_(""),t=_({id:void 0,userId:void 0,userNickname:void 0,userAvatar:void 0,spuId:0,skuId:void 0,descriptionScores:5,benefitScores:5,content:void 0,picUrls:[]}),A=H({spuId:[{required:!0,message:"\u5546\u54C1\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],skuId:[{required:!0,message:"\u89C4\u683C\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],userAvatar:[{required:!0,message:"\u7528\u6237\u5934\u50CF\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],userNickname:[{required:!0,message:"\u7528\u6237\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],content:[{required:!0,message:"\u8BC4\u8BBA\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],descriptionScores:[{required:!0,message:"\u63CF\u8FF0\u661F\u7EA7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],benefitScores:[{required:!0,message:"\u670D\u52A1\u661F\u7EA7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),m=_(),n=_({id:-1,name:"",picUrl:""});x({open:async(u,a)=>{if(i.value=!0,q.value=y("action."+u),h.value=u,z(),a){c.value=!0;try{t.value=await fe(a)}finally{c.value=!1}}}});const N=w,F=async()=>{if(m&&await m.value.validate()){c.value=!0;try{const u=t.value.picUrls.map(s=>s!=null&&s.url?s.url:s),a={...t.value,picUrls:u};h.value==="create"&&(await ve(a),C.success(y("common.createSuccess"))),i.value=!1,N("success")}finally{c.value=!1}}},z=()=>{var u;t.value={id:void 0,userId:void 0,userNickname:void 0,userAvatar:void 0,spuId:0,skuId:void 0,descriptionScores:5,benefitScores:5,content:void 0,picUrls:[]},(u=m.value)==null||u.resetFields()},g=_(),R=()=>{g.value.open()},D=u=>{n.value=u,t.value.skuId=u.id};return(u,a)=>{const s=$,P=me,T=Y,j=ce,b=Z,V=ee,E=_e,M=ae,k=te,O=oe,W=re;return d(),p(X,null,[r(O,{title:"\u6DFB\u52A0\u865A\u62DF\u8BC4\u8BBA",modelValue:e(i),"onUpdate:modelValue":a[8]||(a[8]=l=>Q(i)?i.value=l:null)},{footer:o(()=>[r(k,{onClick:F,type:"primary",disabled:e(c)},{default:o(()=>[U("\u786E \u5B9A")]),_:1},8,["disabled"]),r(k,{onClick:a[7]||(a[7]=l=>i.value=!1)},{default:o(()=>[U("\u53D6 \u6D88")]),_:1})]),default:o(()=>[J((d(),I(M,{ref_key:"formRef",ref:m,model:e(t),rules:e(A),"label-width":"100px"},{default:o(()=>[r(s,{label:"\u5546\u54C1",prop:"spuId"},{default:o(()=>[r(he,{modelValue:e(t).spuId,"onUpdate:modelValue":a[0]||(a[0]=l=>e(t).spuId=l),limit:1},null,8,["modelValue"])]),_:1}),e(t).spuId?(d(),I(s,{key:0,label:"\u5546\u54C1\u89C4\u683C",prop:"skuId"},{default:o(()=>[K("div",{onClick:R,class:"h-60px w-60px"},[e(n)&&e(n).picUrl?(d(),p("div",f,[r(P,{src:e(n).picUrl},null,8,["src"])])):(d(),p("div",v,[r(T,{icon:"ep:plus"})]))])]),_:1})):L("",!0),r(s,{label:"\u7528\u6237\u5934\u50CF",prop:"userAvatar"},{default:o(()=>[r(j,{modelValue:e(t).userAvatar,"onUpdate:modelValue":a[1]||(a[1]=l=>e(t).userAvatar=l),height:"60px",width:"60px"},null,8,["modelValue"])]),_:1}),r(s,{label:"\u7528\u6237\u540D\u79F0",prop:"userNickname"},{default:o(()=>[r(b,{modelValue:e(t).userNickname,"onUpdate:modelValue":a[2]||(a[2]=l=>e(t).userNickname=l),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u79F0"},null,8,["modelValue"])]),_:1}),r(s,{label:"\u8BC4\u8BBA\u5185\u5BB9",prop:"content"},{default:o(()=>[r(b,{type:"textarea",modelValue:e(t).content,"onUpdate:modelValue":a[3]||(a[3]=l=>e(t).content=l)},null,8,["modelValue"])]),_:1}),r(s,{label:"\u63CF\u8FF0\u661F\u7EA7",prop:"descriptionScores"},{default:o(()=>[r(V,{modelValue:e(t).descriptionScores,"onUpdate:modelValue":a[4]||(a[4]=l=>e(t).descriptionScores=l)},null,8,["modelValue"])]),_:1}),r(s,{label:"\u670D\u52A1\u661F\u7EA7",prop:"benefitScores"},{default:o(()=>[r(V,{modelValue:e(t).benefitScores,"onUpdate:modelValue":a[5]||(a[5]=l=>e(t).benefitScores=l)},null,8,["modelValue"])]),_:1}),r(s,{label:"\u8BC4\u8BBA\u56FE\u7247",prop:"picUrls"},{default:o(()=>[r(E,{modelValue:e(t).picUrls,"onUpdate:modelValue":a[6]||(a[6]=l=>e(t).picUrls=l),limit:9,height:"60px",width:"60px"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[W,e(c)]])]),_:1},8,["modelValue"]),r(be,{ref_key:"skuTableSelectRef",ref:g,onChange:D,"spu-id":e(t).spuId},null,8,["spu-id"])],64)}}}),[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/views/mall/product/comment/CommentForm.vue"]])});export{De as __tla,S as default};