123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227 |
- import Mock from 'mockjs'
- import { SUCCESS_CODE } from '@/constants'
- import { toAnyString } from '@/utils'
- const timeout = 1000
- const adminList = [
- {
- path: '/dashboard',
- component: '#',
- redirect: '/dashboard/analysis',
- name: 'Dashboard',
- meta: {
- title: 'router.dashboard',
- icon: 'vi-ant-design:dashboard-filled',
- alwaysShow: true
- },
- children: [
- {
- path: 'analysis',
- component: 'views/Dashboard/Analysis',
- name: 'Analysis',
- meta: {
- title: 'router.analysis',
- noCache: true,
- affix: true
- }
- },
- {
- path: 'workplace',
- component: 'views/Dashboard/Workplace',
- name: 'Workplace',
- meta: {
- title: 'router.workplace',
- noCache: true,
- affix: true
- }
- }
- ]
- },
- {
- path: '/external-link',
- component: '#',
- meta: {},
- name: 'ExternalLink',
- children: [
- {
- path: 'https://element-plus-admin-doc.cn/',
- name: 'DocumentLink',
- meta: {
- title: 'router.document',
- icon: 'vi-clarity:document-solid'
- }
- }
- ]
- },
- {
- path: '/guide',
- component: '#',
- name: 'Guide',
- meta: {},
- children: [
- {
- path: 'index',
- component: 'views/Guide/Guide',
- name: 'GuideDemo',
- meta: {
- title: 'router.guide',
- icon: 'vi-cib:telegram-plane'
- }
- }
- ]
- },
- {
- path: '/components',
- component: '#',
- redirect: '/components/form/default-form',
- name: 'ComponentsDemo',
- meta: {
- title: 'router.component',
- icon: 'vi-bx:bxs-component',
- alwaysShow: true
- },
- children: [
- {
- path: 'form',
- component: '##',
- name: 'Form',
- meta: {
- title: 'router.form',
- alwaysShow: true
- },
- children: [
- {
- path: 'default-form',
- component: 'views/Components/Form/DefaultForm',
- name: 'DefaultForm',
- meta: {
- title: 'router.defaultForm'
- }
- },
- {
- path: 'use-form',
- component: 'views/Components/Form/UseFormDemo',
- name: 'UseForm',
- meta: {
- title: 'UseForm'
- }
- }
- ]
- },
- {
- path: 'table',
- component: '##',
- redirect: '/components/table/default-table',
- name: 'TableDemo',
- meta: {
- title: 'router.table',
- alwaysShow: true
- },
- children: [
- {
- path: 'default-table',
- component: 'views/Components/Table/DefaultTable',
- name: 'DefaultTable',
- meta: {
- title: 'router.defaultTable'
- }
- },
- {
- path: 'use-table',
- component: 'views/Components/Table/UseTableDemo',
- name: 'UseTable',
- meta: {
- title: 'UseTable'
- }
- },
- {
- path: 'tree-table',
- component: 'views/Components/Table/TreeTable',
- name: 'TreeTable',
- meta: {
- title: 'TreeTable'
- }
- },
- {
- path: 'table-image-preview',
- component: 'views/Components/Table/TableImagePreview',
- name: 'TableImagePreview',
- meta: {
- title: 'router.PicturePreview'
- }
- },
- {
- path: 'table-video-preview',
- component: 'views/Components/Table/TableVideoPreview',
- name: 'TableVideoPreview',
- meta: {
- title: 'router.tableVideoPreview'
- }
- },
- {
- path: 'card-table',
- component: 'views/Components/Table/CardTable',
- name: 'CardTable',
- meta: {
- title: 'router.cardTable'
- }
- }
- // {
- // path: 'ref-table',
- // component: 'views/Components/Table/RefTable',
- // name: 'RefTable',
- // meta: {
- // title: 'RefTable'
- // }
- // }
- ]
- },
- {
- path: 'editor-demo',
- component: '##',
- redirect: '/components/editor-demo/editor',
- name: 'EditorDemo',
- meta: {
- title: 'router.editor',
- alwaysShow: true
- },
- children: [
- {
- path: 'editor',
- component: 'views/Components/Editor/Editor',
- name: 'Editor',
- meta: {
- title: 'router.richText'
- }
- },
- {
- path: 'json-editor',
- component: 'views/Components/Editor/JsonEditor',
- name: 'JsonEditor',
- meta: {
- title: 'router.jsonEditor'
- }
- },
- {
- path: 'code-editor',
- component: 'views/Components/Editor/CodeEditor',
- name: 'CodeEditor',
- meta: {
- title: 'router.codeEditor'
- }
- }
- ]
- },
- {
- path: 'search',
- component: 'views/Components/Search',
- name: 'Search',
- meta: {
- title: 'router.search'
- }
- },
- {
- path: 'descriptions',
- component: 'views/Components/Descriptions',
- name: 'Descriptions',
- meta: {
- title: 'router.descriptions'
- }
- },
- {
- path: 'image-viewer',
- component: 'views/Components/ImageViewer',
- name: 'ImageViewer',
- meta: {
- title: 'router.imageViewer'
- }
- },
- {
- path: 'dialog',
- component: 'views/Components/Dialog',
- name: 'Dialog',
- meta: {
- title: 'router.dialog'
- }
- },
- {
- path: 'icon',
- component: 'views/Components/Icon',
- name: 'Icon',
- meta: {
- title: 'router.icon'
- }
- },
- {
- path: 'icon-picker',
- component: 'views/Components/IconPicker',
- name: 'IconPicker',
- meta: {
- title: 'router.iconPicker'
- }
- },
- {
- path: 'echart',
- component: 'views/Components/Echart',
- name: 'Echart',
- meta: {
- title: 'router.echart'
- }
- },
- {
- path: 'count-to',
- component: 'views/Components/CountTo',
- name: 'CountTo',
- meta: {
- title: 'router.countTo'
- }
- },
- {
- path: 'qrcode',
- component: 'views/Components/Qrcode',
- name: 'Qrcode',
- meta: {
- title: 'router.qrcode'
- }
- },
- {
- path: 'highlight',
- component: 'views/Components/Highlight',
- name: 'Highlight',
- meta: {
- title: 'router.highlight'
- }
- },
- {
- path: 'infotip',
- component: 'views/Components/Infotip',
- name: 'Infotip',
- meta: {
- title: 'router.infotip'
- }
- },
- {
- path: 'input-password',
- component: 'views/Components/InputPassword',
- name: 'InputPassword',
- meta: {
- title: 'router.inputPassword'
- }
- },
- {
- path: 'waterfall',
- component: 'views/Components/Waterfall',
- name: 'Waterfall',
- meta: {
- title: 'router.waterfall'
- }
- },
- {
- path: 'image-cropping',
- component: 'views/Components/ImageCropping',
- name: 'ImageCropping',
- meta: {
- title: 'router.imageCropping'
- }
- },
- {
- path: 'video-player',
- component: 'views/Components/VideoPlayer',
- name: 'VideoPlayer',
- meta: {
- title: 'router.videoPlayer'
- }
- },
- {
- path: 'avatars',
- component: 'views/Components/Avatars',
- name: 'Avatars',
- meta: {
- title: 'router.avatars'
- }
- },
- {
- path: 'i-agree',
- component: 'views/Components/IAgree',
- name: 'IAgree',
- meta: {
- title: 'router.iAgree'
- }
- }
- ]
- },
- {
- path: '/function',
- component: '#',
- redirect: '/function/multipleTabs',
- name: 'Function',
- meta: {
- title: 'router.function',
- icon: 'vi-ri:function-fill',
- alwaysShow: true
- },
- children: [
- {
- path: 'multipleTabs',
- component: 'views/Function/MultipleTabs',
- name: 'MultipleTabs',
- meta: {
- title: 'router.multipleTabs'
- }
- },
- {
- path: 'multiple-tabs-demo/:id',
- component: 'views/Function/MultipleTabsDemo',
- name: 'MultipleTabsDemo',
- meta: {
- hidden: true,
- title: 'router.details',
- canTo: true
- }
- },
- {
- path: 'request',
- component: 'views/Function/Request',
- name: 'Request',
- meta: {
- title: 'router.request'
- }
- },
- {
- path: 'test',
- component: 'views/Function/Test',
- name: 'Test',
- meta: {
- title: 'router.permission',
- permission: ['add', 'edit', 'delete']
- }
- }
- ]
- },
- {
- path: '/hooks',
- component: '#',
- redirect: '/hooks/useWatermark',
- name: 'Hooks',
- meta: {
- title: 'hooks',
- icon: 'vi-ic:outline-webhook',
- alwaysShow: true
- },
- children: [
- {
- path: 'useWatermark',
- component: 'views/hooks/useWatermark',
- name: 'UseWatermark',
- meta: {
- title: 'useWatermark'
- }
- },
- {
- path: 'useTagsView',
- component: 'views/hooks/useTagsView',
- name: 'UseTagsView',
- meta: {
- title: 'useTagsView'
- }
- },
- {
- path: 'useValidator',
- component: 'views/hooks/useValidator',
- name: 'UseValidator',
- meta: {
- title: 'useValidator'
- }
- },
- {
- path: 'useCrudSchemas',
- component: 'views/hooks/useCrudSchemas',
- name: 'UseCrudSchemas',
- meta: {
- title: 'useCrudSchemas'
- }
- },
- {
- path: 'useClipboard',
- component: 'views/hooks/useClipboard',
- name: 'UseClipboard',
- meta: {
- title: 'useClipboard'
- }
- },
- {
- path: 'useNetwork',
- component: 'views/hooks/useNetwork',
- name: 'UseNetwork',
- meta: {
- title: 'useNetwork'
- }
- }
- ]
- },
- {
- path: '/level',
- component: '#',
- redirect: '/level/menu1/menu1-1/menu1-1-1',
- name: 'Level',
- meta: {
- title: 'router.level',
- icon: 'vi-carbon:skill-level-advanced'
- },
- children: [
- {
- path: 'menu1',
- name: 'Menu1',
- component: '##',
- redirect: '/level/menu1/menu1-1/menu1-1-1',
- meta: {
- title: 'router.menu1'
- },
- children: [
- {
- path: 'menu1-1',
- name: 'Menu11',
- component: '##',
- redirect: '/level/menu1/menu1-1/menu1-1-1',
- meta: {
- title: 'router.menu11',
- alwaysShow: true
- },
- children: [
- {
- path: 'menu1-1-1',
- name: 'Menu111',
- component: 'views/Level/Menu111',
- meta: {
- title: 'router.menu111'
- }
- }
- ]
- },
- {
- path: 'menu1-2',
- name: 'Menu12',
- component: 'views/Level/Menu12',
- meta: {
- title: 'router.menu12'
- }
- }
- ]
- },
- {
- path: 'menu2',
- name: 'Menu2Demo',
- component: 'views/Level/Menu2',
- meta: {
- title: 'router.menu2'
- }
- }
- ]
- },
- {
- path: '/example',
- component: '#',
- redirect: '/example/example-dialog',
- name: 'Example',
- meta: {
- title: 'router.example',
- icon: 'vi-ep:management',
- alwaysShow: true
- },
- children: [
- {
- path: 'example-dialog',
- component: 'views/Example/Dialog/ExampleDialog',
- name: 'ExampleDialog',
- meta: {
- title: 'router.exampleDialog'
- }
- },
- {
- path: 'example-page',
- component: 'views/Example/Page/ExamplePage',
- name: 'ExamplePage',
- meta: {
- title: 'router.examplePage'
- }
- },
- {
- path: 'example-add',
- component: 'views/Example/Page/ExampleAdd',
- name: 'ExampleAdd',
- meta: {
- title: 'router.exampleAdd',
- noTagsView: true,
- noCache: true,
- hidden: true,
- showMainRoute: true,
- activeMenu: '/example/example-page'
- }
- },
- {
- path: 'example-edit',
- component: 'views/Example/Page/ExampleEdit',
- name: 'ExampleEdit',
- meta: {
- title: 'router.exampleEdit',
- noTagsView: true,
- noCache: true,
- hidden: true,
- showMainRoute: true,
- activeMenu: '/example/example-page'
- }
- },
- {
- path: 'example-detail',
- component: 'views/Example/Page/ExampleDetail',
- name: 'ExampleDetail',
- meta: {
- title: 'router.exampleDetail',
- noTagsView: true,
- noCache: true,
- hidden: true,
- showMainRoute: true,
- activeMenu: '/example/example-page'
- }
- }
- ]
- },
- {
- path: '/error',
- component: '#',
- redirect: '/error/404',
- name: 'Error',
- meta: {
- title: 'router.errorPage',
- icon: 'vi-ci:error',
- alwaysShow: true
- },
- children: [
- {
- path: '404-demo',
- component: 'views/Error/404',
- name: '404Demo',
- meta: {
- title: '404'
- }
- },
- {
- path: '403-demo',
- component: 'views/Error/403',
- name: '403Demo',
- meta: {
- title: '403'
- }
- },
- {
- path: '500-demo',
- component: 'views/Error/500',
- name: '500Demo',
- meta: {
- title: '500'
- }
- }
- ]
- },
- {
- path: '/authorization',
- component: '#',
- redirect: '/authorization/user',
- name: 'Authorization',
- meta: {
- title: 'router.authorization',
- icon: 'vi-eos-icons:role-binding',
- alwaysShow: true
- },
- children: [
- {
- path: 'department',
- component: 'views/Authorization/Department/Department',
- name: 'Department',
- meta: {
- title: 'router.department'
- }
- },
- {
- path: 'user',
- component: 'views/Authorization/User/User',
- name: 'User',
- meta: {
- title: 'router.user'
- }
- },
- {
- path: 'menu',
- component: 'views/Authorization/Menu/Menu',
- name: 'Menu',
- meta: {
- title: 'router.menuManagement'
- }
- },
- {
- path: 'role',
- component: 'views/Authorization/Role/Role',
- name: 'Role',
- meta: {
- title: 'router.role'
- }
- }
- ]
- }
- ]
- const testList: string[] = [
- '/dashboard',
- '/dashboard/analysis',
- '/dashboard/workplace',
- 'external-link',
- 'https://element-plus-admin-doc.cn/',
- '/guide',
- '/guide/index',
- '/components',
- '/components/form',
- '/components/form/default-form',
- '/components/form/use-form',
- '/components/form/ref-form',
- '/components/table',
- '/components/table/default-table',
- '/components/table/use-table',
- '/components/table/tree-table',
- '/components/table/table-image-preview',
- '/components/table/table-video-preview',
- '/components/table/ref-table',
- '/components/table/card-table',
- '/components/editor-demo',
- '/components/editor-demo/editor',
- '/components/editor-demo/json-editor',
- '/components/editor-demo/code-editor',
- '/components/search',
- '/components/descriptions',
- '/components/image-viewer',
- '/components/dialog',
- '/components/icon',
- '/components/iconPicker',
- '/components/echart',
- '/components/count-to',
- '/components/qrcode',
- '/components/highlight',
- '/components/infotip',
- '/components/input-password',
- '/components/waterfall',
- '/components/image-cropping',
- '/components/video-player',
- '/components/avatars',
- '/components/i-agree',
- 'function',
- '/function/multiple-tabs',
- '/function/multiple-tabs-demo/:id',
- '/function/request',
- '/function/test',
- '/hooks',
- '/hooks/useWatermark',
- '/hooks/useTagsView',
- '/hooks/useValidator',
- '/hooks/useCrudSchemas',
- '/hooks/useClipboard',
- '/hooks/useNetwork',
- '/level',
- '/level/menu1',
- '/level/menu1/menu1-1',
- '/level/menu1/menu1-1/menu1-1-1',
- '/level/menu1/menu1-2',
- '/level/menu2',
- '/example',
- '/example/example-dialog',
- '/example/example-page',
- '/example/example-add',
- '/example/example-edit',
- '/example/example-detail',
- '/authorization',
- '/authorization/department',
- '/authorization/user',
- '/authorization/role',
- '/authorization/menu',
- '/error',
- '/error/404-demo',
- '/error/403-demo',
- '/error/500-demo'
- ]
- const List: any[] = []
- const roleNames = ['超级管理员', '管理员', '普通用户', '游客']
- const menus = [
- [
- {
- path: '/dashboard',
- component: '#',
- redirect: '/dashboard/analysis',
- name: 'Dashboard',
- status: Mock.Random.integer(0, 1),
- id: 1,
- meta: {
- title: '首页',
- icon: 'vi-ant-design:dashboard-filled',
- alwaysShow: true
- },
- children: [
- {
- path: 'analysis',
- component: 'views/Dashboard/Analysis',
- name: 'Analysis',
- status: Mock.Random.integer(0, 1),
- id: 2,
- meta: {
- title: '分析页',
- noCache: true
- }
- },
- {
- path: 'workplace',
- component: 'views/Dashboard/Workplace',
- name: 'Workplace',
- status: Mock.Random.integer(0, 1),
- id: 3,
- meta: {
- title: '工作台',
- noCache: true
- }
- }
- ]
- },
- {
- path: '/external-link',
- component: '#',
- meta: {
- title: '文档',
- icon: 'vi-clarity:document-solid'
- },
- name: 'ExternalLink',
- status: Mock.Random.integer(0, 1),
- id: 4,
- children: [
- {
- path: 'https://element-plus-admin-doc.cn/',
- name: 'DocumentLink',
- status: Mock.Random.integer(0, 1),
- id: 5,
- meta: {
- title: '文档'
- }
- }
- ]
- },
- {
- path: '/level',
- component: '#',
- redirect: '/level/menu1/menu1-1/menu1-1-1',
- name: 'Level',
- status: Mock.Random.integer(0, 1),
- id: 6,
- meta: {
- title: '菜单',
- icon: 'vi-carbon:skill-level-advanced'
- },
- children: [
- {
- path: 'menu1',
- name: 'Menu1',
- component: '##',
- status: Mock.Random.integer(0, 1),
- id: 7,
- redirect: '/level/menu1/menu1-1/menu1-1-1',
- meta: {
- title: '菜单1'
- },
- children: [
- {
- path: 'menu1-1',
- name: 'Menu11',
- component: '##',
- status: Mock.Random.integer(0, 1),
- id: 8,
- redirect: '/level/menu1/menu1-1/menu1-1-1',
- meta: {
- title: '菜单1-1',
- alwaysShow: true
- },
- children: [
- {
- path: 'menu1-1-1',
- name: 'Menu111',
- component: 'views/Level/Menu111',
- status: Mock.Random.integer(0, 1),
- id: 9,
- permission: ['edit', 'add', 'delete'],
- meta: {
- title: '菜单1-1-1',
- permission: ['edit', 'add', 'delete']
- }
- }
- ]
- },
- {
- path: 'menu1-2',
- name: 'Menu12',
- component: 'views/Level/Menu12',
- status: Mock.Random.integer(0, 1),
- id: 10,
- permission: ['edit', 'add', 'delete'],
- meta: {
- title: '菜单1-2',
- permission: ['edit', 'add', 'delete']
- }
- }
- ]
- },
- {
- path: 'menu2',
- name: 'Menu2Demo',
- component: 'views/Level/Menu2',
- status: Mock.Random.integer(0, 1),
- id: 11,
- permission: ['edit', 'add', 'delete'],
- meta: {
- title: '菜单2',
- permission: ['edit', 'add', 'delete']
- }
- }
- ]
- },
- {
- path: '/example',
- component: '#',
- redirect: '/example/example-dialog',
- name: 'Example',
- status: Mock.Random.integer(0, 1),
- id: 12,
- meta: {
- title: '综合示例',
- icon: 'vi-ep:management',
- alwaysShow: true
- },
- children: [
- {
- path: 'example-dialog',
- component: 'views/Example/Dialog/ExampleDialog',
- name: 'ExampleDialog',
- status: Mock.Random.integer(0, 1),
- id: 13,
- permission: ['edit', 'add', 'delete'],
- meta: {
- title: '综合示例-弹窗',
- permission: ['edit', 'add', 'delete']
- }
- },
- {
- path: 'example-page',
- component: 'views/Example/Page/ExamplePage',
- name: 'ExamplePage',
- status: Mock.Random.integer(0, 1),
- id: 14,
- permission: ['edit', 'add', 'delete'],
- meta: {
- title: '综合示例-页面',
- permission: ['edit', 'add', 'delete']
- }
- },
- {
- path: 'example-add',
- component: 'views/Example/Page/ExampleAdd',
- name: 'ExampleAdd',
- status: Mock.Random.integer(0, 1),
- id: 15,
- permission: ['edit', 'add', 'delete'],
- meta: {
- title: '综合示例-新增',
- noTagsView: true,
- noCache: true,
- hidden: true,
- showMainRoute: true,
- activeMenu: '/example/example-page',
- permission: ['edit', 'add', 'delete']
- }
- },
- {
- path: 'example-edit',
- component: 'views/Example/Page/ExampleEdit',
- name: 'ExampleEdit',
- status: Mock.Random.integer(0, 1),
- id: 16,
- permission: ['edit', 'add', 'delete'],
- meta: {
- title: '综合示例-编辑',
- noTagsView: true,
- noCache: true,
- hidden: true,
- showMainRoute: true,
- activeMenu: '/example/example-page',
- permission: ['edit', 'add', 'delete']
- }
- },
- {
- path: 'example-detail',
- component: 'views/Example/Page/ExampleDetail',
- name: 'ExampleDetail',
- status: Mock.Random.integer(0, 1),
- id: 17,
- permission: ['edit', 'add', 'delete'],
- meta: {
- title: '综合示例-详情',
- noTagsView: true,
- noCache: true,
- hidden: true,
- showMainRoute: true,
- activeMenu: '/example/example-page',
- permission: ['edit', 'add', 'delete']
- }
- }
- ]
- }
- ],
- [
- {
- path: '/dashboard',
- component: '#',
- redirect: '/dashboard/analysis',
- name: 'Dashboard',
- status: Mock.Random.integer(0, 1),
- id: 1,
- meta: {
- title: '首页',
- icon: 'vi-ant-design:dashboard-filled',
- alwaysShow: true
- },
- children: [
- {
- path: 'analysis',
- component: 'views/Dashboard/Analysis',
- name: 'Analysis',
- status: Mock.Random.integer(0, 1),
- id: 2,
- meta: {
- title: '分析页',
- noCache: true
- }
- },
- {
- path: 'workplace',
- component: 'views/Dashboard/Workplace',
- name: 'Workplace',
- status: Mock.Random.integer(0, 1),
- id: 3,
- meta: {
- title: '工作台',
- noCache: true
- }
- }
- ]
- }
- ],
- [
- {
- path: '/external-link',
- component: '#',
- meta: {
- title: '文档',
- icon: 'vi-clarity:document-solid'
- },
- name: 'ExternalLink',
- status: Mock.Random.integer(0, 1),
- id: 4,
- children: [
- {
- path: 'https://element-plus-admin-doc.cn/',
- name: 'DocumentLink',
- status: Mock.Random.integer(0, 1),
- id: 5,
- meta: {
- title: '文档'
- }
- }
- ]
- },
- {
- path: '/level',
- component: '#',
- redirect: '/level/menu1/menu1-1/menu1-1-1',
- name: 'Level',
- status: Mock.Random.integer(0, 1),
- id: 6,
- meta: {
- title: '菜单',
- icon: 'vi-carbon:skill-level-advanced'
- },
- children: [
- {
- path: 'menu1',
- name: 'Menu1',
- component: '##',
- status: Mock.Random.integer(0, 1),
- id: 7,
- redirect: '/level/menu1/menu1-1/menu1-1-1',
- meta: {
- title: '菜单1'
- },
- children: [
- {
- path: 'menu1-1',
- name: 'Menu11',
- component: '##',
- status: Mock.Random.integer(0, 1),
- id: 8,
- redirect: '/level/menu1/menu1-1/menu1-1-1',
- meta: {
- title: '菜单1-1',
- alwaysShow: true
- },
- children: [
- {
- path: 'menu1-1-1',
- name: 'Menu111',
- component: 'views/Level/Menu111',
- status: Mock.Random.integer(0, 1),
- id: 9,
- permission: ['edit', 'add', 'delete'],
- meta: {
- title: '菜单1-1-1',
- permission: ['edit', 'add', 'delete']
- }
- }
- ]
- },
- {
- path: 'menu1-2',
- name: 'Menu12',
- component: 'views/Level/Menu12',
- status: Mock.Random.integer(0, 1),
- id: 10,
- permission: ['edit', 'add', 'delete'],
- meta: {
- title: '菜单1-2',
- permission: ['edit', 'add', 'delete']
- }
- }
- ]
- },
- {
- path: 'menu2',
- name: 'Menu2Demo',
- component: 'views/Level/Menu2',
- status: Mock.Random.integer(0, 1),
- id: 11,
- permission: ['edit', 'add', 'delete'],
- meta: {
- title: '菜单2',
- permission: ['edit', 'add', 'delete']
- }
- }
- ]
- }
- ],
- [
- {
- path: '/example',
- component: '#',
- redirect: '/example/example-dialog',
- name: 'Example',
- status: Mock.Random.integer(0, 1),
- id: 12,
- meta: {
- title: '综合示例',
- icon: 'vi-ep:management',
- alwaysShow: true
- },
- children: [
- {
- path: 'example-detail',
- component: 'views/Example/Page/ExampleDetail',
- name: 'ExampleDetail',
- status: Mock.Random.integer(0, 1),
- id: 17,
- permission: ['edit', 'add', 'delete'],
- meta: {
- title: '综合示例-详情',
- noTagsView: true,
- noCache: true,
- hidden: true,
- showMainRoute: true,
- activeMenu: '/example/example-page',
- permission: ['edit', 'add', 'delete']
- }
- }
- ]
- }
- ]
- ]
- for (let i = 0; i < 4; i++) {
- List.push(
- Mock.mock({
- id: toAnyString(),
- // timestamp: +Mock.Random.date('T'),
- roleName: roleNames[i],
- role: '@first',
- status: Mock.Random.integer(0, 1),
- createTime: '@datetime',
- remark: '@cword(10, 15)',
- menu: menus[i]
- })
- )
- }
- export default [
- // 列表接口
- {
- url: '/mock/role/list',
- method: 'get',
- timeout,
- response: () => {
- return {
- code: SUCCESS_CODE,
- data: adminList
- }
- }
- },
- {
- url: '/mock/role/table',
- method: 'get',
- timeout,
- response: () => {
- return {
- code: SUCCESS_CODE,
- data: {
- list: List,
- total: 4
- }
- }
- }
- },
- // 列表接口
- {
- url: '/mock/role/list2',
- method: 'get',
- timeout,
- response: () => {
- return {
- code: SUCCESS_CODE,
- data: testList
- }
- }
- },
- {
- url: '/mock/role/table',
- method: 'get',
- timeout,
- response: () => {
- return {
- code: SUCCESS_CODE,
- data: {
- list: List,
- total: 4
- }
- }
- }
- }
- ]
|