Geen omschrijving

index.js 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * Created by TT on 2017/8/28.
  3. */
  4. ;
  5. spa_define(function () {
  6. return $.use(["spa", "pagedatagrid", "util"], function (spa, pdgf, util) {
  7. return {
  8. main: function () {
  9. var root = spa.findInMain(".sys_disbanner_index");
  10. var pdg = pdgf.build(root);
  11. pdg.code.shell("showDay", function (env) {
  12. if (env.cd && env.cd[this.k]) {
  13. var day = env.cd[this.k];
  14. return day.substring(0, 4) + "年" + day.substring(4, 6) + "月" + day.substring(6, 8) + "日 " + day.substring(8, 10) + ":" + day.substring(10, 12);
  15. }
  16. return "";
  17. });
  18. pdg.code.listen($.dict.doTransfer);
  19. root.find(".opt-query").on("click", function () {
  20. pdg.load();
  21. });
  22. pdg.load();
  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-insert").on("click", function() {
  37. spa.showModal("sys_disbanner_insert", function () {
  38. pdg.reload()
  39. });
  40. });
  41. root.find(".opt-putup").on("click", function () {
  42. spa.showModal("sys_disbanner_putup", function () {
  43. pdg.reload()
  44. });
  45. });
  46. // root.find(".opt-putup2").on("click", function () {
  47. // spa.showModal("sys_disbanner_putup2", function () {
  48. // pdg.load()
  49. // });
  50. // });
  51. }, mainDestory: function () {
  52. }
  53. };
  54. });
  55. });