|
|
@@ -1,26 +1,26 @@
|
|
|
$(function () {
|
|
|
- var cid = $.query.get("auth_cid")
|
|
|
+ var cid = $.query.get('auth_cid')
|
|
|
|
|
|
- $("body").append('<script src="/system/lang/desktop/config.json?script=1&auth_cid=' + cid + '"></script>')
|
|
|
- console.log("Auth", AUTH)
|
|
|
- window.document.domain = AUTH.site.domain || "vbdsm.com"
|
|
|
+ $('body').append('<script src="/system/lang/desktop/config.json?script=1&auth_cid=' + cid + '"></script>')
|
|
|
+ console.log('Auth', AUTH)
|
|
|
+ window.document.domain = AUTH.site.domain || 'vbdsm.com'
|
|
|
|
|
|
loadData()
|
|
|
//getWinXin()
|
|
|
- getGdWeather("classic")
|
|
|
- $("#basicBtn").click(function () {
|
|
|
+ getGdWeather('classic')
|
|
|
+ $('#basicBtn').click(function () {
|
|
|
var tabTitle = $(this).text()
|
|
|
- var url = $(this).attr("src")
|
|
|
+ var url = $(this).attr('src')
|
|
|
addTab(tabTitle, url)
|
|
|
})
|
|
|
|
|
|
- $("#toDesktopBtn").click(function () {
|
|
|
+ $('#toDesktopBtn').click(function () {
|
|
|
// var cid = $.query.get("auth_cid");
|
|
|
- window.location = window.location.href.replace("classic.html", "") /*+ (cid ? "?auth_cid=" + cid : "");*/
|
|
|
+ window.location = window.location.href.replace('classic.html', '') /*+ (cid ? "?auth_cid=" + cid : "");*/
|
|
|
return false
|
|
|
})
|
|
|
- $("#logoutBtn").click(function () {
|
|
|
- confirm("退出登录", "您确定要退出登录吗?", function (r) {
|
|
|
+ $('#logoutBtn').click(function () {
|
|
|
+ confirm('退出登录', '您确定要退出登录吗?', function (r) {
|
|
|
if (r) {
|
|
|
logout()
|
|
|
}
|
|
|
@@ -30,49 +30,57 @@ $(function () {
|
|
|
|
|
|
//$(".title h4").text(AUTH.company.name);
|
|
|
if (G.is_root == 1) {
|
|
|
- $(".title h4").text("超级账户ROOT")
|
|
|
- $("head title").text("江苏平台超级账户- Powered by ZKSF")
|
|
|
+ $('.title h4').text('超级账户ROOT')
|
|
|
+ $('head title').text('江苏平台超级账户- Powered by ZKSF')
|
|
|
} else {
|
|
|
- $(".title h4").text(AUTH.company.name)
|
|
|
- $("head title").text(AUTH.company.name + " - Powered by ZKSF")
|
|
|
+ if (AUTH.company.orgType == 2 && !AUTH.company.logo) {
|
|
|
+ if (AUTH.site.domain) {
|
|
|
+ $('#logo-title img').attr('src', '/images/' + AUTH.site.domain + '.logo2.png')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $('#logo-title img').attr('src', AUTH.company.logo)
|
|
|
+ }
|
|
|
+
|
|
|
+ $('.title h4').text(AUTH.company.name)
|
|
|
+ $('head title').text(AUTH.company.name + ' - Powered by ZKSF')
|
|
|
}
|
|
|
//左侧菜单添加滚动条
|
|
|
- $("#layout-menu").yi_scroll({
|
|
|
- barColor: "rgba(158,158,158,0.3)",
|
|
|
+ $('#layout-menu').yi_scroll({
|
|
|
+ barColor: 'rgba(158,158,158,0.3)',
|
|
|
})
|
|
|
|
|
|
//左侧菜单收缩展开
|
|
|
- $(".menu_minimalize").click(function () {
|
|
|
- var p = $("#cc").layout("panel", "west")[0].clientWidth
|
|
|
+ $('.menu_minimalize').click(function () {
|
|
|
+ var p = $('#cc').layout('panel', 'west')[0].clientWidth
|
|
|
if (p > 0) {
|
|
|
- $("#cc").layout("hidden", "west")
|
|
|
- $(".layout-panel-center").css("left", "0px")
|
|
|
- $(this).css("left", "0px")
|
|
|
- $(this).addClass("menu-expand")
|
|
|
+ $('#cc').layout('hidden', 'west')
|
|
|
+ $('.layout-panel-center').css('left', '0px')
|
|
|
+ $(this).css('left', '0px')
|
|
|
+ $(this).addClass('menu-expand')
|
|
|
} else {
|
|
|
- $("#cc").layout("show", "west")
|
|
|
- $(this).css("left", "279px")
|
|
|
- $(this).removeClass("menu-expand")
|
|
|
+ $('#cc').layout('show', 'west')
|
|
|
+ $(this).css('left', '279px')
|
|
|
+ $(this).removeClass('menu-expand')
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- $("#tab").tabs({
|
|
|
+ $('#tab').tabs({
|
|
|
onSelect: function (title, index) {
|
|
|
checkOne(title)
|
|
|
},
|
|
|
})
|
|
|
|
|
|
if (AUTH.company.orgType == 1) {
|
|
|
- $(".portrait").hover(
|
|
|
+ $('.portrait').hover(
|
|
|
function () {
|
|
|
- $(".portrait").css("overflow", "visible")
|
|
|
+ $('.portrait').css('overflow', 'visible')
|
|
|
},
|
|
|
function () {
|
|
|
- $(".portrait").css("overflow", "hidden")
|
|
|
+ $('.portrait').css('overflow', 'hidden')
|
|
|
}
|
|
|
)
|
|
|
- loadAbout()
|
|
|
- $(".monitoringSite").show()
|
|
|
+ //loadAbout()
|
|
|
+ $('.monitoringSite').show()
|
|
|
}
|
|
|
})
|
|
|
|
|
|
@@ -80,17 +88,17 @@ var selectedNodes = []
|
|
|
|
|
|
function getWinXin() {
|
|
|
$.ajax({
|
|
|
- url: "http://weixin.jirengu.com/weather?jsoncallback=getWeather",
|
|
|
- type: "get",
|
|
|
- dataType: "json",
|
|
|
+ url: 'http://weixin.jirengu.com/weather?jsoncallback=getWeather',
|
|
|
+ type: 'get',
|
|
|
+ dataType: 'json',
|
|
|
xhrFields: {
|
|
|
widthCredentials: true,
|
|
|
},
|
|
|
success: function (data) {
|
|
|
- if (data.status == "OK") {
|
|
|
+ if (data.status == 'OK') {
|
|
|
var weather = data.weather[0]
|
|
|
- var name = weather.city_name + " " + weather.now.text + " " + weather.now.temperature + "°C" + " " + weather.future[0].wind
|
|
|
- $("#weatherWX").html(name)
|
|
|
+ var name = weather.city_name + ' ' + weather.now.text + ' ' + weather.now.temperature + '°C' + ' ' + weather.future[0].wind
|
|
|
+ $('#weatherWX').html(name)
|
|
|
}
|
|
|
},
|
|
|
})
|
|
|
@@ -98,24 +106,24 @@ function getWinXin() {
|
|
|
|
|
|
loadData = function () {
|
|
|
ajax({
|
|
|
- url: "web/explorer/my/app/getList.json",
|
|
|
- type: "post",
|
|
|
- dataType: "json",
|
|
|
+ url: 'web/explorer/my/app/getList.json',
|
|
|
+ type: 'post',
|
|
|
+ dataType: 'json',
|
|
|
success: function (data) {
|
|
|
var treedata = data.data.list
|
|
|
- var $tree = $("#menu").treeview({
|
|
|
+ var $tree = $('#menu').treeview({
|
|
|
levels: 1,
|
|
|
- expandIcon: "glyphicon menu-right pull-right",
|
|
|
- collapseIcon: "glyphicon menu-down pull-right",
|
|
|
- selectedBackColor: "#ffffff",
|
|
|
- selectedColor: "#333",
|
|
|
- onhoverColor: "#ffffff",
|
|
|
+ expandIcon: 'glyphicon menu-right pull-right',
|
|
|
+ collapseIcon: 'glyphicon menu-down pull-right',
|
|
|
+ selectedBackColor: '#ffffff',
|
|
|
+ selectedColor: '#333',
|
|
|
+ onhoverColor: '#ffffff',
|
|
|
data: treedata,
|
|
|
})
|
|
|
|
|
|
var findExpandibleNodess = function () {
|
|
|
- return $tree.treeview("search", [
|
|
|
- $("#input-expand-node").val(),
|
|
|
+ return $tree.treeview('search', [
|
|
|
+ $('#input-expand-node').val(),
|
|
|
{
|
|
|
ignoreCase: false,
|
|
|
exactMatch: false,
|
|
|
@@ -125,97 +133,97 @@ loadData = function () {
|
|
|
var expandibleNodes = findExpandibleNodess()
|
|
|
|
|
|
// Expand/collapse/toggle nodes
|
|
|
- $("#input-expand-node").on("keyup", function (e) {
|
|
|
+ $('#input-expand-node').on('keyup', function (e) {
|
|
|
expandibleNodes = findExpandibleNodess()
|
|
|
- $(".expand-node").prop("disabled", !(expandibleNodes.length >= 1))
|
|
|
+ $('.expand-node').prop('disabled', !(expandibleNodes.length >= 1))
|
|
|
})
|
|
|
|
|
|
- $tree.on("nodeSelected", function (event, data) {
|
|
|
+ $tree.on('nodeSelected', function (event, data) {
|
|
|
if (data.nodes != null) {
|
|
|
- var select_node = $("#menu").treeview("getSelected")
|
|
|
+ var select_node = $('#menu').treeview('getSelected')
|
|
|
if (select_node[0].state.expanded) {
|
|
|
- $("#menu").treeview("collapseNode", select_node)
|
|
|
+ $('#menu').treeview('collapseNode', select_node)
|
|
|
select_node[0].state.selected = false
|
|
|
} else {
|
|
|
- $("#menu").treeview("expandNode", select_node)
|
|
|
+ $('#menu').treeview('expandNode', select_node)
|
|
|
select_node[0].state.selected = false
|
|
|
}
|
|
|
} else {
|
|
|
var tabTitle = data.text
|
|
|
- var platform = eval("(" + AUTH.site.config + ")").platform
|
|
|
- var host = "http://" + platform["" + data.attributes.platform] + "." + AUTH.site.domain
|
|
|
- var url = host + data.attributes.url + "?theme=high&auth_cid=" + cid + "&auth_aid=" + data.attributes.appId + "&auth_mid=" + data.attributes.menuId
|
|
|
+ var platform = eval('(' + AUTH.site.config + ')').platform
|
|
|
+ var host = 'http://' + platform['' + data.attributes.platform] + '.' + AUTH.site.domain
|
|
|
+ var url = host + data.attributes.url + '?theme=high&auth_cid=' + cid + '&auth_aid=' + data.attributes.appId + '&auth_mid=' + data.attributes.menuId
|
|
|
addTab(tabTitle, url)
|
|
|
- $("#tab").find("li:first").children(".tabs-close").remove()
|
|
|
+ $('#tab').find('li:first').children('.tabs-close').remove()
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- if (_.has(data.data, "bigScreen")) {
|
|
|
+ if (_.has(data.data, 'bigScreen')) {
|
|
|
//有bigc
|
|
|
var data = data.data.bigScreen
|
|
|
- var platform = eval("(" + AUTH.site.config + ")").platform
|
|
|
- if (_.has(data, "screen")) {
|
|
|
- $(".header .bigScreen").css("display", "block")
|
|
|
- var host = "http://" + platform["" + data.screen.platform] + "." + AUTH.site.domain
|
|
|
+ var platform = eval('(' + AUTH.site.config + ')').platform
|
|
|
+ if (_.has(data, 'screen')) {
|
|
|
+ $('.header .bigScreen').css('display', 'block')
|
|
|
+ var host = 'http://' + platform['' + data.screen.platform] + '.' + AUTH.site.domain
|
|
|
var delay = data.screen.delay ? data.screen.delay : 15
|
|
|
- var bigScreenUrl = host + data.screen.url + "?auth_cid=" + cid + "&auth_aid=" + data.screen.appId + "&auth_mid=" + data.screen.menuId + "&delay=" + delay
|
|
|
- $(".header .bigScreen").attr("href", bigScreenUrl)
|
|
|
- $(".header .bigScreen").attr("target", "_blank")
|
|
|
+ var bigScreenUrl = host + data.screen.url + '?auth_cid=' + cid + '&auth_aid=' + data.screen.appId + '&auth_mid=' + data.screen.menuId + '&delay=' + delay
|
|
|
+ $('.header .bigScreen').attr('href', bigScreenUrl)
|
|
|
+ $('.header .bigScreen').attr('target', '_blank')
|
|
|
}
|
|
|
|
|
|
var tabTitle = data.index.text
|
|
|
- var host1 = "http://" + platform["" + data.index.platform] + "." + AUTH.site.domain
|
|
|
- var dashboardUrl = host1 + data.index.url + "?theme=high&auth_cid=" + cid + "&auth_aid=" + data.index.appId + "&auth_mid=" + data.index.menuId
|
|
|
+ var host1 = 'http://' + platform['' + data.index.platform] + '.' + AUTH.site.domain
|
|
|
+ var dashboardUrl = host1 + data.index.url + '?theme=high&auth_cid=' + cid + '&auth_aid=' + data.index.appId + '&auth_mid=' + data.index.menuId
|
|
|
addTab(tabTitle, dashboardUrl)
|
|
|
- $("#tab").find("li:first").children(".tabs-close").remove()
|
|
|
+ $('#tab').find('li:first').children('.tabs-close').remove()
|
|
|
}
|
|
|
|
|
|
- var target = $.query.get("target")
|
|
|
+ var target = $.query.get('target')
|
|
|
|
|
|
- if (target && "企业实时告警" == target) {
|
|
|
- var urlparams = parserUrl(location.href, "obj").params
|
|
|
+ if (target && '企业实时告警' == target) {
|
|
|
+ var urlparams = parserUrl(location.href, 'obj').params
|
|
|
|
|
|
- gotoWarnDetail("企业实时告警", data, {
|
|
|
- org_id: urlparams["org_id"],
|
|
|
- terminal_id: urlparams["terminal_id"],
|
|
|
- upload_date: urlparams["upload_date"],
|
|
|
- warn_type: urlparams["warn_type"],
|
|
|
+ gotoWarnDetail('企业实时告警', data, {
|
|
|
+ org_id: urlparams['org_id'],
|
|
|
+ terminal_id: urlparams['terminal_id'],
|
|
|
+ upload_date: urlparams['upload_date'],
|
|
|
+ warn_type: urlparams['warn_type'],
|
|
|
})
|
|
|
} else if (target) {
|
|
|
checkOne(target)
|
|
|
} else {
|
|
|
- checkOne("")
|
|
|
+ checkOne('')
|
|
|
}
|
|
|
},
|
|
|
})
|
|
|
}
|
|
|
|
|
|
function showDashboard(data) {
|
|
|
- if (_.has(data.data, "bigScreen")) {
|
|
|
+ if (_.has(data.data, 'bigScreen')) {
|
|
|
//有bigc
|
|
|
var data = data.data.bigScreen
|
|
|
- var platform = eval("(" + AUTH.site.config + ")").platform
|
|
|
- if (_.has(data, "screen")) {
|
|
|
- $(".header .bigScreen").css("display", "block")
|
|
|
- var host = "http://" + platform["" + data.screen.platform] + "." + AUTH.site.domain
|
|
|
- var bigScreenUrl = host + data.screen.url + "?auth_cid=" + cid + "&auth_aid=" + data.screen.appId + "&auth_mid=" + data.screen.menuId
|
|
|
- $(".header .bigScreen").attr("href", bigScreenUrl)
|
|
|
- $(".header .bigScreen").attr("target", "_blank")
|
|
|
+ var platform = eval('(' + AUTH.site.config + ')').platform
|
|
|
+ if (_.has(data, 'screen')) {
|
|
|
+ $('.header .bigScreen').css('display', 'block')
|
|
|
+ var host = 'http://' + platform['' + data.screen.platform] + '.' + AUTH.site.domain
|
|
|
+ var bigScreenUrl = host + data.screen.url + '?auth_cid=' + cid + '&auth_aid=' + data.screen.appId + '&auth_mid=' + data.screen.menuId
|
|
|
+ $('.header .bigScreen').attr('href', bigScreenUrl)
|
|
|
+ $('.header .bigScreen').attr('target', '_blank')
|
|
|
}
|
|
|
|
|
|
var tabTitle = data.index.text
|
|
|
- var host1 = "http://" + platform["" + data.index.platform] + "." + AUTH.site.domain
|
|
|
- var dashboardUrl = host1 + data.index.url + "?theme=high&auth_cid=" + cid + "&auth_aid=" + data.index.appId + "&auth_mid=" + data.index.menuId
|
|
|
+ var host1 = 'http://' + platform['' + data.index.platform] + '.' + AUTH.site.domain
|
|
|
+ var dashboardUrl = host1 + data.index.url + '?theme=high&auth_cid=' + cid + '&auth_aid=' + data.index.appId + '&auth_mid=' + data.index.menuId
|
|
|
addTab(tabTitle, dashboardUrl)
|
|
|
- $("#tab").find("li:first").children(".tabs-close").remove()
|
|
|
+ $('#tab').find('li:first').children('.tabs-close').remove()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function checkOne(text) {
|
|
|
- var $tree = $("#menu")
|
|
|
+ var $tree = $('#menu')
|
|
|
var checkNodeId = 0
|
|
|
|
|
|
- $tree.treeview("expandAll", {
|
|
|
+ $tree.treeview('expandAll', {
|
|
|
levels: 100,
|
|
|
silent: true,
|
|
|
})
|
|
|
@@ -223,23 +231,23 @@ function checkOne(text) {
|
|
|
unselectedAll(selectedNodes)
|
|
|
selectedNodes = []
|
|
|
|
|
|
- $("#menu")
|
|
|
- .find(".list-group-item")
|
|
|
+ $('#menu')
|
|
|
+ .find('.list-group-item')
|
|
|
.each(function (index) {
|
|
|
if ($(this).text() === text) {
|
|
|
- checkNodeId = $(this).data("nodeid")
|
|
|
- $tree.treeview("selectNode", [
|
|
|
- $(this).data("nodeid"),
|
|
|
+ checkNodeId = $(this).data('nodeid')
|
|
|
+ $tree.treeview('selectNode', [
|
|
|
+ $(this).data('nodeid'),
|
|
|
{
|
|
|
silent: false,
|
|
|
},
|
|
|
])
|
|
|
|
|
|
- selectedNodes.push($(this).data("nodeid"))
|
|
|
+ selectedNodes.push($(this).data('nodeid'))
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- $tree.treeview("collapseAll", {
|
|
|
+ $tree.treeview('collapseAll', {
|
|
|
silent: true,
|
|
|
})
|
|
|
|
|
|
@@ -247,27 +255,27 @@ function checkOne(text) {
|
|
|
}
|
|
|
|
|
|
function expandNode(nodeid) {
|
|
|
- var $tree = $("#menu"),
|
|
|
+ var $tree = $('#menu'),
|
|
|
parentNodeId
|
|
|
|
|
|
- $tree.treeview("expandNode", [
|
|
|
+ $tree.treeview('expandNode', [
|
|
|
nodeid,
|
|
|
{
|
|
|
silent: true,
|
|
|
},
|
|
|
])
|
|
|
|
|
|
- parent = $tree.treeview("getParent", nodeid)
|
|
|
+ parent = $tree.treeview('getParent', nodeid)
|
|
|
|
|
|
- if (parent != undefined && ("number" == typeof parent || parent.hasOwnProperty("nodeId"))) {
|
|
|
+ if (parent != undefined && ('number' == typeof parent || parent.hasOwnProperty('nodeId'))) {
|
|
|
expandNode(parent.nodeId)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function unselectedAll(arr) {
|
|
|
- var $tree = $("#menu")
|
|
|
+ var $tree = $('#menu')
|
|
|
for (var i = 0; i < arr.length; i++) {
|
|
|
- $tree.treeview("unselectNode", [
|
|
|
+ $tree.treeview('unselectNode', [
|
|
|
arr[i],
|
|
|
{
|
|
|
silent: true,
|
|
|
@@ -277,25 +285,25 @@ function unselectedAll(arr) {
|
|
|
}
|
|
|
|
|
|
function parserUrl(url, type) {
|
|
|
- type = type || "obj"
|
|
|
+ type = type || 'obj'
|
|
|
|
|
|
- if (!url || "" == url) return false
|
|
|
+ if (!url || '' == url) return false
|
|
|
|
|
|
var result = {}
|
|
|
var params = {}
|
|
|
- if (url.indexOf("?") != -1) {
|
|
|
- var str = url.split("?")[1]
|
|
|
- var strs = str.split("&")
|
|
|
+ if (url.indexOf('?') != -1) {
|
|
|
+ var str = url.split('?')[1]
|
|
|
+ var strs = str.split('&')
|
|
|
for (var i = 0; i < strs.length; i++) {
|
|
|
- if ("obj" == type) {
|
|
|
- params[strs[i].split("=")[0]] = strs[i].split("=")[1]
|
|
|
+ if ('obj' == type) {
|
|
|
+ params[strs[i].split('=')[0]] = strs[i].split('=')[1]
|
|
|
} else {
|
|
|
- var list = strs[i].split("=")[1].split(",")
|
|
|
- params[strs[i].split("=")[0]] = list
|
|
|
+ var list = strs[i].split('=')[1].split(',')
|
|
|
+ params[strs[i].split('=')[0]] = list
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- result.url = url.split("?")[0]
|
|
|
+ result.url = url.split('?')[0]
|
|
|
result.params = params
|
|
|
} else {
|
|
|
result.url = url
|
|
|
@@ -306,12 +314,12 @@ function parserUrl(url, type) {
|
|
|
|
|
|
//添加tab页签
|
|
|
function addTab(title, url) {
|
|
|
- if ($("#tab").tabs("exists", title)) {
|
|
|
- $("#tab").tabs("select", title)
|
|
|
+ if ($('#tab').tabs('exists', title)) {
|
|
|
+ $('#tab').tabs('select', title)
|
|
|
} else {
|
|
|
- var height = $(".tabs-panels").height() + "px"
|
|
|
+ var height = $('.tabs-panels').height() + 'px'
|
|
|
var content = '<iframe scrolling="auto" frameborder="0" src="' + url + '" style="width:100%;height:' + height + '"></iframe>'
|
|
|
- $("#tab").tabs("add", {
|
|
|
+ $('#tab').tabs('add', {
|
|
|
title: title,
|
|
|
content: content,
|
|
|
closable: true,
|
|
|
@@ -320,10 +328,10 @@ function addTab(title, url) {
|
|
|
}
|
|
|
|
|
|
function updateTab(title, url) {
|
|
|
- var tab = $("#tab").tabs("getSelected")
|
|
|
- var height = $(".tabs-panels").height() + "px"
|
|
|
+ var tab = $('#tab').tabs('getSelected')
|
|
|
+ var height = $('.tabs-panels').height() + 'px'
|
|
|
var content = '<iframe scrolling="auto" frameborder="0" src="' + url + '" style="width:100%;height:' + height + '"></iframe>'
|
|
|
- $("#tab").tabs("update", {
|
|
|
+ $('#tab').tabs('update', {
|
|
|
tab: tab,
|
|
|
options: {
|
|
|
title: title,
|
|
|
@@ -334,8 +342,8 @@ function updateTab(title, url) {
|
|
|
}
|
|
|
|
|
|
function gotoWarnDetail(title, data, option) {
|
|
|
- var host = "http://" + eval("(" + AUTH.site.config + ")").platform["01200014"] + "." + AUTH.site.domain
|
|
|
- var url = host + "/enterpriseRealtimeAlarm.html?auth_aid=" + data.index.appId + "&auth_mid=" + data.index.menuId + "&auth_cid=" + cid + "&terminal_id=" + option.terminal_id + "&upload_date=" + option.upload_date + "&warn_type=" + option.warn_type + "&org_id=" + option.org_id
|
|
|
+ var host = 'http://' + eval('(' + AUTH.site.config + ')').platform['01200014'] + '.' + AUTH.site.domain
|
|
|
+ var url = host + '/enterpriseRealtimeAlarm.html?auth_aid=' + data.index.appId + '&auth_mid=' + data.index.menuId + '&auth_cid=' + cid + '&terminal_id=' + option.terminal_id + '&upload_date=' + option.upload_date + '&warn_type=' + option.warn_type + '&org_id=' + option.org_id
|
|
|
|
|
|
addTab(title, url)
|
|
|
}
|
|
|
@@ -343,7 +351,7 @@ function gotoWarnDetail(title, data, option) {
|
|
|
//退出
|
|
|
var logout = function () {
|
|
|
ajax({
|
|
|
- url: "/system/logout.json",
|
|
|
+ url: '/system/logout.json',
|
|
|
success: function (data) {
|
|
|
if (data.data.loginHost) {
|
|
|
window.location = data.data.loginHost
|
|
|
@@ -364,13 +372,13 @@ $.extend($.fn.layout.methods, {
|
|
|
* @param {Object} params
|
|
|
*/
|
|
|
isVisible: function (jq, params) {
|
|
|
- var panels = $.data(jq[0], "layout").panels
|
|
|
+ var panels = $.data(jq[0], 'layout').panels
|
|
|
var pp = panels[params]
|
|
|
if (!pp) {
|
|
|
return false
|
|
|
}
|
|
|
if (pp.length) {
|
|
|
- return pp.panel("panel").is(":visible")
|
|
|
+ return pp.panel('panel').is(':visible')
|
|
|
} else {
|
|
|
return false
|
|
|
}
|
|
|
@@ -382,8 +390,8 @@ $.extend($.fn.layout.methods, {
|
|
|
*/
|
|
|
hidden: function (jq, params) {
|
|
|
return jq.each(function () {
|
|
|
- var opts = $.data(this, "layout").options
|
|
|
- var panels = $.data(this, "layout").panels
|
|
|
+ var opts = $.data(this, 'layout').options
|
|
|
+ var panels = $.data(this, 'layout').panels
|
|
|
if (!opts.regionState) {
|
|
|
opts.regionState = {}
|
|
|
}
|
|
|
@@ -392,27 +400,27 @@ $.extend($.fn.layout.methods, {
|
|
|
function hide(dom, region, doResize) {
|
|
|
var first = region.substring(0, 1)
|
|
|
var others = region.substring(1)
|
|
|
- var expand = "expand" + first.toUpperCase() + others
|
|
|
+ var expand = 'expand' + first.toUpperCase() + others
|
|
|
if (panels[expand]) {
|
|
|
- if ($(dom).layout("isVisible", expand)) {
|
|
|
+ if ($(dom).layout('isVisible', expand)) {
|
|
|
opts.regionState[region] = 1
|
|
|
- panels[expand].panel("close")
|
|
|
- } else if ($(dom).layout("isVisible", region)) {
|
|
|
+ panels[expand].panel('close')
|
|
|
+ } else if ($(dom).layout('isVisible', region)) {
|
|
|
opts.regionState[region] = 0
|
|
|
- panels[region].panel("close")
|
|
|
+ panels[region].panel('close')
|
|
|
}
|
|
|
} else {
|
|
|
- panels[region].panel("close")
|
|
|
+ panels[region].panel('close')
|
|
|
}
|
|
|
if (doResize) {
|
|
|
- $(dom).layout("resize")
|
|
|
+ $(dom).layout('resize')
|
|
|
}
|
|
|
}
|
|
|
- if (region.toLowerCase() == "all") {
|
|
|
- hide(this, "east", false)
|
|
|
- hide(this, "north", false)
|
|
|
- hide(this, "west", false)
|
|
|
- hide(this, "south", true)
|
|
|
+ if (region.toLowerCase() == 'all') {
|
|
|
+ hide(this, 'east', false)
|
|
|
+ hide(this, 'north', false)
|
|
|
+ hide(this, 'west', false)
|
|
|
+ hide(this, 'south', true)
|
|
|
} else {
|
|
|
hide(this, region, true)
|
|
|
}
|
|
|
@@ -425,36 +433,36 @@ $.extend($.fn.layout.methods, {
|
|
|
*/
|
|
|
show: function (jq, params) {
|
|
|
return jq.each(function () {
|
|
|
- var opts = $.data(this, "layout").options
|
|
|
- var panels = $.data(this, "layout").panels
|
|
|
+ var opts = $.data(this, 'layout').options
|
|
|
+ var panels = $.data(this, 'layout').panels
|
|
|
var region = params
|
|
|
|
|
|
function show(dom, region, doResize) {
|
|
|
var first = region.substring(0, 1)
|
|
|
var others = region.substring(1)
|
|
|
- var expand = "expand" + first.toUpperCase() + others
|
|
|
+ var expand = 'expand' + first.toUpperCase() + others
|
|
|
if (panels[expand]) {
|
|
|
- if (!$(dom).layout("isVisible", expand)) {
|
|
|
- if (!$(dom).layout("isVisible", region)) {
|
|
|
+ if (!$(dom).layout('isVisible', expand)) {
|
|
|
+ if (!$(dom).layout('isVisible', region)) {
|
|
|
if (opts.regionState[region] == 1) {
|
|
|
- panels[expand].panel("open")
|
|
|
+ panels[expand].panel('open')
|
|
|
} else {
|
|
|
- panels[region].panel("open")
|
|
|
+ panels[region].panel('open')
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- panels[region].panel("open")
|
|
|
+ panels[region].panel('open')
|
|
|
}
|
|
|
if (doResize) {
|
|
|
- $(dom).layout("resize")
|
|
|
+ $(dom).layout('resize')
|
|
|
}
|
|
|
}
|
|
|
- if (region.toLowerCase() == "all") {
|
|
|
- show(this, "east", false)
|
|
|
- show(this, "north", false)
|
|
|
- show(this, "west", false)
|
|
|
- show(this, "south", true)
|
|
|
+ if (region.toLowerCase() == 'all') {
|
|
|
+ show(this, 'east', false)
|
|
|
+ show(this, 'north', false)
|
|
|
+ show(this, 'west', false)
|
|
|
+ show(this, 'south', true)
|
|
|
} else {
|
|
|
show(this, region, true)
|
|
|
}
|
|
|
@@ -464,49 +472,49 @@ $.extend($.fn.layout.methods, {
|
|
|
|
|
|
//显示企业信息
|
|
|
var showAbout = function (data) {
|
|
|
- var contacts = ""
|
|
|
+ var contacts = ''
|
|
|
if (data.powerContact.length > 0) {
|
|
|
- var arr = eval("(" + data.powerContact + ")")
|
|
|
+ var arr = eval('(' + data.powerContact + ')')
|
|
|
if (arr.length > 0) {
|
|
|
contacts += '<table width="100%" class="table02">'
|
|
|
contacts += '<tr><th style="border: #ccc solid 1px;">姓名</th>' + '<th style="border: #ccc solid 1px;">职位</th>' + '<th style="border: #ccc solid 1px;">电话</th>' + '<th style="border: #ccc solid 1px;">E-mail</th></tr>'
|
|
|
for (var i = 0; i < arr.length; i++) {
|
|
|
contacts +=
|
|
|
- '<tr><td style="border: #ccc solid 1px;"><span>' + arr[i].name + "</td>" + '<td style="border: #ccc solid 1px;">' + arr[i].duty + "</td>" + '<td style="border: #ccc solid 1px;">' + arr[i].mobile + "</td>" + '<td style="border: #ccc solid 1px;">' + arr[i].email + "</span></td></tr>"
|
|
|
+ '<tr><td style="border: #ccc solid 1px;"><span>' + arr[i].name + '</td>' + '<td style="border: #ccc solid 1px;">' + arr[i].duty + '</td>' + '<td style="border: #ccc solid 1px;">' + arr[i].mobile + '</td>' + '<td style="border: #ccc solid 1px;">' + arr[i].email + '</span></td></tr>'
|
|
|
}
|
|
|
- contacts += "</table>"
|
|
|
+ contacts += '</table>'
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var html = '<h4 class="title">企业基本信息:</h4>'
|
|
|
html += '<table width="100%" class="table01">'
|
|
|
- html += '<tr><td colspan="2"><span>名称:' + data.powerName + "</span></td>"
|
|
|
- html += "<td><span>编号:" + (data.powerOrgId == undefined ? AUTH.company.id : data.powerOrgId) + "</span></td></tr>"
|
|
|
- html += '<tr><td colspan="3"><span>地址:' + data.powerAddress + "</span></td></tr>"
|
|
|
- html += '<tr><td width="245"><span>企业类型:' + data.powerType + "</span></td>"
|
|
|
- html += '<td width="245"><span>级别:' + data.powerRank + "</span></td>"
|
|
|
- html += "<td><span>运行状态:" + data.powerState + "</span></td></tr>"
|
|
|
- html += "<tr><td><span>供电电源:" + data.powerPowerSupply + "</span></td>"
|
|
|
- html += "<td><span>电压等级:" + data.powerVoltageClass + "</span></td>"
|
|
|
- html += "<td><span>基本电价:¥" + data.powerJbdj + "元</span></td></tr>"
|
|
|
- html += "<tr><td><span>是否启用自定义电价:" + data.powerIsFgp + "</span></td>"
|
|
|
- html += '<td colspan="2"><span>服务到期时间:' + data.powerExpiredDate + "</span></td></tr>"
|
|
|
- html += '<tr><td colspan="3"><span>联系人列表:' + (contacts == "" ? "未设置" : "") + "</span></td></tr>"
|
|
|
- if (contacts != "") {
|
|
|
- html += '<tr><td colspan="3" style="padding-top:10px;">' + contacts + "</td></tr>"
|
|
|
+ html += '<tr><td colspan="2"><span>名称:' + data.powerName + '</span></td>'
|
|
|
+ html += '<td><span>编号:' + (data.powerOrgId == undefined ? AUTH.company.id : data.powerOrgId) + '</span></td></tr>'
|
|
|
+ html += '<tr><td colspan="3"><span>地址:' + data.powerAddress + '</span></td></tr>'
|
|
|
+ html += '<tr><td width="245"><span>企业类型:' + data.powerType + '</span></td>'
|
|
|
+ html += '<td width="245"><span>级别:' + data.powerRank + '</span></td>'
|
|
|
+ html += '<td><span>运行状态:' + data.powerState + '</span></td></tr>'
|
|
|
+ html += '<tr><td><span>供电电源:' + data.powerPowerSupply + '</span></td>'
|
|
|
+ html += '<td><span>电压等级:' + data.powerVoltageClass + '</span></td>'
|
|
|
+ html += '<td><span>基本电价:¥' + data.powerJbdj + '元</span></td></tr>'
|
|
|
+ html += '<tr><td><span>是否启用自定义电价:' + data.powerIsFgp + '</span></td>'
|
|
|
+ html += '<td colspan="2"><span>服务到期时间:' + data.powerExpiredDate + '</span></td></tr>'
|
|
|
+ html += '<tr><td colspan="3"><span>联系人列表:' + (contacts == '' ? '未设置' : '') + '</span></td></tr>'
|
|
|
+ if (contacts != '') {
|
|
|
+ html += '<tr><td colspan="3" style="padding-top:10px;">' + contacts + '</td></tr>'
|
|
|
}
|
|
|
- html += "</table>"
|
|
|
- html += "<br/>"
|
|
|
+ html += '</table>'
|
|
|
+ html += '<br/>'
|
|
|
html += '<h4 class="title">承建单位信息:</h4>'
|
|
|
html += '<table width="100%" class="table01">'
|
|
|
- html += '<tr><td colspan="3"><span>名称:' + data.proxyName + "</span></td></tr>"
|
|
|
- html += '<tr><td colspan="3"><span>地址:' + data.proxyAddress + "</span></td></tr>"
|
|
|
- html += '<tr><td width="245"><span>单位类型:' + data.proxyTg + "</span></td>"
|
|
|
- html += '<td width="245"><span>负责人:' + (data.proxyPrincipal ? data.proxyPrincipal : "未设置") + "</span></td>"
|
|
|
- html += "<td><span>联系电话:" + (data.proxyTel ? data.proxyTel : "未设置") + "</span></td></tr>"
|
|
|
- html += "</table>"
|
|
|
- var cont = $("#myModal .modal-body")
|
|
|
- $("#myModalLabel").text(AUTH.company.name)
|
|
|
+ html += '<tr><td colspan="3"><span>名称:' + data.proxyName + '</span></td></tr>'
|
|
|
+ html += '<tr><td colspan="3"><span>地址:' + data.proxyAddress + '</span></td></tr>'
|
|
|
+ html += '<tr><td width="245"><span>单位类型:' + data.proxyTg + '</span></td>'
|
|
|
+ html += '<td width="245"><span>负责人:' + (data.proxyPrincipal ? data.proxyPrincipal : '未设置') + '</span></td>'
|
|
|
+ html += '<td><span>联系电话:' + (data.proxyTel ? data.proxyTel : '未设置') + '</span></td></tr>'
|
|
|
+ html += '</table>'
|
|
|
+ var cont = $('#myModal .modal-body')
|
|
|
+ $('#myModalLabel').text(AUTH.company.name)
|
|
|
cont.append(html)
|
|
|
}
|
|
|
|
|
|
@@ -516,7 +524,7 @@ var loadAbout = function () {
|
|
|
return
|
|
|
}
|
|
|
ajax({
|
|
|
- url: "web/desktop/getCompanyInfo.json",
|
|
|
+ url: 'web/desktop/getCompanyInfo.json',
|
|
|
success: function (d) {
|
|
|
G.copyright = d.data
|
|
|
showAbout(G.copyright)
|
|
|
@@ -526,25 +534,25 @@ var loadAbout = function () {
|
|
|
|
|
|
//监测点运行情况
|
|
|
$(function () {
|
|
|
- var cid = $.query.get("auth_cid")
|
|
|
+ var cid = $.query.get('auth_cid')
|
|
|
var step = 1000 * 60 * 30
|
|
|
var init = function (total, outline) {
|
|
|
- var host = "http://" + eval("(" + AUTH.site.config + ")").platform["01200007"] + "." + AUTH.site.domain
|
|
|
+ var host = 'http://' + eval('(' + AUTH.site.config + ')').platform['01200007'] + '.' + AUTH.site.domain
|
|
|
$.ajax({
|
|
|
- url: host + "/web/plugins/getMonitorState.json",
|
|
|
- dataType: "jsonp",
|
|
|
+ url: host + '/web/plugins/getMonitorState.json',
|
|
|
+ dataType: 'jsonp',
|
|
|
data: {
|
|
|
auth_cid: cid,
|
|
|
},
|
|
|
success: function (d) {
|
|
|
- $(".total").html(d.data.total)
|
|
|
+ $('.total').html(d.data.total)
|
|
|
if (d.data.outline != 0) {
|
|
|
- $(".outline").html(d.data.outline)
|
|
|
+ $('.outline').html(d.data.outline)
|
|
|
}
|
|
|
var time = new Date()
|
|
|
var next = new Date(time.getTime() + step)
|
|
|
- $(".remark").html("(" + time.format("HH:mm") + "更新,下次" + next.format("HH:mm") + ")")
|
|
|
- $("#monitorLabel").html("离线设备列表(共" + d.data.total + "个设备," + d.data.outline + "个离线)")
|
|
|
+ $('.remark').html('(' + time.format('HH:mm') + '更新,下次' + next.format('HH:mm') + ')')
|
|
|
+ $('#monitorLabel').html('离线设备列表(共' + d.data.total + '个设备,' + d.data.outline + '个离线)')
|
|
|
},
|
|
|
})
|
|
|
}
|