Commit e10b5d07 by 前端

Merge branch 'v1.20.0' into 'master'

v1.20.0版本已上线,代码合并到master

See merge request !34
2 parents ac2d2a40 117dc6a5
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
margin-left: 20px; margin-left: 20px;
} }
} }
.map-controll.toleft{
.map-controll.toleft {
left: 150px; left: 150px;
right: calc(100% - 330px) right: calc(100% - 330px)
} }
...@@ -38,11 +39,13 @@ ...@@ -38,11 +39,13 @@
font-size: 16px; font-size: 16px;
} }
} }
.map-bottom-controll.toleft{
.map-bottom-controll.toleft {
left: 20px; left: 20px;
right: calc(100% - 55px); right: calc(100% - 55px);
bottom: 50px; bottom: 50px;
} }
.controll-wrap { .controll-wrap {
position: absolute; position: absolute;
top: 40px; top: 40px;
...@@ -479,7 +482,9 @@ ...@@ -479,7 +482,9 @@
} }
} }
a.fence_btn_grey,a.history_btn_grey,a.resident_btn_grey { a.fence_btn_grey,
a.history_btn_grey,
a.resident_btn_grey {
border: 1px solid #d8d8d8; border: 1px solid #d8d8d8;
color: #999; color: #999;
background: #f2f2f2; background: #f2f2f2;
...@@ -546,7 +551,9 @@ ...@@ -546,7 +551,9 @@
} }
} }
.fence_btn_grey,.history_btn_grey,.resident_btn_grey { .fence_btn_grey,
.history_btn_grey,
.resident_btn_grey {
border: 1px solid #d8d8d8 !important; border: 1px solid #d8d8d8 !important;
color: #999 !important; color: #999 !important;
background: #f2f2f2 !important; background: #f2f2f2 !important;
...@@ -557,3 +564,39 @@ ...@@ -557,3 +564,39 @@
background: #f2f2f2 !important; background: #f2f2f2 !important;
} }
} }
.copy-btn {
cursor: pointer;
}
.map-infowindow-title {
position: relative;
.question_icon {
display:inline-block;
background: url('https://img01.glsx.com.cn/weapp/resource/e-shield/circle-question.png') no-repeat;
background-size: 20px auto;
width: 20px;
height: 20px;
vertical-align: middle;
}
.popover_box {
position: absolute;
background: rgba(0, 0, 0, 0.5);
top: 20px;
right: 0px;
padding:10px;
z-index:2;
border-radius:4px;
color:#fff;
font-size:12px;
p{
margin:0;
}
}
}
.map_info_window {
position: relative;
}
\ No newline at end of file \ No newline at end of file
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
src: { src: {
handler: function (n) { handler: function (n) {
if (n) { if (n) {
console.log(n);
this.imgPath = this.IMAGEURL + n; this.imgPath = this.IMAGEURL + n;
} }
}, },
...@@ -40,7 +39,6 @@ ...@@ -40,7 +39,6 @@
}; };
}, },
created() { created() {
console.log(this.src);
}, },
mounted() {}, mounted() {},
methods: { methods: {
......
...@@ -1319,6 +1319,7 @@ export default { ...@@ -1319,6 +1319,7 @@ export default {
} }
} */ } */
this._drawTimeoutId = setTimeout(() => { this._drawTimeoutId = setTimeout(() => {
this.getPositionData(); this.getPositionData();
}, 10 * 1000); }, 10 * 1000);
......
...@@ -172,6 +172,7 @@ import { ...@@ -172,6 +172,7 @@ import {
import EventBus from "@/event-bus"; import EventBus from "@/event-bus";
import { showToast, deepClone } from "@/utils/utils.js"; import { showToast, deepClone } from "@/utils/utils.js";
import { Validator, CHECK_NUMBER } from "@/common/validator"; import { Validator, CHECK_NUMBER } from "@/common/validator";
import qs from "qs";
export default { export default {
data() { data() {
return { return {
...@@ -236,6 +237,7 @@ export default { ...@@ -236,6 +237,7 @@ export default {
"AMap.AutoComplete", "AMap.AutoComplete",
"AMap.MassMarks", "AMap.MassMarks",
"AMap.MarkerCluster", "AMap.MarkerCluster",
"AMap.Bounds",
]); ]);
if (window.AMap) { if (window.AMap) {
window.AMap = null; window.AMap = null;
...@@ -249,7 +251,7 @@ export default { ...@@ -249,7 +251,7 @@ export default {
.then((AMap) => { .then((AMap) => {
_this.mapLoading = false; _this.mapLoading = false;
window.AMap = AMap; window.AMap = AMap;
_this.map = mapService.init("map", { zoom: 12 }); _this.map = mapService.init("map", { zoom: 11 });
_this.mouseTool = new AMap.MouseTool(_this.map); _this.mouseTool = new AMap.MouseTool(_this.map);
var autoComplete = new AMap.AutoComplete({ var autoComplete = new AMap.AutoComplete({
input: "tipInput", input: "tipInput",
...@@ -258,8 +260,15 @@ export default { ...@@ -258,8 +260,15 @@ export default {
console.log(e); console.log(e);
let poi = e.poi || {}; let poi = e.poi || {};
_this.poi = poi; _this.poi = poi;
_this.$set(_this.form, "address", poi.name);
_this.$refs.addressInput.focus(); _this.$refs.addressInput.focus();
}); });
// 判断是否为全屏,是否带参数,如果带了矩形参数,则默认画一个矩形
let _query = _this.$route.query;
if (_query.type == "full" && _query.leftLngLat) {
this.initPage(_query);
}
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
...@@ -294,10 +303,10 @@ export default { ...@@ -294,10 +303,10 @@ export default {
// _this.mouseTool.close(); // _this.mouseTool.close();
// return false; // return false;
// } // }
if (_zoom < 14) { if (_zoom < 11) {
_this.map.setZoom(14); _this.map.setZoom(11);
} }
_this.map.setZooms([14, 30]); _this.map.setZooms([11, 30]);
if (_this.mouseTool) { if (_this.mouseTool) {
_this.mouseTool.rectangle({ _this.mouseTool.rectangle({
...@@ -537,6 +546,8 @@ export default { ...@@ -537,6 +546,8 @@ export default {
async getAreaLocation() { async getAreaLocation() {
let _this = this; let _this = this;
let params = this.getParams(); let params = this.getParams();
let _options = this.$route.query;
console.log(_options);
if (!_this.rectangle) { if (!_this.rectangle) {
showToast({ showToast({
...@@ -550,6 +561,10 @@ export default { ...@@ -550,6 +561,10 @@ export default {
_this.mapMass.clear(); _this.mapMass.clear();
_this.mapMass = null; _this.mapMass = null;
} }
if (_options.type != "full") {
_this.goFullPage();
return false;
}
_this.loading = true; _this.loading = true;
let res = await GER_REGIONAL_SEARCH(params); let res = await GER_REGIONAL_SEARCH(params);
...@@ -633,12 +648,95 @@ export default { ...@@ -633,12 +648,95 @@ export default {
}); });
mass.setMap(_this.map); mass.setMap(_this.map);
this.drawDone = true; this.drawDone = true;
if(arr && arr.length<10){ if (arr && arr.length < 10) {
this.map.setFitView(); this.map.setFitView();
} }
this.mapMass = mass; this.mapMass = mass;
}, },
// 全屏状态下,根据参数初始化页面
initPage(query) {
this.menuId = query.menuId;
if (query.address) {
this.$set(this.form, "address", query.address);
}
if (query.sn) {
this.$set(this.form, "sn", query.sn);
}
// 执行查询设备号
if (query.menuId == 2 && query.sn) {
//this.getLocation();
}
// 如果是地址,则标记出对应的点
if (query.menuId == 1 && query.lng) {
let poi = new AMap.LngLat(query.lng, query.lat);
this.autoCenterMarker = mapService.createMarker(poi);
this.map.add(this.autoCenterMarker);
}
this.drawRectangle(query);
this.getAreaLocation();
},
// 绘画矩形
drawRectangle(query) {
let leftLngLat = query.leftLngLat.split(",");
let rightLngLat = query.rightLngLat.split(",");
let southWest = new AMap.LngLat(leftLngLat[0], leftLngLat[1]);
let northEast = new AMap.LngLat(rightLngLat[0], rightLngLat[1]);
let bounds = new AMap.Bounds(southWest, northEast);
let rectangle = new AMap.Rectangle({
bounds: bounds,
fillColor: "#2C68FF",
strokeColor: "#2C68FF",
fillOpacity: 0.3,
strokeWeight: 4,
strokeOpacity: 1,
draggable: true,
});
this.map.add(rectangle);
this.rectangle = rectangle;
this.calculateWidthHeight(rectangle.getOptions().bounds);
let _zoom = this.map.getZoom();
if (_zoom < 11) {
this.map.setZoom(11);
}
this.map.setZooms([11, 30]);
this.map.setFitView();
},
// 跳转全屏页面
goFullPage() {
let params = this.getParams();
let poi = this.poi;
let m = {};
m.leftLngLat = params.leftLngLat;
m.rightLngLat = params.rightLngLat;
m.menuId = this.menuId;
// 根据地址查询
if (this.menuId == 1) {
//m.address = this.form.address;
m.lng = poi.location ? poi.location.lng : "";
m.lat = poi.location ? poi.location.lat : "";
}
if (this.form.address) {
m.address = this.form.address;
}
if (this.form.sn) {
m.sn = this.form.sn;
}
console.log(qs.stringify(m));
let _path = `oEshield#/monitor/zoneCar?type=full&` + qs.stringify(m);
window.open(_path);
},
// 添加海量点 标记点方式 // 添加海量点 标记点方式
// addMarkers2(arr) { // addMarkers2(arr) {
// console.log(arr); // console.log(arr);
......
...@@ -10,6 +10,7 @@ EventBus.$on('uiMap.copySuccess', (data) => { ...@@ -10,6 +10,7 @@ EventBus.$on('uiMap.copySuccess', (data) => {
message: '已复制内容至粘贴板' message: '已复制内容至粘贴板'
}); });
}); });
var clipboard = null;
...@@ -254,7 +255,15 @@ MapService.prototype = { ...@@ -254,7 +255,15 @@ MapService.prototype = {
autoMove: !!isInfoAutoMove autoMove: !!isInfoAutoMove
}); });
marker.infoWindow = infoWindow; marker.infoWindow = infoWindow;
var clipboard = new ClipboardJS(div.querySelector('.copy-btn')); // var clipboard = new ClipboardJS(div.querySelector('.copy-btn'));
if(clipboard){
clipboard.destroy();
}
clipboard = new ClipboardJS('.copy-btn',{
text:function(trigger){
return trigger.getAttribute('aria-label');
}
})
clipboard.on('success', function (e) { clipboard.on('success', function (e) {
e.clearSelection(); e.clearSelection();
EventBus.$emit('uiMap.copySuccess'); EventBus.$emit('uiMap.copySuccess');
...@@ -277,6 +286,15 @@ MapService.prototype = { ...@@ -277,6 +286,15 @@ MapService.prototype = {
return infoWindow; return infoWindow;
}, },
// 初始化复制事件
initCopyEvent(){
var clipboard = new ClipboardJS('.copy-btn',{
text:function(trigger){
return trigger.getAttribute('aria-label');
}
})
},
// 车辆监控-查看位置点 // 车辆监控-查看位置点
bindMonitorInfoWindow: function (marker, map, info, isInfoOpen, isInfoAutoMove) { bindMonitorInfoWindow: function (marker, map, info, isInfoOpen, isInfoAutoMove) {
var self = this; var self = this;
...@@ -287,14 +305,20 @@ MapService.prototype = { ...@@ -287,14 +305,20 @@ MapService.prototype = {
var statusArr = ['行驶中', '静止', '离线', '在线'] var statusArr = ['行驶中', '静止', '离线', '在线']
if (info.status === 2) { if (info.status === 2) {
infoDiv.querySelector('[data-status]').textContent = `${statusArr[info.status]} | 已离线${info.statusTime && info.statusTime != null?info.statusTime:''}`; let _msg = `${statusArr[info.status]} | 已离线${info.statusTime && info.statusTime != null?info.statusTime:''}`;
infoDiv.querySelector('[data-status]').textContent = _msg;
infoDiv.querySelector('[data-status]').setAttribute('aria-label',_msg)
} else { } else {
infoDiv.querySelector('[data-status]').textContent = statusArr[info.status]; infoDiv.querySelector('[data-status]').textContent = statusArr[info.status];
infoDiv.querySelector('[data-status]').setAttribute('aria-label',statusArr[info.status]);
} }
infoDiv.querySelector('[data-time]').textContent = eLocation.dateTime; infoDiv.querySelector('[data-time]').textContent = eLocation.dateTime;
infoDiv.querySelector('[data-time').setAttribute('aria-label', eLocation.dateTime);
infoDiv.querySelector('[data-transferAddress]').textContent = eLocation.transferAddress; infoDiv.querySelector('[data-transferAddress]').textContent = eLocation.transferAddress;
infoDiv.querySelector('[data-clipboard-text').setAttribute('data-clipboard-text', eLocation.transferAddress); infoDiv.querySelector('[data-transferAddress').setAttribute('aria-label', eLocation.transferAddress);
//infoDiv.querySelector('[data-clipboard-text').setAttribute('data-clipboard-text', eLocation.transferAddress);
infoDiv.querySelector('[data-address-icon').setAttribute('aria-label', eLocation.transferAddress);
if (info.battery) { if (info.battery) {
infoDiv.querySelector('[data-battery]').classList.remove('hide'); infoDiv.querySelector('[data-battery]').classList.remove('hide');
...@@ -333,7 +357,10 @@ MapService.prototype = { ...@@ -333,7 +357,10 @@ MapService.prototype = {
wifiBtn && wifiBtn.classList.remove('el-button--primary'); wifiBtn && wifiBtn.classList.remove('el-button--primary');
baseBtn && baseBtn.classList.add('el-button--primary'); baseBtn && baseBtn.classList.add('el-button--primary');
infoDiv.querySelector('[data-transferAddress]').textContent = eLocation.transferAddress; infoDiv.querySelector('[data-transferAddress]').textContent = eLocation.transferAddress;
infoDiv.querySelector('[data-transferAddress').setAttribute('aria-label', eLocation.transferAddress);
infoDiv.querySelector('[data-address-icon').setAttribute('aria-label', eLocation.transferAddress);
infoDiv.querySelector('[data-time]').textContent = eLocation.dateTime; infoDiv.querySelector('[data-time]').textContent = eLocation.dateTime;
infoDiv.querySelector('[data-time').setAttribute('aria-label', eLocation.dateTime);
EventBus.$emit('uiMap.monitor.changeELocate', info) EventBus.$emit('uiMap.monitor.changeELocate', info)
EventBus.$emit('uiMap.monitor.drawDone'); EventBus.$emit('uiMap.monitor.drawDone');
self.setFitView() self.setFitView()
...@@ -355,7 +382,10 @@ MapService.prototype = { ...@@ -355,7 +382,10 @@ MapService.prototype = {
wifiBtn && wifiBtn.classList.remove('el-button--primary'); wifiBtn && wifiBtn.classList.remove('el-button--primary');
baseBtn && baseBtn.classList.remove('el-button--primary'); baseBtn && baseBtn.classList.remove('el-button--primary');
infoDiv.querySelector('[data-transferAddress]').textContent = eLocation.transferAddress; infoDiv.querySelector('[data-transferAddress]').textContent = eLocation.transferAddress;
infoDiv.querySelector('[data-transferAddress').setAttribute('aria-label', eLocation.transferAddress);
infoDiv.querySelector('[data-address-icon').setAttribute('aria-label', eLocation.transferAddress);
infoDiv.querySelector('[data-time]').textContent = eLocation.dateTime; infoDiv.querySelector('[data-time]').textContent = eLocation.dateTime;
infoDiv.querySelector('[data-time').setAttribute('aria-label', eLocation.dateTime);
EventBus.$emit('uiMap.monitor.changeELocate', info) EventBus.$emit('uiMap.monitor.changeELocate', info)
EventBus.$emit('uiMap.monitor.drawDone'); EventBus.$emit('uiMap.monitor.drawDone');
self.setFitView() self.setFitView()
...@@ -372,7 +402,9 @@ MapService.prototype = { ...@@ -372,7 +402,9 @@ MapService.prototype = {
wifiBtn && wifiBtn.classList.add('el-button--primary'); wifiBtn && wifiBtn.classList.add('el-button--primary');
baseBtn && baseBtn.classList.remove('el-button--primary'); baseBtn && baseBtn.classList.remove('el-button--primary');
infoDiv.querySelector('[data-transferAddress]').textContent = info.wifiLocation.address; infoDiv.querySelector('[data-transferAddress]').textContent = info.wifiLocation.address;
infoDiv.querySelector('[data-transferAddress').setAttribute('aria-label', info.wifiLocation.address);
infoDiv.querySelector('[data-time]').textContent = info.wifiLocation.dateTime; infoDiv.querySelector('[data-time]').textContent = info.wifiLocation.dateTime;
infoDiv.querySelector('[data-time').setAttribute('aria-label', info.wifiLocation.dateTime);
EventBus.$emit('uiMap.monitor.changeELocate', info) EventBus.$emit('uiMap.monitor.changeELocate', info)
EventBus.$emit('uiMap.monitor.drawDone'); EventBus.$emit('uiMap.monitor.drawDone');
self.setFitView() self.setFitView()
...@@ -468,6 +500,20 @@ MapService.prototype = { ...@@ -468,6 +500,20 @@ MapService.prototype = {
} }
}) */ }) */
// 浮窗点击事件
let questionIcon = infoDiv.querySelector('.question_icon');
if(questionIcon){
let _obj = infoDiv.querySelector('.popover_box');
questionIcon.addEventListener('mouseover',function(){
_obj.style.display = 'block';
})
questionIcon.addEventListener('mouseout',function(){
_obj.style.display = 'none';
})
}
return this.createInfoWindow(marker, map, infoDiv, isInfoOpen, isInfoAutoMove); return this.createInfoWindow(marker, map, infoDiv, isInfoOpen, isInfoAutoMove);
}, },
bindLocationInfoWindow(marker, map, info) { bindLocationInfoWindow(marker, map, info) {
...@@ -573,21 +619,23 @@ MapService.prototype = { ...@@ -573,21 +619,23 @@ MapService.prototype = {
return _html;*/ return _html;*/
let _this = this; let _this = this;
let queryCode = `sn=${info.sn}&name=${encodeURI(info.name)}&standno=${info.standNo}`; let queryCode = `sn=${info.sn}&name=${encodeURI(info.name)}&standno=${info.standNo}`;
var _html = `<h3 class="map-infowindow-title">${info.name}/${info.standNo}</h3>`; var _html = `<div class="map-infowindow-title"><span class="copy-btn" aria-label="${info.name}">${info.name}</span><span>/</span><span class="copy-btn" aria-label="${info.standNo}">${info.standNo}</span><span class="question_icon"></span>`;
_html += '<div class="popover_box" style="display:none;"><div class="title">信息复制说明:</div><p>非标题类文字,支持“单击”复制,已复制信息可用快捷键或者鼠标有键“粘贴”功能进行使用。</p></div>'
_html += '</div>'
_html += `<div class="map-infowindow-ct map_info_window">`; _html += `<div class="map-infowindow-ct map_info_window">`;
if (zhongliType == 'yes') { if (zhongliType == 'yes') {
_html += `<div>`; _html += `<div>`;
if (info.shopName) { if (info.shopName) {
_html += `<p><i class="icon icon-icon_store"></i> 店面名称: <span class="des">${info.shopName}</span></p>`; _html += `<p><i class="icon icon-icon_store"></i> 店面名称: <span class="des copy-btn" aria-label="${info.shopName}">${info.shopName}</span></p>`;
} }
if (info.shopContacts) { if (info.shopContacts) {
_html += `<p style="margin-left:29px;"> 店面联系人: <span class="des">${info.shopContacts}</span></p>`; _html += `<p style="margin-left:29px;"> 店面联系人: <span class="des copy-btn" aria-label="${info.shopContacts}">${info.shopContacts}</span></p>`;
} }
if (info.contactsPhone) { if (info.contactsPhone) {
_html += `<p style="margin-left:29px;"> 联系方式: <span class="des">${info.contactsPhone}</span></p>`; _html += `<p style="margin-left:29px;"> 联系方式: <span class="des copy-btn" aria-label="${info.contactsPhone}">${info.contactsPhone}</span></p>`;
} }
if (info.idnum) { if (info.idnum) {
_html += `<p style="margin-left:29px;"> 车牌号: <span class="des">${info.idnum}</span></p>`; _html += `<p style="margin-left:29px;"> 车牌号: <span class="des copy-btn" aria-label="${info.idnum}">${info.idnum}</span></p>`;
} }
_html += `</div>`; _html += `</div>`;
} }
...@@ -597,27 +645,27 @@ MapService.prototype = { ...@@ -597,27 +645,27 @@ MapService.prototype = {
let o = list.find(k => k.origin.permissionTag == 'oEshield_monitor_store_name'); let o = list.find(k => k.origin.permissionTag == 'oEshield_monitor_store_name');
let n = list.find(k => k.origin.permissionTag == 'oEshield_monitor_plate_number'); let n = list.find(k => k.origin.permissionTag == 'oEshield_monitor_plate_number');
if (o && info.shopName) { if (o && info.shopName) {
_html += `<p><i class="icon_info_shop"></i> 店面名称: <span class="des">${info.shopName || '--'}</span></p>`; _html += `<p><i class="icon_info_shop"></i> 店面名称: <span class="des copy-btn" aria-label="${info.shopName}">${info.shopName || '--'}</span></p>`;
} }
if (n && info.licensePlate) { if (n && info.licensePlate) {
_html += `<p><i class="icon_info_plate"></i>车牌号: <span class="des">${info.licensePlate || '--'}</span></p>`; _html += `<p><i class="icon_info_plate"></i>车牌号: <span class="des copy-btn" aria-label="${info.licensePlate}">${info.licensePlate || '--'}</span></p>`;
} }
_html += `<p><i class="icon icon-info_device"></i> 设备号:<span class="des"> ${info.sn} (${info.isSource === '1' ? '有线' : '无线'})</span> _html += `<p class="" aria-label="${info.sn}"><i class="icon icon-info_device"></i> 设备号:<span class="des copy-btn" aria-label="${info.sn}(${info.isSource === '1' ? '有线' : '无线'})"> ${info.sn} (${info.isSource === '1' ? '有线' : '无线'})</span>
<span class="battery" data-battery> <span class="battery" data-battery>
<i class="fill"><i class="fill-percentage" data-battery-percentage></i></i> <i class="fill"><i class="fill-percentage" data-battery-percentage></i></i>
<i class="icon icon-battery_enough"></i> <i class="icon icon-battery_enough"></i>
<i class="text" data-battery-text></i> <i class="text" data-battery-text></i>
</span></p> </span></p>
<p><i class="icon icon-info_device_status"></i> 设备状态: <span class="des" data-status></span></p> <p><i class="icon icon-info_device_status"></i> 设备状态: <span class="des copy-btn" data-status aria-label=""></span></p>
<p data-alarm> <p data-alarm>
<button type="button" class="el-button el-button--mini el-button--primary" data-alarmoff>断电</button> <button type="button" class="el-button el-button--mini el-button--primary" data-alarmoff>断电</button>
<button type="button" class="el-button el-button--mini el-button--primary" data-alarmlight>光感</button> <button type="button" class="el-button el-button--mini el-button--primary" data-alarmlight>光感</button>
</p> </p>
<p><i class="icon icon-info_time"></i> 最后上点时间: <span class="des" data-time></span></p> <p><i class="icon icon-info_time"></i> 最后上点时间: <span class="des copy-btn" data-time aria-label=""></span></p>
<p><i class="icon icon-info_location"></i> 最后上点地址: <span class="des adr" data-transferAddress>${info.transferAddress}</span> <p><i class="icon icon-info_location"></i> 最后上点地址: <span class="des adr copy-btn" data-transferAddress aria-label="${info.transferAddress}">${info.transferAddress}</span>
<a class="copy-btn" data-clipboard-text=""><i class="icon icon-info_copy"></i></a> <a class="" data-clipboard-text="${info.transferAddress}"><i class="icon icon-info_copy copy-btn" data-address-icon aria-label="${info.transferAddress}"></i></a>
</p> </p>
<p><i class="icon icon-info_type"></i> 定位类型:<span class="el-button-group">` <p><i class="icon icon-info_type"></i> 定位类型:<span class="el-button-group">`
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!