• 利用 油猴脚本 每日填日志


    需求

    每天填写日志要点好几下,比较麻烦,写个脚本自动点下

    代码

    • 我现在用的浏览器 双核浏览器

    • 浏览器 安装 油猴脚本 tampermonkey

    • http://extb.cqttech.com/search/tampermonkey

    • 点击 tampermonkey

    • 控制面板

    • 创建两个脚本(因为有一个页面跳转)

    • 脚本1 重点是 @match

    // ==UserScript==
    // @name         EveryLog
    // @namespace    http://tampermonkey.net/
    // @version      0.1
    // @description  try to take over the world!
    // @author       You
    // @match        http://192.168.71.7:8080/TFKJ/
    // @icon         https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
    // @grant        none
    // ==/UserScript==
    
    (function() {
        'use strict';
    
        // Your code here...
        $("#userName").val('name')
    $("#password").val('123456')
    doSubmit()
    // window.location.assign("./implementTemporary.do?act=init")
    
    })();
    
    • 脚本2
    // ==UserScript==
    // @name         EveryLog2
    // @namespace    http://tampermonkey.net/
    // @version      0.1
    // @description  try to take over the world!
    // @author       You
    // @match        http://192.168.71.7:8080/TFKJ/implementTemporary.do?act=init
    // @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
    // @grant        none
    // ==/UserScript==
    
    (function() {
        'use strict';
    
        // Your code here...
    
         $("#add").click()
     $("#add_child").click()
    $("#taskProjectIds").val(435)
    $("#useTimeList>input").click()
    const a = window.frames["__calendarIframe"].document
    a.getElementById('selectTodayButton').click()
    $('#workTypeIds').val('71')
    $('#selectTodayButton').click()
    $('#normalTimes').val('8')
    $('#overTimes').val('0')
    })();
    
    • 脚本3
    // ==UserScript==
    // @name         EveryLogOpenWindow
    // @namespace    http://tampermonkey.net/
    // @version      0.1
    // @description  try to take over the world!
    // @author       You
    // @match        http://192.168.71.7:8080/TFKJ/main.do?act=init*
    // @icon         https://www.google.com/s2/favicons?sz=64&domain=gitee.io
    // @grant        none
    // ==/UserScript==
    
    (function() {
        'use strict';
    
        // Your code here...
        window.frames["content"].location = 'implementTemporary.do?act=init'
    
    })();
    
  • 相关阅读:
    Web Designer Intern
    Internship UI/UX Web Designer
    HTML / CSS Frontend Software Engineer Internship
    CSS 07 文本
    CSS 06 背景
    CSS 05 尺寸大小
    CSS 04 注释
    CSS 03 选择器
    Why Ancient Greeks are Always Nude
    C#表示空字符
  • 原文地址:https://www.cnblogs.com/pengchenggang/p/16692170.html
Copyright © 2020-2023  润新知