修改编辑围栏

master
ZhiShuo_Lou 2023-11-22 19:09:02 +08:00
parent e896639631
commit e2b38a140f
3 changed files with 13 additions and 9 deletions

View File

@ -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
})

View File

@ -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>

View File

@ -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")
}
})
},