diff --git a/src/api/jyh/index.ts b/src/api/jyh/index.ts index ef3666c..54a92d9 100644 --- a/src/api/jyh/index.ts +++ b/src/api/jyh/index.ts @@ -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 } }); } diff --git a/src/components/LicenseInfo/SidePanel.vue b/src/components/LicenseInfo/SidePanel.vue index e118232..9197f90 100644 --- a/src/components/LicenseInfo/SidePanel.vue +++ b/src/components/LicenseInfo/SidePanel.vue @@ -2,14 +2,14 @@
-

Apache License 2.0

+

{{ data.licenseName }}

分数 3 类型 - 获准的 + {{ data.category }}
@@ -78,7 +78,11 @@ diff --git a/src/views/Jyh/AIRepair/index.vue b/src/views/Jyh/AIRepair/index.vue index f73f259..106938c 100644 --- a/src/views/Jyh/AIRepair/index.vue +++ b/src/views/Jyh/AIRepair/index.vue @@ -24,7 +24,7 @@
严重 - Morgan + {{ rowItem.title }}
@@ -44,9 +44,9 @@
升级版本 - xxx + 1.7.0 - xxx + 1.9.1
@@ -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 } ] } diff --git a/src/views/Jyh/Home/index.vue b/src/views/Jyh/Home/index.vue index c063cdb..4d617ca 100644 --- a/src/views/Jyh/Home/index.vue +++ b/src/views/Jyh/Home/index.vue @@ -65,7 +65,7 @@ 搜索 - 批量校验 + 批量校验
@@ -89,11 +89,11 @@ @click="openWarningDetail(item, index)" > {{ item.subject }} - {{ item.importance }} + {{ tagMap[item.importance].text }}
- {{ item.pulishTime }} + {{ item.publishTime }}
@@ -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) { @@ -447,4 +462,4 @@ getNoticeList(); padding: 0px !important; } } - + \ No newline at end of file diff --git a/src/views/Jyh/LicenseInfo/index.vue b/src/views/Jyh/LicenseInfo/index.vue index 4b7a7e1..367fd2a 100644 --- a/src/views/Jyh/LicenseInfo/index.vue +++ b/src/views/Jyh/LicenseInfo/index.vue @@ -4,12 +4,15 @@ + @@ -30,7 +33,7 @@
- + @@ -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();