// ==UserScript== // @name 保存列表设置 // @namespace http://tampermonkey.net/ // @version 0.4 // @description try to take over the world! // @author You // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // @match http://*.zhbg.kjt.gx.gov/* // @run-at context-menu // ==/UserScript== (function() { 'use strict'; // Your code here... //设置列表宽度 let columnsheader = document.querySelector("#pane-hbhq_1 > div > div > div.el-table__header-wrapper > table").__vue__.columns; let columnsbody = document.querySelector("#pane-hbhq_1 > div > div > div.el-table__body-wrapper > table").__vue__.columns; for (let index = 0; index < 9; index++) { localStorage.setItem("table_column_header" + (index + 1), columnsheader[index].realWidth); localStorage.setItem("table_column_body" + (index + 1), columnsbody[index].realWidth); } })();