2025-10-13 09:33:54 +08:00
|
|
|
|
let element, layer, laydate;
|
2025-10-17 16:10:55 +08:00
|
|
|
|
const bidCode = parent.$("#bidPro").val();
|
2025-10-13 09:33:54 +08:00
|
|
|
|
var table;
|
|
|
|
|
|
var alarmTableIns;
|
|
|
|
|
|
var qualityInspectionTableIns;
|
|
|
|
|
|
var historyTableIns;
|
|
|
|
|
|
let thePileFoundationIsMadeIntoHoles = 1906002; //桩基成孔
|
|
|
|
|
|
let groundAcceptance = 1906003; //地面验收
|
|
|
|
|
|
let concretePouring = 1906004; //混凝土浇筑
|
2025-10-17 16:10:55 +08:00
|
|
|
|
layui.use(["layer", "element", "table"], function () {
|
2025-10-13 09:33:54 +08:00
|
|
|
|
element = layui.element;
|
|
|
|
|
|
layer = layui.layer;
|
|
|
|
|
|
laydate = layui.laydate;
|
|
|
|
|
|
table = layui.table;
|
|
|
|
|
|
|
2025-10-17 16:10:55 +08:00
|
|
|
|
document.getElementById("myButton").addEventListener("click", function () {
|
2025-10-13 09:33:54 +08:00
|
|
|
|
// window.location.href = "../consQuality/consQualityList.html";
|
|
|
|
|
|
layer.open({
|
|
|
|
|
|
type: 1,
|
2025-10-17 16:10:55 +08:00
|
|
|
|
title: "历史记录", //显示标题栏
|
2025-10-13 09:33:54 +08:00
|
|
|
|
closeBtn: 1,
|
2025-10-17 16:10:55 +08:00
|
|
|
|
area: ["90%", "90%"],
|
|
|
|
|
|
id: "HISTORY_layui", //设定一个id,防止重复弹出
|
2025-10-13 09:33:54 +08:00
|
|
|
|
resize: false,
|
|
|
|
|
|
// btn: ['确定'],
|
2025-10-17 16:10:55 +08:00
|
|
|
|
btnAlign: "c",
|
2025-10-13 09:33:54 +08:00
|
|
|
|
moveType: 0, //拖拽模式,0或者1
|
2025-10-17 16:10:55 +08:00
|
|
|
|
skin: "my-skin child-skin ",
|
2025-10-13 09:33:54 +08:00
|
|
|
|
content: $("#divDialog"),
|
|
|
|
|
|
success: function (layero) {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
initHistory();
|
|
|
|
|
|
$("th").css("color", "#000");
|
|
|
|
|
|
$(".layui-table").css("color", "#000");
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
|
|
|
|
|
yes: function (layero, index) {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
layer.close("HISTORY_layui");
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
|
|
|
|
|
cancel: function () {
|
|
|
|
|
|
// 右上角关闭事件的逻辑
|
2025-10-17 16:10:55 +08:00
|
|
|
|
layer.close("HISTORY_layui");
|
|
|
|
|
|
},
|
|
|
|
|
|
end: function () {
|
|
|
|
|
|
$("th").css("color", "#fff");
|
|
|
|
|
|
$(".layui-table").css("color", "#fff");
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// $('#ID-laydate-type-datetime').val(getNowDay());
|
2025-10-17 16:10:55 +08:00
|
|
|
|
// 响应成功后的拦截器
|
2025-10-13 09:33:54 +08:00
|
|
|
|
$.ajaxSetup({
|
2025-10-17 16:10:55 +08:00
|
|
|
|
beforeSend: function (xhr, options) {
|
|
|
|
|
|
var originalSuccess = options.success;
|
|
|
|
|
|
options.success = function (data, textStatus, jqXhr) {
|
|
|
|
|
|
data = modifyResponseData(data);
|
|
|
|
|
|
// success(data,textStatus, jqXhr);
|
|
|
|
|
|
originalSuccess.apply(this, arguments);
|
|
|
|
|
|
};
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
2025-10-13 09:33:54 +08:00
|
|
|
|
//下拉选
|
|
|
|
|
|
getConstruction();
|
|
|
|
|
|
getRegion();
|
|
|
|
|
|
|
|
|
|
|
|
//告警列表
|
|
|
|
|
|
AlarmList();
|
|
|
|
|
|
|
|
|
|
|
|
//施工质量列表
|
|
|
|
|
|
ConstructionQualityList();
|
|
|
|
|
|
|
|
|
|
|
|
//检测记录对比
|
2025-10-17 16:10:55 +08:00
|
|
|
|
detectionRecord("", "");
|
2025-10-13 09:33:54 +08:00
|
|
|
|
|
|
|
|
|
|
//质量检测
|
|
|
|
|
|
qualityInspectionApi();
|
|
|
|
|
|
list = {};
|
|
|
|
|
|
var month = [];
|
|
|
|
|
|
var list1 = [];
|
|
|
|
|
|
var list2 = [];
|
|
|
|
|
|
|
2025-10-17 16:10:55 +08:00
|
|
|
|
for (let i = 0; i < list.length; i++) {}
|
2025-10-13 09:33:54 +08:00
|
|
|
|
|
|
|
|
|
|
// laydate.render({
|
|
|
|
|
|
// elem: '#ID-laydate-type-datetime',
|
|
|
|
|
|
// value: getNowDay() // 设置默认值为当天
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
laydate.render({
|
2025-10-17 16:10:55 +08:00
|
|
|
|
elem: "#ID-laydate-rangeLinked",
|
|
|
|
|
|
range: ["#ID-laydate-start-date-1", "#ID-laydate-end-date-1"],
|
|
|
|
|
|
rangeLinked: true, // 开启日期范围选择时的区间联动标注模式 --- 2.8+ 新增
|
|
|
|
|
|
});
|
2025-10-13 09:33:54 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//下拉选
|
2025-10-17 16:10:55 +08:00
|
|
|
|
function getConstruction() {
|
2025-10-13 09:33:54 +08:00
|
|
|
|
const url = commonUrl + "system/sys/select/getBuildLists"; // 建管单位url
|
2025-10-17 16:10:55 +08:00
|
|
|
|
ajaxRequest(
|
|
|
|
|
|
url,
|
|
|
|
|
|
"get",
|
|
|
|
|
|
null,
|
|
|
|
|
|
true,
|
|
|
|
|
|
function () {},
|
|
|
|
|
|
function (result) {
|
|
|
|
|
|
if (result.code === 200) {
|
|
|
|
|
|
let html = "";
|
|
|
|
|
|
if (result.data && result.data.length > 0) {
|
|
|
|
|
|
$.each(result.data, function (index, item) {
|
|
|
|
|
|
html +=
|
|
|
|
|
|
'<option value="' +
|
|
|
|
|
|
item.orgId +
|
|
|
|
|
|
'">' +
|
|
|
|
|
|
item.name +
|
|
|
|
|
|
"</option>";
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#construction").empty().append(html);
|
|
|
|
|
|
layui.form.render();
|
|
|
|
|
|
} else if (result.code === 500) {
|
|
|
|
|
|
layer.msg(result.msg, { icon: 2 });
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
2025-10-17 16:10:55 +08:00
|
|
|
|
},
|
|
|
|
|
|
function (xhr) {
|
|
|
|
|
|
error(xhr);
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
2025-10-17 16:10:55 +08:00
|
|
|
|
);
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-17 16:10:55 +08:00
|
|
|
|
function getRegion() {
|
2025-10-13 09:33:54 +08:00
|
|
|
|
const url = commonUrl + "system/sys/select/getAreaLists"; // 建管单位url
|
2025-10-17 16:10:55 +08:00
|
|
|
|
ajaxRequest(
|
|
|
|
|
|
url,
|
|
|
|
|
|
"get",
|
|
|
|
|
|
null,
|
|
|
|
|
|
true,
|
|
|
|
|
|
function () {},
|
|
|
|
|
|
function (result) {
|
|
|
|
|
|
if (result.code === 200) {
|
|
|
|
|
|
let html = "";
|
|
|
|
|
|
if (result.data && result.data.length > 0) {
|
|
|
|
|
|
$.each(result.data, function (index, item) {
|
|
|
|
|
|
html +=
|
|
|
|
|
|
'<option value="' +
|
|
|
|
|
|
item.orgId +
|
|
|
|
|
|
'">' +
|
|
|
|
|
|
item.name +
|
|
|
|
|
|
"</option>";
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#region").empty().append(html);
|
|
|
|
|
|
layui.form.render();
|
|
|
|
|
|
} else if (result.code === 500) {
|
|
|
|
|
|
layer.msg(result.msg, { icon: 2 });
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
2025-10-17 16:10:55 +08:00
|
|
|
|
},
|
|
|
|
|
|
function (xhr) {
|
|
|
|
|
|
error(xhr);
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
2025-10-17 16:10:55 +08:00
|
|
|
|
);
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//质量检测
|
2025-10-17 16:10:55 +08:00
|
|
|
|
function qualityInspectionApi() {
|
|
|
|
|
|
const url =
|
|
|
|
|
|
commonUrl + "screen/largeScreen/constructionQuality/qualityInspection";
|
2025-10-13 09:33:54 +08:00
|
|
|
|
const params = {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
roleCode: roleCode,
|
|
|
|
|
|
orgId: orgId,
|
|
|
|
|
|
userId: userId,
|
|
|
|
|
|
bidCode: bidCode,
|
|
|
|
|
|
};
|
2025-10-13 09:33:54 +08:00
|
|
|
|
let encryptStr = encryptCBC(JSON.stringify(params));
|
2025-10-17 16:10:55 +08:00
|
|
|
|
ajaxRequest(
|
|
|
|
|
|
url,
|
|
|
|
|
|
"POST",
|
|
|
|
|
|
encryptStr,
|
|
|
|
|
|
true,
|
|
|
|
|
|
function () {},
|
|
|
|
|
|
function (result) {
|
|
|
|
|
|
console.log(result);
|
|
|
|
|
|
if (result.code === 200) {
|
|
|
|
|
|
qualityInspection(result.data);
|
|
|
|
|
|
} else if (result.code === 500) {
|
|
|
|
|
|
layer.msg(result.msg, { icon: 2 });
|
|
|
|
|
|
} else if (result.code === 401) {
|
|
|
|
|
|
loginout(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
function (xhr, status, error) {
|
|
|
|
|
|
error(xhr, status, error);
|
|
|
|
|
|
},
|
|
|
|
|
|
"application/json",
|
|
|
|
|
|
aqEnnable
|
|
|
|
|
|
);
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function qualityInspection(environmentData) {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
// 获取存放设备的父元素
|
|
|
|
|
|
var environmentContainer = document.querySelector(".environment");
|
|
|
|
|
|
// 遍历数据,生成设备元素并添加到页面中
|
2025-10-13 09:33:54 +08:00
|
|
|
|
for (var i = 0; i < environmentData.length; i += 3) {
|
|
|
|
|
|
// 创建一个新的 div 作为一组设备信息的容器
|
2025-10-17 16:10:55 +08:00
|
|
|
|
var groupElement = document.createElement("div");
|
|
|
|
|
|
groupElement.style.width = "100%";
|
|
|
|
|
|
groupElement.style.height = "50%";
|
|
|
|
|
|
groupElement.className = "layout";
|
2025-10-13 09:33:54 +08:00
|
|
|
|
|
|
|
|
|
|
// 将每组四个设备信息添加到容器中
|
|
|
|
|
|
for (var j = i; j < i + 3 && j < environmentData.length; j++) {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
var deviceElement = document.createElement("div");
|
|
|
|
|
|
deviceElement.className = "monitor-data layout";
|
2025-10-13 09:33:54 +08:00
|
|
|
|
deviceElement.id = environmentData[j].deviceId;
|
2025-10-17 16:10:55 +08:00
|
|
|
|
var monitorIconElement = document.createElement("div");
|
|
|
|
|
|
monitorIconElement.className = "monitor-icon";
|
|
|
|
|
|
var pElement = document.createElement("p");
|
2025-10-13 09:33:54 +08:00
|
|
|
|
pElement.textContent = environmentData[j].deviceName;
|
|
|
|
|
|
|
2025-10-17 16:10:55 +08:00
|
|
|
|
if (environmentData[j].status === "0") {
|
2025-10-13 09:33:54 +08:00
|
|
|
|
monitorIconElement.style.backgroundImage = `url('../../img/consQuality/QualityInspection-0.png')`;
|
2025-10-17 16:10:55 +08:00
|
|
|
|
} else if (environmentData[j].status === "1") {
|
2025-10-13 09:33:54 +08:00
|
|
|
|
monitorIconElement.style.backgroundImage = `url('../../img/consQuality/QualityInspection-2.png')`;
|
2025-10-17 16:10:55 +08:00
|
|
|
|
} else if (environmentData[j].status === "2") {
|
2025-10-13 09:33:54 +08:00
|
|
|
|
monitorIconElement.style.backgroundImage = `url('../../img/consQuality/QualityInspection-1.png')`;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
deviceElement.appendChild(monitorIconElement);
|
|
|
|
|
|
deviceElement.appendChild(pElement);
|
|
|
|
|
|
groupElement.appendChild(deviceElement);
|
|
|
|
|
|
// 添加点击事件监听器
|
2025-10-17 16:10:55 +08:00
|
|
|
|
deviceElement.addEventListener("click", function (event) {
|
2025-10-13 09:33:54 +08:00
|
|
|
|
var clickedDeviceId = event.currentTarget.id;
|
2025-10-17 16:10:55 +08:00
|
|
|
|
AlarmList(clickedDeviceId);
|
|
|
|
|
|
ConstructionQualityList(clickedDeviceId);
|
|
|
|
|
|
console.log(clickedDeviceId);
|
2025-10-13 09:33:54 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 将每组设备信息容器添加到父元素中
|
|
|
|
|
|
environmentContainer.appendChild(groupElement);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//告警列表
|
2025-10-17 16:10:55 +08:00
|
|
|
|
function AlarmList(deviceId) {
|
|
|
|
|
|
const dId = deviceId || "";
|
|
|
|
|
|
const url =
|
|
|
|
|
|
commonUrl +
|
|
|
|
|
|
"screen/largeScreen/constructionQuality/getConstructionAlarm";
|
2025-10-13 09:33:54 +08:00
|
|
|
|
alarmTableIns = table.render({
|
2025-10-17 16:10:55 +08:00
|
|
|
|
elem: "#alarm",
|
2025-10-13 09:33:54 +08:00
|
|
|
|
url: url,
|
2025-10-17 16:10:55 +08:00
|
|
|
|
skin: "line",
|
2025-10-13 09:33:54 +08:00
|
|
|
|
page: false,
|
2025-10-17 16:10:55 +08:00
|
|
|
|
headers: {
|
|
|
|
|
|
decrypt: "decrypt",
|
|
|
|
|
|
Authorization: token,
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
|
|
|
|
|
where: {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
deviceId: dId,
|
2025-10-13 09:33:54 +08:00
|
|
|
|
roleCode: roleCode,
|
|
|
|
|
|
orgId: orgId,
|
|
|
|
|
|
userId: userId,
|
2025-10-17 16:10:55 +08:00
|
|
|
|
bidCode: bidCode,
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
2025-10-17 16:10:55 +08:00
|
|
|
|
cols: [
|
|
|
|
|
|
[
|
|
|
|
|
|
// {field: 'number', width:80,title: '序号', align: 'center', type: 'numbers'},
|
|
|
|
|
|
{ field: "warningContent", align: "center", title: "告警内容" },
|
|
|
|
|
|
{ field: "warnTime", align: "center", title: "告警时间" },
|
|
|
|
|
|
],
|
|
|
|
|
|
],
|
2025-10-13 09:33:54 +08:00
|
|
|
|
initComplete: function () {
|
|
|
|
|
|
// 在表格渲染完成后,重新渲染序号列
|
|
|
|
|
|
var that = this.elem.next();
|
2025-10-17 16:10:55 +08:00
|
|
|
|
var tool = that
|
|
|
|
|
|
.children(".layui-table-box")
|
|
|
|
|
|
.children(".layui-table-fixed")
|
|
|
|
|
|
.children(".layui-table-body")
|
|
|
|
|
|
.children(".layui-table");
|
2025-10-13 09:33:54 +08:00
|
|
|
|
tool.find("tr").each(function (index, item) {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
$(this)
|
|
|
|
|
|
.find('td[data-field="LAY_TABLE_INDEX"]')
|
|
|
|
|
|
.text(index + 1);
|
2025-10-13 09:33:54 +08:00
|
|
|
|
});
|
|
|
|
|
|
},
|
2025-10-17 16:10:55 +08:00
|
|
|
|
done: function (res, curr, count, origin) {
|
2025-10-13 09:33:54 +08:00
|
|
|
|
console.log(res);
|
2025-10-17 16:10:55 +08:00
|
|
|
|
},
|
|
|
|
|
|
});
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
//施工质量列表
|
2025-10-17 16:10:55 +08:00
|
|
|
|
function ConstructionQualityList(deviceId) {
|
|
|
|
|
|
const dId = deviceId || "";
|
|
|
|
|
|
const url =
|
|
|
|
|
|
commonUrl +
|
|
|
|
|
|
"screen/largeScreen/constructionQuality/getConstructionQualityList";
|
2025-10-13 09:33:54 +08:00
|
|
|
|
|
|
|
|
|
|
qualityInspectionTableIns = table.render({
|
2025-10-17 16:10:55 +08:00
|
|
|
|
elem: "#demo",
|
2025-10-13 09:33:54 +08:00
|
|
|
|
url: url,
|
2025-10-17 16:10:55 +08:00
|
|
|
|
skin: "line",
|
|
|
|
|
|
headers: {
|
|
|
|
|
|
decrypt: "decrypt",
|
|
|
|
|
|
Authorization: token,
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
|
|
|
|
|
where: {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
deviceId: dId,
|
2025-10-13 09:33:54 +08:00
|
|
|
|
roleCode: roleCode,
|
|
|
|
|
|
orgId: orgId,
|
|
|
|
|
|
userId: userId,
|
|
|
|
|
|
bidCode: bidCode,
|
2025-10-17 16:10:55 +08:00
|
|
|
|
moduleName: $("#moduleName").val(),
|
2025-10-13 09:33:54 +08:00
|
|
|
|
// month: $('#ID-laydate-type-datetime').val(),
|
|
|
|
|
|
},
|
2025-10-17 16:10:55 +08:00
|
|
|
|
cols: [
|
|
|
|
|
|
[
|
|
|
|
|
|
{
|
|
|
|
|
|
field: "number",
|
|
|
|
|
|
width: 80,
|
|
|
|
|
|
title: "序号",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
type: "numbers",
|
|
|
|
|
|
fixed: "left",
|
|
|
|
|
|
},
|
|
|
|
|
|
// {field: 'areaName', align: 'center', title: '区域名称'},
|
|
|
|
|
|
{ field: "deviceName", align: "center", title: "设备名称" },
|
|
|
|
|
|
{ field: "moduleName", align: "center", title: "施工工艺" },
|
|
|
|
|
|
{ field: "changeVal", align: "center", title: "变化值" },
|
|
|
|
|
|
{ field: "val", align: "center", title: "检测值" },
|
|
|
|
|
|
{ field: "createTime", align: "center", title: "检测时间" },
|
|
|
|
|
|
{ field: "isWarn", align: "center", title: "是否告警" },
|
|
|
|
|
|
],
|
|
|
|
|
|
],
|
2025-10-13 09:33:54 +08:00
|
|
|
|
initComplete: function () {
|
|
|
|
|
|
// 在表格渲染完成后,重新渲染序号列
|
|
|
|
|
|
var that = this.elem.next();
|
2025-10-17 16:10:55 +08:00
|
|
|
|
var tool = that
|
|
|
|
|
|
.children(".layui-table-box")
|
|
|
|
|
|
.children(".layui-table-fixed")
|
|
|
|
|
|
.children(".layui-table-body")
|
|
|
|
|
|
.children(".layui-table");
|
2025-10-13 09:33:54 +08:00
|
|
|
|
tool.find("tr").each(function (index, item) {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
$(this)
|
|
|
|
|
|
.find('td[data-field="LAY_TABLE_INDEX"]')
|
|
|
|
|
|
.text(index + 1);
|
2025-10-13 09:33:54 +08:00
|
|
|
|
});
|
|
|
|
|
|
},
|
2025-10-17 16:10:55 +08:00
|
|
|
|
done: function (res, curr, count, origin) {
|
2025-10-13 09:33:54 +08:00
|
|
|
|
// console.log(res);
|
2025-10-17 16:10:55 +08:00
|
|
|
|
$("[data-field='isWarn']")
|
|
|
|
|
|
.children()
|
|
|
|
|
|
.each(function () {
|
|
|
|
|
|
if ($(this).text() == "0") {
|
|
|
|
|
|
$(this).text("未告警");
|
|
|
|
|
|
} else if ($(this).text() == "1") {
|
|
|
|
|
|
$(this).text("告警");
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
|
|
|
|
|
page: true, //开启分页
|
|
|
|
|
|
loading: true, //数据加载中。。。
|
|
|
|
|
|
limits: [5, 10, 20, 100],
|
2025-10-17 16:10:55 +08:00
|
|
|
|
limit: 7,
|
|
|
|
|
|
});
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
//渲染历史记录table
|
2025-10-17 16:10:55 +08:00
|
|
|
|
function initHistory() {
|
|
|
|
|
|
const url =
|
|
|
|
|
|
commonUrl + "screen/largeScreen/constructionQuality/getHistoryList";
|
|
|
|
|
|
let times = "";
|
|
|
|
|
|
if ($("#ID-laydate-start-date-1").val() != "") {
|
|
|
|
|
|
times =
|
|
|
|
|
|
$("#ID-laydate-start-date-1").val() +
|
|
|
|
|
|
" - " +
|
|
|
|
|
|
$("#ID-laydate-end-date-1").val();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
times = "";
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
2025-10-17 16:10:55 +08:00
|
|
|
|
historyTableIns = table.render({
|
|
|
|
|
|
elem: "#tableDialog",
|
|
|
|
|
|
url: url,
|
|
|
|
|
|
// skin: 'line',
|
|
|
|
|
|
page: true,
|
|
|
|
|
|
height: "full-550",
|
|
|
|
|
|
headers: {
|
|
|
|
|
|
decrypt: "decrypt",
|
|
|
|
|
|
Authorization: token,
|
|
|
|
|
|
},
|
|
|
|
|
|
where: {
|
2025-10-13 09:33:54 +08:00
|
|
|
|
roleCode: roleCode,
|
|
|
|
|
|
orgId: orgId,
|
|
|
|
|
|
userId: userId,
|
|
|
|
|
|
bidCode: bidCode,
|
2025-10-17 16:10:55 +08:00
|
|
|
|
deviceName: $("#deviceName").val(),
|
2025-10-13 09:33:54 +08:00
|
|
|
|
times: times,
|
2025-10-17 16:10:55 +08:00
|
|
|
|
},
|
|
|
|
|
|
cols: [
|
|
|
|
|
|
[
|
|
|
|
|
|
{ type: "numbers", title: "序号" }, // 添加序号列
|
|
|
|
|
|
// {field: 'areaName', align: 'center', title: '区域名称'},
|
|
|
|
|
|
{ field: "deviceName", align: "center", title: "设备名称" },
|
|
|
|
|
|
{ field: "moduleName", align: "center", title: "施工工艺" },
|
|
|
|
|
|
{ field: "changeVal", align: "center", title: "变化值" },
|
|
|
|
|
|
{ field: "val", align: "center", title: "检测值" },
|
|
|
|
|
|
{ field: "createTime", align: "center", title: "检测时间" },
|
|
|
|
|
|
// {field: 'isWarn', align: 'center', title: '是否告警'},
|
|
|
|
|
|
],
|
|
|
|
|
|
],
|
|
|
|
|
|
initComplete: function () {
|
|
|
|
|
|
// 在表格渲染完成后,重新渲染序号列
|
|
|
|
|
|
var that = this.elem.next();
|
|
|
|
|
|
var tool = that
|
|
|
|
|
|
.children(".layui-table-box")
|
|
|
|
|
|
.children(".layui-table-fixed")
|
|
|
|
|
|
.children(".layui-table-body")
|
|
|
|
|
|
.children(".layui-table");
|
|
|
|
|
|
tool.find("tr").each(function (index, item) {
|
|
|
|
|
|
$(this)
|
|
|
|
|
|
.find('td[data-field="LAY_TABLE_INDEX"]')
|
|
|
|
|
|
.text(index + 1);
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
done: function (res, curr, count, origin) {
|
|
|
|
|
|
// console.log(res);
|
|
|
|
|
|
$("[data-field='isWarn']")
|
|
|
|
|
|
.children()
|
|
|
|
|
|
.each(function () {
|
|
|
|
|
|
if ($(this).text() == "0") {
|
|
|
|
|
|
$(this).text("未告警");
|
|
|
|
|
|
} else if ($(this).text() == "1") {
|
|
|
|
|
|
$(this).text("告警");
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2025-10-13 09:33:54 +08:00
|
|
|
|
page: true, //开启分页
|
|
|
|
|
|
loading: true, //数据加载中。。。
|
|
|
|
|
|
limits: [5, 10, 20, 100],
|
2025-10-17 16:10:55 +08:00
|
|
|
|
limit: 20,
|
|
|
|
|
|
});
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
2025-10-17 13:55:50 +08:00
|
|
|
|
|
2025-10-13 09:33:54 +08:00
|
|
|
|
//检测记录对比
|
2025-10-17 16:10:55 +08:00
|
|
|
|
function detectionRecord(button, construction) {
|
|
|
|
|
|
if (button !== "") {
|
|
|
|
|
|
let buttons = document.getElementsByClassName("button-style");
|
2025-10-13 09:33:54 +08:00
|
|
|
|
let isSelected = button.style.color === "rgb(81, 170, 209)";
|
|
|
|
|
|
for (let i = 0; i < buttons.length; i++) {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
buttons[i].style.border = "";
|
|
|
|
|
|
buttons[i].style.color = "";
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (!isSelected) {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
button.style.border = "1px solid #51AAD1";
|
|
|
|
|
|
button.style.color = "#51AAD1";
|
|
|
|
|
|
} else {
|
|
|
|
|
|
button.style.border = "";
|
|
|
|
|
|
button.style.color = "";
|
|
|
|
|
|
detectionRecord("", "");
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
const params = {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
roleCode: roleCode,
|
|
|
|
|
|
orgId: orgId,
|
|
|
|
|
|
userId: userId,
|
|
|
|
|
|
bidCode: bidCode,
|
|
|
|
|
|
construction: construction,
|
|
|
|
|
|
};
|
|
|
|
|
|
console.log(construction);
|
|
|
|
|
|
console.log(construction == "table");
|
|
|
|
|
|
if (construction == "table") {
|
|
|
|
|
|
$(".echarts-div").css("display", "none");
|
|
|
|
|
|
$("#data-table-div").css("display", "block");
|
2025-10-13 09:33:54 +08:00
|
|
|
|
getDataTable();
|
2025-10-17 16:10:55 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
$(".echarts-div").css("display", "block");
|
|
|
|
|
|
$("#data-table-div").css("display", "none");
|
2025-10-13 09:33:54 +08:00
|
|
|
|
getDetectionRecord(params);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//施工质量列表
|
2025-10-17 16:10:55 +08:00
|
|
|
|
function getDataTable() {
|
|
|
|
|
|
const url =
|
|
|
|
|
|
commonUrl + "screen/largeScreen/constructionQuality/getDevDataList";
|
|
|
|
|
|
table.render({
|
|
|
|
|
|
elem: "#data-table",
|
2025-10-13 09:33:54 +08:00
|
|
|
|
url: url,
|
2025-10-17 16:10:55 +08:00
|
|
|
|
skin: "line",
|
|
|
|
|
|
headers: {
|
|
|
|
|
|
decrypt: "decrypt",
|
|
|
|
|
|
Authorization: token,
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
|
|
|
|
|
where: {
|
|
|
|
|
|
roleCode: roleCode,
|
|
|
|
|
|
orgId: orgId,
|
|
|
|
|
|
userId: userId,
|
|
|
|
|
|
bidCode: bidCode,
|
|
|
|
|
|
},
|
2025-10-17 16:10:55 +08:00
|
|
|
|
cols: [
|
|
|
|
|
|
[
|
|
|
|
|
|
{
|
|
|
|
|
|
field: "number",
|
|
|
|
|
|
width: 80,
|
|
|
|
|
|
title: "序号",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
type: "numbers",
|
|
|
|
|
|
fixed: "left",
|
|
|
|
|
|
},
|
|
|
|
|
|
{ field: "name", align: "center", title: "区域名称" },
|
|
|
|
|
|
{ field: "bidName", align: "center", title: "工程名称" },
|
|
|
|
|
|
{ field: "val", align: "center", title: "本次沉降" },
|
|
|
|
|
|
{ field: "hisVal", align: "center", title: "累计沉降" },
|
|
|
|
|
|
{ field: "createTime", align: "center", title: "检测时间" },
|
|
|
|
|
|
{ field: "jcUser", align: "center", title: "检测人" },
|
|
|
|
|
|
{ field: "jhUser", align: "center", title: "校核人" },
|
|
|
|
|
|
{
|
|
|
|
|
|
field: "devCode",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
title: "仪器型号计量编号",
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
],
|
2025-10-13 09:33:54 +08:00
|
|
|
|
initComplete: function () {
|
|
|
|
|
|
// 在表格渲染完成后,重新渲染序号列
|
|
|
|
|
|
var that = this.elem.next();
|
2025-10-17 16:10:55 +08:00
|
|
|
|
var tool = that
|
|
|
|
|
|
.children(".layui-table-box")
|
|
|
|
|
|
.children(".layui-table-fixed")
|
|
|
|
|
|
.children(".layui-table-body")
|
|
|
|
|
|
.children(".layui-table");
|
2025-10-13 09:33:54 +08:00
|
|
|
|
tool.find("tr").each(function (index, item) {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
$(this)
|
|
|
|
|
|
.find('td[data-field="LAY_TABLE_INDEX"]')
|
|
|
|
|
|
.text(index + 1);
|
2025-10-13 09:33:54 +08:00
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
page: true, //开启分页
|
|
|
|
|
|
loading: true, //数据加载中。。。
|
|
|
|
|
|
limits: [5, 10, 20, 100],
|
2025-10-17 16:10:55 +08:00
|
|
|
|
limit: 7,
|
|
|
|
|
|
});
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//查询echars
|
2025-10-17 16:10:55 +08:00
|
|
|
|
function getDetectionRecord(params) {
|
|
|
|
|
|
const url =
|
|
|
|
|
|
commonUrl + "screen/largeScreen/constructionQuality/detectionRecord";
|
2025-10-13 09:33:54 +08:00
|
|
|
|
let encryptStr = encryptCBC(JSON.stringify(params));
|
2025-10-17 16:10:55 +08:00
|
|
|
|
ajaxRequest(
|
|
|
|
|
|
url,
|
|
|
|
|
|
"POST",
|
|
|
|
|
|
encryptStr,
|
|
|
|
|
|
true,
|
|
|
|
|
|
function () {},
|
|
|
|
|
|
function (result) {
|
|
|
|
|
|
if (result.code === 200) {
|
|
|
|
|
|
let resultData = result.data;
|
|
|
|
|
|
let extractedData = {
|
|
|
|
|
|
months: [],
|
|
|
|
|
|
qualificationNumber: [],
|
|
|
|
|
|
detectionNumbers: [],
|
|
|
|
|
|
};
|
|
|
|
|
|
resultData.forEach((data) => {
|
|
|
|
|
|
extractedData.months.push(data.month);
|
|
|
|
|
|
extractedData.detectionNumbers.push(
|
|
|
|
|
|
parseInt(data.detectionNumber)
|
|
|
|
|
|
);
|
|
|
|
|
|
extractedData.qualificationNumber.push(
|
|
|
|
|
|
parseInt(data.qualificationNumber)
|
|
|
|
|
|
);
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
console.log(extractedData);
|
|
|
|
|
|
detectionRecordEcharts(extractedData);
|
|
|
|
|
|
} else if (result.code === 500) {
|
|
|
|
|
|
layer.msg(result.msg, { icon: 2 });
|
|
|
|
|
|
} else if (result.code === 401) {
|
|
|
|
|
|
loginout(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
function (xhr) {
|
|
|
|
|
|
// error(xhr)
|
|
|
|
|
|
},
|
|
|
|
|
|
"application/json",
|
|
|
|
|
|
aqEnnable
|
|
|
|
|
|
);
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//检测记录对比echarts图表
|
2025-10-17 16:10:55 +08:00
|
|
|
|
function detectionRecordEcharts(extractedData) {
|
|
|
|
|
|
var myChart = echarts.init(document.getElementById("dome"));
|
2025-10-13 09:33:54 +08:00
|
|
|
|
option = {
|
|
|
|
|
|
backgroundColor: "transparent",
|
|
|
|
|
|
legend: {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
data: ["检测次数", "合格次数"],
|
|
|
|
|
|
icon: "circle",
|
2025-10-13 09:33:54 +08:00
|
|
|
|
right: "3%",
|
|
|
|
|
|
textStyle: {
|
|
|
|
|
|
color: "white",
|
2025-10-17 16:10:55 +08:00
|
|
|
|
fontSize: 12,
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
2025-10-17 16:10:55 +08:00
|
|
|
|
itemWidth: 12, // 设置宽度
|
|
|
|
|
|
itemHeight: 16, // 设置高度
|
|
|
|
|
|
itemGap: 12, // 设置间距
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
|
|
|
|
|
grid: {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
left: "30",
|
|
|
|
|
|
right: "0",
|
|
|
|
|
|
top: "40",
|
|
|
|
|
|
bottom: "20",
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
|
|
|
|
|
tooltip: {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
trigger: "axis",
|
2025-10-13 09:33:54 +08:00
|
|
|
|
axisPointer: {
|
|
|
|
|
|
type: "item",
|
|
|
|
|
|
crossStyle: {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
color: "#999",
|
|
|
|
|
|
},
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
|
|
|
|
|
confine: true,
|
2025-10-17 16:10:55 +08:00
|
|
|
|
formatter: function (params) {
|
2025-10-13 09:33:54 +08:00
|
|
|
|
// console.log(params)
|
2025-10-17 16:10:55 +08:00
|
|
|
|
var html = params[0].name + "月";
|
|
|
|
|
|
for (var i = 0; i < params.length; i++) {
|
|
|
|
|
|
html +=
|
|
|
|
|
|
"<br />" +
|
|
|
|
|
|
params[i].marker +
|
|
|
|
|
|
params[i].seriesName +
|
|
|
|
|
|
":" +
|
|
|
|
|
|
params[i].value;
|
2025-10-13 09:33:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return html;
|
|
|
|
|
|
},
|
2025-10-17 16:10:55 +08:00
|
|
|
|
},
|
|
|
|
|
|
xAxis: [
|
|
|
|
|
|
{
|
|
|
|
|
|
type: "category",
|
|
|
|
|
|
name: "月",
|
|
|
|
|
|
data: extractedData.months,
|
|
|
|
|
|
axisPointer: {
|
|
|
|
|
|
type: "shadow",
|
|
|
|
|
|
},
|
|
|
|
|
|
axisLine: {
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
lineStyle: {
|
|
|
|
|
|
color: "#333",
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
axisLabel: {
|
|
|
|
|
|
formatter: "{value}月",
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
color: "#eee",
|
|
|
|
|
|
},
|
|
|
|
|
|
axisTick: {
|
|
|
|
|
|
show: false,
|
|
|
|
|
|
},
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
2025-10-17 16:10:55 +08:00
|
|
|
|
],
|
|
|
|
|
|
yAxis: [
|
|
|
|
|
|
{
|
|
|
|
|
|
type: "value",
|
|
|
|
|
|
splitNumber: 5,
|
|
|
|
|
|
splitLine: {
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
lineStyle: {
|
|
|
|
|
|
color: "#333",
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
axisLine: {
|
|
|
|
|
|
show: false,
|
|
|
|
|
|
},
|
|
|
|
|
|
axisTick: {
|
|
|
|
|
|
show: false,
|
|
|
|
|
|
},
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
2025-10-17 16:10:55 +08:00
|
|
|
|
],
|
2025-10-13 09:33:54 +08:00
|
|
|
|
series: [
|
|
|
|
|
|
{
|
2025-10-17 16:10:55 +08:00
|
|
|
|
name: "检测次数",
|
|
|
|
|
|
type: "bar",
|
|
|
|
|
|
symbol: "bar",
|
2025-10-13 09:33:54 +08:00
|
|
|
|
barWidth: 20,
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
normal: {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
color: "#51AAD1",
|
|
|
|
|
|
},
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
2025-10-17 16:10:55 +08:00
|
|
|
|
data: extractedData.detectionNumbers,
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-10-17 16:10:55 +08:00
|
|
|
|
name: "合格次数",
|
|
|
|
|
|
type: "bar",
|
|
|
|
|
|
symbol: "circle",
|
2025-10-13 09:33:54 +08:00
|
|
|
|
barWidth: 20,
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
normal: {
|
2025-10-17 16:10:55 +08:00
|
|
|
|
color: "#70D6B5",
|
|
|
|
|
|
},
|
2025-10-13 09:33:54 +08:00
|
|
|
|
},
|
2025-10-17 16:10:55 +08:00
|
|
|
|
data: extractedData.qualificationNumber,
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
2025-10-13 09:33:54 +08:00
|
|
|
|
};
|
|
|
|
|
|
myChart.setOption(option);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getNowDay() {
|
|
|
|
|
|
var time = new Date();
|
|
|
|
|
|
var year = time.getFullYear();
|
2025-10-17 16:10:55 +08:00
|
|
|
|
var month =
|
|
|
|
|
|
time.getMonth() + 1 >= 10
|
|
|
|
|
|
? time.getMonth() + 1
|
|
|
|
|
|
: "0" + (time.getMonth() + 1);
|
|
|
|
|
|
var day = time.getDate() >= 10 ? time.getDate() : "0" + time.getDate();
|
2025-10-13 09:33:54 +08:00
|
|
|
|
return year + "-" + month + "-" + day;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-17 16:10:55 +08:00
|
|
|
|
function onDBLClick(deviceType) {
|
|
|
|
|
|
openIframeByParamObj(
|
|
|
|
|
|
"handleData4",
|
|
|
|
|
|
"边坡位移监测信息",
|
|
|
|
|
|
"../../pages/operEnvironment/dialog.html",
|
|
|
|
|
|
"72%",
|
|
|
|
|
|
"95%",
|
|
|
|
|
|
{ deviceType },
|
|
|
|
|
|
1
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|