feat: 增加项目管理接口
This commit is contained in:
@ -36,7 +36,7 @@
|
||||
@change="handleSearch"
|
||||
>
|
||||
<a-option v-for="(item, index) in uploaders" :key="index" :value="item.id" :label="item.name">
|
||||
{{ item.name }}
|
||||
{{ item.name || '-' }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</div>
|
||||
@ -115,6 +115,8 @@
|
||||
import { formatTableField, exactFormatTime } from '@/utils/tools';
|
||||
|
||||
import { getPlacementAccountOperators, getWorksList } from '@/api/all/propertyMarketing';
|
||||
import { getUserList } from '@/api/all/common';
|
||||
|
||||
import { useTableSelectionWithPagination } from '@/hooks/useTableSelectionWithPagination';
|
||||
|
||||
const TABLE_COLUMNS = [
|
||||
@ -178,21 +180,19 @@ const handleSearch = () => {
|
||||
});
|
||||
};
|
||||
|
||||
// const getOperators = async () => {
|
||||
// const { code, data } = await getPlacementAccountOperators();
|
||||
// if (code === 200) {
|
||||
// uploaders.value = data;
|
||||
// }
|
||||
// };
|
||||
const getUsers = async () => {
|
||||
const { code, data } = await getUserList();
|
||||
if (code === 200) {
|
||||
uploaders.value = data;
|
||||
|
||||
console.log(uploaders.value);
|
||||
}
|
||||
};
|
||||
const getTableData = async () => {
|
||||
const { code, data } = await getWorksList();
|
||||
if (code === 200) {
|
||||
allData.value = data ?? [];
|
||||
dataSource.value = data ?? [];
|
||||
uploaders.value = data.map( v => ({
|
||||
id: v.uploader?.id,
|
||||
name: v.uploader?.name,
|
||||
}))
|
||||
initSelect();
|
||||
}
|
||||
};
|
||||
@ -217,7 +217,7 @@ const onDelete = (item) => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
// getOperators();
|
||||
getUsers();
|
||||
getTableData();
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<span class="label">项目名称</span>
|
||||
<a-space size="medium">
|
||||
<a-input
|
||||
v-model="query.search"
|
||||
v-model="query.name"
|
||||
class="w-240px"
|
||||
placeholder="请搜索..."
|
||||
size="medium"
|
||||
|
||||
@ -11,23 +11,23 @@ export const TABLE_COLUMNS = [
|
||||
},
|
||||
{
|
||||
title: '项目预算',
|
||||
dataIndex: 'key1',
|
||||
dataIndex: 'budget',
|
||||
width: 180,
|
||||
prefix: "¥"
|
||||
},
|
||||
{
|
||||
title: '关联平台账号',
|
||||
dataIndex: 'key2',
|
||||
dataIndex: 'media_account_count',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '关联渠道账户',
|
||||
dataIndex: 'key3',
|
||||
dataIndex: 'placement_account_count',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '关联内容稿件',
|
||||
dataIndex: 'key4',
|
||||
dataIndex: 'work_count',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
@sorter-change="handleSorterChange"
|
||||
>
|
||||
<template #empty>
|
||||
<NoData />
|
||||
<NoData text="暂无项目"/>
|
||||
</template>
|
||||
<template #columns>
|
||||
<a-table-column
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
export const INITIAL_QUERY = {
|
||||
search: '',
|
||||
column: '',
|
||||
order: '',
|
||||
name: '',
|
||||
sort_column: undefined,
|
||||
sort_order: undefined,
|
||||
};
|
||||
|
||||
@ -45,6 +45,7 @@
|
||||
<script setup>
|
||||
import { INITIAL_QUERY } from './constants';
|
||||
import { useTableSelectionWithPagination } from '@/hooks/useTableSelectionWithPagination';
|
||||
import { getProjects } from '@/api/all/propertyMarketing';
|
||||
|
||||
import FilterBlock from './components/filter-block';
|
||||
import ProjectTable from './components/project-table';
|
||||
@ -66,37 +67,16 @@ const addProjectModalRef = ref(null);
|
||||
const query = ref(cloneDeep(INITIAL_QUERY));
|
||||
|
||||
const getData = async () => {
|
||||
dataSource.value = [
|
||||
{
|
||||
id: 1,
|
||||
name: '闲鱼用户增长投放规划',
|
||||
key1: 500131,
|
||||
key2: 4141,
|
||||
key3: 55,
|
||||
key4: 12,
|
||||
create_at: 1753069077,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '闲鱼用户增长投放规划',
|
||||
key1: 500131,
|
||||
key2: 4141,
|
||||
key3: 55,
|
||||
key4: 12,
|
||||
create_at: 1753069077,
|
||||
},
|
||||
];
|
||||
pageInfo.value.total = 2;
|
||||
// const { page, page_size } = pageInfo.value;
|
||||
// const { code, data } = await postSubAccount({
|
||||
// ...query.value,
|
||||
// page,
|
||||
// page_size,
|
||||
// });
|
||||
// if (code === 200) {
|
||||
// dataSource.value = data?.data ?? [];
|
||||
// pageInfo.value.total = data.total;
|
||||
// }
|
||||
const { page, page_size } = pageInfo.value;
|
||||
const { code, data } = await getProjects({
|
||||
...query.value,
|
||||
page,
|
||||
page_size,
|
||||
});
|
||||
if (code === 200) {
|
||||
dataSource.value = data?.data ?? [];
|
||||
pageInfo.value.total = data.total;
|
||||
}
|
||||
};
|
||||
const handleSearch = () => {
|
||||
reload();
|
||||
@ -117,8 +97,8 @@ const handleOpenAddProjectModal = () => {
|
||||
addProjectModalRef.value?.open();
|
||||
};
|
||||
const handleSorterChange = (column, order) => {
|
||||
query.value.column = column;
|
||||
query.value.order = order;
|
||||
query.value.sort_column = column;
|
||||
query.value.sort_order = order;
|
||||
reload();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user