You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
346 lines
14 KiB
346 lines
14 KiB
//单点登录ip配置:
|
|
var _signInIp = "http://camp.xf365.cn";
|
|
|
|
layui.use(['element', 'layer', 'jquery'], function () {
|
|
var element = layui.element;
|
|
$ = layui.$,
|
|
layer = layui.layer;
|
|
|
|
|
|
var kn_root_c_cookie = $.cookie("kn_root_cookie");
|
|
//console.log(kn_root_c_cookie);
|
|
|
|
if (kn_root_c_cookie != undefined) {
|
|
kn_root_c_cookie_json = JSON.parse(kn_root_c_cookie)
|
|
} else {
|
|
layer.msg("您未登录或登录超时请登录后使用,页面将在3秒后关闭!", { icon: 0 });
|
|
setTimeout(function () { window.location.href = "/"; }, 3000);
|
|
return;
|
|
}
|
|
|
|
|
|
var height1 = $("#leftmain").height();
|
|
$("#rightmain").css({ height: height1 + "px" });
|
|
var height2 = $("#zhxfbtn1").outerHeight(true);
|
|
var height3 = $("#xfcon1").outerHeight(true);
|
|
$("#rightmain button").css({ height: height2 + "px" });
|
|
$("#rightmain").css({ paddingTop: height3 + "px" });
|
|
|
|
|
|
var usersUid = kn_root_c_cookie_json.usersUid;
|
|
var usersPwd = kn_root_c_cookie_json.usersPwd;
|
|
var usersName = kn_root_c_cookie_json.usersName;
|
|
$("#show_own").html(usersName);
|
|
|
|
|
|
//console.log(usersUid + "/" + usersPwd);
|
|
//$("#firepage").attr("src", "/clouds/signinCamp?usersUid=" + usersUid);
|
|
$("#firepage").attr("src", _signInIp + ":8377/clouds/signinCamp?usersUid=" + usersUid);
|
|
|
|
// _signInIp:8377/clouds/signin?usersUid=shzxfzd&usersPwd=fire119
|
|
|
|
//监听选项卡关闭,关闭到0,自动调转上一屏
|
|
element.on("tabDelete(work_index_bodyTab)", function (data) {
|
|
var tabs = $(".layui-tab-title li");
|
|
if (tabs.length == 0) {
|
|
show_and_work("show");
|
|
}
|
|
//console.log(tabtitle.length)
|
|
});
|
|
|
|
//菜单点击监听
|
|
$("li[class='clearfix']").each(function () {
|
|
var _this = $(this);
|
|
_this.click(function () {
|
|
var _on = _this.attr("on");
|
|
if (_on == "1") {
|
|
var _t = _this.attr("t");
|
|
if (_t == "2") {
|
|
var _url = _this.attr("url");
|
|
if (_url.indexOf("null") > -1) {
|
|
layer.tips("<span style='color:#000000'>监管用户暂时不提供“消防物联管理”访问,请关注版本更新。</span>", _this, { tips: [2, "#fff"] });
|
|
return false;
|
|
}
|
|
window.open(_url);
|
|
} else {
|
|
var _url = _this.attr("url");
|
|
var _id = _this.attr("id");
|
|
var _text = _this.find(".cname").html();
|
|
show_and_work("work");
|
|
menuOpt(_url, _t, _id, _text);
|
|
}
|
|
//console.log(_on+"-------"+_t+"------"+_url+"----"+_id)
|
|
} else {
|
|
layer.tips("<span style='color:#000000'>暂时不能访问,请关注版本更新。</span>", _this, { tips: [2, "#fff"] });
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
//返回第一屏
|
|
$("#section_show_return").click(function () {
|
|
show_and_work("show");
|
|
});
|
|
$("#section_show_return1").click(function () {
|
|
test("show");
|
|
});
|
|
window.addEventListener('message', function (event) {
|
|
test("show");
|
|
})
|
|
|
|
//几个按钮
|
|
$("a[id$='_admin']").click(function () {
|
|
window.location.href = ctx + "/index/admin";
|
|
});
|
|
$("a[id$='_pwd']").each(function () {
|
|
$(this).click(function (e) {
|
|
var x = e.originalEvent.x || e.originalEvent.layerX || 0;
|
|
var y = e.originalEvent.y || e.originalEvent.layerY || 0;
|
|
x += 10; y += 10;
|
|
layer.open({
|
|
type: 1,
|
|
title: false,
|
|
closeBtn: false,
|
|
offset: [y, x],
|
|
area: "auto",
|
|
shade: 0.3,
|
|
//id:''//设定一个id,防止重复弹出
|
|
btn: ["提交新密码", "取消"],
|
|
btnAlign: "c",
|
|
//move:true,//false关闭拖拽/默认.layui-layer-title可不写
|
|
content: "<div style=\"padding:20px;line-height:22px;background-color:#3352AF;color:#fff;font-weight:300;font-size:16px;\"><input type=\"password\" id=\"npwd\" placeholder=\"请输入您的新密码\" autocomplete=\"off\" style=\"font-size:16px;height:30px;line-height:30px;text-align:center;\"/></div>",
|
|
yes: function (index, layero) {
|
|
var npwd = $("#npwd").val();
|
|
if (npwd == "") {
|
|
$("#npwd").focus();
|
|
return false;
|
|
}
|
|
$.ajax({
|
|
type: "post",
|
|
url: "../ashx/SysUserHandler.ashx",
|
|
data: { Action: "Edit", usersUid: usersUid, usersPwd: npwd },
|
|
dataType: "json",
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
layer.close(index);
|
|
layer.msg(data.msg + " 请退出重新登录!", { time: 3000 });
|
|
}
|
|
else {
|
|
layer.close(index);
|
|
layer.msg(data.msg, { time: 3000 });
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
});
|
|
});
|
|
$("a[id$='_own']").click(function (e) {
|
|
var _html = "<div style=\"padding:30px;background-color:#3352AF;color:#fff;font-weight:300;\">" +
|
|
"<input type=\"text\" id=\"index_newUsersName\" placeholder=\"姓名\" class=\"layui-input\" style=\"width:360px;margin-bottom:20px;\"/>" +
|
|
"<input type=\"text\" id=\"index_newUsersTel\" placeholder=\"电话\" class=\"layui-input\" style=\"width:360px;margin-bottom:20px;\"/>" +
|
|
"<input type=\"text\" id=\"index_newUsersEmail\" placeholder=\"邮箱\" class=\"layui-input\" style=\"width:360px;\"/>" +
|
|
"</div>";
|
|
layer.open({
|
|
type: 1,
|
|
title: false,
|
|
closeBtn: false,
|
|
//offset:"r",
|
|
area: ["420px", "auto"],
|
|
shade: 0.3,
|
|
//id:''//设定一个id,防止重复弹出
|
|
btn: ["确定", "取消"],
|
|
btnAlign: "c",
|
|
content: _html,
|
|
success: function () {
|
|
$.ajax({
|
|
type: "post",
|
|
url: "../ashx/SysUserHandler.ashx",
|
|
|
|
data: { Action: "UserInfo", usersUid: usersUid },
|
|
dataType: "json",
|
|
success: function (data) {
|
|
console.log(data);
|
|
$("#index_newUsersName").val(data.data.USERS_NAME);
|
|
$("#index_newUsersTel").val(data.data.USERS_MOBILE);
|
|
$("#index_newUsersEmail").val(data.data.USERS_EMAIL);
|
|
}
|
|
});
|
|
},
|
|
yes: function (index) {
|
|
var usersName = $("#index_newUsersName");
|
|
if (usersName.val() == "") {
|
|
usersName.focus();
|
|
layer.tips("<span style='color:#000000;'>请输入姓名</span>", "#index_newUsersName", { tips: [2, '#ffffff'] });
|
|
return false;
|
|
}
|
|
var usersTel = $("#index_newUsersTel");
|
|
if (usersTel.val() == "") {
|
|
usersTel.focus();
|
|
layer.tips("<span style='color:#000000;'>请输入电话</span>", "#index_newUsersTel", { tips: [2, '#ffffff'] });
|
|
return false;
|
|
}
|
|
var usersEmail = $("#index_newUsersEmail");
|
|
if (usersEmail.val() == "") {
|
|
usersEmail.focus();
|
|
layer.tips("<span style='color:#000000;'>请输入邮箱</span>", "#index_newUsersEmail", { tips: [2, '#ffffff'] });
|
|
return false;
|
|
}
|
|
$.ajax({
|
|
type: "post",
|
|
url: "../ashx/SysUserHandler.ashx",
|
|
data: { Action: "Edit", usersUid: usersUid, UsersName: usersName.val(), UsersEmail: usersEmail.val(), UsersMobile: usersTel.val() },
|
|
dataType: "json",
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$("#show_own").html(usersName.val());
|
|
|
|
layer.msg("修改成功", { time: 2000 });
|
|
layer.close(index);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
});
|
|
$("a[id$='_out']").each(function () {
|
|
$(this).click(function () {
|
|
layer.open({
|
|
type: 1,
|
|
title: false,
|
|
closeBtn: false,
|
|
area: "auto",
|
|
shade: 0.3,
|
|
//id:''//设定一个id,防止重复弹出
|
|
btn: ["确定", "取消"],
|
|
btnAlign: "c",
|
|
//move:true,//false关闭拖拽/默认.layui-layer-title可不写
|
|
content: "<div style=\"padding:40px;line-height:22px;background-color:#3352AF;color:#fff;font-weight:300;font-size:16px;\">退出云平台?<br/><br/>点击“确定”退出,否者点击“取消”返回。<br/><br/>确定退出?</div>",
|
|
yes: function (index, layero) {
|
|
//跳转退出
|
|
window.location.href = "/";
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
var menuOpt = function(url,t,id,text){
|
|
//console.log(url+"======"+t+"======"+id+"======"+text);
|
|
url += "/" + text + "/" + t;
|
|
//console.log(url);
|
|
var flag = true;
|
|
var _layTab = $(".layui-tab-title li[lay-id="+id+"]");
|
|
if(_layTab.length > 0){
|
|
flag = false;
|
|
}
|
|
if(flag){
|
|
element.tabAdd("work_index_bodyTab",{
|
|
title:"<i class=\"icon_title\"></i>"+text,
|
|
content:"<iframe src=\""+url+"\" data-id=\""+id+"\"></frame>",
|
|
id:id
|
|
});
|
|
}
|
|
element.tabChange("work_index_bodyTab",id);
|
|
element.render("tab","work_index_bodyTab");
|
|
}
|
|
var show_and_work = function(t){
|
|
if(t == "work"){
|
|
$(".section_wrap1")
|
|
.add("class","section_wrap1")
|
|
.addClass(function(){
|
|
return "put_section_work";
|
|
});
|
|
}
|
|
if(t == "show"){
|
|
$(".section_wrap1")
|
|
.attr("class","section_wrap1")
|
|
.addClass(function(){
|
|
return "put_section_show";
|
|
});
|
|
}
|
|
}
|
|
|
|
var test = function (t) {
|
|
if (t == "work") {
|
|
|
|
var issuper=JSON.parse(window.sessionStorage.getItem("userInfo")).IS_SUPER;
|
|
if (issuper.indexOf("2") == -1) {
|
|
layer.tips("<span style='color:#000000'>您暂时没有相关访问权限,如要访问请联系管理员!</span>", "#zhxf", { tips: [2, "#fff"] });
|
|
return false;
|
|
}
|
|
|
|
$(".section_wrap")
|
|
.add("class", "section_wrap")
|
|
.addClass(function () {
|
|
return "put_section_work1";
|
|
});
|
|
//window.open("/clouds/signinCamp?usersUid=aksxfzd");
|
|
}
|
|
if (t == "show") {
|
|
$(".section_wrap")
|
|
.attr("class", "section_wrap")
|
|
.addClass(function () {
|
|
return "put_section_show1";
|
|
});
|
|
}
|
|
}
|
|
function camp() { //三维模型
|
|
if (window.sessionStorage.getItem("userInfo") == undefined) {
|
|
layer.msg("您未登录或登录超时请登录后使用,页面将在3秒后关闭!", { icon: 0 });
|
|
setTimeout(function () { window.location.href = "/"; }, 3000);
|
|
return;
|
|
}
|
|
|
|
var issuper = JSON.parse(window.sessionStorage.getItem("userInfo")).IS_SUPER;
|
|
if (issuper.indexOf("4") == -1) {
|
|
layer.tips("<span style='color:#000000'>您暂时没有相关访问权限,如要访问请联系管理员!</span>", "#szyq", { tips: [2, "#fff"] });
|
|
return false;
|
|
}
|
|
window.open("/visualization/3Dvisualization");
|
|
//window.open(_signInIp + ':8072');
|
|
}
|
|
|
|
function building() { //数字政工
|
|
if (window.sessionStorage.getItem("userInfo") == undefined) {
|
|
layer.msg("您未登录或登录超时请登录后使用,页面将在3秒后关闭!", { icon: 0 });
|
|
setTimeout(function () { window.location.href = "/"; }, 3000);
|
|
return;
|
|
}
|
|
|
|
var issuper = JSON.parse(window.sessionStorage.getItem("userInfo")).IS_SUPER;
|
|
if (issuper.indexOf("1") == -1) {
|
|
layer.tips("<span style='color:#000000'>您暂时没有相关访问权限,如要访问请联系管理员!</span>", "#zhdj", { tips: [2, "#fff"] });
|
|
return false;
|
|
}
|
|
window.open(_signInIp + ':7080/political/html/login.html');
|
|
}
|
|
function mhzy() { //灭火资源
|
|
if (window.sessionStorage.getItem("userInfo") == undefined) {
|
|
layer.msg("您未登录或登录超时请登录后使用,页面将在3秒后关闭!", { icon: 0 });
|
|
setTimeout(function () { window.location.href = "/"; }, 3000);
|
|
return;
|
|
}
|
|
|
|
var issuper = JSON.parse(window.sessionStorage.getItem("userInfo")).IS_SUPER;
|
|
if (issuper.indexOf("3") == -1) {
|
|
layer.tips("<span style='color:#000000'>您暂时没有相关访问权限,如要访问请联系管理员!</span>", "#mhzy", { tips: [2, "#fff"] });
|
|
return false;
|
|
}
|
|
|
|
window.open(_signInIp + ':8071/index.html');
|
|
}
|
|
|
|
function rcgl() { //一体化综合平台
|
|
if (window.sessionStorage.getItem("userInfo") == undefined) {
|
|
layer.msg("您未登录或登录超时请登录后使用,页面将在3秒后关闭!", { icon: 0 });
|
|
setTimeout(function () { window.location.href = "/"; }, 3000);
|
|
return;
|
|
}
|
|
|
|
var issuper = JSON.parse(window.sessionStorage.getItem("userInfo")).IS_SUPER;
|
|
if (issuper.indexOf("5") == -1) {
|
|
layer.tips("<span style='color:#000000'>您暂时没有相关访问权限,如要访问请联系管理员!</span>", "#rcgl", { tips: [2, "#fff"] });
|
|
return false;
|
|
}
|
|
|
|
window.open('index.html');
|
|
}
|