PickUpStoreForm-f5667ecd.js 7.9 KB

1
  1. import{d as J,X as R,J as X,r as n,K as Y,e as G,k as Q,o as _,c as q,v as W,a as t,q as A,w as a,f as e,F as k,n as Z,m as x,t as ee,Y as ae,g as le,N as te,h as oe,U as de,z as se,E as ue,i as re,ba as ie,ag as ne,ah as me,B as pe,C as ce,a$ as ge,H as _e,__tla as fe}from"./index-2eab2d23.js";import{E as ve,__tla as be}from"./el-time-select-5c827818.js";import{g as Ve,c as ye,u as he,__tla as we}from"./index-c2301e22.js";import{a as Te,D as Ue,__tla as qe}from"./dict-1ad71b6f.js";import{C as E}from"./constants-40f13f5e.js";import{d as Ae}from"./tree-fd3a041e.js";import{g as ke,__tla as xe}from"./index-44a34f60.js";import{g as Ee,__tla as Ie}from"./index-e7f20230.js";import{u as Se,__tla as Be}from"./useMessage-171aa63e.js";import{_ as Ce}from"./_plugin-vue_export-helper-1b428a4d.js";let I,De=Promise.all([(()=>{try{return fe}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return qe}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return Ie}catch{}})(),(()=>{try{return Be}catch{}})()]).then(async()=>{let V;V=["src"],I=Ce(J({__name:"PickUpStoreForm",props:{isDetail:{type:Boolean,default:!1},obj:{default:{}},openType:{default:"create"},logo:{type:String,default:""}},emits:["success"],setup(f,{expose:S,emit:Ne}){const B=R(),C=X(()=>B.getMobile),{t:v}=oe(),y=Se(),D=n(!1),p=n(!1),N=n(""),c=n(!1),h=n(""),o=n({id:void 0,name:"",phone:"",logo:"",detailAddress:"",introduction:"",areaId:0,openingTime:void 0,closingTime:void 0,latitude:void 0,longitude:void 0,status:E.ENABLE}),b=f;Y(b,s=>{o.value.logo=s.logo},{immediate:!0});const P=G({name:[{required:!0,message:"\u95E8\u5E97\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],logo:[{required:!0,message:"\u95E8\u5E97 logo \u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],phone:[{required:!0,message:"\u95E8\u5E97\u624B\u673A\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"},{pattern:/^1[3|4|5|6|7|8|9][0-9]\d{8}$/,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801",trigger:"blur"}],areaId:[{required:!0,message:"\u95E8\u5E97\u6240\u5728\u533A\u57DF\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],detailAddress:[{required:!0,message:"\u95E8\u5E97\u8BE6\u7EC6\u5730\u5740\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],openingTime:[{required:!0,message:"\u8425\u4E1A\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],closingTime:[{required:!0,message:"\u8425\u4E1A\u7ED3\u675F\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],latitude:[{required:!0,message:"\u7EAC\u5EA6\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],longitude:[{required:!0,message:"\u7ECF\u5EA6\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u5F00\u542F\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),g=n(),w=n(),T=n("");S({submitForm:async()=>{if(!g||!await g.value.validate())return;c.value=!0;const s=n(!1);try{const l=o.value;h.value==="create"?(await ye(l),y.success(v("common.createSuccess"))):(await he(l),y.success(v("common.updateSuccess"))),s.value=!0}finally{return s.value}}});const F=()=>{var s;o.value={id:void 0,name:"",phone:"",logo:"",detailAddress:"",introduction:"",areaId:void 0,openingTime:void 0,closingTime:void 0,latitude:void 0,longitude:void 0,status:E.ENABLE},(s=g.value)==null||s.resetFields()},L=function(s){s.latlng&&s.latlng.lat&&(o.value.latitude=s.latlng.lat),s.latlng&&s.latlng.lng&&(o.value.longitude=s.latlng.lng),p.value=!1};return Q(async()=>{(async(s,l)=>{if(D.value=!0,N.value=v("action."+s),h.value=s,F(),l){c.value=!0;try{o.value=await Ve(l)}finally{c.value=!1}}})(b.openType,b.obj.id),w.value=await ke(),await(async()=>{window.selectAddress=L,window.addEventListener("message",function(l){let i=l.data;i&&i.module==="locationPicker"&&window.parent.selectAddress(i)},!1);const s=(await Ee()).tencentLbsKey;T.value=`https://apis.map.qq.com/tools/locpicker?type=1&key=${s}&referer=myapp`})()}),(s,l)=>{const i=de,u=se,r=ue,m=re,M=ie,U=ve,$=ne,K=me,j=pe,H=ce,O=ge,z=_e;return _(),q(k,null,[W((_(),A(H,{ref_key:"formRef",ref:g,model:t(o),rules:t(P),"label-width":"120px",class:ae({view:f.isDetail,"mobile-card":t(C)}),disabled:f.isDetail},{default:a(()=>[e(m,null,{default:a(()=>[e(r,{span:12},{default:a(()=>[e(u,{label:"\u95E8\u5E97\u540D\u79F0",prop:"name"},{default:a(()=>[e(i,{modelValue:t(o).name,"onUpdate:modelValue":l[0]||(l[0]=d=>t(o).name=d),placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:a(()=>[e(u,{label:"\u95E8\u5E97\u624B\u673A",prop:"phone"},{default:a(()=>[e(i,{modelValue:t(o).phone,"onUpdate:modelValue":l[1]||(l[1]=d=>t(o).phone=d),placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u624B\u673A"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(m,null,{default:a(()=>[e(r,{span:12},{default:a(()=>[e(u,{label:"\u95E8\u5E97\u6240\u5728\u5730\u533A",prop:"areaId"},{default:a(()=>[e(M,{modelValue:t(o).areaId,"onUpdate:modelValue":l[2]||(l[2]=d=>t(o).areaId=d),options:t(w),props:t(Ae)},null,8,["modelValue","options","props"])]),_:1})]),_:1}),e(r,{span:12},{default:a(()=>[e(u,{label:"\u95E8\u5E97\u8BE6\u7EC6\u5730\u5740",prop:"detailAddress"},{default:a(()=>[e(i,{modelValue:t(o).detailAddress,"onUpdate:modelValue":l[3]||(l[3]=d=>t(o).detailAddress=d),placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u8BE6\u7EC6\u5730\u5740"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(m,null,{default:a(()=>[e(r,{span:12},{default:a(()=>[e(u,{label:"\u8425\u4E1A\u5F00\u59CB\u65F6\u95F4",prop:"openingTime"},{default:a(()=>[e(U,{modelValue:t(o).openingTime,"onUpdate:modelValue":l[4]||(l[4]=d=>t(o).openingTime=d),"max-time":t(o).closingTime,placeholder:"\u5F00\u59CB\u65F6\u95F4",start:"08:30",step:"00:15",end:"23:30"},null,8,["modelValue","max-time"])]),_:1})]),_:1}),e(r,{span:12},{default:a(()=>[e(u,{label:"\u8425\u4E1A\u7ED3\u675F\u65F6\u95F4",prop:"closingTime"},{default:a(()=>[e(U,{modelValue:t(o).closingTime,"onUpdate:modelValue":l[5]||(l[5]=d=>t(o).closingTime=d),"min-time":t(o).openingTime,placeholder:"\u7ED3\u675F\u65F6\u95F4",start:"08:30",step:"00:15",end:"23:30"},null,8,["modelValue","min-time"])]),_:1})]),_:1})]),_:1}),e(m,null,{default:a(()=>[e(r,{span:12},{default:a(()=>[e(u,{label:"\u7ECF\u5EA6",prop:"longitude"},{default:a(()=>[e(i,{modelValue:t(o).longitude,"onUpdate:modelValue":l[6]||(l[6]=d=>t(o).longitude=d),placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u7ECF\u5EA6"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:a(()=>[e(u,{label:"\u7EAC\u5EA6",prop:"latitude"},{default:a(()=>[e(i,{modelValue:t(o).latitude,"onUpdate:modelValue":l[7]||(l[7]=d=>t(o).latitude=d),placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u7EAC\u5EA6"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(m,null,{default:a(()=>[e(r,{span:12},{default:a(()=>[e(u,{label:"\u95E8\u5E97\u72B6\u6001",prop:"status"},{default:a(()=>[e(K,{modelValue:t(o).status,"onUpdate:modelValue":l[8]||(l[8]=d=>t(o).status=d)},{default:a(()=>[(_(!0),q(k,null,Z(t(Te)(t(Ue).COMMON_STATUS),d=>(_(),A($,{key:d.value,label:d.value},{default:a(()=>[x(ee(d.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:a(()=>[e(u,{label:"\u83B7\u53D6\u7ECF\u7EAC\u5EA6"},{default:a(()=>[e(j,{type:"primary",onClick:l[9]||(l[9]=d=>p.value=!0)},{default:a(()=>[x("\u83B7\u53D6")]),_:1})]),_:1})]),_:1})]),_:1}),e(m,null,{default:a(()=>[e(r,{span:24},{default:a(()=>[e(u,{label:"\u95E8\u5E97\u7B80\u4ECB",prop:"introduction"},{default:a(()=>[e(i,{modelValue:t(o).introduction,"onUpdate:modelValue":l[10]||(l[10]=d=>t(o).introduction=d),rows:3,type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u7B80\u4ECB"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","class","disabled"])),[[z,t(c)]]),e(O,{modelValue:t(p),"onUpdate:modelValue":l[11]||(l[11]=d=>te(p)?p.value=d:null),title:"\u83B7\u53D6\u7ECF\u7EAC\u5EA6","append-to-body":"",width:"500px",class:"mapBox"},{default:a(()=>[le("iframe",{id:"mapPage",width:"100%",height:"100%",frameborder:"0",src:t(T)},null,8,V)]),_:1},8,["modelValue"])],64)}}}),[["__scopeId","data-v-65cb1390"]])});export{De as __tla,I as default};