文章报表

This commit is contained in:
weixiaobo@boe.com.cn
2023-08-21 18:26:10 +08:00
parent f48f12936e
commit 05324f2b78

View File

@@ -23,6 +23,15 @@
>
</a-input>
</div>
<div class="select">
<a-range-picker
v-model:value="publishTime"
type="date"
valueFormat="YYYY-MM-DD"
:placeholder="['发布开始时间','结束时间']"
style="width: 100%; margin-right: 0px"
/>
</div>
<div style="display: flex; margin-bottom: 20px">
<div class="btnzx btnzx1" @click="searchData">
<div class="search"></div>
@@ -127,6 +136,7 @@ export default {
pageSize: 10, // 每页条数
pageNo: 1, //当前页码
createName: "", //创建者名称
publishTime: "", // 发布时间
title: "", // 文章名称
selectedRowKeys: [], // 选中的列
});
@@ -157,6 +167,11 @@ export default {
if (state.createName) {
params.createName = state.createName;
}
if (state.publishTime.length>0) {
// params.publishTime = state.publishTime;
params.startTime = state.publishTime[0];
params.endTime = state.publishTime[1];
}
axios({
method: "post",
url: "/report/boeu/article/exportAll",
@@ -183,19 +198,31 @@ export default {
}
const getTableData = async () => {
state.tableLoading = true;
const params = { page: state.pageNo, size: state.pageSize };
const params = {
title: state.title,
createName: state.createName,
// publishTime: state.publishTime,
startTime: state.publishTime[0],
endTime: state.publishTime[1],
page: state.pageNo,
size: state.pageSize
};
if (state.title) {
params.title = state.title;
}
if (state.createName) {
params.createName = state.createName;
}
if (state.publishTime.length>0) {
// params.publishTime = state.publishTime;
params.startTime = state.publishTime[0];
params.endTime = state.publishTime[1];
}
const res = await api.boeuArticlePageList(params);
if (res) {
state.tableLoading = false;
state.tableDataTotal = res.data.total;
const list = res.data.rows?.map((item) => {
state.tableDataTotal = res.data.result.total;
const list = res.data.result.rows?.map((item) => {
return {
...item,
key: item.id,
@@ -207,6 +234,7 @@ export default {
const resetClick = () => {
state.selectedRowKeys = [];
state.createName = "";
state.publishTime = [];
state.title = "";
getTableData();
};
@@ -228,12 +256,19 @@ export default {
align: "center",
},
{
title: "浏览",
title: "浏览",
dataIndex: "views",
ellipsis: true,
key: "views",
align: "center",
},
{
title: "点赞数",
dataIndex: "praises",
ellipsis: true,
key: "praises",
align: "center",
},
{
title: "评论数",
dataIndex: "comments",
@@ -242,19 +277,12 @@ export default {
align: "center",
},
{
title: "分享",
title: "分享",
dataIndex: "shares",
ellipsis: true,
key: "shares",
align: "center",
},
{
title: "点赞量",
dataIndex: "praises",
ellipsis: true,
key: "praises",
align: "center",
},
{
title: "收藏数",
dataIndex: "favorites",
@@ -269,13 +297,13 @@ export default {
key: "publishTime",
align: "center",
},
{
title: "文章状态",
dataIndex: "status",
ellipsis: true,
key: "status",
align: "center",
},
// {
// title: "文章状态",
// dataIndex: "status",
// ellipsis: true,
// key: "status",
// align: "center",
// },
{
title: "创建人",
dataIndex: "sysCreateBy",
@@ -327,7 +355,7 @@ export default {
.select {
margin-right: 20px;
margin-bottom: 20px;
width: calc((100% - 76px - 200px) / 2);
width: calc((100% - 76px - 220px) / 3);
}
.btnz {