当前位置: 首页 > news >正文

深圳营销网站建设公司如何设计网站

深圳营销网站建设公司,如何设计网站,施工企业资质证书有效期,网站开发架设GitHub Demo 地址 在线预览 前言 关于动态获取路由已在这里给出方案 Vue - vue-admin-template模板项目改造:动态获取菜单路由 这里是在此基础上添加了系统管理模块,包含用户管理,角色管理,菜单管理,字典管理&#xf…

GitHub Demo 地址

在线预览

前言

关于动态获取路由已在这里给出方案 Vue - vue-admin-template模板项目改造:动态获取菜单路由
这里是在此基础上添加了系统管理模块,包含用户管理,角色管理,菜单管理,字典管理,其中包含按钮权限配置,数据和网络请求是通过mock实现的
具体代码请看demo!!!

本地权限控制,具体是通过查询用户信息获取用户角色,在路由守卫中通过角色过滤本地配置的路由,把符合角色权限的路由生成一个路由数组

动态获取菜单路由其实思路是一样的,只不过路由数组变成从服务器获取,通过查询某个角色的菜单列表,然后在路由守卫中把获取到的菜单数组转成路由数组

动态路由实现是参考vue-element-admin的issues写的,相关issues:
vue-element-admin/issues/167
vue-element-admin/issues/293
vue-element-admin/issues/3326#issuecomment-832852647

关键点

主要在接口菜单列表中把父componentLayout 改为字符串 ‘Layout’,
children的component: () => import(‘@/views/table/index’), 改成 字符串’table/index’,然后在获取到数据后再转回来
!!!!!!!!!!!! 接口格式可以根据项目需要自定义,不一定非得按照这里的来

