From b72f8f8d58417eb6fb29672d8ac17cfafa46775c Mon Sep 17 00:00:00 2001
From: zhitong.yu <xynz17@163.com>
Date: 星期六, 11 五月 2024 10:51:31 +0800
Subject: [PATCH] 增加:主界面选择系统页面,统计实时刷新,低电量人员数据显示
---
src/main/webapp/Home/HomeJs/Home.js | 198 +++++++++++++++++++++++-------------------------
1 files changed, 95 insertions(+), 103 deletions(-)
diff --git a/src/main/webapp/Home/HomeJs/Home.js b/src/main/webapp/Home/HomeJs/Home.js
index 7e1cd81..f4eb50d 100644
--- a/src/main/webapp/Home/HomeJs/Home.js
+++ b/src/main/webapp/Home/HomeJs/Home.js
@@ -66,6 +66,9 @@
]]
});
+
+
+
table.render({
elem: '#fence'
,url: '/hxzkuwb/findfence'
@@ -99,6 +102,9 @@
});
+
+
+
table.render({
elem: '#person'
,url: '/hxzkuwb/findperson'
@@ -133,6 +139,20 @@
]]
});
+ table.render({
+ elem: '#PowerPerson'
+ ,url: '/hxzkuwb/findPowerPerson'
+ ,skin: 'nob'
+ ,height:300
+ ,limit: 5
+ ,page: true //寮�鍚垎椤�
+ ,cols: [[ //琛ㄥご
+ { field: 'tagid', title: '缂栧彿',width:100}
+ ,{field: 'name', title: '濮撳悕',width: 100}
+ ,{field: 'power', title: '鐢甸噺',width: 100,templet: '#titleTplPower'}
+ ]]
+ });
+
// $(".Tongji").click(function (){
@@ -175,38 +195,7 @@
- $.get("/hxzkuwb/findMapShow",function (data){
- $(".MapShow").append('<li style="width: 100px;display: inline-block"><a href="javascript:;" onClick="yckb()" style="width: 100px;display: inline-block;font-size: 12px;color: '+data[0].color+'" id="ykcbs">闅愯棌鐪嬫澘</a></li>')
- if(data[0].ishow == "鏄剧ず"){
- $(".MapShow").append('<li style="width: 100px;display: inline-block"><input type="checkbox" id="sanweis" onClick="Qh1()" style="position: relative;top: 2px"/><a href="javascript:;" class="ts1" style="font-size: 12px;color: '+data[0].color+'" onClick="Qh1()" id="qh1">涓夌淮鍦板浘</a></li>')
- $(".MapShow").append('<li onclick="xianshilixians()" style="width: 100px;display: inline-block"><input type="checkbox" id="xianshilixian" style="position: relative;top: 2px"/><a href="javascript:;" style="font-size: 12px;color: '+data[0].color+'">鏄剧ず绂荤嚎</a></li>')
- $(".MapShow").append('<li class="ctrls" style="width: 100px;display: inline-block"><a href="javascript:;" style="font-size: 12px;color: '+data[0].color+'" title="鎸変綇CTRL鎸夐敭鍙互鏃嬭浆鏀瑰彉鍦板浘瑙嗚">CTRL鏃嬭浆鍦板浘</a></li>')
- }else{
- }
- if(data[1].ishow == "鏄剧ず"){
- $(".MapShow").append('<li style="width: 100px;display: inline-block"><input type="checkbox" id="baidus" onClick="Qh()" style="position: relative;top: 2px"/><a href="javascript:;" class="ts1" style="font-size: 12px;color: '+data[0].color+'" onClick="Qh()" id="qh2">'+data[1].type+'</a></li>')
- $(".MapShow").append('<li class="qhWeiLan" style="display: inline-block;font-size: 12px;color: white;width: 100px;"><a onclick="qhweil()" id="weilanxs" style="color: '+data[0].color+'" href="javascript:;">闅愯棌鍥存爮</a></li>')
- $(".MapShow").append('<li onclick="xianshilixians()" style="width: 100px;display: inline-block"><input type="checkbox" id="xianshilixian" style="position: relative;top: 2px"/><a href="javascript:;" style="font-size: 12px;color: '+data[0].color+'">鏄剧ず绂荤嚎</a></li>')
- $(".MapShow").append('<li class="ctrls" style="width: 100px;display: inline-block"><a href="javascript:;" style="font-size: 12px;color: '+data[0].color+'" title="鎸変綇CTRL鎸夐敭鍙互鏃嬭浆鏀瑰彉鍦板浘瑙嗚">CTRL鏃嬭浆鍦板浘</a></li>')
- $(".MapShow").append('<li class="MapType" onclick="inits()" style="cursor: pointer;font-size: 12px;width: 100px;display: inline-block;color: '+data[0].color+'"><a href="javascript:;" style="font-size: 12px;cursor:pointer;color: '+data[0].color+'" title="">鍒囨崲绫诲瀷</a></li>')
- }else{
- // $("#ditu2").hide();
- Qh1();
- }
- // $(".MapShow").append('<li class="qhPingMian" style="font-size: 12px;width: 100px;display: inline-block"><select id="mySelect" onchange="TuCeng()" style="border: none;background: none;color: '+data[0].color+'"><option style="color: black">鍒囨崲鍥惧眰</option></select></li>')
- $(".qhPingMian").hide();
- // 鑾峰彇涓嬫媺妗嗙殑 DOM 鍏冪礌
- $.post("/hxzkuwb/qiehuanditu_option.do",function (data){
- if (data.length == 1){
- $(".qhPingMian").hide();
- }else{
- for (var i = 0 ; i < data.length;i++){
- var mapname = data[i].mapname.split('.')
- $("#mySelect").append('<option style="color: black" value="'+data[i].floor+'">'+mapname[0]+'</option>')
- }
- }
- })
- })
+
// $(".Ditu").click(function (){
// $(".MapShow").empty();
// layer.tips('鎿嶄綔鎴愬姛','.Ditu');
@@ -556,78 +545,42 @@
color: 'white'
}
},
- series: [{
- name: '缁熻',
- type: 'pie',
- radius: ['20%', '40%'],
- center: ['35%', '60%'],
- avoidLabelOverlap: false,
- itemStyle: {
- borderRadius: 10,
- },
- label: {
- show: false,
- position: 'center'
- },
- emphasis: {
- label: {
- show: true,
- fontSize: 20,
- fontWeight: 'bold'
- }
- },
- labelLine: {
- show: false
- },
- data: [
- { value: 0, name: '闈欐鎶ヨ 0' },
- { value: 0, name: 'SOS鎶ヨ 0' },
- { value: 0, name: '璺岃惤鎶ヨ 0' },
- { value: 0, name: '缂哄憳鎶ヨ 0' },
- { value: 0, name: '瓒呭憳鎶ヨ 0' },
- { value: 0, name: '鑱氶泦鎶ヨ 0' },
- { value: 0, name: '瓒婄晫鎶ヨ 0' },
- { value: 0, name: '杩涘叆鎶ヨ 0' },
- { value: 0, name: '浣庣數鎶ヨ 0' },
- { value: 0, name: '绂荤嚎鍩虹珯 0' },
- ]
- }],
- // 娣诲姞浜嬩欢鐩戝惉鍣�
- graphic: [
+ series: [
{
- type: 'group',
- left: 'center',
- top: 'center',
- children: [
- {
- type: 'text',
- z: 100,
- left: 'center',
- top: 'middle',
- style: {
- fill: '#fff',
- text: '',
- font: '14px Microsoft YaHei'
- },
- // 璁剧疆榧犳爣鎮仠浜嬩欢
- onmouseover: function (params) {
- var dataIndex = params.dataIndex;
- var name = option.series[0].data[dataIndex].name;
- // 鏇存柊鏂囧瓧棰滆壊
- this.setStyle('fill', '#46E9E8');
- console.log("Mouseover on:", name);
- },
- // 璁剧疆榧犳爣绉诲嚭浜嬩欢
- onmouseout: function (params) {
- // 鎭㈠榛樿鏂囧瓧棰滆壊
- this.setStyle('fill', '#fff');
- },
- onclick: function (params) {
- var dataIndex = params.dataIndex;
- var name = option.series[0].data[dataIndex].name;
- console.log("Clicked on:", name);
- }
+ name: '缁熻',
+ type: 'pie',
+ radius: ['20%', '40%'],
+ center: ['35%', '60%'],
+ avoidLabelOverlap: false,
+ itemStyle: {
+ borderRadius: 10,
+ },
+ label: {
+ show: false,
+ position: 'center'
+ },
+ emphasis: {
+ label: {
+ show: true,
+ fontSize: 20,
+ fontWeight: 'bold'
}
+ },
+ labelLine: {
+ show: false
+ },
+ data: [
+ { value: 0, name: '闈欐鎶ヨ 0' },
+ { value: 0, name: 'SOS鎶ヨ 0' },
+ { value: 0, name: '璺岃惤鎶ヨ 0' },
+ { value: 0, name: '缂哄憳鎶ヨ 0' },
+ { value: 0, name: '瓒呭憳鎶ヨ 0' },
+ { value: 0, name: '鑱氶泦鎶ヨ 0' },
+ { value: 0, name: '瓒婄晫鎶ヨ 0' },
+ { value: 0, name: '杩涘叆鎶ヨ 0' },
+ { value: 0, name: '浣庣數鎶ヨ 0' },
+ { value: 0, name: '绂荤嚎鍩虹珯 0' },
+
]
}
]
@@ -662,6 +615,10 @@
var username = $(".kahao").text();
var context = $("#context1").val();
var data = "username="+username1+"&context="+context+"&tagid="+username
+ if (context.length <2 || context.length >30){
+ layer.msg('褰撳墠杈撳叆鍐呭鏈夎锛屽瓧绗﹂暱搴︿笉鑳藉皬浜�2骞朵笖涓嶈兘澶т簬30')
+ return;
+ }
$.get("/hxzkuwb/sendMsg",data,function(data){
})
@@ -676,6 +633,16 @@
if(username == "" || username == null){
layer.msg("璇疯緭鍏ヨ澶嘔D")
}else{
+ if (username.length < 2){
+ layer.msg('褰撳墠杈撳叆鍐呭鏈夎锛屽瓧绗﹂暱搴︿笉鑳藉皬浜�2')
+ return
+ }
+
+ if (context.length <2 || context.length > 30){
+ layer.msg('褰撳墠杈撳叆鍐呭鏈夎锛屽瓧绗﹂暱搴︿笉鑳藉皬浜�2骞朵笖涓嶈兘澶т簬30')
+ return;
+ }
+
var dts = "username="+username1;
$.get("/hxzkuwb/findUserRole",dts,function (data){
if(data.juese=="璁垮"){
@@ -716,6 +683,10 @@
setInterval(function (){
+ if (localStorage.getItem("KuangXuan") != null && localStorage.getItem("KuangXuan1") == "true"){
+ $("#JianZhuMsg").empty();
+ KuangXuanPerson()
+ }
var SanWei = localStorage.getItem("SanWei_JianZhu")
if (SanWei != null){
$("#JianZhuMsg").animate({right: '-1%'}, 500);
@@ -757,7 +728,7 @@
$("#JianZhuMsg").append('<div style="margin-top: 15%;margin-bottom:5%;margin-left: 5%;width: 85%"><h2 style="margin-top: 0%;display: inline-block;;color: white;font-size: 14px" id="JzMc">'+Name+' 鍖哄煙绛夌骇锛�'+data.dangerlevel+'</h2><h2 style="margin-top: 0%;display: inline-block;float: right;color: white;font-size: 14px">鎬讳汉鏁帮細<span id="zongnumes"></span> <img onclick="GuanBiMsg()" src="../Home/HomeImg/clos.png" style="cursor:pointer;width: 20px;height: 20px;"></h2></div>')
for (var i = 1 ; i <= data.floornum; i++){
$("#JianZhuMsg").append('' +
- '<div id="LouCeng'+i+'" style="overflow-x: hidden;overflow-y: scroll;height: 85%;margin-top: 7%;margin-left: 5%;width: 94%">' +
+ '<div id="LouCeng'+i+'" style="overflow-x: hidden;overflow-y: scroll;height: 5%;margin-top: 7%;margin-left: 5%;width: 94%">' +
'<h2 style="display: inline-block;font-weight: bold;color: black;font-size: 15px">褰撳墠妤煎眰锛�'+i+'灞�</h2>' +
'<h2 style="margin-top: 0%;display: inline-block;font-weight: bold;color: black;font-size: 14px;margin-left: 30%">浜烘暟锛�<span id="numes'+i+'" style="display: inline-block;width: 10%">0</span></h2>' +
'<h2 style="display: inline-block;font-size: 14px;font-weight: bold;margin-left: 10%;cursor:pointer;" onclick="LouCeng('+i+')">灞曞紑/鍚堝苟</h2><img style="width: 20px;height: 20px;" src="../Home/HomeImg/xiala.png"> ' +
@@ -834,4 +805,25 @@
}
+function KuangXuanPerson(){
+ var FIDS = localStorage.getItem("KuangXuan");
+ var data = "FID="+FIDS
+ $.get("/hxzkuwb/FindFIDPersons",data,function (data){
+ var floor1 = 0;
+ $("#JianZhuMsg").append('<div id="KuangNum" style="margin-top: 17%;margin-left: 5%;color: white"></div>')
+ $("#JianZhuMsg").append('<div id="Kuanges" style="overflow-y: scroll;height: 85%;margin-top: 5%"></div>')
+ for (var i = 0; i < data.length;i++){
+ $("#Kuanges").append('<div onclick="personMsgtid('+data[i].ptagid+')" class="layui-colla-item" style="background-color: rgba(255, 255, 255, 0)"><h2 class="layui-colla-title" style="background-color: rgba(255, 255, 255, 0)"><img src="HomeImg/PersonShi.png" style="width: 25px;height: 25px"/><span style="display: inline-block;margin-left: 20px">濮撳悕锛�'+data[i].pname+'</span><span style="display: inline-block;float: right;margin-right: 5%">缂栧彿锛�'+data[i].ptagid+'</span></h2>')
+ floor1++;
+ }
+ $("#KuangNum").text("鎬讳汉鏁帮細"+floor1)
+ localStorage.setItem("SanWei_JianZhu","111")
+ setTimeout(function (){
+ localStorage.setItem("KuangXuan1","false")
+ },500)
+ })
+}
+
+
+
--
Gitblit v1.10.0