|
|
@@ -19,22 +19,48 @@
|
|
|
<div class="scroll">
|
|
|
<el-scrollbar>
|
|
|
<div class="equipList">
|
|
|
- <div class="item"
|
|
|
- v-for="(item,index) in equipData" :key="index" @click="lookEquip(item)">
|
|
|
- <div class="">
|
|
|
- <img :src="require('../../../../static/images/disasterWarn/navicon.png')" alt="">
|
|
|
- <span :ref="`equipName${index}`" v-if="item.key==0">{{item.name}}</span>
|
|
|
- <el-input class="changeNameVal" v-else v-model="editNameval" placeholder="请输入内容"></el-input>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <i @click.stop="editName('edit',item,index)" v-show="item.key==0" class="el-icon-edit"></i>
|
|
|
- <i @click.stop="editName('cancel',item,index)" v-show="item.key==1" class="el-icon-close"></i>
|
|
|
- <i @click.stop="editName('save',item,index)" v-show="item.key==1" class="el-icon-check"></i>
|
|
|
- </div>
|
|
|
+ <div
|
|
|
+ class="item"
|
|
|
+ v-for="(item, index) in equipData"
|
|
|
+ :key="index"
|
|
|
+ @click="lookEquip(item)"
|
|
|
+ >
|
|
|
+ <div class="">
|
|
|
+ <img
|
|
|
+ :src="
|
|
|
+ require('../../../../static/images/disasterWarn/navicon.png')
|
|
|
+ "
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <span :ref="`equipName${index}`" v-if="item.key == 0">{{
|
|
|
+ item.name
|
|
|
+ }}</span>
|
|
|
+ <el-input
|
|
|
+ class="changeNameVal"
|
|
|
+ v-else
|
|
|
+ v-model="editNameval"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
- <div class="item" v-if="!equipData.length">
|
|
|
- 暂无数据
|
|
|
+ <div>
|
|
|
+ <i
|
|
|
+ @click.stop="editName('edit', item, index)"
|
|
|
+ v-show="item.key == 0"
|
|
|
+ class="el-icon-edit"
|
|
|
+ ></i>
|
|
|
+ <i
|
|
|
+ @click.stop="editName('cancel', item, index)"
|
|
|
+ v-show="item.key == 1"
|
|
|
+ class="el-icon-close"
|
|
|
+ ></i>
|
|
|
+ <i
|
|
|
+ @click.stop="editName('save', item, index)"
|
|
|
+ v-show="item.key == 1"
|
|
|
+ class="el-icon-check"
|
|
|
+ ></i>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+ <div class="item" v-if="!equipData.length">暂无数据</div>
|
|
|
</div>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
@@ -42,7 +68,13 @@
|
|
|
</div>
|
|
|
<!-- 设备提示框 -->
|
|
|
<windowPopUp ref="windowPopUp"></windowPopUp>
|
|
|
- <sidebarWarn :qxzName="equips.qxzName" :jkName="equips.jkName" :projectName="equips.projectName" @setQxzEleName='setQxzEleName' ref="sidebarWarnRef"></sidebarWarn>
|
|
|
+ <sidebarWarn
|
|
|
+ :qxzName="equips.qxzName"
|
|
|
+ :jkName="equips.jkName"
|
|
|
+ :projectName="equips.projectName"
|
|
|
+ @setQxzEleName="setQxzEleName"
|
|
|
+ ref="sidebarWarnRef"
|
|
|
+ ></sidebarWarn>
|
|
|
<div class="popupInner">
|
|
|
<!-- 设备预警 -->
|
|
|
<div v-show="equipWarnBox" class="equipWarnBox suspensionBox">
|
|
|
@@ -55,10 +87,12 @@
|
|
|
<div class="inner">
|
|
|
<div class="wranTitle">
|
|
|
<div
|
|
|
- v-for="(item,index) in wranTitle"
|
|
|
+ v-for="(item, index) in wranTitle"
|
|
|
v-bind:key="item"
|
|
|
- :class="[index==1?'wranmsg':'']"
|
|
|
- >{{item}}</div>
|
|
|
+ :class="[index == 1 ? 'wranmsg' : '']"
|
|
|
+ >
|
|
|
+ {{ item }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="equipList">
|
|
|
<div
|
|
|
@@ -68,10 +102,14 @@
|
|
|
@mouseenter="Stop()"
|
|
|
@mouseleave="Up()"
|
|
|
>
|
|
|
- <div class="wranInfo" v-for="item in scrollWranList" v-bind:key="item.id">
|
|
|
- <div>{{item.device_id}}</div>
|
|
|
- <div class="wranmsg">{{item.warning_info}}</div>
|
|
|
- <div>{{item.warning_time*1000 | formatTime}}</div>
|
|
|
+ <div
|
|
|
+ class="wranInfo"
|
|
|
+ v-for="item in scrollWranList"
|
|
|
+ v-bind:key="item.id"
|
|
|
+ >
|
|
|
+ <div>{{ item.device_id }}</div>
|
|
|
+ <div class="wranmsg">{{ item.warning_info }}</div>
|
|
|
+ <div>{{ (item.warning_time * 1000) | formatTime }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -90,27 +128,41 @@
|
|
|
@close="closeQxzDialogVisible"
|
|
|
>
|
|
|
<template slot="title">
|
|
|
- <div class="avue-crud__dialog__header">
|
|
|
- <span class="el-dialog__title">
|
|
|
- <span style="display:inline-block;background-color: #3478f5;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
|
|
|
- 要素名称修改
|
|
|
+ <div class="avue-crud__dialog__header">
|
|
|
+ <span class="el-dialog__title">
|
|
|
+ <span
|
|
|
+ style="
|
|
|
+ display: inline-block;
|
|
|
+ background-color: #3478f5;
|
|
|
+ width: 3px;
|
|
|
+ height: 20px;
|
|
|
+ margin-right: 5px;
|
|
|
+ float: left;
|
|
|
+ margin-top: 2px;
|
|
|
+ "
|
|
|
+ ></span>
|
|
|
+ 要素名称修改
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="equipEleData">
|
|
|
+ <el-scrollbar>
|
|
|
+ <div class="equipEleList">
|
|
|
+ <div v-for="(item, index) in changeQxzEleName" :key="index">
|
|
|
+ <span>{{ item.e }}</span>
|
|
|
+ <span>{{ item.defaultName }}</span>
|
|
|
+ <span class="inp">
|
|
|
+ <el-input
|
|
|
+ v-model="item.editname"
|
|
|
+ @blur="changeQxzName(item, index)"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ ></el-input>
|
|
|
</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <div class="equipEleData">
|
|
|
- <el-scrollbar >
|
|
|
- <div class="equipEleList">
|
|
|
- <div v-for="(item,index) in changeQxzEleName" :key="index">
|
|
|
- <span>{{item.e}}</span>
|
|
|
- <span>{{item.defaultName}}</span>
|
|
|
- <span class="inp">
|
|
|
- <el-input v-model="item.editname" @blur="changeQxzName(item,index)" placeholder="请输入内容"></el-input>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
</div>
|
|
|
- </el-scrollbar>
|
|
|
- </div>
|
|
|
- <!-- <div class="equipEleSaveBtn">
|
|
|
+ </div>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <!-- <div class="equipEleSaveBtn">
|
|
|
<el-button type="grayInfo" size="small" >重置</el-button>
|
|
|
<el-button type="blueInfo" size="small" >保存</el-button>
|
|
|
</div> -->
|
|
|
@@ -121,58 +173,58 @@
|
|
|
<script>
|
|
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
|
|
//例如:import 《组件名称》 from '《组件路径》';
|
|
|
-import windowPopUp from "./windowPopUp"
|
|
|
-import sidebarWarn from "./sidebarWarn"
|
|
|
+import windowPopUp from "./windowPopUp";
|
|
|
+import sidebarWarn from "./sidebarWarn";
|
|
|
|
|
|
// 要素配置表
|
|
|
-import eleList from "../../../../static/js/irrigate/eleList.json"
|
|
|
+import eleList from "../../../../static/js/irrigate/eleList.json";
|
|
|
export default {
|
|
|
//import引入的组件需要注入到对象中才能使用
|
|
|
components: {
|
|
|
windowPopUp,
|
|
|
- sidebarWarn
|
|
|
+ sidebarWarn,
|
|
|
},
|
|
|
data() {
|
|
|
//这里存放数据
|
|
|
return {
|
|
|
- user_id:'',
|
|
|
- equips:{
|
|
|
- qxzId:'',
|
|
|
- qxzDid:'',
|
|
|
- qxzName:'',
|
|
|
- jkId:'',
|
|
|
- jkDid:'',
|
|
|
- jkName:'',
|
|
|
- projectName:'',
|
|
|
+ user_id: "",
|
|
|
+ equips: {
|
|
|
+ qxzId: "",
|
|
|
+ qxzDid: "",
|
|
|
+ qxzName: "",
|
|
|
+ jkId: "",
|
|
|
+ jkDid: "",
|
|
|
+ jkName: "",
|
|
|
+ projectName: "",
|
|
|
},
|
|
|
map: null,
|
|
|
center: [116.3683244, 39.915085],
|
|
|
zoom: 4.5,
|
|
|
tileLayer1: null,
|
|
|
tileLayer2: null,
|
|
|
- equipWarnBox:true,//预警信息弹框
|
|
|
+ equipWarnBox: true, //预警信息弹框
|
|
|
// 设备列表
|
|
|
equipData: [],
|
|
|
equipAllList: [],
|
|
|
- editNameval:'',
|
|
|
+ editNameval: "",
|
|
|
// 设备预警滚动
|
|
|
wranTitle: ["设备ID", "预警信息", "时间"],
|
|
|
scrollWranList: [],
|
|
|
activeIndex: 0,
|
|
|
-
|
|
|
+
|
|
|
searchVal: "",
|
|
|
marker: null,
|
|
|
markerList: [],
|
|
|
infoWindow: null,
|
|
|
- qxzDialogVisible:false,
|
|
|
- changeQxzEleName:[],
|
|
|
+ qxzDialogVisible: false,
|
|
|
+ changeQxzEleName: [],
|
|
|
};
|
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
|
computed: {
|
|
|
top() {
|
|
|
return -this.activeIndex * 22 + "px";
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
//监控data中的数据变化
|
|
|
watch: {},
|
|
|
@@ -184,7 +236,12 @@ export default {
|
|
|
this.map = new AMap.Map("container", {
|
|
|
resizeEnable: true,
|
|
|
center: that.center,
|
|
|
- zoom: that.zoom
|
|
|
+ zoom: that.zoom,
|
|
|
+ layers: [
|
|
|
+ new AMap.TileLayer.Satellite({
|
|
|
+ zIndex: 9,
|
|
|
+ }),
|
|
|
+ ], //加载卫星图
|
|
|
});
|
|
|
AMap.plugin(
|
|
|
[
|
|
|
@@ -192,7 +249,7 @@ export default {
|
|
|
"AMap.Scale",
|
|
|
"AMap.MouseTool",
|
|
|
"AMap.Geocoder",
|
|
|
- "AMap.PolyEditor"
|
|
|
+ "AMap.PolyEditor",
|
|
|
],
|
|
|
() => {
|
|
|
// this.map.addControl(new AMap.ToolBar());
|
|
|
@@ -200,20 +257,22 @@ export default {
|
|
|
|
|
|
this.geocoder = new AMap.Geocoder({
|
|
|
city: "全国",
|
|
|
- radius: 1000
|
|
|
+ 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
|
|
|
+ "http://t{0,1,2,3,4,5,6,7}.tianditu.gov.cn/DataServer?T=img_w&tk=6e5cb1bfc017afcac7a21836cf81a884&x=[x]&y=[y]&l=[z]",
|
|
|
+ zIndex: 10,
|
|
|
+ detectRetina: true,
|
|
|
}); //卫星图层
|
|
|
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
|
|
|
+ "http://t{0,1,2,3,4,5,6,7}.tianditu.gov.cn/DataServer?T=cta_w&tk=6e5cb1bfc017afcac7a21836cf81a884&x=[x]&y=[y]&l=[z]",
|
|
|
+ zIndex: 10,
|
|
|
+ detectRetina: true,
|
|
|
});
|
|
|
this.map.add(this.tileLayer1);
|
|
|
this.map.add(this.tileLayer2);
|
|
|
@@ -235,73 +294,73 @@ export default {
|
|
|
method: "post",
|
|
|
url: "/api/api_gateway?method=weather.weather.warning_page",
|
|
|
data: this.qs.stringify({
|
|
|
- user_id:this.user_id
|
|
|
- })
|
|
|
- }).then(res => {
|
|
|
+ user_id: this.user_id,
|
|
|
+ }),
|
|
|
+ }).then((res) => {
|
|
|
var dat = res.data.data.ids;
|
|
|
this.equipAllList = [];
|
|
|
- for(var i = 0;i<dat.length;i++){
|
|
|
- if(i == 0){
|
|
|
+ for (var i = 0; i < dat.length; i++) {
|
|
|
+ if (i == 0) {
|
|
|
this.equipAllList.push({
|
|
|
- name:dat[i].name,
|
|
|
- lnglat:dat[i].lnglat,
|
|
|
- equips:[dat[i]]
|
|
|
- })
|
|
|
- }else{
|
|
|
- for(var z = 0;z<this.equipAllList.length;z++){
|
|
|
- if(dat[i].name == this.equipAllList[z].name){
|
|
|
- this.equipAllList[z].equips.push(dat[i])
|
|
|
+ name: dat[i].name,
|
|
|
+ lnglat: dat[i].lnglat,
|
|
|
+ equips: [dat[i]],
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ for (var z = 0; z < this.equipAllList.length; z++) {
|
|
|
+ if (dat[i].name == this.equipAllList[z].name) {
|
|
|
+ this.equipAllList[z].equips.push(dat[i]);
|
|
|
break;
|
|
|
}
|
|
|
- if(z == this.equipAllList.length-1){
|
|
|
+ if (z == this.equipAllList.length - 1) {
|
|
|
this.equipAllList.push({
|
|
|
- name:dat[i].name,
|
|
|
- lnglat:dat[i].lnglat,
|
|
|
- equips:[dat[i]]
|
|
|
- })
|
|
|
+ name: dat[i].name,
|
|
|
+ lnglat: dat[i].lnglat,
|
|
|
+ equips: [dat[i]],
|
|
|
+ });
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(i == dat.length-1){
|
|
|
+ if (i == dat.length - 1) {
|
|
|
console.log(this.equipAllList);
|
|
|
- this.equipData = this.equipAllList.filter((item)=>{
|
|
|
- item.key=0;//用于修改设备名input是否展示
|
|
|
- return item.equips.length==2
|
|
|
- })
|
|
|
+ this.equipData = this.equipAllList.filter((item) => {
|
|
|
+ item.key = 0; //用于修改设备名input是否展示
|
|
|
+ return item.equips.length == 2;
|
|
|
+ });
|
|
|
console.log(this.equipData);
|
|
|
this.renderEle();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
});
|
|
|
},
|
|
|
// 渲染点标注
|
|
|
renderEle() {
|
|
|
this.map.remove(this.markerList);
|
|
|
this.markerList = [];
|
|
|
- this.equipData.forEach(item => {
|
|
|
- var icon = "../../../../static/images/disasterWarn/disasterWarnIcon.svg";
|
|
|
+ this.equipData.forEach((item) => {
|
|
|
+ var icon =
|
|
|
+ "../../../../static/images/disasterWarn/disasterWarnIcon.svg";
|
|
|
var itemlnglat = item["lnglat"];
|
|
|
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(50, 50), //图标大小
|
|
|
- imageSize: new AMap.Size(50, 50)
|
|
|
+ icon: new AMap.Icon({
|
|
|
+ image: icon,
|
|
|
+ size: new AMap.Size(50, 50), //图标大小
|
|
|
+ imageSize: new AMap.Size(50, 50),
|
|
|
}),
|
|
|
offset: new AMap.Pixel(-13, -30),
|
|
|
- title: item["name"]
|
|
|
+ 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 => {
|
|
|
+ AMap.event.addListener(this.marker, "click", (event) => {
|
|
|
this.markerClick(event, item);
|
|
|
});
|
|
|
- AMap.event.addListener(this.map, "click", event => {
|
|
|
+ AMap.event.addListener(this.map, "click", (event) => {
|
|
|
if (this.infoWindow) {
|
|
|
this.infoWindow.close();
|
|
|
}
|
|
|
@@ -313,76 +372,76 @@ export default {
|
|
|
});
|
|
|
this.infoWindow = new AMap.InfoWindow({
|
|
|
isCustom: true, //使用自定义窗体
|
|
|
- offset: new AMap.Pixel(-105, -20)
|
|
|
+ offset: new AMap.Pixel(-105, -20),
|
|
|
// anchor:'bottom-righ'
|
|
|
});
|
|
|
},
|
|
|
markerClick(event, item) {
|
|
|
- if(item.equips[0].device_type_id == 11){
|
|
|
- this.equips.qxzId = item.equips[0].device_id
|
|
|
- this.equips.qxzName = item.equips[0].device_name
|
|
|
- this.equips.qxzDid = item.equips[0].d_id
|
|
|
- }else{
|
|
|
- this.equips.qxzId = item.equips[1].device_id
|
|
|
- this.equips.qxzName = item.equips[1].device_name
|
|
|
- this.equips.qxzDid = item.equips[1].d_id
|
|
|
+ if (item.equips[0].device_type_id == 11) {
|
|
|
+ this.equips.qxzId = item.equips[0].device_id;
|
|
|
+ this.equips.qxzName = item.equips[0].device_name;
|
|
|
+ this.equips.qxzDid = item.equips[0].d_id;
|
|
|
+ } else {
|
|
|
+ this.equips.qxzId = item.equips[1].device_id;
|
|
|
+ this.equips.qxzName = item.equips[1].device_name;
|
|
|
+ this.equips.qxzDid = item.equips[1].d_id;
|
|
|
}
|
|
|
- if(item.equips[0].device_type_id == 12){
|
|
|
- this.equips.jkId = item.equips[0].device_id
|
|
|
- this.equips.jkName = item.equips[0].device_name
|
|
|
- this.equips.jkDid = item.equips[0].d_id
|
|
|
- }else{
|
|
|
- this.equips.jkId = item.equips[1].device_id
|
|
|
- this.equips.jkName = item.equips[1].device_name
|
|
|
- this.equips.jkDid = item.equips[1].d_id
|
|
|
+ if (item.equips[0].device_type_id == 12) {
|
|
|
+ this.equips.jkId = item.equips[0].device_id;
|
|
|
+ this.equips.jkName = item.equips[0].device_name;
|
|
|
+ this.equips.jkDid = item.equips[0].d_id;
|
|
|
+ } else {
|
|
|
+ this.equips.jkId = item.equips[1].device_id;
|
|
|
+ this.equips.jkName = item.equips[1].device_name;
|
|
|
+ this.equips.jkDid = item.equips[1].d_id;
|
|
|
}
|
|
|
- this.equips.projectName=item.name
|
|
|
- this.$store.commit('setData',{
|
|
|
- name:'jk_wran_id',
|
|
|
- val:this.equips.jkId
|
|
|
- })
|
|
|
- this.$store.commit('setData',{
|
|
|
- name:'jk_wran_did',
|
|
|
- val:this.equips.jkDid
|
|
|
- })
|
|
|
- this.$store.commit('setData',{
|
|
|
- name:'jk_wran_name',
|
|
|
- val:this.equips.projectName
|
|
|
- })
|
|
|
- this.$store.commit('setData',{
|
|
|
- name:'qxz_wran_id',
|
|
|
- val:this.equips.qxzId
|
|
|
- })
|
|
|
- this.$store.commit('setData',{
|
|
|
- name:'qxz_wran_did',
|
|
|
- val:this.equips.qxzDid
|
|
|
- })
|
|
|
+ this.equips.projectName = item.name;
|
|
|
+ this.$store.commit("setData", {
|
|
|
+ name: "jk_wran_id",
|
|
|
+ val: this.equips.jkId,
|
|
|
+ });
|
|
|
+ this.$store.commit("setData", {
|
|
|
+ name: "jk_wran_did",
|
|
|
+ val: this.equips.jkDid,
|
|
|
+ });
|
|
|
+ this.$store.commit("setData", {
|
|
|
+ name: "jk_wran_name",
|
|
|
+ val: this.equips.projectName,
|
|
|
+ });
|
|
|
+ this.$store.commit("setData", {
|
|
|
+ name: "qxz_wran_id",
|
|
|
+ val: this.equips.qxzId,
|
|
|
+ });
|
|
|
+ this.$store.commit("setData", {
|
|
|
+ name: "qxz_wran_did",
|
|
|
+ val: this.equips.qxzDid,
|
|
|
+ });
|
|
|
this.equipWarnBox = false;
|
|
|
this.$refs.sidebarWarnRef.toggleMenuShow();
|
|
|
this.$refs.sidebarWarnRef.getQxzEle();
|
|
|
this.$refs.sidebarWarnRef.getMonitor();
|
|
|
this.infoWindow = new AMap.InfoWindow({
|
|
|
isCustom: true, //使用自定义窗体
|
|
|
- offset: new AMap.Pixel(16, -45)
|
|
|
+ offset: new AMap.Pixel(16, -45),
|
|
|
});
|
|
|
this.$refs.windowPopUp.initialize({
|
|
|
- currEquip: {device_type_id:1234},
|
|
|
+ currEquip: { device_type_id: 1234 },
|
|
|
visible: true,
|
|
|
- infoWindow: this.infoWindow
|
|
|
+ infoWindow: this.infoWindow,
|
|
|
});
|
|
|
this.infoWindow.setContent(this.$refs.windowPopUp.$el);
|
|
|
- if(event){
|
|
|
+ if (event) {
|
|
|
this.infoWindow.open(this.map, event.target.getPosition());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.infoWindow.open(this.map, item.lnglat);
|
|
|
}
|
|
|
},
|
|
|
- lookEquip(item){
|
|
|
- this.map.setCenter(item.lnglat)
|
|
|
- this.map.setZoom(17)
|
|
|
- this.markerClick('', item);
|
|
|
+ lookEquip(item) {
|
|
|
+ this.map.setCenter(item.lnglat);
|
|
|
+ this.map.setZoom(10);
|
|
|
+ this.markerClick("", item);
|
|
|
},
|
|
|
- getWranInfo(){
|
|
|
+ getWranInfo() {
|
|
|
this.$axios({
|
|
|
method: "post",
|
|
|
url: "/api/api_gateway?method=weather.weather.warning_info", //forecast.forecast_system.equip_photo
|
|
|
@@ -390,17 +449,17 @@ export default {
|
|
|
page_size: 10,
|
|
|
}),
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
- if(res.data.message == ""){
|
|
|
- this.scrollWranList = res.data.data.data
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.log(err);
|
|
|
- });
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data.message == "") {
|
|
|
+ this.scrollWranList = res.data.data.data;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
},
|
|
|
ScrollUp() {
|
|
|
- this.intnum = setInterval(_ => {
|
|
|
+ this.intnum = setInterval((_) => {
|
|
|
this.$refs.scrollContent.style.transition = "top 0.5s";
|
|
|
if (this.activeIndex < this.scrollWranList.length - 5) {
|
|
|
this.activeIndex += 1;
|
|
|
@@ -416,91 +475,91 @@ export default {
|
|
|
Up() {
|
|
|
this.ScrollUp();
|
|
|
},
|
|
|
- equipWarnBoxShow(){
|
|
|
- this.equipWarnBox=true;
|
|
|
+ equipWarnBoxShow() {
|
|
|
+ this.equipWarnBox = true;
|
|
|
},
|
|
|
- editName(ctrl,item,index2){
|
|
|
- if(ctrl == 'edit'){
|
|
|
- this.equipData.forEach((item,index)=>{
|
|
|
- this.$set(this.equipData[index],'key',0);
|
|
|
- })
|
|
|
- this.$set(this.equipData[index2],'key',1);
|
|
|
+ editName(ctrl, item, index2) {
|
|
|
+ if (ctrl == "edit") {
|
|
|
+ this.equipData.forEach((item, index) => {
|
|
|
+ this.$set(this.equipData[index], "key", 0);
|
|
|
+ });
|
|
|
+ this.$set(this.equipData[index2], "key", 1);
|
|
|
this.editNameval = this.equipData[index2].name;
|
|
|
}
|
|
|
- if(ctrl == 'cancel'){
|
|
|
-
|
|
|
- this.equipData.forEach((item)=>{
|
|
|
- item.key = 0
|
|
|
- })
|
|
|
+ if (ctrl == "cancel") {
|
|
|
+ this.equipData.forEach((item) => {
|
|
|
+ item.key = 0;
|
|
|
+ });
|
|
|
}
|
|
|
- if(ctrl == 'save'){
|
|
|
- var id = item.equips[0].device_id+','+item.equips[1].device_id
|
|
|
+ if (ctrl == "save") {
|
|
|
+ var id = item.equips[0].device_id + "," + item.equips[1].device_id;
|
|
|
this.$axios({
|
|
|
method: "post",
|
|
|
url: "/api/api_gateway?method=weather.weather.warning_change",
|
|
|
data: this.qs.stringify({
|
|
|
device_id: id,
|
|
|
name: this.editNameval,
|
|
|
- })
|
|
|
- }).then(res => {
|
|
|
+ }),
|
|
|
+ }).then((res) => {
|
|
|
if (res.data.message == "") {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "修改成功",
|
|
|
- });
|
|
|
- this.equipData.forEach((item,index)=>{
|
|
|
- this.$set(this.equipData[index],'key',0);
|
|
|
- })
|
|
|
- this.equipData[index2].name = this.editNameval
|
|
|
- this.$forceUpdate();
|
|
|
- }else{
|
|
|
- this.$message({
|
|
|
- type: "error",
|
|
|
- message: res.data.message,
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "修改成功",
|
|
|
+ });
|
|
|
+ this.equipData.forEach((item, index) => {
|
|
|
+ this.$set(this.equipData[index], "key", 0);
|
|
|
+ });
|
|
|
+ this.equipData[index2].name = this.editNameval;
|
|
|
+ this.$forceUpdate();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: "error",
|
|
|
+ message: res.data.message,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
this.$forceUpdate();
|
|
|
-
|
|
|
},
|
|
|
- setQxzEleName(data){
|
|
|
- this.qxzDialogVisible = true
|
|
|
- this.changeQxzEleName = data;
|
|
|
+ setQxzEleName(data) {
|
|
|
+ this.qxzDialogVisible = true;
|
|
|
+ this.changeQxzEleName = data;
|
|
|
},
|
|
|
- changeQxzName(item,index){
|
|
|
- this.$confirm('是否更改要素名称?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.$axios({
|
|
|
- method: "post",
|
|
|
- url: "/api/api_gateway?method=weather.weather.qxz_config_change",
|
|
|
- data: this.qs.stringify({
|
|
|
- device_id:this.$store.state.qxz_wran_id,
|
|
|
- ekey:item.e,
|
|
|
- conf:item.editname+'#'+item.unit
|
|
|
- })
|
|
|
- }).then(res => {
|
|
|
- if(res.data.message == ""){
|
|
|
- this.$message({
|
|
|
- message: '修改成功',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- }
|
|
|
+ changeQxzName(item, index) {
|
|
|
+ this.$confirm("是否更改要素名称?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
})
|
|
|
- }).catch(() => {
|
|
|
- this.changeQxzEleName[index].editname = this.changeQxzEleName[index].name
|
|
|
- });
|
|
|
+ .then(() => {
|
|
|
+ this.$axios({
|
|
|
+ method: "post",
|
|
|
+ url: "/api/api_gateway?method=weather.weather.qxz_config_change",
|
|
|
+ data: this.qs.stringify({
|
|
|
+ device_id: this.$store.state.qxz_wran_id,
|
|
|
+ ekey: item.e,
|
|
|
+ conf: item.editname + "#" + item.unit,
|
|
|
+ }),
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.message == "") {
|
|
|
+ this.$message({
|
|
|
+ message: "修改成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.changeQxzEleName[index].editname =
|
|
|
+ this.changeQxzEleName[index].name;
|
|
|
+ });
|
|
|
},
|
|
|
- closeQxzDialogVisible(){
|
|
|
+ closeQxzDialogVisible() {
|
|
|
this.$refs.sidebarWarnRef.getQxzEle();
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created() {
|
|
|
- },
|
|
|
+ created() {},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
|
this.user_id = this.$store.state.disasterWarnUserId;
|
|
|
@@ -517,7 +576,7 @@ export default {
|
|
|
destroyed() {
|
|
|
this.Stop();
|
|
|
}, //生命周期 - 销毁完成
|
|
|
- activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+ activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped lang='less'>
|
|
|
@@ -576,34 +635,34 @@ export default {
|
|
|
cursor: pointer;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
- >div{
|
|
|
- display: flex;
|
|
|
+ > div {
|
|
|
+ display: flex;
|
|
|
justify-content: left;
|
|
|
align-items: center;
|
|
|
}
|
|
|
- >span:nth-child(1){
|
|
|
+ > span:nth-child(1) {
|
|
|
width: 72%;
|
|
|
overflow: hidden;
|
|
|
white-space: nowrap;
|
|
|
text-overflow: ellipsis;
|
|
|
}
|
|
|
- >div{
|
|
|
- i{
|
|
|
+ > div {
|
|
|
+ i {
|
|
|
font-size: 20px;
|
|
|
}
|
|
|
- i:nth-child(1){
|
|
|
+ i:nth-child(1) {
|
|
|
font-size: 18px;
|
|
|
display: none;
|
|
|
}
|
|
|
- i:nth-child(2){
|
|
|
+ i:nth-child(2) {
|
|
|
color: red;
|
|
|
}
|
|
|
- i:nth-child(3){
|
|
|
+ i:nth-child(3) {
|
|
|
color: green;
|
|
|
}
|
|
|
}
|
|
|
- >span:nth-child(2){
|
|
|
- font-size: 14px;
|
|
|
+ > span:nth-child(2) {
|
|
|
+ font-size: 14px;
|
|
|
}
|
|
|
img {
|
|
|
margin-right: 2px;
|
|
|
@@ -611,8 +670,8 @@ export default {
|
|
|
&:hover {
|
|
|
background: #0c142c;
|
|
|
}
|
|
|
- .changeNameVal{
|
|
|
- /deep/.el-input__inner{
|
|
|
+ .changeNameVal {
|
|
|
+ /deep/.el-input__inner {
|
|
|
background: none;
|
|
|
outline: none;
|
|
|
border: 1px solid #6b6b6b;
|
|
|
@@ -622,9 +681,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .item:hover{
|
|
|
- >div{
|
|
|
- i:nth-child(1){
|
|
|
+ .item:hover {
|
|
|
+ > div {
|
|
|
+ i:nth-child(1) {
|
|
|
display: block;
|
|
|
}
|
|
|
}
|
|
|
@@ -697,14 +756,14 @@ export default {
|
|
|
justify-content: space-around;
|
|
|
line-height: 33px;
|
|
|
color: #fff;
|
|
|
- >div:nth-child(1){
|
|
|
+ > div:nth-child(1) {
|
|
|
width: 100px;
|
|
|
- text-indent:14px;
|
|
|
+ text-indent: 14px;
|
|
|
}
|
|
|
.wranmsg {
|
|
|
width: 170px;
|
|
|
}
|
|
|
- >div:nth-child(3){
|
|
|
+ > div:nth-child(3) {
|
|
|
width: 120px;
|
|
|
}
|
|
|
}
|
|
|
@@ -742,50 +801,49 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 设备定位弹框
|
|
|
-/deep/.setlnglatBox{
|
|
|
+/deep/.setlnglatBox {
|
|
|
box-shadow: 0px 0px 4px 0px #0161ff;
|
|
|
background: rgba(12, 20, 44, 0.8);
|
|
|
border-radius: 8px;
|
|
|
}
|
|
|
-/deep/.setlnglatBox .el-dialog__header{
|
|
|
+/deep/.setlnglatBox .el-dialog__header {
|
|
|
background: #0c142c;
|
|
|
padding: 10px 20px;
|
|
|
border-bottom: 1px solid #0c142c;
|
|
|
}
|
|
|
-/deep/.setlnglatBox .el-dialog__header .el-dialog__title{
|
|
|
+/deep/.setlnglatBox .el-dialog__header .el-dialog__title {
|
|
|
color: #fff;
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
-/deep/.setlnglatBox .el-dialog__headerbtn .el-dialog__close{
|
|
|
+/deep/.setlnglatBox .el-dialog__headerbtn .el-dialog__close {
|
|
|
color: #fff;
|
|
|
}
|
|
|
// 设置要素名称
|
|
|
-.equipEleData{
|
|
|
- .el-scrollbar{
|
|
|
+.equipEleData {
|
|
|
+ .el-scrollbar {
|
|
|
height: 230px;
|
|
|
- /deep/.el-scrollbar__wrap{
|
|
|
+ /deep/.el-scrollbar__wrap {
|
|
|
overflow-x: hidden;
|
|
|
}
|
|
|
- /deep/.el-scrollbar__thumb{
|
|
|
+ /deep/.el-scrollbar__thumb {
|
|
|
background: #0165b8;
|
|
|
}
|
|
|
}
|
|
|
- .equipEleList{
|
|
|
+ .equipEleList {
|
|
|
display: flex;
|
|
|
justify-content: left;
|
|
|
flex-wrap: wrap;
|
|
|
- >div{
|
|
|
+ > div {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
margin: 10px 0;
|
|
|
width: 100%;
|
|
|
- span:nth-child(1){
|
|
|
+ span:nth-child(1) {
|
|
|
color: #04d5e8;
|
|
|
width: 33px;
|
|
|
}
|
|
|
- span:nth-child(2){
|
|
|
+ span:nth-child(2) {
|
|
|
color: #04d5e8;
|
|
|
width: 135px;
|
|
|
white-space: nowrap;
|
|
|
@@ -793,9 +851,9 @@ export default {
|
|
|
overflow: hidden;
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
- .inp{
|
|
|
+ .inp {
|
|
|
width: 200px;
|
|
|
- /deep/input{
|
|
|
+ /deep/input {
|
|
|
background: none;
|
|
|
outline: none;
|
|
|
border: 1px solid #0c142c;
|
|
|
@@ -805,12 +863,10 @@ export default {
|
|
|
background: #0c142c;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-.equipEleSaveBtn{
|
|
|
+.equipEleSaveBtn {
|
|
|
text-align: right;
|
|
|
}
|
|
|
-
|
|
|
</style>
|