eidt-school.806cb759.js 6.3 KB

1
  1. import{d as L,ag as y,ah as C,r as m,R as M,$ as i,bF as D,c as a,aj as E,q as l,a5 as F,B as I,F as x,g as N,m as g,o as n,e as A}from"./index.1c621181.js";import{O as W}from"./index.b491c24a.js";import{s,l as z}from"./logo.8acf0b46.js";import{a as k}from"./area.bc7b6c10.js";import{O as q}from"./index.3a293742.js";import{C as f}from"./index.2db9d877.js";import{I as R}from"./index.4c221cbe.js";import{F as c}from"./index.c7a20c76.js";import"./index.6999cc47.js";import"./index.de594f37.js";import"./ImagePreview.410fc85b.js";import"./index.78a302c3.js";import"./function-call.db8bb852.js";import"./index.fd5ae97b.js";var U="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAkCAYAAADl9UilAAAAAXNSR0IArs4c6QAABytJREFUWEe1WH2MXFUV/503O11aMbpiW1NFItEAWyI2UgNVC02qWGDZ7M68cztTLcEaIBZqS4xigu6saLR/KFVsQos1Eut23n1vN2xbCxVNLTFFUQMobjB+JJpUrauNRrTM7sw75oz3bV5n52u7ev569+uc3z3f9xEWQSdOnOiZnp6+DkA/EV2irETkbwCmli9f/qMNGzZUL5Q9XcjB8fHxtXEc7xKRTQBe24LH3wEcy2Qye3K53E8WKmdBwKy1bwTwVQBDALo9KwAmAHyMmU93C7Bb5gjDcJ2IjAN4QwPz3wB4loj+6Ey5CsC7ALw1vY+I/gQg7/v+qW7AdQUsDMP3ishTAHqd8NjzvLFarbZ78+bNLzYTVC6Xr85kMp+M47hIRJ7bUwGwkZl/2AlcR2BRFF0ex/GPAbzeMfszAL8b5rrfWvseAGFK09Ozs7PXbdmy5XftwHUEZq1VTW10TNRH1jHzHzrdOL1urX0zgGcAqJmVnmLm918wsDAMN4nIMWe+WSK6npl/lmY4Pj5+WbVaVXNd7eZ/kclkDuVyud83gHunA5d185uY+clW4NpqzFqrB29ywB42xuxIMwrD8FMARkSk7nspqhDRqO/7X2gA9zCAe9zck8ys6aYptQRmrX0NgL8AWAIg7u3tvX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it8Vx/AMAFxPR4Wq1eqBQKOh4juaARVG0Jo5j9Zl6r5QSusP3fU20c7Rv375lfX19Gmk3J5MiUn8tpVpsHWpbnmfmc+nzQRDsIKKvNMg5Va1W7ykUClrq/vtoDYIgR0RjrltN73++VqvdUigU5jrXZFFLFgD1oaZlSR1dRD7erORMTk6uqlQq3wHwjgZfmxGRokYtHTx48E1LlizR7P4qt+kVEflGNpvdPzw8/ELDwXnDcrl8h+d5XwOwzC2qH21nZjVpW5qYmLimVqvdKSIfBnCR2/yvmZmZKzX5aWeamOpXAG5Nt8KdmOu6tbZfRL7sTHkfM2vb3TVZa7X0qd9e4Q7dqxG0U0QechNa325m5umuuf4PNlprlxPRMRG51rHbqRp7i3tYJKrU30gK9AAz66v7/0bWWv0Psg2Atkb131gAXqn/1tKvIAhuJ6IDSRfhNtT0daRh7XneSRF5jpnPLgaltfZ1RKTRf4OmIRFZ1yhTRLYZYx6bSxfW2huI6BERubKN8DOuDTpNRGfiOD6TyWReFhF94OpNtc+6iIh6a7XaxZ7nrRSRla5jVb763ZSI6CURuZuZT9Z9Nb1LU4CIMBFppKxP/aVZjKJanhWRmIieFpH9mqTTqaVlER8bG1uZzWZvUoAisoaIrgKwdJEINdFqxD6vgGZnZ48Xi0W1wjz6D4HbHVCZGLHzAAAAAElFTkSuQmCC",_=L({name:"school-detail",setup(){const h=y(),b=C(),r=m({list:[],info:{},showArea:!1,columns:[],showProvince:""}),o=m({address:"",logo:"",email:"",emergencyContact:"",addressLongitudeLatitude:""}),d=M();console.log(d.value);const w=async()=>{const e=(N.user.data.schoolInfos||[]).map(t=>t.id).join(",");try{const{data:t}=await g.get(`/api-school/school/detail/${e}`,{});r.info=t,r.showProvince=t.provinceName+t.cityName,o.logo=t.logo,o.email=t.email,o.emergencyContact=t.emergencyContact,o.addressLongitudeLatitude=t.addressLongitudeLatitude,o.address=t.address}catch(t){n(t.message)}},V=async()=>{if(o.email){const e=/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/;if(!o.email.match(e)){n("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u90AE\u7BB1");return}}if(!o.address){n("\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740");return}try{await g.post("/api-school/school/update",{hideLoading:!1,data:{...o}}),b.query.page==="type"?h.go(-1):A({api:"back"})}catch(e){n(e.message)}console.log("submitInfo")};i(()=>{w()});const Z=()=>{d.value.startUpload()};i(()=>{const e=[];k.forEach(t=>{const u={name:t.name,code:t.code,areas:[]};t.areas&&t.areas.length>0&&t.areas.forEach(p=>{u.areas.push({name:p.name,code:p.code})}),e.push(u)}),r.columns=e||[]});const v=async()=>{try{A({api:"sourseMapApi",content:{type:"modify",orginPoint:o.addressLongitudeLatitude}},e=>{console.log(e.content.nowPoint,e.content.address,"------"),o.addressLongitudeLatitude=e.content.nowPoint,o.address=e.content.address})}catch(e){console.log(e)}};return i(()=>{D("sourseMapApi",e=>{console.log(e.content.nowPoint,e.content.address),o.addressLongitudeLatitude=e.content.nowPoint,o.address=e.content.address})}),()=>a(x,null,[a(E,null,null),a("div",{class:s.schoolEidtWrap},[a("div",{class:s.eidtWrap},[a(f,{inset:!0},{default:()=>[a("div",{class:s.schoolDtailWrap,onClick:Z},[a(R,{width:50,height:50,fit:"cover",class:s.schoolICon,src:o.logo?o.logo:z},null),a("div",{class:s.schoolBtnWrap},[a("p",null,[l("\u4FEE\u6539\u6821\u5FBD")]),a(F,{name:"arrow",size:"12px",color:"#aaa"},null)])])]})]),a("div",{class:s.eidtWrap},[a(f,{inset:!0},{default:()=>[a(c,{"label-align":"left",rows:3,modelValue:o.emergencyContact,"onUpdate:modelValue":e=>o.emergencyContact=e,maxlength:50,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D"},{label:()=>a("p",{class:s.addP},[l("\u4E3B\u7BA1\u9886\u5BFC")])}),a(c,{"label-align":"left",rows:3,modelValue:o.email,"onUpdate:modelValue":e=>o.email=e,maxlength:50,placeholder:"\u8BF7\u8F93\u5165\u90AE\u7BB1\u8D26\u53F7"},{label:()=>a("p",{class:s.addP},[l("\u90AE\u7BB1\u8D26\u53F7")])}),a(c,{"label-align":"top",maxlength:50,placeholder:"\u8BF7\u9009\u62E9\u5B66\u6821\u5730\u5740",type:"textarea",disabled:!0,onClick:()=>v()},{extra:()=>a("div",{class:s.loctionIconWrap},null),label:()=>a("p",{class:[s.addP,s.addDet]},[l("\u5B66\u6821\u5730\u5740 "),a(R,{width:19,height:18,src:U},null)]),input:()=>a("div",{style:{paddingTop:"6px",paddingRight:"13px"}},[o.address])})]}),a(q,{class:s.upload,cropper:!0,bucket:"gyt",path:"/orchestra/",modelValue:o.logo,"onUpdate:modelValue":e=>o.logo=e,ref:d},null)]),a(W,{position:"bottom"},{default:()=>[a("div",{class:"btnGroup"},[a(I,{type:"primary",round:!0,block:!0,onClick:V},{default:()=>[l("\u786E\u8BA4\u4FEE\u6539")]})])]})])])}});export{_ as default};