修改编辑围栏
parent
e896639631
commit
e2b38a140f
|
@ -3,7 +3,7 @@ import request from "@/utils/request";
|
|||
//编辑围栏
|
||||
export function updateFenceMapAddr(data) {
|
||||
return request({
|
||||
url: '/baseFence/updateFence',
|
||||
url: 'carBase/baseFence/updateFence',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
@ -13,7 +13,7 @@ export function updateFenceMapAddr(data) {
|
|||
//添加围栏
|
||||
export function insertFence(data) {
|
||||
return request({
|
||||
url: '/baseFence/insertFence',
|
||||
url: 'carBase/baseFence/insertFence',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
|
||||
<el-table-column label="围栏状态" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.driveStatus===0">停用</span>
|
||||
<span v-if="scope.row.driveStatus===1">开启</span>
|
||||
<span v-if="scope.row.fenceStatus===0">停用</span>
|
||||
<span v-if="scope.row.fenceStatus===1">正常</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<div class="input-card" style="width: 200px">
|
||||
<h4 style="margin-bottom: 10px; font-weight: 600">围栏操作</h4>
|
||||
<button class="btn" @click="drawPolygon()" style="margin-bottom: 5px">开始编辑围栏</button>
|
||||
<button class="btn" @click="updateFence()" style="margin-bottom: 5px">录入围栏</button>
|
||||
<button class="btn" @click="updateFence" style="margin-bottom: 5px">录入围栏</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -69,14 +69,14 @@ export default {
|
|||
//绘制多边形;
|
||||
overlays.push(e.obj);
|
||||
//获取坐标;
|
||||
console.log(e.obj.getPath());
|
||||
// console.log(e.obj.getPath());
|
||||
//格式化坐标;
|
||||
var polyPoints = e.obj.getPath();
|
||||
var arr = "";
|
||||
for (var i = 0; i < polyPoints.length; i++) {
|
||||
this.mapAddr += polyPoints[i].lng + "," + polyPoints[i].lat + ";";
|
||||
}
|
||||
console.log("牛逼啊?"+this.mapAddr);//121.540994,29.870174;121.55138,29.858116;121.55756,29.874193;
|
||||
// console.log("牛逼啊?"+this.mapAddr);//121.540994,29.870174;121.55138,29.858116;121.55756,29.874193;
|
||||
|
||||
})
|
||||
|
||||
|
@ -101,9 +101,13 @@ export default {
|
|||
},
|
||||
|
||||
updateFence() {
|
||||
this.fence.fenceLocation = this.mapAddr
|
||||
console.log(this.fence.fenceLocation)
|
||||
updateFenceMapAddr(this.fence).then(res =>{
|
||||
console.log(res)
|
||||
// this.$router.push("/views/car/fence")
|
||||
if (res.data.code === 200){
|
||||
alert("围栏编辑成功!")
|
||||
this.$router.push("/views/car/fence")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue