merge wsw into master
fix: 首页列表过多没做滚动 Created-by: yfzmpj Commit-by: 汪少伟 Merged-by: yfzmpj Description: fix: 首页列表过多没做滚动 See merge request: hk_openRepo/OpenRepo_Portal!44
This commit is contained in:
@@ -6,8 +6,14 @@
|
|||||||
<h1>可信开源代码库</h1>
|
<h1>可信开源代码库</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="home-search" ref="homeSearch" :class="{ 'glow-border': inputGlow }">
|
<div class="home-search" ref="homeSearch" :class="{ 'glow-border': inputGlow }">
|
||||||
<d-input ref="searchInput" placeholder="请输入搜索关键字" @focus="inputFocus" @blur="inputBlur" :autocomplete="'off'"
|
<d-input
|
||||||
v-model="searchStr">
|
ref="searchInput"
|
||||||
|
placeholder="请输入搜索关键字"
|
||||||
|
@focus="inputFocus"
|
||||||
|
@blur="inputBlur"
|
||||||
|
:autocomplete="'off'"
|
||||||
|
v-model="searchStr"
|
||||||
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<d-dropdown @toggle="onCateToggle($event)">
|
<d-dropdown @toggle="onCateToggle($event)">
|
||||||
<div class="flex items-center gap-1 cursor-pointer">
|
<div class="flex items-center gap-1 cursor-pointer">
|
||||||
@@ -42,8 +48,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</d-input>
|
</d-input>
|
||||||
<d-dropdown-menu v-model="isOpen" :origin="searchInput?.$el" close-scope="'blank'"
|
<d-dropdown-menu
|
||||||
:offset="offset" :clickOutside="closeOutside">
|
v-model="isOpen"
|
||||||
|
:origin="searchInput?.$el"
|
||||||
|
close-scope="'blank'"
|
||||||
|
:offset="offset"
|
||||||
|
:clickOutside="closeOutside"
|
||||||
|
>
|
||||||
<div class="advanced-search-menu" :style="{ width: dropdownWidth + 'px' }">
|
<div class="advanced-search-menu" :style="{ width: dropdownWidth + 'px' }">
|
||||||
<AdvanceSearch @submit="submit($event)" @cancel="isOpen = false" class="p-20" :layout="'vertical'">
|
<AdvanceSearch @submit="submit($event)" @cancel="isOpen = false" class="p-20" :layout="'vertical'">
|
||||||
<template #title>
|
<template #title>
|
||||||
@@ -58,18 +69,25 @@
|
|||||||
<div class="home-information">
|
<div class="home-information">
|
||||||
<div class="info-title">
|
<div class="info-title">
|
||||||
<div class="sub-title">
|
<div class="sub-title">
|
||||||
<img src="@/assets/imgs/home/informIcon@2x.png">
|
<img src="@/assets/imgs/home/informIcon@2x.png" />
|
||||||
<span>预警公告</span>
|
<span>预警公告</span>
|
||||||
</div>
|
</div>
|
||||||
<a v-if="isLogin" class="devui-link" @click="checkMore">更多 ></a>
|
<a v-if="isLogin" class="devui-link" @click="checkMore">更多 ></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-content">
|
<div class="info-content">
|
||||||
<d-timeline :direction="'vertical'" :time-position="'right'" :position="'right'">
|
<d-timeline :direction="'vertical'" :time-position="'right'" :position="'right'">
|
||||||
<d-timeline-item v-for="(item, index) in infoList" :key="index"
|
<d-timeline-item
|
||||||
:dot-color="item.dotColor" :line-color="'var(--devui-form-control-line-hover)'">
|
v-for="(item, index) in infoList"
|
||||||
|
:key="index"
|
||||||
|
:dot-color="item.dotColor"
|
||||||
|
:line-color="'var(--devui-form-control-line-hover)'"
|
||||||
|
>
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="flex items-center justify-between w-full">
|
<div class="flex items-center justify-between w-full">
|
||||||
<div class="cursor-pointer notice-content flex gap-2 items-center" @click="openWarningDetail(item, index)">
|
<div
|
||||||
|
class="cursor-pointer notice-content flex gap-2 items-center"
|
||||||
|
@click="openWarningDetail(item, index)"
|
||||||
|
>
|
||||||
<span>{{ item.subject }}</span>
|
<span>{{ item.subject }}</span>
|
||||||
<d-tag :color="tagMap[item.importance]" size="sm">{{ item.importance }}</d-tag>
|
<d-tag :color="tagMap[item.importance]" size="sm">{{ item.importance }}</d-tag>
|
||||||
</div>
|
</div>
|
||||||
@@ -89,7 +107,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<d-modal class="warning-modal" v-model="warningModalVisable" title="" style="width: 600px;">
|
<d-modal class="warning-modal" v-model="warningModalVisable" title="" style="width: 600px">
|
||||||
<EarlyWarningDetail :warningData="currentWarning" :type="'user'"></EarlyWarningDetail>
|
<EarlyWarningDetail :warningData="currentWarning" :type="'user'"></EarlyWarningDetail>
|
||||||
</d-modal>
|
</d-modal>
|
||||||
</template>
|
</template>
|
||||||
@@ -98,7 +116,7 @@
|
|||||||
import { ref, onMounted, onBeforeUnmount } from 'vue';
|
import { ref, onMounted, onBeforeUnmount } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import AdvanceSearch from '@/components/AdvanceSearch/index.vue';
|
import AdvanceSearch from '@/components/AdvanceSearch/index.vue';
|
||||||
import { getHomeNoticeList } from '@/api/jyh'
|
import { getHomeNoticeList } from '@/api/jyh';
|
||||||
import EarlyWarningDetail from '@/views/Jyh/PersonalCenter/Detail/EarlyWarningDetail.vue';
|
import EarlyWarningDetail from '@/views/Jyh/PersonalCenter/Detail/EarlyWarningDetail.vue';
|
||||||
import { useDiscussGetUserInfo } from '@/api/discussion/hook';
|
import { useDiscussGetUserInfo } from '@/api/discussion/hook';
|
||||||
|
|
||||||
@@ -109,14 +127,14 @@ const router = useRouter();
|
|||||||
const inputGlow = ref(false);
|
const inputGlow = ref(false);
|
||||||
const searchStr = ref('');
|
const searchStr = ref('');
|
||||||
const position = ref(['right-start', 'right-end']);
|
const position = ref(['right-start', 'right-end']);
|
||||||
const industryOptions = ref(['通信', '军工', '金融', '能源'])
|
const industryOptions = ref(['通信', '军工', '金融', '能源']);
|
||||||
const searchType = ref('软件');
|
const searchType = ref('软件');
|
||||||
const searchOptions = ref(['软件']);
|
const searchOptions = ref(['软件']);
|
||||||
const offset = ref({ mainAxis: 7, crossAxis: -10 });
|
const offset = ref({ mainAxis: 7, crossAxis: -10 });
|
||||||
const isOpen = ref(false);
|
const isOpen = ref(false);
|
||||||
const rotate = ref(0);
|
const rotate = ref(0);
|
||||||
const cateRotate = ref(0);
|
const cateRotate = ref(0);
|
||||||
const infoList = ref([])
|
const infoList = ref([]);
|
||||||
const warningModalVisable = ref(false);
|
const warningModalVisable = ref(false);
|
||||||
const currentWarning = ref();
|
const currentWarning = ref();
|
||||||
|
|
||||||
@@ -124,10 +142,10 @@ const homeSearch = ref(null);
|
|||||||
const dropdownWidth = ref(0);
|
const dropdownWidth = ref(0);
|
||||||
const selectedCate = ref('软件');
|
const selectedCate = ref('软件');
|
||||||
const tagMap = {
|
const tagMap = {
|
||||||
'高': '#f66f6a',
|
高: '#f66f6a',
|
||||||
'中': '#fac20a',
|
中: '#fac20a',
|
||||||
'低': '#5e7ce0'
|
低: '#5e7ce0'
|
||||||
}
|
};
|
||||||
|
|
||||||
const searchInput = ref(null);
|
const searchInput = ref(null);
|
||||||
const openAdvancedSearch = () => {
|
const openAdvancedSearch = () => {
|
||||||
@@ -139,13 +157,13 @@ const openAdvancedSearch = () => {
|
|||||||
const check = () => {
|
const check = () => {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'Search',
|
name: 'Search',
|
||||||
query: { tab: 'BatchVerify' }, // 通过查询参数指定 Tab
|
query: { tab: 'BatchVerify' } // 通过查询参数指定 Tab
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
const closeOutside = () => {
|
const closeOutside = () => {
|
||||||
return false
|
return false;
|
||||||
}
|
};
|
||||||
|
|
||||||
const submit = (formData) => {
|
const submit = (formData) => {
|
||||||
isOpen.value = false;
|
isOpen.value = false;
|
||||||
@@ -158,7 +176,7 @@ const inputFocus = () => {
|
|||||||
|
|
||||||
const inputBlur = () => {
|
const inputBlur = () => {
|
||||||
inputGlow.value = false;
|
inputGlow.value = false;
|
||||||
}
|
};
|
||||||
|
|
||||||
const updateDropdownWidth = () => {
|
const updateDropdownWidth = () => {
|
||||||
if (homeSearch.value) {
|
if (homeSearch.value) {
|
||||||
@@ -172,15 +190,15 @@ const search = () => {
|
|||||||
|
|
||||||
const onCategoryChange = (cate) => {
|
const onCategoryChange = (cate) => {
|
||||||
selectedCate.value = cate;
|
selectedCate.value = cate;
|
||||||
}
|
};
|
||||||
|
|
||||||
const onCateToggle = (event) => {
|
const onCateToggle = (event) => {
|
||||||
cateRotate.value = event ? 180 : 0;
|
cateRotate.value = event ? 180 : 0;
|
||||||
}
|
};
|
||||||
|
|
||||||
const checkMore = () => {
|
const checkMore = () => {
|
||||||
router.push({ name: 'PersonalCenter' });
|
router.push({ name: 'PersonalCenter' });
|
||||||
}
|
};
|
||||||
|
|
||||||
const openWarningDetail = (event, index) => {
|
const openWarningDetail = (event, index) => {
|
||||||
infoList.value.forEach((item, i) => {
|
infoList.value.forEach((item, i) => {
|
||||||
@@ -189,11 +207,11 @@ const openWarningDetail = (event, index) => {
|
|||||||
} else {
|
} else {
|
||||||
item.dotColor = '';
|
item.dotColor = '';
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
warningModalVisable.value = true;
|
warningModalVisable.value = true;
|
||||||
currentWarning.value = event;
|
currentWarning.value = event;
|
||||||
}
|
};
|
||||||
|
|
||||||
let resizeObserver: ResizeObserver | null = null;
|
let resizeObserver: ResizeObserver | null = null;
|
||||||
|
|
||||||
@@ -217,10 +235,9 @@ const getNoticeList = async() => {
|
|||||||
if (!res.error) {
|
if (!res.error) {
|
||||||
infoList.value = res.data.data;
|
infoList.value = res.data.data;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
getNoticeList();
|
getNoticeList();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@@ -235,10 +252,9 @@ getNoticeList();
|
|||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
|
||||||
.home-content {
|
.home-content {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
height: 50%;
|
height: 80%;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -248,6 +264,7 @@ getNoticeList();
|
|||||||
|
|
||||||
.home-title {
|
.home-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
@@ -265,6 +282,7 @@ getNoticeList();
|
|||||||
.home-search {
|
.home-search {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
flex-shrink: 0;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -315,6 +333,7 @@ getNoticeList();
|
|||||||
.batch-btn {
|
.batch-btn {
|
||||||
color: $devui-aide-text;
|
color: $devui-aide-text;
|
||||||
width: 150px;
|
width: 150px;
|
||||||
|
flex-shrink: 0;
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
border-color: $devui-aide-text;
|
border-color: $devui-aide-text;
|
||||||
}
|
}
|
||||||
@@ -322,6 +341,8 @@ getNoticeList();
|
|||||||
.home-information {
|
.home-information {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
|
overflow: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
|
|
||||||
@@ -366,7 +387,7 @@ getNoticeList();
|
|||||||
.glow-border {
|
.glow-border {
|
||||||
border: 1px solid var(--devui-form-control-line, #d7d8da);
|
border: 1px solid var(--devui-form-control-line, #d7d8da);
|
||||||
border-color: var(--devui-form-control-line-active, #5e7ce0) !important;
|
border-color: var(--devui-form-control-line-active, #5e7ce0) !important;
|
||||||
box-shadow: 0 0 0 4px var(--devui-form-control-interactive-outline, rgba(94, 124, 224, .08));
|
box-shadow: 0 0 0 4px var(--devui-form-control-interactive-outline, rgba(94, 124, 224, 0.08));
|
||||||
transition: border-color 0.3s ease, box-shadow 0.3s ease;
|
transition: border-color 0.3s ease, box-shadow 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user