RegulationAndNotice.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <div class="outer-person-container">
  3. <div class="container-title">
  4. <span class="line"></span>
  5. <span class="title">管理规定与通知</span>
  6. </div>
  7. <div class="tab-content">
  8. <el-tabs v-model="activeName">
  9. <el-tab-pane label="保卫" name="security">
  10. <div class="item-content">
  11. <div class="regulation-item" v-for="item in securityRegulationData" :key="item.id">
  12. <div class="round" @click="handleItemRedirect(item)"> </div>
  13. <div class="item-name" @click="handleItemRedirect(item)">{{ item.name }}</div>
  14. </div>
  15. </div>
  16. </el-tab-pane>
  17. <el-tab-pane label="保密" name="confidentiality">
  18. <div class="item-content">
  19. <div class="regulation-item" v-for="item in confidentialityRegulationData" :key="item.id">
  20. <div class="round" @click="handleItemRedirect(item)"> </div>
  21. <div class="item-name" @click="handleItemRedirect(item)">{{ item.name }}</div>
  22. </div>
  23. </div>
  24. </el-tab-pane>
  25. </el-tabs>
  26. </div>
  27. <div class="more">
  28. <span style="padding-right: 5px; cursor: pointer" @click="handleMoreRedirect">更多</span>
  29. <img
  30. style="cursor: pointer"
  31. @click="handleMoreRedirect"
  32. src="@/assets/images/security-confidientiality/overview-more.png"
  33. alt=""
  34. />
  35. </div>
  36. </div>
  37. </template>
  38. <script setup lang="ts">
  39. import { onUnmounted, ref, watch } from 'vue';
  40. import { useRouter } from 'vue-router';
  41. import type { RegulationItem } from '../types';
  42. import { getSecurityOverview, getConfidentialityOverview } from '@/api/security-confidentiality-overview';
  43. const router = useRouter();
  44. const activeName = ref(sessionStorage.getItem('security-confidentiality-overview-active') || 'security');
  45. const securityRegulationData = ref<RegulationItem[]>([]);
  46. const confidentialityRegulationData = ref<RegulationItem[]>([]);
  47. async function getSecurityRegulationData() {
  48. securityRegulationData.value = await getSecurityOverview();
  49. }
  50. async function getConfidentialityRegulationData() {
  51. confidentialityRegulationData.value = await getConfidentialityOverview();
  52. }
  53. onUnmounted(() => {
  54. sessionStorage.setItem('security-confidentiality-overview-active', activeName.value);
  55. });
  56. watch(
  57. () => activeName.value,
  58. (val) => {
  59. if (val === 'security') {
  60. getSecurityRegulationData();
  61. } else if (val === 'confidentiality') {
  62. getConfidentialityRegulationData();
  63. }
  64. },
  65. {
  66. immediate: true,
  67. },
  68. );
  69. function handleItemRedirect(item: RegulationItem) {
  70. sessionStorage.setItem(`${activeName.value}-regulation-active`, 'regulation');
  71. if (item.managementType === 1) {
  72. router.push({
  73. path: `/security-confidentiality/${activeName.value}-regulation-notice`,
  74. });
  75. } else if (item.managementType === 2) {
  76. router.push({
  77. path: `/security-confidentiality/${activeName.value}-regulation-notice-item`,
  78. query: { id: item.id, operate: 'notice-view' },
  79. });
  80. }
  81. }
  82. function handleMoreRedirect() {
  83. sessionStorage.setItem(`${activeName.value}-regulation-active`, 'regulation');
  84. router.push({
  85. path: `/security-confidentiality/${activeName.value}-regulation-notice`,
  86. });
  87. }
  88. </script>
  89. <style scoped lang="scss">
  90. .container-title {
  91. height: 24px;
  92. display: flex;
  93. align-items: center;
  94. font-weight: 500;
  95. font-size: 16px;
  96. color: #000000;
  97. .line {
  98. width: 3px;
  99. height: 16px;
  100. background: #1777ff;
  101. margin-right: 10px;
  102. }
  103. .title {
  104. margin-right: 12px;
  105. }
  106. }
  107. .outer-person-container {
  108. width: 100%;
  109. height: 100%;
  110. padding-top: 14px;
  111. }
  112. .tab-content {
  113. height: calc(100% - 50px);
  114. padding: 0 10px;
  115. }
  116. .regulation-item {
  117. padding: 7px 0;
  118. display: flex;
  119. align-items: center;
  120. }
  121. .round {
  122. width: 6px;
  123. height: 6px;
  124. background: #1777ff;
  125. border-radius: 50%;
  126. margin-right: 6px;
  127. cursor: pointer;
  128. }
  129. .item-name {
  130. max-width: calc(100% - 12px);
  131. color: rgba($color: #000000, $alpha: 0.85);
  132. font-size: 12px;
  133. overflow: hidden;
  134. text-overflow: ellipsis;
  135. white-space: nowrap;
  136. cursor: pointer;
  137. }
  138. .more {
  139. text-align: end;
  140. color: #007bff;
  141. font-size: 12px;
  142. padding: 0 10px;
  143. }
  144. :deep(.el-tabs__header) {
  145. margin: 0;
  146. }
  147. :deep(.el-tabs__item) {
  148. font-size: 14px !important;
  149. }
  150. </style>