diff --git a/bns/html/dutyTask/remotePatrol/remotePatrol.html b/bns/html/dutyTask/remotePatrol/remotePatrol.html index fc60d3e..2298e9e 100644 --- a/bns/html/dutyTask/remotePatrol/remotePatrol.html +++ b/bns/html/dutyTask/remotePatrol/remotePatrol.html @@ -28,6 +28,7 @@ + diff --git a/bns/img/demo_img/img.png b/bns/img/demo_img/img.png new file mode 100644 index 0000000..c2b777a Binary files /dev/null and b/bns/img/demo_img/img.png differ diff --git a/bns/img/demo_img/img2.png b/bns/img/demo_img/img2.png new file mode 100644 index 0000000..3ad5301 Binary files /dev/null and b/bns/img/demo_img/img2.png differ diff --git a/bns/img/demo_img/img3.png b/bns/img/demo_img/img3.png new file mode 100644 index 0000000..dc926e8 Binary files /dev/null and b/bns/img/demo_img/img3.png differ diff --git a/bns/js/dutyTask/remotePatrol/remotePatrol.js b/bns/js/dutyTask/remotePatrol/remotePatrol.js index a3931c1..9a64fa5 100644 --- a/bns/js/dutyTask/remotePatrol/remotePatrol.js +++ b/bns/js/dutyTask/remotePatrol/remotePatrol.js @@ -306,7 +306,7 @@ function setClassDetailData(result) { } $('#content').html(setValue2(data.workType) + '' + setValue2(data.workGx) + '' + setValue2(data.workContent)) $('#workManager').html(data.workManager) - $('#workManagePhone').html(data.workManagePhone) + $('#workManagePhone').html(phoneHide(data.workManagePhone)) $(safetyManagers(data.safetyManager)).appendTo('#addPostion') $('#controll').html(setValue(data.controll)) $('#changes').html(setValue(data.changes)) @@ -492,13 +492,15 @@ function setWorkPhoto(imgPath, color, item) { /*到岗到位签到表赋值*/ function setDutyTableData(result) { + let list = handleDecryptData(sm4.decryptDefault_CBC(result.data)); + let dataList =JSON.parse(list); let html = '
暂无数据
').css('justify-content', 'center') - $('.key-point-photo-type').eq(index).find('p').eq(0).css('margin-top', '10px'); + let imgPath = '
'
+ }else if(index === 1){
+ imgPath = '
'
+ }else if(index === 2){
+ imgPath = '
'
+ }
+ $('.key-point-photo-type').eq(index).empty().append(imgPath)
+ /* $('.key-point-photo-type').eq(index).empty().append('暂无数据
').css('justify-content', 'center') + $('.key-point-photo-type').eq(index).find('p').eq(0).css('margin-top', '10px'); */ } } diff --git a/bns/js/dutyTask/remotePatrol/remotePatrolAjaxReq.js b/bns/js/dutyTask/remotePatrol/remotePatrolAjaxReq.js index ce34a2a..ee9eb0b 100644 --- a/bns/js/dutyTask/remotePatrol/remotePatrolAjaxReq.js +++ b/bns/js/dutyTask/remotePatrol/remotePatrolAjaxReq.js @@ -1,3 +1,4 @@ +var sm4 = new SM4Util(); /*站班会详情-请求*/ function getZbhDetailAjax() { $.ajax({ @@ -12,8 +13,9 @@ function getZbhDetailAjax() { }, type: 'post', async: true, - success: function (result) { - if (result !== 'null') { + success: function (res) { + let result = handleDecryptData(sm4.decryptDefault_CBC(res)); + if (result !== 'null' && result) { setClassDetailData(result); } else { setClassDetailData(null); @@ -38,7 +40,9 @@ function getZbhPeopleAjax() { }, type: 'post', async: true, - success: function (result) { + success: function (res) { + let result = handleDecryptData(sm4.decryptDefault_CBC(res)); + setWorkerPersonData(result); }, error: function () { setWorkerPersonData(null); @@ -58,7 +62,6 @@ function getClassMettingSignAjax() { data: { classId: idParam }, - contentType: 'application/json; charset=utf-8', // 指定内容类型和编码 dataType:'JSON', type: 'POST', async: true, diff --git a/bns/js/public/commonUtils.js b/bns/js/public/commonUtils.js index a0ca48e..18136b7 100644 --- a/bns/js/public/commonUtils.js +++ b/bns/js/public/commonUtils.js @@ -30,25 +30,25 @@ let getImportComfrimWidth = () => { return $(top.window).width() * 0.3125; }; let autoResizeWidth = (index) => { - layer.style(index, {width: getDefaultWidth().toFixed(0) + 'px'}); + layer.style(index, { width: getDefaultWidth().toFixed(0) + 'px' }); }; let autoNewResizeWidth = (index) => { - layer.style(index, {width: getNewDefaultWidth().toFixed(0) + 'px'}); + layer.style(index, { width: getNewDefaultWidth().toFixed(0) + 'px' }); }; let autoMoreResizeWidth = (index) => { - layer.style(index, {width: getMoreWidth().toFixed(0) + 'px'}); + layer.style(index, { width: getMoreWidth().toFixed(0) + 'px' }); }; let autoChooseResizeWidth = (index) => { - layer.style(index, {width: getChooseWidth().toFixed(0) + 'px'}); + layer.style(index, { width: getChooseWidth().toFixed(0) + 'px' }); }; let autoSecondaryResizeWidth = (index) => { - layer.style(index, {width: getSecondaryWidth().toFixed(0) + 'px'}); + layer.style(index, { width: getSecondaryWidth().toFixed(0) + 'px' }); }; let autoComfrimResizeWidth = (index) => { - layer.style(index, {width: getComfrimWidth().toFixed(0) + 'px'}); + layer.style(index, { width: getComfrimWidth().toFixed(0) + 'px' }); }; let autoImportComfrimResizeWidth = (index) => { - layer.style(index, {width: getImportComfrimWidth().toFixed(0) + 'px'}); + layer.style(index, { width: getImportComfrimWidth().toFixed(0) + 'px' }); }; let getDefaultHeight = () => { return $(top.window).height() * 0.7759259; @@ -74,31 +74,31 @@ let getImportConfirmHeight = () => { return $(top.window).height() * 0.4694444; }; let autoResizeHeight = (index) => { - layer.style(index, {height: getDefaultHeight().toFixed(0) + 'px'}); + layer.style(index, { height: getDefaultHeight().toFixed(0) + 'px' }); }; let autoNewResizeHeight = (index) => { - layer.style(index, {height: getNewDefaultHeight().toFixed(0) + 'px'}); + layer.style(index, { height: getNewDefaultHeight().toFixed(0) + 'px' }); }; let autoMoreResizeHeight = (index) => { - layer.style(index, {height: getMoreHeight().toFixed(0) + 'px'}); + layer.style(index, { height: getMoreHeight().toFixed(0) + 'px' }); }; let autoChooseResizeHeight = (index) => { - layer.style(index, {height: getChooseHeight().toFixed(0) + 'px'}); + layer.style(index, { height: getChooseHeight().toFixed(0) + 'px' }); }; let autoSecondaryResizeHeight = (index) => { - layer.style(index, {height: getSecondaryHeight().toFixed(0) + 'px'}); + layer.style(index, { height: getSecondaryHeight().toFixed(0) + 'px' }); }; let autoConfrimResizeHeight = (index) => { - layer.style(index, {height: getConfirmHeight().toFixed(0) + 'px'}); + layer.style(index, { height: getConfirmHeight().toFixed(0) + 'px' }); }; let autoImportConfrimResizeHeight = (index) => { - layer.style(index, {height: getImportConfirmHeight().toFixed(0) + 'px'}); + layer.style(index, { height: getImportConfirmHeight().toFixed(0) + 'px' }); }; let autoParentResizeWidth = (index) => { - parent.layer.style(index, {width: getDefaultWidth().toFixed(0) + 'px'}); + parent.layer.style(index, { width: getDefaultWidth().toFixed(0) + 'px' }); }; let autoParentResizeHeight = (index) => { - parent.layer.style(index, {height: getDefaultHeight().toFixed(0) + 'px'}); + parent.layer.style(index, { height: getDefaultHeight().toFixed(0) + 'px' }); }; // 根据身份证获取年龄 @@ -291,8 +291,8 @@ function getNowTime() { var dateStr = year + "-" + month + "-" + day; return dateStr; } -function getyesDay(){ - var nowDate = new Date( new Date().setHours(0)-24*60*60*1000); +function getyesDay() { + var nowDate = new Date(new Date().setHours(0) - 24 * 60 * 60 * 1000); var year = nowDate.getFullYear(); var month = nowDate.getMonth() + 1 < 10 ? "0" + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1; @@ -308,25 +308,25 @@ function getyesDay(){ function getStartTime() { let date = new Date() date.setDate(1) // 将当前时间的日期设置成第一天 - let year= date.getFullYear() // 得到当前年份 - let month = date.getMonth() + 1 // 得到当前月份(0-11月份,+1是当前月份) - month = month >= 10 ? month :'0' + month // 补零 - let day = date.getDate() // 得到当前天数,实际是本月第一天,因为前面setDate(1) 设置过了 - day = day >= 10 ? day :'0' + day // 补零 - return year +'-'+ month +'-'+ day // 这里传入的是字符串 + let year = date.getFullYear() // 得到当前年份 + let month = date.getMonth() + 1 // 得到当前月份(0-11月份,+1是当前月份) + month = month >= 10 ? month : '0' + month // 补零 + let day = date.getDate() // 得到当前天数,实际是本月第一天,因为前面setDate(1) 设置过了 + day = day >= 10 ? day : '0' + day // 补零 + return year + '-' + month + '-' + day // 这里传入的是字符串 }; /*获取当前月的最后一天*/ -function getEndTime(){ - let date = new Date() +function getEndTime() { + let date = new Date() let year = date.getFullYear() - let month = date.getMonth() +1 - month = month >= 10 ? month :'0' + month // 补零 + let month = date.getMonth() + 1 + month = month >= 10 ? month : '0' + month // 补零 // 这里传入的是整数时间,返回的是下个月的第一天,因为月份是0-11 - let nextMonthFirthDay = new Date(year,month,1) // 下个月的第一天 - let oneDay = 1000*60 * 60 * 24 // 一天的时间毫秒数 + let nextMonthFirthDay = new Date(year, month, 1) // 下个月的第一天 + let oneDay = 1000 * 60 * 60 * 24 // 一天的时间毫秒数 let endDay = new Date(nextMonthFirthDay - oneDay) let day = endDay.getDate() // 本月最后一天 - day = day >= 10 ? day :'0' + day // 补零 + day = day >= 10 ? day : '0' + day // 补零 // 这里传入的是字符串格式的时间,返回的是传入字符串的时间 return year + '-' + month + '-' + day }; @@ -394,8 +394,8 @@ function ajaxRequest(url, type, data, async, beforeFn, successFn, errorFn, conte async: async, beforeSend: beforeFn, contentType: contentType || "application/x-www-form-urlencoded; charset=utf-8", - success: function (event, xhr, settings, data){ - event=modifyResponseData(event); + success: function (event, xhr, settings, data) { + event = modifyResponseData(event); if (event.code === 401) { logout(1); } @@ -416,4 +416,13 @@ function errorFn(xhr, status, error) { // 请求出现其他错误 console.error("ajax请求错误:" + error); } -} \ No newline at end of file +} + + +/* 处理解密的sm4数据*/ +/* function handleDecryptData(str){ + if(str){ + return str.replace(/\|\|\|\|\/g, ''); + } + return null; +} */ diff --git a/bns/js/public/public.js b/bns/js/public/public.js index af50f70..8d2df67 100644 --- a/bns/js/public/public.js +++ b/bns/js/public/public.js @@ -410,3 +410,39 @@ function setRiskLevelColor(value) { } } +/* 处理解密的sm4数据*/ +function handleDecryptData(decrypted) { + const lastByte = decrypted.charCodeAt(decrypted.length - 1); + if (lastByte <= 16) { + for (let i = decrypted.length - lastByte; i < decrypted.length; i++) { + if (decrypted.charCodeAt(i) !== lastByte) { + return decrypted; // 如果填充不正确,返回原始字符串 + } + } + return decrypted.slice(0, -lastByte); + } + return decrypted; +} + +// 手机号脱敏 +function phoneHide(phone) { + if(!phone){ + return ''; + } + let phoneStr = phone.replace(/(\d{3})\d*(\d{4})/, '$1****$2') + return phoneStr; +} + +/* 身份证号脱敏 */ +function desensitizeIDCard(idCard) { + if (!idCard || idCard.length < 6) { + return ''; + } + // 中国大陆的身份证号码长度为18位 + const idLength = 18; + // 保留前6位和后4位,中间替换为星号 + const prefix = idCard.substr(0, 6); + const suffix = idCard.substr(idLength - 4); + const middle = '*'.repeat(idLength - 10); + return prefix + middle + suffix; +} \ No newline at end of file