案例报表

This commit is contained in:
weixiaobo@boe.com.cn
2023-08-21 18:25:52 +08:00
parent d91308801f
commit f48f12936e

View File

@@ -23,6 +23,31 @@
> >
</a-input> </a-input>
</div> </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 class="select">
<a-cascader
change-on-select
:options="option"
v-model:value="orgId"
style="width: 100%"
placeholder="请选择归属组织"
:allowClear="allowClear"
:fieldNames="{
label: 'orgName',
value: 'organizationId',
children: 'childList',
}"
>
</a-cascader>
</div>
<div style="display: flex; margin-bottom: 20px"> <div style="display: flex; margin-bottom: 20px">
<div class="btnzx btnzx1" @click="searchData"> <div class="btnzx btnzx1" @click="searchData">
<div class="search"></div> <div class="search"></div>
@@ -112,7 +137,12 @@ export default {
title: "", title: "",
author: "", author: "",
authorName: "", authorName: "",
publishTime: "", // 发布时间
selectedRowKeys: [], selectedRowKeys: [],
orgId: null, // 状态值
option: [], // 组织列表
allowClear: true,
resetOrgId: [],
}); });
// 表格数据 // 表格数据
let tableData = ref([]); let tableData = ref([]);
@@ -123,15 +153,28 @@ export default {
return item.id; return item.id;
}); });
}; };
//请求组织接口
const getOrgList = async () => {
//todo 获取用户角色列表判断里面是否有system-admin
// let roleList = store.state.userInfo.roleList;
const res = await api.userGetUserOrg();
if (res) {
state.option = res.data?.result;
state.orgId = [state.option[0]?.organizationId];
state.resetOrgId = [state.option[0]?.organizationId];
state.allowClear = true;
// getTableData();
}
};
// cloumns 表头 // cloumns 表头
const columns = ref([ const columns = ref([
{ // {
title: "编号", // title: "编号",
dataIndex: "num", // dataIndex: "num",
ellipsis: true, // ellipsis: true,
key: "num", // key: "num",
align: "center", // align: "center",
}, // },
{ {
title: "案例名称", title: "案例名称",
dataIndex: "title", dataIndex: "title",
@@ -146,6 +189,13 @@ export default {
key: "orgDomain", key: "orgDomain",
align: "center", align: "center",
}, },
// {
// title: "案例分类",
// dataIndex: "majorType1",
// ellipsis: true,
// key: "majorType1",
// align: "center",
// },
{ {
title: "专业分类", title: "专业分类",
dataIndex: "majorType", dataIndex: "majorType",
@@ -160,6 +210,13 @@ export default {
key: "views", key: "views",
align: "center", align: "center",
}, },
{
title: "点赞量",
dataIndex: "praises",
ellipsis: true,
key: "praises",
align: "center",
},
{ {
title: "评论数", title: "评论数",
dataIndex: "comments", dataIndex: "comments",
@@ -167,13 +224,13 @@ export default {
key: "comments", key: "comments",
align: "center", align: "center",
}, },
{ // {
title: "分享量", // title: "分享量",
dataIndex: "shares", // dataIndex: "shares",
ellipsis: true, // ellipsis: true,
key: "shares", // key: "shares",
align: "center", // align: "center",
}, // },
{ {
title: "收藏数", title: "收藏数",
dataIndex: "favorites", dataIndex: "favorites",
@@ -189,12 +246,19 @@ export default {
align: "center", align: "center",
}, },
{ {
title: "状态", title: "创建人/作者",
dataIndex: "caseScope", dataIndex: "authorName",
ellipsis: true, ellipsis: true,
key: "caseScope", key: "authorName",
align: "center", align: "center",
}, },
// {
// title: "状态",
// dataIndex: "caseScope",
// ellipsis: true,
// key: "caseScope",
// align: "center",
// },
]); ]);
// table 分页事件 // table 分页事件
const changePagination = (page) => { const changePagination = (page) => {
@@ -207,15 +271,19 @@ export default {
const res = await api.boeuCasePlatePageList({ const res = await api.boeuCasePlatePageList({
page: state.pageNo, page: state.pageNo,
size: state.pageSize, size: state.pageSize,
orgId: state.orgId ? state.orgId[state.orgId.length - 1] : null,
title: state.title, title: state.title,
author: state.author, author: state.author,
authorName: state.authorName, authorName: state.authorName,
// publishTime: state.publishTime,
startTime: state.publishTime[0],
endTime: state.publishTime[1],
boeRouterInfoName: state.boeRouterInfoName, boeRouterInfoName: state.boeRouterInfoName,
}); });
if (res) { if (res) {
console.log(res.data, "res.data"); console.log(res.data, "res.data");
state.tableDataTotal = res.data.total; state.tableDataTotal = res.data.result.total;
const list = res.data.rows?.map((item) => { const list = res.data.result.rows?.map((item) => {
return { return {
key: item.id, key: item.id,
...item, ...item,
@@ -232,6 +300,7 @@ export default {
state.title = ""; state.title = "";
state.authorName = ""; state.authorName = "";
state.author = ""; state.author = "";
state.publishTime = [];
getTableData(); getTableData();
}; };
const searchData = async () => { const searchData = async () => {
@@ -262,6 +331,9 @@ export default {
size: state.pageSize, size: state.pageSize,
title: state.title, title: state.title,
author: state.author, author: state.author,
// publishTime: state.publishTime,
startTime: state.publishTime[0],
endTime: state.publishTime[1],
}; };
axios({ axios({
method: "post", method: "post",
@@ -280,6 +352,7 @@ export default {
} }
}; };
onMounted(() => { onMounted(() => {
getOrgList();
getTableData(); getTableData();
state.tableLoading = true; state.tableLoading = true;
}); });
@@ -313,7 +386,7 @@ export default {
.select { .select {
margin-right: 20px; margin-right: 20px;
margin-bottom: 20px; margin-bottom: 20px;
width: calc((100% - 76px - 200px) / 2); width: calc((100% - 76px - 240px) / 4);
} }
.btnz { .btnz {