112 lines
4.3 KiB
Plaintext
112 lines
4.3 KiB
Plaintext
/*地图风险等级选中*/
|
|
$(".check-risk").click(function (e) {
|
|
let checkedName = $(this).find('p').eq(0).attr("checkedName");
|
|
let isCheck = $(this).attr("isCheck");
|
|
if (checkedName === '' && isCheck === '1') {
|
|
$('.check-risk').each(function () {
|
|
if ($(this).attr("isCheck") === '1') {
|
|
$(this).attr("isCheck", '0')
|
|
let checkedValue = $(this).find('p').eq(0).attr("checkedName");
|
|
$(this).find('img').eq(0).attr("src", setRiskIcon(checkedValue, 1))
|
|
}
|
|
})
|
|
} else if (checkedName === '' && isCheck === '0') {
|
|
$('.check-risk').each(function () {
|
|
if ($(this).attr("isCheck") === '0') {
|
|
$(this).attr("isCheck", '1')
|
|
let checkedValue = $(this).find('p').eq(0).attr("checkedName");
|
|
$(this).find('img').eq(0).attr("src", setRiskIcon(checkedValue, 2))
|
|
}
|
|
})
|
|
} else if (checkedName !== '' && isCheck === '1') {
|
|
$(this).attr("isCheck", '0')
|
|
$(this).find('img').eq(0).attr("src", setRiskIcon(checkedName, 1))
|
|
} else if (checkedName !== '' && isCheck === '0') {
|
|
$(this).attr("isCheck", '1')
|
|
$(this).find('img').eq(0).attr("src", setRiskIcon(checkedName, 2))
|
|
}
|
|
mapSearch();
|
|
map2(mapPointList);
|
|
});
|
|
|
|
/*风险等级选中*/
|
|
function mapSearch() {
|
|
let selRiskList = [];
|
|
mapPointList.splice(0, mapPointList.length);
|
|
$('.check-risk').each(function () {
|
|
if ($(this).attr("isCheck") === '1') {
|
|
if ($(this).find('p').eq(0).attr("checkedName")) {
|
|
selRiskList.push($(this).find('p').eq(0).attr("checkedName"))
|
|
}
|
|
}
|
|
})
|
|
if (selRiskList.length) {
|
|
$.each(selRiskList, function (index, item) {
|
|
let dataList = mainMapPointList.filter(item2 => {
|
|
return item2.riskType === item
|
|
})
|
|
$.each(dataList, function (index3, item3) {
|
|
mapPointList.push(item3)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
// 设置风险等级选中样式
|
|
function setRiskIcon(value, type) {
|
|
if (value && type === 1) {
|
|
return '../../img/title-btn/no-check/risk-' + value + '-nocheck.png';
|
|
} else if (!value && type === 1) {
|
|
return '../../img/title-btn/no-check/risk-1-nocheck.png';
|
|
} else if (value && type === 2) {
|
|
return '../../img/title-btn/check/risk-' + value + '-check.png';
|
|
} else if (!value && type === 2) {
|
|
return '../../img/title-btn/check/risk-1-check.png';
|
|
}
|
|
}
|
|
|
|
// 其他-选中标签模块
|
|
function checkLabel(that, value, moduleValue) {
|
|
$('#other-module ul li').each(function (index, item) {
|
|
let labelValue = $(this).attr('labelValue'), isChecked = $(this).attr('isChecked');
|
|
if (value !== labelValue) {
|
|
$(this).css({ 'background': 'url("../../img/cityHome/label_no_checked.png") no-repeat 0 0 / 100% 100%' });
|
|
}
|
|
})
|
|
$(that).css('background', 'url("../../img/cityHome/label_checked.png") no-repeat 0 0 / 100% 100%');
|
|
|
|
$('#other-echarts .other-div').each(function (index, item) {
|
|
let moduleValue = $(this).attr('moduleValue');
|
|
if (value !== moduleValue) {
|
|
$(this).css({ 'display': 'none' });
|
|
}
|
|
})
|
|
myChart.dispose();
|
|
myChart3.dispose();
|
|
myChart4.dispose();
|
|
myChart5.dispose();
|
|
$('#other-' + moduleValue).css({ 'display': '' });
|
|
if (value === '1') {
|
|
myChart = echarts.init(document.getElementById('person-echarts'));
|
|
} else if (value === '2') {
|
|
myChart3 = echarts.init(document.getElementById('team-echarts'));
|
|
} else if (value === '3') {
|
|
myChart4 = echarts.init(document.getElementById('ticket-echarts'));
|
|
} else if (value === '4') {
|
|
myChart5 = echarts.init(document.getElementById('risk-echarts'));
|
|
}
|
|
loadOtherAjax(value);
|
|
}
|
|
|
|
|
|
// 预警提醒-选中标签模块
|
|
function checkEarlyLabel(that, value) {
|
|
$('#early-module ul li').each(function (index, item) {
|
|
let labelValue = $(this).attr('labelValue');
|
|
if (value !== labelValue) {
|
|
$(this).css({ 'background': 'url("../../img/cityHome/label_no_checked.png") no-repeat 0 0 / 100% 100%' });
|
|
}
|
|
})
|
|
$(that).css('background', 'url("../../img/cityHome/label_checked.png") no-repeat 0 0 / 100% 100%');
|
|
loadEarlyAjax(value);
|
|
} |