menu.mock.ts 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650
  1. import { defineMock } from './base'
  2. export default defineMock([
  3. {
  4. url: 'menus/routes',
  5. method: ['GET'],
  6. body: {
  7. code: '00000',
  8. data: [
  9. {
  10. path: '/system',
  11. component: 'Layout',
  12. redirect: '/system/user',
  13. name: '/system',
  14. meta: {
  15. title: '系统管理',
  16. icon: 'system',
  17. hidden: false,
  18. roles: ['ADMIN'],
  19. alwaysShow: false,
  20. params: null
  21. },
  22. children: [
  23. {
  24. path: 'user',
  25. component: 'system/user/index',
  26. name: 'User',
  27. meta: {
  28. title: '用户管理',
  29. icon: 'user',
  30. hidden: false,
  31. roles: ['ADMIN'],
  32. keepAlive: true,
  33. alwaysShow: false,
  34. params: null
  35. }
  36. },
  37. {
  38. path: 'role',
  39. component: 'system/role/index',
  40. name: 'Role',
  41. meta: {
  42. title: '角色管理',
  43. icon: 'role',
  44. hidden: false,
  45. roles: ['ADMIN'],
  46. keepAlive: true,
  47. alwaysShow: false,
  48. params: null
  49. }
  50. },
  51. {
  52. path: 'menu',
  53. component: 'system/menu/index',
  54. name: 'Menu',
  55. meta: {
  56. title: '菜单管理',
  57. icon: 'menu',
  58. hidden: false,
  59. roles: ['ADMIN'],
  60. keepAlive: true,
  61. alwaysShow: false,
  62. params: null
  63. }
  64. },
  65. {
  66. path: 'dept',
  67. component: 'system/dept/index',
  68. name: 'Dept',
  69. meta: {
  70. title: '部门管理',
  71. icon: 'tree',
  72. hidden: false,
  73. roles: ['ADMIN'],
  74. keepAlive: true,
  75. alwaysShow: false,
  76. params: null
  77. }
  78. },
  79. {
  80. path: 'dict',
  81. component: 'system/dict/index',
  82. name: 'Dict',
  83. meta: {
  84. title: '字典管理',
  85. icon: 'dict',
  86. hidden: false,
  87. roles: ['ADMIN'],
  88. keepAlive: true,
  89. alwaysShow: false,
  90. params: null
  91. }
  92. }
  93. ]
  94. },
  95. {
  96. path: '/api',
  97. component: 'Layout',
  98. name: '/api',
  99. meta: {
  100. title: '接口文档',
  101. icon: 'api',
  102. hidden: false,
  103. roles: ['ADMIN'],
  104. alwaysShow: true,
  105. params: null
  106. },
  107. children: [
  108. {
  109. path: 'apifox',
  110. component: 'demo/api/apifox',
  111. name: 'Apifox',
  112. meta: {
  113. title: 'Apifox',
  114. icon: 'api',
  115. hidden: false,
  116. roles: ['ADMIN'],
  117. keepAlive: true,
  118. alwaysShow: false,
  119. params: null
  120. }
  121. }
  122. ]
  123. },
  124. {
  125. path: '/doc',
  126. component: 'Layout',
  127. redirect: 'https://juejin.cn/post/7228990409909108793',
  128. name: '/doc',
  129. meta: {
  130. title: '平台文档',
  131. icon: 'document',
  132. hidden: false,
  133. roles: ['ADMIN'],
  134. alwaysShow: false,
  135. params: null
  136. },
  137. children: [
  138. {
  139. path: 'internal-doc',
  140. component: 'demo/internal-doc',
  141. name: 'InternalDoc',
  142. meta: {
  143. title: '平台文档(内嵌)',
  144. icon: 'document',
  145. hidden: false,
  146. roles: ['ADMIN'],
  147. alwaysShow: false,
  148. params: null
  149. }
  150. },
  151. {
  152. path: 'https://juejin.cn/post/7228990409909108793',
  153. name: 'Https://juejin.cn/post/7228990409909108793',
  154. meta: {
  155. title: '平台文档(外链)',
  156. icon: 'link',
  157. hidden: false,
  158. roles: ['ADMIN'],
  159. alwaysShow: false,
  160. params: null
  161. }
  162. }
  163. ]
  164. },
  165. {
  166. path: '/multi-level',
  167. component: 'Layout',
  168. name: '/multiLevel',
  169. meta: {
  170. title: '多级菜单',
  171. icon: 'cascader',
  172. hidden: false,
  173. roles: ['ADMIN'],
  174. alwaysShow: true,
  175. params: null
  176. },
  177. children: [
  178. {
  179. path: 'multi-level1',
  180. component: 'demo/multi-level/level1',
  181. name: 'MultiLevel1',
  182. meta: {
  183. title: '菜单一级',
  184. icon: '',
  185. hidden: false,
  186. roles: ['ADMIN'],
  187. alwaysShow: true,
  188. params: null
  189. },
  190. children: [
  191. {
  192. path: 'multi-level2',
  193. component: 'demo/multi-level/children/level2',
  194. name: 'MultiLevel2',
  195. meta: {
  196. title: '菜单二级',
  197. icon: '',
  198. hidden: false,
  199. roles: ['ADMIN'],
  200. alwaysShow: false,
  201. params: null
  202. },
  203. children: [
  204. {
  205. path: 'multi-level3-1',
  206. component: 'demo/multi-level/children/children/level3-1',
  207. name: 'MultiLevel31',
  208. meta: {
  209. title: '菜单三级-1',
  210. icon: '',
  211. hidden: false,
  212. roles: ['ADMIN'],
  213. keepAlive: true,
  214. alwaysShow: false,
  215. params: null
  216. }
  217. },
  218. {
  219. path: 'multi-level3-2',
  220. component: 'demo/multi-level/children/children/level3-2',
  221. name: 'MultiLevel32',
  222. meta: {
  223. title: '菜单三级-2',
  224. icon: '',
  225. hidden: false,
  226. roles: ['ADMIN'],
  227. keepAlive: true,
  228. alwaysShow: false,
  229. params: null
  230. }
  231. }
  232. ]
  233. }
  234. ]
  235. }
  236. ]
  237. },
  238. {
  239. path: '/component',
  240. component: 'Layout',
  241. name: '/component',
  242. meta: {
  243. title: '组件封装',
  244. icon: 'menu',
  245. hidden: false,
  246. roles: ['ADMIN'],
  247. alwaysShow: false,
  248. params: null
  249. },
  250. children: [
  251. {
  252. path: 'curd',
  253. component: 'demo/curd/index',
  254. name: 'Curd',
  255. meta: {
  256. title: '增删改查',
  257. icon: '',
  258. hidden: false,
  259. roles: ['ADMIN'],
  260. keepAlive: true,
  261. alwaysShow: false,
  262. params: null
  263. }
  264. },
  265. {
  266. path: 'table-select',
  267. component: 'demo/table-select/index',
  268. name: 'TableSelect',
  269. meta: {
  270. title: '列表选择器',
  271. icon: '',
  272. hidden: false,
  273. roles: ['ADMIN'],
  274. keepAlive: true,
  275. alwaysShow: false,
  276. params: null
  277. }
  278. },
  279. {
  280. path: 'wang-editor',
  281. component: 'demo/wang-editor',
  282. name: 'WangEditor',
  283. meta: {
  284. title: '富文本编辑器',
  285. icon: '',
  286. hidden: false,
  287. roles: ['ADMIN'],
  288. keepAlive: true,
  289. alwaysShow: false,
  290. params: null
  291. }
  292. },
  293. {
  294. path: 'upload',
  295. component: 'demo/upload',
  296. name: 'Upload',
  297. meta: {
  298. title: '图片上传',
  299. icon: '',
  300. hidden: false,
  301. roles: ['ADMIN'],
  302. keepAlive: true,
  303. alwaysShow: false,
  304. params: null
  305. }
  306. },
  307. {
  308. path: 'icon-selector',
  309. component: 'demo/icon-selector',
  310. name: 'IconSelector',
  311. meta: {
  312. title: '图标选择器',
  313. icon: '',
  314. hidden: false,
  315. roles: ['ADMIN'],
  316. keepAlive: true,
  317. alwaysShow: false,
  318. params: null
  319. }
  320. },
  321. {
  322. path: 'dict-demo',
  323. component: 'demo/dict',
  324. name: 'DictDemo',
  325. meta: {
  326. title: '字典组件',
  327. icon: '',
  328. hidden: false,
  329. roles: ['ADMIN'],
  330. keepAlive: true,
  331. alwaysShow: false,
  332. params: null
  333. }
  334. }
  335. ]
  336. },
  337. {
  338. path: '/route-param',
  339. component: 'Layout',
  340. name: '/routeParam',
  341. meta: {
  342. title: '路由参数',
  343. icon: 'el-icon-ElementPlus',
  344. hidden: false,
  345. roles: ['ADMIN'],
  346. alwaysShow: true,
  347. params: null
  348. },
  349. children: [
  350. {
  351. path: 'route-param-type1',
  352. component: 'demo/route-param',
  353. name: 'RouteParamType1',
  354. meta: {
  355. title: '参数(type=1)',
  356. icon: 'el-icon-Star',
  357. hidden: false,
  358. roles: ['ADMIN'],
  359. keepAlive: true,
  360. alwaysShow: false,
  361. params: {
  362. type: '1'
  363. }
  364. }
  365. },
  366. {
  367. path: 'route-param-type2',
  368. component: 'demo/route-param',
  369. name: 'RouteParamType2',
  370. meta: {
  371. title: '参数(type=2)',
  372. icon: 'el-icon-StarFilled',
  373. hidden: false,
  374. roles: ['ADMIN'],
  375. keepAlive: true,
  376. alwaysShow: false,
  377. params: {
  378. type: '2'
  379. }
  380. }
  381. }
  382. ]
  383. },
  384. {
  385. path: '/function',
  386. component: 'Layout',
  387. name: '/function',
  388. meta: {
  389. title: '功能演示',
  390. icon: 'menu',
  391. hidden: false,
  392. roles: ['ADMIN'],
  393. alwaysShow: false,
  394. params: null
  395. },
  396. children: [
  397. {
  398. path: 'icon-demo',
  399. component: 'demo/icons',
  400. name: 'IconDemo',
  401. meta: {
  402. title: 'Icons',
  403. icon: 'el-icon-Notification',
  404. hidden: false,
  405. roles: ['ADMIN'],
  406. keepAlive: true,
  407. alwaysShow: false,
  408. params: null
  409. }
  410. },
  411. {
  412. path: '/function/websocket',
  413. component: 'demo/websocket',
  414. name: '/function/websocket',
  415. meta: {
  416. title: 'Websocket',
  417. icon: '',
  418. hidden: false,
  419. roles: ['ADMIN'],
  420. keepAlive: true,
  421. alwaysShow: false,
  422. params: null
  423. }
  424. },
  425. {
  426. path: 'other/:id',
  427. component: 'demo/other',
  428. name: 'Other/:id',
  429. meta: {
  430. title: '敬请期待...',
  431. icon: '',
  432. hidden: false,
  433. roles: ['ADMIN'],
  434. alwaysShow: false,
  435. params: null
  436. }
  437. }
  438. ]
  439. }
  440. ],
  441. msg: '一切ok'
  442. }
  443. },
  444. {
  445. url: 'menus',
  446. method: ['GET'],
  447. body: {
  448. code: '00000',
  449. data: [
  450. {
  451. id: 1,
  452. parentId: 0,
  453. name: '系统管理',
  454. type: 'CATALOG',
  455. routeName: '',
  456. routePath: '/system',
  457. component: 'Layout',
  458. sort: 1,
  459. visible: 1,
  460. icon: 'system',
  461. redirect: '/system/user',
  462. perm: null,
  463. children: [
  464. {
  465. id: 2,
  466. parentId: 1,
  467. name: '用户管理',
  468. type: 'MENU',
  469. routeName: 'User',
  470. routePath: 'user',
  471. component: 'system/user/index',
  472. sort: 1,
  473. visible: 1,
  474. icon: 'user',
  475. redirect: null,
  476. perm: null,
  477. children: [
  478. {
  479. id: 105,
  480. parentId: 2,
  481. name: '用户查询',
  482. type: 'BUTTON',
  483. routeName: null,
  484. routePath: '',
  485. component: null,
  486. sort: 0,
  487. visible: 1,
  488. icon: '',
  489. redirect: null,
  490. perm: 'sys:user:query',
  491. children: []
  492. },
  493. {
  494. id: 31,
  495. parentId: 2,
  496. name: '用户新增',
  497. type: 'BUTTON',
  498. routeName: null,
  499. routePath: '',
  500. component: null,
  501. sort: 1,
  502. visible: 1,
  503. icon: '',
  504. redirect: '',
  505. perm: 'sys:user:add',
  506. children: []
  507. },
  508. {
  509. id: 32,
  510. parentId: 2,
  511. name: '用户编辑',
  512. type: 'BUTTON',
  513. routeName: null,
  514. routePath: '',
  515. component: null,
  516. sort: 2,
  517. visible: 1,
  518. icon: '',
  519. redirect: '',
  520. perm: 'sys:user:edit',
  521. children: []
  522. },
  523. {
  524. id: 33,
  525. parentId: 2,
  526. name: '用户删除',
  527. type: 'BUTTON',
  528. routeName: null,
  529. routePath: '',
  530. component: null,
  531. sort: 3,
  532. visible: 1,
  533. icon: '',
  534. redirect: '',
  535. perm: 'sys:user:delete',
  536. children: []
  537. },
  538. {
  539. id: 88,
  540. parentId: 2,
  541. name: '重置密码',
  542. type: 'BUTTON',
  543. routeName: null,
  544. routePath: '',
  545. component: null,
  546. sort: 4,
  547. visible: 1,
  548. icon: '',
  549. redirect: null,
  550. perm: 'sys:user:password:reset',
  551. children: []
  552. },
  553. {
  554. id: 106,
  555. parentId: 2,
  556. name: '用户导入',
  557. type: 'BUTTON',
  558. routeName: null,
  559. routePath: '',
  560. component: null,
  561. sort: 5,
  562. visible: 1,
  563. icon: '',
  564. redirect: null,
  565. perm: 'sys:user:import',
  566. children: []
  567. },
  568. {
  569. id: 107,
  570. parentId: 2,
  571. name: '用户导出',
  572. type: 'BUTTON',
  573. routeName: null,
  574. routePath: '',
  575. component: null,
  576. sort: 6,
  577. visible: 1,
  578. icon: '',
  579. redirect: null,
  580. perm: 'sys:user:export',
  581. children: []
  582. }
  583. ]
  584. },
  585. {
  586. id: 3,
  587. parentId: 1,
  588. name: '角色管理',
  589. type: 'MENU',
  590. routeName: 'Role',
  591. routePath: 'role',
  592. component: 'system/role/index',
  593. sort: 2,
  594. visible: 1,
  595. icon: 'role',
  596. redirect: null,
  597. perm: null,
  598. children: [
  599. {
  600. id: 70,
  601. parentId: 3,
  602. name: '角色新增',
  603. type: 'BUTTON',
  604. routeName: null,
  605. routePath: '',
  606. component: null,
  607. sort: 1,
  608. visible: 1,
  609. icon: '',
  610. redirect: null,
  611. perm: 'sys:role:add',
  612. children: []
  613. },
  614. {
  615. id: 71,
  616. parentId: 3,
  617. name: '角色编辑',
  618. type: 'BUTTON',
  619. routeName: null,
  620. routePath: '',
  621. component: null,
  622. sort: 2,
  623. visible: 1,
  624. icon: '',
  625. redirect: null,
  626. perm: 'sys:role:edit',
  627. children: []
  628. },
  629. {
  630. id: 72,
  631. parentId: 3,
  632. name: '角色删除',
  633. type: 'BUTTON',
  634. routeName: null,
  635. routePath: '',
  636. component: null,
  637. sort: 3,
  638. visible: 1,
  639. icon: '',
  640. redirect: null,
  641. perm: 'sys:role:delete',
  642. children: []
  643. }
  644. ]
  645. },
  646. {
  647. id: 4,
  648. parentId: 1,
  649. name: '菜单管理',
  650. type: 'MENU',
  651. routeName: 'Menu',
  652. routePath: 'menu',
  653. component: 'system/menu/index',
  654. sort: 3,
  655. visible: 1,
  656. icon: 'menu',
  657. redirect: null,
  658. perm: null,
  659. children: [
  660. {
  661. id: 73,
  662. parentId: 4,
  663. name: '菜单新增',
  664. type: 'BUTTON',
  665. routeName: null,
  666. routePath: '',
  667. component: null,
  668. sort: 1,
  669. visible: 1,
  670. icon: '',
  671. redirect: null,
  672. perm: 'sys:menu:add',
  673. children: []
  674. },
  675. {
  676. id: 75,
  677. parentId: 4,
  678. name: '菜单删除',
  679. type: 'BUTTON',
  680. routeName: null,
  681. routePath: '',
  682. component: null,
  683. sort: 3,
  684. visible: 1,
  685. icon: '',
  686. redirect: null,
  687. perm: 'sys:menu:delete',
  688. children: []
  689. },
  690. {
  691. id: 74,
  692. parentId: 4,
  693. name: '菜单编辑',
  694. type: 'BUTTON',
  695. routeName: null,
  696. routePath: '',
  697. component: null,
  698. sort: 3,
  699. visible: 1,
  700. icon: '',
  701. redirect: null,
  702. perm: 'sys:menu:edit',
  703. children: []
  704. }
  705. ]
  706. },
  707. {
  708. id: 5,
  709. parentId: 1,
  710. name: '部门管理',
  711. type: 'MENU',
  712. routeName: 'Dept',
  713. routePath: 'dept',
  714. component: 'system/dept/index',
  715. sort: 4,
  716. visible: 1,
  717. icon: 'tree',
  718. redirect: null,
  719. perm: null,
  720. children: [
  721. {
  722. id: 76,
  723. parentId: 5,
  724. name: '部门新增',
  725. type: 'BUTTON',
  726. routeName: null,
  727. routePath: '',
  728. component: null,
  729. sort: 1,
  730. visible: 1,
  731. icon: '',
  732. redirect: null,
  733. perm: 'sys:dept:add',
  734. children: []
  735. },
  736. {
  737. id: 77,
  738. parentId: 5,
  739. name: '部门编辑',
  740. type: 'BUTTON',
  741. routeName: null,
  742. routePath: '',
  743. component: null,
  744. sort: 2,
  745. visible: 1,
  746. icon: '',
  747. redirect: null,
  748. perm: 'sys:dept:edit',
  749. children: []
  750. },
  751. {
  752. id: 78,
  753. parentId: 5,
  754. name: '部门删除',
  755. type: 'BUTTON',
  756. routeName: null,
  757. routePath: '',
  758. component: null,
  759. sort: 3,
  760. visible: 1,
  761. icon: '',
  762. redirect: null,
  763. perm: 'sys:dept:delete',
  764. children: []
  765. }
  766. ]
  767. },
  768. {
  769. id: 6,
  770. parentId: 1,
  771. name: '字典管理',
  772. type: 'MENU',
  773. routeName: 'Dict',
  774. routePath: 'dict',
  775. component: 'system/dict/index',
  776. sort: 5,
  777. visible: 1,
  778. icon: 'dict',
  779. redirect: null,
  780. perm: null,
  781. children: [
  782. {
  783. id: 79,
  784. parentId: 6,
  785. name: '字典类型新增',
  786. type: 'BUTTON',
  787. routeName: null,
  788. routePath: '',
  789. component: null,
  790. sort: 1,
  791. visible: 1,
  792. icon: '',
  793. redirect: null,
  794. perm: 'sys:dict_type:add',
  795. children: []
  796. },
  797. {
  798. id: 81,
  799. parentId: 6,
  800. name: '字典类型编辑',
  801. type: 'BUTTON',
  802. routeName: null,
  803. routePath: '',
  804. component: null,
  805. sort: 2,
  806. visible: 1,
  807. icon: '',
  808. redirect: null,
  809. perm: 'sys:dict_type:edit',
  810. children: []
  811. },
  812. {
  813. id: 84,
  814. parentId: 6,
  815. name: '字典类型删除',
  816. type: 'BUTTON',
  817. routeName: null,
  818. routePath: '',
  819. component: null,
  820. sort: 3,
  821. visible: 1,
  822. icon: '',
  823. redirect: null,
  824. perm: 'sys:dict_type:delete',
  825. children: []
  826. },
  827. {
  828. id: 85,
  829. parentId: 6,
  830. name: '字典数据新增',
  831. type: 'BUTTON',
  832. routeName: null,
  833. routePath: '',
  834. component: null,
  835. sort: 4,
  836. visible: 1,
  837. icon: '',
  838. redirect: null,
  839. perm: 'sys:dict:add',
  840. children: []
  841. },
  842. {
  843. id: 86,
  844. parentId: 6,
  845. name: '字典数据编辑',
  846. type: 'BUTTON',
  847. routeName: null,
  848. routePath: '',
  849. component: null,
  850. sort: 5,
  851. visible: 1,
  852. icon: '',
  853. redirect: null,
  854. perm: 'sys:dict:edit',
  855. children: []
  856. },
  857. {
  858. id: 87,
  859. parentId: 6,
  860. name: '字典数据删除',
  861. type: 'BUTTON',
  862. routeName: null,
  863. routePath: '',
  864. component: null,
  865. sort: 6,
  866. visible: 1,
  867. icon: '',
  868. redirect: null,
  869. perm: 'sys:dict:delete',
  870. children: []
  871. }
  872. ]
  873. }
  874. ]
  875. },
  876. {
  877. id: 40,
  878. parentId: 0,
  879. name: '接口文档',
  880. type: 'CATALOG',
  881. routeName: null,
  882. routePath: '/api',
  883. component: 'Layout',
  884. sort: 7,
  885. visible: 1,
  886. icon: 'api',
  887. redirect: '',
  888. perm: null,
  889. children: [
  890. {
  891. id: 41,
  892. parentId: 40,
  893. name: 'Apifox',
  894. type: 'MENU',
  895. routeName: null,
  896. routePath: 'apifox',
  897. component: 'demo/api/apifox',
  898. sort: 1,
  899. visible: 1,
  900. icon: 'api',
  901. redirect: '',
  902. perm: null,
  903. children: []
  904. }
  905. ]
  906. },
  907. {
  908. id: 26,
  909. parentId: 0,
  910. name: '平台文档',
  911. type: 'CATALOG',
  912. routeName: null,
  913. routePath: '/doc',
  914. component: 'Layout',
  915. sort: 8,
  916. visible: 1,
  917. icon: 'document',
  918. redirect: 'https://juejin.cn/post/7228990409909108793',
  919. perm: null,
  920. children: [
  921. {
  922. id: 102,
  923. parentId: 26,
  924. name: '平台文档(内嵌)',
  925. type: 'EXTLINK',
  926. routeName: null,
  927. routePath: 'internal-doc',
  928. component: 'demo/internal-doc',
  929. sort: 1,
  930. visible: 1,
  931. icon: 'document',
  932. redirect: '',
  933. perm: null,
  934. children: []
  935. },
  936. {
  937. id: 30,
  938. parentId: 26,
  939. name: '平台文档(外链)',
  940. type: 'EXTLINK',
  941. routeName: null,
  942. routePath: 'https://juejin.cn/post/7228990409909108793',
  943. component: '',
  944. sort: 2,
  945. visible: 1,
  946. icon: 'link',
  947. redirect: '',
  948. perm: null,
  949. children: []
  950. }
  951. ]
  952. },
  953. {
  954. id: 20,
  955. parentId: 0,
  956. name: '多级菜单',
  957. type: 'CATALOG',
  958. routeName: null,
  959. routePath: '/multi-level',
  960. component: 'Layout',
  961. sort: 9,
  962. visible: 1,
  963. icon: 'cascader',
  964. redirect: '',
  965. perm: null,
  966. children: [
  967. {
  968. id: 21,
  969. parentId: 20,
  970. name: '菜单一级',
  971. type: 'MENU',
  972. routeName: null,
  973. routePath: 'multi-level1',
  974. component: 'demo/multi-level/level1',
  975. sort: 1,
  976. visible: 1,
  977. icon: '',
  978. redirect: '',
  979. perm: null,
  980. children: [
  981. {
  982. id: 22,
  983. parentId: 21,
  984. name: '菜单二级',
  985. type: 'MENU',
  986. routeName: null,
  987. routePath: 'multi-level2',
  988. component: 'demo/multi-level/children/level2',
  989. sort: 1,
  990. visible: 1,
  991. icon: '',
  992. redirect: null,
  993. perm: null,
  994. children: [
  995. {
  996. id: 23,
  997. parentId: 22,
  998. name: '菜单三级-1',
  999. type: 'MENU',
  1000. routeName: null,
  1001. routePath: 'multi-level3-1',
  1002. component: 'demo/multi-level/children/children/level3-1',
  1003. sort: 1,
  1004. visible: 1,
  1005. icon: '',
  1006. redirect: '',
  1007. perm: null,
  1008. children: []
  1009. },
  1010. {
  1011. id: 24,
  1012. parentId: 22,
  1013. name: '菜单三级-2',
  1014. type: 'MENU',
  1015. routeName: null,
  1016. routePath: 'multi-level3-2',
  1017. component: 'demo/multi-level/children/children/level3-2',
  1018. sort: 2,
  1019. visible: 1,
  1020. icon: '',
  1021. redirect: '',
  1022. perm: null,
  1023. children: []
  1024. }
  1025. ]
  1026. }
  1027. ]
  1028. }
  1029. ]
  1030. },
  1031. {
  1032. id: 36,
  1033. parentId: 0,
  1034. name: '组件封装',
  1035. type: 'CATALOG',
  1036. routeName: null,
  1037. routePath: '/component',
  1038. component: 'Layout',
  1039. sort: 10,
  1040. visible: 1,
  1041. icon: 'menu',
  1042. redirect: '',
  1043. perm: null,
  1044. children: [
  1045. {
  1046. id: 108,
  1047. parentId: 36,
  1048. name: '增删改查',
  1049. type: 'MENU',
  1050. routeName: null,
  1051. routePath: 'curd',
  1052. component: 'demo/curd/index',
  1053. sort: 0,
  1054. visible: 1,
  1055. icon: '',
  1056. redirect: '',
  1057. perm: null,
  1058. children: []
  1059. },
  1060. {
  1061. id: 109,
  1062. parentId: 36,
  1063. name: '列表选择器',
  1064. type: 'MENU',
  1065. routeName: null,
  1066. routePath: 'table-select',
  1067. component: 'demo/table-select/index',
  1068. sort: 1,
  1069. visible: 1,
  1070. icon: '',
  1071. redirect: '',
  1072. perm: null,
  1073. children: []
  1074. },
  1075. {
  1076. id: 37,
  1077. parentId: 36,
  1078. name: '富文本编辑器',
  1079. type: 'MENU',
  1080. routeName: null,
  1081. routePath: 'wang-editor',
  1082. component: 'demo/wang-editor',
  1083. sort: 2,
  1084. visible: 1,
  1085. icon: '',
  1086. redirect: '',
  1087. perm: null,
  1088. children: []
  1089. },
  1090. {
  1091. id: 38,
  1092. parentId: 36,
  1093. name: '图片上传',
  1094. type: 'MENU',
  1095. routeName: null,
  1096. routePath: 'upload',
  1097. component: 'demo/upload',
  1098. sort: 3,
  1099. visible: 1,
  1100. icon: '',
  1101. redirect: '',
  1102. perm: null,
  1103. children: []
  1104. },
  1105. {
  1106. id: 95,
  1107. parentId: 36,
  1108. name: '字典组件',
  1109. type: 'MENU',
  1110. routeName: null,
  1111. routePath: 'dict-demo',
  1112. component: 'demo/dict',
  1113. sort: 4,
  1114. visible: 1,
  1115. icon: '',
  1116. redirect: '',
  1117. perm: null,
  1118. children: []
  1119. },
  1120. {
  1121. id: 39,
  1122. parentId: 36,
  1123. name: '图标选择器',
  1124. type: 'MENU',
  1125. routeName: null,
  1126. routePath: 'icon-selector',
  1127. component: 'demo/icon-selector',
  1128. sort: 4,
  1129. visible: 1,
  1130. icon: '',
  1131. redirect: '',
  1132. perm: null,
  1133. children: []
  1134. }
  1135. ]
  1136. },
  1137. {
  1138. id: 110,
  1139. parentId: 0,
  1140. name: '路由参数',
  1141. type: 'CATALOG',
  1142. routeName: null,
  1143. routePath: '/route-param',
  1144. component: 'Layout',
  1145. sort: 11,
  1146. visible: 1,
  1147. icon: 'el-icon-ElementPlus',
  1148. redirect: null,
  1149. perm: null,
  1150. children: [
  1151. {
  1152. id: 111,
  1153. parentId: 110,
  1154. name: '参数(type=1)',
  1155. type: 'MENU',
  1156. routeName: null,
  1157. routePath: 'route-param-type1',
  1158. component: 'demo/route-param',
  1159. sort: 1,
  1160. visible: 1,
  1161. icon: 'el-icon-Star',
  1162. redirect: null,
  1163. perm: null,
  1164. children: []
  1165. },
  1166. {
  1167. id: 112,
  1168. parentId: 110,
  1169. name: '参数(type=2)',
  1170. type: 'MENU',
  1171. routeName: null,
  1172. routePath: 'route-param-type2',
  1173. component: 'demo/route-param',
  1174. sort: 2,
  1175. visible: 1,
  1176. icon: 'el-icon-StarFilled',
  1177. redirect: null,
  1178. perm: null,
  1179. children: []
  1180. }
  1181. ]
  1182. },
  1183. {
  1184. id: 89,
  1185. parentId: 0,
  1186. name: '功能演示',
  1187. type: 'CATALOG',
  1188. routeName: null,
  1189. routePath: '/function',
  1190. component: 'Layout',
  1191. sort: 12,
  1192. visible: 1,
  1193. icon: 'menu',
  1194. redirect: '',
  1195. perm: null,
  1196. children: [
  1197. {
  1198. id: 97,
  1199. parentId: 89,
  1200. name: 'Icons',
  1201. type: 'MENU',
  1202. routeName: null,
  1203. routePath: 'icon-demo',
  1204. component: 'demo/icons',
  1205. sort: 2,
  1206. visible: 1,
  1207. icon: 'el-icon-Notification',
  1208. redirect: '',
  1209. perm: null,
  1210. children: []
  1211. },
  1212. {
  1213. id: 90,
  1214. parentId: 89,
  1215. name: 'Websocket',
  1216. type: 'MENU',
  1217. routeName: null,
  1218. routePath: '/function/websocket',
  1219. component: 'demo/websocket',
  1220. sort: 3,
  1221. visible: 1,
  1222. icon: '',
  1223. redirect: '',
  1224. perm: null,
  1225. children: []
  1226. },
  1227. {
  1228. id: 91,
  1229. parentId: 89,
  1230. name: '敬请期待...',
  1231. type: 'CATALOG',
  1232. routeName: null,
  1233. routePath: 'other/:id',
  1234. component: 'demo/other',
  1235. sort: 4,
  1236. visible: 1,
  1237. icon: '',
  1238. redirect: '',
  1239. perm: null,
  1240. children: []
  1241. }
  1242. ]
  1243. }
  1244. ],
  1245. msg: '一切ok'
  1246. }
  1247. },
  1248. {
  1249. url: 'menus/options',
  1250. method: ['GET'],
  1251. body: {
  1252. code: '00000',
  1253. data: [
  1254. {
  1255. value: 1,
  1256. label: '系统管理',
  1257. children: [
  1258. {
  1259. value: 2,
  1260. label: '用户管理',
  1261. children: [
  1262. {
  1263. value: 105,
  1264. label: '用户查询'
  1265. },
  1266. {
  1267. value: 31,
  1268. label: '用户新增'
  1269. },
  1270. {
  1271. value: 32,
  1272. label: '用户编辑'
  1273. },
  1274. {
  1275. value: 33,
  1276. label: '用户删除'
  1277. },
  1278. {
  1279. value: 88,
  1280. label: '重置密码'
  1281. },
  1282. {
  1283. value: 106,
  1284. label: '用户导入'
  1285. },
  1286. {
  1287. value: 107,
  1288. label: '用户导出'
  1289. }
  1290. ]
  1291. },
  1292. {
  1293. value: 3,
  1294. label: '角色管理',
  1295. children: [
  1296. {
  1297. value: 70,
  1298. label: '角色新增'
  1299. },
  1300. {
  1301. value: 71,
  1302. label: '角色编辑'
  1303. },
  1304. {
  1305. value: 72,
  1306. label: '角色删除'
  1307. }
  1308. ]
  1309. },
  1310. {
  1311. value: 4,
  1312. label: '菜单管理',
  1313. children: [
  1314. {
  1315. value: 73,
  1316. label: '菜单新增'
  1317. },
  1318. {
  1319. value: 75,
  1320. label: '菜单删除'
  1321. },
  1322. {
  1323. value: 74,
  1324. label: '菜单编辑'
  1325. }
  1326. ]
  1327. },
  1328. {
  1329. value: 5,
  1330. label: '部门管理',
  1331. children: [
  1332. {
  1333. value: 76,
  1334. label: '部门新增'
  1335. },
  1336. {
  1337. value: 77,
  1338. label: '部门编辑'
  1339. },
  1340. {
  1341. value: 78,
  1342. label: '部门删除'
  1343. }
  1344. ]
  1345. },
  1346. {
  1347. value: 6,
  1348. label: '字典管理',
  1349. children: [
  1350. {
  1351. value: 79,
  1352. label: '字典类型新增'
  1353. },
  1354. {
  1355. value: 81,
  1356. label: '字典类型编辑'
  1357. },
  1358. {
  1359. value: 84,
  1360. label: '字典类型删除'
  1361. },
  1362. {
  1363. value: 85,
  1364. label: '字典数据新增'
  1365. },
  1366. {
  1367. value: 86,
  1368. label: '字典数据编辑'
  1369. },
  1370. {
  1371. value: 87,
  1372. label: '字典数据删除'
  1373. }
  1374. ]
  1375. }
  1376. ]
  1377. },
  1378. {
  1379. value: 40,
  1380. label: '接口文档',
  1381. children: [
  1382. {
  1383. value: 41,
  1384. label: 'Apifox'
  1385. }
  1386. ]
  1387. },
  1388. {
  1389. value: 26,
  1390. label: '平台文档',
  1391. children: [
  1392. {
  1393. value: 102,
  1394. label: '平台文档(内嵌)'
  1395. },
  1396. {
  1397. value: 30,
  1398. label: '平台文档(外链)'
  1399. }
  1400. ]
  1401. },
  1402. {
  1403. value: 20,
  1404. label: '多级菜单',
  1405. children: [
  1406. {
  1407. value: 21,
  1408. label: '菜单一级',
  1409. children: [
  1410. {
  1411. value: 22,
  1412. label: '菜单二级',
  1413. children: [
  1414. {
  1415. value: 23,
  1416. label: '菜单三级-1'
  1417. },
  1418. {
  1419. value: 24,
  1420. label: '菜单三级-2'
  1421. }
  1422. ]
  1423. }
  1424. ]
  1425. }
  1426. ]
  1427. },
  1428. {
  1429. value: 36,
  1430. label: '组件封装',
  1431. children: [
  1432. {
  1433. value: 108,
  1434. label: '增删改查'
  1435. },
  1436. {
  1437. value: 109,
  1438. label: '列表选择器'
  1439. },
  1440. {
  1441. value: 37,
  1442. label: '富文本编辑器'
  1443. },
  1444. {
  1445. value: 38,
  1446. label: '图片上传'
  1447. },
  1448. {
  1449. value: 95,
  1450. label: '字典组件'
  1451. },
  1452. {
  1453. value: 39,
  1454. label: '图标选择器'
  1455. }
  1456. ]
  1457. },
  1458. {
  1459. value: 110,
  1460. label: '路由参数',
  1461. children: [
  1462. {
  1463. value: 111,
  1464. label: '参数(type=1)'
  1465. },
  1466. {
  1467. value: 112,
  1468. label: '参数(type=2)'
  1469. }
  1470. ]
  1471. },
  1472. {
  1473. value: 89,
  1474. label: '功能演示',
  1475. children: [
  1476. {
  1477. value: 97,
  1478. label: 'Icons'
  1479. },
  1480. {
  1481. value: 90,
  1482. label: 'Websocket'
  1483. },
  1484. {
  1485. value: 91,
  1486. label: '敬请期待...'
  1487. }
  1488. ]
  1489. }
  1490. ],
  1491. msg: '一切ok'
  1492. }
  1493. },
  1494. // 新增菜单
  1495. {
  1496. url: 'menus',
  1497. method: ['POST'],
  1498. body({ body }) {
  1499. return {
  1500. code: '00000',
  1501. data: null,
  1502. msg: '新增菜单' + body.name + '成功'
  1503. }
  1504. }
  1505. },
  1506. // 获取菜单表单数据
  1507. {
  1508. url: 'menus/:id/form',
  1509. method: ['GET'],
  1510. body: ({ params }) => {
  1511. return {
  1512. code: '00000',
  1513. data: menuMap[params.id],
  1514. msg: '一切ok'
  1515. }
  1516. }
  1517. },
  1518. // 修改菜单
  1519. {
  1520. url: 'menus/:id',
  1521. method: ['PUT'],
  1522. body({ body }) {
  1523. return {
  1524. code: '00000',
  1525. data: null,
  1526. msg: '修改菜单' + body.name + '成功'
  1527. }
  1528. }
  1529. },
  1530. // 删除菜单
  1531. {
  1532. url: 'menus/:id',
  1533. method: ['DELETE'],
  1534. body({ params }) {
  1535. return {
  1536. code: '00000',
  1537. data: null,
  1538. msg: '删除菜单' + params.id + '成功'
  1539. }
  1540. }
  1541. }
  1542. ])
  1543. // 菜单映射表数据
  1544. const menuMap: Record<string, any> = {
  1545. 1: {
  1546. id: 1,
  1547. parentId: 0,
  1548. name: '系统管理',
  1549. type: 'CATALOG',
  1550. routeName: '',
  1551. routePath: '/system',
  1552. component: 'Layout',
  1553. perm: null,
  1554. visible: 1,
  1555. sort: 1,
  1556. icon: 'system',
  1557. redirect: '/system/user',
  1558. keepAlive: null,
  1559. alwaysShow: null,
  1560. params: null
  1561. },
  1562. 2: {
  1563. id: 2,
  1564. parentId: 1,
  1565. name: '用户管理',
  1566. type: 'MENU',
  1567. routeName: 'User',
  1568. routePath: 'user',
  1569. component: 'system/user/index',
  1570. perm: null,
  1571. visible: 1,
  1572. sort: 1,
  1573. icon: 'user',
  1574. redirect: null,
  1575. keepAlive: 1,
  1576. alwaysShow: null
  1577. },
  1578. 3: {
  1579. id: 3,
  1580. parentId: 1,
  1581. name: '角色管理',
  1582. type: 'MENU',
  1583. routeName: 'Role',
  1584. routePath: 'role',
  1585. component: 'system/role/index',
  1586. perm: null,
  1587. visible: 1,
  1588. sort: 2,
  1589. icon: 'role',
  1590. redirect: null,
  1591. keepAlive: 1,
  1592. alwaysShow: null
  1593. },
  1594. 4: {
  1595. id: 4,
  1596. parentId: 1,
  1597. name: '菜单管理',
  1598. type: 'MENU',
  1599. routeName: 'Menu',
  1600. routePath: 'menu',
  1601. component: 'system/menu/index',
  1602. perm: null,
  1603. visible: 1,
  1604. sort: 3,
  1605. icon: 'menu',
  1606. redirect: null,
  1607. keepAlive: 1,
  1608. alwaysShow: null
  1609. },
  1610. 5: {
  1611. id: 5,
  1612. parentId: 1,
  1613. name: '部门管理',
  1614. type: 'MENU',
  1615. routeName: 'Dept',
  1616. routePath: 'dept',
  1617. component: 'system/dept/index',
  1618. perm: null,
  1619. visible: 1,
  1620. sort: 4,
  1621. icon: 'tree',
  1622. redirect: null,
  1623. keepAlive: 1,
  1624. alwaysShow: null
  1625. },
  1626. 6: {
  1627. id: 6,
  1628. parentId: 1,
  1629. name: '字典管理',
  1630. type: 'MENU',
  1631. routeName: 'Dict',
  1632. routePath: 'dict',
  1633. component: 'system/dict/index',
  1634. perm: null,
  1635. visible: 1,
  1636. sort: 5,
  1637. icon: 'dict',
  1638. redirect: null,
  1639. keepAlive: 1,
  1640. alwaysShow: null
  1641. }
  1642. }