fix: bugs

This commit is contained in:
汪少伟
2025-03-19 12:08:19 +08:00
parent 401cfbe05a
commit 8ae8dba0d4
9 changed files with 85 additions and 79 deletions

View File

@@ -122,29 +122,16 @@ export function getLicenseList() {
}); });
} }
// 获取详情漏洞列表
export function getVulnerabilityList() {
return request({
url: '/api/v1/repo/vulnerability/page',
method: 'GET',
params: {
current: 1,
size: 10,
softwareId: 47
}
});
}
// 获取漏洞数据 // 获取漏洞数据
export const getVulnList = (data): Promise<any> => { export const getVulnList = (data): Promise<any> => {
return reqCatchV2(() => return reqCatchV2(() =>
request({ request({
url: `/api/v1/repo/vulnerability/page`, url: `/api/v1/repo/vulnerability/page`,
method: 'post', method: 'post',
data, data
}) })
); );
} };
// 获取漏洞数据 // 获取漏洞数据
export const getVulnDetail = (data): Promise<any> => { export const getVulnDetail = (data): Promise<any> => {
@@ -152,7 +139,22 @@ export const getVulnDetail = (data): Promise<any> => {
request({ request({
url: `/api/v1/repo/vulnerability/info`, url: `/api/v1/repo/vulnerability/info`,
method: 'POST', method: 'POST',
data, data
}) })
); );
} };
// 获取漏洞数据
export const dependencyTree = (softwareId: any): Promise<any> => {
return reqCatchV2(() =>
request({
url: `/api/v1/repo/dependency/tree`,
method: 'POST',
data: {
softwareId,
current: 1,
size: 99999
}
})
);
};

View File

