update: 首页bug修复,AI修复建议 & 许可证信息页面接口更新

This commit is contained in:
@user8949
2025-03-19 13:13:35 +08:00
parent d50ed3f2c1
commit 67a97aaafe
5 changed files with 87 additions and 115 deletions

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>