远程巡视修改
This commit is contained in:
parent
2cecb97652
commit
3b0c8fe230
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
<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/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/layui/layui.js" charset="utf-8"></script>
|
||||
<script src="../../../js/public/select.js" charset="utf-8"></script>
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 300 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 205 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 94 KiB |
|
|
@ -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 = '<tr><td>职务</td><td>姓名</td><td>手机号</td><td>签到时间</td></tr>';
|
||||
if (result.data.length) {
|
||||
$.each(result.data, function (index, item) {
|
||||
if (dataList.length) {
|
||||
$.each(dataList, function (index, item) {
|
||||
html += '<tr>' +
|
||||
'<td>' + transformNull(item.peopleType) + '</td>' +
|
||||
'<td>' + item.userName + '</td>' +
|
||||
'<td>' + item.phone + '</td>' +
|
||||
'<td>' + phoneHide(item.phone) + '</td>' +
|
||||
'<td>' + item.inTime + '</td>' +
|
||||
'</tr>';
|
||||
})
|
||||
|
|
@ -576,8 +578,17 @@ function setPhoto(data, index) {
|
|||
})
|
||||
$('.key-point-photo-type').eq(index).empty().append(html)
|
||||
} else {
|
||||
$('.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');
|
||||
let imgPath = '<img src="">'
|
||||
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'); */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 处理解密的sm4数据*/
|
||||
/* function handleDecryptData(str){
|
||||
if(str){
|
||||
return str.replace(/\|\|\|\|\/g, '');
|
||||
}
|
||||
return null;
|
||||
} */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
Loading…
Reference in New Issue