软件列表及软件版本详情接口对接

This commit is contained in:
付民康
2025-03-18 17:43:51 +08:00
parent b42ee530e2
commit 6c61ac9f73
5 changed files with 62 additions and 260 deletions

View File

@@ -8,9 +8,9 @@
</d-breadcrumb>
<div class="version-detail-header">
<div class="header-top">
<GAvatar style="margin-right: 16px" :src="avatarUrl" name="Vue" :width="72" :height="72"></GAvatar>
<GAvatar style="margin-right: 16px" :name="accountInfo.username" :src="accountInfo.avatar" name="Vue" :width="72" :height="72"></GAvatar>
<div class="pt-24">
<div class="header-title1">UserName</div>
<div class="header-title1">{{ accountInfo.username || '--' }}</div>
<div class="header-div">
<span class="span1"
>介绍包含项目管理代码托管CI/CD 和制品库等功能提供完整的研发流程建议的新的团队</span
@@ -43,11 +43,13 @@ import { getOrgInfo } from '@/views/Org/hooks/orgInfo';
import EarlyWarning from './Detail/EarlyWarning.vue';
import SubscribeList from './Detail/SubscribeList.vue';
import PersonalSettings from './Detail/PersonalSettings.vue';
import { useAccount } from '@/utils/hooks/useAccount';
const { namespace } = getOrgInfo();
const avatarUrl = '/src/assets/imgs/avatar/male.png';
const selectTab = ref('yjtzlb');
const { accountInfo, RemoveInfo } = useAccount();
// 删除弹窗
const item = ref('');

View File

