|
@@ -1,28 +1,30 @@
|
|
|
<script lang="ts" setup>
|
|
|
-import {onMounted, ref, watch} from 'vue'
|
|
|
-import {FsPage, useFs} from '@fast-crud/fast-crud'
|
|
|
-import {createCrudOptions} from './crud'
|
|
|
+import { inject, onMounted, ref, watch } from 'vue'
|
|
|
+import { FsPage, useFs } from '@fast-crud/fast-crud'
|
|
|
+import { createCrudOptions } from './crud'
|
|
|
import DataTendencyChart from '/@/views/adManage/sp/chartComponents/dataTendency.vue'
|
|
|
-import {useShopInfo} from '/@/stores/shopInfo'
|
|
|
+import { useShopInfo } from '/@/stores/shopInfo'
|
|
|
import AdStructChart from './chartComponents/adStruct.vue'
|
|
|
-import {getCardData, getLineData, getLineMonthData, getLineWeekData} from './api'
|
|
|
-import {usePublicData} from '/@/stores/publicData'
|
|
|
-import {storeToRefs} from 'pinia'
|
|
|
+import { getCardData, getLineData, getLineMonthData, getLineWeekData } from './api'
|
|
|
+import { usePublicData } from '/@/stores/publicData'
|
|
|
+import { storeToRefs } from 'pinia'
|
|
|
import router from '/@/router'
|
|
|
-import {BaseColumn} from '/@/views/adManage/utils/commonTabColumn'
|
|
|
+import { BaseColumn } from '/@/views/adManage/utils/commonTabColumn'
|
|
|
import DataCompare from '/@/components/dataCompare/index.vue'
|
|
|
|
|
|
+const filterItem = inject('searchItem')
|
|
|
|
|
|
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
|
|
|
+ dateRange,
|
|
|
+ filterItem,
|
|
|
})
|
|
|
-const {crudBinding, crudRef, crudExpose} = useFs({createCrudOptions, context: queryParams})
|
|
|
+const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: queryParams })
|
|
|
const showCompare = ref(false)
|
|
|
const jumpGroup = (row: any) => {
|
|
|
router.push({
|
|
@@ -35,10 +37,13 @@ onMounted(async () => {
|
|
|
crudExpose.doRefresh()
|
|
|
})
|
|
|
|
|
|
-watch(queryParams, async () => {
|
|
|
- crudExpose.doRefresh()
|
|
|
-}, { deep: true })
|
|
|
-
|
|
|
+watch(
|
|
|
+ queryParams,
|
|
|
+ async () => {
|
|
|
+ crudExpose.doRefresh()
|
|
|
+ },
|
|
|
+ { deep: true }
|
|
|
+)
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -48,37 +53,37 @@ watch(queryParams, async () => {
|
|
|
<el-tabs v-model="tabActiveName" class="chart-tabs" type="border-card">
|
|
|
<el-tab-pane label="数据趋势" name="dataTendency">
|
|
|
<DataTendencyChart
|
|
|
- v-if="tabActiveName === 'dataTendency'"
|
|
|
- :query="queryParams"
|
|
|
- :fetch-line-month="getLineMonthData"
|
|
|
- :fetch-line-week="getLineWeekData"
|
|
|
- :fetchCard="getCardData"
|
|
|
- :fetchLine="getLineData">
|
|
|
+ v-if="tabActiveName === 'dataTendency'"
|
|
|
+ :query="queryParams"
|
|
|
+ :fetch-line-month="getLineMonthData"
|
|
|
+ :fetch-line-week="getLineWeekData"
|
|
|
+ :fetchCard="getCardData"
|
|
|
+ :fetchLine="getLineData">
|
|
|
</DataTendencyChart>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="广告结构" name="adStruct">
|
|
|
- <AdStructChart v-if="tabActiveName === 'adStruct'"/>
|
|
|
+ <AdStructChart v-if="tabActiveName === 'adStruct'" />
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="散点视图" name="scatterView"></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</template>
|
|
|
|
|
|
<template #cell_keywordText="scope">
|
|
|
- <el-tooltip effect="dark" :content="scope.row.keywordText" placement="top">
|
|
|
- <el-link :underline="false" @click="jumpGroup(scope.row)">
|
|
|
+ <el-tooltip effect="dark" :content="scope.row.keywordText" placement="top">
|
|
|
+ <el-link :underline="false" @click="jumpGroup(scope.row)">
|
|
|
<div class="en-text">{{ scope.row.keywordText }}</div>
|
|
|
</el-link>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
<template #cell_campaignName="scope">
|
|
|
- <el-tooltip effect="dark" :content="scope.row.campaignName" placement="top">
|
|
|
+ <el-tooltip effect="dark" :content="scope.row.campaignName" placement="top">
|
|
|
<el-link type="primary" :underline="false" @click="jumpGroup(scope.row)">
|
|
|
<div class="en-text">{{ scope.row.campaignName }}</div>
|
|
|
</el-link>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
<template #cell_adGroupName="scope">
|
|
|
- <el-tooltip effect="dark" :content="scope.row.adGroupName" placement="top">
|
|
|
+ <el-tooltip effect="dark" :content="scope.row.adGroupName" placement="top">
|
|
|
<el-link type="primary" :underline="false" @click="jumpGroup(scope.row)">
|
|
|
<div class="en-text">{{ scope.row.adGroupName }}</div>
|
|
|
</el-link>
|
|
@@ -91,16 +96,20 @@ watch(queryParams, async () => {
|
|
|
<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 #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">
|
|
|
<DataCompare
|
|
|
- :field="field"
|
|
|
- :value="scope.row[field]"
|
|
|
- :prev-val="scope.row[`prev${field}`]"
|
|
|
- :gap-val="scope.row[`gap${field}`]"
|
|
|
- :date-range="dateRange"
|
|
|
- :show-compare="showCompare"/>
|
|
|
+ :field="field"
|
|
|
+ :value="scope.row[field]"
|
|
|
+ :prev-val="scope.row[`prev${field}`]"
|
|
|
+ :gap-val="scope.row[`gap${field}`]"
|
|
|
+ :date-range="dateRange"
|
|
|
+ :show-compare="showCompare" />
|
|
|
</template>
|
|
|
<template #toolbar-left>
|
|
|
<div class="campare-switch">
|
|
@@ -133,15 +142,19 @@ watch(queryParams, async () => {
|
|
|
-webkit-line-clamp: 1;
|
|
|
-webkit-box-orient: vertical;
|
|
|
}
|
|
|
-::v-deep(.el-table__footer-wrapper td.el-table__cell:nth-child(n+3):nth-child(-n+6) .cell) {
|
|
|
+
|
|
|
+::v-deep(.el-table__footer-wrapper td.el-table__cell:nth-child(n + 3):nth-child(-n + 6) .cell) {
|
|
|
display: none;
|
|
|
}
|
|
|
+
|
|
|
::v-deep(.el-table--border .el-table__footer-wrapper) {
|
|
|
border: none;
|
|
|
}
|
|
|
+
|
|
|
::v-deep(.el-table .el-table__footer-wrapper .cell) {
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
+
|
|
|
.text-range {
|
|
|
color: #808184;
|
|
|
}
|