Commit d2b1994c authored by forevertyler's avatar forevertyler

fix:表格

parent d4031d51
......@@ -5,7 +5,7 @@ VUE_APP_LOCAL_PORT = '8059'
VUE_APP_WS_API = 'ws://localhost:8000'
VUE_APP_BASE_API = 'http://192.168.2.15:8059'
VUE_APP_LOCAL_API = 'http://192.168.2.37:9005'
VUE_APP_LOCAL_API = 'http://192.168.2.37:9015'
VUE_APP_D3Tileset = 'http://192.168.2.15:8080/Apps/assets/media/rushanruibo'
VUE_APP_SYS_PORT = '8060'
......
var ServiceURL = 'http://192.168.2.37:9005';
var ServiceURL = 'http://192.168.10.11:9005';
// var ServiceURL = 'http://192.168.2.37:9005';
window.VUE_APP_API = {ServiceURL:ServiceURL}
File added
......@@ -374,7 +374,7 @@ var Highchart = function(){
//series = addAlarmLine(data.alarm, data.lists, series, opts.warningLine);
// 识别最大值
var maxVal = chartData && chartData.maxVal > alarmData.maxAlarm ? chartData.maxVal : alarmData.maxAlarm;
// var maxVal = chartData && chartData.maxVal > alarmData.maxAlarm ? chartData.maxVal : alarmData.maxAlarm;
var option = {
chart: {
type: data.chartType,
......@@ -428,7 +428,7 @@ var Highchart = function(){
gridLineColor:'#0F5680',
//minorGridLineWidth: 5,
//gridLineWidth: 5,
max:opts.maxValDev ? maxVal + maxVal * opts.maxValDev : null,
// max:opts.maxValDev ? maxVal + maxVal * opts.maxValDev : null,
},
plotOptions: {
column: {
......
......@@ -675,6 +675,7 @@ export default {
}
});
});
},
methods: {
showPersonInfo(description) {
......@@ -689,7 +690,7 @@ export default {
this.viewer.infoBox.viewModel.showInfo = true;
},
module0(m, t, f, dmIndex, view){ // 数据总览
console.log(m,t,f,dmIndex,'数据总览')
// console.log(m,t,f,dmIndex,'数据总览')
var self = this, Catch = {}, viewData = self['view'+dmIndex];
var mediaUrlHost = process.env.VUE_APP_liveQing;
......@@ -893,81 +894,83 @@ export default {
return res.body || []
});
};
// 批次号管理(每次定时器触发时生成一个新的批次号)
let currentBatch = 0;
const batchMap = {};
// 创建人员定位卡模型
m.createPersonModel = function() {
// 人员列表
m.personCardList().then(function(list) {
console.log(list, 'list');
m.bgEntities = m.bgEntities || {};
for (var item of list) {
var lng = Number(item.lng);
var lat = Number(item.lat);
var height = Number(item.hight);
var position = Cesium.Cartesian3.fromDegrees(lng, lat, height);
console.log(lng, lat, height)
var url = "/static/images/poi-marker-default.png";
// 创建人员标记
var entity = self.viewer.entities.add({
position: position,
// 'model': {
// 'uri': url,
// 'scale': 1.01,
// 'shadows':'ENABLED',
// 'color':Cesium.Color.WHEAT,
// //'colorBlendMode':'HIGHLIGHT',
// //'colorBlendAmount':0.1,
// //'lightColor':Cesium.Color.RED,
// },
// ellipse: {
// semiMinorAxis: 40.0,
// semiMajorAxis: 60.0,
// material: url
// },
label: {
text: item.perNme,
font: 'normal 28px sans-serif',
scale: 0.5,
color: Cesium.Color.WHITE,
showBackground: true,
heightReference: 0,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10.0, 8000.0),
disableDepthTestDistance: 2500.0,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, // 确保贴地显示
pixelOffset: new Cesium.Cartesian2(0, -35),
// eyeOffset: new Cesium.Cartesian2(0, 5.5),
fillColor: Cesium.Color.WHITE,
backgroundColor: new Cesium.Color(0.0, 0.486, 0.650, .8),
},
billboard: {
image: '/static/images/poi-marker-default.png', // 使用头像作为标记
scale: .5,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, // 确保贴地显示
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10.0, 8000.0),
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
// pixelOffset: new Cesium.Cartesian2(0, 0), // 确保没有像素偏移
// eyeOffset: new Cesium.Cartesian2(0, 5.5), // 确保没有视角偏移
},
description: `
<div>
<h4>${item.perNme}</h4>
</div>
`,
});
entity.info = item;
m.bgEntities[item.perNme] = entity;
// 保存interval ID以便后续清除
if (!m.personModelInterval) {
m.personModelInterval = setInterval(() => {
currentBatch++; // 每次定时器触发,生成新的批次号
// console.log(m.bgEntities, '(m.bgEntities)');
// 清除旧实体(只清除当前批次的实体)
if (m.bgEntities) {
for (let key in m.bgEntities) {
if (m.bgEntities.hasOwnProperty(key)) {
const entity = m.bgEntities[key];
// 检查实体是否属于当前批次
if (entity.batch === currentBatch - 1) {
self.viewer.entities.remove(entity);
delete m.bgEntities[key];
}
}
}
}
m.personCardList().then(function(list) {
// console.log(list, 'list');
let perList = list; // 使用全部人员数据
// 创建新实体
for (let item of perList) {
let lng = Number(item.lng);
let lat = Number(item.lat);
let height = Number(item.hight);
let position = Cesium.Cartesian3.fromDegrees(lng, lat, height);
let url = "/static/images/poi-marker-default.png";
let entity = self.viewer.entities.add({
position: position,
label: {
text: item.perName,
font: 'normal 28px sans-serif',
scale: 0.5,
color: Cesium.Color.WHITE,
showBackground: true,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10.0, 8000.0),
disableDepthTestDistance: 2500.0,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
pixelOffset: new Cesium.Cartesian2(0, -35),
fillColor: Cesium.Color.WHITE,
backgroundColor: new Cesium.Color(0.0, 0.486, 0.650, 0.8),
},
billboard: {
image: url,
scale: 0.5,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10.0, 8000.0),
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
},
description: `<div><h4>${item.perName}</h4></div>`,
});
entity.info = item;
entity.batch = currentBatch; // 标记当前批次
m.bgEntities[item.perName] = entity; // 存储新实体
}
});
}, 10000);
}
});
};
// 更新人员定位卡模型监测数据
m.updatePersonModelData = function(){
m.personCardList().then(function(list){
for(var item of list){
console.log(item)
// var entity = m.bgEntities[item.equipno];
// entity && (entity.info = item);
// var modelColor = modelAlarmOptons[item.isAlarm];
......@@ -986,31 +989,19 @@ export default {
m.personCardList = function(){
return reqApi.common.requstEdge('get', '/api/per/screen/real', {}).then((res)=>{
var listPersonCard = res.body || [];
console.log(listPersonCard,'listPersonCard')
return listPersonCard;
});
};
// 添加人员定位卡窗口内容
m.updatePersonWindowContent = function(md, item){
console.log(md, item,'md, item')
// 设置按钮颜色
// if(item.isAlarm){
// md.Wrap.classList.add('alarm');
// }else{
// md.Wrap.classList.remove('alarm');
// };
// 设置数值
// var val1Name = md.type === '6' ? '降雨量' : 'x';
// var part1 = '<p>'+item.equipname+'</p><p>'+val1Name+': '+item.x+'</p>';
// var part2 = item.y ? '<p>y: '+item.y+'</p>' + '<p>z: '+item.z+'</p>' : '';
// md.el.innerHTML = '<div style="margin:5px;">' +part1+ part2 + '</div>';
// console.log(md, item,'md, item')
};
// 打开人员定位卡驱动窗口
t.openPersonWindow = function(entity){
var info = entity.info;
console.log(info,'!!!!!!!!')
// console.log(info,'!!!!!!!!')
if(info && !entity.infoWindow){
var position = entity.position._value;
......@@ -1033,6 +1024,7 @@ export default {
container:document.createElement('div'), // id || Element对象
html:'<div class="'+popClass+'" style="color:#fff;width:150px;font-size:15px;padding:10px;"></div>',
onload: function(md){
// console.log(md,'md')
var equipno = info.equipno;
md.type = info.devicetype;
if(equipno){
......@@ -1176,8 +1168,8 @@ export default {
}else{
md.Wrap.classList.remove('alarm');
};
if(item.perNme){
var part1 = '<p>姓名:'+item.perNme+'</p>'
if(item.perName){
var part1 = '<p>姓名:'+item.perName+'</p>'
var part2 = '<p>性别:'+item.perSex+'</p>';
var part3 = '<p>工号:'+item.perNumber+'</p>';
var part4 = '<p>部门:'+item.perDept+'</p>';
......@@ -1199,7 +1191,6 @@ export default {
// 打开驱动窗口
t.openDeviceWindow = function(entity){
var info = entity.info;
console.log(entity,'?????????')
if(info && !entity.infoWindow&& info.equipname){
var position = entity.position._value;
......@@ -1241,12 +1232,12 @@ export default {
};
},
});
}else if(info && !entity.infoWindow&&info.perNme){
console.log(1111)
}else if(info && !entity.infoWindow&&info.perName){
var position = entity.position._value;
var popClass = info.isAlarm ? 'popupBgImage BgAlarm' : 'popupBgImage';
// 生成窗口
var popWindow = m['popWindow' + info.perNme] = qf.UI.popWindow({
var popWindow = m['popWindow' + info.perName] = qf.UI.popWindow({
name:'',
pointer:{
point:'bottom',
......@@ -1257,14 +1248,14 @@ export default {
close: function(){
entity.infoWindow.remove();
delete entity.infoWindow;
delete m['popWindow' + info.perNme];
delete m['popWindow' + info.perName];
},
container:document.createElement('div'), // id || Element对象
html:'<div class="'+popClass+'" style="color:#fff;width:150px;font-size:15px;padding:10px;"></div>',
onload: function(md){
var perNme = info.perNme;
var perName = info.perName;
md.perDept = info.perDept;
if(perNme){
if(perName){
m.updateWindowContent(md, info);
entity.md = md;
......@@ -1314,16 +1305,20 @@ export default {
pointFormat: '<div>{seriesData.name}</div><b>在线:{point.y}人</b><br/>{point.category}'
},
xAxis: {
categories: series.categories,
// categories: series.categories,
categories: ['2025-02-15','2025-02-16','2025-02-17','2025-02-18','2025-02-19','2025-02-20','2025-02-21','2025-02-22','2025-02-23','2025-02-24','2025-02-25','2025-02-26','2025-02-27',],
},
yAxis: {
title: {
text: null
}
},
max: 100,
// startOnTick: false, // 防止自动调整到刻度开始
// endOnTick: false // 防止自动调整到刻度结束
},
series: [
{
data:series.data
data:[16,16,16,16,16,16,16,16,16,16,16,16,16]
}
],
},
......@@ -1526,6 +1521,8 @@ export default {
m.timer01(function(){
m.updateModelData();
m.updatePersonModelData()
}); m.timer01.start();
......@@ -2140,6 +2137,7 @@ export default {
};
};
(m.init = function(){
// 设置视角
//m.openVisual()
......@@ -2212,6 +2210,7 @@ export default {
};
},
mounted: function(viewer){
var self = this
this.viewer = that.viewer = viewer;
......@@ -2221,7 +2220,7 @@ export default {
// 去除版权信息
viewer._cesiumWidget._creditContainer.style.display = "none";
var path = process.env.VUE_APP_D3Tileset + '/tileset.json';
console.log('path', path)
// console.log('path', path)
var localTile = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: path,
//maximumScreenSpaceError:1,
......@@ -2308,6 +2307,29 @@ export default {
self.removeWidget();
},
};
// 新增点击事件监听
const handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
handler.setInputAction((movement) => {
this.pickPosition(movement.position);
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
},
pickPosition(position) {
const scene = this.viewer.scene;
const pickedObject = scene.pick(position);
if (Cesium.defined(pickedObject) && pickedObject.primitive instanceof Cesium.Cesium3DTileset) {
const ray = this.viewer.camera.getPickRay(position);
const cartesian = scene.globe.pick(ray, scene);
if (Cesium.defined(cartesian)) {
const cartographic = Cesium.Cartographic.fromCartesian(cartesian);
const longitude = Cesium.Math.toDegrees(cartographic.longitude);
const latitude = Cesium.Math.toDegrees(cartographic.latitude);
const height = cartographic.height;
console.log(`拾取的坐标点:经度 ${longitude}, 纬度 ${latitude}, 高度 ${height}`);
}
}
},
setView: function(viewer){
viewer.camera.setView({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment