import{C as q,D as I,b as L,F as P}from"./element-plus.bccb9376.js";import{P as T}from"./index.8f1b3064.js";import{r as i}from"./index.ac7c1248.js";import"./lodash.466e9fe4.js";import{d as g,s as _,r as j,b as z,Z as B,o as m,c as k,U as l,L as n,u as t,T as A,a9 as K,K as N}from"./@vue.18505fe0.js";function Y(o){return i.get({url:"/user/userfeedback/lists",params:o})}function O(o){return i.post({url:"/user/userfeedback/add",params:o})}function S(o){return i.post({url:"/user/userfeedback/edit",params:o})}function $(o){return i.post({url:"/user/userfeedback/delete",params:o})}function Z(o){return i.get({url:"/user/userfeedback/detail",params:o})}const G={class:"edit-popup"},H=g({name:"userFeedbackEdit"}),ee=g({...H,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(o,{expose:D,emit:C}){const f=C,F=_(),c=_(),p=j("add"),y=z(()=>p.value=="edit"?"\u7F16\u8F91\u7528\u6237\u53CD\u9988\u8868":"\u65B0\u589E\u7528\u6237\u53CD\u9988\u8868"),u=B({id:"",uid:"",content:"",images:"",name:"",contact:""}),v=B({uid:[{required:!0,message:"\u8BF7\u8F93\u5165\u7528\u6237id",trigger:["blur"]}],content:[{required:!0,message:"\u8BF7\u8F93\u5165\u53CD\u9988\u5185\u5BB9",trigger:["blur"]}]}),b=async a=>{for(const e in u)a[e]!=null&&a[e]!=null&&(u[e]=a[e])},V=async a=>{const e=await Z({id:a.id});b(e)},w=async()=>{var e,r;await((e=F.value)==null?void 0:e.validate());const a={...u};p.value=="edit"?await S(a):await O(a),(r=c.value)==null||r.close(),f("success")},x=(a="add")=>{var e;p.value=a,(e=c.value)==null||e.open()},U=()=>{f("close")};return D({open:x,setFormData:b,getDetail:V}),(a,e)=>{const r=q,d=I,E=L,h=P;return m(),k("div",G,[l(T,{ref_key:"popupRef",ref:c,title:t(y),async:!0,width:"550px",onConfirm:w,onClose:U,"bottom-btn":!1},{default:n(()=>[l(h,{ref_key:"formRef",ref:F,model:t(u),"label-width":"90px",rules:t(v)},{default:n(()=>[l(d,{label:"\u7528\u6237id",prop:"uid"},{default:n(()=>[l(r,{modelValue:t(u).uid,"onUpdate:modelValue":e[0]||(e[0]=s=>t(u).uid=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7528\u6237id",readonly:!1},null,8,["modelValue"])]),_:1}),l(d,{label:"\u53CD\u9988\u5185\u5BB9",prop:"content"},{default:n(()=>[l(r,{modelValue:t(u).content,"onUpdate:modelValue":e[1]||(e[1]=s=>t(u).content=s),type:"textarea",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u53CD\u9988\u5185\u5BB9",readonly:!1},null,8,["modelValue"])]),_:1}),l(d,{label:"\u53CD\u9988\u56FE\u7247",prop:"images"},{default:n(()=>[(m(!0),k(A,null,K(t(u).images,(s,R)=>(m(),N(E,{key:R,style:{width:"100px",height:"100px"},src:s,"zoom-rate":1.2,"max-scale":7,"min-scale":.2,"preview-src-list":t(u).images,"initial-index":4,fit:"cover"},null,8,["src","preview-src-list"]))),128))]),_:1}),l(d,{label:"\u8054\u7CFB\u59D3\u540D",prop:"name"},{default:n(()=>[l(r,{modelValue:t(u).name,"onUpdate:modelValue":e[2]||(e[2]=s=>t(u).name=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u59D3\u540D",readonly:!1},null,8,["modelValue"])]),_:1}),l(d,{label:"\u8054\u7CFB\u65B9\u5F0F",prop:"contact"},{default:n(()=>[l(r,{modelValue:t(u).contact,"onUpdate:modelValue":e[3]||(e[3]=s=>t(u).contact=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u65B9\u5F0F",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{ee as _,$ as a,Y as b};
