Merge pull request 'feature/0717_1.1版本问题走查调整' (#11) from feature/0717_1.1版本问题走查调整 into main

Reviewed-on: ai-team/lingji-work-fe#11
This commit is contained in:
2025-07-18 10:13:19 +00: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: 'last_synced_at', notDifferentiateDateType: true },
{ title: '平台', dataIndex: 'platform', notDifferentiateDateType: true }, { title: '平台', dataIndex: 'platform', notDifferentiateDateType: true },
{ title: '状态', dataIndex: 'status', type: 'status', 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: 'mobile', notDifferentiateDateType: true },
{ title: '运营人员', dataIndex: 'operator.name', notDifferentiateDateType: true }, { title: '运营人员', dataIndex: 'operator.name', notDifferentiateDateType: true },
{ title: '所属项目', dataIndex: 'group.name', notDifferentiateDateType: true }, { title: '所属项目', dataIndex: 'group.name', notDifferentiateDateType: true },

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -91,7 +91,8 @@ const init = () => {
selectedRowKeys.value = []; selectedRowKeys.value = [];
accountTableRef.value?.resetTable(); 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; query.value.data_time = data_time;
getData(); getData();
@ -136,9 +137,11 @@ const handleSelectionChange = (selectedRows) => {
}; };
const handleTabClick = (key) => { const handleTabClick = (key) => {
dataSource.value = [];
selectedRowKeys.value = [];
pageInfo.value = cloneDeep(INITIAL_PAGE_INFO);
activeTab.value = key; activeTab.value = key;
getData(); getData();
}; };
const handleExport = () => { const handleExport = () => {

View File

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

View File

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