refactor(property-marketing): 优化品牌物料列表展示
-调整操作列宽度,确保内容显示完整 - 移除冗余注释,提高代码可读性
This commit is contained in:
@ -10,9 +10,12 @@
|
||||
</a-tabs>
|
||||
</div>
|
||||
<!--表单组件搜索-->
|
||||
<listSearchForm v-model:query="query" @onSearch="getData"></listSearchForm>
|
||||
<listSearchForm v-model:query="query" @onSearch="onSearch"></listSearchForm>
|
||||
<!-- 投放指南-->
|
||||
<PlacementGuideList v-if="tabData === 'placement_guide'"></PlacementGuideList>
|
||||
<PlacementGuideList
|
||||
v-if="tabData === 'placement_guide'"
|
||||
:listResult="{ data: guideListData.data, total: pageInfo.total }"
|
||||
></PlacementGuideList>
|
||||
<!-- 历史指南列表-->
|
||||
<GuideListHistory v-if="tabData === 'guide_history'"></GuideListHistory>
|
||||
</div>
|
||||
@ -22,8 +25,9 @@
|
||||
<MonthData></MonthData>
|
||||
|
||||
<!-- 投放建议-->
|
||||
<PlacementSuggestions></PlacementSuggestions>
|
||||
<ActionGuideDistribution></ActionGuideDistribution>
|
||||
<PlacementSuggestions :optimization="aiResult.optimization"></PlacementSuggestions>
|
||||
<!-- 投放行动指南-->
|
||||
<ActionGuideDistribution :action_guide="aiResult.action_guide"></ActionGuideDistribution>
|
||||
</a-spin>
|
||||
<div>
|
||||
<a-space class="down-btn">
|
||||
@ -52,7 +56,6 @@ 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';
|
||||
import FilterBlock from '@/views/property-marketing/put-account/account-data/components/filter-block/index.vue';
|
||||
import {
|
||||
getAiResult,
|
||||
getPlacementAccountData,
|
||||
@ -67,31 +70,46 @@ const query = reactive({
|
||||
});
|
||||
|
||||
const loading = ref(false);
|
||||
const queryResult = reactive({
|
||||
search_key: '',
|
||||
|
||||
const guideListData = reactive({
|
||||
data: [],
|
||||
});
|
||||
const pageInfo = reactive({
|
||||
total: 0,
|
||||
page_size: 0,
|
||||
page: 1,
|
||||
});
|
||||
|
||||
const getData = async () => {
|
||||
console.log(query, 'query');
|
||||
const onSearch = async () => {
|
||||
const { code, data } = await getPlacementGuide(query);
|
||||
if (code === 200) {
|
||||
guideListData.data = data.data;
|
||||
getSyncAiResult();
|
||||
}
|
||||
console.log(guideListData, 'guideListData');
|
||||
};
|
||||
|
||||
const aiResult = reactive({
|
||||
optimization: [], //投放建议优化
|
||||
action_guide: [], //新投放建议生成
|
||||
});
|
||||
|
||||
const getSyncAiResult = async () => {
|
||||
const { code, data } = await getAiResult(query);
|
||||
if (code === 200) {
|
||||
//成功或者失败清除定时任务
|
||||
// 成功或者失败清除定时任务
|
||||
if ((data.status && data.status === 3) || data.status === 2) {
|
||||
clearInterval(timer);
|
||||
// clearInterval(timer);
|
||||
loading.value = false;
|
||||
}
|
||||
aiResult.optimization = data.result.optimization.modules;
|
||||
aiResult.action_guide = data.result?.action_guide?.modules;
|
||||
}
|
||||
};
|
||||
// 定时任务请求接口
|
||||
const timer = setInterval(() => {
|
||||
getSyncAiResult();
|
||||
}, 5000);
|
||||
// const timer = setInterval(() => {
|
||||
// getSyncAiResult();
|
||||
// }, 5000);
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user