Auto Commit

上级 a20b70ab
...@@ -10,23 +10,22 @@ const state = reactive({ ...@@ -10,23 +10,22 @@ const state = reactive({
columns: [{ columns: [{
title: '文章名称', title: '文章名称',
dataIndex: 'title', dataIndex: 'title',
fixed:true fixed: true
}, { }, {
title: '链接', title: '链接',
dataIndex: 'url', key: 'url'
sorter: true,
}, { }, {
title: '浏览量', title: '浏览量',
dataIndex: 'viewCount', dataIndex: 'viewCount',
sorter: true, sorter: (a, b) => a.viewCount - b.viewCount,
}, { }, {
title: '收藏量', title: '收藏量',
dataIndex: 'collectCount', dataIndex: 'collectCount',
sorter: true, sorter: (a, b) => a.collectCount - b.collectCount,
}, { }, {
title: '分数', title: '分数',
dataIndex: 'score', dataIndex: 'score',
sorter: true, sorter: (a, b) => a.score - b.score,
}, { }, {
title: '建议', title: '建议',
dataIndex: 'message', dataIndex: 'message',
...@@ -34,7 +33,16 @@ const state = reactive({ ...@@ -34,7 +33,16 @@ const state = reactive({
title: '发文时间', title: '发文时间',
dataIndex: 'postTime', dataIndex: 'postTime',
}], }],
dataSource: [] dataSource: [],
pagination: {
total: 100,
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + '' + total + '';
},
}
}) })
const getCsdnData = (uId) => { const getCsdnData = (uId) => {
...@@ -43,11 +51,14 @@ const getCsdnData = (uId) => { ...@@ -43,11 +51,14 @@ const getCsdnData = (uId) => {
uId uId
} }
state.loading = true state.loading = true
state.pagination.current = 1
axios.post(url, data, { timeout: 100000 }).then(res => { axios.post(url, data, { timeout: 100000 }).then(res => {
state.dataSource = res.data.data state.dataSource = res.data.data
state.pagination.total = state.dataSource.length
state.loading = false state.loading = false
initFirstData() initFirstData()
}).catch((r) => { }).catch((r) => {
state.pagination.total = 0
console.log(r) console.log(r)
state.loading = false state.loading = false
state.dataSource = [] state.dataSource = []
...@@ -112,10 +123,11 @@ function initFirstData() { ...@@ -112,10 +123,11 @@ function initFirstData() {
const findItem = state.dataSource.find(item => { const findItem = state.dataSource.find(item => {
return item.postTime == params.name return item.postTime == params.name
}) })
return `<span style='color:blue'>-<span> 博客标题:${params.name} <br> return `<span style='color:blue'>-<span> 博客标题:${findItem.title} <br>
<span style='color:green'>-<span> 博客质量:${params.value} <br> <span style='color:green'>-<span> 博客质量:${params.value} <br>
<span style='color:red'>-<span> 博客建议:${findItem.message}<br> <span style='color:red'>-<span> 博客建议:${findItem.message}<br>
<span style='color:blue'>-<span> 博客地址:${findItem.url}<br> <span style='color:blue'>-<span> 博客地址:${findItem.url}<br>
<span style='color:blue'>-<span> 发文时间:${params.name}<br>
` `
}, },
}, },
...@@ -174,7 +186,15 @@ function initFirstData() { ...@@ -174,7 +186,15 @@ function initFirstData() {
</div> </div>
<br> <br>
<div> <div>
<a-table :scroll="{ x: 800,y:600 }" :columns="state.columns" :data-source="state.dataSource" :loading="state.loading"> <a-table :scroll="{ x: 800, y: 600 }" :columns="state.columns" :data-source="state.dataSource"
:loading="state.loading" :pagination="state.pagination">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'url'">
<a>
{{ record.url }}
</a>
</template>
</template>
</a-table> </a-table>
</div> </div>
<div> <div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册