sys-menu.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  1. // 生成数据列表
  2. var dataList = [
  3. {
  4. 'menuId': 1,
  5. 'parentId': 0,
  6. 'parentName': null,
  7. 'name': '系统管理',
  8. 'url': null,
  9. 'perms': null,
  10. 'type': 0,
  11. 'icon': 'system',
  12. 'orderNum': 0,
  13. 'open': null,
  14. 'list': null
  15. },
  16. {
  17. 'menuId': 2,
  18. 'parentId': 1,
  19. 'parentName': '系统管理',
  20. 'name': '管理员列表',
  21. 'url': 'sys/user',
  22. 'perms': null,
  23. 'type': 1,
  24. 'icon': 'admin',
  25. 'orderNum': 1,
  26. 'open': null,
  27. 'list': null
  28. },
  29. {
  30. 'menuId': 3,
  31. 'parentId': 1,
  32. 'parentName': '系统管理',
  33. 'name': '角色管理',
  34. 'url': 'sys/role',
  35. 'perms': null,
  36. 'type': 1,
  37. 'icon': 'role',
  38. 'orderNum': 2,
  39. 'open': null,
  40. 'list': null
  41. },
  42. {
  43. 'menuId': 4,
  44. 'parentId': 1,
  45. 'parentName': '系统管理',
  46. 'name': '菜单管理',
  47. 'url': 'sys/menu',
  48. 'perms': null,
  49. 'type': 1,
  50. 'icon': 'menu',
  51. 'orderNum': 3,
  52. 'open': null,
  53. 'list': null
  54. },
  55. {
  56. 'menuId': 5,
  57. 'parentId': 1,
  58. 'parentName': '系统管理',
  59. 'name': 'SQL监控',
  60. 'url': 'http://localhost:8080/druid/sql.html',
  61. 'perms': null,
  62. 'type': 1,
  63. 'icon': 'sql',
  64. 'orderNum': 4,
  65. 'open': null,
  66. 'list': null
  67. },
  68. {
  69. 'menuId': 6,
  70. 'parentId': 1,
  71. 'parentName': '系统管理',
  72. 'name': '定时任务',
  73. 'url': 'job/schedule',
  74. 'perms': null,
  75. 'type': 1,
  76. 'icon': 'job',
  77. 'orderNum': 5,
  78. 'open': null,
  79. 'list': null
  80. },
  81. {
  82. 'menuId': 7,
  83. 'parentId': 6,
  84. 'parentName': '定时任务',
  85. 'name': '查看',
  86. 'url': null,
  87. 'perms': 'sys:schedule:list,sys:schedule:info',
  88. 'type': 2,
  89. 'icon': null,
  90. 'orderNum': 0,
  91. 'open': null,
  92. 'list': null
  93. },
  94. {
  95. 'menuId': 8,
  96. 'parentId': 6,
  97. 'parentName': '定时任务',
  98. 'name': '新增',
  99. 'url': null,
  100. 'perms': 'sys:schedule:save',
  101. 'type': 2,
  102. 'icon': null,
  103. 'orderNum': 0,
  104. 'open': null,
  105. 'list': null
  106. },
  107. {
  108. 'menuId': 9,
  109. 'parentId': 6,
  110. 'parentName': '定时任务',
  111. 'name': '修改',
  112. 'url': null,
  113. 'perms': 'sys:schedule:update',
  114. 'type': 2,
  115. 'icon': null,
  116. 'orderNum': 0,
  117. 'open': null,
  118. 'list': null
  119. },
  120. {
  121. 'menuId': 10,
  122. 'parentId': 6,
  123. 'parentName': '定时任务',
  124. 'name': '删除',
  125. 'url': null,
  126. 'perms': 'sys:schedule:delete',
  127. 'type': 2,
  128. 'icon': null,
  129. 'orderNum': 0,
  130. 'open': null,
  131. 'list': null
  132. },
  133. {
  134. 'menuId': 11,
  135. 'parentId': 6,
  136. 'parentName': '定时任务',
  137. 'name': '暂停',
  138. 'url': null,
  139. 'perms': 'sys:schedule:pause',
  140. 'type': 2,
  141. 'icon': null,
  142. 'orderNum': 0,
  143. 'open': null,
  144. 'list': null
  145. },
  146. {
  147. 'menuId': 12,
  148. 'parentId': 6,
  149. 'parentName': '定时任务',
  150. 'name': '恢复',
  151. 'url': null,
  152. 'perms': 'sys:schedule:resume',
  153. 'type': 2,
  154. 'icon': null,
  155. 'orderNum': 0,
  156. 'open': null,
  157. 'list': null
  158. },
  159. {
  160. 'menuId': 13,
  161. 'parentId': 6,
  162. 'parentName': '定时任务',
  163. 'name': '立即执行',
  164. 'url': null,
  165. 'perms': 'sys:schedule:run',
  166. 'type': 2,
  167. 'icon': null,
  168. 'orderNum': 0,
  169. 'open': null,
  170. 'list': null
  171. },
  172. {
  173. 'menuId': 14,
  174. 'parentId': 6,
  175. 'parentName': '定时任务',
  176. 'name': '日志列表',
  177. 'url': null,
  178. 'perms': 'sys:schedule:log',
  179. 'type': 2,
  180. 'icon': null,
  181. 'orderNum': 0,
  182. 'open': null,
  183. 'list': null
  184. },
  185. {
  186. 'menuId': 15,
  187. 'parentId': 2,
  188. 'parentName': '管理员列表',
  189. 'name': '查看',
  190. 'url': null,
  191. 'perms': 'sys:user:list,sys:user:info',
  192. 'type': 2,
  193. 'icon': null,
  194. 'orderNum': 0,
  195. 'open': null,
  196. 'list': null
  197. },
  198. {
  199. 'menuId': 16,
  200. 'parentId': 2,
  201. 'parentName': '管理员列表',
  202. 'name': '新增',
  203. 'url': null,
  204. 'perms': 'sys:user:save,sys:role:select',
  205. 'type': 2,
  206. 'icon': null,
  207. 'orderNum': 0,
  208. 'open': null,
  209. 'list': null
  210. },
  211. {
  212. 'menuId': 17,
  213. 'parentId': 2,
  214. 'parentName': '管理员列表',
  215. 'name': '修改',
  216. 'url': null,
  217. 'perms': 'sys:user:update,sys:role:select',
  218. 'type': 2,
  219. 'icon': null,
  220. 'orderNum': 0,
  221. 'open': null,
  222. 'list': null
  223. },
  224. {
  225. 'menuId': 18,
  226. 'parentId': 2,
  227. 'parentName': '管理员列表',
  228. 'name': '删除',
  229. 'url': null,
  230. 'perms': 'sys:user:delete',
  231. 'type': 2,
  232. 'icon': null,
  233. 'orderNum': 0,
  234. 'open': null,
  235. 'list': null
  236. },
  237. {
  238. 'menuId': 19,
  239. 'parentId': 3,
  240. 'parentName': '角色管理',
  241. 'name': '查看',
  242. 'url': null,
  243. 'perms': 'sys:role:list,sys:role:info',
  244. 'type': 2,
  245. 'icon': null,
  246. 'orderNum': 0,
  247. 'open': null,
  248. 'list': null
  249. },
  250. {
  251. 'menuId': 20,
  252. 'parentId': 3,
  253. 'parentName': '角色管理',
  254. 'name': '新增',
  255. 'url': null,
  256. 'perms': 'sys:role:save,sys:menu:list',
  257. 'type': 2,
  258. 'icon': null,
  259. 'orderNum': 0,
  260. 'open': null,
  261. 'list': null
  262. },
  263. {
  264. 'menuId': 21,
  265. 'parentId': 3,
  266. 'parentName': '角色管理',
  267. 'name': '修改',
  268. 'url': null,
  269. 'perms': 'sys:role:update,sys:menu:list',
  270. 'type': 2,
  271. 'icon': null,
  272. 'orderNum': 0,
  273. 'open': null,
  274. 'list': null
  275. },
  276. {
  277. 'menuId': 22,
  278. 'parentId': 3,
  279. 'parentName': '角色管理',
  280. 'name': '删除',
  281. 'url': null,
  282. 'perms': 'sys:role:delete',
  283. 'type': 2,
  284. 'icon': null,
  285. 'orderNum': 0,
  286. 'open': null,
  287. 'list': null
  288. },
  289. {
  290. 'menuId': 23,
  291. 'parentId': 4,
  292. 'parentName': '菜单管理',
  293. 'name': '查看',
  294. 'url': null,
  295. 'perms': 'sys:menu:list,sys:menu:info',
  296. 'type': 2,
  297. 'icon': null,
  298. 'orderNum': 0,
  299. 'open': null,
  300. 'list': null
  301. },
  302. {
  303. 'menuId': 24,
  304. 'parentId': 4,
  305. 'parentName': '菜单管理',
  306. 'name': '新增',
  307. 'url': null,
  308. 'perms': 'sys:menu:save,sys:menu:select',
  309. 'type': 2,
  310. 'icon': null,
  311. 'orderNum': 0,
  312. 'open': null,
  313. 'list': null
  314. },
  315. {
  316. 'menuId': 25,
  317. 'parentId': 4,
  318. 'parentName': '菜单管理',
  319. 'name': '修改',
  320. 'url': null,
  321. 'perms': 'sys:menu:update,sys:menu:select',
  322. 'type': 2,
  323. 'icon': null,
  324. 'orderNum': 0,
  325. 'open': null,
  326. 'list': null
  327. },
  328. {
  329. 'menuId': 26,
  330. 'parentId': 4,
  331. 'parentName': '菜单管理',
  332. 'name': '删除',
  333. 'url': null,
  334. 'perms': 'sys:menu:delete',
  335. 'type': 2,
  336. 'icon': null,
  337. 'orderNum': 0,
  338. 'open': null,
  339. 'list': null
  340. },
  341. {
  342. 'menuId': 27,
  343. 'parentId': 1,
  344. 'parentName': '系统管理',
  345. 'name': '参数管理',
  346. 'url': 'sys/config',
  347. 'perms': 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete',
  348. 'type': 1,
  349. 'icon': 'config',
  350. 'orderNum': 6,
  351. 'open': null,
  352. 'list': null
  353. },
  354. {
  355. 'menuId': 29,
  356. 'parentId': 1,
  357. 'parentName': '系统管理',
  358. 'name': '系统日志',
  359. 'url': 'sys/log',
  360. 'perms': 'sys:log:list',
  361. 'type': 1,
  362. 'icon': 'log',
  363. 'orderNum': 7,
  364. 'open': null,
  365. 'list': null
  366. },
  367. {
  368. 'menuId': 30,
  369. 'parentId': 1,
  370. 'parentName': '系统管理',
  371. 'name': '文件上传',
  372. 'url': 'oss/oss',
  373. 'perms': 'sys:oss:all',
  374. 'type': 1,
  375. 'icon': 'oss',
  376. 'orderNum': 6,
  377. 'open': null,
  378. 'list': null
  379. }
  380. ]
  381. var navDataList = [
  382. {
  383. 'menuId': 1,
  384. 'parentId': 0,
  385. 'parentName': null,
  386. 'name': '系统管理',
  387. 'url': null,
  388. 'perms': null,
  389. 'type': 0,
  390. 'icon': 'system',
  391. 'orderNum': 0,
  392. 'open': null,
  393. 'list': [
  394. {
  395. 'menuId': 2,
  396. 'parentId': 1,
  397. 'parentName': null,
  398. 'name': '管理员列表',
  399. 'url': 'sys/user',
  400. 'perms': null,
  401. 'type': 1,
  402. 'icon': 'admin',
  403. 'orderNum': 1,
  404. 'open': null,
  405. 'list': null
  406. },
  407. {
  408. 'menuId': 3,
  409. 'parentId': 1,
  410. 'parentName': null,
  411. 'name': '角色管理',
  412. 'url': 'sys/role',
  413. 'perms': null,
  414. 'type': 1,
  415. 'icon': 'role',
  416. 'orderNum': 2,
  417. 'open': null,
  418. 'list': null
  419. },
  420. {
  421. 'menuId': 4,
  422. 'parentId': 1,
  423. 'parentName': null,
  424. 'name': '菜单管理',
  425. 'url': 'sys/menu',
  426. 'perms': null,
  427. 'type': 1,
  428. 'icon': 'menu',
  429. 'orderNum': 3,
  430. 'open': null,
  431. 'list': null
  432. },
  433. {
  434. 'menuId': 5,
  435. 'parentId': 1,
  436. 'parentName': null,
  437. 'name': 'SQL监控',
  438. 'url': 'http://localhost:8080/druid/sql.html',
  439. 'perms': null,
  440. 'type': 1,
  441. 'icon': 'sql',
  442. 'orderNum': 4,
  443. 'open': null,
  444. 'list': null
  445. },
  446. {
  447. 'menuId': 6,
  448. 'parentId': 1,
  449. 'parentName': null,
  450. 'name': '定时任务',
  451. 'url': 'job/schedule',
  452. 'perms': null,
  453. 'type': 1,
  454. 'icon': 'job',
  455. 'orderNum': 5,
  456. 'open': null,
  457. 'list': null
  458. },
  459. {
  460. 'menuId': 27,
  461. 'parentId': 1,
  462. 'parentName': null,
  463. 'name': '参数管理',
  464. 'url': 'sys/config',
  465. 'perms': 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete',
  466. 'type': 1,
  467. 'icon': 'config',
  468. 'orderNum': 6,
  469. 'open': null,
  470. 'list': null
  471. },
  472. {
  473. 'menuId': 30,
  474. 'parentId': 1,
  475. 'parentName': null,
  476. 'name': '文件上传',
  477. 'url': 'oss/oss',
  478. 'perms': 'sys:oss:all',
  479. 'type': 1,
  480. 'icon': 'oss',
  481. 'orderNum': 6,
  482. 'open': null,
  483. 'list': null
  484. },
  485. {
  486. 'menuId': 29,
  487. 'parentId': 1,
  488. 'parentName': null,
  489. 'name': '系统日志',
  490. 'url': 'sys/log',
  491. 'perms': 'sys:log:list',
  492. 'type': 1,
  493. 'icon': 'log',
  494. 'orderNum': 7,
  495. 'open': null,
  496. 'list': null
  497. }
  498. ]
  499. }
  500. ]
  501. // var navDataList2 = [
  502. // {
  503. // 'id': 1,
  504. // 'parentId': 0, // 父ID,根ID是0
  505. // 'name': '项目', // 菜单名
  506. // 'ename': 'project-index', // 和路径相同,不要斜杠
  507. // 'path': '', // 页面路径 '/功能块名/页面名' 例子:/jiankong/shouye 后台录入
  508. // 'componentPath': '', // 文件路径,后台录入各子系统页面的文件路径,
  509. // 'noMenu': true // 如果该菜单只是有用,但是不出现在菜单中,就添加这个属性
  510. // }
  511. // ]
  512. var navDataList3 = [
  513. {
  514. 'id': 1,
  515. 'parentId': 0,
  516. 'name': '监测预警',
  517. 'ename': 'jcyj',
  518. 'path': '',
  519. 'componentPath': '',
  520. 'children': []
  521. },
  522. {
  523. 'id': 11,
  524. 'parentId': 1,
  525. 'name': '监测预警',
  526. 'ename': 'jcyjindex',
  527. 'path': 'jcyjindex',
  528. 'componentPath': 'business/home/home',
  529. 'children': []
  530. }
  531. ]
  532. var navDataList4 = [
  533. {
  534. 'UUID': '1',
  535. 'parentUUID': 0,
  536. 'name': '监测预警',
  537. 'ename': 'jcyj',
  538. 'path': 'jcyjindex1',
  539. 'componentPath': 'business/home/home',
  540. 'children': []
  541. },
  542. {
  543. 'UUID': '11',
  544. 'parentUUID': '1',
  545. 'name': '监测预警',
  546. 'ename': 'jcyjindex',
  547. 'path': 'jcyjindex2',
  548. 'componentPath': 'business/home/home',
  549. 'children': []
  550. },
  551. {
  552. 'UUID': '12',
  553. 'parentUUID': '1',
  554. 'name': '监测预警22',
  555. 'ename': 'jcyjindex2',
  556. 'path': '',
  557. 'componentPath': 'business/home/home',
  558. 'children': []
  559. },
  560. {
  561. 'UUID': '13',
  562. 'parentUUID': '1',
  563. 'name': '监测预警333',
  564. 'ename': 'jcyjindex3',
  565. 'path': 'jcyjindex3',
  566. 'componentPath': 'business/home/home',
  567. 'children': []
  568. },
  569. {
  570. 'UUID': '111',
  571. 'parentUUID': '11',
  572. 'name': 'xiao监测预警',
  573. 'ename': 'jcyjindex',
  574. 'path': 'jcyjindex3',
  575. 'componentPath': 'business/home/home',
  576. 'children': []
  577. },
  578. {
  579. 'UUID': '112',
  580. 'parentUUID': '11',
  581. 'name': 'xiao监测预警2',
  582. 'ename': 'jcyjindex222',
  583. 'path': 'jcyjindex32222',
  584. 'componentPath': 'business/home/home',
  585. 'children': []
  586. },
  587. {
  588. 'UUID': '1111',
  589. 'parentUUID': '111',
  590. 'name': 'xiaoxiao监测预警',
  591. 'ename': 'jcyjindex132',
  592. 'path': 'jcyjindex4',
  593. 'componentPath': 'business/home/home',
  594. 'children': []
  595. },
  596. {
  597. 'UUID': '1112',
  598. 'parentUUID': '111',
  599. 'name': 'xiaoxiao监测预警133',
  600. 'ename': 'jcyjindex133',
  601. 'path': 'jcyjindex41',
  602. 'componentPath': 'business/home/home',
  603. 'children': []
  604. },
  605. {
  606. 'UUID': '11111',
  607. 'parentUUID': '1111',
  608. 'name': 'xiaoxiao监测预警5级',
  609. 'ename': 'jcyjindex555',
  610. 'path': 'jcyjindex4555',
  611. 'componentPath': 'business/home/home',
  612. 'children': []
  613. },
  614. {
  615. 'UUID': '11112',
  616. 'parentUUID': '1111',
  617. 'name': 'xiaoxiao监测预警5-2级',
  618. 'ename': 'jcyjindex555-2',
  619. 'path': 'jcyjindex4555-2',
  620. 'componentPath': 'business/home/home',
  621. 'children': []
  622. },
  623. {
  624. 'UUID': '111111',
  625. 'parentUUID': '11111',
  626. 'name': 'xiaoxiao监测预警6级',
  627. 'ename': 'jcyjindex5556',
  628. 'path': 'jcyjindex45556',
  629. 'componentPath': 'business/home/home',
  630. 'children': []
  631. },
  632. {
  633. 'UUID': '2',
  634. 'parentUUID': 0,
  635. 'name': '列表',
  636. 'ename': 'lanmu2',
  637. 'path': 'lanmu2',
  638. 'componentPath': 'modules/demo/listDemo/list-demo',
  639. 'children': []
  640. },
  641. {
  642. 'UUID': '21',
  643. 'parentUUID': '2',
  644. 'name': '列表2',
  645. 'ename': 'lanmu22',
  646. 'path': 'lanmu22',
  647. 'componentPath': 'modules/demo/listDemo/list-demo',
  648. 'children': []
  649. },
  650. {
  651. 'UUID': '3',
  652. 'parentUUID': 0,
  653. 'name': '表单',
  654. 'ename': 'biaodan1',
  655. 'path': 'biaodan1',
  656. 'componentPath': 'modules/demo/formType/form-type',
  657. 'children': []
  658. },
  659. {
  660. 'UUID': '31',
  661. 'parentUUID': '3',
  662. 'name': '表单2',
  663. 'ename': 'biaodan2',
  664. 'path': 'biaodan2',
  665. 'componentPath': 'modules/demo/formType/form-type',
  666. 'children': []
  667. },
  668. {
  669. 'UUID': '4',
  670. 'parentUUID': 0,
  671. 'name': '网址嵌套',
  672. 'ename': 'webaddress',
  673. 'path': 'webaddress',
  674. 'url': 'http://localhost:8003',
  675. // 'componentPath': 'modules/demo/all-form-type',
  676. 'children': []
  677. },
  678. {
  679. 'UUID': '5',
  680. 'parentUUID': 0,
  681. 'name': '基础组件',
  682. 'ename': 'basiccom',
  683. 'path': 'basiccom',
  684. 'componentPath': 'modules/demo/basicComponent/basic-com',
  685. 'children': []
  686. }
  687. ]
  688. // 获取导航菜单列表 / 权限
  689. export function nav () {
  690. return {
  691. // isOpen: false,
  692. url: '/sys/menu/nav',
  693. type: 'get',
  694. data: {
  695. 'msg': 'success',
  696. 'code': 0,
  697. 'data': navDataList3
  698. }
  699. }
  700. }
  701. // 获取菜单列表
  702. export function list () {
  703. return {
  704. // isOpen: false,
  705. url: '/idaas/ps/user/menuList',
  706. type: 'get',
  707. data: {
  708. 'msg': 'success',
  709. 'code': 0,
  710. 'list': navDataList4
  711. }
  712. }
  713. }
  714. // 获取上级菜单
  715. export function select () {
  716. let dataList = JSON.parse(JSON.stringify(navDataList))
  717. dataList = dataList.concat(dataList[0].list)
  718. return {
  719. // isOpen: false,
  720. url: '/sys/menu/select',
  721. type: 'get',
  722. data: {
  723. 'msg': 'success',
  724. 'code': 0,
  725. 'menuList': dataList
  726. }
  727. }
  728. }
  729. // 获取菜单信息
  730. export function info () {
  731. return {
  732. // isOpen: false,
  733. url: '/sys/menu/info',
  734. type: 'get',
  735. data: {
  736. 'msg': 'success',
  737. 'code': 0,
  738. 'menu': dataList[0]
  739. }
  740. }
  741. }
  742. // 添加菜单
  743. export function add () {
  744. return {
  745. // isOpen: false,
  746. url: '/sys/menu/save',
  747. type: 'post',
  748. data: {
  749. 'msg': 'success',
  750. 'code': 0
  751. }
  752. }
  753. }
  754. // 修改菜单
  755. export function update () {
  756. return {
  757. // isOpen: false,
  758. url: '/sys/menu/update',
  759. type: 'post',
  760. data: {
  761. 'msg': 'success',
  762. 'code': 0
  763. }
  764. }
  765. }
  766. // 删除菜单
  767. export function del () {
  768. return {
  769. // isOpen: false,
  770. url: '/sys/menu/delete',
  771. type: 'post',
  772. data: {
  773. 'msg': 'success',
  774. 'code': 0
  775. }
  776. }
  777. }