您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
提供一些网页小工具,低代码开发专用
当前为
// ==UserScript== // @name lcap_tools // @namespace http://tampermonkey.net/ // @version 0.0.7 // @description 提供一些网页小工具,低代码开发专用 // @author 袁龙辉 // @match https://lcap.test.zte.com.cn/* // @match https://lcap.dev.zte.com.cn/* // @match https://lcap.uat.zte.com.cn/* // @match https://lcapst.test.zte.com.cn/* // @match https://lcappro.uat.zte.com.cn/* // @match https://lcappro.test.zte.com.cn/* // @match https://lcappro.dev.zte.com.cn/* // @match https://uactest.zte.com.cn/* // @match https://test55.ucs.zte.com.cn/* // @match http://local.zte.com.cn/* // @match https://local.zte.com.cn/* // @match http://127.0.0.1/* // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAbCAYAAACJISRoAAAABHNCSVQICAgIfAhkiAAAAQtJREFUSInt1c1Kw0AUhuFTF8kFTJnAFFwKYrHQUjE0Fq2iOxG8Bn/vQ8SbEMX+oLhQ9+raXom9g0lI8roQBDdmFi0q5FsOfOdZDIdTAZAZZ27WQImUyC8ju3v7Ug1q0tva+fZ+dn4h1aAmYacreZ7/PISCPL+8orRBacPbeAyAtZaFxTpKG27v7otGUIgAbGxuo7Th4OgEgMFwhNKGVjskTdPpIA+PTyhtCMw875MJ671PtD8YudTdkCzLWFmNUNpweHyK0oZGs02SJNNDAG76w6+/UdpweXXtWnVH4jim3mihtGFpuYm11hlx3hPP86S7FomISNQJxfd91+ofWcZ/g1SgPL8lUiIF+QCIeCJE+P0wYgAAAABJRU5ErkJggg== // @grant GM_cookie // @grant GM_addStyle // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @grant GM_listValues // ==/UserScript== (function () { 'use strict'; GM_addStyle( `.y-panel { width: 150px; display: flex; flex-direction: column; position: fixed; top: 32px; right: -150px; background-color: #07f; border-radius: 3px; transition: all 0.3s; opacity: 1; z-index: 9999999999; } .y-panel:before { width: 32px; height: 32px; position: absolute; top: calc(50% - 16px); left: -16px; background-color: #07f; border-radius: 32px; content: \"\"; opacity: 0.5; cursor: pointer; } .y-panel:hover { right: 0; } .y-panel > .y-panel-btn { position: relative; border: 1px solid #fff; border-radius: 3px; color: #fff !important; cursor: pointer; font-size: 12px !important; margin: 5px; padding: 5px 4px; text-align: center; user-select: none; background-color: #07f; z-index: 9999999999; } .y-panel-input { margin: 5px 4px; } ::-webkit-input-placeholder { color: rgba(0, 0, 0, 0.5); font-size: 14px; } .y-panel-btn_delete { padding: 0px 4px; color: #000; position: absolute; right: 3px; top: 3px; background-color: #88befc; } .y-panel-btn_delete:hover { color: #fff; background-color: red; }` ); const stored_name_map = GM_listValues().map(item => GM_getValue(item)) // 可以在这里配置常用工号,例如: //const name_map = ['10331290', '10239986'] const name_map = [] const register = (btns) => { const yPanel = document.querySelector('.y-panel') if (yPanel) { yPanel.parentNode.removeChild(yPanel) } const container = document.createElement("div"); container.className = "y-panel"; document.body.appendChild(container); btns.forEach(btn => { const button = document.createElement("button"); button.textContent = btn.text; button.className = "y-panel-btn"; button.onclick = btn.onclick; container.appendChild(button); if (btn.isStored) { const delete_btn = document.createElement("button"); delete_btn.textContent = 'x'; delete_btn.className = 'y-panel-btn_delete'; delete_btn.onclick = (e) => { e.stopPropagation() GM_deleteValue(btn.text) refreshPanel() }; button.appendChild(delete_btn); } if (btn.id) { button.id = btn.id } }); const name_input = document.createElement("input"); name_input.className = 'y-panel-input' name_input.placeholder = '新增工号, Enter' container.appendChild(name_input); name_input.addEventListener('keydown', (event) => { if (event.key === 'Enter') { GM_setValue(name_input.value, name_input.value) login(name_input.value) refreshPanel() } }); }; function clearCookies() { const cookies = document.cookie.split(';').map(cookie => cookie.trim().split('=')[0]); cookies.forEach(item => { GM_cookie.delete({ name: item }); }) location.reload(); } function login(name) { const nameInput = document.getElementById('input-loginname') if (!nameInput) return const passwordInput = document.getElementById('input-password') const login_btn = document.getElementsByClassName("el-button login-btn el-button--primary")[0] var event = new Event('input', { bubbles: true, cancelable: true, }); nameInput.value = name nameInput.dispatchEvent(event); passwordInput.value = '1' passwordInput.dispatchEvent(event); login_btn.click() } function changeLang() { const cookies = document.cookie.split(';').map(cookie => cookie.trim()); cookies.forEach(cookie => { const [name, value] = cookie.trim().split('=') if (name.includes('Language')) { GM_cookie.delete({ name }); GM.cookie.set({ name, value: value === 'zh_CN' ? 'en_US' : 'zh_CN' }) } }) location.reload(); } function getNameMap(stored_name_map) { return [ { text: '清空Cookie并刷新', onclick: () => clearCookies() }, { text: '切换cookie的语言', onclick: () => changeLang() }, ...name_map.map(name => { return { text: name, onclick: () => login(name) } }), ...stored_name_map.map(name => { return { text: name, isStored: true, onclick: () => login(name) } }) ] } function refreshPanel() { const current_stored_name_map = GM_listValues().map(item => GM_getValue(item)) const new_name_map = getNameMap(current_stored_name_map) register(new_name_map) } (function init() { const initial_name_map = getNameMap(stored_name_map) register(initial_name_map) })() })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址