| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <template>
- <div class="outer-person-container">
- <div class="container-title">
- <span class="line"></span>
- <span class="title">管理规定与通知</span>
- </div>
- <div class="tab-content">
- <el-tabs v-model="activeName">
- <el-tab-pane label="保卫" name="security">
- <div class="item-content">
- <div class="regulation-item" v-for="item in securityRegulationData" :key="item.id">
- <div class="round" @click="handleItemRedirect(item)"> </div>
- <div class="item-name" @click="handleItemRedirect(item)">{{ item.name }}</div>
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="保密" name="confidentiality">
- <div class="item-content">
- <div class="regulation-item" v-for="item in confidentialityRegulationData" :key="item.id">
- <div class="round" @click="handleItemRedirect(item)"> </div>
- <div class="item-name" @click="handleItemRedirect(item)">{{ item.name }}</div>
- </div>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- <div class="more">
- <span style="padding-right: 5px; cursor: pointer" @click="handleMoreRedirect">更多</span>
- <img
- style="cursor: pointer"
- @click="handleMoreRedirect"
- src="@/assets/images/security-confidientiality/overview-more.png"
- alt=""
- />
- </div>
- </div>
- </template>
- <script setup lang="ts">
- import { onUnmounted, ref, watch } from 'vue';
- import { useRouter } from 'vue-router';
- import type { RegulationItem } from '../types';
- import { getSecurityOverview, getConfidentialityOverview } from '@/api/security-confidentiality-overview';
- const router = useRouter();
- const activeName = ref(sessionStorage.getItem('security-confidentiality-overview-active') || 'security');
- const securityRegulationData = ref<RegulationItem[]>([]);
- const confidentialityRegulationData = ref<RegulationItem[]>([]);
- async function getSecurityRegulationData() {
- securityRegulationData.value = await getSecurityOverview();
- }
- async function getConfidentialityRegulationData() {
- confidentialityRegulationData.value = await getConfidentialityOverview();
- }
- onUnmounted(() => {
- sessionStorage.setItem('security-confidentiality-overview-active', activeName.value);
- });
- watch(
- () => activeName.value,
- (val) => {
- if (val === 'security') {
- getSecurityRegulationData();
- } else if (val === 'confidentiality') {
- getConfidentialityRegulationData();
- }
- },
- {
- immediate: true,
- },
- );
- function handleItemRedirect(item: RegulationItem) {
- sessionStorage.setItem(`${activeName.value}-regulation-active`, 'regulation');
- if (item.managementType === 1) {
- router.push({
- path: `/security-confidentiality/${activeName.value}-regulation-notice`,
- });
- } else if (item.managementType === 2) {
- router.push({
- path: `/security-confidentiality/${activeName.value}-regulation-notice-item`,
- query: { id: item.id, operate: 'notice-view' },
- });
- }
- }
- function handleMoreRedirect() {
- sessionStorage.setItem(`${activeName.value}-regulation-active`, 'regulation');
- router.push({
- path: `/security-confidentiality/${activeName.value}-regulation-notice`,
- });
- }
- </script>
- <style scoped lang="scss">
- .container-title {
- height: 24px;
- display: flex;
- align-items: center;
- font-weight: 500;
- font-size: 16px;
- color: #000000;
- .line {
- width: 3px;
- height: 16px;
- background: #1777ff;
- margin-right: 10px;
- }
- .title {
- margin-right: 12px;
- }
- }
- .outer-person-container {
- width: 100%;
- height: 100%;
- padding-top: 14px;
- }
- .tab-content {
- height: calc(100% - 50px);
- padding: 0 10px;
- }
- .regulation-item {
- padding: 7px 0;
- display: flex;
- align-items: center;
- }
- .round {
- width: 6px;
- height: 6px;
- background: #1777ff;
- border-radius: 50%;
- margin-right: 6px;
- cursor: pointer;
- }
- .item-name {
- max-width: calc(100% - 12px);
- color: rgba($color: #000000, $alpha: 0.85);
- font-size: 12px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- cursor: pointer;
- }
- .more {
- text-align: end;
- color: #007bff;
- font-size: 12px;
- padding: 0 10px;
- }
- :deep(.el-tabs__header) {
- margin: 0;
- }
- :deep(.el-tabs__item) {
- font-size: 14px !important;
- }
- </style>
|