|
@@ -1,106 +1,106 @@
|
|
|
<template>
|
|
|
- <fs-page class="fs-page-custom">
|
|
|
- <fs-crud ref="crudRef" v-bind="crudBinding">
|
|
|
- <template #header-middle>
|
|
|
- <el-tabs v-model="tabActiveName" class="chart-tabs" type="border-card">
|
|
|
- <el-tab-pane label="数据趋势" name="dataTendency">
|
|
|
- <DataTendencyChart
|
|
|
- v-if="tabActiveName === 'dataTendency'"
|
|
|
- :query="queryParams"
|
|
|
- :fetchCard="getCardData"
|
|
|
- :fetchLine="getLineData"
|
|
|
- :fetch-line-month="getLineMonthData"
|
|
|
- :fetch-line-week="getLineWeekData">
|
|
|
- </DataTendencyChart>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="广告结构" name="adStruct">
|
|
|
- <AdStructChart v-if="tabActiveName === 'adStruct'" />
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="散点视图" name="scatterView">
|
|
|
- <div v-if="tabActiveName === 'scatterView'">散点视图</div>
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
- </template>
|
|
|
- <template #cell_percentTimeInBudget="scope">
|
|
|
- <el-progress :percentage="scope.row.percentTimeInBudget > 0 ? scope.row.percentTimeInBudget * 100 : 0" />
|
|
|
- </template>
|
|
|
- <template #cell_campaignName="scope">
|
|
|
- <el-link type="primary" :underline="false" @click="jumpGroup(scope.row)">{{ scope.row.campaignName }}</el-link>
|
|
|
- </template>
|
|
|
- <template #cell_MissedImpressions="scope">
|
|
|
- {{ scope.row.MissedImpressionsLower ?? '0' }} ~ {{ scope.row.MissedImpressionsUpper ?? '0' }}
|
|
|
- </template>
|
|
|
- <template #cell_MissedClicks="scope"> {{ scope.row.MissedClicksLower ?? '0' }} ~ {{ scope.row.MissedClicksUpper ?? '0' }} </template>
|
|
|
- <template #cell_MissedSales="scope"> {{ scope.row.MissedSalesLower ?? '0' }} ~ {{ scope.row.MissedSalesUpper ?? '0' }} </template>
|
|
|
+ <fs-page class="fs-page-custom">
|
|
|
+ <fs-crud ref="crudRef" v-bind="crudBinding">
|
|
|
+ <template #header-middle>
|
|
|
+ <el-tabs v-model="tabActiveName" class="chart-tabs" type="border-card">
|
|
|
+ <el-tab-pane label="数据趋势" name="dataTendency">
|
|
|
+ <DataTendencyChart
|
|
|
+ v-if="tabActiveName === 'dataTendency'"
|
|
|
+ :query="queryParams"
|
|
|
+ :fetchCard="getCardData"
|
|
|
+ :fetchLine="getLineData"
|
|
|
+ :fetch-line-month="getLineMonthData"
|
|
|
+ :fetch-line-week="getLineWeekData">
|
|
|
+ </DataTendencyChart>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="广告结构" name="adStruct">
|
|
|
+ <AdStructChart v-if="tabActiveName === 'adStruct'"/>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="散点视图" name="scatterView">
|
|
|
+ <div v-if="tabActiveName === 'scatterView'">散点视图</div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </template>
|
|
|
+ <template #cell_percentTimeInBudget="scope">
|
|
|
+ <el-progress :percentage="scope.row.percentTimeInBudget > 0 ? scope.row.percentTimeInBudget * 100 : 0"/>
|
|
|
+ </template>
|
|
|
+ <template #cell_campaignName="scope">
|
|
|
+ <el-link type="primary" :underline="false" @click="jumpGroup(scope.row)">{{ scope.row.campaignName }}</el-link>
|
|
|
+ </template>
|
|
|
+ <template #cell_MissedImpressions="scope">
|
|
|
+ {{ scope.row.MissedImpressionsLower ?? '0' }} ~ {{ scope.row.MissedImpressionsUpper ?? '0' }}
|
|
|
+ </template>
|
|
|
+ <template #cell_MissedClicks="scope"> {{ scope.row.MissedClicksLower ?? '0' }} ~ {{ scope.row.MissedClicksUpper ?? '0' }}</template>
|
|
|
+ <template #cell_MissedSales="scope"> {{ scope.row.MissedSalesLower ?? '0' }} ~ {{ scope.row.MissedSalesUpper ?? '0' }}</template>
|
|
|
|
|
|
- <template v-for="field of Object.keys(BaseColumn)" #[`cell_${field}`]="scope">
|
|
|
- <p>{{ scope.row[field] }}</p>
|
|
|
- <el-popover effect="dark" :width="260">
|
|
|
- <template #reference>
|
|
|
- <DataCompare :field="field" :value="scope.row[field]" :gapVal="scope.row[`gap${field}`]" :showCompare="showCompare" />
|
|
|
- </template>
|
|
|
- <p>对比周期:{{ compareDate[0] }} ~ {{ compareDate[1] }}</p>
|
|
|
- <p>对比值:{{ scope.row[`prev${field}`] }}</p>
|
|
|
- </el-popover>
|
|
|
- </template>
|
|
|
- <template #toolbar-left>
|
|
|
- <div class="campare-switch">
|
|
|
- <span>数据对比 </span>
|
|
|
- <el-switch v-model="showCompare" size="small" />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </fs-crud>
|
|
|
- </fs-page>
|
|
|
+ <template v-for="field of Object.keys(BaseColumn)" #[`cell_${field}`]="scope">
|
|
|
+ <p>{{ scope.row[field] }}</p>
|
|
|
+ <el-popover effect="dark" :width="260">
|
|
|
+ <template #reference>
|
|
|
+ <DataCompare :field="field" :value="scope.row[field]" :gapVal="scope.row[`gap${field}`]" :showCompare="showCompare"/>
|
|
|
+ </template>
|
|
|
+ <p>对比周期:{{ compareDate[0] }} ~ {{ compareDate[1] }}</p>
|
|
|
+ <p>对比值:{{ scope.row[`prev${field}`] }}</p>
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
+ <template #toolbar-left>
|
|
|
+ <div class="campare-switch">
|
|
|
+ <span>数据对比 </span>
|
|
|
+ <el-switch v-model="showCompare" size="small"/>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </fs-crud>
|
|
|
+ </fs-page>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, onMounted, computed, watch, onBeforeMount } from 'vue'
|
|
|
-import { useFs, FsPage } from '@fast-crud/fast-crud'
|
|
|
-import { createCrudOptions } from './crud'
|
|
|
-import { useShopInfo } from '/@/stores/shopInfo'
|
|
|
-import { usePublicData } from '/@/stores/publicData'
|
|
|
-import { storeToRefs } from 'pinia'
|
|
|
-import { useRoute, useRouter } from 'vue-router'
|
|
|
+import {computed, onMounted, ref, watch} from 'vue'
|
|
|
+import {FsPage, useFs} from '@fast-crud/fast-crud'
|
|
|
+import {createCrudOptions} from './crud'
|
|
|
+import {useShopInfo} from '/@/stores/shopInfo'
|
|
|
+import {usePublicData} from '/@/stores/publicData'
|
|
|
+import {storeToRefs} from 'pinia'
|
|
|
+import {useRouter} from 'vue-router'
|
|
|
import AdStructChart from './chartComponents/adStruct.vue'
|
|
|
import DataTendencyChart from '/@/views/adManage/sp/chartComponents/dataTendency.vue'
|
|
|
-import { getCardData, getLineData, getLineMonthData, getLineWeekData } from './api'
|
|
|
-import { BaseColumn } from '/@/views/adManage/utils/commonTabColumn.js'
|
|
|
+import {getCardData, getLineData, getLineMonthData, getLineWeekData} from './api'
|
|
|
+import {BaseColumn} from '/@/views/adManage/utils/commonTabColumn.js'
|
|
|
import DataCompare from '/@/components/dataCompare/index.vue'
|
|
|
-import { getCompareDate } from '/@/views/adManage/utils/tools.js'
|
|
|
+import {getCompareDate} from '/@/views/adManage/utils/tools.js'
|
|
|
|
|
|
const tabActiveName = ref('dataTendency')
|
|
|
const shopInfo = useShopInfo()
|
|
|
const publicData = usePublicData()
|
|
|
-const { dateRange } = storeToRefs(publicData)
|
|
|
-const { profile } = storeToRefs(shopInfo)
|
|
|
+const {dateRange} = storeToRefs(publicData)
|
|
|
+const {profile} = storeToRefs(shopInfo)
|
|
|
const queryParams = ref({
|
|
|
profileId: profile.value.profile_id,
|
|
|
dateRange
|
|
|
})
|
|
|
-const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: queryParams })
|
|
|
+const {crudBinding, crudRef, crudExpose} = useFs({createCrudOptions, context: queryParams})
|
|
|
const router = useRouter()
|
|
|
const showCompare = ref(false)
|
|
|
|
|
|
onMounted(async () => {
|
|
|
- crudExpose.doRefresh()
|
|
|
+ crudExpose.doRefresh()
|
|
|
})
|
|
|
const compareDate = computed(() => {
|
|
|
- return getCompareDate(dateRange.value)
|
|
|
+ return getCompareDate(dateRange.value)
|
|
|
})
|
|
|
const jumpGroup = (row: any) => {
|
|
|
- router.push({
|
|
|
- name: 'CampaignDetail',
|
|
|
- query: { id: row.id, campaignId: row.campaignId, tagsViewName: row.campaignName },
|
|
|
- })
|
|
|
+ router.push({
|
|
|
+ name: 'CampaignDetail',
|
|
|
+ query: {id: row.id, campaignId: row.campaignId, tagsViewName: row.campaignName},
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
watch(queryParams, async () => {
|
|
|
- crudExpose.doRefresh()
|
|
|
-}, { deep: true })
|
|
|
+ crudExpose.doRefresh()
|
|
|
+}, {deep: true})
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.campare-switch {
|
|
|
- flex: none;
|
|
|
+ flex: none;
|
|
|
}
|
|
|
</style>
|