远程巡视修改

This commit is contained in:
cwchen 2024-12-13 11:14:17 +08:00
parent 2cecb97652
commit 3b0c8fe230
8 changed files with 104 additions and 44 deletions

View File

@ -28,6 +28,7 @@
<script src="../../../js/public/public.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/public/public.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/public/sm3.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/public/sm3.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/system/sm4.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/public/permission.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/public/permission.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/layui/layui.js" charset="utf-8"></script> <script src="../../../js/layui/layui.js" charset="utf-8"></script>
<script src="../../../js/public/select.js" charset="utf-8"></script> <script src="../../../js/public/select.js" charset="utf-8"></script>

BIN
bns/img/demo_img/img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

BIN
bns/img/demo_img/img2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

BIN
bns/img/demo_img/img3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

View File

@ -306,7 +306,7 @@ function setClassDetailData(result) {
} }
$('#content').html(setValue2(data.workType) + '' + setValue2(data.workGx) + '' + setValue2(data.workContent)) $('#content').html(setValue2(data.workType) + '' + setValue2(data.workGx) + '' + setValue2(data.workContent))
$('#workManager').html(data.workManager) $('#workManager').html(data.workManager)
$('#workManagePhone').html(data.workManagePhone) $('#workManagePhone').html(phoneHide(data.workManagePhone))
$(safetyManagers(data.safetyManager)).appendTo('#addPostion') $(safetyManagers(data.safetyManager)).appendTo('#addPostion')
$('#controll').html(setValue(data.controll)) $('#controll').html(setValue(data.controll))
$('#changes').html(setValue(data.changes)) $('#changes').html(setValue(data.changes))
@ -492,13 +492,15 @@ function setWorkPhoto(imgPath, color, item) {
/*到岗到位签到表赋值*/ /*到岗到位签到表赋值*/
function setDutyTableData(result) { function setDutyTableData(result) {
let list = handleDecryptData(sm4.decryptDefault_CBC(result.data));
let dataList =JSON.parse(list);
let html = '<tr><td>职务</td><td>姓名</td><td>手机号</td><td>签到时间</td></tr>'; let html = '<tr><td>职务</td><td>姓名</td><td>手机号</td><td>签到时间</td></tr>';
if (result.data.length) { if (dataList.length) {
$.each(result.data, function (index, item) { $.each(dataList, function (index, item) {
html += '<tr>' + html += '<tr>' +
'<td>' + transformNull(item.peopleType) + '</td>' + '<td>' + transformNull(item.peopleType) + '</td>' +
'<td>' + item.userName + '</td>' + '<td>' + item.userName + '</td>' +
'<td>' + item.phone + '</td>' + '<td>' + phoneHide(item.phone) + '</td>' +
'<td>' + item.inTime + '</td>' + '<td>' + item.inTime + '</td>' +
'</tr>'; '</tr>';
}) })
@ -576,8 +578,17 @@ function setPhoto(data, index) {
}) })
$('.key-point-photo-type').eq(index).empty().append(html) $('.key-point-photo-type').eq(index).empty().append(html)
} else { } else {
$('.key-point-photo-type').eq(index).empty().append('<p>暂无数据</p>').css('justify-content', 'center') let imgPath = '<img src="">'
$('.key-point-photo-type').eq(index).find('p').eq(0).css('margin-top', '10px'); if(index === 0){
imgPath = '<img src="../../../img/demo_img/img.png">'
}else if(index === 1){
imgPath = '<img src="../../../img/demo_img/img2.png">'
}else if(index === 2){
imgPath = '<img src="../../../img/demo_img/img3.png">'
}
$('.key-point-photo-type').eq(index).empty().append(imgPath)
/* $('.key-point-photo-type').eq(index).empty().append('<p></p>').css('justify-content', 'center')
$('.key-point-photo-type').eq(index).find('p').eq(0).css('margin-top', '10px'); */
} }
} }

View File

@ -1,3 +1,4 @@
var sm4 = new SM4Util();
/*站班会详情-请求*/ /*站班会详情-请求*/
function getZbhDetailAjax() { function getZbhDetailAjax() {
$.ajax({ $.ajax({
@ -12,8 +13,9 @@ function getZbhDetailAjax() {
}, },
type: 'post', type: 'post',
async: true, async: true,
success: function (result) { success: function (res) {
if (result !== 'null') { let result = handleDecryptData(sm4.decryptDefault_CBC(res));
if (result !== 'null' && result) {
setClassDetailData(result); setClassDetailData(result);
} else { } else {
setClassDetailData(null); setClassDetailData(null);
@ -38,7 +40,9 @@ function getZbhPeopleAjax() {
}, },
type: 'post', type: 'post',
async: true, async: true,
success: function (result) { success: function (res) {
let result = handleDecryptData(sm4.decryptDefault_CBC(res));
setWorkerPersonData(result); setWorkerPersonData(result);
}, error: function () { }, error: function () {
setWorkerPersonData(null); setWorkerPersonData(null);
@ -58,7 +62,6 @@ function getClassMettingSignAjax() {
data: { data: {
classId: idParam classId: idParam
}, },
contentType: 'application/json; charset=utf-8', // 指定内容类型和编码
dataType:'JSON', dataType:'JSON',
type: 'POST', type: 'POST',
async: true, async: true,

View File

@ -417,3 +417,12 @@ function errorFn(xhr, status, error) {
console.error("ajax请求错误" + error); console.error("ajax请求错误" + error);
} }
} }
/* 处理解密的sm4数据*/
/* function handleDecryptData(str){
if(str){
return str.replace(/\|\|\|\|\/g, '');
}
return null;
} */

View File

@ -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;
}