IntelligentRecognition/ah-jjsp-web/bns/js/projectInformation/proInfoMgeStyle.js

141 lines
4.3 KiB
JavaScript
Raw Permalink Normal View History

2024-05-24 16:09:40 +08:00
// 切换工程总览、工程信息
function changePage(that, type) {
// $('#change-page button').each(function () {
// $(this).css('background-color', '#e3e3e3')
// })
// $(that).css('background-color', '#b8dffc')
if (type === 1) {
$('#pro-view').css('display', 'block')
$('#pro-info').css('display', 'none')
$('#edit-img').css('display', 'none')
$('#btn-div').css('display', 'none')
$('#pro-detail-edit').css('display', 'none')
getProOverViewData();
getProByUnitData();
} else if (type === 2) {
$('#pro-view').css('display', 'none')
$('#pro-info').css('display', 'block')
$('#pro-detail').removeAttr('style')
// pages(1, 10, 1);
}
pageType = type + '';
}
// 地市选中
function checkedOrgData(that) {
if(checkYear){
isChecked = true;
$('.org-child-p').each(function () {
if ($(this).hasClass('org-child-p-checked')) {
$(this).removeClass('org-child-p-checked');
}
})
$(that).addClass('org-child-p-checked')
checkOrg = $(that).attr('orgNum')
getProNumByOrgAjax();
}
}
// 输变电工程选中
function checkedPowerData(that, data) {
singProData = data;
if (pageType === '2') {
$('.power-child-p').each(function () {
if ($(this).hasClass('power-child-p-checked')) {
$(this).removeClass('power-child-p-checked');
}
})
$(that).addClass('power-child-p-checked')
if (checkProStatus && checkYear && checkOrg) {
checkProNo = $(that).attr('proNo')
}
resetForm();
if (checkProNo) {
// pages(1, 10, 1);
initTable();
}
} else {
$('#change-page button').eq(1).trigger('click');
}
}
// 工程选中
function checkedData(that, value) {
isChecked = true;
$('.child-p').each(function () {
if ($(this).hasClass('child-p-checked')) {
$(this).removeClass('child-p-checked');
}
})
$('.parent-p').each(function () {
if ($(this).hasClass('parent-p-checked')) {
$(this).removeClass('parent-p-checked');
}
})
$(that).addClass('child-p-checked')
$('.' + value + '').addClass('parent-p-checked');
checkProStatus = $(that).attr("proStatus");
checkYear = $(that).attr("year");
getOrgProNumAjax();
}
// 展开工程
function openPro(that, type) {
if (type === 1) {
if ($('#build-pro-child').find('.child-p').length > 0) {
$(that).css("display", 'none');
$(that).next().css('display', 'block');
$('#build-pro-child').slideDown().css('display', 'block');
}
} else if (type === 2) {
if ($('#tg-pro-child').find('.child-p').length > 0) {
$(that).css("display", 'none');
$(that).next().css('display', 'block');
$('#tg-pro-child').slideDown().css('display', 'block');
}
} else if (type === 3) {
if ($('#tc-pro-child').find('.child-p').length > 0) {
$(that).css("display", 'none');
$(that).next().css('display', 'block');
$('#tc-pro-child').slideDown().css('display', 'block');
}
}else if (type === 0) {
if ($('#dkg-pro-child').find('.child-p').length > 0) {
$(that).css("display", 'none');
$(that).next().css('display', 'block');
$('#dkg-pro-child').slideDown().css('display', 'block');
}
}
}
// 收起工程
function closePro(that, type) {
$(that).css("display", 'none');
$(that).prev().css('display', 'block');
if (type === 1) {
$('#build-pro-child').slideUp().css('display', 'none');
} else if (type === 2) {
$('#tg-pro-child').slideUp().css('display', 'none');
} else if (type === 3) {
$('#tc-pro-child').slideUp().css('display', 'none');
}else if(type === 0){
$('#dkg-pro-child').slideUp().css('display', 'none');
}
}
// 通过点击工程类型展开和收起
function isOpenPro(that, type, name) {
let style = $('#' + name).attr('style');
if (style === "display: block;") {
closePro($(that).prev(), type);
} else if (style === "display: none;") {
openPro($(that).prev().prev(), type)
} else {
openPro($(that).prev().prev(), type)
}
}