@@ -1,10 +1,10 @@
<template> <template>
<div class="full-w" :style="{ height: `${height}px` }"> <div class="full-w" :style="{ height: `${height}px` }">
<div class="g-header fixed z-20" ref="headerRef" :class="{'home-background': isHome}"> <div class="g-header fixed z-20" ref="headerRef" :class="{ 'home-background': isHome }">
<div class="g-toolbar w-full overflow-hidden" :class="[searchClass, route?.meta?.headerClassName]"> <div class="g-toolbar w-full overflow-hidden" :class="[searchClass, route?.meta?.headerClassName]">
<div class="g-toolbar-left flex-shrink items-center"> <div class="g-toolbar-left flex-shrink items-center">
<div class="flex-center gap-[16px]" v-if="!isHome"> <div class="flex-center gap-[16px]" v-if="!isHome">
<!-- <g-icon v-if="!asideSetShow" @click="$emit('clickMenu')" name="gt-hamburger" size="20px" class="cursor-pointer hover:!text-black" color="#1D1F3A"></g-icon>--> <!-- <g-icon v-if="!asideSetShow" @click="$emit('clickMenu')" name="gt-hamburger" size="20px" class="cursor-pointer hover:!text-black" color="#1D1F3A"></g-icon>-->
<GLink class="g-toolbar-left-logo" :href="baseUrl" /> <GLink class="g-toolbar-left-logo" :href="baseUrl" />
<GLink class="g-toolbar-left-title" :href="baseUrl">可信代码库</GLink> <GLink class="g-toolbar-left-title" :href="baseUrl">可信代码库</GLink>
@@ -12,7 +12,7 @@
</div> </div>
</div> </div>
<div class="flex-1 flex items-center justify-end" v-if="!isHome"> <div class="flex-1 flex items-center justify-end" v-if="!isHome">
<Search class="g-toolbar-left-search" v-if="!isMobile" :key="$route.fullPath"/> <Search class="g-toolbar-left-search" v-if="!isMobile" :key="$route.fullPath" />
</div> </div>
<div class="g-toolbar-right gap-[12px] flex-grow-0 flex-shrink-0"> <div class="g-toolbar-right gap-[12px] flex-grow-0 flex-shrink-0">
<GLink <GLink
@@ -30,21 +30,23 @@
<GIcon name="gt-plane-add" size="16px" color="#9C9DB4" /> <GIcon name="gt-plane-add" size="16px" color="#9C9DB4" />
<span>新建</span> <span>新建</span>
</d-button> </d-button>
<div class="cursor-pointer hidden-m" @click="handleLogin('login')" v-if="inSearch"><span>搜索记录</span></div> <div class="cursor-pointer hidden-m" @click="handleLogin('login')" v-if="inSearch">
<d-button variant="solid" color="primary" @click="handleLogin('login')"></d-button> <span>搜索记</span>
</div>
<d-button @click="handleLogin('register')" class="min-w-[64px]">注册</d-button> <d-button @click="handleLogin('register')" class="min-w-[64px]">注册</d-button>
<d-button variant="solid" color="primary" @click="handleLogin('login')">Gitcode账号登录</d-button>
</template> </template>
<template v-else> <template v-else>
<!--ai copilot--> <!--ai copilot-->
<!-- <a class="g-header-copilot" href="/ai-copilot/">--> <!-- <a class="g-header-copilot" href="/ai-copilot/">-->
<!-- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">--> <!-- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">-->
<!-- <path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 6C2.5 4.89543 3.39543 4 4.5 4H11.5C12.6046 4 13.5 4.89543 13.5 6V12C13.5 13.1046 12.6046 14 11.5 14H4.5C3.39543 14 2.5 13.1046 2.5 12V6ZM4.5 8C4.5 7.44772 4.94772 7 5.5 7C6.05228 7 6.5 7.44772 6.5 8V9C6.5 9.55228 6.05228 10 5.5 10C4.94772 10 4.5 9.55228 4.5 9V8ZM10.5 7C9.94772 7 9.5 7.44772 9.5 8V9C9.5 9.55228 9.94772 10 10.5 10C11.0523 10 11.5 9.55228 11.5 9V8C11.5 7.44772 11.0523 7 10.5 7Z" fill="white"/>--> <!-- <path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 6C2.5 4.89543 3.39543 4 4.5 4H11.5C12.6046 4 13.5 4.89543 13.5 6V12C13.5 13.1046 12.6046 14 11.5 14H4.5C3.39543 14 2.5 13.1046 2.5 12V6ZM4.5 8C4.5 7.44772 4.94772 7 5.5 7C6.05228 7 6.5 7.44772 6.5 8V9C6.5 9.55228 6.05228 10 5.5 10C4.94772 10 4.5 9.55228 4.5 9V8ZM10.5 7C9.94772 7 9.5 7.44772 9.5 8V9C9.5 9.55228 9.94772 10 10.5 10C11.0523 10 11.5 9.55228 11.5 9V8C11.5 7.44772 11.0523 7 10.5 7Z" fill="white"/>-->
<!-- <path opacity="0.6" fill-rule="evenodd" clip-rule="evenodd" d="M8.75 3.29933C9.19835 3.03997 9.5 2.55521 9.5 2C9.5 1.17157 8.82843 0.5 8 0.5C7.17157 0.5 6.5 1.17157 6.5 2C6.5 2.55521 6.80165 3.03997 7.25 3.29933V5.5H8.75V3.29933ZM0 7C0 6.44772 0.447715 6 1 6H1.5V12H1C0.447715 12 0 11.5523 0 11V7ZM15 6H14.5V12H15C15.5523 12 16 11.5523 16 11V7C16 6.44772 15.5523 6 15 6Z" fill="white"/>--> <!-- <path opacity="0.6" fill-rule="evenodd" clip-rule="evenodd" d="M8.75 3.29933C9.19835 3.03997 9.5 2.55521 9.5 2C9.5 1.17157 8.82843 0.5 8 0.5C7.17157 0.5 6.5 1.17157 6.5 2C6.5 2.55521 6.80165 3.03997 7.25 3.29933V5.5H8.75V3.29933ZM0 7C0 6.44772 0.447715 6 1 6H1.5V12H1C0.447715 12 0 11.5523 0 11V7ZM15 6H14.5V12H15C15.5523 12 16 11.5523 16 11V7C16 6.44772 15.5523 6 15 6Z" fill="white"/>-->
<!-- </svg>--> <!-- </svg>-->
<!-- <span class="ml-xs">AI Copilot</span>--> <!-- <span class="ml-xs">AI Copilot</span>-->
<!-- </a>--> <!-- </a>-->
<!-- <Create />--> <!-- <Create />-->
<!-- <SearchAiHistory />--> <!-- <SearchAiHistory />-->
<d-popover content="提示!" trigger="hover" style="background-color: #7693f5; color: #fff"> <d-popover content="提示!" trigger="hover" style="background-color: #7693f5; color: #fff">
<d-icon style="font-size: 16px" name="icon-helping" /> <d-icon style="font-size: 16px" name="icon-helping" />
</d-popover> </d-popover>
@@ -109,9 +111,7 @@ const { isMobile } = usePageResize();
/* store 用户信息 */ /* store 用户信息 */
/* @test 后面将清除 */ /* @test 后面将清除 */
watchEffect(() => { watchEffect(() => {});
});
microApp.router.beforeEach({ microApp.router.beforeEach({
'micoro-app-homeweb-app': (to, from) => { 'micoro-app-homeweb-app': (to, from) => {
if (to.pathname === '/search') { if (to.pathname === '/search') {
@@ -134,8 +134,8 @@ $add-radius: 48px;
$header-bg: #fff; $header-bg: #fff;
.home-background { .home-background {
background-color: #fff0 !important; background-color: #fff0 !important;
} }
.g-header { .g-header {
// overflow: hidden; // overflow: hidden;
@@ -150,7 +150,7 @@ $header-bg: #fff;
} }
.g-header-copilot { .g-header-copilot {
background: rgba(41, 81, 224, 1); background: rgba(41, 81, 224, 1);
color: #FFF; color: #fff;
width: 120px; width: 120px;
border-radius: 48px; border-radius: 48px;
height: 32px; height: 32px;
@@ -159,7 +159,7 @@ $header-bg: #fff;
cursor: pointer; cursor: pointer;
justify-content: center; justify-content: center;
&:hover { &:hover {
background: rgba(41, 81, 224, .8); background: rgba(41, 81, 224, 0.8);
} }
} }
.g-toolbar { .g-toolbar {
@@ -171,7 +171,7 @@ $header-bg: #fff;
flex-basis: 56px; flex-basis: 56px;
overflow: hidden; overflow: hidden;
padding: 0 24px; padding: 0 24px;
border-bottom: 1px solid #F1F1F8; border-bottom: 1px solid #f1f1f8;
:deep(.devui-button) { :deep(.devui-button) {
padding: 6px 16px; padding: 6px 16px;
border-radius: $add-radius; border-radius: $add-radius;
@@ -202,14 +202,14 @@ $header-bg: #fff;
display: flex; display: flex;
align-items: center; align-items: center;
@media screen and (max-width: 576px) { @media screen and (max-width: 576px) {
@apply gap-[16px]; @apply gap-[16px];
} }
} }
&.border-b-transparent { &.border-b-transparent {
border-bottom-color: transparent !important; border-bottom-color: transparent !important;
} }
&.border-b-show { &.border-b-show {
border-bottom-color: #F1F1F8 !important; border-bottom-color: #f1f1f8 !important;
} }
} }
.g-header-gray { .g-header-gray {
@@ -256,12 +256,12 @@ $header-bg: #fff;
} }
} }
@media screen and (max-width:576px) { @media screen and (max-width: 576px) {
.hidden-m { .hidden-m {
display: none; display: none;
} }
.g-header-copilot { .g-header-copilot {
display: none!important;; display: none !important;
} }
} }
</style> </style>

View File

@@ -1,6 +1,5 @@
<template> <template>
<Card simple class="jyh-card mt-3"> <Card simple class="jyh-card mt-3">
<div class="card-title">组织预警通知列表</div>
<div class="mb-3"> <div class="mb-3">
<d-table class="jyh-table jyh-table-2" :header-bg="true" :data="licenseTableData"> <d-table class="jyh-table jyh-table-2" :header-bg="true" :data="licenseTableData">
<d-column field="code" header="时间"></d-column> <d-column field="code" header="时间"></d-column>

View File

@@ -1,6 +1,5 @@
<template> <template>
<Card simple class="jyh-card mt-3"> <Card simple class="jyh-card mt-3">
<div class="card-title">个人预警通知列表</div>
<div class="mb-3"> <div class="mb-3">
<d-table class="jyh-table jyh-table-2" :header-bg="true" :data="licenseTableData"> <d-table class="jyh-table jyh-table-2" :header-bg="true" :data="licenseTableData">
<d-column field="code" header="时间"></d-column> <d-column field="code" header="时间"></d-column>

View File

@@ -1,7 +1,6 @@
<template> <template>
<div class="invitation-notice-container"> <div class="invitation-notice-container">
<Card simple class="jyh-card mt-3"> <Card simple class="jyh-card mt-3">
<div class="card-title">邀请通知列表</div>
<div class="mb-3"> <div class="mb-3">
<d-table <d-table
class="jyh-table jyh-table-2" class="jyh-table jyh-table-2"
@@ -106,4 +105,4 @@ const handleAccept = async (row, type) => {
text-align: right; text-align: right;
} }
} }
</style> </style>

View File

@@ -1,6 +1,5 @@
<template> <template>
<Card simple class="jyh-card mt-3"> <Card simple class="jyh-card mt-3">
<div class="card-title">组织订阅列表</div>
<div class="mb-3"> <div class="mb-3">
<d-table class="jyh-table jyh-table-2" :header-bg="true" :data="tableData"> <d-table class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="code" header="订阅时间"></d-column> <d-column field="code" header="订阅时间"></d-column>

View File

@@ -1,6 +1,5 @@
<template> <template>
<Card simple class="jyh-card mt-3"> <Card simple class="jyh-card mt-3">
<div class="card-title">个人订阅列表</div>
<div class="mb-3"> <div class="mb-3">
<d-table class="jyh-table jyh-table-2" :header-bg="true" :data="tableData"> <d-table class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="code" header="订阅时间"></d-column> <d-column field="code" header="订阅时间"></d-column>

View File

@@ -29,7 +29,7 @@
<div class="font-bold mb-[16px]">预警通知设置</div> <div class="font-bold mb-[16px]">预警通知设置</div>
</div> </div>
<d-form layout="vertical"> <d-form layout="vertical">
<d-form-item field="radio" label="是否开启邮件通知"> <d-form-item field="radio" label="是否开启预警通知">
<d-radio-group direction="row" v-model="radio"> <d-radio-group direction="row" v-model="radio">
<d-radio value="0">开启</d-radio> <d-radio value="0">开启</d-radio>
<d-radio value="1">关闭</d-radio> <d-radio value="1">关闭</d-radio>
@@ -38,15 +38,15 @@
</d-form> </d-form>
</d-card> </d-card>
<div class="flex"> <div class="flex">
<d-button variant="solid" class="mr-[8px]">提交</d-button> <d-button variant="solid" class="mr-[8px]">保存</d-button>
<d-button color="secondary" class="mr-[8px]">保存草稿</d-button> <!-- <d-button color="secondary" class="mr-[8px]">保存草稿</d-button> -->
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, shallowRef } from 'vue'; import { reactive, ref, shallowRef } from 'vue';
const radio = ref('1'); const radio = ref('0');
const forms = reactive({ const forms = reactive({
name: '', name: '',

View File

@@ -1,28 +1,22 @@
<template> <template>
<div class="soft-detail-container"> <div class="soft-detail-container">
<div class="mt-3"> <div class="mt-3">
<d-table class="jyh-table" v-if="tableData.length" :striped="false" :data="tableData" table-layout="auto"> <d-table class="jyh-table" v-if="tableData.length" :striped="false" :data="valLists" table-layout="auto">
<d-column type="index" width="40"></d-column> <d-column type="index" width="40"></d-column>
<d-column <d-column field="vulnId" header="编码" filterable :filter-list="filterList" @filter-change="handleFilterChange">
field="versionName"
header="编码"
filterable
:filter-list="filterList"
@filter-change="handleFilterChange"
>
<template #default="scope"> <template #default="scope">
<a @click="openVulnDetail(scope.row)">{{ scope.row.versionName }}</a> <a @click="openVulnDetail(scope.row)">{{ scope.row.vulnId }}</a>
</template> </template>
</d-column> </d-column>
<d-column <d-column
field="name" field="cweId"
header="CVE ID" header="CVE ID"
filterable filterable
:filter-list="filterList" :filter-list="filterList"
@filter-change="handleFilterChange" @filter-change="handleFilterChange"
></d-column> ></d-column>
<d-column <d-column
field="code" field="cvssScore"
header="CVSS 打分" header="CVSS 打分"
filterable filterable
:filter-list="filterList" :filter-list="filterList"
@@ -40,7 +34,7 @@
</template> </template>
</d-column> </d-column>
<d-column <d-column
field="versionCode" field="severity"
header="漏洞级别" header="漏洞级别"
sortable sortable
:sort-method="sortNameMethod" :sort-method="sortNameMethod"
@@ -49,11 +43,11 @@
@filter-change="handleFilterChange" @filter-change="handleFilterChange"
> >
<template #default="scope"> <template #default="scope">
<a>{{ scope.row.versionCode }}</a> <a>{{ scope.row.severity }}</a>
</template> </template>
</d-column> </d-column>
<d-column <d-column
field="versionCode" field="fixVersion"
header="补丁版本" header="补丁版本"
sortable sortable
:sort-method="sortNameMethod" :sort-method="sortNameMethod"
@@ -62,10 +56,14 @@
@filter-change="handleFilterChange" @filter-change="handleFilterChange"
> >
<template #default="scope"> <template #default="scope">
<a>{{ scope.row.versionCode }}</a> <a>{{ scope.row.fixVersion }}</a>
</template>
</d-column>
<d-column field="publishDate" header="补丁修复时间" fixed-right="0px">
<template #default="scope">
{{ dayjs(scope.row.publishDate).format('YYYY-MM-DD') }}
</template> </template>
</d-column> </d-column>
<d-column field="created" header="补丁修复时间" fixed-right="0px"></d-column>
</d-table> </d-table>
<DataPanel v-else skeleton :card="false" :empty="true"> </DataPanel> <DataPanel v-else skeleton :card="false" :empty="true"> </DataPanel>
@@ -102,13 +100,14 @@
</GModal> </GModal>
<!-- 漏洞详情 --> <!-- 漏洞详情 -->
<d-drawer v-model="vulnDetailVisable" style="width: auto;"> <d-drawer v-model="vulnDetailVisable" style="width: auto">
<VulnerabilityDetail :softwareId="currentVuln.softwareId" :vulnId="currentVuln.id"></VulnerabilityDetail> <VulnerabilityDetail :softwareId="currentVuln.softwareId" :vulnId="currentVuln.id"></VulnerabilityDetail>
</d-drawer> </d-drawer>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import * as dayjs from 'dayjs';
import SettingTitle from '@/components/Setting/SettingTitle/index.vue'; import SettingTitle from '@/components/Setting/SettingTitle/index.vue';
import SettingText from '@/components/Setting/SettingText/index.vue'; import SettingText from '@/components/Setting/SettingText/index.vue';
import { ref, reactive, onMounted } from 'vue'; import { ref, reactive, onMounted } from 'vue';
@@ -119,7 +118,7 @@ import { reqCatch } from '@/utils/catch';
import { getOrgInfo } from '@/views/Org/hooks/orgInfo'; import { getOrgInfo } from '@/views/Org/hooks/orgInfo';
import { Message } from 'vue-devui'; import { Message } from 'vue-devui';
import VulnerabilityDetail from '@/views/Jyh/Version/Detail/VulnerabilityDetail.vue'; import VulnerabilityDetail from '@/views/Jyh/Version/Detail/VulnerabilityDetail.vue';
import { getVulnerabilityList } from '@/api/jyh'; import { getVulnList } from '@/api/jyh';
const { namespace } = getOrgInfo(); const { namespace } = getOrgInfo();
const tableData = ref([ const tableData = ref([
@@ -245,15 +244,25 @@ const vulnDetailVisable = ref(false);
const currentVuln = ref(); const currentVuln = ref();
const openVulnDetail = (row) => { const openVulnDetail = (row) => {
vulnDetailVisable.value = true; vulnDetailVisable.value = true;
if(row.softwareId && row.id) { if (row.softwareId && row.id) {
currentVuln.value = row; currentVuln.value = row;
} else { } else {
currentVuln.value = { currentVuln.value = {
softwareId: 47, softwareId: 47,
id: 72 id: 72
} };
} }
} };
const valLists = ref([]);
onMounted(async () => {
const data = await getVulnList({
softwareId: 47,
current: 1,
size: 10
});
valLists.value = data?.data?.data?.data?.records || [];
});
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">