|
@@ -1,3 +1,68 @@
|
|
|
+<script lang="ts" setup>
|
|
|
+import { Connection, Picture as IconPicture } from '@element-plus/icons-vue'
|
|
|
+import { FsPage, useFs } from '@fast-crud/fast-crud'
|
|
|
+import { storeToRefs } from 'pinia'
|
|
|
+import { nextTick, onMounted, ref, watch } from 'vue'
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
+import { getCardData, getLineData, getLineMonthData, getLineWeekData } from './api'
|
|
|
+import { createCrudOptions } from './crud'
|
|
|
+import DataCompare from '/@/components/dataCompare/index.vue'
|
|
|
+import { usePublicData } from '/@/stores/publicData'
|
|
|
+import { useShopInfo } from '/@/stores/shopInfo'
|
|
|
+import DataTendencyChart from '/@/views/adManage/sd/chartComponents/dataTendency.vue'
|
|
|
+import { SdBaseColumn } from '/@/views/adManage/utils/commonTabColumn'
|
|
|
+
|
|
|
+const tabActiveName = ref('dataTendency')
|
|
|
+const shopInfo = useShopInfo()
|
|
|
+const publicData = usePublicData()
|
|
|
+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 route = useRoute()
|
|
|
+const router = useRouter()
|
|
|
+const adStructChartRef = ref()
|
|
|
+const dataTendencyRef = ref()
|
|
|
+const showCompare = ref(false)
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ crudExpose.doRefresh()
|
|
|
+})
|
|
|
+
|
|
|
+const jumpGroup = (row: any) => {
|
|
|
+ router.push({
|
|
|
+ name: 'CampaignDetail',
|
|
|
+ query: { campaignId: row.campaignId, tagsViewName: row.campaignName },
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const resizeTabChart = () => {
|
|
|
+ if (tabActiveName.value === 'dataTendency') {
|
|
|
+ dataTendencyRef.value.resizeChart()
|
|
|
+ } else if (tabActiveName.value === 'adStruct') {
|
|
|
+ adStructChartRef.value.resizeChart()
|
|
|
+ }
|
|
|
+}
|
|
|
+const changeTab = () => {
|
|
|
+ nextTick(() => {
|
|
|
+ resizeTabChart()
|
|
|
+ })
|
|
|
+}
|
|
|
+defineExpose({ resizeTabChart })
|
|
|
+
|
|
|
+watch(
|
|
|
+ queryParams,
|
|
|
+ async () => {
|
|
|
+ crudExpose.doRefresh()
|
|
|
+ },
|
|
|
+ { deep: true }
|
|
|
+)
|
|
|
+</script>
|
|
|
+
|
|
|
<template>
|
|
|
<fs-page class="fs-page-custom">
|
|
|
<fs-crud ref="crudRef" v-bind="crudBinding">
|
|
@@ -10,8 +75,7 @@
|
|
|
:fetchCard="getCardData"
|
|
|
:fetch-line-month="getLineMonthData"
|
|
|
:fetch-line-week="getLineWeekData"
|
|
|
- :fetchLine="getLineData"
|
|
|
- >
|
|
|
+ :fetchLine="getLineData">
|
|
|
</DataTendencyChart>
|
|
|
</el-tab-pane>
|
|
|
<!-- <el-tab-pane label="广告结构" name="adStruct">
|
|
@@ -21,26 +85,47 @@
|
|
|
</el-tabs>
|
|
|
</template>
|
|
|
|
|
|
- <template #cell_commodity="scope">
|
|
|
- <el-tooltip effect="dark" placement="top">
|
|
|
- <template #content>
|
|
|
- <p>{{ scope.row.campaignName }}</p>
|
|
|
- <p>ASIN: {{ scope.row.promotedAsin }}</p>
|
|
|
- SKU: {{ scope.row.promotedSku }}
|
|
|
- </template>
|
|
|
- <div>
|
|
|
- <el-link :underline="false" class="ellipsis-inline" style="color: rgb(29, 35, 43); display: inline-block; font-weight: 450;">
|
|
|
- {{ scope.row.campaignName ? scope.row.campaignName : '--' }}
|
|
|
- </el-link>
|
|
|
- <br>
|
|
|
- <span class="ellipsis">
|
|
|
- <span style="color: rgb(109, 119, 132)">ASIN: </span>
|
|
|
- <span style="color: rgb(30, 33, 40)">{{ scope.row.promotedAsin }}</span>
|
|
|
- <span style="color: rgb(109, 119, 132); margin-left: 10px;">SKU: </span>
|
|
|
- <span style="color: rgb(30, 33, 40)">{{ scope.row.promotedSku }}</span>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </el-tooltip>
|
|
|
+ <template #cell_commodity="{ row }">
|
|
|
+ <div style="display: flex">
|
|
|
+ <img class="img-part" v-if="row.image" :src="row.image" />
|
|
|
+ <el-image v-else class="img-part">
|
|
|
+ <template #error>
|
|
|
+ <div class="image-slot">
|
|
|
+ <el-icon><icon-picture /></el-icon>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-image>
|
|
|
+ <el-tooltip effect="dark" placement="top">
|
|
|
+ <template #content>
|
|
|
+ <p>{{ row.itemName }}</p>
|
|
|
+ </template>
|
|
|
+ <div>
|
|
|
+ <div class="list-item-title">
|
|
|
+ {{ row.itemName ? row.itemName : '--' }}
|
|
|
+ </div>
|
|
|
+ <span>
|
|
|
+ <div class="list-item-label">
|
|
|
+ ASIN:
|
|
|
+ <span class="list-item-value">{{ row.promotedAsin }}</span>
|
|
|
+ <span>
|
|
|
+ <el-link
|
|
|
+ :href="row.amazon_url"
|
|
|
+ target="_blank"
|
|
|
+ :disabled="!row.amazon_url"
|
|
|
+ :underline="false"
|
|
|
+ :icon="Connection"
|
|
|
+ :style="{ marginLeft: '8px', color: row.amazon_url ? '#3a83f7' : '#c0c4cc' }">
|
|
|
+ </el-link>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="list-item-label">
|
|
|
+ SKU:
|
|
|
+ <span class="list-item-value">{{ row.promotedSku ? row.promotedSku : '--' }}</span>
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<template #cell_percentTimeInBudget="scope">
|
|
@@ -49,7 +134,7 @@
|
|
|
<template #cell_campaignName="scope">
|
|
|
<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>
|
|
|
+ <div class="en-text">{{ scope.row.campaignName ? scope.row.campaignName : '--' }}</div>
|
|
|
</el-link>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
@@ -62,9 +147,7 @@
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
|
|
|
- <template #cell_MissedImpressions="scope">
|
|
|
- {{ scope.row.MissedImpressionsLower ?? '0' }} ~ {{ scope.row.MissedImpressionsUpper ?? '0' }}
|
|
|
- </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>
|
|
|
|
|
@@ -75,8 +158,7 @@
|
|
|
:prev-val="scope.row[`prev${field}`]"
|
|
|
:gap-val="scope.row[`gap${field}`]"
|
|
|
:date-range="dateRange"
|
|
|
- :show-compare="showCompare"
|
|
|
- />
|
|
|
+ :show-compare="showCompare" />
|
|
|
</template>
|
|
|
<template #toolbar-left>
|
|
|
<div class="campare-switch">
|
|
@@ -88,72 +170,6 @@
|
|
|
</fs-page>
|
|
|
</template>
|
|
|
|
|
|
-<script lang="ts" setup>
|
|
|
-import { nextTick, onMounted, ref, watch } from 'vue'
|
|
|
-import { FsPage, useFs } from '@fast-crud/fast-crud'
|
|
|
-import { createCrudOptions } from './crud'
|
|
|
-import { useRoute, useRouter } from 'vue-router'
|
|
|
-import DataTendencyChart from '/@/views/adManage/sd/chartComponents/dataTendency.vue'
|
|
|
-import { useShopInfo } from '/@/stores/shopInfo'
|
|
|
-import { usePublicData } from '/@/stores/publicData'
|
|
|
-import AdStructChart from './chartComponents/adStruct.vue'
|
|
|
-import { getCardData, getLineData, getLineMonthData, getLineWeekData } from './api'
|
|
|
-import { storeToRefs } from 'pinia'
|
|
|
-import { SdBaseColumn } from '/@/views/adManage/utils/commonTabColumn'
|
|
|
-import DataCompare from '/@/components/dataCompare/index.vue'
|
|
|
-import { sdTypeMap, sdtargetMap } from '/@/views/adManage/utils/enum'
|
|
|
-
|
|
|
-const tabActiveName = ref('dataTendency')
|
|
|
-const shopInfo = useShopInfo()
|
|
|
-const publicData = usePublicData()
|
|
|
-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 route = useRoute()
|
|
|
-const router = useRouter()
|
|
|
-const adStructChartRef = ref()
|
|
|
-const dataTendencyRef = ref()
|
|
|
-const showCompare = ref(false)
|
|
|
-
|
|
|
-onMounted(() => {
|
|
|
- crudExpose.doRefresh()
|
|
|
-})
|
|
|
-
|
|
|
-const jumpGroup = (row: any) => {
|
|
|
- router.push({
|
|
|
- name: 'CampaignDetail',
|
|
|
- query: { campaignId: row.campaignId, tagsViewName: row.campaignName },
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-const resizeTabChart = () => {
|
|
|
- if (tabActiveName.value === 'dataTendency') {
|
|
|
- dataTendencyRef.value.resizeChart()
|
|
|
- } else if (tabActiveName.value === 'adStruct') {
|
|
|
- adStructChartRef.value.resizeChart()
|
|
|
- }
|
|
|
-}
|
|
|
-const changeTab = () => {
|
|
|
- nextTick(() => {
|
|
|
- resizeTabChart()
|
|
|
- })
|
|
|
-}
|
|
|
-defineExpose({ resizeTabChart })
|
|
|
-
|
|
|
-watch(
|
|
|
- queryParams,
|
|
|
- async () => {
|
|
|
- crudExpose.doRefresh()
|
|
|
- },
|
|
|
- { deep: true }
|
|
|
-)
|
|
|
-</script>
|
|
|
-
|
|
|
<style lang="scss" scoped>
|
|
|
.campare-switch {
|
|
|
flex: none;
|
|
@@ -219,4 +235,39 @@ watch(
|
|
|
text-overflow: ellipsis;
|
|
|
display: inline;
|
|
|
}
|
|
|
+
|
|
|
+.list-item-title {
|
|
|
+ color: #000;
|
|
|
+ font-weight: 500;
|
|
|
+ overflow: hidden;
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ -webkit-line-clamp: 1;
|
|
|
+}
|
|
|
+.img-part {
|
|
|
+ min-width: 65px;
|
|
|
+ height: 65px;
|
|
|
+ margin: 0 5px 0 0;
|
|
|
+ border: 1px solid #e5e6eb;
|
|
|
+ border-radius: 4px;
|
|
|
+}
|
|
|
+.image-slot {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ width: 65px;
|
|
|
+ height: 65px;
|
|
|
+ background: var(--el-fill-color-light);
|
|
|
+ color: var(--el-text-color-secondary);
|
|
|
+ font-size: 30px;
|
|
|
+}
|
|
|
+.image-slot .el-icon {
|
|
|
+ font-size: 30px;
|
|
|
+}
|
|
|
+.list-item-label {
|
|
|
+ color: rgb(109, 119, 132);
|
|
|
+}
|
|
|
+.list-item-value {
|
|
|
+ color: rgb(30, 33, 40);
|
|
|
+}
|
|
|
</style>
|