Auto Commit

上级 d11931b2
<script setup>
import axios from 'axios';
import * as echarts from 'echarts';
import Author from './Author.vue'
import {tableColumns} from './const'
import {getRemoteCsdnGrade} from '../service/csdnApi'
import { onMounted, reactive, onUnmounted } from 'vue';
const state = reactive({
loading: false,
searchValue: '',
firstChart: null,
columns: [{
title: '文章名称',
dataIndex: 'title',
fixed: true
}, {
title: '链接',
key: 'url'
}, {
title: '浏览量',
dataIndex: 'viewCount',
sorter: (a, b) => a.viewCount - b.viewCount,
}, {
title: '评论量',
dataIndex: 'commentCount',
sorter: (a, b) => a.commentCount - b.commentCount,
}, {
title: '收藏量',
dataIndex: 'collectCount',
sorter: (a, b) => a.collectCount - b.collectCount,
},, {
title: '点赞量',
dataIndex: 'diggCount',
sorter: (a, b) => a.diggCount - b.diggCount,
},{
title: '质量分',
dataIndex: 'score',
sorter: (a, b) => a.score - b.score,
}, {
title: '建议',
dataIndex: 'message',
}, {
title: '发文时间',
dataIndex: 'postTime',
}],
columns:tableColumns,
dataSource: [],
pagination: {
total: 0,
......@@ -64,14 +31,12 @@ function changePageSize(current, pageSize) {
state.pagination.pageSize = pageSize
}
const getCsdnData = (uId) => {
const url = 'https://yongma16.xyz/common-api/getCsdnGrade/'
const data = {
uId
}
state.loading = true
state.pagination.current = 1
axios.post(url, data, { timeout: 100000 }).then(res => {
getRemoteCsdnGrade(data).then(res => {
state.dataSource = res.data.data
state.pagination.total = state.dataSource.length
state.loading = false
......@@ -241,6 +206,5 @@ function initFirstData() {
<div id="first" style="width:100vw;height:900px;margin: 0 auto"></div>
</a-spin>
</div>
</div>
</template>
export const tableColumns= [{
title: '文章名称',
dataIndex: 'title',
fixed: true
}, {
title: '链接',
key: 'url'
}, {
title: '浏览量',
dataIndex: 'viewCount',
sorter: (a, b) => a.viewCount - b.viewCount,
}, {
title: '评论量',
dataIndex: 'commentCount',
sorter: (a, b) => a.commentCount - b.commentCount,
}, {
title: '收藏量',
dataIndex: 'collectCount',
sorter: (a, b) => a.collectCount - b.collectCount,
},, {
title: '点赞量',
dataIndex: 'diggCount',
sorter: (a, b) => a.diggCount - b.diggCount,
},{
title: '质量分',
dataIndex: 'score',
sorter: (a, b) => a.score - b.score,
}, {
title: '建议',
dataIndex: 'message',
}, {
title: '发文时间',
dataIndex: 'postTime',
}]
\ No newline at end of file
import axios from 'axios';
const url = 'https://yongma16.xyz/common-api/getCsdnGrade/'
export function getRemoteCsdnGrade(data){
return axios.post(url, data, { timeout: 100000 })
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册