PickUpStoreForm-af16c93d.js 8.5 KB

1
  1. import{d as J,n as Y,r as i,f as G,B as Q,o as v,l as b,w as a,i as e,a as l,j as V,C as W,c as Z,F as ee,k as ae,t as le,y as E,g as S,H as te,E as oe,ag as re,ah as de,s as ue,U as se,c1 as ie,J as ne,K as me,cx as pe,N as _e,_ as ce,__tla as ge}from"./index-af173888.js";import{_ as fe,__tla as ve}from"./Dialog-987c90a1.js";import{E as Ve,__tla as he}from"./el-time-select-6302a345.js";import{_ as ye,__tla as be}from"./UploadImg-adf73e38.js";import{g as we,c as Ue,u as Te,__tla as ke}from"./index-4c9ff324.js";import{a as xe,D as qe,__tla as Ae}from"./dict-093d1dfa.js";import{C as I}from"./constants-a3c69b57.js";import{d as Ce}from"./tree-02f455f9.js";import{g as Ee,__tla as Se}from"./index-049873cb.js";import{g as Ie,__tla as Pe}from"./index-e629498b.js";import{u as Be,__tla as Fe}from"./useMessage-170c1b43.js";import{__tla as Le}from"./index-4db4ba8b.js";import{__tla as Ne}from"./el-image-viewer-0d82b94c.js";let P,ze=Promise.all([(()=>{try{return ge}catch{}})(),(()=>{try{return ve}catch{}})(),(()=>{try{return he}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return Ae}catch{}})(),(()=>{try{return Se}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Le}catch{}})(),(()=>{try{return Ne}catch{}})()]).then(async()=>{let w,U;w=S("div",{style:{"font-size":"10px"},class:"pl-10px"},"\u63A8\u8350 180x180 \u56FE\u7247\u5206\u8FA8\u7387",-1),U=["src"],P=ce(J({__name:"PickUpStoreForm",emits:["success"],setup(He,{expose:B,emit:F}){const{t:h}=Y(),T=Be(),n=i(!1),_=i(!1),k=i(""),m=i(!1),x=i(""),r=i({id:void 0,name:"",phone:"",logo:"",detailAddress:"",introduction:"",areaId:0,openingTime:void 0,closingTime:void 0,latitude:void 0,longitude:void 0,status:I.ENABLE}),L=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"}]}),f=i(),q=i(),A=i("");B({open:async(d,t)=>{if(n.value=!0,k.value=h("action."+d),x.value=d,H(),t){m.value=!0;try{r.value=await we(t)}finally{m.value=!1}}}});const N=F,z=async()=>{if(f&&await f.value.validate()){m.value=!0;try{const d=r.value;x.value==="create"?(await Ue(d),T.success(h("common.createSuccess"))):(await Te(d),T.success(h("common.updateSuccess"))),n.value=!1,N("success")}finally{m.value=!1}}},H=()=>{var d;r.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:I.ENABLE},(d=f.value)==null||d.resetFields()},M=function(d){d.latlng&&d.latlng.lat&&(r.value.latitude=d.latlng.lat),d.latlng&&d.latlng.lng&&(r.value.longitude=d.latlng.lng),_.value=!1};return Q(async()=>{q.value=await Ee(),await(async()=>{window.selectAddress=M,window.addEventListener("message",function(t){let c=t.data;c&&c.module==="locationPicker"&&window.parent.selectAddress(c)},!1);const d=(await Ie()).tencentLbsKey;A.value=`https://apis.map.qq.com/tools/locpicker?type=1&key=${d}&referer=myapp`})()}),(d,t)=>{const c=ye,u=te,s=oe,R=re,D=de,g=ue,p=se,K=ie,C=Ve,y=ne,O=me,X=pe,$=fe,j=_e;return v(),b($,{title:l(k),modelValue:l(n),"onUpdate:modelValue":t[14]||(t[14]=o=>E(n)?n.value=o:null),width:"60%"},{footer:a(()=>[e(y,{onClick:z,type:"primary",disabled:l(m)},{default:a(()=>[V("\u786E \u5B9A")]),_:1},8,["disabled"]),e(y,{onClick:t[12]||(t[12]=o=>n.value=!1)},{default:a(()=>[V("\u53D6 \u6D88")]),_:1})]),default:a(()=>[W((v(),b(O,{ref_key:"formRef",ref:f,model:l(r),rules:l(L),"label-width":"120px"},{default:a(()=>[e(g,null,{default:a(()=>[e(s,{span:12},{default:a(()=>[e(u,{label:"\u95E8\u5E97 logo",prop:"logo"},{default:a(()=>[e(c,{modelValue:l(r).logo,"onUpdate:modelValue":t[0]||(t[0]=o=>l(r).logo=o),limit:1,"is-show-tip":!1},null,8,["modelValue"]),w]),_:1})]),_:1}),e(s,{span:12},{default:a(()=>[e(u,{label:"\u95E8\u5E97\u72B6\u6001",prop:"status"},{default:a(()=>[e(D,{modelValue:l(r).status,"onUpdate:modelValue":t[1]||(t[1]=o=>l(r).status=o)},{default:a(()=>[(v(!0),Z(ee,null,ae(l(xe)(l(qe).COMMON_STATUS),o=>(v(),b(R,{key:o.value,label:o.value},{default:a(()=>[V(le(o.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(g,null,{default:a(()=>[e(s,{span:12},{default:a(()=>[e(u,{label:"\u95E8\u5E97\u540D\u79F0",prop:"name"},{default:a(()=>[e(p,{modelValue:l(r).name,"onUpdate:modelValue":t[2]||(t[2]=o=>l(r).name=o),placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1}),e(s,{span:12},{default:a(()=>[e(u,{label:"\u95E8\u5E97\u624B\u673A",prop:"phone"},{default:a(()=>[e(p,{modelValue:l(r).phone,"onUpdate:modelValue":t[3]||(t[3]=o=>l(r).phone=o),placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u624B\u673A"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,{label:"\u95E8\u5E97\u7B80\u4ECB",prop:"introduction"},{default:a(()=>[e(p,{modelValue:l(r).introduction,"onUpdate:modelValue":t[4]||(t[4]=o=>l(r).introduction=o),rows:3,type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u7B80\u4ECB"},null,8,["modelValue"])]),_:1}),e(g,null,{default:a(()=>[e(s,{span:12},{default:a(()=>[e(u,{label:"\u95E8\u5E97\u6240\u5728\u5730\u533A",prop:"areaId"},{default:a(()=>[e(K,{modelValue:l(r).areaId,"onUpdate:modelValue":t[5]||(t[5]=o=>l(r).areaId=o),options:l(q),props:l(Ce)},null,8,["modelValue","options","props"])]),_:1})]),_:1}),e(s,{span:12},{default:a(()=>[e(u,{label:"\u95E8\u5E97\u8BE6\u7EC6\u5730\u5740",prop:"detailAddress"},{default:a(()=>[e(p,{modelValue:l(r).detailAddress,"onUpdate:modelValue":t[6]||(t[6]=o=>l(r).detailAddress=o),placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u8BE6\u7EC6\u5730\u5740"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(g,null,{default:a(()=>[e(s,{span:12},{default:a(()=>[e(u,{label:"\u8425\u4E1A\u5F00\u59CB\u65F6\u95F4",prop:"openingTime"},{default:a(()=>[e(C,{modelValue:l(r).openingTime,"onUpdate:modelValue":t[7]||(t[7]=o=>l(r).openingTime=o),"max-time":l(r).closingTime,placeholder:"\u5F00\u59CB\u65F6\u95F4",start:"08:30",step:"00:15",end:"23:30"},null,8,["modelValue","max-time"])]),_:1})]),_:1}),e(s,{span:12},{default:a(()=>[e(u,{label:"\u8425\u4E1A\u7ED3\u675F\u65F6\u95F4",prop:"closingTime"},{default:a(()=>[e(C,{modelValue:l(r).closingTime,"onUpdate:modelValue":t[8]||(t[8]=o=>l(r).closingTime=o),"min-time":l(r).openingTime,placeholder:"\u7ED3\u675F\u65F6\u95F4",start:"08:30",step:"00:15",end:"23:30"},null,8,["modelValue","min-time"])]),_:1})]),_:1})]),_:1}),e(g,null,{default:a(()=>[e(s,{span:12},{default:a(()=>[e(u,{label:"\u7ECF\u5EA6",prop:"longitude"},{default:a(()=>[e(p,{modelValue:l(r).longitude,"onUpdate:modelValue":t[9]||(t[9]=o=>l(r).longitude=o),placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u7ECF\u5EA6"},null,8,["modelValue"])]),_:1})]),_:1}),e(s,{span:12},{default:a(()=>[e(u,{label:"\u7EAC\u5EA6",prop:"latitude"},{default:a(()=>[e(p,{modelValue:l(r).latitude,"onUpdate:modelValue":t[10]||(t[10]=o=>l(r).latitude=o),placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u7EAC\u5EA6"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,{label:"\u83B7\u53D6\u7ECF\u7EAC\u5EA6"},{default:a(()=>[e(y,{type:"primary",onClick:t[11]||(t[11]=o=>_.value=!0)},{default:a(()=>[V("\u83B7\u53D6")]),_:1})]),_:1})]),_:1},8,["model","rules"])),[[j,l(m)]]),e(X,{modelValue:l(_),"onUpdate:modelValue":t[13]||(t[13]=o=>E(_)?_.value=o:null),title:"\u83B7\u53D6\u7ECF\u7EAC\u5EA6","append-to-body":"",width:"500px",class:"mapBox"},{default:a(()=>[S("iframe",{id:"mapPage",width:"100%",height:"100%",frameborder:"0",src:l(A)},null,8,U)]),_:1},8,["modelValue"])]),_:1},8,["title","modelValue"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/trade/delivery/pickUpStore/PickUpStoreForm.vue"]])});export{ze as __tla,P as default};