长河审批 ID 转换

try to take over the world!

目前為 2021-03-30 提交的版本,檢視 最新版本

// ==UserScript==
// @name         长河审批 ID 转换
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  try to take over the world!
// @author       fangxianli
// @match        https://ch.sankuai.com/approval-batch/index.html
// @grant        none
// ==/UserScript==

(function() {
   'use strict';
   const input = document.querySelector('.el-input__inner')
   const buttons = document.querySelectorAll('.el-button')
   let queryButton
   for (let i = 0; i < buttons.length; i++) {
       if (buttons[i].innerText === '查询') {
           queryButton = buttons[i]
       }
   }
   input.addEventListener('paste', function (e) {
       window.clipboardData = e.clipboardData
       const updateValue = e.clipboardData.getData('text/plain')
       this.value = updateValue.replace(/[^\d,]/g, ',').split(',').filter(val => val && val.length === 6).join(',')
       const inputEvent = new InputEvent('input')
       this.dispatchEvent(inputEvent)
       this.select()
       document.execCommand('copy')
       queryButton.click()
   })
})();

QingJ © 2025

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