Auto Commit

上级 a20b70ab
......@@ -10,23 +10,22 @@ const state = reactive({
columns: [{
title: '文章名称',
dataIndex: 'title',
fixed:true
fixed: true
}, {
title: '链接',
dataIndex: 'url',
sorter: true,
key: 'url'
}, {
title: '浏览量',
dataIndex: 'viewCount',
sorter: true,
sorter: (a, b) => a.viewCount - b.viewCount,
}, {
title: '收藏量',
dataIndex: 'collectCount',
sorter: true,
sorter: (a, b) => a.collectCount - b.collectCount,
}, {
title: '分数',
dataIndex: 'score',
sorter: true,
sorter: (a, b) => a.score - b.score,
}, {
title: '建议',
dataIndex: 'message',
......@@ -34,7 +33,16 @@ const state = reactive({
title: '发文时间',
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) => {
......@@ -43,11 +51,14 @@ const getCsdnData = (uId) => {
uId
}
state.loading = true
state.pagination.current = 1
axios.post(url, data, { timeout: 100000 }).then(res => {
state.dataSource = res.data.data
state.pagination.total = state.dataSource.length
state.loading = false
initFirstData()
}).catch((r) => {
state.pagination.total = 0
console.log(r)
state.loading = false
state.dataSource = []
......@@ -112,10 +123,11 @@ function initFirstData() {
const findItem = state.dataSource.find(item => {
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:red'>-<span> 博客建议:${findItem.message}<br>
<span style='color:blue'>-<span> 博客地址:${findItem.url}<br>
<span style='color:blue'>-<span> 发文时间:${params.name}<br>
`
},
},
......@@ -170,11 +182,19 @@ function initFirstData() {
<div class="container">
<div>
<a-input-search v-model:value="state.searchValue" :disabled="state.loading" placeholder="输入用户id" enter-button
@search="onSearch" />
@search="onSearch" />
</div>
<br>
<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>
</div>
<div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册