rpt_tpl_cfg_helper.js 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /**
  2. * Created by Tony on 2017/12/8.
  3. */
  4. let rpt_tpl_cfg_helper = {
  5. reportCfg: null,
  6. getReportTplCfg: function() {
  7. let me = this, params = {};
  8. params.userId = userID;
  9. CommonAjax.postEx("report_tpl_api/getUserRptCfg", params, 20000, true, function(result){
  10. me.reportCfg = result;
  11. me.refreshRptCfgs();
  12. }, null, null
  13. );
  14. },
  15. refreshRptCfgs: function () {
  16. let me = this;
  17. if (me.reportCfg) {
  18. me.reportCfg.borderArr = [];
  19. for (let style of me.reportCfg.styles) {
  20. me.reportCfg.borderArr.push(style.ID);
  21. $("#borderStyles").append("<option value='" + style.ID + "'>" + style.CfgDispName + "</option>");
  22. $("#elementBorders").append("<option value='" + style.ID + "'>" + style.CfgDispName + "</option>");
  23. }
  24. me.reportCfg.fontArr = [];
  25. for (let font of me.reportCfg.fonts) {
  26. if (font.CfgDispName) {
  27. me.reportCfg.fontArr.push(font.ID);
  28. $("#elementFonts").append("<option value='" + font.ID + "'>" + font.CfgDispName + "</option>");
  29. } else {
  30. me.reportCfg.fontArr.push("dummy font");
  31. }
  32. }
  33. me.reportCfg.controlArr = [];
  34. for (let control of me.reportCfg.ctrls) {
  35. if (control.CfgDispName) {
  36. me.reportCfg.controlArr.push(control.ID);
  37. $("#elementControls").append("<option value='" + control.ID + "'>" + control.CfgDispName + "</option>");
  38. } else {
  39. me.reportCfg.controlArr.push("dummy control");
  40. }
  41. }
  42. }
  43. //elementFonts
  44. let pf = $("#pageFrequency");
  45. pf.append("<option value='" + JV.PAGE_STATUS[0] + "'>每页</option>");
  46. pf.append("<option value='" + JV.PAGE_STATUS[1] + "'>首页</option>");
  47. pf.append("<option value='" + JV.PAGE_STATUS[2] + "'>尾页</option>");
  48. pf.append("<option value='" + JV.PAGE_STATUS[3] + "'>章首页</option>");
  49. pf.append("<option value='" + JV.PAGE_STATUS[4] + "'>章尾页</option>");
  50. pf.append("<option value='" + JV.PAGE_STATUS[5] + "'>分组</option>");
  51. pf.append("<option value='" + JV.PAGE_STATUS[6] + "'>交叉行尾页</option>");
  52. pf.append("<option value='" + JV.PAGE_STATUS[7] + "'>交叉列尾页</option>");
  53. let ba = $("#bandAlignment");
  54. ba.append("<option value='" + JV.LAYOUT[0] + "'>上</option>");
  55. ba.append("<option value='" + JV.LAYOUT[1] + "'>下</option>");
  56. ba.append("<option value='" + JV.LAYOUT[2] + "'>左</option>");
  57. ba.append("<option value='" + JV.LAYOUT[3] + "'>右</option>");
  58. ba.append("<option value='" + JV.LAYOUT[4] + "'>填充</option>");
  59. },
  60. checkAndSetSelectedNodeCfg: function (treeNode) {
  61. if (treeNode[JV.PROP_AREA]) {
  62. $("#element_font")[0].style.display = "";
  63. $("#element_border")[0].style.display = "";
  64. $("#element_control")[0].style.display = "";
  65. } else {
  66. $("#element_font")[0].style.display = "none";
  67. $("#element_border")[0].style.display = "none";
  68. $("#element_control")[0].style.display = "none";
  69. }
  70. },
  71. fontChange: function(dom) {
  72. //
  73. },
  74. borderChange: function(dom) {
  75. //
  76. },
  77. controlChange: function(dom) {
  78. //
  79. },
  80. changeAlignment: function(dom, type) {
  81. if (type === "horizon") {
  82. //
  83. } else {
  84. //vertical
  85. }
  86. }
  87. };