| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170 |
- <!-- 灌溉地图展示 -->
- <template>
- <div class="map">
- <div id="container">加载数据,请稍候...</div>
- <!-- 设备列表 -->
- <div class="equipListBox">
- <div class="searchTop">
- <div>设备列表</div>
- <!-- <div>
- <el-input
- size="small"
- placeholder="请选择设备"
- suffix-icon="el-icon-search"
- v-model="searchVal"
- ></el-input>
- </div> -->
- </div>
- <div class="inner">
- <div class="scroll">
- <el-scrollbar>
- <div class="equipList">
- <div class="item"
- v-for="(item,index) in equipRelayList" :key="index" @click="lookEquip(item)">
- <div class="">
- <img :src="require('../../../../static/images/irrigate/navIcon/navIcon'+`${item.type}`+'.png')" alt="">
- <span>{{item.name}}</span>
- </div>
- <span @click.stop="setEquipInfo(item,index)">
- <i class="el-icon-setting"></i>
- </span>
- </div>
- <div class="item" v-if="!equipRelayList.length">
- 暂无数据
- </div>
- </div>
- </el-scrollbar>
- </div>
- </div>
- </div>
- <!-- 环形菜单 -->
- <div class="navMenu">
- <div class="mainMenu" @click="subMenuToggle">
- <div>
- <i class="el-icon-menu"></i>
- <div>菜单</div>
- </div>
- </div>
- <div class="subMenu" ref="subMenu">
- <div class="itemMenu itemMenu1" @click="subMenuState(1)">
- <div>预警</div>
- </div>
- <div class="itemMenu itemMenu2" @click="subMenuState(2)">
- <div>状态</div>
- </div>
- <div class="itemMenu itemMenu3" @click="subMenuState(3)">
- <div>要素</div>
- </div>
- </div>
- </div>
- <div class="popupInner">
- <!-- 设备预警 -->
- <div v-show="warnShow" class="equipWarnBox suspensionBox">
- <div class="top">
- <div>设备预警</div>
- <div @click="subMenuState(1)">
- <i class="el-icon-caret-right"></i>
- </div>
- </div>
- <div class="inner">
- <div class="wranTitle">
- <div
- v-for="(item,index) in wranTitle"
- v-bind:key="item"
- :class="[index==1?'wranmsg':'']"
- >{{item}}</div>
- </div>
- <div class="equipList">
- <div
- class="scroll-content"
- ref="scrollContent"
- :style="{ top }"
- @mouseenter="Stop()"
- @mouseleave="Up()"
- >
- <!-- <div class="" @mouseenter="Stop()" @mouseleave="Up()"> -->
- <div class="wranInfo" v-for="item in scrollWranList" v-bind:key="item.id">
- <div>{{item.equipName}}</div>
- <div class="wranmsg">{{item.msg}}{{item.msg}}</div>
- <div>{{item.time}}</div>
- <div class="state">{{item.state}}</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 设备状态 -->
- <div v-show="equipShow" class="equipCtrlBox suspensionBox">
- <div class="top">
- <div>设备状态</div>
- <div>
- <span class="historyBtn" @click="lookCtrlHistory()">历史数据</span>
- <i class="el-icon-caret-right" @click="subMenuState(2)"></i>
- </div>
- </div>
- <div class="inner">
- <el-scrollbar :style="{'height':ctrlScrollHeight+'px'}">
- <div class="equipList">
- <div class="equipState" v-for="item in equipRelayList" v-bind:key="item.id">
- <div>
- <span class="name">{{item.name}}</span>
- <el-switch v-model="item.val" @change="equipStateSwitch(item)" active-color="#0295ff" inactive-color="#b6b6b6"></el-switch>
- </div>
- </div>
- </div>
- </el-scrollbar>
- </div>
- </div>
- <!-- 气象要素 -->
- <div v-show="qxzElShow" class="qxzEquipBox suspensionBox">
- <div class="top">
- <div>
- <span>水肥要素</span>
- <span class="uptime">(2021-04-21 12:00:00)</span>
- </div>
- <div>
- <span class="historyBtn" @click="lookEleHistory()">历史数据</span>
- <i class="el-icon-caret-right" @click="subMenuState(3)"></i>
- </div>
- </div>
- <div class="inner">
- <el-scrollbar :style="{'height':qxzScrollHeight+'px'}">
- <div class="equipList">
- <div class="equipState" v-for="item in equipEleList" v-bind:key="item.id">
- <div>
- <img
- :src="`../../../../static/images/irrigate/qxdev/icon_${item.eleNum}.png`"
- alt
- />
- </div>
- <div>
- <div class="val">{{item.val}}{{item.unit}}</div>
- <div class="name">{{item.name}}</div>
- </div>
- </div>
- </div>
- </el-scrollbar>
- </div>
- </div>
- </div>
- <!-- 设备定位 -->
- <el-dialog
- title="设置"
- custom-class='setlnglatBox'
- :visible.sync="setlnglatVisible"
- width="660px"
- :fullscreen="dialogFull"
- v-dialogDrag
- >
- <setLocation @func="addrSave" v-if="setlnglatVisible" :lnglat="currRelay.lnglat"></setLocation>
- </el-dialog>
- <!-- 设备提示框 -->
- <dcfPopUP ref="dcfPopUP"></dcfPopUP>
- <sbPopUP ref="sbPopUP"></sbPopUP>
- <sqPopUP ref="sqPopUP"></sqPopUP>
- <sfjPopUP ref="sfjPopUP"></sfjPopUP>
- <wranPopUP ref="wranPopUP"></wranPopUP>
- </div>
- </template>
- <script>
- //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- //例如:import 《组件名称》 from '《组件路径》';
- const dcfPopUP = () => import("./popUp/dcfPopUp");
- const sbPopUP = () => import("./popUp/sbPopUp");
- const sqPopUP = () => import("./popUp/sqPopUP");
- const sfjPopUP = () => import("./popUp/sfjPopUP");
- // const setLocation = () => import("./popUp/setLocation");
- import setLocation from "./popUp/setLocation";
- // const wranPopUP = ()=> import('./wranPopUP')
- import wranPopUP from "./popUp/wranPopUP";
- // 要素配置表
- import eleList from "../../../../static/js/irrigate/eleList.json"
- export default {
- //import引入的组件需要注入到对象中才能使用
- components: {
- dcfPopUP,
- sbPopUP,
- sqPopUP,
- sfjPopUP,
- wranPopUP,
- setLocation
- },
- data() {
- //这里存放数据
- return {
- id:this.$store.state.irrigate_id,
- map: null,
- center: [116.3683244, 39.915085],
- zoom: 4.5,
- tileLayer1: null,
- tileLayer2: null,
- dialogFull:false,
- // 继电器配置表
- relayList: {
- "0": {
- id: 1,
- index: 0,
- name: "-"
- },
- "1": {
- id: 2,
- index: 1,
- name: "风机"
- },
- "2": {
- id: 3,
- index: 2,
- name: "水泵"
- },
- "3": {
- id: 4,
- index: 3,
- name: "增氧机"
- },
- "4": {
- id: 5,
- index: 4,
- name: "湿帘"
- },
- "5": {
- id: 6,
- index: 5,
- name: "遮阳"
- },
- "6": {
- id: 7,
- index: 6,
- name: "开窗"
- },
- "7": {
- id: 8,
- index: 7,
- name: "保温"
- },
- "8": {
- id: 9,
- index: 8,
- name: "投食机"
- }
- },
- relayName: [],
- relayNum: [],
- relayVal: [],
- relayName: [],
- relaydevice_addr:[],
- equipRelayList: [],
- ctrlScrollHeight:"",
- // 要素
- eleList:eleList,
- eleName: [],
- eleNum: [],
- eleVal: [],
- equipEleList: [],
- qxzScrollHeight: "",
- searchVal: "",
- equipData: [],
- marker: null,
- markerList: [],
- infoWindow: null,
- // subMenu状态 0是旋转0度 1是180度
- subMenu: 0,
- warnShow: true,
- equipShow: true,
- qxzElShow: true,
- // 设备预警滚动
- wranTitle: ["设备编号", "预警信息", "时间", "状态"],
- scrollWranList: [
- {
- equipName: "水泵123456",
- msg: "液体流速≥500mm/s",
- time: "2021-4-26",
- state: "未读"
- },
- {
- equipName: "水泵654321",
- msg: "液体流速≥400mm/s",
- time: "2021-4-25",
- state: "未读"
- },
- {
- equipName: "水泵456546",
- msg: "液体流速≥500mm/s",
- time: "2021-4-24",
- state: "未读"
- },
- {
- equipName: "水泵123456",
- msg: "液体流速≥500mm/s",
- time: "2021-4-23",
- state: "未读"
- },
- {
- equipName: "水泵123456",
- msg: "液体流速≥500mm/s",
- time: "2021-4-22",
- state: "未读"
- },
- {
- equipName: "水泵123456",
- msg: "液体流速≥500mm/s",
- time: "2021-4-21",
- state: "未读"
- },
- {
- equipName: "水泵123456",
- msg: "液体流速≥500mm/s",
- time: "2021-4-20",
- state: "未读"
- },
- {
- equipName: "水泵123456",
- msg: "液体流速≥500mm/s",
- time: "2021-4-19",
- state: "未读"
- },
- {
- equipName: "水泵123456",
- msg: "液体流速≥500mm/s",
- time: "2021-4-19",
- state: "未读"
- },
- {
- equipName: "水泵123456",
- msg: "液体流速≥500mm/s",
- time: "2021-4-19",
- state: "未读"
- },
- {
- equipName: "水泵123456",
- msg: "液体流速≥500mm/s",
- time: "2021-4-19",
- state: "未读"
- },
- {
- equipName: "水泵123456",
- msg: "液体流速≥500mm/s",
- time: "2021-4-19",
- state: "未读"
- },
- {
- equipName: "水泵123456",
- msg: "液体流速≥500mm/s",
- time: "2021-4-19",
- state: "未读"
- },
- {
- equipName: "水泵123456",
- msg: "液体流速≥500mm/s",
- time: "2021-4-19",
- state: "未读"
- }
- ],
- activeIndex: 0,
- intnum: undefined,
- // 编辑的继电器
- currRelay:{
- relayNum:'',
- index:'',
- lnglat:[],
- },
- setlnglatVisible:false,
- };
- },
- //监听属性 类似于data概念
- computed: {
- top() {
- return -this.activeIndex * 22 + "px";
- }
- },
- //监控data中的数据变化
- watch: {},
- //方法集合
- methods: {
- initMap() {
- //创建地图
- var that = this;
- this.map = new AMap.Map("container", {
- resizeEnable: true,
- center: that.center,
- zoom: that.zoom
- });
- AMap.plugin(
- [
- "AMap.ToolBar",
- "AMap.Scale",
- "AMap.MouseTool",
- "AMap.Geocoder",
- "AMap.PolyEditor"
- ],
- () => {
- // this.map.addControl(new AMap.ToolBar());
- this.map.addControl(new AMap.Scale({ position: "RB" }));
- this.geocoder = new AMap.Geocoder({
- city: "全国",
- radius: 1000
- });
- }
- );
- this.tileLayer1 = new AMap.TileLayer({
- tileUrl:
- "http://t{0,1,2,3,4,5,6,7}.tianditu.gov.cn/DataServer?T=img_w&tk=888bc7de1a5f14aa1b335b02e558d9b3&x=[x]&y=[y]&l=[z]",
- zIndex: 10
- }); //卫星图层
- this.tileLayer2 = new AMap.TileLayer({
- // 图块取图地址
- tileUrl:
- "http://t{0,1,2,3,4,5,6,7}.tianditu.gov.cn/DataServer?T=cta_w&tk=888bc7de1a5f14aa1b335b02e558d9b3&x=[x]&y=[y]&l=[z]",
- zIndex: 101
- });
- // this.map.add(this.tileLayer1);
- // this.map.add(this.tileLayer2);
- this.getEquipList();
- },
- getEquipList() {
- this.equipData = [
- {
- imei: 412155155,
- type: 1,
- name: "水泵设备1",
- lnglat: [116.3683244, 39.915085]
- },
- {
- imei: 412155155,
- type: 1,
- name: "水泵设备2",
- lnglat: [116.3667244, 39.915085]
- },
- {
- imei: 412155155,
- type: 2,
- name: "施肥机设备",
- lnglat: [116.3685244, 39.917085]
- },
- {
- imei: 412155155,
- type: 3,
- name: "电磁阀",
- lnglat: [116.3675244, 39.916085]
- },
- {
- imei: 412155155,
- type: 4,
- name: "墒情站",
- lnglat: [116.3695244, 39.916085]
- }
- ];
- this.$axios({
- method: "post",
- url: "/api/api_gateway?method=weather.weather.sf_status",
- data: this.qs.stringify({
- device_id: this.id
- })
- }).then(res => {
- var data = res.data.data;
- // 要素
- this.eleName = data.conf.eleName.split("/");
- this.eleNum = data.conf.eleNum.split("/");
- this.eleVal = eval("(" + data.dat.device_status + ")");
- this.renderEle();
- // 继电器
- this.relayName = data.conf.relayName.split("/");
- this.relayNum = data.conf.relayNum.split("/");
- this.relayVal = eval("(" + data.dat.device_status + ")");
- if(data.dat.device_addr){
- this.relaydevice_addr = data.dat.device_addr.split("/");
- this.renderRelay();
- }else{
- for(var i = 0;i<32;i++){
- var defaultlnglat = data.conf.lng+','+data.conf.lat
- this.relaydevice_addr.push(defaultlnglat);
- if(i==31){
- this.renderRelay();
- }
- }
-
- }
- });
- },
- // 渲染要素
- renderEle() {
- this.equipEleList = [];
- this.eleNum.forEach((item, index) => {
- if (item != 100) {
- var name = this.eleName[index] || this.eleList[item].name;
- var unit = this.eleList[item].unit || '单位'
- if(this.eleVal["e" + (index + 1)] == 32767){
- var val = 'N/A';
- }else{
- var val = this.eleVal["e" + (index + 1)];
- }
- this.equipEleList.push({
- eleNum: item,
- val: val,
- unit: unit,
- name: name
- });
- }
- });
- this.$nextTick(() => {
- if (this.equipEleList.length <= 3) {
- this.qxzScrollHeight = 68;
- } else if (this.equipEleList.length <= 6) {
- this.qxzScrollHeight = 136;
- } else{
- this.qxzScrollHeight = 204;
- }
- });
- },
- // 渲染继电器
- renderRelay() {
- this.equipRelayList = [];
- this.relayNum.forEach((item, index) => {
- if (item != 0) {
- var name = this.relayName[index] || this.relayList[item].name;
- var val = this.eleVal["j" + (index + 1)];
- var lnglat = this.relaydevice_addr[index]
-
- this.equipRelayList.push(
- {
- switchNum:index,
- val:val,
- name:name,
- lnglat:lnglat,
- type:item
- }
- )
- }
- });
- this.$nextTick(() => {
- if (this.equipRelayList.length <= 3) {
- this.ctrlScrollHeight = 33;
- } else if (this.equipRelayList.length <= 6) {
- this.ctrlScrollHeight = 66;
- } else if (this.equipRelayList.length <= 9) {
- this.ctrlScrollHeight = 99;
- } else{
- this.ctrlScrollHeight = 132;
- }
- });
- this.map.remove(this.markerList);
- this.markerList = [];
- this.equipRelayList.forEach(item => {
- if (item.type == 1) {
- var icon = "../../../../static/images/irrigate/relayIcon/relayIcon1.gif";
- // var icon = '../../../../static/images/1111.gif'
- } else if (item.type == 2) {
- var icon = "../../../../static/images/irrigate/relayIcon/relayIcon2.gif";
- // var icon = '../../../../static/images/icon5.svg'
- } else if (item.type == 3) {
- var icon = "../../../../static/images/irrigate/relayIcon/relayIcon3.gif";
- } else if (item.type == 4) {
- var icon = "../../../../static/images/irrigate/relayIcon/relayIcon4.gif";
- } else if (item.type == 5) {
- var icon = "../../../../static/images/irrigate/relayIcon/relayIcon5.gif";
- } else if (item.type == 6) {
- var icon = "../../../../static/images/irrigate/relayIcon/relayIcon6.gif";
- } else if (item.type == 7) {
- var icon = "../../../../static/images/irrigate/relayIcon/relayIcon7.gif";
- } else if (item.type == 8) {
- var icon = "../../../../static/images/irrigate/relayIcon/relayIcon8.gif";
- }
- var itemlnglat = item["lnglat"].split(',');
- this.marker = new AMap.Marker({
- position: new AMap.LngLat(itemlnglat[0], itemlnglat[1]), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
- icon: new AMap.Icon({
- image: icon,
- size: new AMap.Size(33, 40), //图标大小
- imageSize: new AMap.Size(33, 40)
- }),
- offset: new AMap.Pixel(-13, -30),
- title: item["name"]
- });
- // 设置点标记的动画效果,此处为弹跳效果
- // this.marker.setAnimation('AMAP_ANIMATION_BOUNCE');
- this.markerList.push(this.marker);
- //信息窗体
- this.marker.content = item["name"];
- // AMap.event.addListener(this.marker, "click", event => {
- // this.markerClick(event, item);
- // });
- // AMap.event.addListener(this.map, "click", event => {
- // if (this.infoWindow) {
- // this.infoWindow.close();
- // }
- // });
- });
- this.$nextTick(() => {
- this.map.add(this.markerList);
- this.map.setFitView();
- });
- this.infoWindow = new AMap.InfoWindow({
- isCustom: true, //使用自定义窗体
- offset: new AMap.Pixel(-105, -20)
- // anchor:'bottom-righ'
- });
- // 预警提示框
- // this.$refs.wranPopUP.initialize({
- // currEquip: {},
- // visible: true,
- // infoWindow: this.infoWindow
- // });
- // this.infoWindow.setContent(this.$refs.wranPopUP.$el);
- // this.infoWindow.open(this.map, this.equipData[0].lnglat);
- },
- markerClick(event, item) {
- this.infoWindow = new AMap.InfoWindow({
- isCustom: true, //使用自定义窗体
- offset: new AMap.Pixel(16, -45)
- });
- if (item.type == 1) {
- this.$refs.dcfPopUP.initialize({
- currEquip: {},
- visible: true,
- infoWindow: this.infoWindow
- });
- this.infoWindow.setContent(this.$refs.dcfPopUP.$el);
- } else if (item.type == 2) {
- this.$refs.sbPopUP.initialize({
- currEquip: {},
- visible: true,
- infoWindow: this.infoWindow
- });
- this.infoWindow.setContent(this.$refs.sbPopUP.$el);
- } else if (item.type == 3) {
- this.$refs.sqPopUP.initialize({
- currEquip: {},
- visible: true,
- infoWindow: this.infoWindow
- });
- this.infoWindow.setContent(this.$refs.sqPopUP.$el);
- } else if (item.type == 4) {
- this.$refs.sfjPopUP.initialize({
- currEquip: {},
- visible: true,
- infoWindow: this.infoWindow
- });
- this.infoWindow.setContent(this.$refs.sfjPopUP.$el);
- }
- this.infoWindow.open(this.map, event.target.getPosition());
- },
- // 环形菜单特效
- subMenuToggle() {
- if (this.subMenu == 0) {
- this.subMenu = 1;
- this.$refs.subMenu.style.transform = "rotate(0deg) scale(1)";
- } else {
- this.subMenu = 0;
- this.$refs.subMenu.style.transform = "rotate(124deg) scale(1.4)";
- }
- },
- // 子菜单点击
- subMenuState(flag) {
- if (flag == 1) {
- this.warnShow = !this.warnShow;
- } else if (flag == 2) {
- this.equipShow = !this.equipShow;
- } else if (flag == 3) {
- this.qxzElShow = !this.qxzElShow;
- }
- },
- lookEleHistory(){
- this.$store.commit('setData',{
- name:'ele_history_id',
- val:this.id
- })
- this.$router.push('eleHistory');
- },
- lookCtrlHistory(){
- this.$store.commit('setData',{
- name:'ele_operat_id',
- val:this.id
- })
- this.$router.push('operatData');
- },
- ScrollUp() {
- this.intnum = setInterval(_ => {
- this.$refs.scrollContent.style.transition = "top 0.5s";
- if (this.activeIndex < this.scrollWranList.length - 5) {
- this.activeIndex += 1;
- } else {
- this.$refs.scrollContent.style.transition = "none";
- this.activeIndex = 0;
- }
- }, 1000);
- },
- Stop() {
- clearInterval(this.intnum);
- },
- Up() {
- this.ScrollUp();
- },
- // 设备控制
- equipStateSwitch(item){
- var switchNum = item.switchNum;
- if(item.val){
- var relayState = 1
- }else{
- var relayState = 0
- }
- this.$axios({
- method: "post",
- url: "/api/api_gateway?method=weather.weather.sf_control",
- data: this.qs.stringify({
- device_id: this.id,
- relayNum:switchNum,
- relayState:relayState,
- })
- }).then(res => {
- this.$message({
- message: '下发成功',
- type: 'success'
- });
- })
- },
- lookEquip(item){
- var addr =this.relaydevice_addr[item.switchNum].split(',');
- this.map.setCenter(addr)
- this.map.setZoom(17)
- },
- setEquipInfo(item,index){
- this.currRelay.relayNum=item.switchNum;
- this.currRelay.index=index;
- this.currRelay.lnglat=this.relaydevice_addr[item.switchNum].split(',');
- this.setlnglatVisible = true
-
- },
- addrSave(data){
- var addr = [].concat(this.relaydevice_addr)
- addr[this.currRelay.relayNum]=data.lng+','+data.lat
- this.$axios({
- method: "post",
- url: "/api/api_gateway?method=weather.weather.sf_control_addr",
- data: this.qs.stringify({
- device_id: this.id,
- device_addr:addr.join('/')
- })
- }).then(res => {
- if(res.data.data==true){
- this.setlnglatVisible = false;
- this.relaydevice_addr[this.currRelay.relayNum]=data.lng+','+data.lat
- this.renderRelay()
- }
- })
- }
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {
- // this.ScrollUp();
- },
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- this.initMap();
- for (var i = 0; i < 4; i++) {
- this.scrollWranList.push(this.scrollWranList[i]);
- }
- this.$nextTick(() => {
- this.ScrollUp();
- });
- },
- beforeCreate() {}, //生命周期 - 创建之前
- beforeMount() {}, //生命周期 - 挂载之前
- beforeUpdate() {}, //生命周期 - 更新之前
- updated() {}, //生命周期 - 更新之后
- beforeDestroy() {}, //生命周期 - 销毁之前
- destroyed() {
- this.Stop();
- }, //生命周期 - 销毁完成
- activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
- };
- </script>
- <style scoped lang='less'>
- .map,
- #container {
- width: 100%;
- height: 100%;
- }
- .equipListBox {
- position: absolute;
- left: 110px;
- top: 160px;
- bottom: 3.125rem;
- width: 3.5rem;
- background: rgba(12, 20, 44, 0.8);
- border-radius: 8px;
- overflow: hidden;
- z-index: 200;
- .searchTop {
- display: flex;
- justify-content: space-between;
- color: #fff;
- align-items: center;
- padding: 10px;
- background: #0c142c;
- .el-input {
- width: 2.25rem;
- input {
- background: #ececec;
- color: #000;
- padding: 5px;
- height: 27px;
- }
- /deep/.el-input__inner {
- height: 28px;
- line-height: 28px;
- }
- }
- }
- .inner {
- position: absolute;
- top: 52px;
- bottom: -18px;
- left: 0;
- right: 0;
- .scroll {
- height: 100%;
- overflow: auto;
- .equipList {
- .item {
- padding: 0.175rem;
- color: #fff;
- font-size: 0.175rem;
- // background: red;
- cursor: pointer;
- display: flex;
- justify-content: space-between;
- >div{
- width: 72%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- >span:nth-child(2){
- font-size: 14px;
- }
- img {
- vertical-align: middle;
- margin-right: 2px;
- }
- &:hover {
- background: #0c142c;
- }
- }
- .item.active {
- background: #0c142c;
- }
- }
- }
- .scroll {
- height: 100%;
- overflow-y: hidden;
- }
- .el-scrollbar {
- height: 100%;
- }
- .el-scrollbar__bar {
- &.is-vertical {
- width: 100px; //滚动条宽度
- }
- }
- .el-scrollbar__wrap {
- overflow-y: auto;
- overflow-x: hidden;
- }
- .el-scrollbar__thumb {
- // 可设置滚动条颜色
- background: red;
- }
- }
- }
- // 悬浮框样式
- .suspensionBox {
- // position: absolute;
- width: 400px;
- background: rgba(12, 20, 44, 0.8);
- border-radius: 8px;
- overflow: hidden;
- z-index: 100;
- margin-top: 20px;
- .top {
- display: flex;
- justify-content: space-between;
- color: #fff;
- align-items: center;
- padding: 10px;
- background: #0c142c;
- i {
- cursor: pointer;
- font-size: 14px;
- }
- }
- }
- .popupInner {
- position: absolute;
- right: 0;
- top: 160px;
- z-index: 200;
- }
- // 设备预警
- .equipWarnBox {
- height: 190px;
- right: 10px;
- // top: 160px;
- .inner {
- // height: 82px;
- // overflow: hidden;
- .wranTitle {
- display: flex;
- justify-content: space-around;
- line-height: 33px;
- color: #fff;
- .wranmsg {
- width: 157px;
- }
- }
- .equipList {
- height: 110px;
- overflow: hidden;
- .scroll-wrap {
- height: 150px;
- overflow: hidden;
- }
- .scroll-content {
- position: relative;
- transition: top 0.5s;
- .wranInfo {
- line-height: 22px;
- color: #92c2f3;
- display: flex;
- justify-content: space-around;
- .wranmsg {
- width: 157px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .state {
- color: red;
- }
- }
- }
- .scroll-content p {
- line-height: 50px;
- text-align: center;
- }
- }
- }
- }
- .equipCtrlBox {
- // height: 180px;
- right: 10px;
- top: 357px;
- .top {
- .uptime {
- color: #eee;
- }
- .historyBtn {
- border: 1px solid #00c2ff;
- color: #00c2ff;
- border-radius: 14px;
- padding: 2px 4px;
- cursor: pointer;
- }
- }
- .inner {
- // height: 132px;
- overflow: hidden;
- padding-bottom: 10px;
- .el-scrollbar {
- // height: 149px;
- /deep/.el-scrollbar__wrap {
- overflow-y: auto;
- overflow-x: hidden;
- }
- }
- }
- .equipList {
- display: flex;
- flex-wrap: wrap;
- .equipState {
- color: #fff;
- width: 50%;
- margin-top: 13px;
- text-align: center;
- .name {
- display: inline-block;
- white-space: nowrap;
- width: 87px;
- overflow: hidden;
- text-overflow: ellipsis;
- vertical-align: middle;
- // text-align: right;
- }
- /deep/.el-switch__core {
- width: 30px !important;
- height: 15px;
- /*color:#409EFF;*/
- }
- /*设置圆*/
- /deep/.el-switch__core::after {
- width: 14px;
- height: 14px;
- margin-top: -1px;
- margin-bottom: 2px;
- }
- }
- }
- }
- .qxzEquipBox {
- // height: 215px;
- right: 10px;
- top: 542px;
- color: #fff;
- .top {
- .uptime {
- color: #eee;
- }
- .historyBtn {
- border: 1px solid #00c2ff;
- color: #00c2ff;
- border-radius: 14px;
- padding: 2px 4px;
- cursor: pointer;
- }
- }
- .inner {
- .el-scrollbar {
- // height: 198px;
- /deep/.el-scrollbar__wrap {
- overflow-x: hidden;
- }
- }
- .equipList {
- display: flex;
- flex-wrap: wrap;
- padding-bottom: 10px;
- .equipState {
- width: 33.333%;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-top: 10px;
- > div:first-child {
- margin-right: 5px;
- }
- .val {
- font-size: 14px;
- background-image: -webkit-linear-gradient(bottom, #069dff, #09fdff);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- font-weight: 700;
- }
- .name {
- color: #92c2f3;
- width: 70px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- }
- }
- }
- // 环形菜单
- .navMenu {
- position: fixed;
- left: 110px;
- bottom: 23px;
- width: 135px;
- height: 135px;
- z-index: 100;
- > div {
- position: absolute;
- cursor: pointer;
- }
- .mainMenu {
- left: 0;
- bottom: 0;
- z-index: 5;
- // transform: scale(.8);
- transition: all 0.3s;
- > div {
- width: 70px;
- height: 70px;
- background: #0c142c;
- border-radius: 50%;
- color: #fff;
- line-height: 18px;
- font-size: 12px;
- text-align: center;
- > i {
- font-size: 30px;
- margin-top: 12px;
- }
- }
- }
- .subMenu {
- transform: rotate(124deg) scale(1.4);
- transform-origin: 30px 100px;
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- transition: all 0.5s;
- .itemMenu {
- transform: scale(1);
- transition: all 0.3s;
- position: absolute;
- cursor: pointer;
- &:hover {
- transform: scale(1.1);
- }
- > div {
- width: 40px;
- height: 40px;
- background: #0c142c;
- border-radius: 50%;
- color: #fff;
- font-size: 12px;
- line-height: 40px;
- text-align: center;
- }
- }
- .itemMenu1 {
- right: 65px;
- bottom: 96px;
- }
- .itemMenu2 {
- right: 16px;
- bottom: 64px;
- }
- .itemMenu3 {
- right: -1px;
- bottom: 5px;
- }
- }
- }
- // 设备定位弹框
- /deep/.setlnglatBox{
- box-shadow: 0px 0px 4px 0px #0161ff;
- background: rgba(12, 20, 44, 0.8);
- border-radius: 8px;
- }
- /deep/.setlnglatBox .el-dialog__header{
- background: #0c142c;
- padding: 10px 20px;
- border-bottom: 1px solid #0c142c;
- }
- /deep/.setlnglatBox .el-dialog__header .el-dialog__title{
- color: #fff;
- font-size: 14px;
- }
- /deep/.setlnglatBox .el-dialog__headerbtn .el-dialog__close{
- color: #fff;
- }
- </style>
|