|
@@ -63,7 +63,7 @@
|
|
|
<a-col :span="16">
|
|
|
<a-row class="r2">
|
|
|
<a-col :span="24">
|
|
|
- <p class="t3 company-name">{{ customerStats.isDemo === 1 ? '*' : customerStats.descriptiveName }}</p>
|
|
|
+ <p class="t3 company-name">{{ displayCompanyName }}</p>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
<a-row class="r2">
|
|
@@ -206,7 +206,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="marketing-googleads">
|
|
|
-import { ref, reactive } from 'vue';
|
|
|
+import { ref, reactive, computed } from 'vue';
|
|
|
import dayjs from 'dayjs';
|
|
|
import selectSite from '@/components/Adweb/selectSite.vue';
|
|
|
import LineChart from './charts/Line.vue';
|
|
@@ -250,17 +250,20 @@ const chartDetailDataCol = ref([
|
|
|
},
|
|
|
]);
|
|
|
|
|
|
+// Add isDemo ref
|
|
|
+const isDemo = ref(localStorage.getItem('siteIsDemo') === '1');
|
|
|
+
|
|
|
+// Update the changeSite function
|
|
|
const changeSite = (selectedSiteInfo: any) => {
|
|
|
queryParam.siteCode = selectedSiteInfo.code;
|
|
|
localStorage.setItem('siteCode', queryParam.siteCode);
|
|
|
+ isDemo.value = localStorage.getItem('siteIsDemo') === '1';
|
|
|
reloadData();
|
|
|
};
|
|
|
|
|
|
const onChangeDatePicker = (date, dateString) => {
|
|
|
if (dateString.length > 0) {
|
|
|
- console.log('rangeDate:', rangeDate.value);
|
|
|
rangeDate.value = date;
|
|
|
- console.log('date:', date);
|
|
|
queryParam.start = dateString[0];
|
|
|
queryParam.end = dateString[1];
|
|
|
queryParam.dateType = undefined;
|
|
@@ -480,7 +483,14 @@ const customerStats = ref({
|
|
|
cost: '-',
|
|
|
conversions: '-',
|
|
|
optiScore: 0,
|
|
|
- isDemo: 0
|
|
|
+});
|
|
|
+
|
|
|
+// Add computed property for company name
|
|
|
+const displayCompanyName = computed(() => {
|
|
|
+ if (isDemo.value && customerStats.value.descriptiveName) {
|
|
|
+ return customerStats.value.descriptiveName.replace(/./g, '*');
|
|
|
+ }
|
|
|
+ return customerStats.value.descriptiveName;
|
|
|
});
|
|
|
|
|
|
// 添加格式化数字的函数
|
|
@@ -515,7 +525,6 @@ const getCustomerStats = async () => {
|
|
|
cost: stats.cost ? formatNumber(stats.cost) : '-',
|
|
|
conversions: stats.conversions ? formatNumber(stats.conversions) : '-',
|
|
|
optiScore: stats.optiScore ? stats.optiScore * 100 : 0,
|
|
|
- isDemo: stats.isDemo ?? 0
|
|
|
};
|
|
|
} catch (error) {
|
|
|
console.error('获取客户统计数据失败:', error);
|
|
@@ -678,14 +687,6 @@ const exportToPDF = () => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-// onMounted(() => {
|
|
|
-// getCustomerStats();
|
|
|
-// getDailyStats();
|
|
|
-// getCampaignStats();
|
|
|
-// getKeywordStats();
|
|
|
-// getPlacementStats();
|
|
|
-// getCountryStats();
|
|
|
-// });
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less">
|