// ==UserScript==
// @icon http://www.tzr.me/images/2019/01/26/111.png
// @name 华医通审核助手
// @author zhiwen-T
// @namespace [url=mailto:1649991905@qq.com]1649991905@qq.com[/url]
// @description 华医通审核助手V1.0
// @include *://h5hyt.cd120.com/admin*
// @require http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js
// @version 1.2.0
// @downloadURL none
// ==/UserScript==
var run = true; //定义全局变量用于关闭函数
var a = '
';
//将以上的html代码插入到网页里的ul标签中
$("div.ant-layout-sider-children").append(a);
var b = '';
//将以上的html代码插入到网页里的ul标签中
$("div.ant-layout-sider-children").append(b);
$(document).on("click","#set",function(){
//document.querySelector("#set").addEventListener("click",function(){
var oldEditBox = document.querySelector("#rwl-setMenu");
if(oldEditBox){
oldEditBox.parentNode.removeChild(oldEditBox);
return;
}
var odom = document.createElement("div");
odom.id = "rwl-setMenu";
odom.style.cssText ="position: absolute;" +
"top: 65px;" +
"left: 202px;" +
"padding: 10px;" +
"background: #fff;" +
"border-radius: 4px;";
var innerH = "" +
''+//添加适应div ,背景
// "
" +
" " +
" " +
// "
" +
"
-------- 设置界面(尚未完成) --------" +
"
" +
"
其他 (待添加)
" +
"
关闭自动点击详情
" + "" +
"
自动点击第: 页,第个详情
" + "" +
"
自定义原因:
" + "" +
"
关闭快捷键功能
" + "" +
'
'+//添加适应div ,背景
"
  快捷功能:
  小键盘数字键 0 : 通过审核
  小键盘数字键 1 : 未通过原因1
  小键盘数字键 2 : 未通过原因2
  小键盘数字键 3 : 未通过原因3
  小键盘数字键 4 : 未通过原因4
  小键盘数字键 5 : 未通过原因5
  方向键← 左键   : 返回
   + 键                 : 进入下一个用户ID
  ESC键               : 退出图片全屏查看
 回车键               : 快捷点击确认
" +
'
'+
'
'+
""
"";
odom.innerHTML = innerH;
document.body.appendChild(odom);
document.getElementById("upload3").style.width="20px";
document.getElementById("upload4").style.width="20px";
document.getElementById("upload5").style.width="250px";
document.querySelector("#rwl-setMenuSave").addEventListener("click",saveSetting);
})
// 保存选项
function saveSetting(){
var positionTop = document.querySelector("#rwl-setMenu #positiontop").value;
var uploadChecked = document.querySelector("#rwl-setMenu #uploadchecked").checked;
var codevalue = document.querySelector("#rwl-setMenu textarea").value;
// console.log(positionTop,uploadChecked);
if(codevalue){
console.log(JSON.parse(codevalue));
var userSetting = GM_getValue("rwl_userData");
userSetting.data = JSON.parse(codevalue);
userSetting.positionTop = parseInt(positionTop);
userSetting.connectToTheServer = uploadChecked;
GM_setValue("rwl_userData",userSetting);
// console.log(GM_getValue("searchEngineJumpData"));
// 刷新页面
setTimeout(function(){
window.location.reload();
},300);
} else {
alert("输入为空");
// this.reset();
}
closeMenu();
}
//关闭菜单
function closeMenu(){
var oldEditBox = document.querySelector("#rwl-setMenu");
if(oldEditBox){
oldEditBox.parentNode.removeChild(oldEditBox);
return;
}
}
$(document).on("click","#zhushou1",function(){
console.log('关闭助手');
clearInterval(out);//停止功能1
clearInterval(aaa);//停止功能2
clearInterval(dj);//停止功能3
//$("#zhushou").html("审核助手X");
$("#kaiqi").hide();//隐藏按钮(0~0)
$("#guanbi").show();//显示按钮(0~0)
})
$(document).on("click","#zhushou2",function(){
console.log('开启助手');
out=setInterval(f,100) //重新开始功能1
aaa=setInterval(ff,500)//重新开始功能2
dj=setInterval(xq,500)//重新开始功能3
//$("#zhushou").html("审核助手√");
$("#kaiqi").show();//隐藏按钮(0~0)
$("#guanbi").hide();//显示按钮(0~0)
})
var out = setInterval(f,100);//100毫秒后运行刷新 (循环)
function f(){
var url = window.location.href;
// console.log('刷新111');
if(url.indexOf("tabStatu") >= 0 ){//2、判断循环条件;
if(location.href.indexOf('#') < 1){
location.href=location.href+"#";
location.href=location.href+"%";
location.reload();
}
}
// if(url.indexOf("list") >= 0 ){//2、判断循环条件;
// $("a")[2].click(); //自动点击详情
// }
}
var aaa = setInterval(ff,300);//100毫秒后运行刷新 (循环)
function ff(){
var url1 = window.location.href;
//console.log('刷新222');
if(url1.indexOf("tabStatu") >= 0 ){//2、判断循环条件;
if(location.href.indexOf('%') < 1){
setTimeout(function(){
window.location.href = "https://h5hyt.cd120.com/admin/realname/card/list";//跳转到主页
},420);
}
}
}
var dj = setInterval(xq,100);//100毫秒后运行刷新 (循环)
clearInterval(dj);//默认关闭自动点击
function xq(){
var url2 = window.location.href;
if(url2.indexOf("list") >= 0 ){//2、判断循环条件;
$("a")[2].click(); //自动点击详情
}
}
$(document).keydown(function(event){
if (event.keyCode == 103){
console.log('刷新222');
var title = document.getElementsByTagName("title")[5];
title[2].click();
// $("a")[0].click();
//$("tbody.ant-table-tbody tr:first td:last a:first").trigger("click"); //(废弃)能找到对应a标签但,无法出发点击事件!
}
})
window.onload=function(){
// 刷新后页面加载完成
// $("p").hide(); //隐藏全部p标签
//setInterval(function(){//220毫秒后运行下列程序 循环
setTimeout(function(){//220毫秒后运行下列程序 一次
var url = window.location.href;
if(url.indexOf("tabStatu") >= 0 ) { //判断url地址中是否包含tabStatu字符串
//alert("包含tabStatu字符");
$(".ant-btn.ant-btn-primary").hide();//隐藏原按钮(0~0)
$(".ant-btn.ant-btn-sm").hide();
$(".ant-btn.ant-btn-danger").hide();
var as = document.getElementsByTagName('p');// 获取所有 P标签内容,
var img1 =document.getElementById("images1").getElementsByTagName("img")[0].src //获取正面照
var img2 =document.getElementById("images2").getElementsByTagName("img")[0].src //获取反面照
var img3 =document.getElementById("images3").getElementsByTagName("img")[0].src //获取手持照
////将以下的html代码插入到网页里的第一个P标签中
var down_btn_html = ''; //添加确认和返回按钮
down_btn_html += '
';
down_btn_html += '
';
down_btn_html += '
';
down_btn_html += ''+as[2].innerText+'
'; //添加患者名字
//down_btn_html += ''+as[9].innerText+'
'; //添加审核状态
//down_btn_html += ''+as[10].innerText+'
'; //添加操作人
//down_btn_html += ''+as[11].innerText+'
'; //添加审核时间
down_btn_html += ''+as[12].innerText+'
'; //添加审核理由
down_btn_html += '';//添加适应div ,背景
down_btn_html += '
';
down_btn_html += '
';//添加正面照
down_btn_html += '
';
down_btn_html += '';
down_btn_html += '
';
down_btn_html += '
';
down_btn_html += '
';//添加反面照
down_btn_html += '
';
down_btn_html += '';
down_btn_html += '
';
down_btn_html += '
';
down_btn_html += '
';//添加手持照
down_btn_html += '
';
down_btn_html += '';
down_btn_html += '
';
down_btn_html += '
'; // 背景 style="background-color:#AFEEEE"width:100px;height:50px;
down_btn_html += '
';
down_btn_html += '
';
down_btn_html += '
';
down_btn_html += '
';
down_btn_html += '
';
down_btn_html += '
';
down_btn_html += '
';
$("p:first").before(down_btn_html); //将以上的html代码插入到网页里的第一个P标签中
var imges = document.getElementsByTagName('img');//单击图片即可放大
imges[0].click();
imges[1].click();
imges[2].click();
imges[3].click();
imges[4].click();
imges[5].click();
imges[6].click();
var obj = document.getElementsByClassName("aaaa"); //移动到确认,返回按钮的效果
for(var i = 0; i < obj.length; i ++) {
if (obj[i].type.toLowerCase() == 'button') {
obj[i].onmouseover = function() {
this.style.backgroundColor = '#40A9FF';
this.style.color = '#FFFFFF';
}
obj[i].onmouseout = function() {
this.style.backgroundColor = '#1890FF';
this.style.color = '#FFFFFF';
}
}
}
var obj = document.getElementsByClassName("bbbb");//移动到未通过按钮的效果
for(var i = 0; i < obj.length; i ++) {
if (obj[i].type.toLowerCase() == 'button') {
obj[i].onmouseover = function() {
this.style.backgroundColor = '#FF4D4F';
this.style.color = '#F5F5F5';
}
obj[i].onmouseout = function() {
this.style.backgroundColor = '#F5F5F5';
this.style.color = '#FF4D4F';
}
}
}
$("#re1").click(function(){ //点击按钮id=re1 的功能
var url1 = window.location.href;
$(".ant-btn.ant-btn-primary").trigger("click");
setTimeout(function(){
var btns = document.getElementsByClassName("ant-btn");
if(btns.length<4){
setTimeout(function(){
window.location.href = "https://h5hyt.cd120.com/admin/realname/card/list";//跳转到主页
},500);
}else{
btns[4].style.backgroundColor = '#32CD32';
setTimeout(function(){//1020毫秒后运行下列程序 一次
btns[4].style.backgroundColor = '#1890FF';
btns[4].click();
},200);
setTimeout(function(){
window.location.href = "https://h5hyt.cd120.com/admin/realname/card/list";//跳转到主页 .
aaa=setInterval(ff,500)//重新开始功能2
},520);
}
},420);
});
$("#re2").click(function(){ //点击按钮id=re2 的功能
console.log('返回');
// var btns = document.getElementsByClassName("ant-btn");
// btns[3].click();
var url_home = "https://h5hyt.cd120.com/admin/realname/card/list";//你要跳的链接
window.location.href = url_home;//跳转到主页
});
$("#re3").click(function(){ //点击按钮id=re3 的功能
//aaa=setInterval(f,11000)//重新开始定时器判断
setTimeout(function(){//1020毫秒后运行下列程序 一次
$(".ant-btn.ant-btn-danger").trigger("click");
var editorWin=document.getElementById('failReason').contentWindow;
$("#failReason").focus().trigger("click");
// $("#failReason").select; //选择全部文本
$('#failReason').val('您未上传手持证件照,请您手持身份证合拍照片重新上传或者使用人脸识别的功能进行验证'); //设置value文本为*****
//setTimeout(function(){//1020毫秒后运行下列程序 一次
// $(".ant-btn.ant-btn-primary").click(); //点击确认
// },1020);
function sendkey(keychar){ //模拟按键点击触发textarea监听的oninput事件(不起作用。。。。)
var ev = document.createEvent("KeyboardEvent");//模拟按键点击触发textarea监听的oninput事件(不起作用。。。。)
var keycode = keychar.charCodeAt(); //模拟按键点击触发textarea监听的oninput事件(不起作用。。。。)
ev.initKeyEvent("keydown", true, true, null, 0, 0, 0, 0,keycode,keychar);
document.dispatchEvent(ev); //模拟按键点击触发textarea监听的oninput事件(不起作用。。。。)
}
},220);
});
$("#re4").click(function(){//点击按钮id=re4 的功能
//aaa=setInterval(f,11000)//重新开始定时器判断
setTimeout(function(){//1020毫秒后运行下列程序 一次
$(".ant-btn.ant-btn-danger").trigger("click");
var editorWin=document.getElementById('failReason').contentWindow;
$("#failReason").focus().trigger("click");
$('#failReason').val('您上传的手持证件照未符合要求(请您手持身份证合拍照片),请您重新上传或者使用人脸识别的功能进行验证'); //设置value文本为*****
//setTimeout(function(){//1020毫秒后运行下列程序 一次
// $(".ant-btn.ant-btn-primary").click(); //点击确认
// },1020);
},220);
});
$("#re5").click(function(){//点击按钮id=re5 的功能
// aaa=setInterval(f,100)//重新开始定时器判断
setTimeout(function(){//1020毫秒后运行下列程序 一次
$(".ant-btn.ant-btn-danger").trigger("click");
var editorWin=document.getElementById('failReason');
$("#failReason").focus().trigger("click");
$('#failReason').val('翻拍的身份证,无法判断是否是本人注册,请本人重新用实体身份证拍摄上传。建议使用人脸识别的功能进行验证'); //设置value文本为*****
//setTimeout(function(){//1020毫秒后运行下列程序 一次
// $(".ant-btn.ant-btn-primary").click(); //点击确认
// },1020);
},220);
});
$("#re6").click(function(){//点击按钮id=re6的功能
// aaa=setInterval(f,100)//重新开始定时器判断
setTimeout(function(){//1020毫秒后运行下列程序 一次
$(".ant-btn.ant-btn-danger").click();
$("#failReason").focus().trigger("click");
$('#failReason').val('您上传的证件照的信息不清晰或被遮挡(请保持证件照清晰的展示了全部信息),建议使用人脸识别的功能进行验证'); //设置value文本为*****
//setTimeout(function(){//1020毫秒后运行下列程序 一次
// $(".ant-btn.ant-btn-primary").click(); //点击确认
// },1020);
},220);
});
$("#re7").click(function(){//点击按钮id=re7 的功能
// aaa=setInterval(f,100)//重新开始定时器判断
setTimeout(function(){//1020毫秒后运行下列程序 一次
$(".ant-btn.ant-btn-danger").click();
var editorWin=document.getElementById('failReason').contentWindow;
document.getElementById('failReason').focus()
$('#failReason').val('您注册电子就诊卡的证件号与实名证件信息不匹配(请保持注册证件与实名证件信息统一,无身份证可使用户口簿或出生证),建议人脸识别的功能进行验证'); //设置value文本为*****
//setTimeout(function(){//1020毫秒后运行下列程序 一次
// $(".ant-btn.ant-btn-primary").click(); //点击确认
// },1020);
},220);
});
$("#xxxxxxxxxxx").click(function(){//点击按钮id=xxxxxxxxxxx 的功能
$(".ant-btn.ant-btn-primary").click();
setTimeout(function(){//1020毫秒后运行下列程序 一次
$(".ant-btn.ant-btn-primary").click();
if(url.indexOf("//h5hyt.cd120.com/admin/realname/card/list") <= 0 ){
setTimeout(function(){//1020毫秒后运行下列程序 一次
window.location.href = "https://h5hyt.cd120.com/admin/realname/card/list"
},1020);
}
},220);
});
$("#xxxxxxxxxxx").click(function(){//点击按钮id=xxxxxxxxxxx 的功能
$("p").remove(); //全局判断按钮被点击
});
//Action for checked
$(document).keydown(function(event){
if (event.keyCode == 103){
var btns = document.getElementsByClassName("ant-btn");
btns[4].style.backgroundColor = '#40A9FF';
btns[4].style.opacity="0.3";
$(".ant-table-tbody tr:first td:last a:first").click();
}
else if(event.keyCode == 97){
document.getElementById("re3").style.backgroundColor = '#FF4D4F';
document.getElementById("re3").style.opacity="0.3";
setTimeout(function(){//1020毫秒后运行下列程序 一次
document.getElementById("re3").style.backgroundColor = '#F5F5F5';
document.getElementById("re3").style.opacity="1";
},100);
$("#re3").click();
}else if (event.keyCode == 98){
document.getElementById("re4").style.backgroundColor = '#FF4D4F';
document.getElementById("re4").style.opacity="0.3";
setTimeout(function(){//1020毫秒后运行下列程序 一次
document.getElementById("re4").style.backgroundColor = '#F5F5F5';
document.getElementById("re4").style.opacity="1";
},100);
$("#re4").click();
}
else if (event.keyCode == 99){
document.getElementById("re5").style.backgroundColor = '#FF4D4F';
document.getElementById("re5").style.opacity="0.3";
setTimeout(function(){//1020毫秒后运行下列程序 一次
document.getElementById("re5").style.backgroundColor = '#F5F5F5';
document.getElementById("re5").style.opacity="1";
},100);
$("#re5").click();
}
else if (event.keyCode == 100){
document.getElementById("re6").style.backgroundColor = '#FF4D4F';
document.getElementById("re6").style.opacity="0.3";
setTimeout(function(){//1020毫秒后运行下列程序 一次
document.getElementById("re6").style.backgroundColor = '#F5F5F5';
document.getElementById("re6").style.opacity="1";
},100);
$("#re6").click();
}
else if (event.keyCode == 101){
document.getElementById("re7").style.backgroundColor = '#FF4D4F';
document.getElementById("re7").style.opacity="0.3";
setTimeout(function(){//1020毫秒后运行下列程序 一次
document.getElementById("re7").style.backgroundColor = '#F5F5F5';
document.getElementById("re7").style.opacity="1";
},100);
$("#re7").click();
}
else if (event.keyCode == 37){ //按左← 键返回
document.getElementById("re2").style.backgroundColor = '#40A9FF';
document.getElementById("re2").style.opacity="0.3";
setTimeout(function(){//1020毫秒后运行下列程序 一次
document.getElementById("re2").style.backgroundColor = '#1890FF';
document.getElementById("re2").style.opacity="1";
},100);
$("#re2").click();
}
else if (event.keyCode == 107){
var url1 = window.location.href; //按右→键调往下一个ID
var sec = url1.split("?")[1].split("&")[0].split("=")[1];
var num = Number(sec)
var num2 = num + 1
var url_Id = "https://h5hyt.cd120.com/admin/realname/card/detail?id="+num2;//你要跳的链接加id
var url_Id2 = url_Id+"&status=1&realnameType=MC&tabStatus=1" //你要跳的链接加id+1
window.location.href = url_Id2;//跳转
}
else if (event.keyCode == 96){ //按0确认
document.getElementById("re1").style.backgroundColor = '#40A9FF';
document.getElementById("re1").style.opacity="0.3";
setTimeout(function(){//1020毫秒后运行下列程序 一次
document.getElementById("re1").style.backgroundColor = '#1890FF';
document.getElementById("re1").style.opacity="1";
},100);
$("#re1").click();
}
else if (event.keyCode == 13){ //按回车确认
setTimeout(function(){
var btns = document.getElementsByClassName("ant-btn");
if(btns.length<4){
setTimeout(function(){
$(".ant-btn.ant-btn-primary").click();
},100);
}else{
btns[4].style.backgroundColor = '#00FFFF';
setTimeout(function(){//1020毫秒后运行下列程序 一次
btns[4].style.backgroundColor = '#1890FF';
btns[4].click();
},200);
setTimeout(function(){
//btns[4].click(); // 延时点击确认,防止点错(已取消)
},420);
}
},100);
}
});
}
},220);
}