template_param.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. 'use strict';
  2. /**
  3. *
  4. *
  5. * @author Mai
  6. * @date 2018/4/24
  7. * @version
  8. */
  9. // 参数绑定类别
  10. const matchType = {
  11. fixed_id: 1,
  12. node_default: 2,
  13. properties: 3,
  14. code: 4,
  15. non_match: 5,
  16. }
  17. const matchTypeStr = [];
  18. matchTypeStr[matchType.fixed_id] = '全局匹配参数';
  19. matchTypeStr[matchType.node_default] = '节点默认参数';
  20. matchTypeStr[matchType.properties] = '属性匹配参数';
  21. matchTypeStr[matchType.code] = '编号匹配参数';
  22. matchTypeStr[matchType.non_match] = '非匹配参数';
  23. const validMatchType = [matchType.properties, matchType.code, matchType.non_match];
  24. const validProperties = {
  25. loadLength: 'loadLength',
  26. loadWidth: 'loadWidth'
  27. }
  28. // 参数取值
  29. const matchNum = {
  30. total_price: 1,
  31. dgn_quantity1: 2,
  32. dgn_quantity2: 3,
  33. quantity: 4,
  34. };
  35. const matchNumStr = [];
  36. matchNumStr[matchNum.total_price] = '合价';
  37. matchNumStr[matchNum.dgn_quantity1] = '设计数量1';
  38. matchNumStr[matchNum.dgn_quantity2] = '设计数量2';
  39. matchNumStr[matchNum.quantity] = '清单数量';
  40. const globalParamNodeId = 0;
  41. // 默认全局参数
  42. const defaultGlobalParams = [
  43. {
  44. template_id: 1,
  45. node_id: 0,
  46. param_id: 1,
  47. code: 'g_a',
  48. name: '公路基本造价',
  49. match_type: matchType.fixed_id,
  50. match_key: '10',
  51. match_num: matchNum.total_price,
  52. },{
  53. template_id: 1,
  54. node_id: 0,
  55. param_id: 2,
  56. code: 'g_b',
  57. name: '建安费',
  58. match_type: matchType.fixed_id,
  59. match_key: '1',
  60. match_num: matchNum.total_price,
  61. },{
  62. template_id: 1,
  63. node_id: 0,
  64. param_id: 3,
  65. code: 'g_c',
  66. name: '工程建设其他费用',
  67. match_type: matchType.fixed_id,
  68. match_key: '3',
  69. match_num: matchNum.total_price,
  70. },{
  71. template_id: 1,
  72. node_id: 0,
  73. param_id: 4,
  74. code: 'g_d',
  75. name: '路线总长度',
  76. match_type: matchType.fixed_id,
  77. match_key: '1',
  78. matchNum: matchNum.dgn_quantity1,
  79. },{
  80. template_id: 1,
  81. node_id: 0,
  82. param_id: 5,
  83. code: 'g_e',
  84. name: '建筑总面积',
  85. match_type: matchType.non_match,
  86. },{
  87. template_id: 1,
  88. node_id: 0,
  89. param_id: 6,
  90. code: 'g_f',
  91. name: '路基长度',
  92. match_type: matchType.code,
  93. match_key: '1-2',
  94. match_num: matchNum.dgn_quantity1,
  95. }, {
  96. template_id: 1,
  97. node_id: 0,
  98. param_id: 6,
  99. code: 'g_g',
  100. name: '桥梁建筑面积',
  101. match_type: matchType.non_match,
  102. },{
  103. template_id: 1,
  104. node_id: 0,
  105. param_id: 6,
  106. code: 'g_h',
  107. name: '桥梁长度(含互通主线)',
  108. match_type: matchType.code,
  109. match_key: '1-4',
  110. match_num: matchNum.dgn_quantity1,
  111. }, {
  112. template_id: 1,
  113. node_id: 0,
  114. param_id: 6,
  115. code: 'g_i',
  116. name: '路面铺装体积',
  117. match_type: matchType.non_match,
  118. }, {
  119. template_id: 1,
  120. node_id: 0,
  121. param_id: 6,
  122. code: 'g_j',
  123. name: '桥梁建筑面积',
  124. match_type: matchType.non_match,
  125. }, {
  126. template_id: 1,
  127. node_id: 0,
  128. param_id: 6,
  129. code: 'g_k',
  130. name: '桥梁用筋重量',
  131. match_type: matchType.non_match,
  132. }, {
  133. template_id: 1,
  134. node_id: 0,
  135. param_id: 6,
  136. code: 'g_l',
  137. name: '桥梁混凝土体积',
  138. match_type: matchType.non_match,
  139. }, {
  140. template_id: 1,
  141. node_id: 0,
  142. param_id: 6,
  143. code: 'g_m',
  144. name: '交叉工程总占地面积',
  145. match_type: matchType.non_match,
  146. }, {
  147. template_id: 1,
  148. node_id: 0,
  149. param_id: 6,
  150. code: 'g_n',
  151. name: '隧道长度',
  152. match_type: matchType.code,
  153. match_key: '1-6',
  154. match_num: matchNum.dgn_quantity1,
  155. }, {
  156. template_id: 1,
  157. node_id: 0,
  158. param_id: 6,
  159. code: 'g_o',
  160. name: '隧道建筑面积',
  161. match_type: matchType.non_match,
  162. }, {
  163. template_id: 1,
  164. node_id: 0,
  165. param_id: 6,
  166. code: 'g_p',
  167. name: '房建总占地面积',
  168. match_type: matchType.code,
  169. match_key: '1-9',
  170. match_num: matchNum.dgn_quantity1,
  171. }, {
  172. template_id: 1,
  173. node_id: 0,
  174. param_id: 6,
  175. code: 'g_q',
  176. name: '房建处数',
  177. match_type: matchType.non_match,
  178. }, {
  179. template_id: 1,
  180. node_id: 0,
  181. param_id: 6,
  182. code: 'g_r',
  183. name: '计划工期',
  184. match_type: matchType.non_match,
  185. },
  186. ];
  187. // 默认节点参数
  188. const defaultNodeParams = [
  189. {
  190. template_id: 1,
  191. param_id: 1,
  192. code: 'a',
  193. name: '本项合价',
  194. match_type: matchType.node_default,
  195. match_num: matchNum.total_price,
  196. }, {
  197. template_id: 1,
  198. param_id: 2,
  199. code: 'b',
  200. name: '本项数量1',
  201. match_type: matchType.node_default,
  202. match_num: matchNum.dgn_quantity1,
  203. }, {
  204. template_id: 1,
  205. param_id: 3,
  206. code: 'c',
  207. name: '本项数量2',
  208. match_type: matchType.node_default,
  209. match_num: matchNum.dgn_quantity2,
  210. }, {
  211. template_id: 1,
  212. param_id: 4,
  213. code: 'd',
  214. name: '本项清单数量',
  215. match_type: matchType.node_default,
  216. match_num: matchNum.quantity,
  217. }
  218. ];
  219. module.exports = {
  220. matchType,
  221. matchTypeStr,
  222. validMatchType,
  223. validProperties,
  224. matchNum,
  225. matchNumStr,
  226. globalParamNodeId,
  227. defaultGlobalParams,
  228. defaultNodeParams
  229. }