OrgnizationRow.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="orgnization_row">
  3. <view @click="itemClick(item, idx)" v-for="(item, idx) in orgList" :key="idx" class="orgnization_row_item">
  4. <my-avatar v-if="idx === 0" :desc="item.title" :src="item.icon" size="42" />
  5. <view v-else class="orz_icon">
  6. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/contact_dep_icon.png" mode=""></image>
  7. </view>
  8. <view class="item_content">
  9. <text class="title">
  10. {{ item.title }}
  11. </text>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import MyAvatar from '../../../../components/MyAvatar/index.vue';
  18. export default {
  19. name: '',
  20. components: {
  21. MyAvatar
  22. },
  23. props: {
  24. checkedUserInfoList: Array,
  25. checkedGroupInfoList: Array,
  26. disabledUserIDList: Array,
  27. groupID: String
  28. },
  29. data() {
  30. return {
  31. orgList: []
  32. };
  33. },
  34. mounted() {
  35. this.getOrganizationData();
  36. },
  37. methods: {
  38. itemClick({ departmentID }, idx) {
  39. uni.$u.route('/pages_im/pages/contact/orgnization/index', {
  40. title: this.$store.getters.storeOrganizationData.current.name,
  41. departmentID,
  42. checkedUserInfoList: JSON.stringify(this.checkedUserInfoList),
  43. checkedGroupInfoList: JSON.stringify(this.checkedGroupInfoList),
  44. disabledUserIDList: JSON.stringify(this.disabledUserIDList),
  45. groupID: this.groupID
  46. });
  47. },
  48. getOrganizationData() {
  49. let tmpList = [];
  50. tmpList.push({
  51. title: this.$store.getters.storeOrganizationData.current.name,
  52. icon: this.$store.getters.storeOrganizationData.current.faceURL,
  53. departmentID: this.$store.getters.storeOrganizationData.current.departmentID
  54. });
  55. const departmentList = (this.$store.getters.storeSelfInfo.members ?? []).map((item) => item.department);
  56. departmentList.map((item) => {
  57. tmpList.push({
  58. title: item.name,
  59. departmentID: item.departmentID
  60. });
  61. });
  62. this.orgList = [...tmpList];
  63. }
  64. }
  65. };
  66. </script>
  67. <style lang="scss" scoped>
  68. .orgnization_row {
  69. background-color: #fff;
  70. &_item {
  71. @include vCenterBox();
  72. margin: 0 44rpx;
  73. padding: 24rpx 0;
  74. .company_icon,
  75. .orz_icon {
  76. width: 42px;
  77. min-width: 42px;
  78. height: 42px;
  79. min-height: 42px;
  80. }
  81. .orz_icon {
  82. display: flex;
  83. justify-content: center;
  84. align-items: center;
  85. image {
  86. width: 36rpx;
  87. height: 36rpx;
  88. }
  89. }
  90. .item_content {
  91. @include btwBox();
  92. margin-left: 24rpx;
  93. width: 100%;
  94. position: relative;
  95. color: #0c1c33;
  96. }
  97. }
  98. }
  99. </style>