import{D as W,S as N,T as O,b as P,F as j}from"./element-plus.55d71530.js";import{_ as $}from"./index.vue_vue_type_style_index_0_lang.7c7bbd24.js";import{P as z}from"./index.8e3b20a1.js";import{r as p,t as C}from"./index.75e08341.js";import{d as w,s as D,r as V,b as G,_ as h,o as n,c,V as s,M as o,u,T as H,R as J,U as _,aa as b,L as k}from"./@vue.96c135a1.js";function re(l){return p.get({url:"/feedback.feedback/lists",params:l})}function K(l){return p.post({url:"/feedback.feedback/add",params:l})}function Q(l){return p.post({url:"/feedback.feedback/edit",params:l})}function oe(l){return p.post({url:"/feedback.feedback/delete",params:l})}function X(l){return p.get({url:"/feedback.feedback/detail",params:l})}const Y={class:"edit-popup"},Z={key:0},ee=w({name:"feedbackEdit"}),de=w({...ee,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(l,{expose:x,emit:R}){const y=R,E=D(),m=D(),f=V("add"),M=G(()=>f.value=="edit"?"\u7F16\u8F91\u5DE5\u7A0B\u5E08-\u610F\u89C1\u53CD\u9988\u8868":"\u65B0\u589E\u5DE5\u7A0B\u5E08-\u610F\u89C1\u53CD\u9988\u8868"),t=h({id:"",user_id:"",masterWorker:V({}),feedback_type:"",description:"",pictures:[],remark:"",status:""}),U=h({feedback_type:[{required:!0,message:"\u8BF7\u9009\u62E9\u53CD\u9988\u7C7B\u578B",trigger:["blur"]}],description:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BE6\u7EC6\u8BF4\u660E",trigger:["blur"]}],status:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001",trigger:["blur"]}]}),B=async r=>{for(const e in t)r[e]!=null&&r[e]!=null&&(t[e]=r[e]);t.create_time=C(t.create_time,"yyyy-mm-dd hh:MM:ss"),t.update_time=C(t.update_time,"yyyy-mm-dd hh:MM:ss")},q=async r=>{const e=await X({id:r.id});B(e)},I=async()=>{var e,d;await((e=E.value)==null?void 0:e.validate());const r={...t};f.value=="edit"?await Q(r):await K(r),(d=m.value)==null||d.close(),y("success")},S=(r="add")=>{var e;f.value=r,(e=m.value)==null||e.open()},A=()=>{y("close")};return x({open:S,setFormData:B,getDetail:q}),(r,e)=>{const d=W,F=N,g=O,v=$,L=P,T=j;return n(),c("div",Y,[s(z,{ref_key:"popupRef",ref:m,title:u(M),async:!0,width:"1000px",onConfirm:I,onClose:A},{default:o(()=>[s(T,{ref_key:"formRef",ref:E,model:u(t),"label-width":"90px",rules:u(U)},{default:o(()=>[s(d,{label:"\u7528\u6237"},{default:o(()=>[u(t).masterWorker?(n(),c("span",Z,H(u(t).masterWorker.nickname),1)):J("",!0)]),_:1}),s(d,{label:"\u53CD\u9988\u7C7B\u578B",prop:"feedback_type"},{default:o(()=>[s(g,{class:"flex-1",modelValue:u(t).feedback_type,"onUpdate:modelValue":e[0]||(e[0]=a=>u(t).feedback_type=a),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u53CD\u9988\u7C7B\u578B",disabled:""},{default:o(()=>[(n(!0),c(_,null,b(l.dictData.worker_feedback_type,(a,i)=>(n(),k(F,{key:i,label:a.name,value:parseInt(a.value)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(d,{label:"\u8BE6\u7EC6\u8BF4\u660E",prop:"description"},{default:o(()=>[s(v,{class:"flex-1",modelValue:u(t).description,"onUpdate:modelValue":e[1]||(e[1]=a=>u(t).description=a),height:500,disabled:"true"},null,8,["modelValue"])]),_:1}),s(d,{label:"\u56FE\u7247\u7EC4",prop:"pictures"},{default:o(()=>[(n(!0),c(_,null,b(u(t).pictures,(a,i)=>(n(),k(L,{style:{width:"100px",height:"100px"},src:a,key:i,"preview-src-list":u(t).pictures},null,8,["src","preview-src-list"]))),128))]),_:1}),s(d,{label:"\u72B6\u6001",prop:"status"},{default:o(()=>[s(g,{class:"flex-1",modelValue:u(t).status,"onUpdate:modelValue":e[2]||(e[2]=a=>u(t).status=a),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"},{default:o(()=>[(n(!0),c(_,null,b(l.dictData.event_status,(a,i)=>(n(),k(F,{key:i,label:a.name,value:parseInt(a.value)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(d,{label:"\u8BF4\u660E",prop:"remark"},{default:o(()=>[s(v,{class:"flex-1",modelValue:u(t).remark,"onUpdate:modelValue":e[3]||(e[3]=a=>u(t).remark=a),height:500},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{de as _,oe as a,re as b};
