diff --git a/js/index.js b/js/index.js
index 329fb0b..cfa9f3f 100644
--- a/js/index.js
+++ b/js/index.js
@@ -2,6 +2,9 @@
// var ajaxUrl = 'http://192.168.99.67:7070'
var ajaxUrl = 'http://192.168.1.100:7070'
+var storeroomId = 'D6490DA3D4261E8C26D0E3'
+var currentIndex = 0
+
//获取当前时间
var timer = null
timer = setInterval(() => {
@@ -17,7 +20,37 @@ var swiper = new Swiper('.swiper-container', {
el: '.swiper-pagination', // 分页器容器
clickable: true, // 点击分页器切换
bulletClass : 'my-bullet',//需设置.my-bullet样式
- },
+ }
+});
+
+swiper.on('slideChange', function () {
+ currentIndex = swiper.activeIndex;
+ if (currentIndex === 0) {
+ $('.banner-top-name').html('5F 全景图')
+ storeroomId = 'D6490DA3D4261E8C26D0E3'
+ FetchInitDisplayconfig()
+ } else if (currentIndex === 1) {
+ $('.banner-top-name').html('5F 档案库')
+ storeroomId = 'D6490DA3D4261E8C26D0E3'
+ } else if (currentIndex === 2) {
+ $('.banner-top-name').html('5F 整理室')
+ storeroomId = 'D6490DA3D4261E8C26D0E3'
+ } else if (currentIndex === 3) {
+ $('.banner-top-name').html('5F 阅览室')
+ storeroomId = 'D6490DA3D4261E8C26D0E3'
+ } else if (currentIndex === 4) {
+ $('.banner-top-name').html('7F 全景图')
+ storeroomId = '1B2DADD8499058954C0CAC'
+ FetchInitDisplayconfig()
+ } else if (currentIndex === 5) {
+ $('.banner-top-name').html('7F 现行文件室 / 信息技术室')
+ storeroomId = '1B2DADD8499058954C0CAC'
+ FetchInitDisplayconfig()
+ } else if (currentIndex === 6) {
+ $('.banner-top-name').html('7F 待销文件室')
+ storeroomId = 'D4C395BFB0A2E7C96C65A0'
+ FetchInitDisplayconfig()
+ }
});
var echartsTimer = null
@@ -27,7 +60,6 @@ echartsTimer = setInterval(() => {
FetchArchivesNum()
FetchFileAnjuanNum()
FetchDevice()
- FetchInitDisplayconfig()
}, 1000 * 30)
FetchArchivesNum()
@@ -40,7 +72,6 @@ FetchAlarmInfo()
var allDisplayConfigData;
var allDeviceIds = [];
-var allDeviceIds = [];
var displayConfigData;
var url;
var topDisplayData = {
@@ -79,6 +110,80 @@ var topDisplayData = {
curValue: '',
unit: '',
curstatus: 0
+ },
+ // 7F 现行文件室 / 信息技术室
+ DXW_DIV_TOP_001: {
+ show: false,
+ curValue: '',
+ unit: '',
+ curstatus: 0
+ },
+ DXW_DIV_TOP_002: {
+ show: false,
+ curValue: '',
+ unit: '',
+ curstatus: 0
+ },
+ DXW_DIV_TOP_003: {
+ show: false,
+ curValue: '',
+ unit: '',
+ curstatus: 0
+ },
+ DXW_DIV_TOP_004: {
+ show: false,
+ curValue: '',
+ unit: '',
+ curstatus: 0
+ },
+ DXW_DIV_TOP_005: {
+ show: false,
+ curValue: '',
+ unit: '',
+ curstatus: 0
+ },
+ DXW_DIV_TOP_006: {
+ show: false,
+ curValue: '',
+ unit: '',
+ curstatus: 0
+ },
+ // 7F 待销文件室
+ XXW_DIV_TOP_001: {
+ show: false,
+ curValue: '',
+ unit: '',
+ curstatus: 0
+ },
+ XXW_DIV_TOP_002: {
+ show: false,
+ curValue: '',
+ unit: '',
+ curstatus: 0
+ },
+ XXW_DIV_TOP_003: {
+ show: false,
+ curValue: '',
+ unit: '',
+ curstatus: 0
+ },
+ XXW_DIV_TOP_004: {
+ show: false,
+ curValue: '',
+ unit: '',
+ curstatus: 0
+ },
+ XXW_DIV_TOP_005: {
+ show: false,
+ curValue: '',
+ unit: '',
+ curstatus: 0
+ },
+ XXW_DIV_TOP_006: {
+ show: false,
+ curValue: '',
+ unit: '',
+ curstatus: 0
}
}
var waterLeakage = {
@@ -95,20 +200,33 @@ function FetchInitDisplayconfig() {
url: ajaxUrl + '/api/displayconfig/list',
type: 'GET',
data: {
- storeroomId: 'D6490DA3D4261E8C26D0E3'
+ storeroomId: storeroomId
},
success: function (res) {
if (res.code === 200) {
allDisplayConfigData = res.data
- allDisplayConfigData.forEach(item => {
- if (item.isDisplay && item.bindState && item.deviceInfo && (item.divPosition.includes('OAO') || item.divPosition.includes('TOP') || item.divPosition.includes('LS'))) {
- allDeviceIds.push(item.deviceInfo.deviceId)
- if (!url) {
- url = 'http://' + item.deviceInfo.deviceIp + ':' + item.deviceInfo.devicePort
+ allDeviceIds = []
+ if (currentIndex == 4 || currentIndex == 5 || currentIndex == 6) {
+ allDisplayConfigData.forEach(item => {
+ if (item.isDisplay && item.bindState && item.deviceInfo && (item.divPosition.includes('OAO') || item.divPosition.includes('TOP'))) {
+ allDeviceIds.push(item.deviceInfo.deviceId)
+ if (!url) {
+ url = 'http://' + item.deviceInfo.deviceIp + ':' + item.deviceInfo.devicePort
+ }
+ }
+ })
+ displayConfigData = allDisplayConfigData.filter((item) => { return item.isDisplay && item.bindState && item.deviceInfo && (item.divPosition.includes('OAO') || item.divPosition.includes('TOP')) })
+ } else {
+ allDisplayConfigData.forEach(item => {
+ if (item.isDisplay && item.bindState && item.deviceInfo && (item.divPosition.includes('OAO') || item.divPosition.includes('TOP') || item.divPosition.includes('LS'))) {
+ allDeviceIds.push(item.deviceInfo.deviceId)
+ if (!url) {
+ url = 'http://' + item.deviceInfo.deviceIp + ':' + item.deviceInfo.devicePort
+ }
}
- }
- })
- displayConfigData = allDisplayConfigData.filter((item) => { return item.isDisplay && item.bindState && item.deviceInfo && (item.divPosition.includes('OAO') || item.divPosition.includes('TOP') || item.divPosition.includes('LS')) })
+ })
+ displayConfigData = allDisplayConfigData.filter((item) => { return item.isDisplay && item.bindState && item.deviceInfo && (item.divPosition.includes('OAO') || item.divPosition.includes('TOP') || item.divPosition.includes('LS')) })
+ }
getRealTimeData()
}
},
@@ -145,49 +263,109 @@ function getRealTimeData() {
unit: result.unit,
curstatus: result.curstatus
};
+ if(currentIndex == 0 || currentIndex == 1 || currentIndex == 2 || currentIndex == 3){
+ var str = '
'
+ +''
+ +' '
+ +'
'+topDisplayData.DAK_DIV_TOP_003.curValue+''
+ +'
CO2 '+topDisplayData.DAK_DIV_TOP_003.unit +'
'
+ +'
'
+ +''
+ +'
'
+ +''
+ +''
+ +'
'+topDisplayData.DAK_DIV_TOP_004.curValue+''
+ +'
VOC '+topDisplayData.DAK_DIV_TOP_004.unit+'
'
+ +'
'
+ +''
+ +'
'
+ +' '
+ +''
+ +'
'+topDisplayData.DAK_DIV_TOP_005.curValue+''
+ +'
PM2.5 '+topDisplayData.DAK_DIV_TOP_005.unit+'
'
+ +'
'
+ +' '
+ +'
'
+ +''
+ +' '
+ +'
'+topDisplayData.DAK_DIV_TOP_006.curValue+''
+ +'
PM10 '+topDisplayData.DAK_DIV_TOP_006.unit+'
'
+ +'
'
+ +''
+ }else if(currentIndex == 4 || currentIndex == 5){
+ var str = '
'
+ +''
+ +' '
+ +'
'+topDisplayData.DXW_DIV_TOP_003.curValue+''
+ +'
CO2 '+topDisplayData.DXW_DIV_TOP_003.unit +'
'
+ +'
'
+ +''
+ +'
'
+ +''
+ +''
+ +'
'+topDisplayData.DXW_DIV_TOP_004.curValue+''
+ +'
VOC '+topDisplayData.DXW_DIV_TOP_004.unit+'
'
+ +'
'
+ +''
+ +'
'
+ +' '
+ +''
+ +'
'+topDisplayData.DXW_DIV_TOP_005.curValue+''
+ +'
PM2.5 '+topDisplayData.DXW_DIV_TOP_005.unit+'
'
+ +'
'
+ +' '
+ +'
'
+ +''
+ +' '
+ +'
'+topDisplayData.DXW_DIV_TOP_006.curValue+''
+ +'
PM10 '+topDisplayData.DXW_DIV_TOP_006.unit+'
'
+ +'
'
+ +''
+ }else if(currentIndex == 6){
+ var str = '
'
+ +''
+ +' '
+ +'
'+topDisplayData.XXW_DIV_TOP_003.curValue+''
+ +'
CO2 '+topDisplayData.XXW_DIV_TOP_003.unit +'
'
+ +'
'
+ +''
+ +'
'
+ +''
+ +''
+ +'
'+topDisplayData.XXW_DIV_TOP_004.curValue+''
+ +'
VOC '+topDisplayData.XXW_DIV_TOP_004.unit+'
'
+ +'
'
+ +''
+ +'
'
+ +' '
+ +''
+ +'
'+topDisplayData.XXW_DIV_TOP_005.curValue+''
+ +'
PM2.5 '+topDisplayData.XXW_DIV_TOP_005.unit+'
'
+ +'
'
+ +' '
+ +'
'
+ +''
+ +' '
+ +'
'+topDisplayData.XXW_DIV_TOP_006.curValue+''
+ +'
PM10 '+topDisplayData.XXW_DIV_TOP_006.unit+'
'
+ +'
'
+ +''
+ }
- var str = '
'
- +''
- +' '
- +'
'+topDisplayData.DAK_DIV_TOP_003.curValue+''
- +'
CO2 '+topDisplayData.DAK_DIV_TOP_003.unit +'
'
- +'
'
- +''
- +'
'
- +''
- +''
- +'
'+topDisplayData.DAK_DIV_TOP_004.curValue+''
- +'
VOC '+topDisplayData.DAK_DIV_TOP_004.unit+'
'
- +'
'
- +''
- +'
'
- +' '
- +''
- +'
'+topDisplayData.DAK_DIV_TOP_005.curValue+''
- +'
PM2.5 '+topDisplayData.DAK_DIV_TOP_005.unit+'
'
- +'
'
- +' '
- +'
'
- +''
- +' '
- +'
'+topDisplayData.DAK_DIV_TOP_006.curValue+''
- +'
PM10 '+topDisplayData.DAK_DIV_TOP_006.unit+'
'
- +'
'
- +''
$('.left-top-env').html(str)
- if(topDisplayData.DAK_DIV_TOP_003.curstatus > 0){
+ if(topDisplayData.DAK_DIV_TOP_003.curstatus > 0 || topDisplayData.DXW_DIV_TOP_003.curstatus > 0 || topDisplayData.XXW_DIV_TOP_003.curstatus > 0){
$('.top003').addClass('li-warn');
}
- if(topDisplayData.DAK_DIV_TOP_004.curstatus > 0){
+ if(topDisplayData.DAK_DIV_TOP_004.curstatus > 0 || topDisplayData.DXW_DIV_TOP_004.curstatus > 0 || topDisplayData.XXW_DIV_TOP_004.curstatus > 0){
$('.top004').addClass('li-warn');
}
- if(topDisplayData.DAK_DIV_TOP_005.curstatus > 0){
+ if(topDisplayData.DAK_DIV_TOP_005.curstatus > 0 || topDisplayData.DXW_DIV_TOP_005.curstatus > 0 || topDisplayData.XXW_DIV_TOP_005.curstatus > 0){
$('.top005').addClass('li-warn');
}
- if(topDisplayData.DAK_DIV_TOP_006.curstatus > 0){
+ if(topDisplayData.DAK_DIV_TOP_006.curstatus > 0 || topDisplayData.DXW_DIV_TOP_006.curstatus > 0 || topDisplayData.XXW_DIV_TOP_006.curstatus > 0){
$('.top006').addClass('li-warn');
}
-
+ if(currentIndex == 0 || currentIndex == 1 || currentIndex == 2 || currentIndex == 3 ){
var strMiddle = '
'
+''
+''
@@ -202,11 +380,43 @@ function getRealTimeData() {
+'
湿度 '+topDisplayData.DAK_DIV_TOP_002.unit+'
'
+'
'
+''
+ }else if(currentIndex == 4 || currentIndex == 5){
+ var strMiddle = '
'
+ +''
+ +''
+ +'
'+topDisplayData.XXW_DIV_TOP_001.curValue+''
+ +'
温度 '+topDisplayData.XXW_DIV_TOP_001.unit+'
'
+ +'
'
+ +''
+ +'
'
+ +''
+ +''
+ +'
'+topDisplayData.XXW_DIV_TOP_002.curValue+''
+ +'
湿度 '+topDisplayData.XXW_DIV_TOP_002.unit+'
'
+ +'
'
+ +''
+ }else if(currentIndex == 6){
+ var strMiddle = '
'
+ +''
+ +''
+ +'
'+topDisplayData.DXW_DIV_TOP_001.curValue+''
+ +'
温度 '+topDisplayData.DXW_DIV_TOP_001.unit+'
'
+ +'
'
+ +''
+ +'
'
+ +''
+ +''
+ +'
'+topDisplayData.DXW_DIV_TOP_002.curValue+''
+ +'
湿度 '+topDisplayData.DXW_DIV_TOP_002.unit+'
'
+ +'
'
+ +''
+ }
+
$('.middle-env').html(strMiddle)
- if(topDisplayData.DAK_DIV_TOP_001.curstatus > 0){
+ if(topDisplayData.DAK_DIV_TOP_001.curstatus > 0 || topDisplayData.XXW_DIV_TOP_001.curstatus > 0 || topDisplayData.DXW_DIV_TOP_001.curstatus > 0){
$('.top001').addClass('li-warn');
}
- if(topDisplayData.DAK_DIV_TOP_002.curstatus > 0){
+ if(topDisplayData.DAK_DIV_TOP_002.curstatus > 0 || topDisplayData.XXW_DIV_TOP_002.curstatus > 0 || topDisplayData.DXW_DIV_TOP_002.curstatus > 0){
$('.top002').addClass('li-warn');
}
} else {
@@ -401,7 +611,7 @@ function addTableRefScroll (bodyWrapper, table, displayNum) {
function FetchInitSecurityDoorLog () {
$.ajax({
- url: ajaxUrl + '/api/securitydoor/initSecurityDoorLog',
+ url: ajaxUrl + '/api/securitydoor/initSecurityDoorLog1',
type: 'GET',
data: {
page: 0,
@@ -414,7 +624,11 @@ function FetchInitSecurityDoorLog () {
tableData.splice(0, result.length, ...result)
for (var i = 0; i < result.length; i++) {
var tempHtml;
- tempHtml += "
" + parseTime(result[i].createTime) + " | " + result[i].roomName + " | " + result[i].alarmMsg + " |
";
+ if(result[i].inOrOut == 0){
+ tempHtml += "
" + parseTime(result[i].createTime) + " | " + result[i].doorName + " | " + result[i].userName + "_进门_"+ result[i].action +" |
";
+ }else{
+ tempHtml += "
" + parseTime(result[i].createTime) + " | " + result[i].doorName + " | " + result[i].userName + "_出门_"+ result[i].action +" |
";
+ }
$("#fTbody").append(tempHtml);
}
tableRefScroll()