2025-06-28 15:28:54 +08:00
|
|
|
<!--
|
|
|
|
|
* @Author: RenXiaoDong
|
|
|
|
|
* @Date: 2025-06-28 14:13:42
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<div class="account-data-wrap">
|
|
|
|
|
<div class="filter-wrap bg-#fff rounded-8px border-1px border-#D7D7D9 border-solid pb-24px mb-16px">
|
|
|
|
|
<a-tabs v-model="activeTab" @tab-click="handleTabClick">
|
2025-07-02 17:55:20 +08:00
|
|
|
<a-tab-pane key="1" title="账户"></a-tab-pane>
|
2025-07-03 16:56:10 +08:00
|
|
|
<a-tab-pane key="2" title="计划"></a-tab-pane>
|
2025-07-02 16:11:51 +08:00
|
|
|
<template v-if="!isAccountTab" #extra>
|
|
|
|
|
<a-button class="w-112px mr-12px search-btn flex items-center" size="medium" @click="handleOpenGroupModal">
|
|
|
|
|
<template #icon>
|
|
|
|
|
<img :src="icon2" width="16" height="16" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #default>分组管理</template>
|
|
|
|
|
</a-button>
|
|
|
|
|
</template>
|
2025-06-28 15:28:54 +08:00
|
|
|
</a-tabs>
|
2025-07-04 14:05:01 +08:00
|
|
|
<FilterBlock
|
|
|
|
|
ref="filterBlockRef"
|
|
|
|
|
v-model:query="query"
|
|
|
|
|
:isAccountTab="isAccountTab"
|
|
|
|
|
@onSearch="getData"
|
|
|
|
|
@onReset="handleReset"
|
|
|
|
|
/>
|
2025-06-28 15:28:54 +08:00
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
class="table-wrap bg-#fff rounded-8px border-1px border-#D7D7D9 border-solid px-24px py-24px flex-1 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-07-02 17:55:20 +08:00
|
|
|
<div v-if="pageInfo.total > 0" class="pagination-box">
|
2025-06-28 15:28:54 +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>
|
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>
|
|
|
|
|
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-06-28 15:28:54 +08:00
|
|
|
import { INITIAL_QUERY } from './constants';
|
2025-07-04 16:05:45 +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-06-28 15:28:54 +08:00
|
|
|
const query = ref({});
|
|
|
|
|
const dataSource = ref([]);
|
2025-07-02 17:55:20 +08:00
|
|
|
const pageInfo = ref({
|
2025-06-28 15:28:54 +08:00
|
|
|
page: 1,
|
|
|
|
|
pageSize: 20,
|
2025-07-04 14:05:01 +08:00
|
|
|
total: 0,
|
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-02 17:55:20 +08:00
|
|
|
const getData = async () => {
|
|
|
|
|
const _fn = isAccountTab.value ? getPlacementAccountData : getPlacementAccountDataList;
|
|
|
|
|
const { code, data } = await _fn(query.value);
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
dataSource.value = data?.data ?? [];
|
|
|
|
|
pageInfo.value.total = data.total;
|
|
|
|
|
}
|
2025-06-28 15:28:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onPageChange = (current) => {
|
2025-07-02 17:55:20 +08:00
|
|
|
pageInfo.value.page = current;
|
2025-06-28 15:28:54 +08:00
|
|
|
getData();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onPageSizeChange = (pageSize) => {
|
2025-07-02 17:55:20 +08:00
|
|
|
pageInfo.value.pageSize = 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 handleReset = () => {
|
2025-07-02 17:55:20 +08:00
|
|
|
pageInfo.value.page = 1;
|
|
|
|
|
pageInfo.value.pageSize = 20;
|
|
|
|
|
pageInfo.value.total = 0;
|
2025-06-28 15:28:54 +08:00
|
|
|
selectedRowKeys.value = [];
|
|
|
|
|
accountTableRef.value?.resetTable();
|
|
|
|
|
query.value = cloneDeep(INITIAL_QUERY);
|
|
|
|
|
reload();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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) => {
|
|
|
|
|
activeTab.value = key;
|
2025-07-04 16:05:45 +08:00
|
|
|
dataSource.value = [];
|
2025-06-28 15:28:54 +08:00
|
|
|
handleReset();
|
|
|
|
|
};
|
|
|
|
|
|
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-04 16:05:45 +08:00
|
|
|
downloadByUrl(data.download_url);
|
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(() => {
|
|
|
|
|
getData();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
@import './style.scss';
|
|
|
|
|
</style>
|