merge junjie_dev into master

update: 首页更新

Created-by: user8949
Commit-by: @user8949;user8949
Merged-by: user8949
Description: update: 首页bug修复,AI修复建议 & 许可证信息页面接口更新
update: 首页更新
update: 首页更新

See merge request: hk_openRepo/OpenRepo_Portal!43
This commit is contained in:
user8949
2025-03-19 13:36:06 +08:00
5 changed files with 94 additions and 117 deletions

View File

@@ -103,9 +103,9 @@ export function getRepairInfo() {
url: '/api/v1/repo/repair/info',
method: 'POST',
data: {
current: 1,
size: 10,
softwareId: 47
"current": 1,
"size": 10,
"softwareId": 47
}
});
}
@@ -113,12 +113,12 @@ export function getRepairInfo() {
// 获取许可证列表
export function getLicenseList() {
return request({
url: '/api/v1/repo/license/list',
method: 'GET',
params: {
current: 1,
size: 10,
softwareId: 47
url: '/api/v1/repo/license/info',
method: 'POST',
data: {
"current": 1,
"size": 10,
"softwareId": 47
}
});
}

View File

@@ -2,14 +2,14 @@
<d-layout class="dlayout">
<d-header class="dheader">
<div class="title">
<h1>Apache License 2.0</h1>
<h1>{{ data.licenseName }}</h1>
<d-icon style="cursor: pointer;" name="icon-close" @click="emit('close')"></d-icon>
</div>
<div class="sub-title">
<span>分数</span>
<span>3</span>
<span>类型</span>
<d-tag color="#3ac295" size="sm">获准的</d-tag>
<d-tag color="#3ac295" size="sm">{{ data.category }}</d-tag>
</div>
</d-header>
<d-content class="dcontent">
@@ -78,7 +78,11 @@
<script setup>
import { ref, defineEmits } from 'vue';
const props = defineProps({
data: {
type: Object
}
})
const emit = defineEmits(['close']);
</script>

View File

@@ -24,7 +24,7 @@
<div class="ai-panel-header-title">
<div>
<d-tag color="red-w98" class="mr-1" size="sm">严重</d-tag>
<span>Morgan</span>
<span>{{ rowItem.title }}</span>
</div>
<div style="cursor: pointer; display: flex; gap: 8px; align-items: center;" @click="rowItem.expand = !rowItem.expand">
<img style="width: 14px; height: 14px;" src="@/assets/imgs/jyh/collapseIcon.png">
@@ -44,9 +44,9 @@
</div>
<div>
<span class="weak-text">升级版本</span>
<span>xxx</span>
<span>1.7.0</span>
<img src="@/assets/imgs/jyh/ic_digital_power_next_step_@2x.png" class="icon-sm">
<span>xxx</span>
<span>1.9.1</span>
</div>
</div>
</div>
@@ -106,25 +106,27 @@ const tableConfig = ref([
const list = ref([
{
expand: true,
title: 'Morgan',
data: {
listData: [
{
securityProblemCode: '1',
type: '安全问题',
CWEcode: 'CWE-123',
score: 100
score: 70
},
{
securityProblemCode: '2',
type: '安全问题',
CWEcode: 'CWE-123',
score: 100
CWEcode: 'MIT-LICENSE',
score: 89
}
]
}
},
{
expand: true,
title: 'webpack',
data: {
listData: [
{
@@ -136,65 +138,8 @@ const list = ref([
{
securityProblemCode: '2',
type: '安全问题',
CWEcode: 'CWE-123',
score: 100
}
]
}
},
{
expand: true,
data: {
listData: [
{
securityProblemCode: '1',
type: '安全问题',
CWEcode: 'CWE-123',
score: 100
},
{
securityProblemCode: '2',
type: '安全问题',
CWEcode: 'CWE-123',
score: 100
}
]
}
},
{
expand: true,
data: {
listData: [
{
securityProblemCode: '1',
type: '安全问题',
CWEcode: 'CWE-123',
score: 100
},
{
securityProblemCode: '2',
type: '安全问题',
CWEcode: 'CWE-123',
score: 100
}
]
}
},
{
expand: true,
data: {
listData: [
{
securityProblemCode: '1',
type: '安全问题',
CWEcode: 'CWE-123',
score: 100
},
{
securityProblemCode: '2',
type: '安全问题',
CWEcode: 'CWE-123',
score: 100
CWEcode: 'MIT-LICENSE',
score: 90
}
]
}

View File

@@ -65,7 +65,7 @@
</d-dropdown-menu>
<d-button color="primary" variant="solid" @click="search">搜索</d-button>
</div>
<d-button @click="check" ref="origin" icon="share" class="batch-btn">批量校验</d-button>
<d-button v-if="isLogin" @click="check" ref="origin" icon="share" class="batch-btn">批量校验</d-button>
<div class="home-information">
<div class="info-title">
<div class="sub-title">
@@ -89,11 +89,11 @@
@click="openWarningDetail(item, index)"
>
<span>{{ item.subject }}</span>
<d-tag :color="tagMap[item.importance]" size="sm">{{ item.importance }}</d-tag>
<d-tag v-if="item.importance" :color="tagMap[item.importance].color" size="sm">{{ tagMap[item.importance].text }}</d-tag>
</div>
<div class="time-container">
<d-icon name="icon-time"></d-icon>
{{ item.pulishTime }}
{{ item.publishTime }}
</div>
</div>
</template>
@@ -142,10 +142,23 @@ const homeSearch = ref(null);
const dropdownWidth = ref(0);
const selectedCate = ref('软件');
const tagMap = {
: '#f66f6a',
: '#fac20a',
: '#5e7ce0'
};
'Critical': {
text: '致命',
color: '#c7000b'
},
'High': {
text: '高',
color: '#f66f6a'
},
'Medium': {
text: '中',
color: '#fac20a'
},
'Low': {
text: '低',
color: '#5e7ce0'
}
}
const searchInput = ref(null);
const openAdvancedSearch = () => {
@@ -254,7 +267,6 @@ getNoticeList();
.home-content {
font-size: 14px;
height: 80%;
width: 50%;
display: flex;
flex-direction: column;
@@ -432,8 +444,11 @@ getNoticeList();
display: flex;
align-items: center;
gap: 8px;
width: 120px;
width: 150px;
flex-shrink: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
:deep(.devui-timeline-item-data-right) {

View File

@@ -4,12 +4,15 @@
<d-layout>
<d-content class="dcontent">
<d-table :data="list" style="width: 100%;">
<template #empty>
<NoData></NoData>
</template>
<d-column type="index" width="40"></d-column>
<d-column v-for="(column, index) in tableConfig" :field="column.field"
:header="column.header" :sortable="column.sortable" :sort-method="column.sortMethod"></d-column>
<d-column header="详情" width="100px">
<template #default="scope">
<a class="devui-link" @click="openPanel">查看</a>
<a class="devui-link" @click="openPanel(scope.row)">查看</a>
</template>
</d-column>
</d-table>
@@ -30,7 +33,7 @@
</div>
</div>
<d-drawer v-model="showDetail" style="width: 800px; padding: 20px" >
<SidePanel @close="close"/>
<SidePanel :data="currentData" @close="close"/>
</d-drawer>
</template>
@@ -38,6 +41,8 @@
import { ref } from 'vue';
import SidePanel from '@/components/LicenseInfo/SidePanel.vue';
import { getLicenseList } from '@/api/jyh';
import NoData from '@/components/NoData/NoData.vue';
const currentData = ref(null);
const pager = ref({
pageIndex: 1,
pageSize: 30,
@@ -52,7 +57,8 @@ const close = () => {
showDetail.value = false;
}
const openPanel = () => {
const openPanel = (row) => {
currentData.value = row
showDetail.value = true;
}
@@ -64,7 +70,7 @@ const tableConfig = ref([
sortMethod: null
},
{
field: 'licenseType',
field: 'category',
header: '许可证种类',
sortable: false,
sortMethod: null
@@ -84,34 +90,41 @@ const tableConfig = ref([
])
const list = ref([
{
licenseName: 'Apache License 2.0',
licenseType: '获准的',
affectedComponent: 'org.apache.commons:commons-collections4',
version: '4.4',
},
{
licenseName: 'Apache License 2.0',
licenseType: '获准的',
affectedComponent: 'org.apache.commons:commons-collections4',
version: '4.4',
},
{
licenseName: 'Apache License 2.0',
licenseType: '获准的',
affectedComponent: 'org.apache.commons:commons-collections4',
version: '4.4',
},
{
licenseName: 'Apache License 2.0',
licenseType: '获准的',
affectedComponent: 'org.apache.commons:commons-collections4',
version: '4.4',
}
// {
// licenseName: 'Apache License 2.0',
// licenseType: '获准的',
// affectedComponent: 'org.apache.commons:commons-collections4',
// version: '4.4',
// },
// {
// licenseName: 'Apache License 2.0',
// licenseType: '获准的',
// affectedComponent: 'org.apache.commons:commons-collections4',
// version: '4.4',
// },
// {
// licenseName: 'Apache License 2.0',
// licenseType: '获准的',
// affectedComponent: 'org.apache.commons:commons-collections4',
// version: '4.4',
// },
// {
// licenseName: 'Apache License 2.0',
// licenseType: '获准的',
// affectedComponent: 'org.apache.commons:commons-collections4',
// version: '4.4',
// }
])
const getList = async() => {
const res = await getLicenseList()
const res: any = await getLicenseList();
if (!res.error) {
console.log(res);
list.value = res.data.data.records;
pager.value.total = res.data.data.records.length;
} else {
list.value = [];
}
}
getList();
</script>