$(function () {
//预警
//war();
wa_fotown_inforceList();
war3();
})
var cuWf = "";
function wa_fotown_inforceList() {
$.getJSON("/warning/wa_fotown_inforce.js?t=" + Math.random(), function (json) {
if (json) {
$.each(json, function (key, value) {
if (value[2] != "-1") {
var code = value[0] + value[2];
$("
").appendTo($(".wa_fotown"));
}
//else {
// code = value[0]+"0";
// $("").appendTo($(".wa_fotown"));
//}
})
$("").appendTo($(".wa_fotown"));
}
if (cuWf == "null")
{
var ahref = $(".wa_fotown li a:first").attr("href");
if(ahref!=undefined)
location.href = ahref;
}
$("." + cuWf).addClass("on");
})
//统计
return;
var color_valArry = ["#ffffff", "#025bc4", "#fff906", "#f8991e", "#e51610"];
var color_textArry = ["白", "蓝", "黄", "橙", "红"];
$.getJSON("/warning/wa_fotown_inforce_Count.js?t="+Math.random(), function (json) {
if (json) {
$.each(json, function (key, value) {
if (value[0] == cuWf.substr(0, 1)) {//当前预报类型
var sCount = 0;
//$(".wfType").html(value[1]);
for (var i = 2; i < 7; i++) {
if (value[i] != 0) $("" + color_textArry[i-2] + " | " + value[i] + " |
").appendTo(".currWfInfo");
sCount += value[i];
}
$("共计 | " + sCount + " |
").appendTo(".currWfInfo");
}
$("" + value[1] + " | " + value[2] + " | " + value[3] + " | " + value[4] + " | " + value[5] + " | " + value[6] + " |
").appendTo($(".wa_fotown_count"));
})
}
})
}
function war3() {
var dq = [{ "id": "CCSW", "cn": "石湾", "dist": "禅城区", "territory_id": "440604" }, { "id": "CCZC", "cn": "张槎", "dist": "禅城区", "territory_id": "440604" }, { "id": "CCNZ", "cn": "南庄", "dist": "禅城区", "territory_id": "440604" }, { "id": "CCZM", "cn": "祖庙", "dist": "禅城区", "territory_id": "440604" }, { "id": "NHLS", "cn": "里水", "dist": "南海区", "territory_id": "440605" }, { "id": "NHXQ", "cn": "西樵", "dist": "南海区", "territory_id": "440605" }, { "id": "NHJJ", "cn": "九江", "dist": "南海区", "territory_id": "440605" }, { "id": "NHDZ", "cn": "丹灶", "dist": "南海区", "territory_id": "440605" }, { "id": "NHDL", "cn": "大沥", "dist": "南海区", "territory_id": "440605" }, { "id": "NHSS", "cn": "狮山", "dist": "南海区", "territory_id": "440605" }, { "id": "NHGC", "cn": "桂城", "dist": "南海区", "territory_id": "440605" }, { "id": "SDJA", "cn": "均安", "dist": "顺德区", "territory_id": "440606" }, { "id": "SDDL", "cn": "大良", "dist": "顺德区", "territory_id": "440606" }, { "id": "SDRG", "cn": "容桂", "dist": "顺德区", "territory_id": "440606" }, { "id": "SDLL", "cn": "勒流", "dist": "顺德区", "territory_id": "440606" }, { "id": "SDLJ", "cn": "伦教", "dist": "顺德区", "territory_id": "440606" }, { "id": "SDCC", "cn": "陈村", "dist": "顺德区", "territory_id": "440606" }, { "id": "SDXT", "cn": "杏坛", "dist": "顺德区", "territory_id": "440606" }, { "id": "SDLZ", "cn": "龙江", "dist": "顺德区", "territory_id": "440606" }, { "id": "SDLC", "cn": "乐从", "dist": "顺德区", "territory_id": "440606" }, { "id": "SDBJ", "cn": "北滘", "dist": "顺德区", "territory_id": "440606" }, { "id": "SSYD", "cn": "云东海", "dist": "三水区", "territory_id": "440607" }, { "id": "SSDT", "cn": "大塘", "dist": "三水区", "territory_id": "440607" }, { "id": "SSLP", "cn": "乐平", "dist": "三水区", "territory_id": "440607" }, { "id": "SSBN", "cn": "白坭", "dist": "三水区", "territory_id": "440607" }, { "id": "SSNS", "cn": "南山", "dist": "三水区", "territory_id": "440607" }, { "id": "SSXN", "cn": "西南", "dist": "三水区", "territory_id": "440607" }, { "id": "SSLB", "cn": "芦苞", "dist": "三水区", "territory_id": "440607" }, { "id": "GMYH", "cn": "杨和", "dist": "高明区", "territory_id": "440608" }, { "id": "GMGH", "cn": "更合", "dist": "高明区", "territory_id": "440608" }, { "id": "GMMC", "cn": "明城", "dist": "高明区", "territory_id": "440608" }, { "id": "GMHC", "cn": "荷城", "dist": "高明区", "territory_id": "440608" }];
var wa_type = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"];
var jiezhan = new Array("B", "E", "G", "I");//滚动街镇类型
var fenqu = new Array("A", "C", "D", "F","H","J");//滚动分区类型
var wa_fo_area = { "BFFO": "禅城", "GDNH": "南海", "GDSD": "顺德", "GDGM": "高明", "GDSS": "三水" };
sContent01 = "";
var ss = "", nh = "", fo = "", gm = "", sd = "";
var div_cc = "", div_nh = "", div_fo = "", div_gm = "", div_sd = "";
var hy_xx = "";
$.getJSON("/warning/wa_fotown_inforce_all.js?t="+Math.random(), function (json) {
if (json) {
$.each(dq, function (key, value) {
var th_area = this.id;
if (this.dist == "禅城区") {
fo += "" + this.cn + "
";
}
if (this.dist == "南海区") {
nh += "" + this.cn + "
";
}
if (this.dist == "顺德区") {
sd += "" + this.cn + "
";
}
if (this.dist == "三水区") {
ss += "" + this.cn + "
";
}
if (this.dist == "高明区") {
gm += "" + this.cn + "
";
}
});
//当前信号预警街镇
//去除A台风,C高温,D寒冷,F灰霾,H道路结冰,J森林火险
$.each(json, function (key, value) {
var curr_type = value.code.substr(0, 1);
if (jiezhan.indexOf(curr_type)!="-1") {
if (curr_type == cuWf.substr(0, 1)) {//当前预报类型
if (value.code.substr(0, 1))
$(".warningArea").append("" + value.cn + new Date(value.datetime.replace(/-/g, "/")).Format(" MM月dd日 hh:mm:ss") + " " + "");
}
}
})
//$.each(json, function (key, value) {
// if (value["station_code"] == "GDSS") {
// $.each(hy, function (key2, value2) {
// if (value["code"] == value2["id"]) {
// hy_xx = value2["meaning"];
// return false;
// }
// });
// ss += "" + new Date(value["datetime"].replace(/-/g, "/")).Format("MM月dd日hh时mm分") + "
";
// ss += "
佛山市气象台" + new Date(value["datetime"].replace(/-/g, "/")).Format("MM月dd日hh时mm分") + "发布三水" + value["name"] + "
";
// } else if (value["station_code"] == "GDNH") {
// $.each(hy, function (key2, value2) {
// if (value["code"] == value2["id"]) {
// hy_xx = value2["meaning"];
// return false;
// }
// });
// nh += "" + new Date(value["datetime"].replace(/-/g, "/")).Format("MM月dd日hh时mm分") + "
";
// nh += "
佛山市气象台" + new Date(value["datetime"].replace(/-/g, "/")).Format("MM月dd日hh时mm分") + "发布南海" + value["name"] + "
";
// } else if (value["station_code"] == "BFFO") {
// $.each(hy, function (key2, value2) {
// if (value["code"] == value2["id"]) {
// hy_xx = value2["meaning"];
// return false;
// }
// });
// fo += "" + new Date(value["datetime"].replace(/-/g, "/")).Format("MM月dd日hh时mm分") + "
";
// fo += "
佛山市气象台" + new Date(value["datetime"].replace(/-/g, "/")).Format("MM月dd日hh时mm分") + "发布禅城" + value["name"] + "
";
// } else if (value["station_code"] == "GDGM") {
// $.each(hy, function (key2, value2) {
// if (value["code"] == value2["id"]) {
// hy_xx = value2["meaning"];
// return false;
// }
// });
// gm += "" + new Date(value["datetime"].replace(/-/g, "/")).Format("MM月dd日hh时mm分") + "
";
// gm += "
佛山市气象台" + new Date(value["datetime"].replace(/-/g, "/")).Format("MM月dd日hh时mm分") + "发布高明" + value["name"] + "
";
// } else if (value["station_code"] == "GDSD") {
// $.each(hy, function (key2, value2) {
// if (value["code"] == value2["id"]) {
// hy_xx = value2["meaning"];
// return false;
// }
// });
// sd += "" + new Date(value["datetime"].replace(/-/g, "/")).Format("MM月dd日hh时mm分") + "
";
// sd += "
佛山市气象台" + new Date(value["datetime"].replace(/-/g, "/")).Format("MM月dd日hh时mm分") + "发布顺德" + value["name"] + "
";
// }
//})
//sContent01 += "预警信号
";
//if (fo != "")
sContent01 = "";
//if (nh != "")
sContent01 += "";
//if (sd != "")
sContent01 += "";
//if (ss != "")
sContent01 += "";
//if (gm != "")
sContent01 += "";
//禅城,南海、顺德、三水、高明
$("#qxShow3").append(sContent01);
//$('.wa_l .pic').cluetip({
// splitTitle: '|',
// cluetipClass: "taifeng",
// width: '250'
//});
}
});
//当前信号预警分区滚动
//只显示A台风,C高温,D寒冷,F灰霾,H道路结冰,J森林火险
$.getJSON("/weather/data/wa_fo_inforce.js?t=" + Math.random(), function (json) {
$.each(json, function (key, value) {
var curr_type = value.code.substr(0, 1);
if (fenqu.indexOf(curr_type) != "-1") {
if (curr_type == cuWf.substr(0, 1)) {//当前预报类型
if (value.code.substr(0, 1))
$(".warningArea").append("" + wa_fo_area[value.station_code] + new Date(value.datetime.replace(/-/g, "/")).Format(" MM月dd日 hh:mm:ss") + " " + "");
}
}
});
jQuery(".warningScroll").slide({ mainCell: ".bd ul", autoPlay: true, effect: "leftMarquee", interTime: 30 });
})
}