长河审批 ID 转换

try to take over the world!

目前为 2021-03-20 提交的版本。查看 最新版本

// ==UserScript==
// @name         长河审批 ID 转换
// @namespace    http://tampermonkey.net/
// @version      0.2
// @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')
    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')
    })
})();

QingJ © 2025

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