$.ajaxSetup({ headers: { 'x-access-token': localStorage.getItem("hxzkmars3d") } }); setTimeout(function (){ //详细信息 if (detail == "1"){ $("#xxcheck1").show() $("#xxnocheck1").hide() }else{ $("#xxcheck1").hide() $("#xxnocheck1").show() } //离线消失 if (Disappear == "1"){ $("#xxcheck2").show() $("#xxnocheck2").hide() }else{ $("#xxcheck2").hide() $("#xxnocheck2").show() } //开启语音 if (voice == "1"){ $("#xxcheck3").show() $("#xxnocheck3").hide() }else{ $("#xxcheck3").hide() $("#xxnocheck3").show() } //显示围栏 if (showfence == "1"){ $("#xxcheck4").show() $("#xxnocheck4").hide() }else{ $("#xxcheck4").hide() $("#xxnocheck4").show() } //显示基站 if (showanchor == "1"){ $("#xxcheck5").show() $("#xxnocheck5").hide() }else{ $("#xxcheck5").hide() $("#xxnocheck5").show() } //网关显示 if (showgetway == "1"){ $("#xxcheck6").show() $("#xxnocheck6").hide() }else{ $("#xxcheck6").hide() $("#xxnocheck6").show() } //速度显示 if (sudu == "1"){ $("#xxcheck7").show() $("#xxnocheck7").hide() }else{ $("#xxcheck7").hide() $("#xxnocheck7").show() } },1000) function check1(){ var displayValues = $("#xxcheck1").css("display"); let num = 0; if (displayValues == "none"){ //勾选显示详细信息 num = 1; }else{ //取消显示详细信息 num = 0; } let data = "detail="+num $.post("/hxzkuwb/UpMarsHomeSet",data) .done(function (response) { // 请求成功时执行的代码 notify.confirm({ msg:"设置成功!确定后刷新页面生效", shadow:true, position:"vcenter", },function() { location.reload() }); }) .fail(function (jqXHR, textStatus, errorThrown) { // 请求失败时执行的代码 notify.error("设置失败!请联系管理员") }) } function check2(){ var displayValues = $("#xxcheck2").css("display"); if (displayValues == "none"){ Disappear= 1 }else{ Disappear = 0 } let data = "offlinehide="+Disappear $.post("/hxzkuwb/UpMarsHomeSet",data) .done(function (response) { // 请求成功时执行的代码 $("#xxcheck2").toggle() $("#xxnocheck2").toggle() notify.success({ msg:"设置成功!更新后生效", closable:true, shadow:true, duration:2000, position:"vcenter", }) }) .fail(function (jqXHR, textStatus, errorThrown) { // 请求失败时执行的代码 notify.error("设置失败!请联系管理员") }) } function check3(){ var displayValues = $("#xxcheck3").css("display"); let num = 0; if (displayValues == "none") { //勾选显示围栏 voice = 1; speakTexts() } else { //取消显示围栏 voice = 0; speakTexts() } let data = "voice="+voice $.post("/hxzkuwb/UpMarsHomeSet",data) .done(function (response) { // 请求成功时执行的代码 $("#xxcheck3").toggle() $("#xxnocheck3").toggle() notify.success({ msg:"设置成功!已生效", closable:true, shadow:true, duration:2000, position:"vcenter", }) }) .fail(function (jqXHR, textStatus, errorThrown) { // 请求失败时执行的代码 notify.error("设置失败!请联系管理员") }) } function check4() { var displayValues = $("#xxcheck4").css("display"); let num = 0; if (displayValues == "none") { //勾选显示围栏 addfence() num = 1; } else { //取消显示围栏 num = 0; graphicLayerFence.clear() } let data = "showfence="+num $.post("/hxzkuwb/UpMarsHomeSet",data) .done(function (response) { // 请求成功时执行的代码 $("#xxcheck4").toggle() $("#xxnocheck4").toggle() notify.success({ msg:"设置成功!已生效", closable:true, shadow:true, duration:2000, position:"vcenter", }) }) .fail(function (jqXHR, textStatus, errorThrown) { // 请求失败时执行的代码 notify.error("设置失败!请联系管理员") }) } function check5(){ var displayValues = $("#xxcheck5").css("display"); let num = 0; if (displayValues == "none") { addAnchor() num = 1; } else { graphicLayerAnchor.clear() num = 0 } let data = "showanchor="+num $.post("/hxzkuwb/UpMarsHomeSet",data) .done(function (response) { // 请求成功时执行的代码 $("#xxcheck5").toggle() $("#xxnocheck5").toggle() notify.success({ msg:"设置成功!已生效", closable:true, shadow:true, duration:2000, position:"vcenter", }) }) .fail(function (jqXHR, textStatus, errorThrown) { // 请求失败时执行的代码 notify.error("设置失败!请联系管理员") }) } function check6(){ var displayValues = $("#xxcheck6").css("display"); let num = 0; if (displayValues == "none") { addGetWay() num = 1 } else { graphicLayerGetWay.clear() num = 0 } let data = "showgateway="+num $.post("/hxzkuwb/UpMarsHomeSet",data) .done(function (response) { // 请求成功时执行的代码 $("#xxcheck6").toggle() $("#xxnocheck6").toggle() notify.success({ msg:"设置成功!已生效", closable:true, shadow:true, duration:2000, position:"vcenter", }) }) .fail(function (jqXHR, textStatus, errorThrown) { // 请求失败时执行的代码 notify.error("设置失败!请联系管理员") }) } function check7(){ var displayValues = $("#xxcheck7").css("display"); let num = 0; if (displayValues == "none") { num = 1 } else { num = 0 } let data = "sudu="+num $.post("/hxzkuwb/UpMarsHomeSet",data) .done(function (response) { // 请求成功时执行的代码 $("#xxcheck7").toggle() $("#xxnocheck7").toggle() notify.success({ msg:"设置成功!已生效", closable:true, shadow:true, duration:2000, position:"vcenter", }) }) .fail(function (jqXHR, textStatus, errorThrown) { // 请求失败时执行的代码 notify.error("设置失败!请联系管理员") }) }