2025-07-07 20:59:54 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="guidelines-data-wrap">
|
2025-08-15 14:32:40 +08:00
|
|
|
<div class="filter-wrap bg-#fff rounded-8px ">
|
2025-07-07 20:59:54 +08:00
|
|
|
<div class="top flex h-64px px-24px py-10px justify-between items-center">
|
|
|
|
|
<p class="text-18px font-400 lh-26px color-#211F24 title">投放信息</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="container px-24px pt-12px pb-24px">
|
2025-09-05 16:41:50 +08:00
|
|
|
<Row class="grid-demo" :gutter="24">
|
|
|
|
|
<Col :span="12">
|
2025-07-07 20:59:54 +08:00
|
|
|
<div class="">
|
2025-09-04 16:50:20 +08:00
|
|
|
<Space direction="vertical">
|
2025-07-10 16:49:33 +08:00
|
|
|
<span class="span-title">账户</span>
|
|
|
|
|
<span class="span-content">{{ detailData?.account }}</span>
|
2025-09-04 16:50:20 +08:00
|
|
|
</Space>
|
2025-07-07 20:59:54 +08:00
|
|
|
</div>
|
2025-09-05 16:41:50 +08:00
|
|
|
</Col>
|
2025-07-07 20:59:54 +08:00
|
|
|
|
2025-09-05 16:41:50 +08:00
|
|
|
<Col :span="12">
|
2025-07-07 20:59:54 +08:00
|
|
|
<div class="">
|
2025-09-04 16:50:20 +08:00
|
|
|
<Space direction="vertical">
|
2025-07-10 16:49:33 +08:00
|
|
|
<span class="span-title">计划</span>
|
|
|
|
|
<span class="span-content">{{detailData.plan}}</span>
|
2025-09-04 16:50:20 +08:00
|
|
|
</Space>
|
2025-07-07 20:59:54 +08:00
|
|
|
</div>
|
2025-09-05 16:41:50 +08:00
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row class="grid-demo" :gutter="24" style="margin-top: 30px">
|
|
|
|
|
<Col :span="12">
|
2025-07-07 20:59:54 +08:00
|
|
|
<div class="">
|
2025-09-04 16:50:20 +08:00
|
|
|
<Space direction="vertical">
|
2025-07-10 16:49:33 +08:00
|
|
|
<span class="span-title">平台</span>
|
2025-09-04 16:50:20 +08:00
|
|
|
<Space>
|
2025-07-10 16:49:33 +08:00
|
|
|
<span
|
|
|
|
|
class="mr-8px"
|
|
|
|
|
v-if="detailData.platform.length > 0"
|
|
|
|
|
v-for="(item, index) in detailData.platform"
|
|
|
|
|
>
|
|
|
|
|
<img :src="PLATFORM_LIST?.[item]?.icon" width="15" height="15" />
|
|
|
|
|
<span class="label ml-5px">{{ PLATFORM_LIST?.[item]?.label }}</span>
|
|
|
|
|
</span>
|
2025-09-04 16:50:20 +08:00
|
|
|
</Space>
|
|
|
|
|
</Space>
|
2025-07-07 20:59:54 +08:00
|
|
|
</div>
|
2025-09-05 16:41:50 +08:00
|
|
|
</Col>
|
2025-07-07 20:59:54 +08:00
|
|
|
|
2025-09-05 16:41:50 +08:00
|
|
|
<Col :span="12">
|
2025-07-07 20:59:54 +08:00
|
|
|
<div class="">
|
2025-09-04 16:50:20 +08:00
|
|
|
<Space direction="vertical">
|
2025-07-10 16:49:33 +08:00
|
|
|
<span class="span-title">生成时间</span>
|
|
|
|
|
<span class="span-content">{{ detailData.created_at }}</span>
|
2025-09-04 16:50:20 +08:00
|
|
|
</Space>
|
2025-07-07 20:59:54 +08:00
|
|
|
</div>
|
2025-09-05 16:41:50 +08:00
|
|
|
</Col>
|
|
|
|
|
</Row>
|
2025-07-07 20:59:54 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-07-10 16:49:33 +08:00
|
|
|
<MonthData :overview="aiResult.overview"></MonthData>
|
2025-07-08 16:55:03 +08:00
|
|
|
|
2025-07-10 16:49:33 +08:00
|
|
|
<!-- 投放建议-->
|
|
|
|
|
<PlacementSuggestions :optimization="aiResult.optimization"></PlacementSuggestions>
|
2025-07-09 15:15:16 +08:00
|
|
|
<div class="ignore-export">
|
2025-09-04 16:50:20 +08:00
|
|
|
<Space class="down-btn">
|
2025-09-03 11:15:37 +08:00
|
|
|
<Button type="primary" ghost :loading="exportLoading" @click="downPage">
|
2025-07-09 15:15:16 +08:00
|
|
|
<template #icon>
|
2025-09-03 11:15:37 +08:00
|
|
|
<icon-download class="mr-8px"/>
|
2025-07-09 15:15:16 +08:00
|
|
|
</template>
|
|
|
|
|
<template #default>下载</template>
|
2025-09-03 11:15:37 +08:00
|
|
|
</Button>
|
2025-09-04 16:50:20 +08:00
|
|
|
</Space>
|
2025-07-07 20:59:54 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { reactive, ref } from 'vue';
|
2025-09-05 16:41:50 +08:00
|
|
|
import { Button, Space, message, Row, Col } from 'ant-design-vue';
|
2025-07-07 20:59:54 +08:00
|
|
|
import MonthData from './components/month-data/index.vue';
|
|
|
|
|
import PlacementSuggestions from './components/placement-suggestions/index.vue';
|
2025-07-22 16:29:16 +08:00
|
|
|
import { PLATFORM_LIST } from '@/utils/platform';
|
2025-07-07 20:59:54 +08:00
|
|
|
import { getPlacementGuideDetail } from '@/api/all/propertyMarketing';
|
|
|
|
|
import { useRoute } from 'vue-router';
|
2025-07-09 15:15:16 +08:00
|
|
|
import { uploadPdf } from '@/views/property-marketing/put-account/investment-guidelines/constants';
|
2025-07-07 20:59:54 +08:00
|
|
|
|
2025-07-08 16:55:03 +08:00
|
|
|
const aiResult = reactive({
|
|
|
|
|
optimization: [], // 投放建议优化
|
|
|
|
|
action_guide: [], // 新投放建议生成
|
|
|
|
|
overview: [], // 新投放建议生成
|
2025-07-07 20:59:54 +08:00
|
|
|
});
|
2025-07-09 15:15:16 +08:00
|
|
|
const fileUrl = ref('');
|
2025-07-07 20:59:54 +08:00
|
|
|
const detailData = reactive({
|
2025-07-08 16:55:03 +08:00
|
|
|
created_at: '',
|
|
|
|
|
account: '',
|
2025-07-07 20:59:54 +08:00
|
|
|
platform: [],
|
|
|
|
|
});
|
|
|
|
|
const route = useRoute();
|
|
|
|
|
const id = route.params.id;
|
|
|
|
|
const getDetail = async () => {
|
|
|
|
|
const { code, data } = await getPlacementGuideDetail(id);
|
|
|
|
|
if (code === 200) {
|
2025-07-08 16:55:03 +08:00
|
|
|
Object.assign(aiResult, data.ai_result);
|
2025-07-07 20:59:54 +08:00
|
|
|
Object.assign(detailData, data);
|
2025-07-08 16:55:03 +08:00
|
|
|
console.log(aiResult, 'aiResult');
|
2025-07-07 20:59:54 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-09 15:15:16 +08:00
|
|
|
const exportLoading = ref(false);
|
|
|
|
|
const downPage = async () => {
|
|
|
|
|
try {
|
|
|
|
|
let downFileUrl = fileUrl.value;
|
|
|
|
|
exportLoading.value = true;
|
|
|
|
|
if (downFileUrl === '') {
|
|
|
|
|
downFileUrl = await uploadPdf('投放指南.pdf', '.guidelines-data-wrap');
|
|
|
|
|
fileUrl.value = downFileUrl;
|
|
|
|
|
}
|
|
|
|
|
const link = document.createElement('a');
|
|
|
|
|
link.href = downFileUrl;
|
|
|
|
|
link.download = '投放指南.pdf';
|
|
|
|
|
document.body.appendChild(link);
|
|
|
|
|
link.click();
|
|
|
|
|
document.body.removeChild(link);
|
|
|
|
|
exportLoading.value = false;
|
|
|
|
|
} catch (error) {
|
2025-09-05 11:30:31 +08:00
|
|
|
message.error(error.message);
|
2025-07-09 15:15:16 +08:00
|
|
|
exportLoading.value = false;
|
|
|
|
|
}
|
|
|
|
|
};
|
2025-07-07 20:59:54 +08:00
|
|
|
onMounted(() => {
|
|
|
|
|
getDetail();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
@import './style.scss';
|
|
|
|
|
</style>
|