feat: 报告、证书下载功能
This commit is contained in:
parent
695769076a
commit
19ec7ca25a
@ -38,17 +38,25 @@ const props = defineProps({
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
|
||||
|
||||
const loading = ref(false)
|
||||
const tableData = ref([...props.assetList])
|
||||
|
||||
function handleDownloadReport(item) {
|
||||
window.$message?.info('下载报告功能开发中')
|
||||
// window.$message?.info('下载报告功能开发中')
|
||||
if (item.certificate_download_urls && item.certificate_download_urls[0]) {
|
||||
window.open(item.certificate_download_urls[0], '_blank')
|
||||
} else {
|
||||
window.$message?.error('报告下载链接不存在')
|
||||
}
|
||||
}
|
||||
|
||||
function handleDownloadCertificate(item) {
|
||||
window.$message?.info('下载证书功能开发中')
|
||||
// window.$message?.info('下载证书功能开发中')
|
||||
if (item.report_download_urls && item.report_download_urls[0]) {
|
||||
window.open(item.report_download_urls[0], '_blank')
|
||||
} else {
|
||||
window.$message?.error('证书下载链接不存在')
|
||||
}
|
||||
}
|
||||
|
||||
function formatDate(dateStr) {
|
||||
@ -71,7 +79,7 @@ const pagination = reactive({
|
||||
pagination.pageSize = pageSize
|
||||
pagination.page = 1
|
||||
fetchHistory()
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
const columns = [
|
||||
@ -81,7 +89,7 @@ const columns = [
|
||||
width: 80,
|
||||
align: 'center',
|
||||
titleAlign: 'center',
|
||||
render: (_, index) => (pagination.page - 1) * pagination.pageSize + index + 1
|
||||
render: (_, index) => (pagination.page - 1) * pagination.pageSize + index + 1,
|
||||
},
|
||||
{
|
||||
title: '资产名称',
|
||||
@ -90,19 +98,20 @@ const columns = [
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
titleAlign: 'center',
|
||||
render: (row) => h(
|
||||
'div',
|
||||
{
|
||||
class: 'asset-name-link',
|
||||
onClick: () => {
|
||||
router.push({
|
||||
path: '/pages',
|
||||
query: { id: row.id }
|
||||
})
|
||||
}
|
||||
},
|
||||
row.asset_name || row.name || '未知资产'
|
||||
),
|
||||
render: (row) =>
|
||||
h(
|
||||
'div',
|
||||
{
|
||||
class: 'asset-name-link',
|
||||
onClick: () => {
|
||||
router.push({
|
||||
path: '/pages',
|
||||
query: { id: row.id },
|
||||
})
|
||||
},
|
||||
},
|
||||
row.asset_name || row.name || '未知资产'
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '评估时间',
|
||||
@ -161,9 +170,9 @@ const rowKey = (row) => row.id ?? row.asset_name ?? row.name
|
||||
async function fetchHistory() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await api.getHistoryList({
|
||||
page: pagination.page,
|
||||
page_size: pagination.pageSize
|
||||
const res = await api.getHistoryList({
|
||||
page: pagination.page,
|
||||
page_size: pagination.pageSize,
|
||||
})
|
||||
const list = res?.data?.items ?? res?.data?.results ?? res?.results ?? []
|
||||
tableData.value = Array.isArray(list) ? list : []
|
||||
@ -217,7 +226,7 @@ onMounted(fetchHistory)
|
||||
|
||||
:deep(.asset-name-link) {
|
||||
cursor: pointer;
|
||||
color: #A30113;
|
||||
color: #a30113;
|
||||
font-weight: 500;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user