合工大研究生教学管理信息系统-研究生培养计划-打印功能补丁

针对合工大研究生教学管理信息系统中点击打印按钮没有反应的问题,在菜单树左边添加了新的打印按钮,可以直接打印出培养计划书。

// ==UserScript==
// @name        合工大研究生教学管理信息系统-研究生培养计划-打印功能补丁
// @namespace   Violentmonkey Scripts
// @match       *://yjsjw.hfut.edu.cn/student/*
// @grant       none
// @require     http://libs.baidu.com/jquery/2.0.0/jquery.min.js
// @require     https://cdn.bootcdn.net/ajax/libs/jQuery.print/1.5.1/jQuery.print.js
// @require     https://cdn.bootcdn.net/ajax/libs/PrintArea/2.4.1/jquery.PrintArea.js
// @version     0.1
// @author      longskyer
// @run-at      document-end
// @description 针对合工大研究生教学管理信息系统中点击打印按钮没有反应的问题,在菜单树左边添加了新的打印按钮,可以直接打印出培养计划书。
// ==/UserScript==
(function(){

  $("frame[name='leftFrame']").attr("id", "leftFrame"); 
  $("frame[name='mainFrame']").attr("id", "mainFrame"); 
  var tmp=window.top.frames['leftFrame'].document.getElementById("newPrint");
  if( tmp==null){
     $("body",window.top.frames['leftFrame'].document).append('<input id="newPrint" type="button" value="新打印">');
  }
  
  $("#newPrint",window.top.frames['leftFrame'].document).on("click",function () { 
      console.log("新打印按钮被点击了!");
      $("div:first",window.top.frames['mainFrame'].document).attr("id","toPrint");
      $(".PageNext",window.top.frames['mainFrame'].document).css("page-break-after","always");
      $(".td01:first",window.top.frames['mainFrame'].document).css("height","105");
      $(".td01",window.top.frames['mainFrame'].document).css("padding","1px 11px 1px 11px");
      $("td[colspan='4']",window.top.frames['mainFrame'].document).attr("valign","top");
      $("div[style='width:100%; height: 90; FONT-SIZE: 10.5pt;']",window.top.frames['mainFrame'].document).css("height","91");
      $("span[style='FONT-SIZE: 12pt;'] span[style='width:150']",window.top.frames['mainFrame'].document).css("padding-right","80");
      $("table",window.top.frames['mainFrame'].document).eq(3).next().remove();
      $("#toPrint",window.top.frames['mainFrame'].document).print();
      //$("#toPrint",window.top.frames['mainFrame'].document).css("text-align","center");
      //$("#toPrint",window.top.frames['mainFrame'].document).css("vertical-align","center");
      //$("body",window.top.frames['mainFrame'].document).css("align","center");
      //$("#toPrint",window.top.frames['mainFrame'].document).printArea({debug: false, globalStyles: true,importCSS: true, printContainer: true, operaSupport: true});
  });
  
})();

QingJ © 2025

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