web.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. 'use strict';
  2. /**
  3. * 前端所需js
  4. *
  5. * {String} webPath: 记录 合并压缩后的 文件存放的路径
  6. * {String[]} commonFiles: 所有页面通用的js包文件
  7. * {Object} controller: 根据controller和action来区分不同的页面数据
  8. * - files: 当前页面所需的js包文件
  9. * - mergeFiles: 当前页面所需 合并压缩的 js文件
  10. * - mergeFile: 合并压缩后 生成的js文件名
  11. *
  12. * 在app中运行合并压缩代码,运行后数据为app.jsFiles,示例(ledger)如下:
  13. * app.jsFiles = {
  14. * common: String[]
  15. * controller1: {
  16. * action1: String[]
  17. * action2: String[]
  18. * }
  19. * }
  20. *
  21. * 在Controller中使用时,需添加到renderData.jsFiles中,并调用Layout方法
  22. * 没有该值时,Layout方法会自动加载app.jsFiles.common
  23. * 有该值时,例如台账审核页面,renderData.jsFiles = app.jsFiles.ledger.audit = ['/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js', '/public/js/web/ledger_audit.min.1.0.0.js']
  24. * 则layout方法会同时加载app.jsFiles.common与renderData.jsFiles
  25. * 加载位置为head
  26. *
  27. * 如果页面无需合并压缩js文件,可以直接添加到JsFiles.controller.controller1.action1.files,也可以直接添加到调用的ejs模板中
  28. *
  29. * @author Mai
  30. * @date 2019/1/10
  31. * @version
  32. */
  33. const JsFiles = {
  34. webPath: "/public/js/web/",
  35. commonFiles: [
  36. "/public/js/jquery/jquery-3.2.1.min.js",
  37. "/public/js/jquery/jquery-ui.js",
  38. "/public/js/jquery/jquery.validate.js",
  39. "/public/js/messages_zh.js",
  40. "/public/js/popper/popper.min.js",
  41. "/public/js/bootstrap/bootstrap.min.js",
  42. "/public/js/vue/vue.js",
  43. "/public/js/component/input.js",
  44. "/public/js/cookies.js",
  45. "/public/js/jquery-contextmenu/jquery.ui.position.min.js",
  46. "/public/js/jquery-contextmenu/jquery.contextMenu.min.js",
  47. "/public/js/lodash.js",
  48. "/public/js/lz-string/lz-string.js",
  49. "/public/js/number-precision.js",
  50. "/public/js/toastr.min.js",
  51. "/public/js/global.js",
  52. ],
  53. controller: {
  54. tender: {
  55. list: {
  56. files: [
  57. "/public/js/ztree/jquery.ztree.core.js",
  58. "/public/js/ztree/jquery.ztree.exedit.js",
  59. "/public/js/decimal.min.js",
  60. ],
  61. mergeFiles: [
  62. "/public/js/zh_calc.js",
  63. "/public/js/tender_list.js"
  64. ],
  65. mergeFile: 'tender_list',
  66. },
  67. progress: {
  68. files: [
  69. "/public/js/ztree/jquery.ztree.core.js",
  70. "/public/js/ztree/jquery.ztree.exedit.js",
  71. "/public/js/decimal.min.js",
  72. ],
  73. mergeFiles: [
  74. "/public/js/zh_calc.js",
  75. "/public/js/tender_list_progress.js"
  76. ],
  77. mergeFile: 'tender_list_progress',
  78. },
  79. manage: {
  80. files: [
  81. "/public/js/ztree/jquery.ztree.core.js",
  82. "/public/js/ztree/jquery.ztree.exedit.js",
  83. "/public/js/moment/moment.min.js",
  84. "/public/js/decimal.min.js",
  85. ],
  86. mergeFiles: [
  87. "/public/js/zh_calc.js",
  88. "/public/js/tender_list_manage.js",
  89. ],
  90. mergeFile: 'tender_list_manage',
  91. },
  92. info: {
  93. files: [
  94. "/public/js/echarts/echarts.min.js",
  95. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  96. ],
  97. mergeFiles: [
  98. "/public/js/spreadjs_rela/spreadjs_zh.js",
  99. "/public/js/change_calculation.js",
  100. "/public/js/tender.js",
  101. ],
  102. mergeFile: 'tender',
  103. }
  104. },
  105. ledger: {
  106. explode: {
  107. files: [
  108. "/public/js/js-xlsx/xlsx.full.min.js",
  109. "/public/js/js-xlsx/xlsx.utils.js",
  110. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  111. "/public/js/decimal.min.js",
  112. "/public/js/math.min.js",
  113. ],
  114. mergeFiles: [
  115. "/public/js/sub_menu.js",
  116. "/public/js/div_resizer.js",
  117. "/public/js/spreadjs_rela/spreadjs_zh.js",
  118. "/public/js/ledger_search.js",
  119. "/public/js/zh_calc.js",
  120. "/public/js/path_tree.js",
  121. "/public/js/ledger_tree_col.js",
  122. "/public/js/ledger.js",
  123. ],
  124. mergeFile: 'explode',
  125. },
  126. audit: {
  127. files: [
  128. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  129. "/public/js/decimal.min.js",
  130. ],
  131. mergeFiles: [
  132. "/public/js/sub_menu.js",
  133. "/public/js/div_resizer.js",
  134. "/public/js/spreadjs_rela/spreadjs_zh.js",
  135. "/public/js/ledger_search.js",
  136. "/public/js/zh_calc.js",
  137. "/public/js/path_tree.js",
  138. "/public/js/ledger_audit.js",
  139. ],
  140. mergeFile: 'ledger_audit',
  141. },
  142. revise: {
  143. files: [
  144. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  145. "/public/js/decimal.min.js",
  146. ],
  147. mergeFiles: [
  148. "/public/js/sub_menu.js",
  149. "/public/js/div_resizer.js",
  150. "/public/js/spreadjs_rela/spreadjs_zh.js",
  151. "/public/js/ledger_search.js",
  152. "/public/js/zh_calc.js",
  153. "/public/js/path_tree.js",
  154. "/public/js/revise.js",
  155. ],
  156. mergeFile: 'revise',
  157. }
  158. },
  159. revise: {
  160. info: {
  161. files: [
  162. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  163. "/public/js/decimal.min.js",
  164. "/public/js/math.min.js",
  165. ],
  166. mergeFiles: [
  167. "/public/js/sub_menu.js",
  168. "/public/js/div_resizer.js",
  169. "/public/js/spreadjs_rela/spreadjs_zh.js",
  170. "/public/js/ledger_search.js",
  171. "/public/js/zh_calc.js",
  172. "/public/js/path_tree.js",
  173. "/public/js/revise.js",
  174. ],
  175. mergeFile: 'revise',
  176. },
  177. history: {
  178. files: [
  179. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  180. "/public/js/decimal.min.js",
  181. ],
  182. mergeFiles: [
  183. "/public/js/sub_menu.js",
  184. "/public/js/div_resizer.js",
  185. "/public/js/spreadjs_rela/spreadjs_zh.js",
  186. "/public/js/ledger_search.js",
  187. "/public/js/zh_calc.js",
  188. "/public/js/path_tree.js",
  189. "/public/js/revise_history.js",
  190. ],
  191. mergeFile: 'revise_history',
  192. }
  193. },
  194. stage: {
  195. // 本期计量台账
  196. index: {
  197. files: [
  198. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  199. "/public/js/decimal.min.js",
  200. "/public/js/math.min.js",
  201. ],
  202. mergeFiles: [
  203. "/public/js/sub_menu.js",
  204. "/public/js/div_resizer.js",
  205. "/public/js/spreadjs_rela/spreadjs_zh.js",
  206. "/public/js/zh_calc.js",
  207. "/public/js/path_tree.js",
  208. "/public/js/stage.js",
  209. "/public/js/stage_audit.js",
  210. ],
  211. mergeFile: 'stage',
  212. },
  213. detail: {
  214. files: [
  215. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  216. "/public/js/decimal.min.js",
  217. "/public/js/html2canvas/html2canvas.min.js",
  218. "/public/js/html2canvas/canvas2image.js",
  219. ],
  220. mergeFiles: [
  221. "/public/js/sub_menu.js",
  222. "/public/js/spreadjs_rela/spreadjs_zh.js",
  223. "/public/js/zh_calc.js",
  224. "/public/js/path_tree.js",
  225. "/public/js/stage_im.js",
  226. "/public/js/stage_detail.js",
  227. "/public/js/stage_audit.js",
  228. ],
  229. mergeFile: 'stage_detail',
  230. },
  231. pay: {
  232. files: [
  233. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  234. ],
  235. mergeFiles: [
  236. "/public/js/sub_menu.js",
  237. "/public/js/spreadjs_rela/spreadjs_zh.js",
  238. "/public/js/stage_pay.js",
  239. "/public/js/stage_audit.js",
  240. ],
  241. mergeFile: 'stage_pay',
  242. },
  243. change: {
  244. files: [
  245. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  246. "/public/js/decimal.min.js",
  247. ],
  248. mergeFiles: [
  249. "/public/js/sub_menu.js",
  250. "/public/js/div_resizer.js",
  251. "/public/js/spreadjs_rela/spreadjs_zh.js",
  252. "/public/js/zh_calc.js",
  253. "/public/js/path_tree.js",
  254. "/public/js/stage_change.js",
  255. "/public/js/stage_audit.js",
  256. ],
  257. mergeFile: 'stage_change',
  258. },
  259. gather: {
  260. files: [
  261. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  262. "/public/js/decimal.min.js",
  263. ],
  264. mergeFiles: [
  265. "/public/js/sub_menu.js",
  266. "/public/js/div_resizer.js",
  267. "/public/js/spreadjs_rela/spreadjs_zh.js",
  268. "/public/js/zh_calc.js",
  269. "/public/js/path_tree.js",
  270. "/public/js/gcl_gather.js",
  271. "/public/js/stage_gather.js",
  272. "/public/js/stage_audit.js",
  273. ],
  274. mergeFile: 'stage_gather',
  275. },
  276. compare: {
  277. files: [
  278. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  279. "/public/js/decimal.min.js",
  280. ],
  281. mergeFiles: [
  282. "/public/js/sub_menu.js",
  283. "/public/js/div_resizer.js",
  284. "/public/js/spreadjs_rela/spreadjs_zh.js",
  285. "/public/js/zh_calc.js",
  286. "/public/js/path_tree.js",
  287. "/public/js/stage_compare.js",
  288. "/public/js/stage_audit.js",
  289. ],
  290. mergeFile: 'stage_compare',
  291. }
  292. },
  293. measure: {
  294. compare: {
  295. files: [
  296. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  297. "/public/js/decimal.min.js",
  298. ],
  299. mergeFiles: [
  300. "/public/js/sub_menu.js",
  301. "/public/js/div_resizer.js",
  302. "/public/js/spreadjs_rela/spreadjs_zh.js",
  303. "/public/js/zh_calc.js",
  304. "/public/js/path_tree.js",
  305. "/public/js/measure_compare.js"
  306. ],
  307. mergeFile: 'measure_compare',
  308. }
  309. },
  310. material: {
  311. info: {
  312. files: [
  313. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  314. "/public/js/decimal.min.js",
  315. "/public/js/toastr.min.js",
  316. ],
  317. mergeFiles: [
  318. "/public/js/sub_menu.js",
  319. "/public/js/div_resizer.js",
  320. "/public/js/spreadjs_rela/spreadjs_zh.js",
  321. "/public/js/zh_calc.js",
  322. "/public/js/path_tree.js",
  323. "/public/js/material.js",
  324. "/public/js/material_audit.js",
  325. ],
  326. mergeFile: 'material',
  327. },
  328. list: {
  329. files: [
  330. "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
  331. "/public/js/decimal.min.js",
  332. "/public/js/toastr.min.js",
  333. ],
  334. mergeFiles: [
  335. "/public/js/sub_menu.js",
  336. "/public/js/div_resizer.js",
  337. "/public/js/spreadjs_rela/spreadjs_zh.js",
  338. "/public/js/zh_calc.js",
  339. "/public/js/path_tree.js",
  340. "/public/js/gcl_gather.js",
  341. "/public/js/material_list.js",
  342. "/public/js/material_audit.js",
  343. ],
  344. mergeFile: 'material_list',
  345. },
  346. },
  347. }
  348. };
  349. module.exports = JsFiles;