menu.mock.ts 35 KB

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