2025-06-28 15:28:54 +08:00
|
|
|
<!--
|
|
|
|
|
* @Author: RenXiaoDong
|
|
|
|
|
* @Date: 2025-06-28 14:13:42
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<div class="account-data-wrap">
|
2025-09-04 16:10:44 +08:00
|
|
|
<div class="filter-wrap bg-#fff rounded-8px mb-16px">
|
|
|
|
|
<Tabs v-model:activeKey="activeTab" @change="handleTabClick" size="large">
|
|
|
|
|
<TabPane key="1" tab="账户"></TabPane>
|
2025-09-04 18:05:16 +08:00
|
|
|
<TabPane key="2" tab="计划"> </TabPane>
|
|
|
|
|
<template v-if="!isAccountTab" #rightExtra>
|
|
|
|
|
<Button type="primary" ghost class="mr-12px flex items-center" @click="handleOpenGroupModal">
|
|
|
|
|
<template #icon>
|
|
|
|
|
<img :src="icon2" width="16" height="16" class="mr-8px" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #default>分组管理</template>
|
|
|
|
|
</Button>
|
|
|
|
|
</template>
|
2025-09-04 16:10:44 +08:00
|
|
|
</Tabs>
|
2025-07-04 14:05:01 +08:00
|
|
|
<FilterBlock
|
|
|
|
|
ref="filterBlockRef"
|
|
|
|
|
v-model:query="query"
|
|
|
|
|
:isAccountTab="isAccountTab"
|
|
|
|
|
@onSearch="getData"
|
2025-07-07 10:01:59 +08:00
|
|
|
@onReset="init"
|
2025-07-04 14:05:01 +08:00
|
|
|
/>
|
2025-06-28 15:28:54 +08:00
|
|
|
</div>
|
2025-08-16 17:01:06 +08:00
|
|
|
<div class="table-wrap bg-#fff rounded-8px px-24px py-24px flex flex-col">
|
2025-07-04 14:05:01 +08:00
|
|
|
<component
|
|
|
|
|
:is="isAccountTab ? BoardTable : PlanTable"
|
2025-06-28 15:28:54 +08:00
|
|
|
ref="accountTableRef"
|
|
|
|
|
:dataSource="dataSource"
|
|
|
|
|
@export="handleExport"
|
|
|
|
|
@sorterChange="handleSorterChange"
|
|
|
|
|
@selectionChange="handleSelectionChange"
|
|
|
|
|
/>
|
2025-08-16 17:01:06 +08:00
|
|
|
<div v-if="pageInfo.total > 0" class="pagination-row">
|
2025-09-04 23:30:41 +08:00
|
|
|
<Pagination
|
2025-06-28 15:28:54 +08:00
|
|
|
:total="pageInfo.total"
|
2025-09-04 23:30:41 +08:00
|
|
|
size="small"
|
|
|
|
|
:showTotal="(total, range) => `共 ${total} 条`"
|
|
|
|
|
showSizeChanger
|
|
|
|
|
showQuickJumper
|
2025-06-28 15:28:54 +08:00
|
|
|
:current="pageInfo.page"
|
2025-09-04 23:30:41 +08:00
|
|
|
:pageSize="pageInfo.page_size"
|
2025-06-28 15:28:54 +08:00
|
|
|
@change="onPageChange"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-07-02 16:11:51 +08:00
|
|
|
|
2025-07-03 16:56:10 +08:00
|
|
|
<GroupManageModal ref="groupManageModalRef" @update="filterBlockRef?.getGroups" />
|
2025-06-28 15:28:54 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2025-09-04 23:30:41 +08:00
|
|
|
import { Button, Tabs, Pagination } from 'ant-design-vue';
|
2025-09-04 16:10:44 +08:00
|
|
|
const { TabPane } = Tabs;
|
2025-06-28 15:28:54 +08:00
|
|
|
import FilterBlock from './components/filter-block';
|
2025-07-02 17:55:20 +08:00
|
|
|
import BoardTable from './components/board-table';
|
2025-07-04 14:05:01 +08:00
|
|
|
import PlanTable from './components/plan-table';
|
2025-07-02 16:11:51 +08:00
|
|
|
import GroupManageModal from './components/group-manage-modal';
|
2025-07-02 17:55:20 +08:00
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
getPlacementAccountData,
|
|
|
|
|
postPlacementAccountDataExport,
|
|
|
|
|
getPlacementAccountDataList,
|
|
|
|
|
postPlacementAccountDataListExport,
|
|
|
|
|
} from '@/api/all/propertyMarketing';
|
|
|
|
|
|
2025-07-18 18:00:29 +08:00
|
|
|
import { showExportNotification } from '@/utils/arcoD';
|
2025-07-05 15:55:56 +08:00
|
|
|
import { INITIAL_QUERY, INITIAL_PAGE_INFO } from './constants';
|
2025-07-18 18:00:29 +08:00
|
|
|
// import { downloadByUrl } from '@/utils/tools';
|
2025-06-28 15:28:54 +08:00
|
|
|
|
2025-07-02 16:11:51 +08:00
|
|
|
import icon2 from '@/assets/img/media-account/icon-group.png';
|
|
|
|
|
|
2025-07-02 17:55:20 +08:00
|
|
|
const selectedRowKeys = ref([]);
|
|
|
|
|
const activeTab = ref('1');
|
|
|
|
|
const accountTableRef = ref(null);
|
|
|
|
|
const groupManageModalRef = ref(null);
|
|
|
|
|
const filterBlockRef = ref(null);
|
2025-07-05 15:55:56 +08:00
|
|
|
const query = ref(cloneDeep(INITIAL_QUERY));
|
2025-06-28 15:28:54 +08:00
|
|
|
const dataSource = ref([]);
|
2025-07-05 15:55:56 +08:00
|
|
|
const pageInfo = ref(cloneDeep(INITIAL_PAGE_INFO));
|
2025-06-28 15:28:54 +08:00
|
|
|
|
2025-07-02 17:55:20 +08:00
|
|
|
const isAccountTab = computed(() => activeTab.value === '1');
|
2025-06-28 15:28:54 +08:00
|
|
|
|
2025-07-07 10:01:59 +08:00
|
|
|
const init = () => {
|
|
|
|
|
query.value = cloneDeep(INITIAL_QUERY);
|
|
|
|
|
dataSource.value = [];
|
|
|
|
|
pageInfo.value = cloneDeep(INITIAL_PAGE_INFO);
|
|
|
|
|
selectedRowKeys.value = [];
|
|
|
|
|
accountTableRef.value?.resetTable();
|
|
|
|
|
|
2025-07-18 14:10:27 +08:00
|
|
|
const yesterday = dayjs().subtract(1, 'day').format('YYYY-MM-DD');
|
2025-07-18 14:24:49 +08:00
|
|
|
const data_time = [yesterday, yesterday];
|
2025-07-07 10:01:59 +08:00
|
|
|
query.value.data_time = data_time;
|
|
|
|
|
|
|
|
|
|
getData();
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-02 17:55:20 +08:00
|
|
|
const getData = async () => {
|
|
|
|
|
const _fn = isAccountTab.value ? getPlacementAccountData : getPlacementAccountDataList;
|
2025-07-05 15:55:56 +08:00
|
|
|
const { page, page_size } = pageInfo.value;
|
|
|
|
|
const { code, data } = await _fn({
|
|
|
|
|
...query.value,
|
|
|
|
|
page,
|
|
|
|
|
page_size,
|
|
|
|
|
});
|
2025-07-02 17:55:20 +08:00
|
|
|
if (code === 200) {
|
|
|
|
|
dataSource.value = data?.data ?? [];
|
|
|
|
|
pageInfo.value.total = data.total;
|
|
|
|
|
}
|
2025-06-28 15:28:54 +08:00
|
|
|
};
|
|
|
|
|
|
2025-09-04 23:30:41 +08:00
|
|
|
const onPageChange = (current, pageSize) => {
|
2025-07-02 17:55:20 +08:00
|
|
|
pageInfo.value.page = current;
|
2025-09-04 23:30:41 +08:00
|
|
|
pageInfo.value.page_size = pageSize;
|
2025-06-28 15:28:54 +08:00
|
|
|
getData();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onPageSizeChange = (pageSize) => {
|
2025-07-05 15:55:56 +08:00
|
|
|
pageInfo.value.page_size = pageSize;
|
2025-06-28 15:28:54 +08:00
|
|
|
reload();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const reload = () => {
|
2025-07-02 17:55:20 +08:00
|
|
|
pageInfo.value.page = 1;
|
2025-06-28 15:28:54 +08:00
|
|
|
getData();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleSorterChange = (column, order) => {
|
|
|
|
|
query.value.column = column;
|
|
|
|
|
query.value.order = order;
|
|
|
|
|
reload();
|
|
|
|
|
};
|
|
|
|
|
const handleSelectionChange = (selectedRows) => {
|
|
|
|
|
selectedRowKeys.value = selectedRows;
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-02 17:55:20 +08:00
|
|
|
const handleTabClick = (key) => {
|
2025-07-18 14:24:49 +08:00
|
|
|
dataSource.value = [];
|
|
|
|
|
selectedRowKeys.value = [];
|
|
|
|
|
pageInfo.value = cloneDeep(INITIAL_PAGE_INFO);
|
2025-07-02 17:55:20 +08:00
|
|
|
activeTab.value = key;
|
2025-07-11 16:04:51 +08:00
|
|
|
getData();
|
2025-06-28 15:28:54 +08:00
|
|
|
};
|
|
|
|
|
|
2025-07-02 17:55:20 +08:00
|
|
|
const handleExport = () => {
|
|
|
|
|
const _fn = isAccountTab.value ? postPlacementAccountDataExport : postPlacementAccountDataListExport;
|
|
|
|
|
_fn({
|
|
|
|
|
...query.value,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
const { code, data } = res;
|
|
|
|
|
if (code === 200) {
|
2025-07-18 18:00:29 +08:00
|
|
|
showExportNotification(`正在下载“${data.name}”,请稍后...`);
|
2025-07-02 17:55:20 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-02 16:11:51 +08:00
|
|
|
const handleOpenGroupModal = () => {
|
|
|
|
|
groupManageModalRef.value?.open();
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-28 15:28:54 +08:00
|
|
|
onMounted(() => {
|
2025-07-07 10:01:59 +08:00
|
|
|
init();
|
2025-06-28 15:28:54 +08:00
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
@import './style.scss';
|
|
|
|
|
</style>
|