2025-06-25 18:26:03 +08:00
|
|
|
<!--
|
|
|
|
|
* @Author: RenXiaoDong
|
|
|
|
|
* @Date: 2025-06-25 10:02:20
|
|
|
|
|
-->
|
|
|
|
|
|
2025-06-27 18:37:42 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="account-dashboard-wrap">
|
2025-06-28 15:28:54 +08:00
|
|
|
<div class="filter-wrap bg-#fff rounded-8px border-1px border-#D7D7D9 border-solid px-24px pb-20px mb-16px">
|
2025-07-02 17:55:20 +08:00
|
|
|
<div class="top flex h-64px py-10px justify-between items-center">
|
2025-06-27 18:37:42 +08:00
|
|
|
<div class="flex items-center">
|
|
|
|
|
<p class="text-18px font-400 lh-26px color-#211F24 title">数据总览</p>
|
2025-07-02 17:55:20 +08:00
|
|
|
<a-tooltip content="数据纵览">
|
|
|
|
|
<img :src="icon1" width="14" height="14" class="ml-4px" />
|
|
|
|
|
</a-tooltip>
|
2025-06-27 18:37:42 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="overview-row flex">
|
|
|
|
|
<div v-for="item in CARD_FIELDS" :key="item.prop" class="overview-item flex-1">
|
|
|
|
|
<div class="flex items-center mb-8px">
|
2025-07-04 16:05:45 +08:00
|
|
|
<img :src="item.icon" width="20" height="20" class="mr-8px" />
|
|
|
|
|
<p class="label color-#211F24">{{ item.label }}</p>
|
2025-06-27 18:37:42 +08:00
|
|
|
<a-tooltip v-if="item.tooltip" :content="item.tooltip" position="bottom">
|
|
|
|
|
<img :src="icon1" width="14" height="14" class="cursor-pointer ml-4px" />
|
|
|
|
|
</a-tooltip>
|
|
|
|
|
</div>
|
2025-07-04 16:05:45 +08:00
|
|
|
<span class="value color-#211F24 ml-32px">{{ formatNumberShow(overviewData[item.prop]) }}</span>
|
2025-06-27 18:37:42 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-06-28 15:28:54 +08:00
|
|
|
<div class="filter-wrap bg-#fff rounded-8px border-1px border-#D7D7D9 border-solid px-24px py-24px mb-16px">
|
2025-06-27 18:37:42 +08:00
|
|
|
<FilterBlock v-model:query="query" @onSearch="handleSearch" @onReset="handleReset" />
|
|
|
|
|
</div>
|
2025-06-28 15:28:54 +08:00
|
|
|
<div
|
|
|
|
|
class="table-wrap bg-#fff rounded-8px border-1px border-#D7D7D9 border-solid px-24px py-24px flex-1 flex flex-col"
|
|
|
|
|
>
|
2025-06-27 18:37:42 +08:00
|
|
|
<AccountTable
|
2025-06-28 15:28:54 +08:00
|
|
|
ref="accountTableRef"
|
2025-06-27 18:37:42 +08:00
|
|
|
:dataSource="dataSource"
|
|
|
|
|
@selectionChange="handleSelectionChange"
|
2025-06-28 11:31:49 +08:00
|
|
|
@export="handleExport"
|
|
|
|
|
@sorterChange="handleSorterChange"
|
2025-06-27 18:37:42 +08:00
|
|
|
/>
|
2025-07-02 17:55:20 +08:00
|
|
|
<div v-if="pageInfo.total > 0" class="pagination-box">
|
2025-06-27 18:37:42 +08:00
|
|
|
<a-pagination
|
|
|
|
|
:total="pageInfo.total"
|
|
|
|
|
size="mini"
|
|
|
|
|
show-total
|
|
|
|
|
show-jumper
|
|
|
|
|
show-page-size
|
|
|
|
|
:current="pageInfo.page"
|
|
|
|
|
:page-size="pageInfo.pageSize"
|
|
|
|
|
@change="onPageChange"
|
|
|
|
|
@page-size-change="onPageSizeChange"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2025-06-25 18:26:03 +08:00
|
|
|
|
2025-06-27 18:37:42 +08:00
|
|
|
<script setup>
|
|
|
|
|
import FilterBlock from './components/filter-block';
|
|
|
|
|
import AccountTable from './components/account-table';
|
|
|
|
|
|
2025-06-28 11:31:49 +08:00
|
|
|
import { getAccountBoardOverview, getAccountBoardList, postAccountBoardExport } from '@/api/all/propertyMarketing';
|
2025-06-27 18:37:42 +08:00
|
|
|
import { formatNumberShow } from '@/utils/tools';
|
2025-07-02 15:30:13 +08:00
|
|
|
import { INITIAL_QUERY, CARD_FIELDS } from './constants';
|
2025-07-04 16:05:45 +08:00
|
|
|
import { downloadByUrl } from '@/utils/tools';
|
2025-06-27 18:37:42 +08:00
|
|
|
|
|
|
|
|
import icon1 from '@/assets/img/icon-question.png';
|
|
|
|
|
|
|
|
|
|
const query = ref(cloneDeep(INITIAL_QUERY));
|
|
|
|
|
const dataSource = ref([]);
|
|
|
|
|
const overviewData = ref({});
|
2025-06-28 11:31:49 +08:00
|
|
|
const selectedRowKeys = ref([]);
|
2025-06-28 15:28:54 +08:00
|
|
|
const accountTableRef = ref(null);
|
2025-07-02 17:55:20 +08:00
|
|
|
const pageInfo = ref({
|
2025-06-27 18:37:42 +08:00
|
|
|
page: 1,
|
|
|
|
|
pageSize: 20,
|
2025-07-02 17:55:20 +08:00
|
|
|
total: 0,
|
2025-06-27 18:37:42 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const getOverviewData = async () => {
|
2025-07-02 17:55:20 +08:00
|
|
|
const { code, data } = await getAccountBoardOverview();
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
overviewData.value = data;
|
|
|
|
|
}
|
2025-06-27 18:37:42 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getData = async () => {
|
2025-07-02 17:55:20 +08:00
|
|
|
const { code, data } = await getAccountBoardList(query.value);
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
dataSource.value = data?.data ?? [];
|
|
|
|
|
pageInfo.value.total = data.total;
|
|
|
|
|
}
|
2025-06-27 18:37:42 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onPageChange = (current) => {
|
2025-07-02 17:55:20 +08:00
|
|
|
pageInfo.value.page = current;
|
2025-06-27 18:37:42 +08:00
|
|
|
getData();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onPageSizeChange = (pageSize) => {
|
2025-07-02 17:55:20 +08:00
|
|
|
pageInfo.value.pageSize = pageSize;
|
2025-06-27 18:37:42 +08:00
|
|
|
reload();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleSearch = () => {
|
|
|
|
|
getData();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const reload = () => {
|
2025-07-02 17:55:20 +08:00
|
|
|
pageInfo.value.page = 1;
|
2025-06-27 18:37:42 +08:00
|
|
|
getData();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleReset = () => {
|
2025-06-28 15:28:54 +08:00
|
|
|
selectedRowKeys.value = [];
|
2025-07-02 17:55:20 +08:00
|
|
|
pageInfo.value.page = 1;
|
|
|
|
|
pageInfo.value.pageSize = 20;
|
|
|
|
|
pageInfo.value.total = 0;
|
2025-06-27 18:37:42 +08:00
|
|
|
query.value = cloneDeep(INITIAL_QUERY);
|
2025-06-28 15:28:54 +08:00
|
|
|
accountTableRef.value?.resetTable();
|
2025-06-27 18:37:42 +08:00
|
|
|
reload();
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-28 11:31:49 +08:00
|
|
|
const handleSelectionChange = (selectedRows) => {
|
|
|
|
|
selectedRowKeys.value = selectedRows;
|
2025-06-27 18:37:42 +08:00
|
|
|
};
|
|
|
|
|
|
2025-06-28 11:31:49 +08:00
|
|
|
const handleExport = () => {
|
|
|
|
|
postAccountBoardExport({
|
|
|
|
|
...query.value,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
const { code, data } = res;
|
|
|
|
|
if (code === 200) {
|
2025-07-04 16:05:45 +08:00
|
|
|
downloadByUrl(data.download_url);
|
2025-06-28 11:31:49 +08:00
|
|
|
}
|
|
|
|
|
});
|
2025-06-27 18:37:42 +08:00
|
|
|
};
|
|
|
|
|
|
2025-06-28 11:31:49 +08:00
|
|
|
const handleSorterChange = (column, order) => {
|
|
|
|
|
query.value.column = column;
|
|
|
|
|
query.value.order = order;
|
|
|
|
|
reload();
|
2025-06-27 18:37:42 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getOverviewData();
|
|
|
|
|
getData();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2025-06-25 18:26:03 +08:00
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
@import './style.scss';
|
|
|
|
|
</style>
|