import{d as v,ag as D,ah as L,r as m,R as y,$ as d,bJ as C,c as a,aj as E,q as l,a5 as M,B as I,F as x,g as N,m as g,o as n,e as A}from"./index.5f7ffb46.js";import{O as W}from"./index.7790de2a.js";import{s,l as z}from"./logo.8acf0b46.js";import{a as k}from"./area.bc7b6c10.js";import{O as q}from"./index.623dc134.js";import{C as f}from"./index.052b3caa.js";import{I as R}from"./index.276a5d68.js";import{F as i}from"./index.6438a25f.js";import"./index.36e5ddaf.js";import"./index.4f3f29e9.js";import"./ImagePreview.289405c5.js";import"./index.99e0cf1f.js";import"./function-call.aca3a7bc.js";import"./index.abd668f7.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/7X2gA9zCAe9zck8ys6aYptQRmrX0NgL8AWAIg7u3tvXRwcLAeeUphGD4gIg+2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1eqBQKOh4juaARVG0Jo5j9Zl6r5QSusP3fU20c7Rv375lfX19Gmk3J5MiUn8tpVpsHWpbnmfmc+nzQRDsIKKvNMg5Va1W7ykUClrq/vtoDYIgR0RjrltN73++VqvdUigU5jrXZFFLFgD1oaZlSR1dRD7erORMTk6uqlQq3wHwjgZfmxGRokYtHTx48E1LlizR7P4qt+kVEflGNpvdPzw8/ELDwXnDcrl8h+d5XwOwzC2qH21nZjVpW5qYmLimVqvdKSIfBnCR2/yvmZmZKzX5aWeamOpXAG5Nt8KdmOu6tbZfRL7sTHkfM2vb3TVZa7X0qd9e4Q7dqxG0U0QechNa325m5umuuf4PNlprlxPRMRG51rHbqRp7i3tYJKrU30gK9AAz66v7/0bWWv0Psg2Atkb131gAXqn/1tKvIAhuJ6IDSRfhNtT0daRh7XneSRF5jpnPLgaltfZ1RKTRf4OmIRFZ1yhTRLYZYx6bSxfW2huI6BERubKN8DOuDTpNRGfiOD6TyWReFhF94OpNtc+6iIh6a7XaxZ7nrRSRla5jVb763ZSI6CURuZuZT9Z9Nb1LU4CIMBFppKxP/aVZjKJanhWRmIieFpH9mqTTqaVlER8bG1uZzWZvUoAisoaIrgKwdJEINdFqxD6vgGZnZ48Xi0W1wjz6D4HbHVCZGLHzAAAAAElFTkSuQmCC",_=v({name:"school-detail",setup(){const h=D(),b=L(),r=m({list:[],info:{},showArea:!1,columns:[],showProvince:""}),o=m({address:"",logo:"",email:"",emergencyContact:"",addressLongitudeLatitude:""}),u=y();console.log(u.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)}},F=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")};d(()=>{w()});const V=()=>{u.value.startUpload()};d(()=>{const e=[];k.forEach(t=>{const c={name:t.name,code:t.code,areas:[]};t.areas&&t.areas.length>0&&t.areas.forEach(p=>{c.areas.push({name:p.name,code:p.code})}),e.push(c)}),r.columns=e||[]});const Z=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 d(()=>{C("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:V},[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(M,{name:"arrow",size:"12px",color:"#aaa"},null)])])]})]),a("div",{class:s.eidtWrap},[a(f,{inset:!0},{default:()=>[a(i,{"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(i,{"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(i,{"label-align":"top",maxlength:50,placeholder:"\u8BF7\u9009\u62E9\u5B66\u6821\u5730\u5740",type:"textarea",disabled:!0,onClick:()=>Z()},{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:u},null)]),a(W,{position:"bottom"},{default:()=>[a("div",{class:"btnGroup"},[a(I,{type:"primary",round:!0,block:!0,onClick:F},{default:()=>[l("\u786E\u8BA4\u4FEE\u6539")]})])]})])])}});export{_ as default};