1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156 |
- import config from '@/config/axios/config'
- import { MockMethod } from 'vite-plugin-mock'
- import Mock from 'mockjs'
- import { toAnyString } from '@/utils'
- const { code } = config
- const timeout = 1000
- const adminList = [
- {
- path: '/dashboard',
- component: '#',
- redirect: '/dashboard/analysis',
- name: 'Dashboard',
- meta: {
- title: 'router.dashboard',
- icon: 'ant-design:dashboard-filled',
- alwaysShow: true
- },
- children: [
- {
- path: 'analysis',
- component: 'views/Dashboard/Analysis',
- name: 'Analysis',
- meta: {
- title: 'router.analysis',
- noCache: true
- }
- },
- {
- path: 'workplace',
- component: 'views/Dashboard/Workplace',
- name: 'Workplace',
- meta: {
- title: 'router.workplace',
- noCache: true
- }
- }
- ]
- },
- {
- path: '/external-link',
- component: '#',
- meta: {},
- name: 'ExternalLink',
- children: [
- {
- path: 'https://element-plus-admin-doc.cn/',
- name: 'DocumentLink',
- meta: {
- title: 'router.document',
- icon: 'clarity:document-solid'
- }
- }
- ]
- },
- {
- path: '/guide',
- component: '#',
- name: 'Guide',
- meta: {},
- children: [
- {
- path: 'index',
- component: 'views/Guide/Guide',
- name: 'GuideDemo',
- meta: {
- title: 'router.guide',
- icon: 'cib:telegram-plane'
- }
- }
- ]
- },
- {
- path: '/components',
- component: '#',
- redirect: '/components/form/default-form',
- name: 'ComponentsDemo',
- meta: {
- title: 'router.component',
- icon: '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: '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: '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: '/function',
- component: '#',
- redirect: '/function/multipleTabs',
- name: 'Function',
- meta: {
- title: 'router.function',
- icon: 'ri:function-fill',
- alwaysShow: true
- },
- children: [
- {
- path: 'multipleTabs',
- component: 'views/Function/MultipleTabs',
- name: 'MultipleTabs',
- meta: {
- title: 'router.multipleTabs'
- }
- },
- {
- path: 'multipleTabs-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: '/hooks',
- component: '#',
- redirect: '/hooks/useWatermark',
- name: 'Hooks',
- meta: {
- title: 'hooks',
- icon: '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: '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: '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: '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: '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'
- }
- },
- {
- path: 'test',
- component: 'views/Authorization/Test/Test',
- name: 'Test',
- meta: {
- title: 'router.permission'
- }
- }
- ]
- }
- ]
- 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/ref-table',
- '/components/editor-demo',
- '/components/editor-demo/editor',
- '/components/editor-demo/json-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/InputPassword',
- '/Components/Sticky',
- 'function',
- '/function/multiple-tabs',
- '/function/multiple-tabs-demo/:id',
- '/function/request',
- '/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',
- '/authorization/test',
- '/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: '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: '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: '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: '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: '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: '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: '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: '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: '/role/list',
- method: 'get',
- timeout,
- response: () => {
- return {
- code: code,
- data: adminList
- }
- }
- },
- {
- url: '/role/table',
- method: 'get',
- timeout,
- response: () => {
- return {
- code: code,
- data: {
- list: List,
- total: 4
- }
- }
- }
- },
- // 列表接口
- {
- url: '/role/list2',
- method: 'get',
- timeout,
- response: () => {
- return {
- code: code,
- data: testList
- }
- }
- },
- {
- url: '/role/table',
- method: 'get',
- timeout,
- response: () => {
- return {
- code: code,
- data: {
- list: List,
- total: 4
- }
- }
- }
- }
- ] as MockMethod[]
|