2025-06-27 16:26:03 +08:00
|
|
|
<template>
|
2025-06-30 11:36:11 +08:00
|
|
|
<view>
|
2025-06-27 16:26:03 +08:00
|
|
|
<div class="part-div">
|
|
|
|
|
<div>
|
|
|
|
|
<a-tabs v-model:activeKey="tabData" class="a-tab-class" default-active-key="placement_guide">
|
|
|
|
|
<a-tab-pane key="placement_guide" title="投放指南"></a-tab-pane>
|
|
|
|
|
<a-tab-pane key="guide_history">
|
|
|
|
|
<template #title>历史投放指南</template>
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
</a-tabs>
|
|
|
|
|
</div>
|
|
|
|
|
<!--表单组件搜索-->
|
2025-07-06 18:27:51 +08:00
|
|
|
<listSearchForm v-model:query="query" @onSearch="onSearch"></listSearchForm>
|
2025-06-27 16:26:03 +08:00
|
|
|
<!-- 投放指南-->
|
2025-07-06 18:27:51 +08:00
|
|
|
<PlacementGuideList
|
|
|
|
|
v-if="tabData === 'placement_guide'"
|
|
|
|
|
:listResult="{ data: guideListData.data, total: pageInfo.total }"
|
|
|
|
|
></PlacementGuideList>
|
2025-06-27 16:26:03 +08:00
|
|
|
<!-- 历史指南列表-->
|
2025-06-30 11:36:11 +08:00
|
|
|
<GuideListHistory v-if="tabData === 'guide_history'"></GuideListHistory>
|
2025-06-27 16:26:03 +08:00
|
|
|
</div>
|
|
|
|
|
|
2025-07-04 10:35:16 +08:00
|
|
|
<a-spin :loading="loading" tip="数据分析中">
|
|
|
|
|
<!-- 本月摘要-->
|
|
|
|
|
<MonthData></MonthData>
|
2025-06-27 16:26:03 +08:00
|
|
|
|
2025-07-04 10:35:16 +08:00
|
|
|
<!-- 投放建议-->
|
2025-07-06 18:27:51 +08:00
|
|
|
<PlacementSuggestions :optimization="aiResult.optimization"></PlacementSuggestions>
|
|
|
|
|
<!-- 投放行动指南-->
|
|
|
|
|
<ActionGuideDistribution :action_guide="aiResult.action_guide"></ActionGuideDistribution>
|
2025-07-04 10:35:16 +08:00
|
|
|
</a-spin>
|
2025-06-27 16:26:03 +08:00
|
|
|
<div>
|
2025-06-30 16:11:25 +08:00
|
|
|
<a-space class="down-btn">
|
2025-06-27 16:26:03 +08:00
|
|
|
<a-button type="outline" @click="handleSearch">
|
|
|
|
|
<template #icon>
|
|
|
|
|
<icon-download />
|
|
|
|
|
</template>
|
|
|
|
|
<template #default>下载</template>
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button type="primary" @click="handleSearch">
|
|
|
|
|
<template #icon>
|
|
|
|
|
<icon-drive-file />
|
|
|
|
|
</template>
|
|
|
|
|
<template #default>保存</template>
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-space>
|
|
|
|
|
</div>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { reactive, ref } from 'vue';
|
|
|
|
|
import PlacementGuideList from './components/table-data/placementGuideList.vue';
|
|
|
|
|
import listSearchForm from './components/table-data/listSearchForm.vue';
|
|
|
|
|
import GuideListHistory from './components/table-data/guideListHistory.vue';
|
|
|
|
|
import MonthData from './components/month-data/index.vue';
|
|
|
|
|
import PlacementSuggestions from './components/placement-suggestions/index.vue';
|
|
|
|
|
import ActionGuideDistribution from './components/action-guide-distribution';
|
2025-07-04 10:35:16 +08:00
|
|
|
import {
|
|
|
|
|
getAiResult,
|
|
|
|
|
getPlacementAccountData,
|
|
|
|
|
getPlacementAccountDataList,
|
|
|
|
|
getPlacementGuide,
|
|
|
|
|
} from '@/api/all/propertyMarketing';
|
2025-06-27 16:26:03 +08:00
|
|
|
|
|
|
|
|
const tabData = ref('placement_guide');
|
|
|
|
|
|
2025-07-04 10:35:16 +08:00
|
|
|
const query = reactive({
|
|
|
|
|
platform: '',
|
2025-06-27 16:26:03 +08:00
|
|
|
});
|
2025-07-04 10:35:16 +08:00
|
|
|
|
|
|
|
|
const loading = ref(false);
|
2025-07-06 18:27:51 +08:00
|
|
|
|
|
|
|
|
const guideListData = reactive({
|
|
|
|
|
data: [],
|
|
|
|
|
});
|
|
|
|
|
const pageInfo = reactive({
|
|
|
|
|
total: 0,
|
|
|
|
|
page_size: 0,
|
|
|
|
|
page: 1,
|
2025-07-04 10:35:16 +08:00
|
|
|
});
|
|
|
|
|
|
2025-07-06 18:27:51 +08:00
|
|
|
const onSearch = async () => {
|
2025-07-04 10:35:16 +08:00
|
|
|
const { code, data } = await getPlacementGuide(query);
|
|
|
|
|
if (code === 200) {
|
2025-07-06 18:27:51 +08:00
|
|
|
guideListData.data = data.data;
|
|
|
|
|
getSyncAiResult();
|
2025-07-04 10:35:16 +08:00
|
|
|
}
|
2025-07-06 18:27:51 +08:00
|
|
|
console.log(guideListData, 'guideListData');
|
2025-07-04 10:35:16 +08:00
|
|
|
};
|
|
|
|
|
|
2025-07-06 18:27:51 +08:00
|
|
|
const aiResult = reactive({
|
|
|
|
|
optimization: [], //投放建议优化
|
|
|
|
|
action_guide: [], //新投放建议生成
|
|
|
|
|
});
|
|
|
|
|
|
2025-07-04 10:35:16 +08:00
|
|
|
const getSyncAiResult = async () => {
|
|
|
|
|
const { code, data } = await getAiResult(query);
|
|
|
|
|
if (code === 200) {
|
2025-07-06 18:27:51 +08:00
|
|
|
// 成功或者失败清除定时任务
|
2025-07-04 10:35:16 +08:00
|
|
|
if ((data.status && data.status === 3) || data.status === 2) {
|
2025-07-06 18:27:51 +08:00
|
|
|
// clearInterval(timer);
|
2025-07-04 10:35:16 +08:00
|
|
|
loading.value = false;
|
|
|
|
|
}
|
2025-07-06 18:27:51 +08:00
|
|
|
aiResult.optimization = data.result.optimization.modules;
|
|
|
|
|
aiResult.action_guide = data.result?.action_guide?.modules;
|
2025-07-04 10:35:16 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
// 定时任务请求接口
|
2025-07-06 18:27:51 +08:00
|
|
|
// const timer = setInterval(() => {
|
|
|
|
|
// getSyncAiResult();
|
|
|
|
|
// }, 5000);
|
2025-06-27 16:26:03 +08:00
|
|
|
</script>
|
|
|
|
|
|
2025-06-30 11:36:11 +08:00
|
|
|
<style lang="scss">
|
|
|
|
|
@import './style.scss';
|
|
|
|
|
</style>
|