import{D as m,d as w,s as N,r as C,b as f,p as L,c as i,e as g,k as V,i as a,h as u,u as l,f as M,j as O,m as _,t as P,F as z,A as R,a2 as j,E}from"./index.0308b213.js";import{M as G}from"./index.dfdc0704.js";const $=n=>m.request({url:"merchant/dingingTreasure.dinging_treasure/list",params:n}),ee=n=>m.request({url:"merchant/dingingTreasure.dinging_treasure/delete",method:"POST",data:n}),H=n=>m.request({url:"merchant/dingingTreasure.dinging_treasure/detail",params:n}),I=n=>m.request({url:"merchant/dingingTreasure.dinging_treasure/edit",method:"POST",data:n}),J=n=>m.request({url:"merchant/dingingTreasure.dinging_treasure/add",method:"POST",data:n}),K=_("\u5DF2\u51FA\u9910"),Q=_("\u5DF2\u8FDB\u6536\u9910\u7AD9\u70B9"),W=_("\u63D0\u4EA4"),X=_("\u53D6\u6D88"),te=w({props:{modelValue:{type:Boolean,default:!1},id:null},emits:["update:modelValue","onClose"],setup(n,{emit:b}){const r=n;let A=N(()=>Number(r.id)>0);const c=C(!1),h=C(),e=f({id:"",agentid:"",name:"",imei:"",update_status_image:"",update_status:"",station_id:""}),y=()=>{e.id>0?I(e).then(o=>{E({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),p()}):J(e).then(o=>{E({message:"\u65B0\u589E\u6210\u529F",type:"success"}),p()})};L(()=>r.modelValue,o=>{c.value=o,o&&r.id&&(e.id=r.id,k())}),f({list:[]});const k=()=>{H({id:r.id}).then(o=>{o=o.data,e.agentid=o.agentid,e.name=o.name,e.imei=o.imei,e.update_status_image=o.update_status_image,e.update_status=o.update_status,e.station_id=o.station_id})},p=()=>{b("update:modelValue",!1),b("onClose")},T=f({list:[]});return(o,s)=>{const F=i("el-input"),d=i("el-form-item"),B=i("el-radio"),v=i("el-radio-group"),x=i("el-option"),q=i("el-select"),D=i("el-button"),U=i("el-dialog");return g(),V(U,{modelValue:c.value,"onUpdate:modelValue":s[5]||(s[5]=t=>c.value=t),title:l(A)?"\u67E5\u770B":"\u65B0\u589E",width:"70%","destroy-on-close":"",onClose:p},{default:a(()=>[u(l(j),{ref_key:"formRef",ref:h,model:l(e),"inline-message":!0,"label-width":"160px"},{default:a(()=>[u(d,{label:"\u540D\u79F0",prop:"name"},{default:a(()=>[u(F,{modelValue:l(e).name,"onUpdate:modelValue":s[0]||(s[0]=t=>l(e).name=t)},null,8,["modelValue"])]),_:1}),u(d,{label:"\u8BBE\u5907\u53F7",prop:"imei"},{default:a(()=>[u(F,{modelValue:l(e).imei,"onUpdate:modelValue":s[1]||(s[1]=t=>l(e).imei=t)},null,8,["modelValue"])]),_:1}),u(d,{label:"\u51FA\u9910\u754C\u9762\u80CC\u666F\u56FE",prop:"update_status_image"},{default:a(()=>[u(G,{modelValue:l(e).update_status_image,"onUpdate:modelValue":s[2]||(s[2]=t=>l(e).update_status_image=t),limit:1},null,8,["modelValue"])]),_:1}),u(d,{label:"\u66F4\u65B0\u72B6\u6001",prop:"update_status"},{default:a(()=>[u(v,{modelValue:l(e).update_status,"onUpdate:modelValue":s[3]||(s[3]=t=>l(e).update_status=t)},{default:a(()=>[u(B,{label:"is_meal_served",size:"large"},{default:a(()=>[K]),_:1}),u(B,{label:"is_in_box",size:"large"},{default:a(()=>[Q]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(e).update_status=="is_in_box"?(g(),V(d,{key:0,label:"\u7ED1\u5B9A\u6536\u9910\u70B9",prop:"station_id"},{default:a(()=>[u(q,{modelValue:l(e).station_id,"onUpdate:modelValue":s[4]||(s[4]=t=>l(e).station_id=t),placeholder:"\u8BF7\u9009\u62E9\u6536\u9910\u7AD9\u70B9",filterable:"",clearable:""},{default:a(()=>[(g(!0),M(z,null,O(l(T).list,(t,S)=>(g(),V(x,{key:S,value:t.id,label:t.title},{default:a(()=>[_(P(t.title),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1})):R("",!0),u(d,null,{default:a(()=>[u(D,{type:"primary",onClick:y},{default:a(()=>[W]),_:1}),u(D,{onClick:p},{default:a(()=>[X]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{te as _,ee as d,$ as g};
