fase()坐标获取
parent
73fd29b308
commit
f1fe1a348a
|
@ -34,9 +34,3 @@ export function getSel(data) {
|
|||
})
|
||||
}
|
||||
|
||||
export function setSel(r) {
|
||||
return request({
|
||||
url: '/rule/map/setSel?r=' + r,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -143,9 +143,6 @@
|
|||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
@click="querys(scope.row.carId)"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
@ -283,11 +280,6 @@ export default {
|
|||
bulk() {
|
||||
alert("信息已发送,等待处理")
|
||||
},
|
||||
querys(carId){
|
||||
query(carId).then(res => {
|
||||
console.log(res.data)
|
||||
})
|
||||
},
|
||||
fence(carId) {
|
||||
this.$router.push({path: '/client/sever/fence',query:{carId:carId}})
|
||||
},
|
||||
|
|
|
@ -1,21 +1,26 @@
|
|||
<template>
|
||||
<div>
|
||||
{{fenceGroups.groupsName}}下属围栏
|
||||
<el-button type="text" @click="add(fenceGroups.groupsId)">增加围栏</el-button>
|
||||
<el-table :data="fenceGroups.fenceList">
|
||||
<el-table-column prop="fenceName" label="围栏名称"></el-table-column>
|
||||
<el-table-column prop="fenceType" label="围栏类型"></el-table-column>
|
||||
<el-table-column prop="radius" label="半径"></el-table-column>
|
||||
<el-table-column prop="eventType" label="驶入驶出"></el-table-column>
|
||||
<el-table-column prop="eventType" label="驶入驶出">
|
||||
<span slot-scope="scope">
|
||||
<span v-if="scope.row.eventType === 'Y'">驶入</span>
|
||||
<span v-if="scope.row.eventType === 'N'">驶出</span>
|
||||
</span>
|
||||
</el-table-column>
|
||||
<el-table-column prop="staut" label="围栏状态">
|
||||
<span slot-scope="scope">
|
||||
<span v-if="scope.row.staut == 0">启用</span>
|
||||
<span v-if="scope.row.staut == -1">禁止</span>
|
||||
<span v-if="scope.row.staut === 'Y'">启用</span>
|
||||
<span v-if="scope.row.staut === 'N'">禁止</span>
|
||||
</span>
|
||||
</el-table-column>
|
||||
<el-table-column prop="polygonPoints" label="坐标"></el-table-column>
|
||||
<el-table-column label="增加围栏">
|
||||
<el-table-column label="删除">
|
||||
<span slot-scope="scope">
|
||||
<el-button type="text" @click="add(scope.row.groupId)">增加围栏</el-button>
|
||||
<el-button type="text">删除</el-button>
|
||||
</span>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -49,8 +54,9 @@ export default {
|
|||
console.log(res.data)
|
||||
})
|
||||
},
|
||||
add(groupId) {
|
||||
this.$router.push({path:'/client/sever/map',groupId:groupId})
|
||||
add(groupsId) {
|
||||
alert(groupsId)
|
||||
this.$router.push({path:'/client/sever/map',query:{groupsId:groupsId}})
|
||||
}
|
||||
},
|
||||
// 生命周期 - 创建完成(可以访问当前this实例)",
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getSel, setSel } from "@/api/goods/map";
|
||||
import { getSel } from "@/api/goods/map";
|
||||
// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||
// 例如:import 《组件名称》 from '《组件路径》,
|
||||
export default {
|
||||
|
@ -21,10 +21,14 @@ export default {
|
|||
data() {
|
||||
// 这里存放数据"
|
||||
return {
|
||||
groupId: this.$route.query.groupId,
|
||||
groupsId: this.$route.query.groupsId,
|
||||
path: [], //当前绘制多边形经纬度数组
|
||||
polygonItem: [], // 地图上绘制所有的多边形对象
|
||||
polyEditors: [] //所有编辑对象的数组
|
||||
polyEditors: [], //所有编辑对象的数组
|
||||
pences:{
|
||||
groupsId: this.$route.query.groupsId,
|
||||
list: []
|
||||
} //传输
|
||||
}
|
||||
},
|
||||
// 计算属性 类似于data概念",
|
||||
|
@ -33,14 +37,17 @@ export default {
|
|||
watch: {},
|
||||
// 方法集合",
|
||||
methods: {
|
||||
sel() {
|
||||
sel() {// 获取坐标传输给电子围栏
|
||||
const jsonData = JSON.stringify(this.polygonItem[0].w.path)
|
||||
console.log(jsonData)
|
||||
const jsonPare = JSON.parse(jsonData)
|
||||
jsonPare.forEach(res => {
|
||||
console.log(res)
|
||||
// console.log(res)
|
||||
})
|
||||
getSel(jsonPare).then(res => {
|
||||
this.pences.list = this.polygonItem[0].w.path;
|
||||
console.log(this.groupsId)
|
||||
console.log(this.groupsId)
|
||||
console.log(this.$route)
|
||||
getSel(this.pences).then(res => {
|
||||
console.log(res.data)
|
||||
})
|
||||
},
|
||||
|
@ -51,7 +58,7 @@ export default {
|
|||
//TODO 创建控件并添加
|
||||
});
|
||||
this.map = new this.AMap.Map("amapContainer", {
|
||||
center: [116.434381, 39.898515],
|
||||
center: [116.409753, 39.921925],
|
||||
zoom: 14,
|
||||
mapStyle: "amap://styles/darkblue",
|
||||
pitch: 80,
|
||||
|
|
Loading…
Reference in New Issue