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:
@user8949
2025-03-19 20:56:39 +08:00
8 changed files with 61 additions and 46 deletions

View File

@@ -10,7 +10,7 @@
</div>
<div class="g-user-drawer-info-list">
<div class="g-user-drawer-info-list-name">
<span class="break-all">{{ accountInfo.username?accountInfo.username[0]:'' }}</span>
<span class="break-all">{{ accountInfo.username ? accountInfo.username[0] : '' }}</span>
<GIcon class="close-icon" name="gt-close" size="12" @click="handleClose" />
</div>
<div class="g-user-drawer-info-list-id break-all">@{{ accountInfo.username }}</div>
@@ -69,6 +69,10 @@ const logout = async () => {
router.go(0);
}
}
// 退出系统刷新页面
setTimeout(() => {
location.reload();
}, 100);
};
const handleClick = (item) => {
@@ -107,9 +111,7 @@ const getRouterLink = (params) => {
};
const blockList = ref([
[
{ id: 'myPage', label: '个人中心', to: getRouterLink('PersonalCenter') }
],
[{ id: 'myPage', label: '个人中心', to: getRouterLink('PersonalCenter') }],
// [
// // { id: 'dashboard', label: '工作台', icon: 'gt-member-c', to: getRouterLink('dashboard') },
// // { id: 'myIssues', label: '我的 Issue', icon: 'gt-issue-c', to: getRouterLink('issues') },
@@ -126,9 +128,7 @@ const blockList = ref([
// { id: 'personalSetting', label: '个人设置', icon: 'gt-setting-c', to: getRouterLink('setting') },
// { id: 'help', label: '帮助文档', icon: 'gt-file-c', href: 'https://gitcode.com/Gitcode-offical-team/GitCode-Docs/wiki' }
// ],
[
{ id: 'logout', label: '退出登录', icon: 'gt-exit', action: logout }
]
[{ id: 'logout', label: '退出登录', icon: 'gt-exit', action: logout }]
]);
</script>

View File

@@ -2,7 +2,7 @@
<div class="TableSetting">
<d-button @click.stop="toggleColumnList" class="output-btn" icon="icon-form-settings" variant="text">设置</d-button>
<!-- 多选列表 -->
<div v-if="showColumnList" class="column-list">
<div v-if="showColumnList" ref="columnListRef" class="column-list">
<div class="column-list-header">
<span class="title1">展示列设置</span>
<a class="title2">恢复默认</a>
@@ -20,7 +20,7 @@
</div>
</template>
<script lang="ts" setup>
import { ref, defineProps, defineEmits } from 'vue';
import { ref, defineProps, defineEmits,onMounted,onUnmounted } from 'vue';
const props = defineProps({
@@ -42,6 +42,29 @@ const toggleColumnList = () => {
const newValue = !props.showColumnList;
emits('update:show-column-list', newValue); // 触发事件,更新父组件的 showColumnList
};
// 关闭多选列表
const closeColumnList = () => {
emits('update:show-column-list', false);
};
// 监听点击事件
const columnListRef = ref<HTMLElement | null>(null);
const handleClickOutside = (event: MouseEvent) => {
if (columnListRef.value && !columnListRef.value.contains(event.target as Node)) {
closeColumnList();
}
};
onMounted(() => {
document.addEventListener('click', handleClickOutside);
});
onUnmounted(() => {
document.removeEventListener('click', handleClickOutside);
});
</script>
<style lang="scss" scoped>
.TableSetting {

View File

@@ -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>

View File

@@ -3,7 +3,7 @@
<div class="license-info-content">
<d-layout>
<d-content class="dcontent">
<d-table :data="list" style="width: 100%;">
<d-table class="jyh-table" v-if="list.length>0" :data="list" style="width: 100%;">
<template #empty>
<NoData></NoData>
</template>
@@ -16,6 +16,7 @@
</template>
</d-column>
</d-table>
<NoData v-else :small="false"></NoData>
</d-content>
</d-layout>
</div>

View File

@@ -105,6 +105,7 @@
<template #default="scope">
<d-button
variant="text"
v-if="scope.row.validStatus == 0"
:disabled="scope.row.validStatus !== 0"
>
申请入库

View File

@@ -5,7 +5,7 @@
</div>
<Card simple class="jyh-card mt-3">
<div class="clear-padding">
<d-table :indent="32" @check-change="treeCheckChange" :data="baseTreeTableData1" row-key="id">
<d-table class="jyh-table" v-if="baseTreeTableData1.length>0" :indent="32" @check-change="treeCheckChange" :data="baseTreeTableData1" row-key="id">
<d-column field="firstName" header="组织名称" show-overflow-tooltip>
<template #default="scope">
<a class="devui-link" @click="showDetail = true">{{ scope.row.firstName }}</a>
@@ -13,6 +13,7 @@
</d-column>
<d-column field="lastName" header="版本"></d-column>
</d-table>
<NoData v-else :small="false"></NoData>
</div>
</Card>
<d-drawer v-model="showDetail" style="width: 800px; padding: 20px">
@@ -22,6 +23,7 @@
<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue';
import SBOMDetail from './SBOMDetail.vue';
import NoData from '@/components/NoData/NoData.vue';
import { dependencyTree } from '@/api/jyh';
import { useRoute } from 'vue-router';

View File

@@ -237,8 +237,8 @@ const fetchVulnList = async () => {
// softwareId: 47,
softwareId: propsData.versionId,
componentId: '',
current: 1,
size: 10
current: pager.value.pageIndex,
size: pager.value.pageSize,
});
if(data.data.code===200) {
tableData.value = data?.data?.data?.records || [];

View File

@@ -130,7 +130,7 @@
<script setup lang="ts">
import { getVulnDetail } from '@/api/jyh';
import { ref } from 'vue';
import { ref,defineProps } from 'vue';
const propsData = defineProps(['softwareId', 'vulnId', 'vulnInfo']);
const vulnDetail = ref({});
@@ -190,4 +190,4 @@ queryVulnDetail();
vertical-align: top;
}
}
</style>
</style>