Commit fc90dac9 authored by forevertyler's avatar forevertyler

fix:大屏

parent d2b1994c
......@@ -4,7 +4,7 @@ ENV = 'development'
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.3.60:12113'
VUE_APP_LOCAL_API = 'http://192.168.2.37:9015'
VUE_APP_D3Tileset = 'http://192.168.2.15:8080/Apps/assets/media/rushanruibo'
......
......@@ -5,8 +5,14 @@ ENV = 'production'
# 如果接口是 http 形式, wss 需要改为 ws
# ------------------------
# VUE_APP_BASE_API = 'http://192.168.3.60:12113'
# VUE_APP_LOCAL_API = 'http://192.168.3.60:12112'
# VUE_APP_D3Tileset = 'http://192.168.3.60:12113/3dtile'
VUE_APP_BASE_API = 'http://192.168.10.11:5003'
VUE_APP_LOCAL_API = 'http://192.168.10.11:9005'
VUE_APP_D3Tileset = 'http://192.168.10.11:5003/3dtile'
VUE_APP_SYS_PORT = '8060'
#VUE_APP_liveQing = 'http://192.168.10.11:5003'
var ServiceURL = 'http://192.168.10.11:9005';
// var ServiceURL = 'http://192.168.3.60:12112';
// var ServiceURL = 'http://192.168.2.37:9005';
window.VUE_APP_API = {ServiceURL:ServiceURL}
File deleted
import request from '@/utils/request'
export function percarcount(params) {
return request({
url: 'tab/datascreen/percarcount',
method: 'get',
params
})
}
......@@ -377,10 +377,11 @@ import { CoordTransform } from '@/assets/js/CoordTransform.js';
import { getToken, setToken, removeToken } from '@/utils/auth';
import { encrypt } from '@/utils/rsaEncrypt';
import { openAlarm, closeAlarm } from '@/api/alarmEquCtrl.js';
import { percarcount } from '@/api/newApi'
export default {
data() {
return {
timerRef:null,
navActive:null,
view0:{
//产量总览
......@@ -457,6 +458,7 @@ export default {
finishNum:706,
monitorNum:40,
areaSwitchFalg:false,
percarcountList:[],
personnelList:[
{
longitude: 121.70710830038986,
......@@ -481,6 +483,8 @@ export default {
mounted() {
var that = this;
this.$nextTick(() => {
this.setRefreshTimer();
this.getPerCardCount()
var views = that.$el.querySelectorAll("#b0_>div");
var a0a_ = that.$el.querySelector("#a0a_");
......@@ -678,6 +682,28 @@ export default {
},
methods: {
setRefreshTimer() {
// 设置定时器,30分钟后刷新页面
this.timer = setTimeout(() => {
this.refreshPage();
}, 30 * 60 * 1000);
},
clearRefreshTimer() {
// 清除定时器
if (this.timer) {
clearTimeout(this.timer);
this.timer = null;
}
},
refreshPage() {
// 刷新页面
window.location.reload();
},
getPerCardCount(){
percarcount().then(res => {
this.percarcountList = res.body
})
},
showPersonInfo(description) {
// 使用 Cesium 的 InfoBox 显示信息
this.viewer.selectedEntity = this.viewer.entities.add({
......@@ -688,6 +714,7 @@ export default {
this.viewer.infoBox.frame.contentDocument.write(description);
this.viewer.infoBox.frame.contentDocument.close();
this.viewer.infoBox.viewModel.showInfo = true;
this.viewer.scene.globe.depthTestAgainstTerrain = true;
},
module0(m, t, f, dmIndex, view){ // 数据总览
// console.log(m,t,f,dmIndex,'数据总览')
......@@ -898,42 +925,53 @@ export default {
let currentBatch = 0;
const batchMap = {};
// 创建人员定位卡模型
// 创建定位人员卡模型
m.createPersonModel = function() {
// 保存interval ID以便后续清除
if (!m.personModelInterval) {
m.personModelInterval = setInterval(() => {
currentBatch++; // 每次定时器触发,生成新的批次号
// console.log(m.bgEntities, '(m.bgEntities)');
// 清除旧实体(只清除当前批次的实体)
if (m.bgEntities) {
for (let key in m.bgEntities) {
console.log(isNaN(parseFloat(key)),'key')
if (m.bgEntities.hasOwnProperty(key)) {
const entity = m.bgEntities[key];
// 检查实体是否属于当前批次
if (entity.batch === currentBatch - 1) {
// if (entity.batch === currentBatch - 1) {
// 检查 entity.info 是否包含 perName
// if (entity.info && Object.keys(entity.info).includes('perName'))
if(isNaN(parseFloat(key))) {
self.viewer.entities.remove(entity);
console.log(m.bgEntities,m.bgEntities[key], '(mEntities.bg)');
delete m.bgEntities[key];
}
// }
}
}
}
m.personCardList().then(function(list) {
// console.log(list, 'list');
let perList = list; // 使用全部人员数据
// let perList = [{lng:'121.70710830038986',lat:'36.854636402927986',hight:20,perName:'aaa',},{lng:'121.70710830038986',lat:'36.853636402927986',hight:30,perName:'bbb',}]
// 创建新实体
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);
console.log(position,'position')
let url = "/static/images/poi-marker-default.png";
let entity = self.viewer.entities.add({
position: position,
// fixedFrame: fixedFrame,
label: {
text: item.perName,
font: 'normal 28px sans-serif',
......@@ -942,24 +980,29 @@ export default {
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,
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(1.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),
disableDepthTestDistance:5,
heightReference:Cesium.HeightReference.CLAMP_TO_GROUND
},
billboard: {
image: url,
scale: 0.5,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10.0, 8000.0),
disableDepthTestDistance:5,
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(1.0, 8000.0),
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
},
description: `<div><h4>${item.perName}</h4></div>`,
fixedFrame: Cesium.Transforms.eastNorthUpToFixedFrame(position),
// heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
});
entity.info = item;
entity.info = item; // 添加 info 属性
entity.batch = currentBatch; // 标记当前批次
m.bgEntities[item.perName] = entity; // 存储新实体
}
......@@ -1277,10 +1320,13 @@ export default {
// 人员
m.percarCount = function(){
reqApi.common.requstEdge('get', '/tab/datascreen/percarcount', {time:'week'}).then((res)=>{
reqApi.common.requstEdge('get', '/tab/datascreen/percarcount', ).then((res)=>{
var body = res.body || {};
console.log(body,'??????')
var xData = body.xData;
var yData = body.yData;
var colors = [Highchart.getRandomColor(0), Highchart.getRandomColor(2), "#38f1f3"];
var series = Highchart.formatSeriesList(body.lists, {value:'values.person', categoriesKye:'dateUnit', colors:colors, serie:{name:'人员统计'}});
// var series = Highchart.formatSeriesList(body.lists, {value:'values.person', categoriesKye:'dateUnit', colors:colors, serie:{name:'人员统计'}});
var options2 = {
chartConfig:{
......@@ -1306,7 +1352,7 @@ export default {
},
xAxis: {
// 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',],
categories: xData,
},
yAxis: {
title: {
......@@ -1318,7 +1364,7 @@ export default {
},
series: [
{
data:[16,16,16,16,16,16,16,16,16,16,16,16,16]
data:yData
}
],
},
......@@ -1330,37 +1376,37 @@ export default {
};
// 报警弹窗-可变形
m.createAlarmView = function(){
m.createAlarmView = function() {
let that = this;
var checkHtml = '';
var list = [{areaCode:1, name:'1111'}];
for(var item of list){
checkHtml += '<div><input type="checkbox" data-type="list" value="'+item.areaCode+'"/>'+item.name+'dfgdfg</div>';
var list = [{ areaCode: 1, name: '1111' }];
for (var item of list) {
checkHtml += '<div><input type="checkbox" data-type="list" value="' + item.areaCode + '"/>' + item.name + 'dfgdfg</div>';
};
return qf.UI.popWindow({
name:'morphView1',
container:self.$el, // id || Element对象
className:'morph1',
html:'<div class="morphView"></div>',
show:false,
onload: function(o){
name: 'morphView1',
container: self.$el, // id || Element对象
className: 'morph1',
html: '<div class="morphView"></div>',
show: false,
onload: function(o) {
var el = o.el, wrap = o.Wrap, morphView = wrap.firstElementChild;
o.setStyle(wrap, {
bottom:'0.3rem', left:'50%', height:0, width:0, zIndex:1,
transformOrigin:'0px 0px',
justifyContent:'center',
bottom: '0.3rem', left: '50%', height: 0, width: 0, zIndex: 1,
transformOrigin: '0px 0px',
justifyContent: 'center',
});
// 数据绑定
Object.defineProperty(o, 'shrink', {
set: function(f){
if(f){
set: function(f) {
if (f) {
morphView.classList.add('f-prepare');
morphView.classList.add('f-shrink');
morphView.classList.remove('f-anim-revert');
}else{
} else {
morphView.classList.add('f-anim-revert');
setTimeout(() => {
morphView.classList.remove('f-shrink');
......@@ -1379,7 +1425,6 @@ export default {
<i class="el-icon-circle-close"></i>
</div>
<div class="el-icon-bell"></div>
`;
var content = el.firstElementChild;
......@@ -1402,66 +1447,75 @@ export default {
optBtnWrapper.appendChild(startAlarmBtn);
optBtnWrapper.appendChild(stopAlarmBtn);
o.updateList = function(list){
o.updateList = function(list) {
var dds = '';
for(var item of list){
for (var item of list) {
var state = item.state === 1 ? '报警中' : '已处理';
dds += '<dd><span>'+item.name+'</span><span class="red">'+state+'</span><span>'+item.time+'</span></dd>';
}; return o.scroll.innerHTML = dds, o.scroll
dds += '<dd><span>' + item.name + '</span><span class="red">' + state + '</span><span>' + item.time + '</span></dd>';
}
return o.scroll.innerHTML = dds, o.scroll;
};
// 事件
wrap.onclick = function(e){
wrap.onclick = function(e) {
var tag = e.target || e.srcElement;
if(tag.className === 'el-icon-circle-close'){
if (tag.className === 'el-icon-circle-close') {
o.shrink = true;
}else if(tag.className === 'el-icon-bell'){
optBtnWrapper.style.opacity = '0';
} else if (tag.className === 'el-icon-bell') {
o.shrink = false;
optBtnWrapper.style.opacity = '1';
};
};
startAlarmBtn.addEventListener('click', () => {
openAlarm().then(res=>{
res.body===200?new qf.UI.Notify({
openAlarm().then(res => {
res.body === 200 ? new qf.UI.Notify({
position: 'top',
zIndex:2050,
zIndex: 2050,
type: 'success',
duration: 3000,
autoOpen:true,
autoOpen: true,
message: res.body,
}):new qf.UI.Notify({
}) : new qf.UI.Notify({
position: 'top',
zIndex:2050,
zIndex: 2050,
type: 'warning',
duration: 3000,
autoOpen:true,
autoOpen: true,
message: res.body,
})
})
});
stopAlarmBtn.addEventListener('click', () => {
closeAlarm().then(res=>{
res.body===200?new qf.UI.Notify({
closeAlarm().then(res => {
res.body === 200 ? new qf.UI.Notify({
position: 'top',
zIndex:2050,
zIndex: 2050,
type: 'success',
duration: 3000,
autoOpen:true,
autoOpen: true,
message: res.body,
}):new qf.UI.Notify({
}) : new qf.UI.Notify({
position: 'top',
zIndex:2050,
zIndex: 2050,
type: 'warning',
duration: 3000,
autoOpen:true,
autoOpen: true,
message: res.body,
})
})
});
// 初次加载时触发 el-icon-circle-close 点击事件
const closeIcon = el.querySelector('.el-icon-circle-close');
if (closeIcon) {
closeIcon.click();
}
},
});
// 打开 filter
//t.morphView1.open();
// t.morphView1.open();
};
// unload
......@@ -2374,6 +2428,9 @@ export default {
});
},
},
beforeDestroy() {
this.clearRefreshTimer();
},
}
</script>
......
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