Commit 901b1182 by 张杰

修复bug,优化界面

1 parent 9b2ca6b5
...@@ -52,7 +52,7 @@ import remoteLoad from "utils/remoteLoad.js"; ...@@ -52,7 +52,7 @@ import remoteLoad from "utils/remoteLoad.js";
import mapService from "utils/mapService.js"; import mapService from "utils/mapService.js";
import FenceMapControll from "./FenceMapControll.vue"; import FenceMapControll from "./FenceMapControll.vue";
const BUSINESS_SERVICE = services.business; const BUSINESS_SERVICE = services.business;
const mapMenu = ""; var mapMenu = "";
import { CONSTANT } from "../../constant"; import { CONSTANT } from "../../constant";
export default { export default {
props: ["fenceMapModalVisible", "init", "readonlyStatus"], props: ["fenceMapModalVisible", "init", "readonlyStatus"],
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
], ],
}; };
}, },
mounted() {}, async mounted() {},
watch: { watch: {
lng(newVal) { lng(newVal) {
//this.transfer() //this.transfer()
...@@ -187,27 +187,22 @@ export default { ...@@ -187,27 +187,22 @@ export default {
}, },
bindContextMenu() { bindContextMenu() {
const self = this; const self = this;
window.mapMenu = new ContextMenu(self.mapObj); //暴露mapMenu onclick要用 var contextMenu = new AMap.ContextMenu();
function ContextMenu(map) { contextMenu.addItem(
var me = this; "设置围栏中心",
this.contextMenuPositon = null; function () {
this.contextMenu = new AMap.ContextMenu({
isCustom: true,
content: `<div class="context_menu" >
<p onclick="mapMenu.moveCenter()"><span>设置围栏中心</span></p>
</div>`,
});
map.on("rightclick", (e) => {
if (self.mapObj.getAllOverlays("circle").length) {
this.contextMenu.open(map, e.lnglat);
self.contextMenuPositon = e.lnglat; //右键菜单位置
}
});
}
ContextMenu.prototype.moveCenter = function addPOI() {
self.moveCenter(); self.moveCenter();
this.contextMenu.close(); },
}; 0
);
//地图绑定鼠标右击事件——弹出右键菜单
self.mapObj.on("rightclick", function (e) {
console.log(e)
contextMenu.open(self.mapObj, e.lnglat);
self.contextMenuPositon = e.lnglat;
});
//contextMenu.open(self.mapObj, lnglat);
}, },
drawFence() { drawFence() {
if (!this.lng && !this.lat) { if (!this.lng && !this.lat) {
...@@ -422,13 +417,13 @@ export default { ...@@ -422,13 +417,13 @@ export default {
self.geolocation.getCurrentPosition(); self.geolocation.getCurrentPosition();
AMap.event.addListener(self.geolocation, "complete", function (e) { AMap.event.addListener(self.geolocation, "complete", function (e) {
console.log('complete',e) console.log("complete", e);
//返回定位信息 //返回定位信息
var lnglatXY = mapService.getLngLat(e.position.lng, e.position.lat); var lnglatXY = mapService.getLngLat(e.position.lng, e.position.lat);
resolve(lnglatXY); resolve(lnglatXY);
}); });
AMap.event.addListener(self.geolocation, "error", function (e) { AMap.event.addListener(self.geolocation, "error", function (e) {
console.log('error',e) console.log("error", e);
//返回定位出错信息 //返回定位出错信息
resolve(mapObj.getCenter()); resolve(mapObj.getCenter());
}); });
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<el-form-item> <el-form-item>
<div class="pre_select_box"> <div class="pre_select_box">
<el-select v-model="form.timeType" class="small_select mr5" placeholder="请选择"> <el-select v-model="form.timeType" class="small_select mr5" placeholder="请选择">
<el-option label="创建时间" value="1"></el-option> <el-option label="激活时间" value="1"></el-option>
</el-select> </el-select>
<el-date-picker v-model="form.timeDate" class="data_picker" value-format="yyyy-MM-dd" type="daterange" range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期"> <el-date-picker v-model="form.timeDate" class="data_picker" value-format="yyyy-MM-dd" type="daterange" range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div class="controll-wrap"> <div class="controll-wrap">
<div class="search-box" :class="resultBoxHidden?'active':''"> <div class="search-box" :class="resultBoxHidden?'active':''">
<h3>轨迹回放</h3> <h3>轨迹回放</h3>
<p class="info">{{name}}/{{standno}}/{{sn}}</p> <p class="info">{{name||'--'}}/{{standno||'--'}}/{{sn||'--'}}</p>
<el-form ref="form" :model="form" :rules="rules" :inline="false" size="mini" class="form"> <el-form ref="form" :model="form" :rules="rules" :inline="false" size="mini" class="form">
<el-form-item label="查询范围" prop="daterange"> <el-form-item label="查询范围" prop="daterange">
<el-date-picker class="pull-left" style="width: 100%;" v-model="form.dateRange" type="datetimerange" range-separator="至" start-placeholder="开始日期" format="yyyy-MM-dd HH:mm" :clearable="false" :editable="false" :picker-options="{ <el-date-picker class="pull-left" style="width: 100%;" v-model="form.dateRange" type="datetimerange" range-separator="至" start-placeholder="开始日期" format="yyyy-MM-dd HH:mm" :clearable="false" :editable="false" :picker-options="{
......
...@@ -422,12 +422,17 @@ MapService.prototype = { ...@@ -422,12 +422,17 @@ MapService.prototype = {
// 跳转到电子围栏页面 无线设备不能跳转电子围栏 isSource:1有线,其他无线 // 跳转到电子围栏页面 无线设备不能跳转电子围栏 isSource:1有线,其他无线
let fenceBtn = infoDiv.querySelector('[data-fence]'); let fenceBtn = infoDiv.querySelector('[data-fence]');
if (fenceBtn && info.isSource == 1) {
fenceBtn.onclick = function () {
if (fenceBtn) {
if (info.isSource != 1) {
fenceBtn.classList.add('fence_btn_grey');
}
fenceBtn.onclick = function () {
if (info.isSource == 1) {
mapService.openPage(`#/monitor/fence?${queryCode}`) mapService.openPage(`#/monitor/fence?${queryCode}`)
} }
} }
}
console.log(historyBtn) console.log(historyBtn)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!