Commit fc90dac9 authored by forevertyler's avatar forevertyler

fix:大屏

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