clickBtn.vue 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <div id="clickBtn">
  3. <el-row>
  4. <el-col :span="24" class="style">
  5. <span v-if="user.role == '2' || user.role == '3' || user.role == '6' || user.role == '7'">
  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. </span>
  11. <span v-else>
  12. <span v-if="user.role == '1'">
  13. <van-cell is-link title="用户管理" @click="$router.push({ path: '/adminCenter/user/index' })" />
  14. <van-cell is-link title="对接会管理" />
  15. <van-cell is-link title="产品供求审核管理" />
  16. <van-cell is-link title="产品供求交易状态审核管理" />
  17. </span>
  18. <span v-else>
  19. <van-cell is-link title="用户管理" v-if="oneName == '用户管理'" />
  20. <van-cell is-link title="对接会管理" v-if="twoName == '对接会'" />
  21. <van-cell is-link title="产品供求审核管理" v-if="threeName == '产品供求审核管理'" />
  22. <van-cell is-link title="产品供求交易状态审核管理" v-if="fourName == '产品供求交易状态审核管理'" />
  23. </span>
  24. </span>
  25. </el-col>
  26. </el-row>
  27. </div>
  28. </template>
  29. <script>
  30. import { mapState, createNamespacedHelpers } from 'vuex';
  31. const { mapActions: login } = createNamespacedHelpers('login');
  32. export default {
  33. name: 'clickBtn',
  34. props: {},
  35. components: {},
  36. data: function() {
  37. return {
  38. oneName: '',
  39. twoName: '',
  40. threeName: '',
  41. fourName: '',
  42. };
  43. },
  44. created() {
  45. this.searchMenu();
  46. },
  47. methods: {
  48. ...login(['toGetMenu']),
  49. async searchMenu() {
  50. const res = await this.toGetMenu({ id: this.user.uid });
  51. for (const val of res.data.menus) {
  52. if (val.role_name == '用户管理') {
  53. this.$set(this, `oneName`, val.role_name);
  54. } else if (val.role_name == '对接会') {
  55. this.$set(this, `twoName`, val.role_name);
  56. } else if (val.role_name == '产品供求审核管理') {
  57. this.$set(this, `threeName`, val.role_name);
  58. } else if (val.role_name == '产品供求交易状态审核管理') {
  59. this.$set(this, `fourName`, val.role_name);
  60. }
  61. }
  62. },
  63. },
  64. computed: {
  65. ...mapState(['user']),
  66. pageTitle() {
  67. return `${this.$route.meta.title}`;
  68. },
  69. },
  70. metaInfo() {
  71. return { title: this.$route.meta.title };
  72. },
  73. };
  74. </script>
  75. <style lang="less" scoped></style>