|
@@ -1,4 +1,4 @@
|
|
-<script setup lang="ts">
|
|
|
|
|
|
+<script lang="ts" setup>
|
|
/**
|
|
/**
|
|
* @Name: index.vue
|
|
* @Name: index.vue
|
|
* @Description: Targeting-SearchTerm 跳转页面
|
|
* @Description: Targeting-SearchTerm 跳转页面
|
|
@@ -6,18 +6,19 @@
|
|
*/
|
|
*/
|
|
|
|
|
|
import { useRoute } from 'vue-router';
|
|
import { useRoute } from 'vue-router';
|
|
-import { targetingColumns, searchTermColumns } from './useColumns';
|
|
|
|
-import { reactive, ref, onBeforeMount } from 'vue';
|
|
|
|
|
|
+import { searchTermColumns, targetingColumns } from './useColumns';
|
|
|
|
+import { onBeforeMount, reactive, ref } from 'vue';
|
|
import { storeToRefs } from 'pinia';
|
|
import { storeToRefs } from 'pinia';
|
|
import { usePublicData } from '/@/stores/publicData';
|
|
import { usePublicData } from '/@/stores/publicData';
|
|
import * as api from './api';
|
|
import * as api from './api';
|
|
import { debounce } from 'lodash';
|
|
import { debounce } from 'lodash';
|
|
|
|
|
|
|
|
+
|
|
const publicData = usePublicData();
|
|
const publicData = usePublicData();
|
|
const { dateRange } = storeToRefs(publicData);
|
|
const { dateRange } = storeToRefs(publicData);
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
const { searchRoot } = route.query;
|
|
const { searchRoot } = route.query;
|
|
-const date = ref([dateRange.value[0], dateRange.value[1]]);
|
|
|
|
|
|
+const date = ref([ dateRange.value[0], dateRange.value[1] ]);
|
|
const searchType = ref('BROAD');
|
|
const searchType = ref('BROAD');
|
|
const targetingSearchRoot = ref('');
|
|
const targetingSearchRoot = ref('');
|
|
const searchTermSearchRoot = ref('');
|
|
const searchTermSearchRoot = ref('');
|
|
@@ -29,21 +30,21 @@ const targetingOptions: any = reactive({
|
|
border: false,
|
|
border: false,
|
|
round: true,
|
|
round: true,
|
|
columnConfig: {
|
|
columnConfig: {
|
|
- resizable: true,
|
|
|
|
|
|
+ resizable: true
|
|
},
|
|
},
|
|
toolbarConfig: {
|
|
toolbarConfig: {
|
|
custom: true,
|
|
custom: true,
|
|
slots: {
|
|
slots: {
|
|
- buttons: 'toolbar_buttons',
|
|
|
|
- },
|
|
|
|
|
|
+ buttons: 'toolbar_buttons'
|
|
|
|
+ }
|
|
},
|
|
},
|
|
columns: targetingColumns,
|
|
columns: targetingColumns,
|
|
- data: [],
|
|
|
|
|
|
+ data: []
|
|
});
|
|
});
|
|
const targetingPage = reactive({
|
|
const targetingPage = reactive({
|
|
total: 0,
|
|
total: 0,
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
- pageSize: 15,
|
|
|
|
|
|
+ pageSize: 15
|
|
});
|
|
});
|
|
|
|
|
|
const searchTermOptions: any = reactive({
|
|
const searchTermOptions: any = reactive({
|
|
@@ -51,21 +52,21 @@ const searchTermOptions: any = reactive({
|
|
border: false,
|
|
border: false,
|
|
round: true,
|
|
round: true,
|
|
columnConfig: {
|
|
columnConfig: {
|
|
- resizable: true,
|
|
|
|
|
|
+ resizable: true
|
|
},
|
|
},
|
|
toolbarConfig: {
|
|
toolbarConfig: {
|
|
custom: true,
|
|
custom: true,
|
|
slots: {
|
|
slots: {
|
|
- buttons: 'toolbar_buttons',
|
|
|
|
- },
|
|
|
|
|
|
+ buttons: 'toolbar_buttons'
|
|
|
|
+ }
|
|
},
|
|
},
|
|
columns: searchTermColumns,
|
|
columns: searchTermColumns,
|
|
- data: [],
|
|
|
|
|
|
+ data: []
|
|
});
|
|
});
|
|
const searchTermPage = reactive({
|
|
const searchTermPage = reactive({
|
|
total: 0,
|
|
total: 0,
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
- pageSize: 15,
|
|
|
|
|
|
+ pageSize: 15
|
|
});
|
|
});
|
|
|
|
|
|
onBeforeMount(() => {
|
|
onBeforeMount(() => {
|
|
@@ -85,17 +86,17 @@ function searchTermPageChange({ currentPage, pageSize }) {
|
|
}
|
|
}
|
|
|
|
|
|
const fetchTableData = debounce(
|
|
const fetchTableData = debounce(
|
|
- () => {
|
|
|
|
- targetingPage.currentPage = 1;
|
|
|
|
- targetingPage.pageSize = 15;
|
|
|
|
- searchTermPage.currentPage = 1;
|
|
|
|
- searchTermPage.pageSize = 15;
|
|
|
|
- fetchTargetingData();
|
|
|
|
- fetchSearchTermData();
|
|
|
|
- },
|
|
|
|
- 500,
|
|
|
|
- { leading: true, trailing: false }
|
|
|
|
-); // 首次调用立即执行,500毫秒内的后续调用不生效
|
|
|
|
|
|
+ () => {
|
|
|
|
+ targetingPage.currentPage = 1;
|
|
|
|
+ targetingPage.pageSize = 15;
|
|
|
|
+ searchTermPage.currentPage = 1;
|
|
|
|
+ searchTermPage.pageSize = 15;
|
|
|
|
+ fetchTargetingData();
|
|
|
|
+ fetchSearchTermData();
|
|
|
|
+ },
|
|
|
|
+ 500,
|
|
|
|
+ { leading: true, trailing: false } // 首次调用立即执行,500毫秒内的后续调用不生效
|
|
|
|
+);
|
|
|
|
|
|
async function fetchTargetingData() {
|
|
async function fetchTargetingData() {
|
|
TargetingLoading.value = true;
|
|
TargetingLoading.value = true;
|
|
@@ -107,7 +108,7 @@ async function fetchTargetingData() {
|
|
limit: targetingPage.pageSize,
|
|
limit: targetingPage.pageSize,
|
|
search_root: targetingSearchRoot.value ? targetingSearchRoot.value : searchRoot,
|
|
search_root: targetingSearchRoot.value ? targetingSearchRoot.value : searchRoot,
|
|
search_type: searchType.value, // BROAD, PHRASE, EXACT, AUTO
|
|
search_type: searchType.value, // BROAD, PHRASE, EXACT, AUTO
|
|
- term_type: 'TARGETING', // TARGETING, SEARCHTERM
|
|
|
|
|
|
+ term_type: 'TARGETING' // TARGETING, SEARCHTERM
|
|
};
|
|
};
|
|
try {
|
|
try {
|
|
const response = await api.getTargetingData(query);
|
|
const response = await api.getTargetingData(query);
|
|
@@ -130,7 +131,7 @@ async function fetchSearchTermData() {
|
|
limit: targetingPage.pageSize,
|
|
limit: targetingPage.pageSize,
|
|
search_root: searchTermSearchRoot.value ? searchTermSearchRoot.value : searchRoot,
|
|
search_root: searchTermSearchRoot.value ? searchTermSearchRoot.value : searchRoot,
|
|
search_type: searchType.value,
|
|
search_type: searchType.value,
|
|
- term_type: 'SEARCHTERM',
|
|
|
|
|
|
+ term_type: 'SEARCHTERM'
|
|
};
|
|
};
|
|
try {
|
|
try {
|
|
const response = await api.getTargetingData(query);
|
|
const response = await api.getTargetingData(query);
|
|
@@ -156,7 +157,7 @@ async function fetchSearchTermData() {
|
|
</el-divider>
|
|
</el-divider>
|
|
</div>
|
|
</div>
|
|
<div class="py-2 px-2.5">
|
|
<div class="py-2 px-2.5">
|
|
- <el-card shadow="hover" style="border: none" body-class="flex justify-between">
|
|
|
|
|
|
+ <el-card body-class="flex justify-between" shadow="hover" style="border: none">
|
|
<div class="flex flex-wrap gap-7">
|
|
<div class="flex flex-wrap gap-7">
|
|
<div>
|
|
<div>
|
|
<span class="font-medium mr-0.5">搜索词类型 </span>
|
|
<span class="font-medium mr-0.5">搜索词类型 </span>
|
|
@@ -170,27 +171,28 @@ async function fetchSearchTermData() {
|
|
<div>
|
|
<div>
|
|
<span class="font-medium mr-0.5">日期 </span>
|
|
<span class="font-medium mr-0.5">日期 </span>
|
|
<el-date-picker
|
|
<el-date-picker
|
|
- v-model="date"
|
|
|
|
- type="daterange"
|
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
|
- range-separator="To"
|
|
|
|
- :disabled-date="(time: Date) => time > new Date()"
|
|
|
|
- :popper-options="{ placement: 'bottom-end' }"
|
|
|
|
- :clearable="false" />
|
|
|
|
|
|
+ v-model="date"
|
|
|
|
+ :clearable="false"
|
|
|
|
+ :disabled-date="(time: Date) => time > new Date()"
|
|
|
|
+ :popper-options="{ placement: 'bottom-end' }"
|
|
|
|
+ range-separator="To"
|
|
|
|
+ type="daterange"
|
|
|
|
+ value-format="YYYY-MM-DD"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <el-button type="primary" plain @click="fetchTableData" icon="search">查询</el-button>
|
|
|
|
|
|
+ <el-button icon="search" plain type="primary" @click="fetchTableData">查询</el-button>
|
|
</el-card>
|
|
</el-card>
|
|
- <el-card shadow="hover" class="mt-3" style="border: none" body-style="padding-top: 10px">
|
|
|
|
- <div class="w-full overflow-hidden" style="height: 950px" v-loading="TargetingLoading">
|
|
|
|
|
|
+ <el-card body-style="padding-top: 10px" class="mt-3" shadow="hover" style="border: none">
|
|
|
|
+ <div v-loading="TargetingLoading" class="w-full overflow-hidden" style="height: 950px">
|
|
<vxe-grid v-bind="targetingOptions">
|
|
<vxe-grid v-bind="targetingOptions">
|
|
<template #toolbar_buttons>
|
|
<template #toolbar_buttons>
|
|
<span class="font-medium text-xl" style="color: #000000"> Targeting-关联关键词 </span>
|
|
<span class="font-medium text-xl" style="color: #000000"> Targeting-关联关键词 </span>
|
|
- <el-input v-model="targetingSearchRoot" placeholder="请输入关键词回车搜索" @change="fetchTargetingData" class="ml-5" style="width: 200px;"></el-input>
|
|
|
|
|
|
+ <el-input v-model="targetingSearchRoot" class="ml-5" placeholder="请输入关键词回车搜索" style="width: 200px;"
|
|
|
|
+ @change="fetchTargetingData"></el-input>
|
|
</template>
|
|
</template>
|
|
<template v-for="col in targetingColumns" #[`${col.field}_default`]="{ row }">
|
|
<template v-for="col in targetingColumns" #[`${col.field}_default`]="{ row }">
|
|
<div v-if="col.field === 'targeting'">
|
|
<div v-if="col.field === 'targeting'">
|
|
- <el-tooltip effect="dark" :content="row.targeting" placement="top" :show-after="300">
|
|
|
|
|
|
+ <el-tooltip :content="row.targeting" :show-after="300" effect="dark" placement="top">
|
|
<div class="font-medium overflow-hidden whitespace-nowrap text-ellipsis">
|
|
<div class="font-medium overflow-hidden whitespace-nowrap text-ellipsis">
|
|
{{ row.targeting }}
|
|
{{ row.targeting }}
|
|
</div>
|
|
</div>
|
|
@@ -208,26 +210,27 @@ async function fetchSearchTermData() {
|
|
</template>
|
|
</template>
|
|
<template #pager>
|
|
<template #pager>
|
|
<vxe-pager
|
|
<vxe-pager
|
|
- :layouts="['Sizes', 'PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'FullJump', 'Total']"
|
|
|
|
- v-model:current-page="targetingPage.currentPage"
|
|
|
|
- v-model:page-size="targetingPage.pageSize"
|
|
|
|
- :total="targetingPage.total"
|
|
|
|
- @page-change="targetingPageChange">
|
|
|
|
|
|
+ v-model:current-page="targetingPage.currentPage"
|
|
|
|
+ v-model:page-size="targetingPage.pageSize"
|
|
|
|
+ :layouts="['Sizes', 'PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'FullJump', 'Total']"
|
|
|
|
+ :total="targetingPage.total"
|
|
|
|
+ @page-change="targetingPageChange">
|
|
</vxe-pager>
|
|
</vxe-pager>
|
|
</template>
|
|
</template>
|
|
</vxe-grid>
|
|
</vxe-grid>
|
|
</div>
|
|
</div>
|
|
</el-card>
|
|
</el-card>
|
|
- <el-card shadow="hover" class="mt-3" style="border: none" body-style="padding-top: 10px">
|
|
|
|
- <div class="w-full overflow-hidden" style="height: 950px" v-loading="searchTermLoading">
|
|
|
|
|
|
+ <el-card body-style="padding-top: 10px" class="mt-3" shadow="hover" style="border: none">
|
|
|
|
+ <div v-loading="searchTermLoading" class="w-full overflow-hidden" style="height: 950px">
|
|
<vxe-grid v-bind="searchTermOptions">
|
|
<vxe-grid v-bind="searchTermOptions">
|
|
<template #toolbar_buttons>
|
|
<template #toolbar_buttons>
|
|
<span class="font-medium text-xl" style="color: #000000"> SearchTerm-相关搜索结果 </span>
|
|
<span class="font-medium text-xl" style="color: #000000"> SearchTerm-相关搜索结果 </span>
|
|
- <el-input v-model="searchTermSearchRoot" placeholder="请输入搜索词回车搜索" @change="fetchTargetingData" class="ml-5" style="width: 200px;"></el-input>
|
|
|
|
|
|
+ <el-input v-model="searchTermSearchRoot" class="ml-5" placeholder="请输入搜索词回车搜索" style="width: 200px;"
|
|
|
|
+ @change="fetchTargetingData"></el-input>
|
|
</template>
|
|
</template>
|
|
<template v-for="col in searchTermColumns" #[`${col.field}_default`]="{ row }">
|
|
<template v-for="col in searchTermColumns" #[`${col.field}_default`]="{ row }">
|
|
<div v-if="col.field === 'searchTerm'">
|
|
<div v-if="col.field === 'searchTerm'">
|
|
- <el-tooltip effect="dark" :content="row.searchTerm" placement="top" :show-after="300">
|
|
|
|
|
|
+ <el-tooltip :content="row.searchTerm" :show-after="300" effect="dark" placement="top">
|
|
<div class="font-medium overflow-hidden whitespace-nowrap text-ellipsis">
|
|
<div class="font-medium overflow-hidden whitespace-nowrap text-ellipsis">
|
|
{{ row.searchTerm }}
|
|
{{ row.searchTerm }}
|
|
</div>
|
|
</div>
|
|
@@ -245,11 +248,11 @@ async function fetchSearchTermData() {
|
|
</template>
|
|
</template>
|
|
<template #pager>
|
|
<template #pager>
|
|
<vxe-pager
|
|
<vxe-pager
|
|
- :layouts="['Sizes', 'PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'FullJump', 'Total']"
|
|
|
|
- v-model:current-page="searchTermPage.currentPage"
|
|
|
|
- v-model:page-size="searchTermPage.pageSize"
|
|
|
|
- :total="searchTermPage.total"
|
|
|
|
- @page-change="searchTermPageChange">
|
|
|
|
|
|
+ v-model:current-page="searchTermPage.currentPage"
|
|
|
|
+ v-model:page-size="searchTermPage.pageSize"
|
|
|
|
+ :layouts="['Sizes', 'PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'FullJump', 'Total']"
|
|
|
|
+ :total="searchTermPage.total"
|
|
|
|
+ @page-change="searchTermPageChange">
|
|
</vxe-pager>
|
|
</vxe-pager>
|
|
</template>
|
|
</template>
|
|
</vxe-grid>
|
|
</vxe-grid>
|