This commit is contained in:
shijing 2022-08-31 14:54:53 +07:00
parent 8c8eeeda69
commit 9ea3cb58a9
5 changed files with 184 additions and 216 deletions

1
public/img/sound.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1661834700150" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8645" width="48" height="48" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 539.89a113.27 113.27 0 1 0 113.27 113.27A113.4 113.4 0 0 0 512 539.89z" fill="#1d7ef3" p-id="8646"></path><path d="M755.57 19H268.14a61.78 61.78 0 0 0-61.78 61.78v861.44a61.78 61.78 0 0 0 61.78 61.78h487.43a61.78 61.78 0 0 0 61.78-61.78V80.78A61.78 61.78 0 0 0 755.57 19zM512 218.12a51.49 51.49 0 1 1-51.49 51.49A51.49 51.49 0 0 1 512 218.12z m0 610.1c-96.53 0-175.06-78.53-175.06-175.06S415.47 478.11 512 478.11s175.06 78.53 175.06 175.06S608.53 828.22 512 828.22z" fill="#1d7ef3" p-id="8647"></path></svg>

After

Width:  |  Height:  |  Size: 843 B

View File

@ -42,6 +42,7 @@ export default {
isSaveing: false,
coordinates: {
floorNo: 'Floor1',
floorId: 1,
railName: '',
railType: 1,//1:0
mapType: 1,//2xy1
@ -81,14 +82,9 @@ export default {
imageryProvider: jsmap.JSImageryProviderType.IMAGE_TDT,
backgroundColor: '#3798ff', //
viewOptions: {
//
center: { x: 114.63059258861512, y: 38.81407163905287, z: 1 },
// center: {x:120,y:30,z:10},
//m
distance: 400,
// °
rotate: 0,
//°
tilt: 45,
}
});
@ -106,6 +102,7 @@ export default {
console.log('add', feature);
console.log(feature.properties);//type:POLYGON;id:"";name:"";floorNo:"";floorId:""
console.log(feature.geometry);//feature.geometry.coordinates:[[],[]]
this.coordinates.floorId = feature.properties.floorId;
this.coordinates.floorNo = feature.properties.floorNo == '室外' ? 'Floor1' : feature.properties.floorNo;
// this.coordinates.floorId = feature.properties.floorId;
that.points = feature.geometry.coordinates[0];
@ -125,7 +122,6 @@ export default {
});
window.map.addControl(drawTool2);
if (that.areaPoints.length > 2) {
debugger;
that.areaMarkerLayers();
}
});
@ -146,7 +142,9 @@ export default {
closeDrawer() {
this.$emit('closed');
},
//
areaMarkerLayers() {
debugger;
let that = this;
let areaPoints = [];
that.areaPoints.forEach(item => {
@ -161,7 +159,6 @@ export default {
color: 'rgba(0,0,255,.44)',//
strokeColor: 'rgba(0,0,255,.44)',//线
depthTest: false,//
// material: new jsmap.JSWaterMaterial(),
allowPicking: true,
displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),
properties: {
@ -177,24 +174,15 @@ export default {
submit() {
let that = this;
let pointXY = [];
console.log(that.points)
// let tool = new jsmap.JSMapCoordTool(window.map);
// let coordinate = { x: 114.63059258861512, y: 38.81407163905287 };
// let pixel = tool.mapToScreenCoordinate(coordinate);
debugger;
let points = that.points;
if (points.length > 2) {
that.isSaveing = true;
that.coordinates.color = 'rgba(255,0,0,.4)';
points.forEach(item => {
let pixel = { x: parseFloat(item[0]), y: parseFloat(item[1]) };
// let zuobiao = tool.screenToMapCoordinate(pixel);
// console.log(zuobiao)
pointXY.push(pixel);
});
that.coordinates.polygon.points = pointXY;
// that.coordinates.polygon.points = points;
that.$API.am.area.bindRail.req(that.areaId, that.coordinates)
.then(res => {
that.isSaveing = false;

View File

@ -95,6 +95,8 @@ export default {
},
methods: {
handlePosition(row) {
debugger;
console.log(row)
this.channelId = row.my_info.id ? row.my_info.id : null;
this.channelArea = row.my_info.area ? row.my_info.area : '';
this.channelAreas = row.my_info.areas ? row.my_info.areas : [];

View File

@ -154,8 +154,10 @@ export default {
console.log(feature.properties);//type:POINT;id:"";name:"";floorNo:"";floorId:""
console.log(feature.geometry);//type:POINT;coordinates:[114.63028499839209,38.81195080123784,0]
let floorNo = feature.properties.floorNo=='室外'?'Floor1':feature.properties.floorNo;
let floorId = feature.properties.floorId;
this.form.location = feature.geometry.coordinates;
this.form.location.push(floorNo);
this.form.location.push(floorId);
},
//
removeCallback: (feature) => {
@ -190,7 +192,7 @@ export default {
submit() {
let that = this;
let item = this.form.location;
that.form.location = { x: item[0], y: item[1], z: item[2] ,floorNo:item[3]};
that.form.location = { x: item[0], y: item[1], z: item[2] ,floorNo:item[3],floorId:item[4]};
that.$API.am.tdevice.labelLocation.req(that.channelId, that.form)
.then(res => {
that.isSaveing = false;

View File

@ -22,26 +22,22 @@
</div>
<div class="screen-check-content hoverPointer" @click="markerClick(1)">
<span class="box-btn box-uncheck" :class="{ 'box-check': markList[1] }"></span>
<span class="box-text">车间名称</span>
<span class="box-text">摄像头</span>
</div>
<div class="screen-check-content hoverPointer" @click="markerClick(2)">
<span class="box-btn box-uncheck" :class="{ 'box-check': markList[2] }"></span>
<span class="box-text">摄像头</span>
<span class="box-text">喇叭</span>
</div>
<div class="screen-check-content hoverPointer" @click="markerClick(3)">
<span class="box-btn box-uncheck" :class="{ 'box-check': markList[3] }"></span>
<span class="box-text">喇叭</span>
<span class="box-text">危险作业</span>
</div>
<div class="screen-check-content hoverPointer" @click="markerClick(4)">
<span class="box-btn box-uncheck" :class="{ 'box-check': markList[4] }"></span>
<span class="box-text">危险作业</span>
<span class="box-text">风险区域</span>
</div>
<div class="screen-check-content hoverPointer" @click="markerClick(5)">
<span class="box-btn box-uncheck" :class="{ 'box-check': markList[5] }"></span>
<span class="box-text">风险区域</span>
</div>
<div class="screen-check-content hoverPointer" @click="markerClick(6)">
<span class="box-btn box-uncheck" :class="{ 'box-check': markList[6] }"></span>
<span class="box-text">人员</span>
</div>
<div class="caret-dropdown">
@ -762,7 +758,7 @@ export default {
dropIndex: '1',
countIndex: '2',
areaShowType: '1',
markList: [false, false, false, false, false, false, false],
markList: [false, false, false, false, false, false],
autoRun: false,
tracking: false,
areaDetail: false,
@ -820,7 +816,7 @@ export default {
data: {
channelId: "",
streamType: "2",
type: "flv"
type: "flv",
}
},
code: 'video_realtime'
@ -858,12 +854,13 @@ export default {
document.head.appendChild(scriptInfo)
},
mounted() {
let that = this;
let date = new Date();
this.timeNow = date.getDay();
this.todayDate = this.warningData.params.start_create = this.cateAggForm.start_create = this.$TOOL.dateFormat(new Date(), 'yyyy-MM-dd');
this.showTime();
that.timeNow = date.getDay();
that.todayDate = this.warningData.params.start_create = this.cateAggForm.start_create = this.$TOOL.dateFormat(new Date(), 'yyyy-MM-dd');
that.showTime();
setInterval(() => {
this.showTime();
that.showTime();
}, 1000);
window.map = new jsmap.JSMap({
mapType: jsmap.JSMapType.MAP_3D,
@ -871,7 +868,7 @@ export default {
mapServerURL: 'data/map',
enableShadows: false, // false
enableLighting: false, // false
showBuildingMarker: false,
showBuildingMarker: true,
// showNavigationDisplay: true,
mapScaleLevelRange: [16, 23],// 1623,[1,24]
floorControlOptions: {
@ -898,28 +895,28 @@ export default {
});
window.map.openMapById('0000');
window.map.on('loadComplete', e => {
this.riskMaskerLayers();//
this.userMaskerLayers();//
this.cameraMaskerLayers();//
this.domMarkerLayers();//
this.polygonMarkerLayers();//
this.speakersMaskerLayers();//
this.jobDomMarkerLayers();//
this.areaMarkerLayers();//
that.riskMaskerLayers();//
that.userMaskerLayers();//
that.cameraMaskerLayers();//
that.domMarkerLayers();//
that.polygonMarkerLayers();//
that.speakersMaskerLayers();//
that.jobDomMarkerLayers();//
that.areaMarkerLayers();//
let compassControl = new jsmap.JSCompassControl({
position: jsmap.JSControlPosition.LEFT_TOP,
offset: {
x: 450,
y: 70
x: 420,
y: 50
}
});
window.map.addControl(compassControl);
let zoomControl = new jsmap.JSZoomControl({
position: jsmap.JSControlPosition.LEFT_TOP,
offset: {
x: 480,
y: 60
x: 450,
y: 5
}
});
window.map.addControl(zoomControl);
@ -1006,7 +1003,7 @@ export default {
//
that.screenUserItem = item.properties.get("employee");
that.screenUser = true;
debugger;
// debugger;
window.map.flyToMarker(that.userMarker[that.screenUserItem.mac], {
duration: 1000
})
@ -1025,14 +1022,10 @@ export default {
//
this.getManCount();//$$
this.getWarnings();//$$
this.getAreas();///$$
// this.getAreas();///$$
this.getGroup();//$$
//
// this.getVchannels();//$$
this.getDangers();//$$
// this.getRisks();//$$
this.getSpeakers();//$$
// this.getAllMen();//
this.getAllPost();//
this.getWarningTotal();//
this.getWarningType();//
@ -1140,17 +1133,7 @@ export default {
this.countIndex = index;
this.getManCount();
},
//
getSpeakers() {
let that = this;
that.$API.am.tdevice.speaker.req().then(res => {
if (res.err_msg) {
that.$message.error(res.err_msg);
} else {
that.speakerList = res.rows;
}
});
},
//
getDangers() {
let that = this;
@ -1169,7 +1152,7 @@ export default {
if (res.err_msg) {
} else {
that.areaList = res.results;
that.showRiskMarkers();
that.showRiskMarkers(res.results);
}
})
},
@ -1194,7 +1177,7 @@ export default {
this.$API.ecm.event.list.req(this.warningData.params).then(res => {
if (res.err_msg) {
} else {
debugger;
// debugger;
this.warningData.list = res.results.filter(item => {
return item.handle_user === null;
});
@ -1204,7 +1187,7 @@ export default {
},
//
warningTypeSelected(id) {
debugger;
// debugger;
let that = this;
this.warningTypeShow = false;
let params = new Object();
@ -1274,8 +1257,6 @@ export default {
show: false
});
window.map.addLayer(that.cameraMaskerLayer);
debugger;
console.log(that.cameraMaskerLayer);
that.getVchannels();
},
//
@ -1328,7 +1309,8 @@ export default {
show: false
});
window.map.addLayer(that.materialsMaskerLayer);
this.showSpeakersMarkers();
//
this.getSpeakers();
},
//Layer
polygonMarkerLayers() {//
@ -1342,118 +1324,127 @@ export default {
that.showPolygonMarkers();
},
//
showRiskMarkers() {
showRiskMarkers(list) {
let that = this;
console.log(that.areaList);
// debugger;
that.areaList.forEach(item => {
// debugger
let pointsList = [], floorId = null;
if (item.third_info.xx_rail!==null&&item.third_info.xx_rail!==undefined) {
floorId = item.third_info.xx_rail.detail.floorId;
let points = item.third_info.xx_rail.detail.polygon.points;
pointsList = points.map(item => {
let obj = item;
obj.z = 0;
return obj
});
// debugger;
console.log(pointsList);
let boxMarker = new jsmap.JSBoxMarker({
id: item.id,
position: pointsList,
floorId: floorId,//id
color: 'rgba(255,0,0,0.44)',//
height: 0,//
stretchHeight: 6,//
strokeColor: '#ff0000',//线
show: true, //
// depthTest: Boolean,
allowPicking: true, //
displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),//
callback: (marker) => {
// console.log(marker);
if(list.length>0){
list.forEach(item => {
let boxMarker = null;
let pointsList = [], floorId = null;
if (item.third_info.xx_rail!==null&&item.third_info.xx_rail!==undefined) {
floorId = item.third_info.xx_rail.detail.floorId;
let points = item.third_info.xx_rail.detail.polygon.points;
pointsList = points.map(item => {
let obj = item;
obj.z = 0;
return obj
});
let maskColor = '',strokeColor='';
if(item.level===10){
maskColor = 'rgba(0,0,255,.44)';//
strokeColor = '#0000ff';
}else if(item.level===20){
maskColor = 'rgba(255,255,0,0.44)';//
strokeColor = '#ffff00';
}else if(item.level===30){
maskColor = 'rgba(255,153,0,0.44)';//
strokeColor = '#ff9900';
}else if(item.level===40){
maskColor = 'rgba(255,0,0,0.44)';//
strokeColor = '#ff0000';
}
});
that.riskMarkerLayer.addMarker(boxMarker);
}
})
boxMarker = new jsmap.JSBoxMarker({
id: item.id,
position: pointsList,
floorId: floorId,//id
color: maskColor,//
height: 0,//
stretchHeight: 25,//
strokeColor: strokeColor,//线
show: true, //
allowPicking: true, //
displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),//
var boxMarker1 = new jsmap.JSBoxMarker({
id: 'box',
position: [
{ x: 114.6284236353879, y: 38.81587979561416, z: 0 },
{ x: 114.62920209224112, y: 38.81519905830823, z: 0 },
{ x: 114.63022009284202, y: 38.81594033572247, z: 0 },
{ x: 114.62938229018444, y: 38.81656925374177, z: 0 },
],
floorId: 1,//id
color: 'rgba(134,255,78,0.44)',//
height: 0,//
stretchHeight: 20,//
strokeColor: '#87FF4F',//线
show: true, //
depthTest: Boolean,
allowPicking: true, //
displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),//
callback: (marker) => {
// console.log(marker);
}
});
this.riskMarkerLayer.addMarker(boxMarker1);
});
// debugger;
console.log(that.riskMarkerLayer);
that.riskMarkerLayer.addMarker(boxMarker);
}
})
}
},
/*showPointMarkers() {
let pointMarker = new jsmap.JSPointMarker({
id: 'point1',
color: '#00FF00', //
size: 10, //
position: new jsmap.JSPoint(114.6318495165543, 38.81301151091491, 3), //
floorId: 1, //id,1
outlineColor: '#CD5C5C', //线
outlineWidth: 2, //线
// depthTest: true, //
show: true, //
allowPicking: true, //
displayCondition: new jsmap.JSDisplayCondition(0.0, 1000), //
nearFarScale: new jsmap.JSNearFarScale(0.0, 10.0, 500, 0.5), //
callback: (node) => {
// console.log(node);
}//
});
this.pointMarkerLayer.addMarker(pointMarker);
},*/
//
showCameraMarkers(list) {
debugger;
let that = this;
if(list.length>0){
list.forEach(item => {
let cameraMarker = null;
let pixel = item.my_info.location;
if(pixel.x){
cameraMarker = new jsmap.JSIconTextMarker({
id: item.channelCode,
position: { x: pixel.x, y: pixel.y, z: pixel.z }, //
floorId: pixel.floorId, //id,1
image: "/img/camera.svg",
text: item.channelName,
font: 'lighter 12px serif',
fontColor: '#ffffff',
imageHeight: 25,
imageWidth: 25,
backgroundColor: 'rgba(0,0,0,0.3)',
backgroundRadius: 1,
backgroundStrokeColor: 'rgba(0,0,0,0.3)',
backgroundStrokeWidth: 1,
iconTextType: jsmap.JSIconTextType.TOPTEXT_BOTTOMICON,
allowPicking: true,
displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),
nearFarScale: new jsmap.JSNearFarScale(0.0, 1, 500, 1),
show: true,
callback: () => {
}
});
debugger;
console.log(that.cameraMaskerLayer)
that.cameraMaskerLayer.addMarker(cameraMarker);
}
})
}
},
//
showSpeakersMarkers(list) {
let that = this;
list.forEach(item => {
let cameraMarker = null;
// debugger;
console.log(item)
let materialMarker = null;
let pixel = item.my_info.location;
cameraMarker = new jsmap.JSIconTextMarker({
id: item.channelCode,
position: { x: pixel.x, y: pixel.y, z: pixel.z }, //
floorId: 1, //id,1
image: "/img/camera.svg",
text: '摄像头',
font: '10px sans-serif',
fontColor: '#ffffff',
imageHeight: 25,
imageWidth: 25,
backgroundColor: 'rgba(0,0,0,0.3)',
backgroundRadius: 1,
backgroundStrokeColor: 'rgba(0,0,0,0.3)',
backgroundStrokeWidth: 1,
iconTextType: jsmap.JSIconTextType.TOPTEXT_BOTTOMICON,
allowPicking: true,
displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),
nearFarScale: new jsmap.JSNearFarScale(0.0, 1, 500, 1),
show: true,
callback: () => {
}
});
debugger;
console.log(that.cameraMaskerLayer);
that.cameraMaskerLayer.addMarker(cameraMarker);
materialMarker = new jsmap.JSIconTextMarker({
id: item.id,
position: {x: pixel.x, y: pixel.y, z: pixel.z}, //
floorId: pixel.floorId, //id,1
image: "/img/sound.svg",
text: item.name,
font: '10px sans-serif',
fontColor: '#ffffff',
imageHeight: 25,
imageWidth: 25,
// fontStrokeColor: '#1f0fdd',
fontStrokeWidth: 1,
backgroundColor: 'rgba(0,0,0,0.3)',
backgroundRadius: 1,
backgroundStrokeColor: 'rgba(0,0,0,0.3)',
backgroundStrokeWidth: 1,
iconTextType: jsmap.JSIconTextType.TOPTEXT_BOTTOMICON,
allowPicking: false,
displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),
nearFarScale: new jsmap.JSNearFarScale(0.0, 1, 500, 1),
show: true
});
this.materialsMaskerLayer.addMarker(materialMarker);
})
},
//
showUserMarkers(userList) {
@ -1566,7 +1557,7 @@ export default {
if (bool !== false) arr.push(arr1[bool]);
}
let arrList = [arr, list];
debugger;
// debugger;
console.log(arrList);
return arrList;
},
@ -1619,32 +1610,7 @@ export default {
});
this.jobDomMarkerLayer.addMarker(domMarker);
},
//
showSpeakersMarkers() {
let materialMarker = new jsmap.JSIconTextMarker({
id: 'iconTextMarker',
position: { x: 114.6302317964304, y: 38.81315596674133 }, //
floorId: 1, //id,1
image: "/img/speaker.png",
text: '喇叭1',
font: '10px sans-serif',
fontColor: '#ffffff',
imageHeight: 25,
imageWidth: 25,
// fontStrokeColor: '#1f0fdd',
fontStrokeWidth: 1,
backgroundColor: 'rgba(0,0,0,0.3)',
backgroundRadius: 1,
backgroundStrokeColor: 'rgba(0,0,0,0.3)',
backgroundStrokeWidth: 1,
iconTextType: jsmap.JSIconTextType.TOPTEXT_BOTTOMICON,
allowPicking: false,
displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),
nearFarScale: new jsmap.JSNearFarScale(0.0, 1, 500, 1),
show: true
});
this.materialsMaskerLayer.addMarker(materialMarker);
},
//
userSelect() {
this.showUserSelect = !this.showUserSelect
@ -1707,34 +1673,34 @@ export default {
that.markList[0] = false;
}
}
// if (that.markList[1]) {
// window.map.showBuildingMarker = true;
// } else {
// window.map.showBuildingMarker = false;
// }
if (that.markList[1]) {
window.map.showBuildingMarker = true;
} else {
window.map.showBuildingMarker = false;
}
if (that.markList[2]) {
that.cameraMaskerLayer.show = true;
} else {
that.cameraMaskerLayer.show = false;
}
if (that.markList[3]) {
if (that.markList[2]) {
that.materialsMaskerLayer.show = true;
} else {
that.materialsMaskerLayer.show = false;
}
if (that.markList[4]) {
if (that.markList[3]) {
that.jobDomMarkerLayer.show = true;
that.polygonMaskerLayer.show = true;
} else {
that.jobDomMarkerLayer.show = false;
that.polygonMaskerLayer.show = false;
}
if (that.markList[5]) {
if (that.markList[4]) {
that.riskMarkerLayer.show = true;
} else {
that.riskMarkerLayer.show = false;
}
if (that.markList[6]) {
if (that.markList[5]) {
that.userMaskerLayer.show = true;
} else {
that.userMaskerLayer.show = false;
@ -1743,15 +1709,28 @@ export default {
//
getVchannels() {
let that = this;
this.$API.am.video.list.req(that.params).then(res => {
debugger;
that.$API.am.tdevice.vchannel.req({pageSize:999}).then(res => {
if (res.err_msg) {
this.$message.error(res.err_msg);
that.$message.error(res.err_msg);
} else {
that.Vchannels = res.pageData;
that.showCameraMarkers(res.pageData);
}
});
},
//
getSpeakers() {
let that = this;
that.$API.am.tdevice.speaker.req().then(res => {
if (res.err_msg) {
that.$message.error(res.err_msg);
} else {
that.speakerList = res.rows;
that.showSpeakersMarkers(res.rows);
}
});
},
//
warningItemShow(item) {
this.screenJob = false;
@ -1790,7 +1769,7 @@ export default {
},
//
userRowClick(row) {
debugger;
// debugger;
console.log(row);
let that = this;
that.screenUserItem.name = row.my_info.employee_.name;
@ -2471,11 +2450,9 @@ export default {
padding: 0 20px 20px;
position: absolute;
background: rgba(24, 36, 51, .7);
.basic-head {
position: relative;
margin-bottom: 16px;
.header-tab {
width: 160px;
}
@ -2483,7 +2460,6 @@ export default {
.basic-info {
min-height: 400px;
.info-item {
font-size: 14px;
height: 30px;
@ -2769,7 +2745,7 @@ export default {
border-radius: 20px;
.filter-ctrl {
width: 610px;
width: 520px;
height: 40px;
display: flex;
align-items: center;
@ -2798,7 +2774,8 @@ export default {
border-radius: 4px;
transition: .5s;
z-index: 10;
max-height: 50vh;
overflow-y: scroll;
.drop-content-item {
color: #fff;
position: relative;
@ -3096,15 +3073,13 @@ export default {
.alarm-detail-info {
position: absolute;
left: 445px;
left: 480px;
top: -73px;
width: 390px;
background: rgba(24, 36, 51, .7);
border-radius: 4px;
padding: 0 12px 0 12px;
z-index: 20;
/*min-height: 400px;*/
.action-group {
display: flex;
align-items: center;