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

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