修改电子围栏

master
夜笙歌 2 years ago
parent 66485002d0
commit ecc536bc74

@ -1,7 +1,7 @@
<template>
<div class="indexBg" style="background-repeat: no-repeat;background-size: 100% 100%">
<el-container>
<el-aside style="background-color: rgba(0,0,0,0.3);padding-bottom: 0;" width="350px">
<el-aside style="background-color: rgba(0,0,0,0.3);margin-bottom: 0;" width="350px">
<div id="carCharts" style="height:150px;width:150px;display: inline-block;margin-top: 20px"/>
<div
style="width: 150px;display: inline-block;vertical-align: top;color:#fff;text-align: center;margin-top: 20px">
@ -110,7 +110,7 @@
</div>
</el-footer>
</el-container>
<el-aside style="background-color: rgba(0,0,0,0.3);overflow: auto;height:80vh" width="350px">
<el-aside style="background-color: rgba(0,0,0,0.3);overflow: auto;margin-bottom: 0;height: calc(100vh - 84px)" width="350px">
<div v-for="i in 60" style="position:relative;color:#fff;height: 120px;">
<img src="../assets/icons/highTemperature.png"
style="width: 40px;height: 40px;position: absolute;top: 10px;left: 0px">
@ -638,6 +638,13 @@ export default {
},
],
})
},
getErrInfo(){
if( typeof(WebSocket) != "function" ) {
alert("您的浏览器不支持Websocket通信协议")
return
}
}
}
}

@ -8,10 +8,11 @@
</el-form-item>
<el-form-item label="选择车辆" prop="internationalization8">
<el-cascader
v-model="form.carId"
:options="options"
:props="{ multiple: true, checkStrictly: true,value:'id',label:'title',children:'baseCarList', }"
:props="{ multiple: true, value:'id',label:'title',children:'baseCarList', }"
clearable
@change="cascaderChange"></el-cascader>
@change="cascaderChange" />
</el-form-item>
<el-form-item label="第一轴高气压阀值" prop="z1PressureHigh;">
<el-input-number v-model="form.z1PressureHigh" :min="0" :step="5"/>
@ -71,6 +72,7 @@ const form = ref({
zPressureHigh: 0,
zPressureLow: 0,
temperatureHigh: 0,
carId:null,
time: parseTime(new Date()),
})
const setDisabled = (arr) => {
@ -84,10 +86,11 @@ const setDisabled = (arr) => {
listBaseCar().then(e => {
let res = JSON.stringify(e.rows)
let newObj = JSON.parse(res.replace(/"carLicense":/g, '"title":'))
setDisabled(newObj)
// setDisabled(newObj)
options.value = newObj
})
const cascaderChange = (e) => {
console.log(e)
let lastIds = ids.value || []
let nowIds = e.map(val => val.at(-1))
let nowClick = nowIds.filter(val => !(lastIds.includes(val)))?.[0]
@ -133,4 +136,16 @@ const handleQuery = (e) => {
proxy.$modal.msgSuccess("操作成功");
})
}
const resetQuery = () => {
form.value = {
z1PressureHigh: 0,
z1PressureLow: 0,
zPressureHigh: 0,
zPressureLow: 0,
temperatureHigh: 0,
carId:null,
time: parseTime(new Date()),
}
ids.value=[]
}
</script>

@ -24,6 +24,7 @@
<el-form-item label=" ">
<el-button icon="Search" type="primary" @click="handleQuery">{{ t('option.search') }}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ t('option.reset') }}</el-button>
<el-button icon="Refresh" @click="getLine"></el-button>
</el-form-item>
</el-form>
@ -44,10 +45,9 @@ const queryParams = ref({})
let map = null
let polyline = null
let passedPolyline = null
let mouseTool = null
let path = [[116.390969, 39.911592], [116.391496, 39.909008], [116.389264, 39.909765], [116.38802, 39.911016]]
let path2 = [[116.400969, 39.921592], [116.401496, 39.919008], [116.399264, 39.919765], [116.39802, 39.921016]]
const areaPath = ref([path,path2])
let marketPath = [116.390669, 39.911147]
AMapLoader.load({
key: "ba8fb8d8bae1b280b93406d5959d492f", // WebKey load
@ -75,7 +75,7 @@ AMapLoader.load({
marker.setLabel({
direction: 'top',
offset: new AMap.Pixel(0, -10), //
content: "" + AMap.GeometryUtil.isPointInRing(marketPath,path),
content: "" + AMap.GeometryUtil.isPointInRing(marketPath,path,path2),
});
marker.setMap(map);
@ -91,8 +91,8 @@ AMapLoader.load({
//
map.addControl(new AMap.MapType());
let polygon = new AMap.Polygon({path: path});
areaPath.value.forEach( (e,index)=> {
let polygon = new AMap.Polygon({path: e});
map.add([polygon]);
let polyEditor = new AMap.PolygonEditor(map);
polyEditor.addAdsorbPolygons([polygon]);
@ -103,20 +103,35 @@ AMapLoader.load({
})
polyEditor.on('addnode', function (data) {
//
console.log(polyEditor.getTarget()._opts.path)
areaPath.value[index] = polyEditor.getTarget()._opts.path
})
polyEditor.on('adjust', function (data) {
//
console.log(polyEditor.getTarget()._opts.path)
areaPath.value[index] = polyEditor.getTarget()._opts.path
})
polyEditor.setTarget(polygon);
polyEditor.open();
// map.setFitView();
})
}).catch(e => {
console.log(e);
})
const getLine = () => {
let list = areaPath.value
let params = []
list.forEach((e,index)=>{
e.forEach(val => {
params.push({
longitude:val[0],
latitude:val[1],
index:index
})
})
})
console.log(params)
}
</script>
<style>
#container4 {

Loading…
Cancel
Save