rpt_tpl_cfg_helper.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  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. $("#visElementFonts").append("<option value='" + font.ID + "'>" + font.CfgDispName + "</option>");
  30. } else {
  31. // me.reportCfg.fontArr.push("dummy font");
  32. }
  33. }
  34. me.reportCfg.fontArr.push('自定义');
  35. $("#elementFonts").append("<option value='自定义'>自定义</option>");
  36. $("#visElementFonts").append("<option value='自定义'>自定义</option>");
  37. me.reportCfg.controlArr = [];
  38. for (let control of me.reportCfg.ctrls) {
  39. if (control.CfgDispName) {
  40. me.reportCfg.controlArr.push(control.ID);
  41. $("#elementControls").append("<option value='" + control.ID + "'>" + control.CfgDispName + "</option>");
  42. } else {
  43. me.reportCfg.controlArr.push("dummy control");
  44. }
  45. }
  46. }
  47. let pf = $("#pageFrequency");
  48. pf.append("<option value='" + JV.PAGE_STATUS[0] + "'>每页</option>");
  49. pf.append("<option value='" + JV.PAGE_STATUS[1] + "'>首页</option>");
  50. pf.append("<option value='" + JV.PAGE_STATUS[2] + "'>尾页</option>");
  51. pf.append("<option value='" + JV.PAGE_STATUS[3] + "'>章首页</option>");
  52. pf.append("<option value='" + JV.PAGE_STATUS[4] + "'>章尾页</option>");
  53. pf.append("<option value='" + JV.PAGE_STATUS[5] + "'>分组</option>");
  54. pf.append("<option value='" + JV.PAGE_STATUS[6] + "'>交叉行尾页</option>");
  55. pf.append("<option value='" + JV.PAGE_STATUS[7] + "'>交叉列尾页</option>");
  56. let ba = $("#bandAlignment");
  57. ba.append("<option value='" + JV.LAYOUT[0] + "'>上</option>");
  58. ba.append("<option value='" + JV.LAYOUT[1] + "'>下</option>");
  59. ba.append("<option value='" + JV.LAYOUT[2] + "'>左</option>");
  60. ba.append("<option value='" + JV.LAYOUT[3] + "'>右</option>");
  61. ba.append("<option value='" + JV.LAYOUT[4] + "'>填充</option>");
  62. let ha = $("#elementAlignmentHorizon");
  63. ha.append("<option value='" + JV.OUTPUT_ALIGN.H[0] + "'>左</option>");
  64. ha.append("<option value='" + JV.OUTPUT_ALIGN.H[1] + "'>中</option>");
  65. ha.append("<option value='" + JV.OUTPUT_ALIGN.H[2] + "'>右</option>");
  66. let va = $("#elementAlignmentVertical");
  67. va.append("<option value='" + JV.OUTPUT_ALIGN.V[0] + "'>上</option>");
  68. va.append("<option value='" + JV.OUTPUT_ALIGN.V[1] + "'>中</option>");
  69. va.append("<option value='" + JV.OUTPUT_ALIGN.V[2] + "'>下</option>");
  70. },
  71. checkAndSetSelectedNodeCfg: function (treeNode) {
  72. let me = rpt_tpl_cfg_helper;
  73. if (treeNode[JV.PROP_AREA]) {
  74. $("#element_hidden")[0].style.display = "";
  75. $("#element_font")[0].style.display = "";
  76. $("#element_border")[0].style.display = "";
  77. $("#element_control")[0].style.display = "";
  78. $("#element_area_1")[0].style.display = "";
  79. $("#element_visual_div1")[0].style.display = "none";
  80. $("#element_visual_div2")[0].style.display = "none";
  81. $("#element_visual_div3")[0].style.display = "none";
  82. // $("#element_area_2")[0].style.display = "";
  83. if (treeNode[JV.PROP_FIELD_ID] || treeNode[JV.PROP_PARAM_ID]) {
  84. $("#element_pre_suff")[0].style.display = "";
  85. if (treeNode[JV.PROP_PREFIX]) {
  86. $("#elePrefix").get(0).value = treeNode[JV.PROP_PREFIX];
  87. } else {
  88. $("#elePrefix").get(0).value = "";
  89. }
  90. if (treeNode[JV.PROP_SUFFIX]) {
  91. $("#eleSuffix").get(0).value = treeNode[JV.PROP_SUFFIX];
  92. } else {
  93. $("#eleSuffix").get(0).value = "";
  94. }
  95. if (treeNode[JV.PROP_FORMAT]) {
  96. $("#eleFormat").get(0).value = treeNode[JV.PROP_FORMAT];
  97. } else {
  98. $("#eleFormat").get(0).value = "";
  99. }
  100. if (treeNode[JV.PROP_DFT_VALUE]) {
  101. $("#eleDftValue").get(0).value = treeNode[JV.PROP_DFT_VALUE];
  102. } else {
  103. $("#eleDftValue").get(0).value = "";
  104. }
  105. } else {
  106. $("#element_pre_suff")[0].style.display = "none";
  107. $("#element_hidden")[0].style.display = "none";
  108. }
  109. //setup auto height
  110. if (treeNode[JV.PROP_IS_AUTO_HEIGHT]) {
  111. $("#eleAutoHeight").get(0).checked = true;
  112. } else {
  113. $("#eleAutoHeight").get(0).checked = false;
  114. }
  115. //setup hidden
  116. if (treeNode[JV.PROP_HIDDEN]) {
  117. $("#eleFieldHidden").get(0).checked = true;
  118. } else {
  119. $("#eleFieldHidden").get(0).checked = false;
  120. }
  121. //setup cross-row serial
  122. if (treeNode[JV.PROP_IS_SERIAL]) {
  123. $("#eleFieldSerial").get(0).checked = true;
  124. } else {
  125. $("#eleFieldSerial").get(0).checked = false;
  126. }
  127. if (treeNode[JV.TAB_FIELD_PROP_SORT] !== null && treeNode[JV.TAB_FIELD_PROP_SORT] !== undefined) {
  128. if (treeNode[JV.TAB_FIELD_PROP_SORT] === JV.TAB_FIELD_PROP_SORT_VAL_ASC) {
  129. $("#elementSortType").get(0).selectedIndex = 1;
  130. } else if (treeNode[JV.TAB_FIELD_PROP_SORT] === JV.TAB_FIELD_PROP_SORT_VAL_DESC) {
  131. $("#elementSortType").get(0).selectedIndex = 2;
  132. } else {
  133. $("#elementSortType").get(0).selectedIndex = 0;
  134. }
  135. } else {
  136. $("#elementSortType").get(0).selectedIndex = 0;
  137. }
  138. //setup font
  139. let fontDom = $("#elementFonts").get(0);
  140. fontDom.removeAttribute("disabled");
  141. let fontAttr = treeNode[JV.PROP_FONT];
  142. if (typeof treeNode[JV.PROP_FONT] !== "string") {
  143. fontAttr = "自定义";
  144. }
  145. let idx = me.reportCfg.fontArr.indexOf(fontAttr);
  146. fontDom.selectedIndex = idx;
  147. me.fontChange(fontDom);
  148. //setup border
  149. let borderDom = $("#elementBorders").get(0);
  150. let borderAttr = treeNode[JV.PROP_STYLE];
  151. idx = me.reportCfg.borderArr.indexOf(borderAttr);
  152. borderDom.selectedIndex = idx;
  153. me.borderChange(borderDom);
  154. //setup control
  155. let ctrlDom = $("#elementControls").get(0);
  156. let ctrlAttr = treeNode[JV.PROP_CONTROL];
  157. idx = me.reportCfg.controlArr.indexOf(ctrlAttr);
  158. ctrlDom.selectedIndex = idx;
  159. me.controlChange(ctrlDom);
  160. //setup area
  161. me.private_setup_area(treeNode);
  162. } else {
  163. $("#elementFonts").get(0).disabled = "disabled" ;
  164. $("#element_hidden")[0].style.display = "none";
  165. $("#element_font")[0].style.display = "none";
  166. $("#element_border")[0].style.display = "none";
  167. $("#element_control")[0].style.display = "none";
  168. $("#element_area_1")[0].style.display = "none";
  169. // $("#element_area_2")[0].style.display = "none";
  170. $("#element_pre_suff")[0].style.display = "none";
  171. if (treeNode[JV.PROP_NAME] === JV.NODE_FLOW_COLUMN || treeNode[JV.PROP_NAME] === JV.NODE_FLOW_CONTENT) {
  172. //一些可视化操作
  173. $("#element_visual_div1")[0].style.display = "";
  174. $("#element_visual_div2")[0].style.display = "none";
  175. $("#element_visual_div3")[0].style.display = "none";
  176. let columnParentNode = null;
  177. let contentParentNode = null;
  178. if (treeNode[JV.PROP_NAME] === JV.NODE_FLOW_CONTENT) {
  179. contentParentNode = treeNode;
  180. columnParentNode = treeNode.getPreNode();
  181. } else {
  182. columnParentNode = treeNode;
  183. contentParentNode = treeNode.getNextNode();
  184. }
  185. let rptTpl = (zTreeOprObj.currentNode)?zTreeOprObj.currentNode.rptTpl:null;
  186. fieldLocationOprObj.iniSpreadJs(columnParentNode, contentParentNode);
  187. fieldLocationOprObj.setupColumn(rptTpl, columnParentNode, contentParentNode);
  188. } else if (treeNode[JV.PROP_NAME].indexOf("统计信息") > 0) {
  189. $("#element_visual_div1")[0].style.display = "none";
  190. $("#element_visual_div2")[0].style.display = "";
  191. $("#element_visual_div3")[0].style.display = "none";
  192. let rptTpl = (zTreeOprObj.currentNode)?zTreeOprObj.currentNode.rptTpl:null;
  193. virtualSummaryOprObj.iniSpreadJs(treeNode);
  194. virtualSummaryOprObj.setupSummary(rptTpl, treeNode);
  195. } else if (treeNode[JV.PROP_NAME] === `子项`) {
  196. $("#element_visual_div1")[0].style.display = "none";
  197. $("#element_visual_div2")[0].style.display = "none";
  198. $("#element_visual_div3")[0].style.display = "";
  199. } else {
  200. $("#element_visual_div1")[0].style.display = "none";
  201. $("#element_visual_div2")[0].style.display = "none";
  202. $("#element_visual_div3")[0].style.display = "none";
  203. }
  204. }
  205. if (!zTreeOprObj.isCrossTpl()) {
  206. $("#element_hidden")[0].style.display = "none";
  207. }
  208. },
  209. hiddenChange: function (dom) {
  210. dataInfoMapTreeOprObj.currentNode[JV.PROP_HIDDEN] = dom.checked;
  211. },
  212. crossRowIsSerialChange: function (dom) {
  213. dataInfoMapTreeOprObj.currentNode[JV.PROP_IS_SERIAL] = dom.checked;
  214. },
  215. crossSortOrderChange: function (dom) {
  216. switch (dom.selectedIndex) {
  217. case 0:
  218. dataInfoMapTreeOprObj.currentNode[JV.TAB_FIELD_PROP_SORT] = JV.TAB_FIELD_PROP_SORT_VAL_NOSORT;
  219. break;
  220. case 1:
  221. dataInfoMapTreeOprObj.currentNode[JV.TAB_FIELD_PROP_SORT] = JV.TAB_FIELD_PROP_SORT_VAL_ASC;
  222. break;
  223. case 2:
  224. dataInfoMapTreeOprObj.currentNode[JV.TAB_FIELD_PROP_SORT] = JV.TAB_FIELD_PROP_SORT_VAL_DESC;
  225. break;
  226. default:
  227. dataInfoMapTreeOprObj.currentNode[JV.TAB_FIELD_PROP_SORT] = JV.TAB_FIELD_PROP_SORT_VAL_ASC;
  228. break;
  229. }
  230. },
  231. fontChange: function(dom) {
  232. let me = rpt_tpl_cfg_helper, fontAttr = dom.value;
  233. //dataInfoMapTreeOprObj.currentNode
  234. if (fontAttr === "自定义") {
  235. fontAttr = dataInfoMapTreeOprObj.currentNode[JV.PROP_FONT];
  236. if (typeof fontAttr === "string") {
  237. fontAttr = {};
  238. fontAttr[JV.FONT_PROPS[0]] = "宋体";
  239. fontAttr[JV.FONT_PROPS[1]] = 12;
  240. fontAttr[JV.FONT_PROPS[2]] = "BLACK";
  241. fontAttr[JV.FONT_PROPS[3]] = "F"; //bold
  242. fontAttr[JV.FONT_PROPS[4]] = "F"; //italic
  243. fontAttr[JV.FONT_PROPS[5]] = "F"; //underline
  244. fontAttr[JV.FONT_PROPS[6]] = "F"; //strikeout
  245. fontAttr[JV.FONT_PROPS[7]] = 0; //angle
  246. dataInfoMapTreeOprObj.currentNode[JV.PROP_FONT] = fontAttr;
  247. }
  248. } else {
  249. dataInfoMapTreeOprObj.currentNode[JV.PROP_FONT] = fontAttr;
  250. }
  251. me.private_setup_font(fontAttr);
  252. },
  253. private_setup_font: function(fontAttr) {
  254. let me = rpt_tpl_cfg_helper;
  255. if (typeof fontAttr === "string" && fontAttr !== "自定义") {
  256. $("#eleFontName").get(0).disabled = "disabled" ;
  257. $("#eleFontSize").get(0).disabled = "disabled" ;
  258. $("#eleFontBold").get(0).disabled = "disabled" ;
  259. $("#eleFontItalic").get(0).disabled = "disabled" ;
  260. $("#eleFontUnderline").get(0).disabled = "disabled" ;
  261. let idx = me.reportCfg.fontArr.indexOf(fontAttr);
  262. $("#elementFonts").get(0).selectedIndex = idx;
  263. let font = me.reportCfg.fonts[idx];
  264. $("#eleFontName").get(0).value = font.Name;
  265. $("#eleFontSize").get(0).value = parseInt(font.FontHeight);
  266. $("#eleFontBold").get(0).checked = stringUtil.convertStrToBoolean(font.FontBold);
  267. $("#eleFontItalic").get(0).checked = stringUtil.convertStrToBoolean(font.FontItalic);
  268. $("#eleFontUnderline").get(0).checked = stringUtil.convertStrToBoolean(font.FontUnderline);
  269. } else {
  270. //$("#elementFonts").get(0).selectedIndex = idx;
  271. $("#eleFontName").get(0).removeAttribute("disabled");
  272. $("#eleFontSize").get(0).removeAttribute("disabled");
  273. $("#eleFontBold").get(0).removeAttribute("disabled");
  274. $("#eleFontItalic").get(0).removeAttribute("disabled");
  275. $("#eleFontUnderline").get(0).removeAttribute("disabled");
  276. $("#eleFontName").get(0).value = fontAttr.Name;
  277. $("#eleFontSize").get(0).value = parseInt(fontAttr.FontHeight);
  278. $("#eleFontBold").get(0).checked = stringUtil.convertStrToBoolean(fontAttr.FontBold);
  279. $("#eleFontItalic").get(0).checked = stringUtil.convertStrToBoolean(fontAttr.FontItalic);
  280. $("#eleFontUnderline").get(0).checked = stringUtil.convertStrToBoolean(fontAttr.FontUnderline);
  281. }
  282. },
  283. private_setup_area: function (treeNode) {
  284. $("#elementArea_Left").get(0).value = parseFloat(treeNode[JV.PROP_AREA][JV.PROP_LEFT]);
  285. $("#elementArea_Right").get(0).value = parseFloat(treeNode[JV.PROP_AREA][JV.PROP_RIGHT]);
  286. $("#elementArea_Top").get(0).value = parseFloat(treeNode[JV.PROP_AREA][JV.PROP_TOP]);
  287. $("#elementArea_Bottom").get(0).value = parseFloat(treeNode[JV.PROP_AREA][JV.PROP_BOTTOM]);
  288. if (typeof treeNode[JV.PROP_AREA][JV.PROP_H_CALCULATION] === "string") {
  289. $("#isPercentage_Left").get(0).checked = treeNode[JV.PROP_AREA][JV.PROP_H_CALCULATION] === "percentage";
  290. $("#isPercentage_Right").get(0).checked = treeNode[JV.PROP_AREA][JV.PROP_H_CALCULATION] === "percentage";
  291. } else {
  292. $("#isPercentage_Left").get(0).checked = treeNode[JV.PROP_AREA][JV.PROP_H_CALCULATION][JV.PROP_LEFT] === "percentage";
  293. $("#isPercentage_Right").get(0).checked = treeNode[JV.PROP_AREA][JV.PROP_H_CALCULATION][JV.PROP_RIGHT] === "percentage";
  294. }
  295. if (typeof treeNode[JV.PROP_AREA][JV.PROP_V_CALCULATION] === "string") {
  296. $("#isPercentage_Top").get(0).checked = treeNode[JV.PROP_AREA][JV.PROP_V_CALCULATION] === "percentage";
  297. $("#isPercentage_Bottom").get(0).checked = treeNode[JV.PROP_AREA][JV.PROP_V_CALCULATION] === "percentage";
  298. } else {
  299. $("#isPercentage_Top").get(0).checked = treeNode[JV.PROP_AREA][JV.PROP_V_CALCULATION][JV.PROP_TOP] === "percentage";
  300. $("#isPercentage_Bottom").get(0).checked = treeNode[JV.PROP_AREA][JV.PROP_V_CALCULATION][JV.PROP_BOTTOM] === "percentage";
  301. }
  302. },
  303. fontNameChange: function(dom){
  304. let font = dataInfoMapTreeOprObj.currentNode[JV.PROP_FONT];
  305. font[JV.FONT_PROPS[0]] = dom.value;
  306. },
  307. fontSizeChange: function(dom) {
  308. let font = dataInfoMapTreeOprObj.currentNode[JV.PROP_FONT];
  309. font[JV.FONT_PROPS[1]] = dom.value;
  310. },
  311. fontBoldChange: function(dom) {
  312. let font = dataInfoMapTreeOprObj.currentNode[JV.PROP_FONT];
  313. font[JV.FONT_PROPS[3]] = dom.checked?'T':'F';
  314. },
  315. fontItalicChange: function(dom) {
  316. let font = dataInfoMapTreeOprObj.currentNode[JV.PROP_FONT];
  317. font[JV.FONT_PROPS[4]] = dom.checked?'T':'F';
  318. },
  319. fontUnderlineChange: function(dom) {
  320. let font = dataInfoMapTreeOprObj.currentNode[JV.PROP_FONT];
  321. font[JV.FONT_PROPS[5]] = dom.checked?'T':'F';
  322. },
  323. borderChange: function(dom) {
  324. if (dataInfoMapTreeOprObj.currentNode) {
  325. let me = this, borderAttr = dom.value;
  326. let idx = me.reportCfg.borderArr.indexOf(borderAttr);
  327. let border = me.reportCfg.styles[idx];
  328. dataInfoMapTreeOprObj.currentNode[JV.PROP_STYLE] = borderAttr;
  329. for (let borderLine of border[JV.PROP_BORDER_STYLE]) {
  330. switch (borderLine[JV.PROP_POSITION]) {
  331. case JV.PROP_LEFT:
  332. $("#eleBorderLeft").get(0).value = borderLine[JV.PROP_LINE_WEIGHT];
  333. break;
  334. case JV.PROP_RIGHT:
  335. $("#eleBorderRight").get(0).value = borderLine[JV.PROP_LINE_WEIGHT];
  336. break;
  337. case JV.PROP_TOP:
  338. $("#eleBorderTop").get(0).value = borderLine[JV.PROP_LINE_WEIGHT];
  339. break;
  340. case JV.PROP_BOTTOM:
  341. $("#eleBorderBottom").get(0).value = borderLine[JV.PROP_LINE_WEIGHT];
  342. break;
  343. default:
  344. break;
  345. }
  346. }
  347. }
  348. },
  349. controlChange: function(dom) {
  350. if (dataInfoMapTreeOprObj.currentNode) {
  351. let me = this, ctrlAttr = dom.value;
  352. let idx = me.reportCfg.controlArr.indexOf(ctrlAttr);
  353. let ctrl = me.reportCfg.ctrls[idx];
  354. dataInfoMapTreeOprObj.currentNode[JV.PROP_CONTROL] = ctrlAttr;
  355. $("#elementAlignmentHorizon").get(0).selectedIndex = JV.OUTPUT_ALIGN.H.indexOf(ctrl[JV.CONTROL_PROPS[2]]);
  356. $("#elementAlignmentVertical").get(0).selectedIndex = JV.OUTPUT_ALIGN.V.indexOf(ctrl[JV.CONTROL_PROPS[3]]);
  357. $("#eleShrink").get(0).checked = stringUtil.convertStrToBoolean(ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_SHRINK]]);
  358. $("#eleShowZero").get(0).checked = stringUtil.convertStrToBoolean(ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_SHOW_ZERO]]);
  359. $("#eleAutoWrap").get(0).checked = stringUtil.convertStrToBoolean(ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_WRAP]]);
  360. $("#eleIsShrinkFirst").get(0).checked = stringUtil.convertStrToBoolean(ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_SHRINK_FIRST]]);
  361. $("#eleCloseOutput").get(0).checked = stringUtil.convertStrToBoolean(ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_CLOSE_OUTPUT]]);
  362. }
  363. },
  364. changeAlignment: function(dom, type) {
  365. let ctrl = dataInfoMapTreeOprObj.currentNode[JV.PROP_CONTROL];
  366. if (type === "horizon") {
  367. ctrl[JV.CONTROL_PROPS[2]] = JV.OUTPUT_ALIGN[dom.selectedIndex];
  368. } else {
  369. ctrl[JV.CONTROL_PROPS[3]] = JV.OUTPUT_ALIGN[dom.selectedIndex];
  370. }
  371. },
  372. changeArea: function(dom, typeStr) {
  373. if (dataInfoMapTreeOprObj.currentNode) {
  374. dataInfoMapTreeOprObj.currentNode[JV.PROP_AREA][typeStr] = dom.value;
  375. }
  376. },
  377. changeAreaCalcType: function (dom, typeStr) {
  378. if (dataInfoMapTreeOprObj.currentNode) {
  379. let otherSideStr = "", caclStr = "";
  380. switch (typeStr) {
  381. case JV.PROP_LEFT:
  382. caclStr = JV.PROP_H_CALCULATION;
  383. otherSideStr = JV.PROP_RIGHT;
  384. break;
  385. case JV.PROP_RIGHT:
  386. caclStr = JV.PROP_H_CALCULATION;
  387. otherSideStr = JV.PROP_LEFT;
  388. break;
  389. case JV.PROP_TOP:
  390. caclStr = JV.PROP_V_CALCULATION;
  391. otherSideStr = JV.PROP_BOTTOM;
  392. break;
  393. case JV.PROP_BOTTOM:
  394. caclStr = JV.PROP_V_CALCULATION;
  395. otherSideStr = JV.PROP_TOP;
  396. break;
  397. }
  398. if (typeof dataInfoMapTreeOprObj.currentNode[JV.PROP_AREA][caclStr] === "string") {
  399. let bk_type = dataInfoMapTreeOprObj.currentNode[JV.PROP_AREA][caclStr];
  400. dataInfoMapTreeOprObj.currentNode[JV.PROP_AREA][caclStr] = {};
  401. dataInfoMapTreeOprObj.currentNode[JV.PROP_AREA][caclStr][typeStr] = dom.checked?JV.CAL_TYPE[0]:JV.CAL_TYPE[1];
  402. dataInfoMapTreeOprObj.currentNode[JV.PROP_AREA][caclStr][otherSideStr] = bk_type;
  403. } else {
  404. dataInfoMapTreeOprObj.currentNode[JV.PROP_AREA][caclStr][typeStr] = dom.checked?JV.CAL_TYPE[0]:JV.CAL_TYPE[1];
  405. }
  406. }
  407. },
  408. changePreSuff: function (dom, typeStr) {
  409. if (dataInfoMapTreeOprObj.currentNode) {
  410. dataInfoMapTreeOprObj.currentNode[typeStr] = dom.value;
  411. }
  412. },
  413. changeFormat: function (dom) {
  414. if (dataInfoMapTreeOprObj.currentNode) {
  415. dataInfoMapTreeOprObj.currentNode[JV.PROP_FORMAT] = dom.value;
  416. }
  417. },
  418. changeDftValue: function (dom) {
  419. if (dataInfoMapTreeOprObj.currentNode) {
  420. dataInfoMapTreeOprObj.currentNode[JV.PROP_DFT_VALUE] = dom.value;
  421. }
  422. },
  423. changeAutoHeight: function(dom) {
  424. if (dataInfoMapTreeOprObj.currentNode) {
  425. dataInfoMapTreeOprObj.currentNode[JV.PROP_IS_AUTO_HEIGHT] = dom.checked;
  426. }
  427. }
  428. };