暂无描述

index.js 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ;
  2. spa_define(function(){
  3. return $.use(["spa","pagedatagrid","util"],function(spa,pdgf,util){
  4. return{
  5. main: function() {
  6. var root = spa.findInMain(".sys_professor_index");
  7. var pdg = pdgf.build(root);
  8. pdg.code.shell("showDay", function(env) {
  9. if(env.cd && env.cd[this.k]) {
  10. var day = env.cd[this.k];
  11. return day.substring(0, 4) + "年" + day.substring(4, 6) + "月" + day.substring(6, 8) + "日";
  12. }
  13. return "";
  14. });
  15. pdg.code.listen($.dict.doTransfer);
  16. root.find(".opt-query").on("click", function() {
  17. pdg.load();
  18. });
  19. pdg.load();
  20. root.find(".opt-new").on("click", function() {
  21. spa.showModal("sys_professor_new", function() { pdg.load() });
  22. });
  23. root.find(".dt-tpl").on("click", "th.opt-check>i.icon-st-check", function() {
  24. var $this = $(this);
  25. $this.toggleClass("checked");
  26. if($this.hasClass("checked")) {
  27. root.find(".dt-tpl td.opt-check>i.icon-st-check").addClass("checked");
  28. } else {
  29. root.find(".dt-tpl td.opt-check>i.icon-st-check").removeClass("checked");
  30. }
  31. });
  32. root.find(".dt-tpl").on("click", "td.opt-check>i.icon-st-check", function() {
  33. var $this = $(this);
  34. $this.toggleClass("checked");
  35. });
  36. root.find(".opt-edit").on("click", function() {
  37. var $org = root.find("td.opt-check>i.checked");
  38. if($org.length) {
  39. if($org.length > 1) {
  40. util.alertMsg("只能选择一个机构");
  41. } else {
  42. window.open('http://www.ekexiu.com/information-console.html?professorId=' + $org.attr("id"));
  43. }
  44. } else {
  45. util.alert("请选择一个机构");
  46. }
  47. });
  48. root.on("click", ".opt-auth", function () {
  49. var id = $(this).parent().attr("pId");
  50. window.open('http://www.ekexiu.com/information-console.html?professorId=' + id);
  51. });
  52. root.on("click",".table-opt a.name", function () {
  53. var professorId = $(this).parent().attr("professorId");
  54. window.open('http://www.ekexiu.com/information-brow.html?professorId=' + professorId);
  55. });
  56. },mainDestory: function() {
  57. },
  58. };
  59. });
  60. });