提取公共常量

This commit is contained in:
林志军
2025-07-04 10:35:16 +08:00
parent f3f0397eae
commit 514081aea8
5 changed files with 331 additions and 180 deletions

View File

@ -6,11 +6,18 @@
<a-col :span="8">
<a-space>
<span>账户</span>
<a-select :style="{ width: '320px' }" placeholder="全部">
<a-option>Beijing</a-option>
<a-option>Shanghai</a-option>
<a-option>Guangzhou</a-option>
</a-select>
<a-input
class="w-310px"
:style="{ width: '320px' }"
v-model="query.names"
placeholder="请搜索..."
size="medium"
allow-clear
>
<template #prefix>
<icon-search />
</template>
</a-input>
</a-space>
</a-col>
<a-col :span="8">
@ -26,10 +33,18 @@
<a-col :span="8">
<a-space>
<span>平台</span>
<a-select :style="{ width: '320px' }" placeholder="全部">
<a-option>Beijing</a-option>
<a-option>Shanghai</a-option>
<a-option>Guangzhou</a-option>
<a-select
v-model="query.platform"
class="w-320"
size="medium"
placeholder="全部"
allow-clear
@change="handleSearch"
>
<a-option v-for="(item, index) in PLATFORM_LIST" :key="index" :value="item.value" :label="item.label"
>{{ item.label }}
</a-option>
</a-select>
</a-space>
</a-col>
@ -44,7 +59,6 @@
:time-picker-props="{
defaultValue: ['00:00:00', '00:00:00'],
}"
@change="onChange"
@select="onSelect"
style="width: 380px"
/>
@ -72,8 +86,20 @@
</template>
<script setup lang="ts">
import { defineEmits, defineProps } from 'vue';
import { PLATFORM_LIST } from '@/views/property-marketing/put-account/common_constants';
const props = defineProps({
query: {
type: Object,
required: true,
},
});
const emits = defineEmits('onSearch', 'onReset', 'update:query');
const handleSearch = () => {
console.log('handleSearch');
emits('onSearch', props.query);
};
</script>

View File

@ -10,19 +10,21 @@
</a-tabs>
</div>
<!--表单组件搜索-->
<listSearchForm></listSearchForm>
<listSearchForm v-model:query="query" @onSearch="getData"></listSearchForm>
<!-- 投放指南-->
<PlacementGuideList v-if="tabData === 'placement_guide'"></PlacementGuideList>
<!-- 历史指南列表-->
<GuideListHistory v-if="tabData === 'guide_history'"></GuideListHistory>
</div>
<!-- 本月摘要-->
<MonthData></MonthData>
<a-spin :loading="loading" tip="数据分析中">
<!-- 本月摘要-->
<MonthData></MonthData>
<!-- 投放建议-->
<PlacementSuggestions></PlacementSuggestions>
<ActionGuideDistribution></ActionGuideDistribution>
<!-- 投放建议-->
<PlacementSuggestions></PlacementSuggestions>
<ActionGuideDistribution></ActionGuideDistribution>
</a-spin>
<div>
<a-space class="down-btn">
<a-button type="outline" @click="handleSearch">
@ -50,20 +52,48 @@ 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,
getPlacementAccountDataList,
getPlacementGuide,
} from '@/api/all/propertyMarketing';
const tabData = ref('placement_guide');
const listQuery = reactive({
project_id: ref(''),
platform: ref(''),
page: ref(1),
name: ref(''),
page_size: ref('10'),
const query = reactive({
platform: '',
});
const loading = ref(false);
const queryResult = reactive({
search_key: '',
});
const getData = async () => {
console.log(query, 'query');
const { code, data } = await getPlacementGuide(query);
if (code === 200) {
}
};
const getSyncAiResult = async () => {
const { code, data } = await getAiResult(query);
if (code === 200) {
//成功或者失败清除定时任务
if ((data.status && data.status === 3) || data.status === 2) {
clearInterval(timer);
loading.value = false;
}
}
};
// 定时任务请求接口
const timer = setInterval(() => {
getSyncAiResult();
}, 5000);
</script>
<style lang="scss">
@import './style.scss';
</style>