TeamDetailDrawer.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <el-drawer v-model="showDrawer" direction="rtl" @close="clearData">
  3. <div class="team-detail__info">
  4. <div class="team-detail__info__team-name">{{ organization?.orgName }}</div>
  5. <div class="team-detail__info__member-count">
  6. 共 <span>{{ organization?.userNum || 0 }}</span> 人
  7. </div>
  8. </div>
  9. <div class="team-detail__description">
  10. <div class="team-detail__description__title"> 组织职责 </div>
  11. <div class="team-detail__description__content"> {{ organization?.depResp || '暂无职责'}} </div>
  12. </div>
  13. </el-drawer>
  14. </template>
  15. <script setup lang="ts">
  16. import { ref, watch } from 'vue';
  17. import {
  18. safetyOrgUserDetail,
  19. } from '@/api/safety-organization-management';
  20. const props = defineProps<{ selectedTeamId: number | null }>();
  21. type LevelAndPersonType = {
  22. positionLevel: number;
  23. title: string;
  24. personList: string[];
  25. };
  26. interface OrganizationInfoType {
  27. createdAt: Date;
  28. createdBy: number;
  29. depResp: string;
  30. id: number;
  31. isDeleted: number;
  32. orgName: string;
  33. parentId: number;
  34. updatedAt: Date;
  35. userNum: number;
  36. };
  37. const showDrawer = ref(false);
  38. const organization = ref<OrganizationInfoType>();
  39. function drawerShow() {
  40. showDrawer.value = true;
  41. }
  42. function clearData() {
  43. organization.value = undefined;
  44. }
  45. watch(
  46. () => showDrawer.value,
  47. async () => {
  48. if (showDrawer.value) {
  49. organization.value = await safetyOrgUserDetail(props.selectedTeamId!);
  50. }
  51. },
  52. );
  53. defineExpose({
  54. drawerShow,
  55. });
  56. </script>
  57. <style scoped lang="scss">
  58. .team-detail__info {
  59. display: flex;
  60. justify-content: space-between;
  61. align-items: center;
  62. margin-bottom: 20px;
  63. &__team-name {
  64. font-size: 20px;
  65. font-weight: bold;
  66. }
  67. &__member-count {
  68. span {
  69. color: #1777ff;
  70. }
  71. }
  72. }
  73. .team-detail__level {
  74. display: flex;
  75. align-items: center;
  76. margin-bottom: 10px;
  77. padding: 10px 0;
  78. border-left: 3px solid #1777ff;
  79. background-color: #e5effe;
  80. &__title {
  81. flex: 1;
  82. height: inherit;
  83. padding: 0 10px;
  84. color: #1777ff;
  85. text-align: center;
  86. white-space: nowrap;
  87. }
  88. &__content {
  89. flex: 10;
  90. display: flex;
  91. flex-wrap: wrap;
  92. padding: 0 15px;
  93. gap: 15px;
  94. border-left: 1px solid #c5c3c3;
  95. }
  96. }
  97. .team-detail__description {
  98. margin-top: 20px;
  99. &__title {
  100. margin-bottom: 10px;
  101. font-size: 16px;
  102. font-weight: bold;
  103. }
  104. &__content {
  105. color: #aaaaaa;
  106. white-space: pre-wrap;
  107. }
  108. }
  109. </style>