东莞理工大学生毕业论文管理系统自动批量审阅脚本::co2.cnki.net

东莞理工大学生毕业论文管理系统

目前為 2023-11-29 提交的版本,檢視 最新版本

// ==UserScript==
// @name         东莞理工大学生毕业论文管理系统自动批量审阅脚本::co2.cnki.net
// @namespace    https://gf.qytechs.cn/
// @version      0.1018
// @description  东莞理工大学生毕业论文管理系统
// @author       CosilC; Lynn
// @match        https://co2.cnki.net/*
// @icon         https://co2.cnki.net/favicon.ico
// @grant        none
// @license      GPLv3
// ==/UserScript==

function authTogether(){
    var nodeList = document.querySelectorAll("[href*=`审核`]");
    var node;
    for (var i = 0; i < nodeList.length; i++) {
        nodeList[i].click();
        wait(3000);
        node = document.getElementById("rdoPass0");
        node.click();
        node = document.getElementById("_easyui_textbox_input6");
        node.value = "无";
        node = document.getElementById("btnSubmit0");
        node.click();
        wait(10000);
    }
}
     

function main() {
    var nodeList = getNodeListByText("审核学生申报的题目");
    if (nodeList != null)
    {
        nodeList[length-1].innerText = "核审学生申报的题目";

        var button  = document.createElement("button");
        //button.setAttribute('onclick', "authTogether()");
        button.addEventListener('click', authTogether)
        button.innerText = "开始自动审核"
        nodeList[length-2].appendChild(button);
    }
}


function getNodeByText(text, cssSelector = '*', allEqual = true) {
    let targetNodeList = [];
    return (targetNodeList = getNodeListByText(text, cssSelector, allEqual)) ? targetNodeList[0] : null;
}

/**
 * 获取给定文本和选择器对应的节点列表
 * 
 * @param {string} text 目标文本
 * @param {string} cssSelector css选择器
 * @param {boolean} allEqual 全等
 * @return {array(domNode)} 文本和选择器对应的节点列表 没有时返回null
 */
function getNodeListByText(text, cssSelector = '*', allEqual = true) {
    let targetNodeList = [];
    return (targetNodeList = Array.from(document.querySelectorAll(cssSelector)).filter(v => allEqual ? v.innerText == text : v.innerText.includes(text))).length > 0 ? targetNodeList : null;
}

console.log('script loaded');

var wait = (ms) => {
    const start = Date.now();
    let now = start;
    while (now - start < ms) {
      now = Date.now();
    }
}

let hrefChangeWatcher = setInterval(() => {
    main();
}, 100);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址