rpt_tpl_pre_handle.js 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232
  1. /**
  2. * Created by Tony on 2017/12/26.
  3. */
  4. const sort_types = ["normal", "tree", "accord_to_parent", "self_define"];
  5. const condition_types = ["==", "===", ">", ">=", "<", "<=", "!=", "in", "not in"];
  6. const pre_handle_data_objects = ["bills", "ration", "ration_glj", "projectGLJ"];
  7. const pre_handle_data_objects_name = ["清单", "定额", "定额人材机", "项目人材机"];
  8. //供货方式
  9. const fixed_supply_types = [
  10. {Name: "自行采购(0)", Title: "", Value: 0},
  11. {Name: "部分甲供(1)", Title: "", Value: 1},
  12. {Name: "完全甲供(2)", Title: "", Value: 2},
  13. {Name: "甲定乙供(3)", Title: "", Value: 3}
  14. ];
  15. //三材类别
  16. const fixed_material_types = [
  17. {Name: "钢材(1)", Title: "", Value: 1},
  18. {Name: "钢筋(2)", Title: "", Value: 2},
  19. {Name: "木材(3)", Title: "", Value: 3},
  20. {Name: "水泥(4)", Title: "", Value: 4},
  21. {Name: "标准砖(5)", Title: "", Value: 5}
  22. ];
  23. // const fixed_glj_types = [
  24. // {Name: "人工(1)", Title: "", Value: 1},
  25. // {Name: "普通材料(201)", Title: "", Value: 201},
  26. // {Name: "混凝土(202)", Title: "", Value: 202},
  27. // {Name: "砂浆(203)", Title: "", Value: 203},
  28. // {Name: "配合比(204)", Title: "", Value: 204},
  29. // {Name: "商品混凝土(205)", Title: "", Value: 205},
  30. // {Name: "商品砂浆(206)", Title: "", Value: 206},
  31. // {Name: "其他材料(207)", Title: "", Value: 207},
  32. // {Name: "普通机械(301)", Title: "", Value: 301},
  33. // {Name: "机械组成物(302)", Title: "", Value: 302},
  34. // {Name: "机上人工(303)", Value: 303},
  35. // {Name: "仪器仪表(304)", Value: 304},
  36. // {Name: "燃料动力费(305)", Value: 305},
  37. // {Name: "折旧费(306)", Value: 306},
  38. // {Name: "检修费(307)", Value: 307},
  39. // {Name: "维护费(308)", Value: 308},
  40. // {Name: "安拆费及场外运费(309)", Value: 309},
  41. // {Name: "校验费(310)", Value: 310},
  42. // {Name: "其他费用(311)", Value: 311},
  43. // {Name: "其他施工机具使用费(312)", Value: 312},
  44. // {Name: "主材(4)", Title: "", Value: 4},
  45. // {Name: "设备(5)", Title: "", Value: 5},
  46. // {Name: "企业管理费(6)", Title: "", Value: 6},
  47. // {Name: "利润(7)", Title: "", Value: 7},
  48. // {Name: "一般风险费(8)", Title: "", Value: 8}
  49. // ];
  50. const fixed_glj_types = [
  51. {Name: "人工(1)", Title: "", Value: 1},
  52. {Name: "普通材料(201)", Title: "", Value: 201},
  53. {Name: "混凝土(202)", Title: "", Value: 202},
  54. {Name: "砂浆(203)", Title: "", Value: 203},
  55. {Name: "配合比(204)", Title: "", Value: 204},
  56. {Name: "商品混凝土(205)", Title: "", Value: 205},
  57. {Name: "商品砂浆(206)", Title: "", Value: 206},
  58. {Name: "其他材料(207)", Title: "", Value: 207},
  59. {Name: "机械台班(301)", Title: "", Value: 301},
  60. {Name: "机械组成物(302)", Title: "", Value: 302},
  61. {Name: "机上人工(303)", Value: 303},
  62. {Name: "仪器仪表(304)", Value: 304},
  63. {Name: "燃料动力费(305)", Value: 305},
  64. {Name: "折旧费(306)", Value: 306},
  65. {Name: "检修费(307)", Value: 307},
  66. {Name: "维护费(308)", Value: 308},
  67. {Name: "安拆费及场外运费(309)", Value: 309},
  68. {Name: "校验费(310)", Value: 310},
  69. {Name: "其他费用(311)", Value: 311},
  70. {Name: "其他施工机具使用费(312)", Value: 312},
  71. {Name: "主材(4)", Title: "", Value: 4},
  72. {Name: "设备(5)", Title: "", Value: 5},
  73. {Name: "企业管理费(6)", Title: "", Value: 6},
  74. {Name: "利润(7)", Title: "", Value: 7},
  75. {Name: "一般风险费(8)", Title: "", Value: 8}
  76. ];
  77. // const fixed_top_bills_nodes = [
  78. // {Name: "分部分项工程(1)", Title: "", Value: 1}
  79. // ,{Name: "措施项目(2)", Title: "", Value: 2}
  80. // ,{Name: "其他项目(7)", Title: "", Value: 7}
  81. // ,{Name: "规费(15)", Title: "", Value: 15}
  82. // ,{Name: "税金(18)", Title: "", Value: 18}
  83. // ,{Name: "工程造价(19)", Title: "", Value: 19}
  84. // ];
  85. const fixed_top_bills_nodes = [
  86. {Name: "建筑安装工程费(1)", Title: "", Value: 1}
  87. ,{Name: "土地使用及拆迁补偿费(2)", Title: "", Value: 2}
  88. ,{Name: "养护工程其他费用(3)", Title: "", Value: 3}
  89. ,{Name: "预备费(4)", Title: "", Value: 4}
  90. ,{Name: "一二三四部分合计(7)", Title: "", Value: 7}
  91. ,{Name: "贷款利息(8)", Title: "", Value: 8}
  92. ,{Name: "总造价(9)", Title: "", Value: 9}
  93. ];
  94. // const fixed_other_bills_types = [
  95. // {Name: "施工技术措施项目(3)", Title: "", Value: 3}
  96. // ,{Name: "安全文明施工按实计算费用(4)", Title: "", Value: 4}
  97. // ,{Name: "施工组织措施专项费用(5)", Title: "", Value: 5}
  98. // ,{Name: "安全文明施工专项费用(6)", Title: "", Value: 6}
  99. // ,{Name: "暂列金额(8)", Title: "", Value: 8}
  100. // ,{Name: "暂估价(9)", Title: "", Value: 9}
  101. // ,{Name: "材料(工程设备)暂估价(10)", Title: "", Value: 10}
  102. // ,{Name: "专业工程暂估价(11)", Title: "", Value: 11}
  103. // ,{Name: "计日工(12)", Title: "", Value: 12}
  104. // ,{Name: "总承包服务费(13)", Title: "", Value: 13}
  105. // ,{Name: "索赔与现场签证(14)", Title: "", Value: 14}
  106. // ,{Name: "社会保险费及住房公积金(16)", Title: "", Value: 16}
  107. // ,{Name: "工程排污费(17)", Title: "", Value: 17}
  108. // ,{Name: "增值税(20)", Title: "", Value: 20}
  109. // ];
  110. const fixed_other_bills_types = [
  111. {Name: "基本预备费(5)", Title: "", Value: 5}
  112. ,{Name: "价差预备费(6)", Title: "", Value: 6}
  113. ,{Name: "设备购置费(10)", Title: "", Value: 10}
  114. ,{Name: "专项费用(11)", Title: "", Value: 11}
  115. ,{Name: "施工场地建设费(12)", Title: "", Value: 12}
  116. ,{Name: "养护单位(业主)管理费(13)", Title: "", Value: 13}
  117. ,{Name: "信息化费", Title: "", Value: 14}
  118. ,{Name: "工程监理费(15)", Title: "", Value: 15}
  119. ,{Name: "设计文件审查费(16)", Title: "", Value: 16}
  120. ,{Name: "勘察设计费(17)", Title: "", Value: 17}
  121. ,{Name: "招标代理及标底编制费(18)", Title: "", Value: 18}
  122. ,{Name: "第100章至700章清单(19)", Title: "", Value: 19}
  123. ,{Name: "专项暂定合计(20)", Title: "", Value: 20}
  124. ,{Name: "清单合计扣除专项暂定合计(21)", Title: "", Value: 21}
  125. ,{Name: "计日工(22)", Title: "", Value: 22}
  126. ,{Name: "劳务(23)", Title: "", Value: 23}
  127. ,{Name: "材料(24)", Title: "", Value: 24}
  128. ,{Name: "施工机械(25)", Title: "", Value: 25}
  129. ,{Name: "暂列金额(26)", Title: "", Value: 26}
  130. ,{Name: "安全生产费(27)", Title: "", Value: 27}
  131. ,{Name: "100章清单(28)", Title: "", Value: 28}
  132. ];
  133. // const fixed_bills_flags = [
  134. // {Name: "分部分项工程(1)", Title: "", Value: 1},
  135. // {Name: "措施项目(2)", Title: "", Value: 2},
  136. // {Name: "施工技术措施项目(3)", Title: "", Value: 3},
  137. // {Name: "安全文明施工按实计算费用(4)", Title: "", Value: 4},
  138. // {Name: "施工组织措施专项费用(5)", Title: "", Value: 5},
  139. // {Name: "安全文明施工专项费用(6)", Title: "", Value: 6},
  140. // {Name: "其他项目(7)", Title: "", Value: 7},
  141. // {Name: "暂列金额(8)", Title: "", Value: 8},
  142. // {Name: "暂估价(9)", Title: "", Value: 9},
  143. // {Name: "材料(工程设备)暂估价(10)", Title: "", Value: 10},
  144. // {Name: "专业工程暂估价(11)", Title: "", Value: 11},
  145. // {Name: "计日工(12)", Title: "", Value: 12},
  146. // {Name: "总承包服务费(13)", Title: "", Value: 13},
  147. // {Name: "索赔与现场签证(14)", Title: "", Value: 14},
  148. // {Name: "规费(15)", Title: "", Value: 15},
  149. // {Name: "社会保险费及住房公积金(16)", Title: "", Value: 16},
  150. // {Name: "工程排污费(17)", Title: "", Value: 17},
  151. // {Name: "税金(18)", Title: "", Value: 18},
  152. // {Name: "工程造价(19)", Title: "", Value: 19},
  153. // {Name: "增值税(20)", Title: "", Value: 20}
  154. // ];
  155. const fixed_bills_flags = [
  156. {Name: "建筑安装工程费(1)", Title: "", Value: 1}
  157. ,{Name: "土地使用及拆迁补偿费(2)", Title: "", Value: 2}
  158. ,{Name: "养护工程其他费用(3)", Title: "", Value: 3}
  159. ,{Name: "预备费(4)", Title: "", Value: 4}
  160. ,{Name: "基本预备费(5)", Title: "", Value: 5}
  161. ,{Name: "价差预备费(6)", Title: "", Value: 6}
  162. ,{Name: "一二三四部分合计(7)", Title: "", Value: 7}
  163. ,{Name: "贷款利息(8)", Title: "", Value: 8}
  164. ,{Name: "总造价(9)", Title: "", Value: 9}
  165. ,{Name: "设备购置费(10)", Title: "", Value: 10}
  166. ,{Name: "专项费用(11)", Title: "", Value: 11}
  167. ,{Name: "施工场地建设费(12)", Title: "", Value: 12}
  168. ,{Name: "养护单位(业主)管理费(13)", Title: "", Value: 13}
  169. ,{Name: "信息化费", Title: "", Value: 14}
  170. ,{Name: "工程监理费(15)", Title: "", Value: 15}
  171. ,{Name: "设计文件审查费(16)", Title: "", Value: 16}
  172. ,{Name: "勘察设计费(17)", Title: "", Value: 17}
  173. ,{Name: "招标代理及标底编制费(18)", Title: "", Value: 18}
  174. ,{Name: "第100章至700章清单(19)", Title: "", Value: 19}
  175. ,{Name: "专项暂定合计(20)", Title: "", Value: 20}
  176. ,{Name: "清单合计扣除专项暂定合计(21)", Title: "", Value: 21}
  177. ,{Name: "计日工(22)", Title: "", Value: 22}
  178. ,{Name: "劳务(23)", Title: "", Value: 23}
  179. ,{Name: "材料(24)", Title: "", Value: 24}
  180. ,{Name: "施工机械(25)", Title: "", Value: 25}
  181. ,{Name: "暂列金额(26)", Title: "", Value: 26}
  182. ,{Name: "安全生产费(27)", Title: "", Value: 27}
  183. ,{Name: "100章清单(28)", Title: "", Value: 28}
  184. ];
  185. const fixed_bills_types = [
  186. {Name: "大项费用(1)", Title: "", Value: 1},
  187. {Name: "分部(2)", Title: "", Value: 2},
  188. {Name: "分项(3)", Title: "", Value: 3},
  189. {Name: "清单(4)", Title: "", Value: 4},
  190. {Name: "补项(5)", Title: "", Value: 5}
  191. ];
  192. const fixed_bills_special_provisional_types = [
  193. {Name: "材料", Title: "", Value: "材料"},
  194. {Name: "工程设备", Title: "", Value: "工程设备"},
  195. {Name: "专业工程", Title: "", Value: "专业工程"}
  196. ];
  197. const exposed_bills_properties = [
  198. {Name: "清单_所属项目ID", Title: "", Key: "projectID", Order: "ascend"}
  199. ,{Name: "清单_ID", Title: "", Key: "ID", Order: "ascend"}
  200. ,{Name: "顶层父清单_标记", Title: "", Key: "topBillID", Order: "ascend", individualType: fixed_top_bills_nodes}
  201. ,{Name: "清单_层次", Title: "", Key: "treeLevel", Order: "ascend"}
  202. ,{Name: "清单_类别", Title: "", Key: "type", Order: "ascend", individualType: fixed_bills_types}
  203. ,{Name: "清单_标记", Title: "", Key: "flags.flag", Order: "ascend", individualType: fixed_bills_flags}
  204. ,{Name: "清单_顺序号", Title: "", Key: "treeFlatSerialOrder", Order: "ascend"}
  205. ,{Name: "清单_专项类型", Title: "", Key: "specialProvisional", Order: "ascend", individualType: fixed_bills_special_provisional_types}
  206. ];
  207. const exposed_ration_properties = [
  208. {Name: "定额_工程内部ID", Title: "", Key: "ID", Order: "ascend"}
  209. ,{Name: "定额_所属项目ID", Title: "", Key: "projectID", Order: "ascend"}
  210. ,{Name: "定额_所属清单ID", Title: "", Key: "billsItemID", Order: "ascend"}
  211. ,{Name: "定额_清单内顺序", Title: "", Key: "serialNo", Order: "ascend"}
  212. ];
  213. const exposed_ration_glj_properties = [
  214. {Name: "定额人材机_ID", Title: "", Key: "ID"}
  215. ,{Name: "定额人材机_所属定额ID", Title: "", Key: "rationID", Order: "ascend"}
  216. ,{Name: "定额人材机_所属清单ID", Title: "", Key: "billsItemID", Order: "ascend"}
  217. ,{Name: "定额人材机_所属工程ID", Title: "", Key: "projectID", Order: "ascend"}
  218. ,{Name: "定额人材机_代码", Title: "", Key: "code", Order: "ascend"}
  219. ,{Name: "定额人材机_类型", Title: "", Key: "type", Order: "ascend", individualType: fixed_glj_types}
  220. ,{Name: "定额人材机_数量", Title: "", Key: "quantity", Order: "ascend"}
  221. ,{Name: "定额人材机_是否暂估", Title: "", Key: "ref_join(projectGLJID,projectGLJ,id).is_evaluate", Order: "ascend", isBoolean: true, booleanOptions: [1,0]}
  222. ,{Name: "定额人材机_供货方式", Title: "", Key: "ref_join(projectGLJID,projectGLJ,id).supply", Order: "ascend", individualType: fixed_supply_types}
  223. ,{Name: "定额人材机_三材类别", Title: "", Key: "ref_join(projectGLJID,projectGLJ,id).materialType", Order: "ascend", individualType: fixed_material_types}
  224. ];
  225. const exposed_prj_glj_properties = [
  226. {Name: "项目人材机_ID", Title: "", Key: "ID"}
  227. ,{Name: "项目人材机_所属工程ID", Title: "", Key: "projectID", Order: "ascend"}
  228. ,{Name: "项目人材机_代码", Title: "", Key: "code", Order: "ascend"}
  229. ,{Name: "项目人材机_类型", Title: "", Key: "type", Order: "ascend", individualType: fixed_glj_types}
  230. ,{Name: "项目人材机_数量", Title: "", Key: "quantity", Order: "ascend"}
  231. ,{Name: "项目人材机_是否暂估", Title: "", Key: "is_evaluate", Order: "ascend", isBoolean: true, booleanOptions: [1,0]}
  232. ,{Name: "项目人材机_是否材料计算", Title: "", Key: "unit_price.calcMaterial", Order: "ascend", isBoolean: true, booleanOptions: [1,0]}
  233. ,{Name: "项目人材机_供货方式", Title: "", Key: "supply", Order: "ascend", individualType: fixed_supply_types}
  234. ,{Name: "项目人材机_三材类别", Title: "", Key: "materialType", Order: "ascend", individualType: fixed_material_types}
  235. ];
  236. const exposed_properties_arr = [exposed_bills_properties, exposed_ration_properties, exposed_ration_glj_properties, exposed_prj_glj_properties];
  237. let preHandleObj = {
  238. treeObj: null,
  239. typeTreeObj: null,
  240. currentNode: null,
  241. iniTree: function(rptTpl) {
  242. let me = this;
  243. me.buildData(rptTpl);
  244. },
  245. buildData: function(rptTpl) {
  246. let me = this, handles = [];
  247. if (rptTpl[JV.NODE_MAP_DATA_HANDLE_INFO]) {
  248. for (let item of rptTpl[JV.NODE_MAP_DATA_HANDLE_INFO]) {
  249. let hd = {Name: "预处理环节"};
  250. me.private_copy_node(item, hd);
  251. me.private_set_title(hd);
  252. hd.Operations = []; //考虑到用户可能会换来换去,这样会有冗余的属性出现
  253. handles.push(hd);
  254. }
  255. }
  256. me.treeObj = $.fn.zTree.init($("#pre_handle_data_info_reversed"), preHandleSetting, handles);
  257. },
  258. build_handle_data_selection: function() {
  259. let sel = $("#select_mapping_data"), sel2 = $("#select_mapping_data_for_sort_type");
  260. for (let i = 0; i < pre_handle_data_objects.length; i++) {
  261. sel2.append("<option value='" + pre_handle_data_objects[i] + "'>" + pre_handle_data_objects_name[i] + "</option>");
  262. sel.append("<option value='" + pre_handle_data_objects[i] + "'>" + pre_handle_data_objects_name[i] + "</option>");
  263. }
  264. },
  265. buildTypeData: function () {
  266. let me = this, types = [];
  267. types.push({Name: JV.PROP_HANDLE_TYPE_SORT, Title: ""});
  268. types.push({Name: JV.PROP_HANDLE_TYPE_FILTER, Title: ""});
  269. types.push({Name: JV.PROP_HANDLE_TYPE_BILLS_DATA_MOVE, Title: ""});
  270. types.push({Name: JV.PROP_HANDLE_TYPE_SUM, Title: ""});
  271. types.push({Name: JV.PROP_HANDLE_TYPE_ADJUST, Title: ""});
  272. types.push({Name: JV.PROP_HANDLE_TYPE_ADD_DUMMY, Title: ""});
  273. // types.push({Name: "纯手工填写", Title: ""});
  274. me.typeTreeObj = $.fn.zTree.init($("#pre_handle_type_reversed"), preHandleTypeSetting, types);
  275. me.setDisabledBandSelect([0,1,2,3,4,5]);
  276. me.build_handle_data_selection();
  277. },
  278. setDisabledBandSelect: function(disabledIdxArr) {
  279. let me = this;
  280. if (me.typeTreeObj) {
  281. let nodes = me.typeTreeObj.getNodes();
  282. for (let idx = 0; idx < nodes.length; idx++) {
  283. if (disabledIdxArr.indexOf(idx) >= 0) {
  284. me.typeTreeObj.setChkDisabled(nodes[idx], true, true, true);
  285. } else {
  286. me.typeTreeObj.setChkDisabled(nodes[idx], false, true, true);
  287. }
  288. }
  289. }
  290. },
  291. createNewNode: function (nodeType) {
  292. let rst = null, preHandleType = nodeType;
  293. if (!nodeType) {
  294. preHandleType = JV.PROP_HANDLE_TYPE_SORT;
  295. }
  296. switch (nodeType) {
  297. case JV.PROP_HANDLE_TYPE_SORT:
  298. rst = {Name: "预处理环节", Title: "", "映射数据对象": "bills", "预处理类型": preHandleType, "排序方式": "normal", "排序键值集":[]};
  299. break;
  300. case JV.PROP_HANDLE_TYPE_FILTER:
  301. rst = {Name: "预处理环节", Title: "", "映射数据对象": "bills", "预处理类型": preHandleType, "过滤键值集": []};
  302. break;
  303. case JV.PROP_HANDLE_TYPE_BILLS_DATA_MOVE:
  304. rst = {Name: "预处理环节", Title: "", "映射数据对象": "ration", "预处理类型": preHandleType};
  305. break;
  306. case JV.PROP_HANDLE_TYPE_SUM:
  307. rst = {Name: "预处理环节", Title: "", "映射数据对象": "bills", "预处理类型": preHandleType, "分组键值集": [], "统计键值集":[]};
  308. break;
  309. case JV.PROP_HANDLE_TYPE_ADJUST:
  310. rst = {Name: "预处理环节", Title: "", "映射数据对象": "bills", "预处理类型": preHandleType, "数据调整集":[]};
  311. break;
  312. case JV.PROP_HANDLE_TYPE_ADD_DUMMY:
  313. rst = {Name: "预处理环节", Title: "", "映射数据对象": "bills", "预处理类型": preHandleType, "Dummy数据集":[]};
  314. break;
  315. default:
  316. rst = {Name: "预处理环节", Title: "", "映射数据对象": "bills", "预处理类型": "排序", "排序方式": "normal", "排序键值集":[]};
  317. break;
  318. }
  319. return rst;
  320. },
  321. addNewNode: function(nodeType) {
  322. let me = this, item = me.createNewNode(nodeType);
  323. me.private_set_title(item);
  324. me.treeObj.addNodes(null, -1, [item], true);
  325. },
  326. private_change_node_by_type: function(handleType, item) {
  327. let preHandleType = handleType;
  328. if (!handleType) {
  329. preHandleType = JV.PROP_HANDLE_TYPE_SORT;
  330. }
  331. item[JV.PROP_HANDLE_TYPE] = preHandleType;
  332. switch (handleType) {
  333. case JV.PROP_HANDLE_TYPE_SORT:
  334. item[JV.PROP_SORT_TYPE] = "normal";
  335. item[JV.PROP_SORT_KEYS] = [];
  336. break;
  337. case JV.PROP_HANDLE_TYPE_FILTER:
  338. item[JV.PROP_FILTER_KEYS] = [];
  339. break;
  340. case JV.PROP_HANDLE_TYPE_BILLS_DATA_MOVE:
  341. break;
  342. case JV.PROP_HANDLE_TYPE_SUM:
  343. item[JV.PROP_SUM_GROUP_KEYS] = [];
  344. item[JV.PROP_SUM_SUM_KEYS] = [];
  345. break;
  346. case JV.PROP_HANDLE_TYPE_ADJUST:
  347. item[JV.PROP_ADJUST_COLLECTION] = [];
  348. break;
  349. case JV.PROP_HANDLE_TYPE_ADD_DUMMY:
  350. item[JV.PROP_DUMMY_COLLECTION] = [];
  351. break;
  352. default:
  353. item[JV.PROP_HANDLE_TYPE] = JV.PROP_HANDLE_TYPE_SORT;
  354. item[JV.PROP_SORT_TYPE] = "normal";
  355. item[JV.PROP_SORT_KEYS] = [];
  356. break;
  357. }
  358. // return rst;
  359. },
  360. private_copy_node: function(src, dest) {
  361. let me = this;
  362. dest[JV.PROP_DATA_KEY] = src[JV.PROP_DATA_KEY];
  363. dest[JV.PROP_HANDLE_TYPE] = src[JV.PROP_HANDLE_TYPE];
  364. if (src[JV.PROP_HANDLE_TYPE] === JV.PROP_HANDLE_TYPE_SORT) {
  365. preHandleSortObj.copyNode(src, dest);
  366. } else if (src[JV.PROP_HANDLE_TYPE] === JV.PROP_HANDLE_TYPE_FILTER) {
  367. preHandleFilterObj.copyNode(src, dest);
  368. } else if (src[JV.PROP_HANDLE_TYPE] === JV.PROP_HANDLE_TYPE_SUM) {
  369. preHandleSummaryObj.copyNode(src, dest);
  370. } else if (src[JV.PROP_HANDLE_TYPE] === JV.PROP_HANDLE_TYPE_ADJUST) {
  371. preHandleAdjustObj.copyNode(src, dest);
  372. } else if (src[JV.PROP_HANDLE_TYPE] === JV.PROP_HANDLE_TYPE_ADD_DUMMY) {
  373. preHandleAddDummyObj.copyNode(src, dest);
  374. }
  375. },
  376. private_set_title: function(node) {
  377. let nameStr = node[JV.PROP_NAME], idx = nameStr.indexOf("(");
  378. if (idx >= 0) {
  379. nameStr = nameStr.slice(0, idx);
  380. }
  381. node[JV.PROP_NAME] = nameStr + "(" + node[JV.PROP_HANDLE_TYPE] + ")";
  382. node.Title = "映射数据对象:" + node[JV.PROP_DATA_KEY] + " | " + node[JV.PROP_HANDLE_TYPE];
  383. },
  384. refreshByNode: function(treeNode) {
  385. let me = preHandleObj;
  386. if (me.typeTreeObj) {
  387. let nodes = me.typeTreeObj.getNodes();
  388. let typeNode = null;
  389. for (let node of nodes) {
  390. if (treeNode[JV.PROP_NAME].indexOf(node[JV.PROP_NAME]) > 0) {
  391. me.typeTreeObj.checkNode(node, true, false, false);
  392. typeNode = node;
  393. break;
  394. }
  395. }
  396. let md = $("#select_mapping_data")[0];
  397. for (let i = 0; i < md.children.length; i++) {
  398. if (treeNode[JV.PROP_DATA_KEY] === md.children[i].value) {
  399. md.selectedIndex = i;
  400. break;
  401. }
  402. }
  403. if (typeNode) {
  404. me.hide_all_dom();
  405. $("#div_pre_handle_data")[0].style.display = "";
  406. if (typeNode[JV.PROP_NAME] === "排序") {
  407. preHandleSortObj.refresh_node();
  408. } else if (typeNode[JV.PROP_NAME] === "过滤") {
  409. preHandleFilterObj.refresh_node();
  410. } else if (typeNode[JV.PROP_NAME] === "合计") {
  411. preHandleSummaryObj.refresh_node();
  412. } else if (typeNode[JV.PROP_NAME] === "数据调整") {
  413. preHandleAdjustObj.refresh_node();
  414. } else if (typeNode[JV.PROP_NAME] === "增加Dummy数据") {
  415. preHandleAddDummyObj.refresh_node();
  416. }
  417. }
  418. }
  419. },
  420. hide_all_dom: function() {
  421. $("#div_pre_handle_data")[0].style.display = "none";
  422. $("#div_sort_type")[0].style.display = "none";
  423. $("#div_sort_type_normal")[0].style.display = "none";
  424. $("#div_filter_type")[0].style.display = "none";
  425. $("#div_summary_type")[0].style.display = "none";
  426. $("#div_adjust_type")[0].style.display = "none";
  427. $("#div_add_dummy_type")[0].style.display = "none";
  428. $("#div_sort_type_according_to_parent")[0].style.display = "none";
  429. $("#div_sort_type_parent_data")[0].style.display = "none";
  430. $("#div_sort_tree")[0].style.display = "none";
  431. $("#div_sort_self_define")[0].style.display = "none";
  432. },
  433. onPreHandleClick: function(event,treeId,treeNode) {
  434. //点击预处理环节 节点
  435. let me = preHandleObj;
  436. me.currentNode = treeNode;
  437. me.setDisabledBandSelect([3,4,5]);
  438. // me.setDisabledBandSelect([]);
  439. me.refreshByNode(treeNode);
  440. },
  441. onTypeClick: function(event,treeId,treeNode) {
  442. //选择预处理类型(排序、过滤。。。)
  443. let me = preHandleObj;
  444. if (me.currentNode) {
  445. // me.currentNode[JV.PROP_HANDLE_TYPE] = treeNode[JV.PROP_NAME];
  446. me.private_change_node_by_type(treeNode[JV.PROP_NAME], me.currentNode);
  447. me.private_set_title(me.currentNode);
  448. me.treeObj.updateNode(me.currentNode, false);
  449. me.refreshByNode(me.currentNode);
  450. }
  451. },
  452. onChangeDataMappingObj: function(dom, oprType) {
  453. //更改(或选择)预处理环节中的 数据依据(就是说报表想预处理什么数据)
  454. let me = preHandleObj;
  455. if (oprType === "top") {
  456. preHandleObj.currentNode[JV.PROP_DATA_KEY] = dom.value;
  457. preHandleSortObj.childTreeObj = $.fn.zTree.init($("#child_sorting_keys"), sortingKeysSetting, exposed_properties_arr[dom.selectedIndex]);
  458. preHandleSortObj.treeObj = $.fn.zTree.init($("#pre_handle_sort_keys_reversed"), sortingKeysSetting, exposed_properties_arr[dom.selectedIndex]);
  459. preHandleFilterObj.treeObj = $.fn.zTree.init($("#pre_handle_filter_keys_reversed"), filterKeysSetting, exposed_properties_arr[dom.selectedIndex]);
  460. } else if (oprType === "accord_to_parent") {
  461. preHandleSortObj.parentTreeObj = $.fn.zTree.init($("#parent_sorting_keys"), sortingKeysSetting, exposed_properties_arr[dom.selectedIndex]);
  462. preHandleObj.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_DATA_KEY] = dom.value;
  463. }
  464. },
  465. onBeforeDrag: function (treeId, treeNodes) {
  466. let rst = true;
  467. for (let node of treeNodes) {
  468. if (node.level > 0) {
  469. rst = false;
  470. break;
  471. }
  472. }
  473. return rst;
  474. },
  475. onBeforeDrop: function(treeId, treeNodes, targetNode, moveType){
  476. let rst = false;
  477. if (targetNode.level === 0 && moveType !== "inner") {
  478. rst = true;
  479. }
  480. return rst;
  481. },
  482. onBeforeRemove: function(treeId, treeNode){
  483. let rst = true;
  484. if (treeNode.isParent) {
  485. rst = false;
  486. } else {
  487. //
  488. }
  489. return rst;
  490. },
  491. addHoverDom: function(treeId, treeNode) {
  492. let me = preHandleObj, sObj = $("#" + treeNode.tId + "_span");
  493. if ((treeNode.level > 0 && treeNode[JV.PROP_HANDLE_TYPE] !== JV.PROP_HANDLE_TYPE_FILTER) || ($("#addBtn_"+treeNode.tId).length > 0) ) return;
  494. if (treeNode[JV.PROP_HANDLE_TYPE] === JV.PROP_HANDLE_TYPE_SORT && treeNode[JV.PROP_SORT_TYPE] === "accord_to_parent") {
  495. let addStr = "<span class='button add' id='addBtn_" + treeNode.tId + "' title='新增子排序' onfocus='this.blur();'></span>";
  496. sObj.after(addStr);
  497. let btn = $("#addBtn_"+treeNode.tId);
  498. if (btn) btn.bind("click", function(){
  499. let newSubNodes = [];
  500. let newNode = me.createNewNode(treeNode[JV.PROP_HANDLE_TYPE]);
  501. newNode.Name = "子排序";
  502. newNode[JV.PROP_DATA_KEY] = treeNode[JV.PROP_DATA_KEY];
  503. me.private_set_title(newNode);
  504. newSubNodes.push(newNode);
  505. treeNode.isParent = true;
  506. me.treeObj.addNodes(treeNode, -1, newSubNodes, true);
  507. me.treeObj.expandNode(treeNode, true, false);
  508. });
  509. } else if (treeNode[JV.PROP_HANDLE_TYPE] === JV.PROP_HANDLE_TYPE_FILTER) {
  510. let addStr = "<span class='button add' id='addBtn_" + treeNode.tId + "' title='新增子过滤' onfocus='this.blur();'></span>";
  511. sObj.after(addStr);
  512. let btn = $("#addBtn_"+treeNode.tId);
  513. if (btn) btn.bind("click", function(){
  514. let newSubNodes = [];
  515. let newNode = me.createNewNode(treeNode[JV.PROP_HANDLE_TYPE]);
  516. newNode.Name = "子过滤";
  517. newNode[JV.PROP_DATA_KEY] = treeNode[JV.PROP_DATA_KEY];
  518. newNode.Title = "";
  519. newNode[JV.PROP_HANDLE_TYPE] = JV.PROP_HANDLE_TYPE_FILTER;
  520. // me.private_set_title(newNode);
  521. newSubNodes.push(newNode);
  522. treeNode.isParent = true;
  523. me.treeObj.addNodes(treeNode, -1, newSubNodes, true);
  524. me.treeObj.expandNode(treeNode, true, false);
  525. });
  526. }
  527. },
  528. removeHoverDom: function (treeId, treeNode) {
  529. $("#addBtn_"+treeNode.tId).unbind().remove();
  530. },
  531. extractTabFields: function (rptTpl) {
  532. let me = this, nodes = me.treeObj.getNodes();
  533. let rst = [];
  534. if (nodes && nodes.length > 0) {
  535. for (let handleObj of nodes) {
  536. switch (handleObj[JV.PROP_HANDLE_TYPE]) {
  537. case JV.PROP_HANDLE_TYPE_SORT:
  538. rst.push(preHandleSortObj.extractTabFields(handleObj));
  539. break;
  540. case JV.PROP_HANDLE_TYPE_FILTER:
  541. rst.push(preHandleFilterObj.extractTabFields(handleObj));
  542. break;
  543. case JV.PROP_HANDLE_TYPE_SUM:
  544. rst.push(preHandleSummaryObj.extractTabFields(handleObj));
  545. break;
  546. case JV.PROP_HANDLE_TYPE_ADJUST:
  547. rst.push(preHandleAdjustObj.extractTabFields(handleObj));
  548. break;
  549. case JV.PROP_HANDLE_TYPE_ADD_DUMMY:
  550. rst.push(preHandleAddDummyObj.extractTabFields(handleObj));
  551. break;
  552. case JV.PROP_HANDLE_TYPE_BILLS_DATA_MOVE:
  553. rst.push(preHandleBillDataMoveObj.extractTabFields(handleObj));
  554. break;
  555. default:
  556. break;
  557. }
  558. }
  559. }
  560. rptTpl[JV.NODE_MAP_DATA_HANDLE_INFO] = rst;
  561. }
  562. };
  563. let preHandleSortObj = {
  564. normalTreeObj: null,
  565. parentTreeObj: null,
  566. childTreeObj: null,
  567. topBillsTreeObj: null,
  568. otherBillsTreeObj: null,
  569. copyNode: function (src, dest) {
  570. let me = preHandleSortObj;
  571. dest[JV.PROP_SORT_TYPE] = src[JV.PROP_SORT_TYPE];
  572. switch (sort_types.indexOf(src[JV.PROP_SORT_TYPE])) {
  573. case -1:
  574. //unknown!
  575. break;
  576. case 0 :
  577. //normal
  578. let keys = [];
  579. for (let sortKeyItem of src[JV.PROP_SORT_KEYS]) {
  580. let item = {key: sortKeyItem.key, order: sortKeyItem.order};
  581. keys.push(item);
  582. }
  583. dest[JV.PROP_SORT_KEYS] = keys;
  584. break;
  585. case 1 :
  586. //tree
  587. let billKeys = [];
  588. if (src[JV.PROP_FILTER_TOP_BILLS_NODES] && src[JV.PROP_FILTER_TOP_BILLS_NODES].length > 0) {
  589. billKeys = billKeys.concat(src[JV.PROP_FILTER_TOP_BILLS_NODES]);
  590. }
  591. dest[JV.PROP_FILTER_TOP_BILLS_NODES] = billKeys;
  592. let otherBillKeys = [];
  593. if (src[JV.PROP_FILTER_OTHER_BILLS_NODES] && src[JV.PROP_FILTER_OTHER_BILLS_NODES].length > 0) {
  594. otherBillKeys = otherBillKeys.concat(src[JV.PROP_FILTER_OTHER_BILLS_NODES]);
  595. }
  596. dest[JV.PROP_FILTER_OTHER_BILLS_NODES] = otherBillKeys;
  597. break;
  598. case 2 :
  599. //according to parent
  600. dest[JV.PROP_PARENT_CHILD_SORT_KEY] = {};
  601. dest[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_DATA_KEY] = src[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_DATA_KEY];
  602. dest[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_SORT_KEYS] = [];
  603. for (let item of src[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_SORT_KEYS]) {
  604. dest[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_SORT_KEYS].push(item);
  605. }
  606. dest[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_CHILD_SORT_KEYS] = [];
  607. for (let item of src[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_CHILD_SORT_KEYS]) {
  608. dest[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_CHILD_SORT_KEYS].push(item);
  609. }
  610. dest[JV.PROP_OTHER_SUB_SORT] = [];
  611. if (src[JV.PROP_OTHER_SUB_SORT] !== null && src[JV.PROP_OTHER_SUB_SORT] !== undefined) {
  612. dest.items = [];
  613. for (let subSort of src[JV.PROP_OTHER_SUB_SORT]) {
  614. let destSubSort = {Name: "子排序"};
  615. me.copyNode(subSort, destSubSort);
  616. destSubSort[JV.PROP_DATA_KEY] = src[JV.PROP_DATA_KEY];
  617. dest.items.push(destSubSort);
  618. }
  619. }
  620. break;
  621. case 3 :
  622. //self define
  623. dest[JV.PROP_SORT_TYPE_SELF_DEFINE_LOGIC] = src[JV.PROP_SORT_TYPE_SELF_DEFINE_LOGIC];
  624. break;
  625. default:
  626. break;
  627. }
  628. },
  629. refresh_node: function () {
  630. let me = this;
  631. $("#div_sort_type")[0].style.display = "";
  632. if (preHandleObj.currentNode) {
  633. let sel = $("#select_sort_types")[0];
  634. let idx = -1;
  635. let sortTypeIdx = sort_types.indexOf(preHandleObj.currentNode[JV.PROP_SORT_TYPE]);
  636. sel.selectedIndex = sortTypeIdx;
  637. switch (sortTypeIdx) {
  638. case -1:
  639. //unknown!
  640. break;
  641. case 0 :
  642. //normal
  643. $("#div_sort_type_normal")[0].style.display = "";
  644. idx = pre_handle_data_objects.indexOf(preHandleObj.currentNode[JV.PROP_DATA_KEY]);
  645. me.normalTreeObj = $.fn.zTree.init($("#pre_handle_sort_keys_reversed"), sortingKeysSetting, exposed_properties_arr[idx]);
  646. let nodes = me.normalTreeObj.getNodes();
  647. for (let sortItem of preHandleObj.currentNode[JV.PROP_SORT_KEYS]) {
  648. for (let keyNode of nodes) {
  649. if (sortItem.key === keyNode.Key) {
  650. me.normalTreeObj.checkNode(keyNode, true, false, false);
  651. break;
  652. }
  653. }
  654. }
  655. break;
  656. case 1 :
  657. //tree
  658. //tree排序是我们特有的数据结构方式,与数据结构有关,非common用
  659. $("#div_sort_tree")[0].style.display = "";
  660. me.topBillsTreeObj = $.fn.zTree.init($("#bills_top_nodes"), sortingTreeSetting, fixed_top_bills_nodes);
  661. let topBillnodes = me.topBillsTreeObj.getNodes();
  662. if (preHandleObj.currentNode[JV.PROP_FILTER_TOP_BILLS_NODES]) {
  663. for (let topBillsNodeId of preHandleObj.currentNode[JV.PROP_FILTER_TOP_BILLS_NODES]) {
  664. for (let topBillsNode of topBillnodes) {
  665. if (topBillsNode.Value === topBillsNodeId) {
  666. me.topBillsTreeObj.checkNode(topBillsNode, true, false, false);
  667. break;
  668. }
  669. }
  670. }
  671. } else {
  672. preHandleObj.currentNode[JV.PROP_FILTER_TOP_BILLS_NODES] = [];
  673. }
  674. me.otherBillsTreeObj = $.fn.zTree.init($("#bills_other_nodes"), sortingTreeSetting2, fixed_other_bills_types);
  675. let otherBillnodes = me.otherBillsTreeObj.getNodes();
  676. if (preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES]) {
  677. for (let otherBillsNodeId of preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES]) {
  678. for (let otherBillsNode of otherBillnodes) {
  679. if (otherBillsNode.Value === otherBillsNodeId) {
  680. me.otherBillsTreeObj.checkNode(otherBillsNode, true, false, false);
  681. break;
  682. }
  683. }
  684. }
  685. } else {
  686. preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES] = [];
  687. }
  688. break;
  689. case 2 :
  690. //according to parent
  691. $("#div_sort_type_according_to_parent")[0].style.display = "";
  692. $("#div_sort_type_parent_data")[0].style.display = "";
  693. sel = $("#select_mapping_data_for_sort_type")[0];
  694. idx = pre_handle_data_objects.indexOf(preHandleObj.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_DATA_KEY]);
  695. sel.selectedIndex = idx;
  696. me.parentTreeObj = $.fn.zTree.init($("#parent_sorting_keys"), sortingKeysSetting, exposed_properties_arr[idx]);
  697. me.checkupNode(preHandleObj.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_SORT_KEYS], me.parentTreeObj);
  698. idx = pre_handle_data_objects.indexOf(preHandleObj.currentNode[JV.PROP_DATA_KEY]);
  699. me.childTreeObj = $.fn.zTree.init($("#child_sorting_keys"), sortingKeysSetting, exposed_properties_arr[idx]);
  700. me.checkupNode(preHandleObj.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_CHILD_SORT_KEYS], me.childTreeObj);
  701. break;
  702. case 3 :
  703. //self define
  704. $("#div_sort_self_define")[0].style.display = "";
  705. $("#selfDefineSort")[0].value = preHandleObj.currentNode[JV.PROP_SORT_TYPE_SELF_DEFINE_LOGIC];
  706. break;
  707. default:
  708. break;
  709. }
  710. }
  711. },
  712. checkupNode: function(keysArr, treeObj) {
  713. let nodes = treeObj.getNodes();
  714. for (let key of keysArr) {
  715. for (let node of nodes) {
  716. if (node.Key === key) {
  717. treeObj.checkNode(node, true, false, false);
  718. break;
  719. }
  720. }
  721. }
  722. },
  723. onCheck: function(event,treeId,treeNode) {
  724. let me = preHandleSortObj;
  725. if (treeId.indexOf("parent_sorting_keys") >= 0) {
  726. me.resetParentSort();
  727. } else if (treeId.indexOf("child_sorting_keys") >= 0) {
  728. me.resetChildSort();
  729. } else {
  730. me.resetNormalSort();
  731. }
  732. },
  733. onTopBillsNodeCheck: function (event,treeId,treeNode) {
  734. let me = preHandleSortObj;
  735. if (treeNode.checked) {
  736. if (preHandleObj.currentNode[JV.PROP_FILTER_TOP_BILLS_NODES].indexOf(treeNode.Value) < 0) {
  737. preHandleObj.currentNode[JV.PROP_FILTER_TOP_BILLS_NODES].push(treeNode.Value);
  738. }
  739. } else {
  740. let idx = preHandleObj.currentNode[JV.PROP_FILTER_TOP_BILLS_NODES].indexOf(treeNode.Value);
  741. if (idx >= 0) {
  742. preHandleObj.currentNode[JV.PROP_FILTER_TOP_BILLS_NODES].splice(idx, 1);
  743. }
  744. }
  745. },
  746. onOtherBillsNodeCheck: function (event,treeId,treeNode) {
  747. let me = preHandleSortObj;
  748. if (treeNode.checked) {
  749. if (preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES].indexOf(treeNode.Value) < 0) {
  750. preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES].push(treeNode.Value);
  751. }
  752. } else {
  753. let idx = preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES].indexOf(treeNode.Value);
  754. if (idx >= 0) {
  755. preHandleObj.currentNode[JV.PROP_FILTER_OTHER_BILLS_NODES].splice(idx, 1);
  756. }
  757. }
  758. },
  759. resetParentSort: function () {
  760. let me = preHandleSortObj;
  761. let nodes = me.parentTreeObj.getCheckedNodes();
  762. let sortKeys = [];
  763. for (let node of nodes) {
  764. sortKeys.push(node.Key);
  765. }
  766. preHandleObj.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_SORT_KEYS] = sortKeys;
  767. },
  768. resetChildSort: function () {
  769. let me = preHandleSortObj;
  770. let nodes = me.childTreeObj.getCheckedNodes();
  771. let sortKeys = [];
  772. for (let node of nodes) {
  773. sortKeys.push(node.Key);
  774. }
  775. preHandleObj.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_CHILD_SORT_KEYS] = sortKeys;
  776. },
  777. resetNormalSort: function() {
  778. let me = preHandleSortObj;
  779. let nodes = me.normalTreeObj.getCheckedNodes();
  780. let normalSortKeys = [];
  781. for (let node of nodes) {
  782. let keyObj = {key: node.Key, order: node.Order};
  783. normalSortKeys.push(keyObj);
  784. }
  785. preHandleObj.currentNode[JV.PROP_SORT_KEYS] = normalSortKeys;
  786. },
  787. addDiyDom: function(treeId,treeNode) {
  788. let aObj = $("#" + treeNode.tId + IDMark_A);
  789. let editStr = "<select class='selDemo' id='diySelect_" +treeNode.tId+ "'><option value='ascend'>升序 </option><option value='descend'>降序 </option></select>";
  790. aObj.after(editStr);
  791. let sel = $("#diySelect_" + treeNode.tId);
  792. if (sel) {
  793. sel.bind("change", function(){
  794. treeNode.Order = sel[0].value;
  795. preHandleSortObj.resetNormalSort();
  796. });
  797. }
  798. },
  799. onSortTypeChange: function(dom) {
  800. //排序类型的选择/更改
  801. let me = preHandleObj;
  802. me.hide_all_dom();
  803. $("#div_pre_handle_data")[0].style.display = "";
  804. $("#div_sort_type")[0].style.display = "";
  805. let data_dom = $("#select_mapping_data")[0];
  806. if (dom.selectedIndex === 2) {
  807. $("#div_sort_type_according_to_parent")[0].style.display = "";
  808. $("#div_sort_type_parent_data")[0].style.display = "";
  809. preHandleSortObj.parentTreeObj = $.fn.zTree.init($("#parent_sorting_keys"), sortingKeysSetting, exposed_properties_arr[0]);
  810. preHandleSortObj.childTreeObj = $.fn.zTree.init($("#child_sorting_keys"), sortingKeysSetting, exposed_properties_arr[data_dom.selectedIndex]);
  811. me.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY] = {};
  812. me.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_DATA_KEY] = pre_handle_data_objects[0];
  813. me.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_PARENT_SORT_KEYS] = [];
  814. me.currentNode[JV.PROP_PARENT_CHILD_SORT_KEY][JV.PROP_CHILD_SORT_KEYS] = [];
  815. me.currentNode[JV.PROP_OTHER_SUB_SORT] = [];
  816. } else if (dom.selectedIndex === 0) {
  817. $("#div_sort_type_normal")[0].style.display = "";
  818. preHandleSortObj.normalTreeObj = $.fn.zTree.init($("#pre_handle_sort_keys_reversed"), sortingKeysSetting, exposed_properties_arr[data_dom.selectedIndex]);
  819. me.currentNode[JV.PROP_SORT_KEYS] = [];
  820. } else if (dom.selectedIndex === 1) {
  821. $("#div_sort_tree")[0].style.display = "";
  822. preHandleSortObj.normalTreeObj = $.fn.zTree.init($("#bills_top_nodes"), sortingTreeSetting, fixed_top_bills_nodes);
  823. } else {
  824. //自定义
  825. $("#div_sort_self_define")[0].style.display = "";
  826. $("#selfDefineSort")[0].value = "";
  827. me.currentNode[JV.PROP_SORT_TYPE_SELF_DEFINE_LOGIC] = '';
  828. }
  829. me.currentNode[JV.PROP_SORT_TYPE] = dom.value;
  830. },
  831. changeSelfDefineExpression: function (dom) {
  832. let me = preHandleObj;
  833. if (me.currentNode) {
  834. me.currentNode[JV.PROP_SORT_TYPE_SELF_DEFINE_LOGIC] = dom.value;
  835. }
  836. },
  837. extractTabFields: function (handleObj) {
  838. let me = this, rst = {};
  839. rst[JV.PROP_HANDLE_TYPE] = handleObj[JV.PROP_HANDLE_TYPE];
  840. rst[JV.PROP_DATA_KEY] = handleObj[JV.PROP_DATA_KEY];
  841. rst[JV.PROP_SORT_TYPE] = handleObj[JV.PROP_SORT_TYPE];
  842. switch (sort_types.indexOf(handleObj[JV.PROP_SORT_TYPE])) {
  843. case -1:
  844. //unknown!
  845. break;
  846. case 0 :
  847. //normal
  848. rst[JV.PROP_SORT_KEYS] = handleObj[JV.PROP_SORT_KEYS];
  849. break;
  850. case 1 :
  851. //tree
  852. rst[JV.PROP_FILTER_TOP_BILLS_NODES] = handleObj[JV.PROP_FILTER_TOP_BILLS_NODES];
  853. rst[JV.PROP_FILTER_OTHER_BILLS_NODES] = handleObj[JV.PROP_FILTER_OTHER_BILLS_NODES];
  854. break;
  855. case 2 :
  856. //according to parent
  857. rst[JV.PROP_PARENT_CHILD_SORT_KEY] = handleObj[JV.PROP_PARENT_CHILD_SORT_KEY];
  858. rst[JV.PROP_OTHER_SUB_SORT] = [];
  859. if (handleObj.items && handleObj.items.length > 0) {
  860. for (let subSort of handleObj.items) {
  861. let dtlRst = {};
  862. me.copyNode(subSort, dtlRst);
  863. delete dtlRst.Name;
  864. delete dtlRst.PROP_DATA_KEY;
  865. rst[JV.PROP_OTHER_SUB_SORT].push(dtlRst);
  866. dtlRst = null;
  867. }
  868. }
  869. break;
  870. case 3 :
  871. //self define
  872. rst[JV.PROP_SORT_TYPE_SELF_DEFINE_LOGIC] = handleObj[JV.PROP_SORT_TYPE_SELF_DEFINE_LOGIC];
  873. break;
  874. default:
  875. break;
  876. }
  877. return rst;
  878. }
  879. };
  880. let preHandleFilterObj = {
  881. treeObj: null,
  882. copyNode: function (src, dest) {
  883. let me = preHandleFilterObj, keys = [];
  884. for (let filterItem of src[JV.PROP_FILTER_KEYS]) {
  885. let item = {key: filterItem.key};
  886. item[JV.PROP_FILTER_CONDITION] = filterItem[JV.PROP_FILTER_CONDITION];
  887. item[JV.PROP_FILTER_COMPARE_VAL] = filterItem[JV.PROP_FILTER_COMPARE_VAL];
  888. if (filterItem[JV.PROP_FILTER_COMPARE_OBJ]) {
  889. item[JV.PROP_FILTER_COMPARE_OBJ] = filterItem[JV.PROP_FILTER_COMPARE_OBJ];
  890. item[JV.PROP_FILTER_COMPARE_OBJ_KEY] = filterItem[JV.PROP_FILTER_COMPARE_OBJ_KEY];
  891. }
  892. keys.push(item);
  893. }
  894. dest[JV.PROP_HANDLE_TYPE] = src[JV.PROP_HANDLE_TYPE];
  895. dest[JV.PROP_DATA_KEY] = src[JV.PROP_DATA_KEY];
  896. dest[JV.PROP_FILTER_KEYS] = keys;
  897. if (src[JV.PROP_OTHER_SUB_FILTER] && src[JV.PROP_OTHER_SUB_FILTER].length > 0) {
  898. dest.items = [];
  899. for (let subFilter of src[JV.PROP_OTHER_SUB_FILTER]) {
  900. let dtlRst = {Name: "子过滤", Title: ""};
  901. subFilter[JV.PROP_DATA_KEY] = src[JV.PROP_DATA_KEY];
  902. me.copyNode(subFilter, dtlRst);
  903. dtlRst[JV.PROP_HANDLE_TYPE] = src[JV.PROP_HANDLE_TYPE];
  904. dtlRst[JV.PROP_DATA_KEY] = src[JV.PROP_DATA_KEY];
  905. dest.items.push(dtlRst);
  906. }
  907. }
  908. },
  909. refresh_node: function () {
  910. let me = this;
  911. $("#div_filter_type")[0].style.display = "";
  912. if (preHandleObj.currentNode) {
  913. let idx = pre_handle_data_objects.indexOf(preHandleObj.currentNode[JV.PROP_DATA_KEY]);
  914. me.treeObj = $.fn.zTree.init($("#pre_handle_filter_keys_reversed"), filterKeysSetting, exposed_properties_arr[idx]);
  915. let nodes = me.treeObj.getNodes();
  916. for (let filterItem of preHandleObj.currentNode[JV.PROP_FILTER_KEYS]) {
  917. for (let keyNode of nodes) {
  918. if (filterItem.key === keyNode.Key) {
  919. me.treeObj.checkNode(keyNode, true, false, false);
  920. //and then others...
  921. //过滤条件
  922. keyNode[JV.PROP_FILTER_CONDITION] = filterItem[JV.PROP_FILTER_CONDITION];
  923. if (keyNode.isBoolean) {
  924. keyNode[JV.PROP_FILTER_COMPARE_VAL] = filterItem[JV.PROP_FILTER_COMPARE_VAL];
  925. $("#diyCheck_" + keyNode.tId)[0].checked = (keyNode["booleanOptions"].indexOf(filterItem["compareValue"]) === 0);
  926. } else if (keyNode.hasOwnProperty("individualType")) {
  927. $("#diySelect_" + keyNode.tId)[0].selectedIndex = condition_types.indexOf(filterItem[JV.PROP_FILTER_CONDITION]);
  928. //条件值
  929. keyNode[JV.PROP_FILTER_COMPARE_VAL] = filterItem[JV.PROP_FILTER_COMPARE_VAL];
  930. $("#diyInput_" + keyNode.tId)[0].value = filterItem[JV.PROP_FILTER_COMPARE_VAL];
  931. for (let idx = 0; idx < keyNode["individualType"].length; idx++) {
  932. let idType = keyNode["individualType"][idx];
  933. if (idType.Value.toString() === filterItem[JV.PROP_FILTER_COMPARE_VAL].toString()) {
  934. $("#diyDataDetailSelect_" + keyNode.tId)[0].selectedIndex = idx;
  935. break;
  936. }
  937. }
  938. } else {
  939. $("#diySelect_" + keyNode.tId)[0].selectedIndex = condition_types.indexOf(filterItem[JV.PROP_FILTER_CONDITION]);
  940. //条件值
  941. keyNode[JV.PROP_FILTER_COMPARE_VAL] = filterItem[JV.PROP_FILTER_COMPARE_VAL];
  942. $("#diyInput_" + keyNode.tId)[0].value = filterItem[JV.PROP_FILTER_COMPARE_VAL];
  943. //其他关联业务数据对象
  944. if (filterItem[JV.PROP_FILTER_COMPARE_OBJ]) {
  945. let cmpObjDom = $("#diyDataSelect_" + keyNode.tId)[0];
  946. keyNode[JV.PROP_FILTER_COMPARE_OBJ] = filterItem[JV.PROP_FILTER_COMPARE_OBJ];
  947. let idx = pre_handle_data_objects.indexOf(filterItem[JV.PROP_FILTER_COMPARE_OBJ]);
  948. cmpObjDom.selectedIndex = idx + 1;
  949. me.private_setup_compare_obj(cmpObjDom);
  950. let cmpObjIdDom = $("#diyDataDetailSelect_" + keyNode.tId)[0];
  951. for (let i = 0; i < cmpObjIdDom.children.length; i++) {
  952. let option = cmpObjIdDom.children[i];
  953. if (option.value === filterItem[JV.PROP_FILTER_COMPARE_OBJ_KEY]) {
  954. keyNode[JV.PROP_FILTER_COMPARE_OBJ_KEY] = filterItem[JV.PROP_FILTER_COMPARE_OBJ_KEY]
  955. cmpObjIdDom.selectedIndex = i;
  956. break;
  957. }
  958. }
  959. }
  960. }
  961. break;
  962. }
  963. }
  964. }
  965. }
  966. },
  967. onCheck: function(event,treeId,treeNode) {
  968. let me = preHandleFilterObj;
  969. me.resetFilter();
  970. },
  971. resetFilter: function() {
  972. let me = this;
  973. let nodes = me.treeObj.getCheckedNodes();
  974. let normalSortKeys = [];
  975. for (let node of nodes) {
  976. let keyObj = {key: node.Key};
  977. if (!node[JV.PROP_FILTER_CONDITION]) {
  978. node[JV.PROP_FILTER_CONDITION] = "==";
  979. }
  980. keyObj[JV.PROP_FILTER_CONDITION] = node[JV.PROP_FILTER_CONDITION];
  981. keyObj[JV.PROP_FILTER_COMPARE_VAL] = node[JV.PROP_FILTER_COMPARE_VAL];
  982. if (node[JV.PROP_FILTER_COMPARE_OBJ]) {
  983. keyObj[JV.PROP_FILTER_COMPARE_OBJ] = node[JV.PROP_FILTER_COMPARE_OBJ];
  984. keyObj[JV.PROP_FILTER_COMPARE_OBJ_KEY] = node[JV.PROP_FILTER_COMPARE_OBJ_KEY];
  985. }
  986. normalSortKeys.push(keyObj);
  987. }
  988. preHandleObj.currentNode[JV.PROP_FILTER_KEYS] = normalSortKeys;
  989. },
  990. build_filter_handle_data_selection_str: function(treeId,treeNode) {
  991. let rst = [];
  992. rst.push("<select class='selDemo' id='diyDataSelect_" + treeNode.tId + "'>");
  993. rst.push("<option value='empty'>无</option>");
  994. for (let i = 0; i < pre_handle_data_objects.length; i++) {
  995. rst.push("<option value='" + pre_handle_data_objects[i] + "'>" + pre_handle_data_objects_name[i] + "</option>");
  996. }
  997. rst.push("</select>");
  998. return rst.join("");
  999. },
  1000. build_filter_handle_data_detail_selection_str: function(treeId,treeNode) {
  1001. let rst = [];
  1002. rst.push("<select class='selDemo' id='diyDataDetailSelect_" + treeNode.tId + "'>");
  1003. rst.push("</select>");
  1004. return rst.join("");
  1005. },
  1006. build_individual_filter_selection_str: function (individualTypes,treeNode) {
  1007. let rst = [];
  1008. rst.push("<select class='selDemo' id='diyDataDetailSelect_" + treeNode.tId + "'>");
  1009. for (let i = 0; i < individualTypes.length; i++) {
  1010. rst.push("<option value='" + individualTypes[i].Value + "'>" + individualTypes[i].Name + "</option>");
  1011. }
  1012. rst.push("</select>");
  1013. return rst.join("");
  1014. },
  1015. addDiyDom: function(treeId,treeNode) {
  1016. let me = preHandleFilterObj;
  1017. let aObj = $("#" + treeNode.tId + IDMark_A);
  1018. if (treeNode.hasOwnProperty("isBoolean")) {
  1019. let checkStr = "<input type='checkbox' id='diyCheck_" + treeNode.tId + "' />";
  1020. aObj.after(checkStr);
  1021. let sel = $("#diyCheck_" + treeNode.tId);
  1022. if (sel) {
  1023. sel.bind("change", me.filterConditionCheck);
  1024. }
  1025. } else if (treeNode.hasOwnProperty("individualType")) {
  1026. let dataDtlSelStr = me.build_individual_filter_selection_str(treeNode.individualType, treeNode);
  1027. aObj.after(dataDtlSelStr);
  1028. let editStr = "<input type='text' id='diyInput_" + treeNode.tId + "' width='10'/>";
  1029. aObj.after(editStr);
  1030. let selStr = "<select class='selDemo' id='diySelect_" + treeNode.tId + "'><option value='=='>等于</option><option value='==='>全等于</option><option value='>'>大于</option><option value='>='>大于等于</option><option value='<'>小于</option><option value='<='>小于等于</option><option value='!='>不等于</option><option value='in'>在</option><option value='not in'>不在</option></select>";
  1031. aObj.after(selStr);
  1032. let sel = $("#diySelect_" + treeNode.tId);
  1033. if (sel) {
  1034. sel.bind("change", me.filterConditionChange);
  1035. }
  1036. sel = $("#diyInput_" + treeNode.tId);
  1037. if (sel) {
  1038. sel.bind("change", me.filterCompareValChange);
  1039. }
  1040. sel = $("#diyDataDetailSelect_" + treeNode.tId);
  1041. if (sel) {
  1042. sel.bind("change", me.filterIndividualCompareObjKeyChange);
  1043. }
  1044. } else {
  1045. //注意:这是后面的DOM先生成
  1046. let dataDtlSelStr = me.build_filter_handle_data_detail_selection_str(treeId,treeNode);
  1047. aObj.after(dataDtlSelStr);
  1048. let dataSelStr = me.build_filter_handle_data_selection_str(treeId,treeNode);
  1049. aObj.after(dataSelStr);
  1050. let editStr = "<input type='text' id='diyInput_" + treeNode.tId + "' width='10'/>";
  1051. aObj.after(editStr);
  1052. let selStr = "<select class='selDemo' id='diySelect_" + treeNode.tId + "'><option value='=='>等于</option><option value='==='>全等于</option><option value='>'>大于</option><option value='>='>大于等于</option><option value='<'>小于</option><option value='<='>小于等于</option><option value='!='>不等于</option><option value='in'>在</option><option value='not in'>不在</option></select>";
  1053. aObj.after(selStr);
  1054. let sel = $("#diySelect_" + treeNode.tId);
  1055. if (sel) {
  1056. sel.bind("change", me.filterConditionChange);
  1057. }
  1058. sel = $("#diyInput_" + treeNode.tId);
  1059. if (sel) {
  1060. sel.bind("change", me.filterCompareValChange);
  1061. }
  1062. sel = $("#diyDataSelect_" + treeNode.tId);
  1063. if (sel) {
  1064. sel.bind("change", me.filterCompareObjChange);
  1065. }
  1066. sel = $("#diyDataDetailSelect_" + treeNode.tId);
  1067. if (sel) {
  1068. sel.bind("change", me.filterCompareObjKeyChange);
  1069. }
  1070. }
  1071. },
  1072. filterCompareValChange(event) {
  1073. let me = preHandleFilterObj, sel = event.currentTarget, tId = sel.id.slice(9);
  1074. let node = me.treeObj.getNodeByTId(tId);
  1075. node[JV.PROP_FILTER_COMPARE_VAL] = sel.value;
  1076. me.resetFilter();
  1077. },
  1078. filterConditionCheck: function (event) {
  1079. let me = preHandleFilterObj, sel = event.currentTarget, tId = sel.id.slice(9);
  1080. let node = me.treeObj.getNodeByTId(tId);
  1081. node[JV.PROP_FILTER_CONDITION] = "===";
  1082. if (sel.checked === true) {
  1083. node[JV.PROP_FILTER_COMPARE_VAL] = node.booleanOptions[0];
  1084. } else {
  1085. node[JV.PROP_FILTER_COMPARE_VAL] = node.booleanOptions[1];
  1086. }
  1087. //注:这里虽然是boolean选项,但实际有可能是0,1的选择(非true,false),所以需要设置node节点的booleanOptions
  1088. me.resetFilter();
  1089. },
  1090. filterConditionChange: function(event) {
  1091. let me = preHandleFilterObj, sel = event.currentTarget, tId = sel.id.slice(10);
  1092. let node = me.treeObj.getNodeByTId(tId);
  1093. node[JV.PROP_FILTER_CONDITION] = sel.value;
  1094. me.resetFilter();
  1095. },
  1096. private_setup_compare_obj: function(dom) {
  1097. let me = this, sel = dom, tId = sel.id.slice(14);
  1098. let node = me.treeObj.getNodeByTId(tId);
  1099. node[JV.PROP_FILTER_COMPARE_OBJ] = sel.value;
  1100. let idx = pre_handle_data_objects.indexOf(sel.value);
  1101. let dtlKey = "diyDataDetailSelect_" + tId;
  1102. let dtlSel = document.getElementById(dtlKey);
  1103. dtlSel.length = 0;
  1104. if (idx >= 0) {
  1105. let jdtlSel = $("#" + dtlKey);
  1106. for (let item of exposed_properties_arr[idx]) {
  1107. jdtlSel.append("<option value='" + item.Key + "'>" + item.Name + "</option>");
  1108. }
  1109. } else {
  1110. //清除所有key选项
  1111. node[JV.PROP_FILTER_COMPARE_OBJ_KEY] = null;
  1112. }
  1113. },
  1114. filterCompareObjChange: function(event) {
  1115. let me = preHandleFilterObj, sel = event.currentTarget;
  1116. me.private_setup_compare_obj(sel);
  1117. me.resetFilter();
  1118. },
  1119. filterIndividualCompareObjKeyChange: function(event) {
  1120. let me = preHandleFilterObj, sel = event.currentTarget, tId = sel.id.slice(20);
  1121. let inTxt = $("#diyInput_" + tId);
  1122. if (inTxt) {
  1123. inTxt[0].value = sel.value;
  1124. }
  1125. let node = me.treeObj.getNodeByTId(tId);
  1126. node[JV.PROP_FILTER_COMPARE_VAL] = sel.value;
  1127. me.resetFilter();
  1128. },
  1129. filterCompareObjKeyChange: function(event) {
  1130. let me = preHandleFilterObj, sel = event.currentTarget, tId = sel.id.slice(20);
  1131. let node = me.treeObj.getNodeByTId(tId);
  1132. node[JV.PROP_FILTER_COMPARE_OBJ_KEY] = sel.value;
  1133. me.resetFilter();
  1134. },
  1135. extractTabFields: function (handleObj) {
  1136. let me = preHandleFilterObj, rst = {};
  1137. me.copyNode(handleObj, rst);
  1138. rst[JV.PROP_OTHER_SUB_FILTER] = [];
  1139. let private_extract_other_sub_filter = function (parentFilter, currentFilterNode) {
  1140. let dtlRst = {};
  1141. me.copyNode(currentFilterNode, dtlRst);
  1142. parentFilter[JV.PROP_OTHER_SUB_FILTER].push(dtlRst);
  1143. if (currentFilterNode.items && currentFilterNode.items.length > 0) {
  1144. dtlRst[JV.PROP_OTHER_SUB_FILTER] = [];
  1145. for (let subFilterNode of currentFilterNode.items) {
  1146. private_extract_other_sub_filter(dtlRst, subFilterNode);
  1147. }
  1148. }
  1149. delete dtlRst.Name;
  1150. delete dtlRst[JV.PROP_DATA_KEY];
  1151. dtlRst = null;
  1152. };
  1153. if (handleObj.items && handleObj.items.length > 0) {
  1154. for (let subFilter of handleObj.items) {
  1155. private_extract_other_sub_filter(rst, subFilter);
  1156. }
  1157. }
  1158. return rst;
  1159. }
  1160. };
  1161. let preHandleBillDataMoveObj = {
  1162. copyNode: function (src, dest) {
  1163. dest[JV.PROP_HANDLE_TYPE] = src[JV.PROP_HANDLE_TYPE];
  1164. dest[JV.PROP_DATA_KEY] = src[JV.PROP_DATA_KEY];
  1165. },
  1166. refresh_node: function () {
  1167. $("#div_bills_data_move_type")[0].style.display = "";
  1168. if (preHandleObj.currentNode) {
  1169. }
  1170. },
  1171. extractTabFields: function (handleObj) {
  1172. let me = preHandleBillDataMoveObj, rst = {};
  1173. me.copyNode(handleObj, rst);
  1174. return rst;
  1175. }
  1176. };
  1177. let preHandleSummaryObj = {
  1178. copyNode: function (src, dest) {
  1179. //
  1180. },
  1181. refresh_node: function () {
  1182. $("#div_summary_type")[0].style.display = "";
  1183. if (preHandleObj.currentNode) {
  1184. }
  1185. },
  1186. extractTabFields: function (handleObj) {
  1187. let rst = {};
  1188. //
  1189. return rst;
  1190. }
  1191. };
  1192. let preHandleAdjustObj = {
  1193. copyNode: function (src, dest) {
  1194. //
  1195. },
  1196. refresh_node: function () {
  1197. $("#div_adjust_type")[0].style.display = "";
  1198. if (preHandleObj.currentNode) {
  1199. }
  1200. },
  1201. extractTabFields: function (handleObj) {
  1202. let rst = {};
  1203. //
  1204. return rst;
  1205. }
  1206. };
  1207. let preHandleAddDummyObj = {
  1208. copyNode: function (src, dest) {
  1209. //
  1210. },
  1211. refresh_node: function () {
  1212. $("#div_add_dummy_type")[0].style.display = "";
  1213. if (preHandleObj.currentNode) {
  1214. }
  1215. },
  1216. extractTabFields: function (handleObj) {
  1217. let rst = {};
  1218. //
  1219. return rst;
  1220. }
  1221. };