clickBtn.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div id="clickBtn">
  3. <el-row>
  4. <el-col :span="24" class="style">
  5. <span v-if="user.role == '4' || user.role == '5' || user.role == '6'">
  6. <van-cell is-link title="基本信息" @click="$router.push({ path: '/userCenter/user/index' })" />
  7. <van-cell is-link title="我的发布" @click="$router.push({ path: '/userCenter/myProduct/index' })" />
  8. <!--<van-cell is-link title="事项管理" @click="$router.push({ path: '/userCenter/matter/index' })" />
  9. <van-cell is-link title="展会管理" @click="$router.push({ path: '/userCenter/dock/index' })" />
  10. <van-cell is-link title="退出登录" @click="$router.push({ path: '/userCenter/out/index' })" /> -->
  11. </span>
  12. <span v-else>
  13. <span v-if="user.role == '0'">
  14. <van-cell is-link title="用户管理" @click="$router.push({ path: '/adminCenter/user/index' })" />
  15. <van-cell is-link title="展会管理" @click="$router.push({ path: '/adminCenter/duijiehui/index' })" />
  16. <van-cell is-link title="审核管理" @click="$router.push({ path: '/adminCenter/enterpriseProduct/index' })" />
  17. <van-cell is-link title="交易审核" @click="$router.push({ path: '/adminCenter/transaction/index' })" />
  18. </span>
  19. <span v-else-if="user.role == '1'">
  20. <van-cell is-link title="用户管理" @click="$router.push({ path: '/adminCenter/user/index' })" />
  21. <van-cell is-link title="审核管理" @click="$router.push({ path: '/adminCenter/enterpriseProduct/index' })" />
  22. </span>
  23. <span v-else-if="user.role == '3'">
  24. 展会负责人
  25. </span>
  26. <span v-else-if="user.role == '8'">
  27. 展会vip用户
  28. </span>
  29. </span>
  30. <van-cell is-link title="退出登录" @click="loginOut()" />
  31. <van-cell is-link title="修改密码" @click="change()" />
  32. <!-- <span v-else>
  33. <span v-else-if="user.role == '3'">
  34. <van-cell is-link title="展会管理" @click="$router.push({ path: '/dockCenter/dockInfo/index' })" />
  35. <van-cell is-link title="申请管理" @click="$router.push({ path: '/dockCenter/applyInfo/index' })" />
  36. <van-cell is-link title="VIP用户" @click="$router.push({ path: '/dockCenter/vipInfo/index' })" />
  37. <van-cell is-link title="交易备案" @click="$router.push({ path: '/dockCenter/transaction/index' })" />
  38. <van-cell is-link title="统计报表" @click="$router.push({ path: '/dockCenter/statisInfo/index' })" />
  39. <van-cell is-link title="动态监测" @click="$router.push({ path: '/dockCenter/dynamicInfo/index' })" />
  40. </span>
  41. <span v-else-if="user.role == '8'">
  42. <van-cell is-link title="统计报表" @click="$router.push({ path: '/vipDockCenter/statisInfo/index' })" />
  43. <van-cell is-link title="动态监测" @click="$router.push({ path: '/vipDockCenter/dynamicInfo/index' })" />
  44. </span>
  45. </span> -->
  46. </el-col>
  47. </el-row>
  48. </div>
  49. </template>
  50. <script>
  51. import { mapState, createNamespacedHelpers } from 'vuex';
  52. const { mapActions: login } = createNamespacedHelpers('login');
  53. export default {
  54. name: 'clickBtn',
  55. props: {},
  56. components: {},
  57. data: function() {
  58. return {
  59. oneName: '',
  60. twoName: '',
  61. threeName: '',
  62. fourName: '',
  63. };
  64. },
  65. created() {
  66. this.searchMenu();
  67. },
  68. methods: {
  69. ...login(['toGetMenu', 'logout']),
  70. async searchMenu() {
  71. // console.log(this.user);
  72. const res = await this.toGetMenu({ id: this.user.uid });
  73. for (const val of res.data.menus) {
  74. if (val.role_name == '用户管理') {
  75. this.$set(this, `oneName`, val.role_name);
  76. } else if (val.role_name == '对接会') {
  77. this.$set(this, `twoName`, val.role_name);
  78. } else if (val.role_name == '产品供求审核管理') {
  79. this.$set(this, `threeName`, val.role_name);
  80. } else if (val.role_name == '产品供求交易状态审核管理') {
  81. this.$set(this, `fourName`, val.role_name);
  82. }
  83. }
  84. },
  85. // 退出登录
  86. async loginOut() {
  87. this.logout();
  88. this.$notify({
  89. message: '退出成功',
  90. type: 'success',
  91. });
  92. this.$router.push({ path: '/live/index' });
  93. },
  94. //修改密码
  95. change() {
  96. this.$router.push({ path: './parts/changePwd' });
  97. },
  98. },
  99. computed: {
  100. ...mapState(['user']),
  101. pageTitle() {
  102. return `${this.$route.meta.title}`;
  103. },
  104. },
  105. metaInfo() {
  106. return { title: this.$route.meta.title };
  107. },
  108. };
  109. </script>
  110. <style lang="less" scoped></style>