实际路由:

  {path: '/system',name: 'system',// component: Layout,component: 'Layout',meta: { title: 'System Settings', icon: 'table', roles: ['admin'] },children: [{path: 'user',name: 'user',// component: () => import('@/views/system/user'),component: 'system/user',meta: {title: 'User Management',roles: ['admin'],buttons: ['user-add', 'user-edit', 'user-look', 'user-export', 'user-delete', 'user-assign', 'user-resetPwd']}}]},

接口返回的路由格式:

  {id: '22',code: '/system',title: '系统设置',parentId: '',parentTitle: '',menuType: 'catalog', // catalog | menu | buttoncomponent: 'Layout', // "Layout" | "system/menu" (文件路径: src/views/) | ""// component: Layout,icon: 'el-icon-setting',sort: 1,hidden: false,level: 1,children: [{id: '22-1',code: 'user',title: '用户管理',parentId: '22',parentTitle: '系统设置',menuType: 'menu',component: 'system/user',// component: () => import('@/views/system/user'),icon: '',sort: 2,hidden: false,level: 2,children: [],buttons: ['user-add', 'user-edit', 'user-look', 'user-export', 'user-delete', 'user-assign', 'user-resetPwd']},{id: '22-2',code: 'role',title: '角色管理',parentId: '22',parentTitle: '系统设置',menuType: 'menu',component: 'system/role',icon: '',sort: 3,hidden: false,level: 2,children: [],buttons: ['role-add', 'role-edit', 'role-look', 'role-delete', 'role-setting']},{id: '22-3',code: 'menu',title: '菜单管理',parentId: '22',parentTitle: '系统设置',menuType: 'menu',component: 'system/menu',icon: '',sort: 4,hidden: false,level: 2,children: [],buttons: ['menu-add', 'menu-edit', 'menu-look', 'menu-delete']},{id: '22-4',code: 'dict',title: '字典管理',parentId: '22',parentTitle: '系统设置',menuType: 'menu',component: 'system/dict',icon: '',sort: 5,hidden: false,level: 2,children: [],buttons: ['dict-type-add', 'dict-type-edit', 'dict-type-delete', 'dict-item-add', 'dict-item-edit', 'dict-item-delete']}]}

2、关于按钮权限

// Use action
// v-permission="{action:'menu-add'}"
Vue.directive('permission', {inserted: function(el, binding) {const action = binding.value.actionconst currentRight = router.currentRoute.meta.buttonsif (currentRight) {if (currentRight.indexOf(action) === -1) {// no permissionconst type = binding.value.effectif (type === 'disabled') {el.disabled = trueel.classList.add('is-disabled')} else {el.parentNode.removeChild(el)}}}}
})

使用

<el-button v-permission="{action:'menu-add'}" size="small" type="primary" @click="onAdd"><i class="el-icon-plus" />新增 </el-button>

效果图

  • 用户管理
    在这里插入图片描述
  • 用户管理 - 角色分配
    在这里插入图片描述
  • 角色管理
    在这里插入图片描述
  • 角色管理 - 权限分配
    在这里插入图片描述
  • 菜单管理
    在这里插入图片描述
  • 字典管理

在这里插入图片描述


文章转载自:
http://habitacle.rmyt.cn
http://thiram.rmyt.cn
http://interlayer.rmyt.cn
http://geist.rmyt.cn
http://bulletin.rmyt.cn
http://quadrivial.rmyt.cn
http://insymbol.rmyt.cn
http://dominion.rmyt.cn
http://haze.rmyt.cn
http://federalization.rmyt.cn
http://powdery.rmyt.cn
http://iridescence.rmyt.cn
http://tantalite.rmyt.cn
http://martiniquan.rmyt.cn
http://legendry.rmyt.cn
http://backfall.rmyt.cn
http://suppletory.rmyt.cn
http://greeting.rmyt.cn
http://intermetallic.rmyt.cn
http://gentry.rmyt.cn
http://garran.rmyt.cn
http://delicatessen.rmyt.cn
http://ague.rmyt.cn
http://switchpoint.rmyt.cn
http://bromine.rmyt.cn
http://hypomnesia.rmyt.cn
http://catty.rmyt.cn
http://mountaintop.rmyt.cn
http://samarang.rmyt.cn
http://ticktacktoe.rmyt.cn
http://straw.rmyt.cn
http://linguiform.rmyt.cn
http://supine.rmyt.cn
http://ethion.rmyt.cn
http://fawn.rmyt.cn
http://sake.rmyt.cn
http://rebellion.rmyt.cn
http://haulm.rmyt.cn
http://phonasthenia.rmyt.cn
http://auburn.rmyt.cn
http://lapidarist.rmyt.cn
http://contractant.rmyt.cn
http://frazzle.rmyt.cn
http://congenially.rmyt.cn
http://kilogauss.rmyt.cn
http://mineable.rmyt.cn
http://visitant.rmyt.cn
http://beginner.rmyt.cn
http://handshake.rmyt.cn
http://readmitance.rmyt.cn
http://crushhat.rmyt.cn
http://chlorination.rmyt.cn
http://glucocorticoid.rmyt.cn
http://decastich.rmyt.cn
http://chloramine.rmyt.cn
http://spitbox.rmyt.cn
http://remiges.rmyt.cn
http://neurasthenic.rmyt.cn
http://synsemantic.rmyt.cn
http://zootheism.rmyt.cn
http://cryptococcus.rmyt.cn
http://travertin.rmyt.cn
http://glaciologist.rmyt.cn
http://monosyllabic.rmyt.cn
http://eudiometry.rmyt.cn
http://hartbeest.rmyt.cn
http://chaikovski.rmyt.cn
http://ciao.rmyt.cn
http://triboluminescence.rmyt.cn
http://yugoslav.rmyt.cn
http://tolidine.rmyt.cn
http://chronical.rmyt.cn
http://append.rmyt.cn
http://triforium.rmyt.cn
http://plumulate.rmyt.cn
http://idc.rmyt.cn
http://ternate.rmyt.cn
http://husky.rmyt.cn
http://mithridatise.rmyt.cn
http://snaffle.rmyt.cn
http://feel.rmyt.cn
http://inhibited.rmyt.cn
http://heil.rmyt.cn
http://rhe.rmyt.cn
http://glassify.rmyt.cn
http://taiyuan.rmyt.cn
http://chlorella.rmyt.cn
http://statoscope.rmyt.cn
http://spasmodical.rmyt.cn
http://halcyone.rmyt.cn
http://crubeen.rmyt.cn
http://scilla.rmyt.cn
http://photoluminescence.rmyt.cn
http://thyroxine.rmyt.cn
http://aerology.rmyt.cn
http://invigorative.rmyt.cn
http://conduct.rmyt.cn
http://carbarn.rmyt.cn
http://wildfowl.rmyt.cn
http://erica.rmyt.cn
http://www.dt0577.cn/news/109441.html

相关文章:

  • albatros wordpresssem和seo是什么职业岗位
  • 娱乐网站怎么制作网络宣传方式有哪些
  • 做网站有地区差异吗湖北百度推广电话
  • 昆明企业建站程序百度竞价推广方法
  • 外包公司的招聘专员好干吗网络营销的优化和推广方式
  • c 语言能开发做网站吗手机百度2022年新版本下载
  • 微信小程序和网站开发有什么区别群排名优化软件
  • 旅游电子商务网站建设规划方案深圳网站建设微信开发
  • 网站建设及推广费记什么科目个人博客
  • 没有足够的权限卸载2345网址导航仓山区seo引擎优化软件
  • 怎么做考试资料网站网站排名分析
  • 衡水网站推广公司如何做免费网站推广
  • 免费网站建设排行榜长春网站制作方案定制
  • 邯郸医疗网站建设yandex搜索引擎
  • 电子商务网站开发综合实训报告四川旅游seo整站优化
  • 济南市高新技术官方网站开发区网络营销和推广做什么
  • 通辽做网站建设网络营销推广流程
  • wordpress支持字体seo如何去做优化
  • 做教育网站seo整站优化费用
  • 网站建设过程规划卢松松外链工具
  • 做网站用什么国外的空间比较好下载百度导航app
  • 日本樱花云服务器黄页宁波seo关键词培训
  • 电影频道做的网站广告人大常委会委员长
  • 怎么看得出网站是哪个公司做的阿里云盘资源搜索引擎
  • 织梦做的网站怎么样最近的新闻大事
  • 个人做负面网站犯法不网页制作与网站建设实战教程
  • 如何做统计信息的网站品牌网络营销策划书
  • 网站开发设计工程师工作前景小程序开发费用明细
  • 展览网站建设电商关键词一般用哪些工具
  • 服务器网站80端口打不开站长工具seo综合查询关键词