ah_jjzhgd_webscreen/js/pages/constrDisplay/constrDisplay.js

270 lines
11 KiB
JavaScript

let form, laydate, flow, layer, table;
let pageNum = 1, pageSize = 100; // 定义分页
layui.use(["form", 'laydate', 'table', 'flow', 'layer'], function () {
form = layui.form;
laydate = layui.laydate;
flow = layui.flow;
layer = layui.layer;
table = layui.table;
dataFlow({
pageNum: pageNum,
pageSize: pageSize
});
$('#workContent').append('混凝土工程;模板工程;装配式围墙施工;砖砌电缆沟;阀厅建筑物接地施工;钢结构安装;钢结构安装;阀厅建筑物接地施工;模板工程;站区四通一平、站区道路工程;模板工程;模板工程;模板工程;围墙工程混凝土、砂浆搅拌及浇筑;模板安拆;装配式围墙施工;电缆沟砌筑;焊接;檩条及墙板安装;檩条及墙板安装;焊接;模板安拆;场地平整;模板安拆;模板安拆;模板安拆;围墙工程施工混凝土、砂浆搅拌及浇筑-配电装置楼;模板安拆-配电装置楼;装配式围墙施工-站区围墙;电缆沟砌筑-电缆沟;焊接-配电装置区;檩条及墙板安装-防火墙;檩条及墙板安装-配电装置楼;焊接-配电装置楼;模板安拆-消弧线圈;场地平整-配电装置楼;模板安拆-站用变压器;模板安拆-电容器;模板安拆-配电装置区;围墙工程施工-站区围墙。');
$('#mainRisk').append('触电、机械伤害、高处坠落,触电、机械伤害、其他伤害,物体打击、起重伤害,触电、机械伤害、物体打击,火灾、触电,坍塌,坍塌');
$('#yeWorkContent').append('混凝土工程;模板工程;装配式围墙施工;砖砌电缆沟;阀厅建筑物接地施工;钢结构安装;钢结构安装;阀厅建筑物接地施工;模板工程;站区四通一平、站区道路工程;模板工程;模板工程;模板工程;围墙工程混凝土、砂浆搅拌及浇筑;模板安拆;装配式围墙施工;电缆沟砌筑;焊接;檩条及墙板安装;檩条及墙板安装;焊接;模板安拆;场地平整;模板安拆;模板安拆;模板安拆;围墙工程施工混凝土、砂浆搅拌及浇筑-配电装置楼;模板安拆-配电装置楼;装配式围墙施工-站区围墙;电缆沟砌筑-电缆沟;焊接-配电装置区;檩条及墙板安装-防火墙;檩条及墙板安装-配电装置楼;焊接-配电装置楼;模板安拆-消弧线圈;场地平整-配电装置楼;模板安拆-站用变压器;模板安拆-电容器;模板安拆-配电装置区;围墙工程施工-站区围墙。');
$("#workContent").niceScroll({ cursorborder: "", cursorcolor: "#c0c4cc", boxzoom: true });
$("#mainRisk").niceScroll({ cursorborder: "", cursorcolor: "#c0c4cc", boxzoom: true });
$("#yeWorkContent").niceScroll({ cursorborder: "", cursorcolor: "#c0c4cc", boxzoom: true });
$("#ID-flow-demo").niceScroll({ cursorborder: "", cursorcolor: "#c0c4cc", boxzoom: true });
initTable(parent.$('#bidPro').val());
form.on('select(classMeeting)', function (data) {
})
});
/**数据流加载*/
function dataFlow(queryParams) {
flow.load({
elem: '#ID-flow-demo', // 流加载容器
scrollElem: '#ID-flow-demo', // 滚动条所在元素,一般不用填,此处只是演示需要。
end: '数据加载完毕',
direction: 'bottom',
done: function (page, next) { // 执行下一页的回调
console.error(page);
pageNum = page;
let lis = [];
queryParams.pageNum = page;
let returnData = loadData(queryParams);
if (returnData != null) {
lis = initImgData(returnData.data.list)
next(lis.join(''), page < returnData.data.total / 100);
}
}
});
}
/**加载图片数据*/
function loadData(queryParams) {
let returnData = {
total: 60,
data: {
list: [
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '2',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '3',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '2',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '2',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '3',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '2',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '2',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '3',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '2',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
}, {
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '2',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '3',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '2',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
}, {
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '2',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '3',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '2',
'username': '张三'
},
{
'path': '../../../img/constrDisplay/test.jpg',
'type': '1',
'username': '张三'
}
]
}
}
return returnData;
/* let returnData = null;
let url = dataUrl + "/backstage/synthesisQuery/getImgList"
let obj = queryParams;
let params = {
encryptedData: encryptCBC(JSON.stringify(obj))
}
ajaxRequest(url, "POST", params, false, function () {
}, function (result) {
if (result.status === 200) {
console.log(result)
returnData = result;
} else {
layer.msg(result.msg, { icon: 2 })
}
}, function (xhr) {
error(xhr)
});
return returnData; */
}
/**渲染图片*/
function initImgData(list) {
let htmlArr = [];
if (list && list.length > 0) {
$.each(list, function (index, item) {
// let filePath = imgUrl + item.compressFilePath + "?token=" + tokens;
let back_img = '../../../img/constrDisplay/img-' + item.type + '.png';
let filePath = item.path;
htmlArr.push("<div class='img-info'>" +
" <div class='imgData layout' style='background: url(" + back_img + ") no-repeat 0 0 / 100% 100%;'>\n" +
" <img src='" + filePath + "'>" +
" </div>" +
" <div class='imgData2 layout'>" +
" <p class='img-color" + (item.type) + "'>" + item.username + "</p>" +
" </div>" +
" </div>");
})
}
return htmlArr;
}
function initTable(bidCode) {
const url = commonUrl + "screen/largeScreen/constrDisplay/getUserInfoDetails";
table.render({
elem: '#demo2',
url: url,
skin: 'line',
page: true,
height: 'full-500',
headers: {
"decrypt": "decrypt",
"Authorization": token
},
where: {
bidCode: bidCode,
},
cols: [[
{ type: 'numbers', title: '序号', width: '10%' }, // 添加序号列
{ field: 'date', title: '姓名', align: 'center', width: '30%' },
{ field: 'warnContent', title: '类型', align: 'center', width: '30%' },
{ field: 'photo', title: '时间', align: 'center', width: '30%' },
]],
done: function (res, curr, count, origin) {
console.log(res);
}
})
}