Merge remote-tracking branch 'origin/main' into feature/0710_下载中心_rxd

This commit is contained in:
rd
2025-07-18 18:14:14 +08:00
9 changed files with 43 additions and 19 deletions

View File

@ -30,7 +30,7 @@ export const getAccountInfoFields = (dateType: string, showMore: boolean) => {
{ title: '数据更新时间', dataIndex: 'last_synced_at', notDifferentiateDateType: true },
{ title: '平台', dataIndex: 'platform', notDifferentiateDateType: true },
{ title: '状态', dataIndex: 'status', type: 'status', notDifferentiateDateType: true },
{ title: '账号ID', dataIndex: 'id', notDifferentiateDateType: true },
{ title: '账号ID', dataIndex: 'account_id', notDifferentiateDateType: true },
{ title: '手机号码', dataIndex: 'mobile', notDifferentiateDateType: true },
{ title: '运营人员', dataIndex: 'operator.name', notDifferentiateDateType: true },
{ title: '所属项目', dataIndex: 'group.name', notDifferentiateDateType: true },

View File

@ -28,9 +28,7 @@
</div>
<div class="field-row">
<span class="label">数据更新时间</span>
<span class="cts num">{{
exactFormatTime(item.last_synced_at, 'YYYY-MM-DD HH:mm:ss', 'YYYY-MM-DD HH:mm:ss')
}}</span>
<span class="cts num">{{ getLastSyncedAt(item) }}</span>
</div>
<div class="field-row">
<span class="label">平台</span>
@ -144,6 +142,10 @@ const props = defineProps({
type: Array,
default: () => [],
},
isLoadingTaskStatus: {
type: Boolean,
default: () => false,
},
});
const emits = defineEmits(['openEdit', 'update', 'selectionChange', 'delete']);
@ -172,6 +174,9 @@ const isSyncing = (item) => {
if (!props.syncMediaAccounts.length) return false;
const target = props.syncMediaAccounts.find((v) => v.id === item.id);
if(target) {
return target?.status === 0;
}
return target?.status === 0;
};
@ -265,6 +270,18 @@ const onDeleteSyncStatus = async (item) => {
await deleteSyncStatus(item.id);
item.status = 1;
};
const formatTime = (time) => {
return exactFormatTime(time, 'YYYY-MM-DD HH:mm:ss', 'YYYY-MM-DD HH:mm:ss');
};
const getLastSyncedAt = (item) => {
const target = props.syncMediaAccounts.find((v) => v.id === item.id);
if (props.isLoadingTaskStatus && target) {
if (target?.status !== 0) {
return formatTime(target.last_synced_at);
}
}
return formatTime(item.last_synced_at);
};
</script>
<style scoped lang="scss">

View File

@ -80,6 +80,7 @@
<AccountTable
v-if="dataSource.length > 0"
:syncMediaAccounts="syncMediaAccounts"
:isLoadingTaskStatus="isLoadingTaskStatus"
:dataSource="dataSource"
:selectedItems="selectedItems"
@selectionChange="handleSelectionChange"
@ -164,7 +165,7 @@ const dataSource = ref([]);
const selectedItems = ref([]);
const healthData = ref({});
const syncMediaAccounts = ref([]);
const startSyncData = ref(false);
const isLoadingTaskStatus = ref(false); // 正在查询状态中
const isAbNormalStatus = computed(() => healthData.value?.total_abnormal_number > 0);
const isDisabledBatchSyncData = computed(() => selectedItems.value.some((item) => item.status !== EnumStatus.NORMAL));
@ -291,14 +292,14 @@ const getAsyncStatus = async () => {
const isEnd = data.every((item) => item.status !== 0);
if (isEnd) {
clearSyncDataTimer();
startSyncData.value = false;
isLoadingTaskStatus.value = false;
getData();
}
}
};
const startSyncDataPolling = () => {
startSyncData.value = true;
isLoadingTaskStatus.value = true;
clearSyncDataTimer();
getAsyncStatus();
@ -308,7 +309,7 @@ const startSyncDataPolling = () => {
const handleSyncData = async (item) => {
const { code } = await postSyncMediaAccountData(item.id);
if (code === 200) {
if (!startSyncData.value) {
if (!isLoadingTaskStatus.value) {
startSyncDataPolling();
}
}
@ -325,7 +326,7 @@ const handleBatchSyncData = async () => {
const ids = selectedItems.value.map((item) => item.id);
const { code } = await postBatchSyncMediaAccountData({ ids });
if (code === 200) {
if (!startSyncData.value) {
if (!isLoadingTaskStatus.value) {
startSyncDataPolling();
}
}

View File

@ -7,7 +7,7 @@ export const TABLE_COLUMNS = [
title: '账户名称',
dataIndex: 'name',
prop: 'name',
width: 180,
width: 240,
fixed: 'left',
},
{
@ -19,7 +19,7 @@ export const TABLE_COLUMNS = [
},
{
title: '运营人员',
dataIndex: 'operator_ame',
dataIndex: 'operator_name',
prop: 'operator',
width: 180,
},

View File

@ -38,7 +38,7 @@
<div class="filter-row flex">
<div v-if="!isAccountTab" class="filter-row-item flex items-center">
<span class="label">关联账户</span>
<a-space class="w-160px">
<a-space class="w-240px">
<AccountSelect v-model="query.placement_account_id" :options="placementAccounts" @change="handleSearch" />
</a-space>
</div>

View File

@ -7,7 +7,7 @@ export const TABLE_COLUMNS = [
title: '计划名称',
dataIndex: 'name',
prop: 'name',
width: 180,
width: 240,
fixed: 'left',
},
{

View File

@ -92,7 +92,8 @@ const init = () => {
selectedRowKeys.value = [];
accountTableRef.value?.resetTable();
const data_time = [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')];
const yesterday = dayjs().subtract(1, 'day').format('YYYY-MM-DD');
const data_time = [yesterday, yesterday];
query.value.data_time = data_time;
getData();
@ -137,9 +138,11 @@ const handleSelectionChange = (selectedRows) => {
};
const handleTabClick = (key) => {
dataSource.value = [];
selectedRowKeys.value = [];
pageInfo.value = cloneDeep(INITIAL_PAGE_INFO);
activeTab.value = key;
getData();
};
const handleExport = () => {

View File

@ -173,7 +173,7 @@ const INITIAL_FORM = {
operator_name: '',
holder_name: '',
platform: 0,
is_sync_project: 0,
is_sync_project: 1,
};
const visible = ref(false);

View File

@ -9,11 +9,14 @@
size="medium"
:placeholder="placeholder"
allow-clear
allow-search
@change="handleChange"
>
<a-option v-for="(item, index) in options" :key="index" :value="item.id" :label="item.name">
{{ item.name }}
</a-option>
<a-tooltip v-for="(item, index) in options" :key="index" :content="item.name">
<a-option :value="item.id" :label="item.name">
{{ item.name }}
</a-option>
</a-tooltip>
</a-select>
</template>