156 lines
5.4 KiB
JavaScript
156 lines
5.4 KiB
JavaScript
|
|
/* 工程简介 */
|
|
function loadProBrief(montageParam) {
|
|
const url = commonUrl + 'screen/largeScreen/xcIndex/getProDetails?params=' + montageParam;
|
|
ajaxRequestGet(url, "GET", true, function () {
|
|
}, function (result) {
|
|
if (result.code === 200) {
|
|
setData(result.data.data);
|
|
} else if (result.code === 500) {
|
|
console.error('工程简介:' + result.msg);
|
|
setData(null);
|
|
} else if (result.code === 401) {
|
|
loginout(1);
|
|
}
|
|
}, function (xhr, status, error) {
|
|
error(xhr, status, error)
|
|
setData(null);
|
|
}, aqEnnable);
|
|
|
|
// 项目简介赋值
|
|
function setData(data) {
|
|
let proBrief = '暂无简介', html = '';
|
|
let proImgList = [];
|
|
if (data) {
|
|
proBrief = data.proBrief ? data.proBrief : '暂无简介'
|
|
proImgList = data.fileData;
|
|
}
|
|
if (proImgList && proImgList.length > 0) {
|
|
$.each(proImgList, function (index, item) {
|
|
html += '<div><img src="' + item.base64Url + '"></div>'
|
|
})
|
|
} else {
|
|
html += '<div><img src="https://unpkg.com/outeres/demo/carousel/720x360-1.jpg"></div>'
|
|
}
|
|
$('#img-carousel').empty().append(html);
|
|
$('#pro-desc p').html(proBrief);
|
|
// 渲染 - 图片轮播
|
|
carousel.render({
|
|
elem: '#ID-carousel-demo-image',
|
|
width: '900px',
|
|
height: '360px',
|
|
interval: 3000
|
|
});
|
|
}
|
|
}
|
|
|
|
/* 实时监测 */
|
|
function loadRealMonitor(montageParam) {
|
|
const url = commonUrl + 'screen/largeScreen/xcIndex/getProJcData?params=' + montageParam;
|
|
ajaxRequestGet(url, "GET", true, function () {
|
|
}, function (result) {
|
|
if (result.code === 200) {
|
|
setData(result.data);
|
|
} else if (result.code === 500) {
|
|
console.error('实时监测' + result.msg);
|
|
setData(null);
|
|
} else if (result.code === 401) {
|
|
loginout(1);
|
|
}
|
|
}, function (xhr, status, error) {
|
|
error(xhr, status, error)
|
|
setData(null);
|
|
}, aqEnnable);
|
|
|
|
/* 实时检测赋值 */
|
|
function setData(data) {
|
|
if (data && data.length > 0) {
|
|
$.each(data, function (index, item) {
|
|
if (item.modelName === '温度') {
|
|
$('#wd').html(item.val ? item.val : 0);
|
|
} else if (item.modelName === '湿度') {
|
|
$('#sd').html(item.val ? item.val : 0);
|
|
} else if (item.modelName === '噪声') {
|
|
$('#zs').html(item.val ? item.val : 0);
|
|
} else if (item.modelName === '光照') {
|
|
$('#gz').html(item.val ? item.val : 0);
|
|
} else if (item.modelName === 'pm2') {
|
|
$('#pm2').html(item.val ? item.val : 0);
|
|
} else if (item.modelName === 'pm10') {
|
|
$('#pm10').html(item.val ? item.val : 0);
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
|
|
/* 项目风险 */
|
|
function loadProRisk(montageParam) {
|
|
const url = commonUrl + 'screen/largeScreen/xcIndex/getProRisk?params=' + montageParam;
|
|
ajaxRequestGet(url, "GET", true, function () {
|
|
}, function (result) {
|
|
if (result.code === 200) {
|
|
setData(result.data);
|
|
} else if (result.code === 500) {
|
|
console.error('项目风险' + result.msg);
|
|
} else if (result.code === 401) {
|
|
loginout(1);
|
|
}
|
|
}, function (xhr, status, error) {
|
|
error(xhr, status, error)
|
|
}, aqEnnable);
|
|
|
|
/* 项目风险赋值 */
|
|
function setData(data) {
|
|
initEchartsOne(data.day, data.week, data.warn);
|
|
}
|
|
}
|
|
|
|
/* 项目进度 */
|
|
function loadProProgress(montageParam) {
|
|
const url = commonUrl + 'screen/largeScreen/xcIndex/getProcess?params=' + montageParam;
|
|
ajaxRequestGet(url, "GET", true, function () {
|
|
}, function (result) {
|
|
if (result.code === 200) {
|
|
setData(result.data);
|
|
} else if (result.code === 500) {
|
|
console.error('项目进度:' + result.msg);
|
|
} else if (result.code === 401) {
|
|
loginout(1);
|
|
}
|
|
}, function (xhr, status, error) {
|
|
error(xhr, status, error)
|
|
}, aqEnnable);
|
|
|
|
/* 项目进度赋值 */
|
|
function setData(data) {
|
|
if (data) {
|
|
$('#planStartTime').html(data.planStartTime);
|
|
$('#planEndTime').html(data.planEndTime);
|
|
initEchartsTwo(data.value2, data.value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* 项目成本 */
|
|
function loadProCost(montageParam) {
|
|
const url = commonUrl + 'screen/largeScreen/xcIndex/getProMoney?params=' + montageParam;
|
|
ajaxRequestGet(url, "GET", true, function () {
|
|
}, function (result) {
|
|
console.log(result);
|
|
if (result.code === 200) {
|
|
setData(result.data);
|
|
} else if (result.code === 500) {
|
|
console.error('项目成本:' + result.msg);
|
|
} else if (result.code === 401) {
|
|
loginout(1);
|
|
}
|
|
}, function (xhr, status, error) {
|
|
error(xhr, status, error)
|
|
}, aqEnnable);
|
|
function setData(data) {
|
|
let nameList = ['黄家村', '曹家村', '吕家村', '大草坝村', '庙坡村', '廉家庄村', '莲花池村', '小西关村', '杜家漕村', '栗子园村', '翟家寺村'];
|
|
let valueList = ['2', '3', '1', '1', '2', '2', '2', '6', '5', '3', '2'];
|
|
initEchartsThree(nameList,valueList);
|
|
}
|
|
} |