From c9c946ae78acf220f68f161d03bf7513b5575792 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Thu, 15 May 2025 21:00:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/commonRequest.js | 4 +- css/constrDisplay/constrDisplay.css | 23 +- css/video/fixed_video.css | 9 + css/video/handleWarnInfo.css | 3 +- css/video/moreData.css | 14 ++ js/pages/constrDisplay/constrDisplay.js | 319 ++++++++++-------------- js/pages/video/fixed_video.js | 96 +++---- js/pages/video/handleWarnInfo.js | 35 ++- js/pages/video/moreData.js | 75 ++++-- pages/constrDisplay/constrDisplay.html | 4 +- pages/video/handleWarnInfo.html | 12 +- pages/video/moreData.html | 2 +- 12 files changed, 318 insertions(+), 278 deletions(-) diff --git a/api/commonRequest.js b/api/commonRequest.js index c52d1ec..aafc6fb 100644 --- a/api/commonRequest.js +++ b/api/commonRequest.js @@ -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="; /* 登录相关 */ diff --git a/css/constrDisplay/constrDisplay.css b/css/constrDisplay/constrDisplay.css index 6b27a1d..e205a45 100644 --- a/css/constrDisplay/constrDisplay.css +++ b/css/constrDisplay/constrDisplay.css @@ -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; } \ No newline at end of file diff --git a/css/video/fixed_video.css b/css/video/fixed_video.css index 046271c..7ca60ed 100644 --- a/css/video/fixed_video.css +++ b/css/video/fixed_video.css @@ -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; } \ No newline at end of file diff --git a/css/video/handleWarnInfo.css b/css/video/handleWarnInfo.css index 19a5d5a..e81d9c2 100644 --- a/css/video/handleWarnInfo.css +++ b/css/video/handleWarnInfo.css @@ -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; } \ No newline at end of file diff --git a/css/video/moreData.css b/css/video/moreData.css index 57f96f2..fd4201d 100644 --- a/css/video/moreData.css +++ b/css/video/moreData.css @@ -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; } \ No newline at end of file diff --git a/js/pages/constrDisplay/constrDisplay.js b/js/pages/constrDisplay/constrDisplay.js index b4fa5cc..72d160e 100644 --- a/js/pages/constrDisplay/constrDisplay.js +++ b/js/pages/constrDisplay/constrDisplay.js @@ -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("
" + "
\n" + - " " + + " " + "
" + "
" + - "

" + item.username + "

" + + "

" + item.userName + "

" + + "
" + + "
" + + "

" + item.accessTime + "

" + "
" + "
"); }) @@ -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 += ""; + 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); } }) -} \ No newline at end of file +} + +// 工作情况 +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 += ''; + }) + } 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, + } + ] + }, + }); +} diff --git a/js/pages/video/fixed_video.js b/js/pages/video/fixed_video.js index 8166146..7f490f2 100644 --- a/js/pages/video/fixed_video.js +++ b/js/pages/video/fixed_video.js @@ -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("
" + + let filePath = imgUrl + item.image + "?token=" + sessionStorage.getItem("zhgd_token"); + htmlArr.push("
" + "
\n" + " " + "
" + "
" + - "

" + item.warnTime + "

" + - "

" + (item.status === '0' ? '未确认' : '已确认') + "

" + + "

" + item.createTime + "

" + + "

" + (item.isSure === '0' ? '未确认' : item.isSure === '1' ? '已确认' : '系统误判') + "

" + "
" + "
" + - "

" + item.content + "

" + + "

今日无作业票

" + "
" + "
" + - "

" + item.warnContent + "

" + + "

现场有人员逗留,请确认!

" + "
" + "
"); }) @@ -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'); } // 查看更多 diff --git a/js/pages/video/handleWarnInfo.js b/js/pages/video/handleWarnInfo.js index 4bc1b26..04a2995 100644 --- a/js/pages/video/handleWarnInfo.js +++ b/js/pages/video/handleWarnInfo.js @@ -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('

' + objParams.warnTime + '

'); - $('.content-info').eq(1).append('

' + objParams.content + '

'); - $('.content-info').eq(2).append('

' + objParams.warnContent + '

'); - $('#img-show').find('img').attr('src', objParams.path); + $('.content-info').eq(0).append('

' + objParams.createTime + '

'); + $('.content-info').eq(1).append('

今日无作业票

'); + $('.content-info').eq(2).append('

现场有人员逗留,请确认!

'); + if (objParams.isSure === '1') { + $('#statusItem').remove(); + $('#measures').remove(); + $('#save').remove(); + $('#lastContent-info').after('

已确认

处置措施:' + objParams.remark + '

'); + } else if (objParams.isSure === '2') { + $('#statusItem').remove(); + $('#measures').remove(); + $('#save').remove(); + $('#lastContent-info').after('

系统误判

'); + } + 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); // 再执行关闭 } \ No newline at end of file diff --git a/js/pages/video/moreData.js b/js/pages/video/moreData.js index f99a541..399f396 100644 --- a/js/pages/video/moreData.js +++ b/js/pages/video/moreData.js @@ -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 += ""; + 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, + } + ] + }, + }); } \ No newline at end of file diff --git a/pages/constrDisplay/constrDisplay.html b/pages/constrDisplay/constrDisplay.html index f7410a0..7068c1b 100644 --- a/pages/constrDisplay/constrDisplay.html +++ b/pages/constrDisplay/constrDisplay.html @@ -47,9 +47,7 @@
-
diff --git a/pages/video/handleWarnInfo.html b/pages/video/handleWarnInfo.html index f986e2c..4798a77 100644 --- a/pages/video/handleWarnInfo.html +++ b/pages/video/handleWarnInfo.html @@ -36,18 +36,19 @@
-
+
- - + +
- +
- + +
diff --git a/pages/video/moreData.html b/pages/video/moreData.html index ef4f157..994408c 100644 --- a/pages/video/moreData.html +++ b/pages/video/moreData.html @@ -42,7 +42,7 @@
-