接口联调

This commit is contained in:
cwchen 2025-05-15 21:00:34 +08:00
parent ff390628c2
commit c9c946ae78
12 changed files with 318 additions and 278 deletions

View File

@ -3,11 +3,13 @@ let aqEnnable = false // 参数加密开关
// const commonUrl = "http://11.158.16.194:21624/zhgd/";
// const URL_IP="http://11.158.16.194:21624/zhgd-web"
const commonUrl = "http://192.168.0.14:13030/zhgd/";
// const commonUrl = "http://192.168.0.14:13030/zhgd/";
const URL_IP="http://192.168.0.14:13030/zhgd-web"
//前端
// const URL_IP="http://127.0.0.1:63343/ah_jjzhgd_webscreen"
// const commonUrl = "http://127.0.0.1:18080/zhgd/";
const commonUrl = "http://192.168.1.107:13030/zhgd/";
const imgUrl = "http://192.168.1.107:13030/zhgd/file/files/";
// //前端路径
// let isc_login="http://iscssotest.ah.sgcc.com.cn/isc_sso/login?service=";
/* 登录相关 */

View File

@ -120,7 +120,7 @@ body {
.img-info {
width: 12%;
height: 180px;
height: 210px;
margin: 1% 2.3%;
}
@ -132,7 +132,7 @@ body {
.imgData {
width: 100%;
height: 85%;
height: 70%;
background-position: center center !important;
}
@ -228,4 +228,23 @@ img {
.layui-form-select dl {
background-color: #144e49;
}
.layui-table-cell {
line-height: 20px;
word-break: break-all;
}
.layui-table-cell {
height: auto !important;
white-space: normal !important;
padding: 5px 12px !important;
}
/* 图片样式 */
.layui-table img {
max-width: 100%;
max-height: 100px;
display: block;
margin: 0 auto;
}

View File

@ -569,6 +569,15 @@ body {
color: #2BEEC0;
}
.img-color2 {
color: #edfeb6;
}
body .my-skin.child-skin {
background: url("../../img/video/child-back.png") no-repeat 0 0/100% 100% transparent;
}
.layui-layer-dialog .layui-layer-padding {
color: #000 !important;
}

View File

@ -50,7 +50,7 @@ body {
.content-info {
width: 100%;
height: 40px;
min-height: 40px;
font-size: 16px;
justify-content: start;
}
@ -75,6 +75,7 @@ img {
-ms-interpolation-mode: nearest-neighbor;
/* IE (non-standard property) */
}
.layui-layer-dialog .layui-layer-padding {
color: #000 !important;
}

View File

@ -46,4 +46,18 @@ body {
.layui-layer-dialog .layui-layer-padding {
color: #000 !important;
}
.layui-table-cell {
height: auto !important;
white-space: normal !important;
padding: 5px 12px !important;
}
/* 图片样式 */
.layui-table img {
max-width: 100%;
max-height: 100px;
display: block;
margin: 0 auto;
}

View File

@ -1,5 +1,7 @@
let form, laydate, flow, layer, table;
let pageNum = 1, pageSize = 100; // 定义分页
let pageNum = 1, pageSize = 32; // 定义分页
let dataList = [];
let scheduledTask2 = false;
layui.use(["form", 'laydate', 'table', 'flow', 'layer'], function () {
form = layui.form;
laydate = layui.laydate;
@ -8,20 +10,38 @@ layui.use(["form", 'laydate', 'table', 'flow', 'layer'], function () {
table = layui.table;
dataFlow({
pageNum: pageNum,
pageSize: pageSize
pageSize: pageSize,
bidCode: parent.$('#bidPro').val()
});
$('#workContent').append('混凝土工程;模板工程;装配式围墙施工;砖砌电缆沟;阀厅建筑物接地施工;钢结构安装;钢结构安装;阀厅建筑物接地施工;模板工程;站区四通一平、站区道路工程;模板工程;模板工程;模板工程;围墙工程混凝土、砂浆搅拌及浇筑;模板安拆;装配式围墙施工;电缆沟砌筑;焊接;檩条及墙板安装;檩条及墙板安装;焊接;模板安拆;场地平整;模板安拆;模板安拆;模板安拆;围墙工程施工混凝土、砂浆搅拌及浇筑-配电装置楼;模板安拆-配电装置楼;装配式围墙施工-站区围墙;电缆沟砌筑-电缆沟;焊接-配电装置区;檩条及墙板安装-防火墙;檩条及墙板安装-配电装置楼;焊接-配电装置楼;模板安拆-消弧线圈;场地平整-配电装置楼;模板安拆-站用变压器;模板安拆-电容器;模板安拆-配电装置区;围墙工程施工-站区围墙。');
$('#mainRisk').append('触电、机械伤害、高处坠落,触电、机械伤害、其他伤害,物体打击、起重伤害,触电、机械伤害、物体打击,火灾、触电,坍塌,坍塌');
$('#yeWorkContent').append('混凝土工程;模板工程;装配式围墙施工;砖砌电缆沟;阀厅建筑物接地施工;钢结构安装;钢结构安装;阀厅建筑物接地施工;模板工程;站区四通一平、站区道路工程;模板工程;模板工程;模板工程;围墙工程混凝土、砂浆搅拌及浇筑;模板安拆;装配式围墙施工;电缆沟砌筑;焊接;檩条及墙板安装;檩条及墙板安装;焊接;模板安拆;场地平整;模板安拆;模板安拆;模板安拆;围墙工程施工混凝土、砂浆搅拌及浇筑-配电装置楼;模板安拆-配电装置楼;装配式围墙施工-站区围墙;电缆沟砌筑-电缆沟;焊接-配电装置区;檩条及墙板安装-防火墙;檩条及墙板安装-配电装置楼;焊接-配电装置楼;模板安拆-消弧线圈;场地平整-配电装置楼;模板安拆-站用变压器;模板安拆-电容器;模板安拆-配电装置区;围墙工程施工-站区围墙。');
getClassMeetings();
$("#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) {
const item = dataList.find(item => item.id === data.value);
setData(item);
})
timedRefresh2();
});
// 刷新数据-五分钟刷新一次
function timedRefresh2() {
if (scheduledTask2) {
$('#ID-flow-demo').empty();
dataFlow({
pageNum: 1,
pageSize: pageSize,
bidCode: parent.$('#bidPro').val()
});
reloadTable(1);
} else {
scheduledTask2 = true;
}
setTimeout(timedRefresh2, 1000 * 60 * 5);
}
/**数据流加载*/
function dataFlow(queryParams) {
flow.load({
@ -36,8 +56,8 @@ function dataFlow(queryParams) {
queryParams.pageNum = page;
let returnData = loadData(queryParams);
if (returnData != null) {
lis = initImgData(returnData.data.list)
next(lis.join(''), page < returnData.data.total / 100);
lis = initImgData(returnData.data)
next(lis.join(''), page < returnData.count / pageSize);
}
}
});
@ -45,180 +65,22 @@ function dataFlow(queryParams) {
/**加载图片数据*/
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 () {
let returnData = null;
let paramData = 'bidCode=' + queryParams.bidCode + '&page=' + queryParams.pageNum + '&limit=' + queryParams.pageSize;
let montageParam = aqEnnable ? encryptCBC(paramData) : ' &' + encryptCBC(paramData);
const url = commonUrl + "screen/largeScreen/constrDisplay/getUserInfo?params=" + montageParam;
ajaxRequestGet(url, "GET", false, function () {
}, function (result) {
if (result.status === 200) {
if (result.code === 0) {
console.log(result)
returnData = result;
} else {
layer.msg(result.msg, { icon: 2 })
} else if (result.code === 500) {
layer.msg(result.msg, { icon: 2 });
}
}, function (xhr) {
error(xhr)
});
return returnData; */
}, function (xhr, status, error) {
error(xhr, status, error)
}, aqEnnable);
return returnData;
}
/**渲染图片*/
@ -226,15 +88,17 @@ 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;
let filePath = imgUrl + item.image + "?token=" + sessionStorage.getItem("zhgd_token");
let back_img = '../../../img/constrDisplay/img-3.png';
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 + "'>" +
" <img src='" + filePath + "' onclick='viewImg(" + JSON.stringify(item) + ")'>" +
" </div>" +
" <div class='imgData2 layout'>" +
" <p class='img-color" + (item.type) + "'>" + item.username + "</p>" +
" <p class='img-color3'>" + item.userName + "</p>" +
" </div>" +
" <div class='imgData2 layout'>" +
" <p>" + item.accessTime + "</p>" +
" </div>" +
" </div>");
})
@ -242,14 +106,28 @@ function initImgData(list) {
return htmlArr;
}
// 重载表格
function reloadTable(pageNum) {
table.reload("currentTableId", {
page: {
curr: pageNum ? pageNum : 1,
},
where: {
bidCode: parent.$('#bidPro').val(),
},
},
);
}
function initTable(bidCode) {
const url = commonUrl + "screen/largeScreen/constrDisplay/getUserInfoDetails";
table.render({
elem: '#demo2',
id: 'currentTableId',
url: url,
skin: 'line',
page: true,
height: 'full-500',
height: 'full-550',
headers: {
"decrypt": "decrypt",
"Authorization": token
@ -259,12 +137,79 @@ function initTable(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%' },
{ field: 'userName', title: '姓名', align: 'center', width: '20%' },
{
title: '图片', align: 'center', width: '20%', templet: function (d) {
let html = "", filePath = imgUrl + d.image + "?token=" + sessionStorage.getItem("zhgd_token");
html += "<img src=" + filePath + " onclick='viewImg(" + JSON.stringify(d) + ")'>";
return html;
},
},
{ field: 'accessType', title: '类型', align: 'center', width: '20%' },
{ field: 'accessTime', title: '时间', align: 'center', width: '30%' },
]],
done: function (res, curr, count, origin) {
console.log(res);
}
})
}
}
// 工作情况
function getClassMeetings() {
const url = commonUrl + "screen/largeScreen/constrDisplay/getSgInfo";
const params = { bidCode: parent.$('#bidPro').val() }
let encryptStr = encryptCBC(JSON.stringify(params));
ajaxRequest(url, "POST", encryptStr, true, function () {
}, function (result) {
console.log(result);
if (result.code === 200) {
dataList = result.data;
setSelectValue(result.data);
} else if (result.code === 500) {
layer.msg(result.msg, { icon: 2 });
}
}, function (xhr) {
error(xhr)
}, "application/json", aqEnnable);
function setSelectValue(list) {
let html = '';
if (list && list.length > 0) {
$.each(list, function (index, item) {
if (index === 0) {
setData(item);
}
html += '<option value="' + item.id + '">工作情况' + (index + 1) + '</option>';
})
} else {
setData(null);
}
$('#classMeeting').empty().append(html);
layui.form.render();
}
}
function setData(obj) {
$('#workContent').empty().append(obj == null ? '暂无数据' : obj.workContent);
$('#mainRisk').empty().append(obj == null ? '暂无数据' : obj.mainRisk);
$('#yeWorkContent').empty().append(obj == null ? '暂无数据' : obj.yworkContent);
}
function viewImg(item) {
let filePath = imgUrl + item.image + "?token=" + sessionStorage.getItem("zhgd_token");
layer.photos({
shade: 0.5,
footer: false,
photos: {
"title": "图片预览",
"start": 0,
"data": [
{
"pid": 1,
"src": filePath,
}
]
},
});
}

View File

@ -1,5 +1,5 @@
let layer, form, util, dtree, videoTree, flow;
let pageNum = 1, pageSize = 100; // 定义分页
let pageNum = 1, pageSize = 10; // 定义分页
let _this = null;
layui.config({
base: "../../plugin/layui-v2.9.7/layui/dtree/", //此处路径请自行处理, 可以使用绝对路径
@ -14,13 +14,9 @@ layui.config({
if (obj.param.level === '1') {
return parent.layer.msg('请选择球机', { icon: 7, offset: 't' });
}
let id = $(this).find('span').attr('id');
let online = $(this).find('span').attr('online');
let bZero = $(this).find('span').attr('bZero');
console.log($(this).find('span').attr('id'));
console.log($(this).find('span').attr('online'));
console.log($(this).find('span').attr('bZero'));
if (online === '0') {
return parent.layer.msg('设备离线', { icon: 7, offset: 't' });
}
@ -28,11 +24,12 @@ layui.config({
});
// 登录海康平台
setTimeout(() => {
// clickLogin(1);
clickLogin(1);
}, 1000);
dataFlow({
pageNum: pageNum,
pageSize: pageSize
pageSize: pageSize,
bidCode: parent.$('#bidPro').val()
});
$("#ID-flow-demo").niceScroll({ cursorborder: "", cursorcolor: "#c0c4cc", boxzoom: true });
$("#video-tree").niceScroll({ cursorborder: "", cursorcolor: "#c0c4cc", boxzoom: true });
@ -67,8 +64,8 @@ function dataFlow(queryParams) {
queryParams.pageNum = page;
let returnData = loadData(queryParams);
if (returnData != null) {
lis = initImgData(returnData.data.list)
next(lis.join(''), page < returnData.data.total / 100);
lis = initImgData(returnData.data)
next(lis.join(''), page < returnData.count / pageSize);
}
}
});
@ -76,40 +73,22 @@ function dataFlow(queryParams) {
/**加载图片数据*/
function loadData(queryParams) {
let returnData = {
total: 60,
data: {
list: [
{
'id': '1',
'path': '../../../img/constrDisplay/test.jpg',
'status': '0',
'warnTime': '2025-05-15 12:00:00',
'content': '今日无作业票',
'warnContent': '现场有人员逗留超过10分钟请确认'
},
]
}
}
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 () {
let returnData = null;
let paramData = 'bidCode=' + queryParams.bidCode + '&page=' + queryParams.pageNum + '&limit=' + queryParams.pageSize;
let montageParam = aqEnnable ? encryptCBC(paramData) : ' &' + encryptCBC(paramData);
const url = commonUrl + "screen/largeScreen/constrDisplay/getCameraImage?params=" + montageParam;
ajaxRequestGet(url, "GET", false, function () {
}, function (result) {
if (result.status === 200) {
if (result.code === 0) {
console.log(result)
returnData = result;
} else {
layer.msg(result.msg, { icon: 2 })
} else if (result.code === 500) {
layer.msg(result.msg, { icon: 2 });
}
}, function (xhr) {
error(xhr)
});
return returnData; */
}, function (xhr, status, error) {
error(xhr, status, error)
}, aqEnnable);
return returnData;
}
/**渲染图片*/
@ -117,21 +96,20 @@ function initImgData(list) {
let htmlArr = [];
if (list && list.length > 0) {
$.each(list, function (index, item) {
// let filePath = imgUrl + item.compressFilePath + "?token=" + tokens;
let filePath = item.path;
htmlArr.push("<div class='img-info' isShow = 'true' onclick='handleData(this," + JSON.stringify(item) + ")'>" +
let filePath = imgUrl + item.image + "?token=" + sessionStorage.getItem("zhgd_token");
htmlArr.push("<div class='img-info' onclick='handleData(this," + JSON.stringify(item) + ")'>" +
" <div class='imgData layout'>\n" +
" <img src='" + filePath + "'>" +
" </div>" +
" <div class='imgData2 layout'>" +
" <p>" + item.warnTime + "</p>" +
" <p class='img-color" + (item.status) + "'>" + (item.status === '0' ? '未确认' : '已确认') + "</p>" +
" <p>" + item.createTime + "</p>" +
" <p class='img-color" + (item.isSure) + "'>" + (item.isSure === '0' ? '未确认' : item.isSure === '1' ? '已确认' : '系统误判') + "</p>" +
" </div>" +
" <div class='imgData3 layout'>" +
" <p>" + item.content + "</p>" +
" <p>今日无作业票</p>" +
" </div>" +
" <div class='imgData4 layout'>" +
" <p>" + item.warnContent + "</p>" +
" <p>现场有人员逗留,请确认!</p>" +
" </div>" +
" </div>");
})
@ -140,18 +118,26 @@ function initImgData(list) {
}
function handleData(that, obj) {
let isShow = $(that).attr('isShow');
if (isShow === 'true') {
hidPlugin();
_this = that;
openIframeByParamObj("handleData", "无计划预警信息", "./handleWarnInfo.html", "72%", "95%", obj, 1);
hidPlugin();
_this = that;
let isSure = $(that).attr('isSure');
let remark = $(that).attr('remark');
if (isSure) {
obj.isSure = isSure;
}
if (remark) {
obj.remark = remark;
}
openIframeByParamObj("handleData", "无计划预警信息", "./handleWarnInfo.html", "72%", "95%", obj, 1);
}
function changeData() {
$(_this).attr('isShow', 'false');
$(_this).find('.imgData2').find('p').eq(1).html('已确认');
$(_this).find('.imgData2').find('p').eq(1).attr('class', 'img-color1');
function changeData(str) {
let obj = JSON.parse(str);
console.error(obj);
$(_this).attr('isSure', obj.isSure);
$(_this).attr('remark', obj.remark);
$(_this).find('.imgData2').find('p').eq(1).html(obj.isSure === '1' ? '已确认' : '系统误判');
$(_this).find('.imgData2').find('p').eq(1).attr('class', obj.isSure === '1' ? 'img-color1' : 'img-color2');
}
// 查看更多

View File

@ -2,6 +2,8 @@ let form, laydate, layer;
let objParams = {};
function setParams(obj) {
objParams = JSON.parse(obj);
console.log(objParams);
layui.use(["form", 'layer'], function () {
form = layui.form;
layer = layui.layer;
@ -19,10 +21,22 @@ function setParams(obj) {
});
layui.form.render();
});
$('.content-info').eq(0).append('<p>' + objParams.warnTime + '</p>');
$('.content-info').eq(1).append('<p>' + objParams.content + '</p>');
$('.content-info').eq(2).append('<p>' + objParams.warnContent + '</p>');
$('#img-show').find('img').attr('src', objParams.path);
$('.content-info').eq(0).append('<p>' + objParams.createTime + '</p>');
$('.content-info').eq(1).append('<p>今日无作业票</p>');
$('.content-info').eq(2).append('<p>现场有人员逗留,请确认!</p>');
if (objParams.isSure === '1') {
$('#statusItem').remove();
$('#measures').remove();
$('#save').remove();
$('#lastContent-info').after('<div class="content-info layout"><p>已确认</p></div><div class="content-info layout"><p>处置措施:' + objParams.remark + '</p></div>');
} else if (objParams.isSure === '2') {
$('#statusItem').remove();
$('#measures').remove();
$('#save').remove();
$('#lastContent-info').after('<div class="content-info layout"><p>系统误判</p></div>');
}
let filePath = imgUrl + objParams.image + "?token=" + sessionStorage.getItem("zhgd_token");
$('#img-show').find('img').attr('src', filePath);
}
function setMeasures() {
@ -41,8 +55,9 @@ function saveData2() {
// 保存数据
function submitApply(data) {
/* let field = data.field; // 获取表单字段值
const url = commonUrl + "screen/largeScreen/personnelControl/addNewFence";
let field = data.field; // 获取表单字段值
field.id = objParams.id;
const url = commonUrl + "screen/largeScreen/constrDisplay/updateImage";
let encryptStr = encryptCBC(JSON.stringify(field));
let loadingMsg = layer.msg('正在提交保存,请稍等...', {
icon: 16,
@ -54,6 +69,7 @@ function submitApply(data) {
layer.close(loadingMsg); // 关闭提示层
if (result.code === 200) {
parent.layer.msg(result.msg, { icon: 1, offset: 't' });
closePage(1);
} else if (result.code === 500) {
layer.msg(result.msg, { icon: 2 });
} else if (result.code === 401) {
@ -62,15 +78,16 @@ function submitApply(data) {
}, function (xhr) {
layer.close(loadingMsg); // 关闭提示层
error(xhr)
}, "application/json", aqEnnable); */
closePage(1);
}, "application/json", aqEnnable);
}
// 关闭页面
function closePage(type) {
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
if (type == 1) {
window.parent.changeData();
objParams.remark = $('#remark').val();
objParams.isSure = $('input[name="isSure"]:checked').val();
window.parent.changeData(JSON.stringify(objParams));
}
parent.layer.close(index); // 再执行关闭
}

View File

@ -19,38 +19,85 @@ function setParams(obj) {
});
}
// 重载表格
function reloadTable(pageNum) {
table.reload("currentTableId", {
page: {
curr: pageNum ? pageNum : 1,
},
where: {
bidCode: parent.$('#bidPro').val(),
startTime: $('#startDate').val(),
endTime: $('#endDate').val(),
},
},
);
}
function initTable(bidCode) {
const url = commonUrl + "screen/largeScreen/dataAnalysis/getListByType";
const url = commonUrl + "screen/largeScreen/constrDisplay/getCameraImage";
table.render({
elem: '#demo2',
id: 'currentTableId',
url: url,
skin: 'line',
page: true,
height: 'full-200',
height: 'full-180',
headers: {
"decrypt": "decrypt",
"Authorization": token
},
where: {
bidCode: bidCode,
startTime: $('#startDate').val(),
endTime: $('#endDate').val()
},
cols: [[
{ type: 'numbers', title: '序号', width: '10%' }, // 添加序号列
{ field: 'date', title: '日期', align: 'center', width: '20%' },
{ field: 'warnContent', title: '预警内容', align: 'center', width: '20%' },
{ field: 'photo', title: '照片', align: 'center', width: '25%' },
{ field: 'status', title: '状态', align: 'center', width: '25%' }
{ field: 'createTime', title: '日期', align: 'center', width: '20%' },
{
field: 'warnContent', title: '预警内容', align: 'center', width: '20%',
templet: function (d) {
return '现场有人员逗留,请确认!';
}
},
{
field: 'photo', title: '照片', align: 'center', width: '20%',
templet: function (d) {
let html = "", filePath = imgUrl + d.image + "?token=" + sessionStorage.getItem("zhgd_token");
html += "<img src=" + filePath + " onclick='viewImg(" + JSON.stringify(d) + ")'>";
return html;
}
},
{
field: 'status', title: '状态', align: 'center', width: '10%',
templet: function (d) {
return (d.isSure === '0' ? '未确认' : d.isSure === '1' ? '已确认' : '系统误判');
},
},
{
field: 'remark', title: '处置措施', align: 'center', width: '20%'
}
]],
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);
}
})
}
function viewImg(item) {
let filePath = imgUrl + item.image + "?token=" + sessionStorage.getItem("zhgd_token");
layer.photos({
shade: 0.5,
footer: false,
photos: {
"title": "图片预览",
"start": 0,
"data": [
{
"pid": 1,
"src": filePath,
}
]
},
});
}

View File

@ -47,9 +47,7 @@
<form class="layui-form" onsubmit="return false;">
<div class="layui-form-item" style="margin-bottom: 0;">
<div class="layui-inline" style="height: 36px;width: 400px;margin-top: -5px;">
<select class="layui-select" lay-filter="classMeeting">
<option value="1">测试</option>
<option value="2">测试2</option>
<select class="layui-select" id="classMeeting" lay-filter="classMeeting">
</select>
</div>
</div>

View File

@ -36,18 +36,19 @@
</div>
<div class="content-info layout">
</div>
<div class="content-info layout">
<div class="content-info layout" id="lastContent-info">
</div>
<div class="layui-form-item" id="statusItem">
<div class="layui-input-block" style="margin-left: 0;">
<input type="radio" name="status" value="1" title="确认无计划" checked>
<input type="radio" name="status" value="2" title="系统误判">
<input type="radio" name="isSure" value="1" title="确认无计划" checked>
<input type="radio" name="isSure" value="2" title="系统误判">
</div>
</div>
<div class="layui-form-item layui-form-text" id="measures">
<label class="layui-form-label" style="text-align: left;padding: 9px 0;">处置措施</label>
<div class="layui-input-block" style="margin-left: 0;">
<textarea placeholder="请输入处置措施" lay-verify="required" class="layui-textarea" maxlength="255"></textarea>
<textarea placeholder="请输入处置措施" name="remark" id="remark" lay-verify="required" class="layui-textarea"
maxlength="255"></textarea>
</div>
</div>
<button type="submit" id="formSubmit" class="layui-btn" lay-submit="" lay-filter="formData"
@ -56,7 +57,8 @@
</div>
</div>
<div class="btn-box">
<button class="layui-btn layui-btn-lg layui-btn-normal" onclick="saveData2()">确认</button>
<button class="layui-btn layui-btn-lg layui-btn-normal" id="save" onclick="saveData2()">确认</button>
<button class="layui-btn layui-btn-lg layui-btn-normal" id="cancel" onclick="closePage()">取消</button>
</div>
</div>
</body>

View File

@ -42,7 +42,7 @@
</div>
</div>
<div class="layui-inline">
<button class="layui-btn" onclick="queryTable(1)"><i class="layui-icon"></i>
<button class="layui-btn" onclick="reloadTable(1)"><i class="layui-icon"></i>
搜 索</button>
</div>
</div>