1 |
- import{d as G,h as H,r as i,e as K,o as d,c as p,f as t,w as o,a as e,m as U,x as L,v as I,g as M,P as Q,O as W,F as X,A as Y,n as Z,V as $,db as ee,D as ae,C as re,I as te,_ as le,__tla as se}from"./index-430b3151.js";import{_ as oe,__tla as ue}from"./Dialog-cd42c639.js";import{_ as ie,__tla as _e}from"./UploadImgs-6e3d2ca2.js";import{_ as ce,__tla as de}from"./UploadImg-2f818d4f.js";import{E as me,__tla as ne}from"./el-image-c98b70f9.js";import{__tla as pe}from"./el-image-viewer-467ebe35.js";import{g as fe,c as ve,__tla as ye}from"./comment-b37a29a4.js";import he,{__tla as be}from"./SpuShowcase-5ead536a.js";import ge,{__tla as Ve}from"./SkuTableSelect-deaba3f5.js";import{u as ke,__tla as Ue}from"./useMessage-d226ba89.js";import{__tla as Ie}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-7ba47553.js";import{__tla as Se}from"./index-255e3b1c.js";import{__tla as xe}from"./spu-fa11f657.js";import{__tla as we}from"./SpuTableSelect-015cfb9f.js";import{__tla as Ce}from"./ContentWrap-60842994.js";import{__tla as qe}from"./el-card-dee5b36b.js";import{__tla as Ae}from"./index-c425c88f.js";import{__tla as Ne}from"./index-555139e7.js";import{__tla as Fe}from"./el-tree-select-eb1ce80a.js";import"./tree-0af4953a.js";import{__tla as ze}from"./category-61e1eb2c.js";let S,Re=Promise.all([(()=>{try{return se}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return ne}catch{}})(),(()=>{try{return pe}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return be}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{}})()]).then(async()=>{let f,v;f={key:0},v={key:1,class:"select-box"},S=le(G({__name:"CommentForm",emits:["success"],setup(De,{expose:x,emit:w}){const{t:y}=H(),C=ke(),_=i(!1),q=i(""),c=i(!1),h=i(""),r=i({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=K({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=i(),n=i({id:-1,name:"",picUrl:""});x({open:async(u,a)=>{if(_.value=!0,q.value=y("action."+u),h.value=u,z(),a){c.value=!0;try{r.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=r.value.picUrls.map(s=>s!=null&&s.url?s.url:s),a={...r.value,picUrls:u};h.value==="create"&&(await ve(a),C.success(y("common.createSuccess"))),_.value=!1,N("success")}finally{c.value=!1}}},z=()=>{var u;r.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()},b=i(),R=()=>{b.value.open()},D=u=>{n.value=u,r.value.skuId=u.id};return(u,a)=>{const s=Y,P=me,T=Z,B=ce,g=$,V=ee,E=ie,J=ae,k=re,O=oe,j=te;return d(),p(X,null,[t(O,{title:"\u6DFB\u52A0\u865A\u62DF\u8BC4\u8BBA",modelValue:e(_),"onUpdate:modelValue":a[8]||(a[8]=l=>W(_)?_.value=l:null)},{footer:o(()=>[t(k,{onClick:F,type:"primary",disabled:e(c)},{default:o(()=>[U("\u786E \u5B9A")]),_:1},8,["disabled"]),t(k,{onClick:a[7]||(a[7]=l=>_.value=!1)},{default:o(()=>[U("\u53D6 \u6D88")]),_:1})]),default:o(()=>[L((d(),I(J,{ref_key:"formRef",ref:m,model:e(r),rules:e(A),"label-width":"100px"},{default:o(()=>[t(s,{label:"\u5546\u54C1",prop:"spuId"},{default:o(()=>[t(he,{modelValue:e(r).spuId,"onUpdate:modelValue":a[0]||(a[0]=l=>e(r).spuId=l),limit:1},null,8,["modelValue"])]),_:1}),e(r).spuId?(d(),I(s,{key:0,label:"\u5546\u54C1\u89C4\u683C",prop:"skuId"},{default:o(()=>[M("div",{onClick:R,class:"h-60px w-60px"},[e(n)&&e(n).picUrl?(d(),p("div",f,[t(P,{src:e(n).picUrl},null,8,["src"])])):(d(),p("div",v,[t(T,{icon:"ep:plus"})]))])]),_:1})):Q("",!0),t(s,{label:"\u7528\u6237\u5934\u50CF",prop:"userAvatar"},{default:o(()=>[t(B,{modelValue:e(r).userAvatar,"onUpdate:modelValue":a[1]||(a[1]=l=>e(r).userAvatar=l),height:"60px",width:"60px"},null,8,["modelValue"])]),_:1}),t(s,{label:"\u7528\u6237\u540D\u79F0",prop:"userNickname"},{default:o(()=>[t(g,{modelValue:e(r).userNickname,"onUpdate:modelValue":a[2]||(a[2]=l=>e(r).userNickname=l),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u79F0"},null,8,["modelValue"])]),_:1}),t(s,{label:"\u8BC4\u8BBA\u5185\u5BB9",prop:"content"},{default:o(()=>[t(g,{type:"textarea",modelValue:e(r).content,"onUpdate:modelValue":a[3]||(a[3]=l=>e(r).content=l)},null,8,["modelValue"])]),_:1}),t(s,{label:"\u63CF\u8FF0\u661F\u7EA7",prop:"descriptionScores"},{default:o(()=>[t(V,{modelValue:e(r).descriptionScores,"onUpdate:modelValue":a[4]||(a[4]=l=>e(r).descriptionScores=l)},null,8,["modelValue"])]),_:1}),t(s,{label:"\u670D\u52A1\u661F\u7EA7",prop:"benefitScores"},{default:o(()=>[t(V,{modelValue:e(r).benefitScores,"onUpdate:modelValue":a[5]||(a[5]=l=>e(r).benefitScores=l)},null,8,["modelValue"])]),_:1}),t(s,{label:"\u8BC4\u8BBA\u56FE\u7247",prop:"picUrls"},{default:o(()=>[t(E,{modelValue:e(r).picUrls,"onUpdate:modelValue":a[6]||(a[6]=l=>e(r).picUrls=l),limit:9,height:"60px",width:"60px"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[j,e(c)]])]),_:1},8,["modelValue"]),t(ge,{ref_key:"skuTableSelectRef",ref:b,onChange:D,"spu-id":e(r).spuId},null,8,["spu-id"])],64)}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/product/comment/CommentForm.vue"]])});export{Re as __tla,S as default};
|