home.vue 972 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <div>
  3. <el-button type="primary" plain @click="handleModuleJump('myTaskIndex', 'crm', 'CRM系统')">
  4. CRM系统
  5. </el-button>
  6. <el-button type="primary" plain @click="handleModuleJump('Index', 'admin', '爱思系统')">
  7. 系统管理
  8. </el-button>
  9. </div>
  10. </template>
  11. <script>
  12. import router from "../router";
  13. import store from "../store";
  14. export default {
  15. name:"Home",
  16. data() {
  17. return {};
  18. },
  19. methods: {
  20. handleModuleJump(name, type, title) {
  21. let that = this;
  22. //更改侧边栏参数及title
  23. // this.$store.commit('SET_SYSTEMTYPE', type)
  24. this.$store.commit('SET_SYSTEMTITLE', title)
  25. //生成侧边栏
  26. store.dispatch("GenerateRoutes").then((accessRoutes) => {
  27. // 根据roles权限生成可访问的路由表
  28. router.addRoutes(accessRoutes); // 动态添加可访问路由表
  29. that.$router.push({ name, query: { type, title } });
  30. });
  31. },
  32. },
  33. };
  34. </script>