Merge branch 'master' of https://gitcode.com/hk_openRepo/OpenRepo_Portal into junjie_dev
# Conflicts: # src/views/Jyh/Home/index.vue
This commit is contained in:
@@ -59,14 +59,18 @@
|
||||
</d-dropdown-menu>
|
||||
<d-button color="primary" variant="solid" @click="search">搜索</d-button>
|
||||
</div>
|
||||
<d-button v-if="isLogin" @click="check" ref="origin" icon="share" class="batch-btn">批量校验</d-button>
|
||||
<d-button @click="check" ref="origin" icon="share" class="batch-btn">批量校验</d-button>
|
||||
<div class="home-information">
|
||||
<div class="info-title">
|
||||
<div class="sub-title">
|
||||
<img src="@/assets/imgs/home/informIcon@2x.png" />
|
||||
<span>预警公告</span>
|
||||
</div>
|
||||
<a v-if="isLogin" class="devui-link" @click="checkMore">更多 ></a>
|
||||
|
||||
<!-- <a v-if="accountInfo.access_token" class="devui-link" @click="checkMore"
|
||||
>更多 <i class="icon icon-chevron-right-2"></i>
|
||||
</a>
|
||||
<span v-else class="text-blue-500">查看更多,请先登录</span> -->
|
||||
</div>
|
||||
<div class="info-content">
|
||||
<d-timeline :direction="'vertical'" :time-position="'right'" :position="'right'">
|
||||
@@ -83,11 +87,11 @@
|
||||
@click="openWarningDetail(item, index)"
|
||||
>
|
||||
<span>{{ item.subject }}</span>
|
||||
<d-tag v-if="item.importance" :color="tagMap[item.importance].color" size="sm">{{ tagMap[item.importance].text }}</d-tag>
|
||||
<d-tag :color="tagMap[item.importance]" size="sm">{{ item.importance }}</d-tag>
|
||||
</div>
|
||||
<div class="time-container">
|
||||
<d-icon name="icon-time"></d-icon>
|
||||
{{ item.publishTime }}
|
||||
{{ item.pulishTime }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -109,15 +113,14 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onBeforeUnmount } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useAccount } from '@/utils/hooks/useAccount';
|
||||
import AdvanceSearch from '@/components/AdvanceSearch/index.vue';
|
||||
import { getHomeNoticeList } from '@/api/jyh';
|
||||
import EarlyWarningDetail from '@/views/Jyh/PersonalCenter/Detail/EarlyWarningDetail.vue';
|
||||
import { useDiscussGetUserInfo } from '@/api/discussion/hook';
|
||||
import { useGlobalInfoStore } from '@/stores/Global';
|
||||
|
||||
const { updateHeaderSearch } = useGlobalInfoStore();
|
||||
// 获取当前用户信息 & 是否登录
|
||||
const { isLogin = false, userInfo = {}} = useDiscussGetUserInfo();
|
||||
const { accountInfo } = useAccount();
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const inputGlow = ref(false);
|
||||
@@ -139,23 +142,10 @@ const homeSearch = ref(null);
|
||||
const dropdownWidth = ref(0);
|
||||
const selectedCate = ref('软件');
|
||||
const tagMap = {
|
||||
'Critical': {
|
||||
text: '致命',
|
||||
color: '#c7000b'
|
||||
},
|
||||
'High': {
|
||||
text: '高',
|
||||
color: '#f66f6a'
|
||||
},
|
||||
'Medium': {
|
||||
text: '中',
|
||||
color: '#fac20a'
|
||||
},
|
||||
'Low': {
|
||||
text: '低',
|
||||
color: '#5e7ce0'
|
||||
}
|
||||
}
|
||||
高: '#f66f6a',
|
||||
中: '#fac20a',
|
||||
低: '#5e7ce0'
|
||||
};
|
||||
|
||||
const searchInput = ref(null);
|
||||
const openAdvancedSearch = () => {
|
||||
@@ -244,7 +234,7 @@ onBeforeUnmount(() => {
|
||||
const getNoticeList = async () => {
|
||||
const res: any = await getHomeNoticeList();
|
||||
if (!res.error) {
|
||||
infoList.value = res.data.data;
|
||||
infoList.value = res.data.data || [];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -265,6 +255,7 @@ getNoticeList();
|
||||
|
||||
.home-content {
|
||||
font-size: 14px;
|
||||
height: 80%;
|
||||
width: 50%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -442,11 +433,8 @@ getNoticeList();
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
width: 150px;
|
||||
width: 120px;
|
||||
flex-shrink: 0;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
:deep(.devui-timeline-item-data-right) {
|
||||
@@ -460,4 +448,4 @@ getNoticeList();
|
||||
padding: 0px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user