menu.mock.ts 42 KB

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