|
@@ -2,31 +2,26 @@
|
|
|
<div class="asj-container">
|
|
|
<div class="public-search">
|
|
|
<DateRangePicker v-model="dateRange" :timezone="shopInfo.profile.time_zone"></DateRangePicker>
|
|
|
- <el-select v-model="selectedPortfolios" placeholder="广告组合" clearable multiple style="width: 400px;"
|
|
|
+ <el-select
|
|
|
+ v-model="selectedPortfolios"
|
|
|
+ placeholder="广告组合"
|
|
|
+ clearable
|
|
|
+ multiple
|
|
|
+ style="width: 400px"
|
|
|
collapse-tags
|
|
|
collapse-tags-tooltip
|
|
|
- :max-collapse-tags="3">
|
|
|
+ :max-collapse-tags="3"
|
|
|
+ >
|
|
|
<el-option v-for="info of portfolios" :label="info.name" :value="info.portfolioId"></el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
- <el-tabs v-model="tabActiveName" class="asj-tabs" @tab-change="changeTab">
|
|
|
- <el-tab-pane label="广告活动" name="campaigns">
|
|
|
- <Campaigns ref="campaignsRef" />
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="关键词投放" name="keywords" :lazy="true">
|
|
|
- <Keywords ref="keywordsRef" />
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="商品投放" name="targets" :lazy="true">
|
|
|
- <Targets ref="targetsRef"/>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="推广商品" :lazy="true"></el-tab-pane>
|
|
|
- <el-tab-pane label="购买的其它商品" :lazy="true"></el-tab-pane>
|
|
|
- <el-tab-pane label="搜索词" :lazy="true">
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="广告位" :lazy="true">
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="预算上限" :lazy="true"></el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
+
|
|
|
+ <div class="asj-tabs">
|
|
|
+ <div v-for="tab of tabs" :key="tab.name" :class="['asj-tab', { active: tabActiveName === tab.name }]" @click="tabActiveName = tab.name">
|
|
|
+ {{ tab.label }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <component :is="tabsComponents[tabActiveName]"></component>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -39,7 +34,6 @@ import { ref, onBeforeMount, Ref, watch, provide } from 'vue'
|
|
|
import { useShopInfo } from '/@/stores/shopInfo'
|
|
|
import { usePublicData } from '/@/stores/publicData'
|
|
|
import { GetList } from '/@/views/adManage/portfolios/api'
|
|
|
-import { nextTick } from 'process'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
import Targets from './targets/index.vue'
|
|
|
|
|
@@ -48,10 +42,17 @@ const publicData = usePublicData()
|
|
|
const selectedPortfolios: Ref<string[]> = ref([])
|
|
|
const portfolios: Ref<Portfolio[]> = ref([])
|
|
|
const { dateRange } = storeToRefs(publicData)
|
|
|
-const tabActiveName = ref('campaigns')
|
|
|
-const campaignsRef = ref()
|
|
|
-const keywordsRef = ref()
|
|
|
-const targetsRef = ref()
|
|
|
+const tabActiveName = ref('Campaigns')
|
|
|
+const tabs = [
|
|
|
+ { label: '广告活动', name: 'Campaigns' },
|
|
|
+ { label: '关键词投放', name: 'Keywords' },
|
|
|
+ { label: '商品投放', name: 'Targets' },
|
|
|
+]
|
|
|
+const tabsComponents: any = {
|
|
|
+ Campaigns,
|
|
|
+ Keywords,
|
|
|
+ Targets,
|
|
|
+}
|
|
|
|
|
|
provide('dateRange', dateRange)
|
|
|
|
|
@@ -59,13 +60,7 @@ onBeforeMount(async () => {
|
|
|
const resp: APIResponseData = await GetList({ limit: 999 })
|
|
|
portfolios.value = resp.data
|
|
|
})
|
|
|
-const changeTab = () => {
|
|
|
- nextTick(() => {
|
|
|
- campaignsRef.value.resizeTabChart()
|
|
|
- keywordsRef.value.resizeTabChart()
|
|
|
- targetsRef.value.resizeTabChart()
|
|
|
- })
|
|
|
-}
|
|
|
+
|
|
|
publicData.$subscribe((mutation, state) => {
|
|
|
// console.log(mutation)
|
|
|
// console.log(state.dateRange)
|
|
@@ -73,4 +68,4 @@ publicData.$subscribe((mutation, state) => {
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
-<style></style>
|
|
|
+<style scoped></style>
|