@@ -16,7 +16,7 @@
</template>
</AdvanceSearch>
</div>
<div class="mt-3 px-20">
<div class="mt-3 px-20 min-h-[600px]">
<d-table :key="tableKey" class="jyh-table" v-if="tableData.length" :striped="false" :data="tableData" table-layout="auto">
<!-- 索引列 -->
<d-column type="index" width="40"></d-column>
@@ -40,6 +40,9 @@
<template v-else-if="column.key === 'version'">
<a @click="gotoDetail(scope.row)">{{ scope.row.version }}</a>
</template>
<template v-else-if="column.key === 'releaseDate'">
<span>{{ formatTime(scope.row.releaseDate, 'YYYY-MM-DD') }}</span>
</template>
<template v-else-if="column.key === 'softwareVersion'">
<a @click="gotoDetail(scope.row)">{{ scope.row.softwareVersion }}</a>
</template>
@@ -64,8 +67,8 @@
<d-tag color="gray">+3</d-tag>
</div>
</template>
<template v-else-if="column.key === 'sourceCodeDownload'">
<a>{{ scope.row.sourceCodeDownload }}</a>
<template v-else-if="column.key === 'sourceDownloadUrl'">
<a>{{ scope.row.sourceDownloadUrl }}</a>
</template>
<template v-else>
{{ scope.row[column.key] }}
@@ -117,6 +120,9 @@ import { storeToRefs } from 'pinia';
import CountryModal from './CountryModal.vue'
import OrgModal from './OrgModal.vue'
import { useAccountStore } from '@/stores/user';
const { formatTime } = useTimeFormat();
import { releasePage } from '@/api/jyh';
import { useTimeFormat } from '@/utils/hooks/useTimeFormat';
const { namespace } = getOrgInfo();
const userInfo = useAccountStore();
const { isLogin } = storeToRefs(userInfo);
@@ -125,238 +131,7 @@ const { isLogin } = storeToRefs(userInfo);
const tableKey = ref(0);
const countryVisible = ref(false);
const orgVisible = ref(false);
const tableData = ref([
{
softwareName: 'eslint-plugin-import',
softwareVersion: '2.29.0',
releaseDate: '2025-03-10',
licenseCount: 3,
dependencyCount: 15,
productComponentUsage: ['供应链系统A', '供应链系统B'],
codeSize: '150KB',
vulnerabilityCount: 5,
industryCategory: '软件开发工具',
developer: 'ESLint团队',
contributorCountries: ['美国', '中国', '德国'],
contributorOrganizations: ['Google', 'Microsoft', 'Alibaba'],
programmingLanguage: 'JavaScript',
communityHash: 'a1b2c3d4',
softwareScore: 8.5,
sourceCodeDownload: 'https://github.com/eslint/eslint-plugin-import',
copyright: 'MIT License',
externalVulnerabilitySource: 'CVE-2025-1234',
versionDescription: '修复了若干安全漏洞',
compatibilityRisk: '低',
communityEOL: '2028-12-31',
},
{
softwareName: 'react',
softwareVersion: '18.2.0',
releaseDate: '2025-02-15',
licenseCount: 1,
dependencyCount: 10,
productComponentUsage: ['供应链系统C'],
codeSize: '500KB',
vulnerabilityCount: 2,
industryCategory: '前端框架',
developer: 'Facebook',
contributorCountries: ['美国', '加拿大', '英国'],
contributorOrganizations: ['Facebook', 'Netflix', 'Airbnb'],
programmingLanguage: 'JavaScript',
communityHash: 'e5f6g7h8',
softwareScore: 9.0,
sourceCodeDownload: 'https://github.com/facebook/react',
copyright: 'MIT License',
externalVulnerabilitySource: 'CVE-2025-5678',
versionDescription: '新增了并发渲染功能',
compatibilityRisk: '中',
communityEOL: '2030-12-31',
},
{
softwareName: 'vue',
softwareVersion: '3.2.0',
releaseDate: '2025-01-20',
licenseCount: 1,
dependencyCount: 8,
productComponentUsage: ['供应链系统D'],
codeSize: '300KB',
vulnerabilityCount: 1,
industryCategory: '前端框架',
developer: 'Evan You',
contributorCountries: ['中国', '美国', '日本'],
contributorOrganizations: ['Alibaba', 'Tencent', 'Baidu'],
programmingLanguage: 'JavaScript',
communityHash: 'i9j0k1l2',
softwareScore: 9.2,
sourceCodeDownload: 'https://github.com/vuejs/vue',
copyright: 'MIT License',
externalVulnerabilitySource: 'CVE-2025-9101',
versionDescription: '优化了性能',
compatibilityRisk: '低',
communityEOL: '2029-12-31',
},
{
softwareName: 'webpack',
softwareVersion: '5.75.0',
releaseDate: '2025-04-05',
licenseCount: 2,
dependencyCount: 20,
productComponentUsage: ['供应链系统E'],
codeSize: '1MB',
vulnerabilityCount: 3,
industryCategory: '构建工具',
developer: 'Webpack团队',
contributorCountries: ['美国', '德国', '俄罗斯'],
contributorOrganizations: ['Google', 'Microsoft', 'Yandex'],
programmingLanguage: 'JavaScript',
communityHash: 'm3n4o5p6',
softwareScore: 8.8,
sourceCodeDownload: 'https://github.com/webpack/webpack',
copyright: 'MIT License',
externalVulnerabilitySource: 'CVE-2025-1122',
versionDescription: '修复了构建性能问题',
compatibilityRisk: '高',
communityEOL: '2027-12-31',
},
{
softwareName: 'babel',
softwareVersion: '7.20.0',
releaseDate: '2025-03-25',
licenseCount: 1,
dependencyCount: 12,
productComponentUsage: ['供应链系统F'],
codeSize: '400KB',
vulnerabilityCount: 4,
industryCategory: '编译器',
developer: 'Babel团队',
contributorCountries: ['美国', '英国', '印度'],
contributorOrganizations: ['Facebook', 'Netflix', 'Uber'],
programmingLanguage: 'JavaScript',
communityHash: 'q7r8s9t0',
softwareScore: 8.7,
sourceCodeDownload: 'https://github.com/babel/babel',
copyright: 'MIT License',
externalVulnerabilitySource: 'CVE-2025-3344',
versionDescription: '新增了对新语法的支持',
compatibilityRisk: '中',
communityEOL: '2026-12-31',
},
{
softwareName: 'typescript',
softwareVersion: '5.0.0',
releaseDate: '2025-05-01',
licenseCount: 1,
dependencyCount: 5,
productComponentUsage: ['供应链系统G'],
codeSize: '2MB',
vulnerabilityCount: 0,
industryCategory: '编程语言',
developer: 'Microsoft',
contributorCountries: ['美国', '中国', '加拿大'],
contributorOrganizations: ['Microsoft', 'Google', 'Alibaba'],
programmingLanguage: 'TypeScript',
communityHash: 'u1v2w3x4',
softwareScore: 9.5,
sourceCodeDownload: 'https://github.com/microsoft/TypeScript',
copyright: 'Apache License 2.0',
externalVulnerabilitySource: '无',
versionDescription: '新增了装饰器功能',
compatibilityRisk: '低',
communityEOL: '2035-12-31',
},
{
softwareName: 'jest',
softwareVersion: '29.0.0',
releaseDate: '2025-06-10',
licenseCount: 1,
dependencyCount: 18,
productComponentUsage: ['供应链系统H'],
codeSize: '600KB',
vulnerabilityCount: 2,
industryCategory: '测试工具',
developer: 'Facebook',
contributorCountries: ['美国', '德国', '法国'],
contributorOrganizations: ['Facebook', 'Netflix', 'Spotify'],
programmingLanguage: 'JavaScript',
communityHash: 'y5z6a7b8',
softwareScore: 9.1,
sourceCodeDownload: 'https://github.com/facebook/jest',
copyright: 'MIT License',
externalVulnerabilitySource: 'CVE-2025-5566',
versionDescription: '优化了测试性能',
compatibilityRisk: '中',
communityEOL: '2032-12-31',
},
{
softwareName: 'docker',
softwareVersion: '24.0.0',
releaseDate: '2025-07-15',
licenseCount: 1,
dependencyCount: 25,
productComponentUsage: ['供应链系统I'],
codeSize: '10MB',
vulnerabilityCount: 6,
industryCategory: '容器化工具',
developer: 'Docker Inc.',
contributorCountries: ['美国', '英国', '澳大利亚'],
contributorOrganizations: ['Docker Inc.', 'Google', 'Amazon'],
programmingLanguage: 'Go',
communityHash: 'c9d0e1f2',
softwareScore: 9.3,
sourceCodeDownload: 'https://github.com/docker/docker',
copyright: 'Apache License 2.0',
externalVulnerabilitySource: 'CVE-2025-7788',
versionDescription: '新增了对ARM架构的支持',
compatibilityRisk: '高',
communityEOL: '2030-12-31',
},
{
softwareName: 'kubernetes',
softwareVersion: '1.28.0',
releaseDate: '2025-08-20',
licenseCount: 1,
dependencyCount: 30,
productComponentUsage: ['供应链系统J'],
codeSize: '15MB',
vulnerabilityCount: 8,
industryCategory: '容器编排工具',
developer: 'CNCF',
contributorCountries: ['美国', '中国', '德国'],
contributorOrganizations: ['Google', 'Red Hat', 'IBM'],
programmingLanguage: 'Go',
communityHash: 'g3h4i5j6',
softwareScore: 9.4,
sourceCodeDownload: 'https://github.com/kubernetes/kubernetes',
copyright: 'Apache License 2.0',
externalVulnerabilitySource: 'CVE-2025-9900',
versionDescription: '优化了集群管理功能',
compatibilityRisk: '高',
communityEOL: '2033-12-31',
},
{
softwareName: 'postgresql',
softwareVersion: '15.0.0',
releaseDate: '2025-09-25',
licenseCount: 1,
dependencyCount: 7,
productComponentUsage: ['供应链系统K'],
codeSize: '8MB',
vulnerabilityCount: 3,
industryCategory: '数据库',
developer: 'PostgreSQL团队',
contributorCountries: ['美国', '加拿大', '日本'],
contributorOrganizations: ['PostgreSQL Inc.', 'Amazon', 'Microsoft'],
programmingLanguage: 'C',
communityHash: 'k7l8m9n0',
softwareScore: 9.6,
sourceCodeDownload: 'https://github.com/postgres/postgres',
copyright: 'PostgreSQL License',
externalVulnerabilitySource: 'CVE-2025-1122',
versionDescription: '新增了JSONB索引功能',
compatibilityRisk: '低',
communityEOL: '2035-12-31',
},
]);
const tableData = ref([]);
const formData = ref({ title: '',type: '', useType: '',formData:'',select: '',time1:null,name:'',versionCode:'',pulishTime:'' });
const typeOptions = reactive(['主软件', '依赖软件']);
const riskOptions = reactive(['低', '中', '高']);
@@ -395,21 +170,21 @@ const columns = ref([
{ key: 'licenseCount', label: 'License数量', visible: true, filterable: false, sortable: false },
{ key: 'dependencyCount', label: '依赖软件数', visible: true, filterable: false, sortable: false },
{ key: 'productComponentUsage', label: '产品成分使用量', visible: false, filterable: false, sortable: false },
{ key: 'codeSize', label: '代码量', visible: true, filterable: false, sortable: false },
{ key: 'codeLines', label: '代码量', visible: true, filterable: false, sortable: false },
{ key: 'vulnerabilityCount', label: '漏洞数量', visible: true, filterable: false, sortable: false },
{ key: 'industryCategory', label: '行业分类', visible: true, filterable: true, sortable: false },
{ key: 'developer', label: '开发商', visible: false, filterable: true, sortable: false },
{ key: 'communityName', label: '开发商', visible: false, filterable: true, sortable: false },
{ key: 'contributorCountries', label: '贡献者国家/地区分布', visible: true, filterable: false, sortable: false },
{ key: 'contributorOrganizations', label: '贡献者组织/公司分布', visible: true, filterable: false, sortable: false },
{ key: 'programmingLanguage', label: '编程语言', visible: false, filterable: true, sortable: false },
{ key: 'primaryLanguage', label: '编程语言', visible: false, filterable: true, sortable: false },
{ key: 'communityHash', label: '社区hash值', visible: false, filterable: false, sortable: false },
{ key: 'softwareScore', label: '软件评分', visible: false, filterable: false, sortable: true },
{ key: 'sourceCodeDownload', label: '源码包下载地址', visible: true, filterable: false, sortable: false },
{ key: 'securityScore', label: '软件评分', visible: false, filterable: false, sortable: true },
{ key: 'sourceDownloadUrl', label: '源码包下载地址', visible: true, filterable: false, sortable: false },
{ key: 'copyright', label: 'CopyRight', visible: false, filterable: false, sortable: false },
{ key: 'externalVulnerabilitySource', label: '外部漏洞源的软件名称', visible: false, filterable: true, sortable: false },
{ key: 'versionDescription', label: '版本描述', visible: false, filterable: false, sortable: false },
{ key: 'compatibilityRisk', label: '兼容性风险描述', visible: false, filterable: false, sortable: false },
{ key: 'communityEOL', label: '社区EOL时间', visible: false, filterable: true, sortable: true },
{ key: 'eolDate', label: '社区EOL时间', visible: false, filterable: true, sortable: true },
]);
// 定义 showColumnList 状态
@@ -452,7 +227,7 @@ const route = useRoute();
const gotoDetail = (row) => {
// 后续请换成params暂时params传参没传过去
router.push({
path: 'repoDetail/' + row.version
path: 'repoDetail/' + row.id
});
};
// 分页
@@ -525,6 +300,19 @@ const signCla = (row: any) => {
router.push('/cla/' + row.object_id);
};
const getReleaseList = async() => {
const { data, error } = await releasePage({ ...newFormData.value, current: pager.value.pageIndex,size: pager.value.pageSize });
if (!error && data) {
debugger
tableData.value = data.data.records;
pager.value.total = data.data.total;
}
};
onMounted(async() => {
getReleaseList();
});
onMounted(() => {
const query: any = route.query;
newFormData.value = {

View File

@@ -289,12 +289,12 @@
<script setup lang="ts">
import { ref, defineEmits, onMounted,reactive } from 'vue';
import { useRouter } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import { discussDetailType, userInfoType } from '@/api/discussion/types';
import { Message } from 'vue-devui/message';
import { useClipboard } from '@vueuse/core/index';
import { releaseInfo } from '@/api/jyh';
const route = useRoute();
const emits = defineEmits(['changeTabs']);
// 触发事件的方法
@@ -340,15 +340,18 @@ const handleCopy = event => {
};
const getReleaseInfo = async() => {
const { data, error } = await releaseInfo({ repoId: '123',releaseId: '123' });
const getReleaseInfo = async(versionId) => {
const { data, error } = await releaseInfo({ softwareId: versionId });
if (!error && data) {
ReleaseInfo.value = data.data;
}
};
onMounted(async() => {
getReleaseInfo();
onMounted(() => {
const versionId = route.params.versionId; // 获取路由参数 versionId
if (versionId) {
getReleaseInfo(versionId); // 调用接口获取数据
}
});
</script>