12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235 |
- 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: 'tree',
- component: 'views/Components/Tree',
- name: 'Tree',
- meta: {
- title: 'router.tree'
- }
- }
- ]
- },
- {
- 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
- }
- }
- }
- }
- ]
|