Index-dfd29d1b.js 9.3 KB

1
  1. import{p as A}from"./index-519a55fb.js";import{d as M,i as f,y as D,l as B,q as F,r as u,o as k,b as P,w as a,C as E,c as e,B as q,e as _,m as H,x as Z,s as R,f as $,F as G,D as J,S as K,t as Q,H as X,p as Y,j as ee,_ as te}from"./index-3b8b93f4.js";import"./CusNavigation.vue_vue_type_style_index_0_scoped_5e63f475_lang-c9f54a72.js";import{C as le}from"./CusNavigation-0a2cb184.js";import{R as oe}from"./ReloadOutlined-79e30c0a.js";const ae=M({__name:"Add",emits:["onSuccess"],setup(U,{expose:C,emit:c}){const s=f(null),i=f(!1),v=f(!0),m=f([{value:"00",label:"中国移动"},{value:"01",label:"中国联通"},{value:"02",label:"中国电信"}]),t=D({id:void 0,lac:"",ci:"",mnc:"",lng:"",lat:"",address:""}),z=function(){let d="";v.value?d="/stationLocation/add":d="/stationLocation/edit",A({url:d,data:t},l=>{console.log(l),q.info(l.msg),h(),c("onSuccess",l)})},w=d=>{var l;console.log("handleOK",d),(l=s.value)==null||l.validate().then(()=>{console.log("11"),z()},()=>{console.log("22")})},r=()=>{i.value=!0},h=()=>{i.value=!1},S=()=>{var d;v.value=!0,E(t),(d=s.value)==null||d.clearValidate(),r()},b=d=>{var l;v.value=!1,Object.assign(t,d),(l=s.value)==null||l.clearValidate(),r()};return B(()=>{console.log("onMounted")}),F(()=>{console.log("onUnmounted")}),C({add:S,update:b}),(d,l)=>{const O=u("a-input"),x=u("a-form-item"),o=u("a-select"),n=u("a-textarea"),I=u("a-form"),T=u("a-modal");return k(),P(T,{title:"添加设备",visible:i.value,"onUpdate:visible":l[6]||(l[6]=p=>i.value=p),maskClosable:!1,width:480,bodyStyle:{height:"500px","overflow-y":"auto"},cancelText:"取消",okText:"确定",onOk:w},{default:a(()=>[e(I,{ref_key:"formRef",ref:s,model:t,name:"basic","label-align":"left","label-col":{span:24},"wrapper-col":{span:20},autocomplete:"off",layout:"vertical"},{default:a(()=>[e(x,{"wrapper-col":{offset:0,span:24},label:"基站ID",name:"lac",rules:[{required:!0,message:"请输入基站ID!"}]},{default:a(()=>[e(O,{size:"large",value:t.lac,"onUpdate:value":l[0]||(l[0]=p=>t.lac=p)},null,8,["value"])]),_:1}),e(x,{"wrapper-col":{offset:0,span:24},label:"小区ID",name:"ci",rules:[{required:!0,message:"请输入小区ID!"}]},{default:a(()=>[e(O,{size:"large",value:t.ci,"onUpdate:value":l[1]||(l[1]=p=>t.ci=p)},null,8,["value"])]),_:1}),e(x,{"wrapper-col":{offset:0,span:24},label:"运营商",name:"mnc",rules:[{required:!0,message:"请选择运营商!"}]},{default:a(()=>[e(o,{size:"large",value:t.mnc,"onUpdate:value":l[2]||(l[2]=p=>t.mnc=p),options:m.value},null,8,["value","options"])]),_:1}),e(x,{"wrapper-col":{offset:0,span:24},label:"坐标(经度)",name:"lng",rules:[{required:!0,message:"请输入经度!"}]},{default:a(()=>[e(O,{size:"large",value:t.lng,"onUpdate:value":l[3]||(l[3]=p=>t.lng=p)},null,8,["value"])]),_:1}),e(x,{"wrapper-col":{offset:0,span:24},label:"坐标(纬度)",name:"lat",rules:[{required:!0,message:"请输入经度!"}]},{default:a(()=>[e(O,{size:"large",value:t.lat,"onUpdate:value":l[4]||(l[4]=p=>t.lat=p)},null,8,["value"])]),_:1}),e(x,{"wrapper-col":{offset:0,span:24},label:"地址",name:"address"},{default:a(()=>[e(n,{value:t.address,"onUpdate:value":l[5]||(l[5]=p=>t.address=p),placeholder:"请输入地址","allow-clear":""},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["visible"])}}}),ne=_("div",null," 详情 ",-1),se=M({__name:"Detail",setup(U,{expose:C}){const c=f(!1),s=m=>{console.log(m),c.value=!1},i=()=>{c.value=!0},v=()=>{c.value=!1};return B(()=>{}),C({show:i,hidden:v}),(m,t)=>{const z=u("a-modal");return k(),P(z,{title:"基站信息",visible:c.value,"onUpdate:visible":t[0]||(t[0]=w=>c.value=w),maskClosable:!1,width:480,cancelText:"取消",okText:"确定",onOk:s},{default:a(()=>[ne]),_:1},8,["visible"])}}}),ie=_("div",{style:{"font-weight":"bold"}},[_("span",null,"基站定位")],-1),de=_("div",{id:"map_2",style:{"flex-grow":"1",width:"100%",height:"500px"}},null,-1),ce=M({__name:"Location",setup(U,{expose:C}){const c=f(!1),s=window.BMapGL,i=f(null),v=()=>{if(!i.value){i.value=new s.Map("map_2",{mapType:window.BMAP_EARTH_MAP}),i.value.centerAndZoom(new s.Point(114.404,39.915),15),i.value.enableScrollWheelZoom(!0);var r=new s.ScaleControl;i.value.addControl(r)}},m=r=>{console.log(r),c.value=!1},t=f(),z=r=>{c.value=!0,t.value=r},w=()=>{c.value=!1};return B(()=>{console.log("onMounted")}),F(()=>{console.log("onUnmounted")}),H(()=>{var h,S;if(!c.value)return;console.log("onUpdate"),v(),i.value.clearOverlays();const r={lat:parseFloat((h=t.value)==null?void 0:h.lat),lng:parseFloat((S=t.value)==null?void 0:S.lng)};if(console.log(r),r.lat&&r.lng){const b=r.lng,d=r.lat;let l=new s.Point(b,d);console.log(b,d);let O=new s.Marker(l),x=new s.Circle(l,500,{strokeColor:"red",strokeWeight:1,strokeOpacity:1,fillOpacity:0});i.value.addOverlay(O),i.value.addOverlay(x),setTimeout(()=>{i.value.setCenter(l)},300)}else q.error("暂无定位")}),C({show:z,hidden:w}),(r,h)=>{const S=u("a-button"),b=u("a-modal");return k(),P(b,{visible:c.value,"onUpdate:visible":h[0]||(h[0]=d=>c.value=d),maskClosable:!1,destroyOnClose:!1,width:900},{title:a(()=>[ie]),footer:a(()=>[e(S,{type:"primary",onClick:m},{default:a(()=>[Z("知道了")]),_:1})]),default:a(()=>[de]),_:1},8,["visible"])}}}),re=U=>(Y("data-v-08b25017"),U=U(),ee(),U),ue={class:"cus-animation",style:{height:"100%",width:"100%",padding:"16px 20px",display:"flex","flex-direction":"column"}},pe={style:{display:"flex","justify-content":"space-between","align-items":"flex-end"}},_e={style:{display:"flex"}},fe=re(()=>_("span",null,"添加",-1)),me={style:{"font-weight":"bold"}},ve={key:0},ge={key:1,style:{color:"red"}},he=["onClick"],xe={key:1,class:"cus-forbidden",style:{color:"rgba(0, 0, 0, 0.25)"}},ye=["onClick"],we=["onClick"],be={key:0,style:{"margin-left":"26px"}},ke=M({__name:"Index",setup(U){const C=f(null),c=D({x:1600}),s=D({pageSize:20,current:1,size:"default",showSizeChanger:!0,showQuickJumper:!0,showTotal:function(o){return`共 ${o} 条数据`},onChange:function(o,n){console.log("111",o,n),this.current=o,this.pageSize=n,t()}}),i=f([]),v=f(!1),m=D({size:20,page:1,sort:"createtime",order:"desc",keyWord:""}),t=()=>{v.value=!0,m.size=s.pageSize,m.page=s.current,A({url:"/stationLocation/search",data:m},o=>{console.log(o),s.total=o.total,i.value=o.data,v.value=!1})},z=function(){s.current=1,t()},w=f(null),r=o=>{var n;console.log(o),(n=w.value)==null||n.add()},h=f(null),S=o=>{var n;console.log(o),(n=h.value)==null||n.show(o)},b=f(null),d=o=>{var n;console.log(o),(n=b.value)==null||n.show(o)},l=o=>{console.log(o);const n={id:o.id};A({url:"/stationLocation/delete",data:n},I=>{console.log(I),q.info(I.msg),t()})},O=o=>{var n;console.log(o),(n=w.value)==null||n.update(o)},x=o=>{console.log(o),t()};return B(()=>{var o;c.y=((o=C.value)==null?void 0:o.clientHeight)-113,t()}),(o,n)=>{const I=u("a-button"),T=u("a-tooltip"),p=u("a-input"),V=u("a-form-item"),N=u("a-form"),y=u("a-table-column"),W=u("a-popconfirm"),j=u("a-table");return k(),R(G,null,[_("div",ue,[e($(le),{title:"基站管理"}),_("div",pe,[_("div",_e,[e(I,{type:"primary",style:{"margin-right":"10px",background:"#0058FF"},onClick:r},{icon:a(()=>[e($(J))]),default:a(()=>[fe]),_:1}),e(N,{layout:"inline",model:m},{default:a(()=>[e(V,null,{default:a(()=>[e(p,{allowClear:"",value:m.keyWord,"onUpdate:value":n[0]||(n[0]=g=>m.keyWord=g),placeholder:"请输入要查询的内容",style:{width:"280px"}},{suffix:a(()=>[e(T,{title:"点击搜索",onClick:z},{default:a(()=>[e($(K),{style:{color:"rgba(0, 0, 0, 0.45)"}})]),_:1})]),_:1},8,["value"])]),_:1})]),_:1},8,["model"])]),_("div",null,[e(T,{onClick:t},{default:a(()=>[e($(oe),{style:{"font-size":"16px"},spin:v.value},null,8,["spin"])]),_:1})])]),_("div",{ref_key:"table_container",ref:C,style:{"margin-top":"9px","border-top":"1px solid #eee",display:"flex","flex-direction":"column",overflow:"hidden",height:"0px","flex-grow":"1"}},[e(j,{"data-source":i.value,pagination:s,scroll:c,bordered:!0,loading:v.value,size:"middle"},{default:a(()=>[e(y,{title:"序号",width:60,fixed:"left",align:"center"},{default:a(({index:g})=>[_("div",null,Q(g+1),1)]),_:1}),e(y,{title:"基站ID","data-index":"lac",width:100,fixed:"left",align:"center"}),e(y,{title:"小区ID","data-index":"ci",width:150,fixed:"left",align:"center"}),e(y,{title:"运营商",width:120,fixed:"left",align:"left"},{default:a(({record:g})=>[_("div",me,[g.mnc=="00"?(k(),R("span",ve,"中国移动")):(k(),R("span",ge,"未知"))])]),_:1}),e(y,{title:"坐标(经度)","data-index":"lng",width:200}),e(y,{title:"坐标(纬度)","data-index":"lat",width:200}),e(y,{title:"地址","data-index":"address","min-width":200,ellipsis:!0}),e(y,{title:"上次更新时间","data-index":"modifytime",width:200}),e(y,{title:"创建时间","data-index":"createtime",width:200}),e(y,{title:"操作",width:250,fixed:"right"},{default:a(({record:g})=>[_("div",null,[g.lat?(k(),R("a",{key:0,onClick:L=>S(g)},"位置",8,he)):(k(),R("a",xe,"位置")),_("a",{style:{"margin-left":"26px"},onClick:L=>d(g)},"查看",8,ye),_("a",{style:{"margin-left":"26px"},onClick:L=>O(g)},"编辑",8,we),e(W,{title:"确定删除?",okText:"确定",cancelText:"取消",onConfirm:L=>l(g)},{default:a(()=>[g.id!=1?(k(),R("a",be,"删除")):X("",!0)]),_:2},1032,["onConfirm"])])]),_:1})]),_:1},8,["data-source","pagination","scroll","loading"])],512)]),e(ae,{ref_key:"addRef",ref:w,onOnSuccess:x},null,512),e(se,{ref_key:"detailRef",ref:b},null,512),e(ce,{ref_key:"locationRef",ref:h},null,512)],64)}}});const Ie=te(ke,[["__scopeId","data-v-08b25017"]]);export{Ie as default};