feat: 巨量/b站平台添加子账户
This commit is contained in:
@ -294,7 +294,7 @@ export const getPlacementAccountProjectsTrend = (params = {}) => {
|
|||||||
export const getPlacementGuide = (params: {}) => {
|
export const getPlacementGuide = (params: {}) => {
|
||||||
return Http.get(`/v1/placement-account-projects/getGuideList`, params);
|
return Http.get(`/v1/placement-account-projects/getGuideList`, params);
|
||||||
};
|
};
|
||||||
//查询投放指南历史
|
// 查询投放指南历史
|
||||||
export const getPlacementGuideHistory = (params: {}) => {
|
export const getPlacementGuideHistory = (params: {}) => {
|
||||||
return Http.get(`/v1/placement-account-projects/getGuideListHistory`, params);
|
return Http.get(`/v1/placement-account-projects/getGuideListHistory`, params);
|
||||||
};
|
};
|
||||||
@ -312,7 +312,7 @@ export const getPlacementGuideDetail = (id: string) => {
|
|||||||
return Http.get(`/v1/placement-account-projects/historylog/${id}`);
|
return Http.get(`/v1/placement-account-projects/historylog/${id}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
//删除记录
|
// 删除记录
|
||||||
export const deleteHistorylog = (id: string) => {
|
export const deleteHistorylog = (id: string) => {
|
||||||
return Http.delete(`/v1/placement-account-projects/historylog/${id}`);
|
return Http.delete(`/v1/placement-account-projects/historylog/${id}`);
|
||||||
};
|
};
|
||||||
@ -332,4 +332,12 @@ export const postPlacementAccountsSync = (id: string) => {
|
|||||||
return Http.post(`/v1/placement-accounts/${id}/sync-data`);
|
return Http.post(`/v1/placement-accounts/${id}/sync-data`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 投放账号-子账号分页
|
||||||
|
export const postSubAccount = (params = {}) => {
|
||||||
|
return Http.post('/v1/placement-accounts/get-subaccount', params);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 投放账号-添加子账号
|
||||||
|
export const postAddSubAccount = (params = {}) => {
|
||||||
|
return Http.post('/v1/placement-accounts/subaccount', params);
|
||||||
|
};
|
||||||
|
|||||||
@ -121,7 +121,7 @@ const openDelete = (item) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleReauthorize = (item) => {
|
const handleReauthorize = (item) => {
|
||||||
authorizedAccountModalRef.value?.open(item.id, item.last_synced_at);
|
authorizedAccountModalRef.value?.open({ accountId: item.id, last_synced_at: item.last_synced_at });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePause = (item) => {
|
const handlePause = (item) => {
|
||||||
|
|||||||
@ -148,7 +148,7 @@ import { ref, defineEmits } from 'vue';
|
|||||||
import AuthorizedAccountModal from '../authorized-account-modal';
|
import AuthorizedAccountModal from '../authorized-account-modal';
|
||||||
// import ImportPromptModal from '../import-prompt-modal';
|
// import ImportPromptModal from '../import-prompt-modal';
|
||||||
import StatusBox from '../status-box';
|
import StatusBox from '../status-box';
|
||||||
import { PLATFORM_LIST } from '@/views/property-marketing/put-account/common_constants';
|
import { PLATFORM_LIST, ENUM_PLATFORM } from '@/views/property-marketing/put-account/common_constants';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
postPlacementAccounts,
|
postPlacementAccounts,
|
||||||
@ -290,6 +290,27 @@ const handleBatchImport = async () => {
|
|||||||
// importPromptModalRef.value.open();
|
// importPromptModalRef.value.open();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleAdd = async () => {
|
||||||
|
// 聚光无子账号
|
||||||
|
if (form.value.platform === ENUM_PLATFORM.jg) {
|
||||||
|
const { code, data } = await postPlacementAccounts(form.value);
|
||||||
|
if (code === 200) {
|
||||||
|
update();
|
||||||
|
authorizedAccountModalRef.value.open({ accountId: data?.id });
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
authorizedAccountModalRef.value.open({ form: form.value });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const handleEdit = async () => {
|
||||||
|
const { code } = await putPlacementAccounts({ id: id.value, ...form.value });
|
||||||
|
if (code === 200) {
|
||||||
|
isEdit.value && AMessage.success('修改成功');
|
||||||
|
update();
|
||||||
|
onClose();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
if (isBatchImport.value) {
|
if (isBatchImport.value) {
|
||||||
handleBatchImport();
|
handleBatchImport();
|
||||||
@ -298,27 +319,11 @@ async function onSubmit() {
|
|||||||
|
|
||||||
formRef.value.validate(async (errors) => {
|
formRef.value.validate(async (errors) => {
|
||||||
if (!errors) {
|
if (!errors) {
|
||||||
const _fn = id.value ? putPlacementAccounts : postPlacementAccounts;
|
isEdit.value ? handleEdit() : handleAdd();
|
||||||
const _params = id.value ? { id: id.value, ...form.value } : form.value;
|
|
||||||
const { code, data } = await _fn(_params);
|
|
||||||
if (code === 200) {
|
|
||||||
isEdit.value && AMessage.success('修改成功');
|
|
||||||
update();
|
|
||||||
|
|
||||||
if (isEdit.value) {
|
|
||||||
onClose();
|
|
||||||
} else {
|
|
||||||
handleSuccess(data?.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSuccess = (id) => {
|
|
||||||
authorizedAccountModalRef.value.open(id);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDownloadTemplate = async () => {
|
const handleDownloadTemplate = async () => {
|
||||||
const { code, data } = await getPlacementAccountsTemplateUrl();
|
const { code, data } = await getPlacementAccountsTemplateUrl();
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
@ -326,6 +331,7 @@ const handleDownloadTemplate = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
provide('closeAddAccountModal', onClose);
|
||||||
// 对外暴露打开弹窗方法
|
// 对外暴露打开弹窗方法
|
||||||
defineExpose({ open });
|
defineExpose({ open });
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -60,13 +60,14 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
|
|
||||||
<SelectSubAccountModal ref="selectSubAccountModalRef" @confirm="onSelectSubAccounts" />
|
<SelectSubAccountModal ref="selectSubAccountModalRef" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { defineExpose, ref, computed, defineEmits } from 'vue';
|
import { defineExpose, ref, computed, defineEmits } from 'vue';
|
||||||
import { exactFormatTime } from '@/utils/tools';
|
import { exactFormatTime } from '@/utils/tools';
|
||||||
|
import { ENUM_PLATFORM } from '@/views/property-marketing/put-account/common_constants';
|
||||||
import {
|
import {
|
||||||
putPlacementAccountsAuthorized,
|
putPlacementAccountsAuthorized,
|
||||||
getPlacementAccountsAuthorizedStatus,
|
getPlacementAccountsAuthorizedStatus,
|
||||||
@ -94,6 +95,7 @@ const selectSubAccountModalRef = ref(null);
|
|||||||
const lastSyncedAt = ref(null); // 上次同步时间戳
|
const lastSyncedAt = ref(null); // 上次同步时间戳
|
||||||
const showSyncTip = ref(false);
|
const showSyncTip = ref(false);
|
||||||
const syncType = ref(INITIAL_SYNC_TYPE); // sync | no_sync
|
const syncType = ref(INITIAL_SYNC_TYPE); // sync | no_sync
|
||||||
|
const addAccountFormData = ref(null); // 添加账户表单数据
|
||||||
|
|
||||||
const INITIAL_FORM = {
|
const INITIAL_FORM = {
|
||||||
account: '',
|
account: '',
|
||||||
@ -130,11 +132,12 @@ const getDaysDiffText = (lastSyncedAt) => {
|
|||||||
return `${daysDiff}天`;
|
return `${daysDiff}天`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const open = (accountId, last_synced_at = null) => {
|
const open = ({ accountId, last_synced_at = null, form = null }) => {
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
id.value = accountId;
|
id.value = accountId;
|
||||||
lastSyncedAt.value = last_synced_at;
|
lastSyncedAt.value = last_synced_at;
|
||||||
|
addAccountFormData.value = form;
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -152,6 +155,7 @@ const reset = () => {
|
|||||||
lastSyncedAt.value = null;
|
lastSyncedAt.value = null;
|
||||||
syncType.value = INITIAL_SYNC_TYPE;
|
syncType.value = INITIAL_SYNC_TYPE;
|
||||||
showSyncTip.value = false;
|
showSyncTip.value = false;
|
||||||
|
addAccountFormData.value = null;
|
||||||
clearFakeProgressTimer();
|
clearFakeProgressTimer();
|
||||||
clearStatusPollingTimer();
|
clearStatusPollingTimer();
|
||||||
};
|
};
|
||||||
@ -251,27 +255,14 @@ const handleSyncData = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSelectSubAccounts = (selectedItems) => {
|
|
||||||
console.log({ selectedItems });
|
|
||||||
|
|
||||||
visible.value = true;
|
|
||||||
isLoading.value = true;
|
|
||||||
isCompleted.value = false;
|
|
||||||
progress.value = 0;
|
|
||||||
startFakeProgressPolling();
|
|
||||||
startStatusPolling();
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
// visible.value = false;
|
|
||||||
// selectSubAccountModalRef.value.open();
|
|
||||||
// return;
|
|
||||||
// n天未同步更新
|
// n天未同步更新
|
||||||
if (lastSyncedAt.value && lastSyncedAt.value < dayjs().startOf('day').valueOf()) {
|
if (lastSyncedAt.value && lastSyncedAt.value < dayjs().startOf('day').valueOf()) {
|
||||||
handleSyncData();
|
handleSyncData();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 已完成
|
||||||
if (isCompleted.value) {
|
if (isCompleted.value) {
|
||||||
if (isSuccess.value) {
|
if (isSuccess.value) {
|
||||||
update();
|
update();
|
||||||
@ -279,15 +270,25 @@ const handleOk = () => {
|
|||||||
} else {
|
} else {
|
||||||
startLoading();
|
startLoading();
|
||||||
}
|
}
|
||||||
} else {
|
return;
|
||||||
formRef.value.validate(async (errors) => {
|
|
||||||
if (!errors) {
|
|
||||||
startLoading();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 未完成,校验表单
|
||||||
|
formRef.value.validate(async (errors) => {
|
||||||
|
if (errors) return;
|
||||||
|
if (form.value.platform === ENUM_PLATFORM.jg) {
|
||||||
|
startLoading();
|
||||||
|
} else {
|
||||||
|
visible.value = false;
|
||||||
|
selectSubAccountModalRef.value.open({
|
||||||
|
...addAccountFormData.value,
|
||||||
|
...form.value,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
provide('closeAuthorizeAccountModal', close);
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,20 +1,23 @@
|
|||||||
export const INITIAL_FORM = {
|
export const INITIAL_FORM = {
|
||||||
search: '',
|
platform: '',
|
||||||
id: '',
|
account: '',
|
||||||
|
password: '',
|
||||||
|
account_name: '',
|
||||||
|
account_id: '',
|
||||||
};
|
};
|
||||||
export const INITIAL_PAGE_INFO = {
|
export const INITIAL_PAGE_INFO = {
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 20,
|
page_size: 20,
|
||||||
total: 0,
|
total: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TABLE_COLUMNS = [
|
export const TABLE_COLUMNS = [
|
||||||
{
|
{
|
||||||
title: '账户名称',
|
title: '账户名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'account_name',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '账户ID',
|
title: '账户ID',
|
||||||
dataIndex: 'id',
|
dataIndex: 'account_id',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@ -11,12 +11,12 @@
|
|||||||
<div class="filter-row-item flex items-center">
|
<div class="filter-row-item flex items-center">
|
||||||
<span class="label">账户名称</span>
|
<span class="label">账户名称</span>
|
||||||
<a-input
|
<a-input
|
||||||
v-model="query.search"
|
v-model="query.account_name"
|
||||||
class="w-240px"
|
class="w-240px"
|
||||||
placeholder="请搜索..."
|
placeholder="请搜索..."
|
||||||
size="medium"
|
size="medium"
|
||||||
allow-clear
|
allow-clear
|
||||||
@change="handleSearch"
|
@change="reload"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<icon-search />
|
<icon-search />
|
||||||
@ -26,12 +26,12 @@
|
|||||||
<div class="filter-row-item flex items-center">
|
<div class="filter-row-item flex items-center">
|
||||||
<span class="label">账户ID</span>
|
<span class="label">账户ID</span>
|
||||||
<a-input
|
<a-input
|
||||||
v-model="query.id"
|
v-model="query.account_id"
|
||||||
class="w-240px"
|
class="w-240px"
|
||||||
placeholder="请搜索..."
|
placeholder="请搜索..."
|
||||||
size="medium"
|
size="medium"
|
||||||
allow-clear
|
allow-clear
|
||||||
@change="handleSearch"
|
@change="reload"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<icon-search />
|
<icon-search />
|
||||||
@ -44,16 +44,16 @@
|
|||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:data="dataSource"
|
:data="dataSource"
|
||||||
column-resizable
|
column-resizable
|
||||||
row-key="id"
|
|
||||||
:row-selection="{
|
:row-selection="{
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
showCheckedAll: true,
|
showCheckedAll: true,
|
||||||
width: 48,
|
width: 48,
|
||||||
}"
|
}"
|
||||||
:selected-keys="selectedItems"
|
row-key="account_id"
|
||||||
|
:selected-keys="selectedRowKeys"
|
||||||
:pagination="false"
|
:pagination="false"
|
||||||
:scroll="{ x: '100%' }"
|
:scroll="{ x: '100%', y: '100%' }"
|
||||||
class="w-100% flex-1"
|
class="w-100% flex-1 overflow-hidden"
|
||||||
bordered
|
bordered
|
||||||
@select="handleSelect"
|
@select="handleSelect"
|
||||||
@select-all="handleSelectAll"
|
@select-all="handleSelectAll"
|
||||||
@ -76,7 +76,6 @@
|
|||||||
>
|
>
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<img v-if="column.dataIndex === 'ai_evaluate'" width="16" height="16" :src="icon5" class="mr-4px" />
|
|
||||||
<span class="cts mr-4px">{{ column.title }}</span>
|
<span class="cts mr-4px">{{ column.title }}</span>
|
||||||
<a-tooltip v-if="column.tooltip" :content="column.tooltip" position="top">
|
<a-tooltip v-if="column.tooltip" :content="column.tooltip" position="top">
|
||||||
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
|
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
|
||||||
@ -84,14 +83,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'platform'" #cell="{ record }">
|
<template #cell="{ record }">
|
||||||
{{ record.platform === 0 ? '抖音' : record.platform === 1 ? '小红书' : '-' }}
|
|
||||||
</template>
|
|
||||||
<template v-else-if="column.dataIndex === 'time'" #cell="{ record }">
|
|
||||||
{{ exactFormatTime(record.time) }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template v-else #cell="{ record }">
|
|
||||||
{{ formatTableField(column, record, true) }}
|
{{ formatTableField(column, record, true) }}
|
||||||
</template>
|
</template>
|
||||||
</a-table-column>
|
</a-table-column>
|
||||||
@ -112,11 +104,19 @@
|
|||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="cts color-#3C4043 s1"
|
<span class="cts color-#3C4043 s1"
|
||||||
>已选<span class="color-#6D4CFE num mx-3px">{{ selectedItems.length }}个</span>账户</span
|
>已选<span class="color-#6D4CFE num mx-3px">{{ selectedAccounts.length }}个</span>账户</span
|
||||||
>
|
>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<a-button class="cancel-btn" size="large" @click="onClose">取消</a-button>
|
<a-button class="cancel-btn" size="large" @click="onClose">取消</a-button>
|
||||||
<a-button type="primary" class="ml-16px" status="danger" size="large" @click="onConfirm">添加已选账户</a-button>
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
class="ml-16px"
|
||||||
|
status="danger"
|
||||||
|
size="large"
|
||||||
|
:disabled="!selectedAccounts.length"
|
||||||
|
@click="onConfirm"
|
||||||
|
>添加已选账户</a-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
@ -124,69 +124,106 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { INITIAL_FORM, INITIAL_PAGE_INFO, TABLE_COLUMNS } from './constants';
|
import { INITIAL_FORM, INITIAL_PAGE_INFO, TABLE_COLUMNS } from './constants';
|
||||||
import { formatTableField, formatNumberShow, exactFormatTime } from '@/utils/tools';
|
import { formatTableField } from '@/utils/tools';
|
||||||
|
import { postSubAccount, postAddSubAccount } from '@/api/all/propertyMarketing';
|
||||||
|
|
||||||
const emits = defineEmits('confirm');
|
const emits = defineEmits('confirm');
|
||||||
const update = inject('update');
|
const update = inject('update');
|
||||||
|
const closeAddAccountModal = inject('closeAddAccountModal');
|
||||||
|
const closeAuthorizeAccountModal = inject('closeAuthorizeAccountModal');
|
||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const dataSource = ref([]);
|
const dataSource = ref([]);
|
||||||
const query = ref(cloneDeep(INITIAL_FORM));
|
const query = ref(cloneDeep(INITIAL_FORM));
|
||||||
const pageInfo = ref(cloneDeep(INITIAL_PAGE_INFO));
|
const pageInfo = ref(cloneDeep(INITIAL_PAGE_INFO));
|
||||||
const selectedItems = ref([]);
|
const form = ref(null);
|
||||||
|
|
||||||
const checkedAll = computed(() => selectedItems.value.length === dataSource.value.length);
|
const selectedAccounts = ref([]);
|
||||||
const indeterminate = computed(
|
const selectedRowKeys = ref([]);
|
||||||
() => selectedItems.value.length > 0 && selectedItems.value.length < dataSource.value.length,
|
|
||||||
);
|
const open = (formData) => {
|
||||||
|
const { platform, account, password } = formData;
|
||||||
|
form.value = formData;
|
||||||
|
query.value = {
|
||||||
|
...query.value,
|
||||||
|
platform,
|
||||||
|
account,
|
||||||
|
password,
|
||||||
|
};
|
||||||
|
|
||||||
const open = () => {
|
|
||||||
getData();
|
getData();
|
||||||
|
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
};
|
};
|
||||||
const onClose = () => {
|
const onClose = () => {
|
||||||
|
form.value = null;
|
||||||
|
selectedAccounts.value = [];
|
||||||
|
selectedRowKeys.value = [];
|
||||||
query.value = cloneDeep(INITIAL_FORM);
|
query.value = cloneDeep(INITIAL_FORM);
|
||||||
pageInfo.value = cloneDeep(INITIAL_FORM);
|
pageInfo.value = cloneDeep(INITIAL_FORM);
|
||||||
|
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onConfirm = () => {
|
const onConfirm = async () => {
|
||||||
onClose();
|
const { code } = await postAddSubAccount({ ...form.value, subaccounts: selectedAccounts.value });
|
||||||
emits('confirm', selectedItems);
|
if (code === 200) {
|
||||||
|
visible.value = false;
|
||||||
|
update();
|
||||||
|
closeAuthorizeAccountModal();
|
||||||
|
closeAddAccountModal();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getData = () => {
|
const getData = async () => {
|
||||||
dataSource.value = [
|
const { page, page_size } = pageInfo.value;
|
||||||
{
|
const { code, data } = await postSubAccount({
|
||||||
id: '1832880547948105',
|
...query.value,
|
||||||
name: '美团-人设组YSCX-运管-OM运营三部-BT2阿里巴巴国际站-小题-3',
|
page,
|
||||||
},
|
page_size,
|
||||||
{
|
// platform: 0,
|
||||||
id: '1832880548441993',
|
// account: '543366265@qq.com',
|
||||||
name: 'YSCX-运管-OM运营三部-BT2阿里巴巴国际站-小题',
|
// password: 'Xiaoti2025@',
|
||||||
},
|
// // page: 1,
|
||||||
];
|
// // page_size: 10,
|
||||||
pageInfo.value.total = 2;
|
// account_id: '',
|
||||||
|
});
|
||||||
|
if (code === 200) {
|
||||||
|
dataSource.value = data?.data ?? [];
|
||||||
|
pageInfo.value.total = data.total;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const reload = () => {
|
const reload = () => {
|
||||||
pageInfo.value.page = 1;
|
pageInfo.value.page = 1;
|
||||||
getData();
|
getData();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSearch = () => {
|
const handleSelect = (selectedKeys, rowKey, record) => {
|
||||||
reload();
|
const select = selectedKeys.includes(rowKey);
|
||||||
};
|
selectedRowKeys.value = selectedKeys;
|
||||||
const handleSelect = (selectedRowKeys, selectedRows) => {
|
|
||||||
selectedItems.value = selectedRowKeys;
|
if (select) {
|
||||||
|
selectedAccounts.value.push(record);
|
||||||
|
} else {
|
||||||
|
selectedAccounts.value = selectedAccounts.value.filter((v) => v.account_id !== record.account_id);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSelectAll = (checked) => {
|
const handleSelectAll = (checked) => {
|
||||||
|
const currentPageAccounts = dataSource.value;
|
||||||
|
const currentPageKeys = currentPageAccounts.map((v) => v.account_id);
|
||||||
|
|
||||||
if (checked) {
|
if (checked) {
|
||||||
selectedItems.value = dataSource.value.map((item) => item.id);
|
selectedRowKeys.value = Array.from(new Set([...selectedRowKeys.value, ...currentPageKeys]));
|
||||||
|
|
||||||
|
const allAccounts = [...selectedAccounts.value, ...currentPageAccounts];
|
||||||
|
const map = new Map();
|
||||||
|
allAccounts.forEach((acc) => map.set(acc.account_id, acc));
|
||||||
|
selectedAccounts.value = Array.from(map.values());
|
||||||
} else {
|
} else {
|
||||||
selectedItems.value = [];
|
selectedRowKeys.value = selectedRowKeys.value.filter((key) => !currentPageKeys.includes(key));
|
||||||
|
selectedAccounts.value = selectedAccounts.value.filter((acc) => !currentPageKeys.includes(acc.account_id));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -195,7 +232,7 @@ const onPageChange = (current) => {
|
|||||||
getData();
|
getData();
|
||||||
};
|
};
|
||||||
const onPageSizeChange = (pageSize) => {
|
const onPageSizeChange = (pageSize) => {
|
||||||
pageInfo.value.pageSize = pageSize;
|
pageInfo.value.page_size = pageSize;
|
||||||
reload();
|
reload();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
}
|
}
|
||||||
.arco-modal-body {
|
.arco-modal-body {
|
||||||
height: 536px;
|
height: 536px;
|
||||||
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.filter-row {
|
.filter-row {
|
||||||
|
|||||||
@ -2,6 +2,12 @@ import icon1 from '@/assets/img/media-account/icon-jl.png';
|
|||||||
import icon2 from '@/assets/img/media-account/icon-jg.png';
|
import icon2 from '@/assets/img/media-account/icon-jg.png';
|
||||||
import icon3 from '@/assets/img/media-account/icon-bili.png';
|
import icon3 from '@/assets/img/media-account/icon-bili.png';
|
||||||
|
|
||||||
|
export const ENUM_PLATFORM = {
|
||||||
|
jl: 0,
|
||||||
|
jg: 1,
|
||||||
|
bili: 2,
|
||||||
|
};
|
||||||
|
|
||||||
export const PLATFORM_LIST = [
|
export const PLATFORM_LIST = [
|
||||||
{
|
{
|
||||||
label: '巨量',
|
label: '巨量',
|
||||||
|
|||||||
Reference in New Issue
Block a user