浏览代码

something updated

WanGxC 9 月之前
父节点
当前提交
5c48c67d8e
共有 2 个文件被更改,包括 29 次插入17 次删除
  1. 1 1
      .env.development
  2. 28 16
      src/views/searchTerm/targetingSearchTerm/index.vue

+ 1 - 1
.env.development

@@ -5,7 +5,7 @@ ENV = 'development'
 # 本地环境接口地址
 # VITE_API_URL = 'http://127.0.0.1:8000'
 # VITE_API_URL = 'http://192.168.1.225/'
- VITE_API_URL = 'http://192.168.1.23:8080/'
+ VITE_API_URL = 'http://192.168.1.11:8080/'
 # VITE_API_URL = 'http://amzads.zositechc.cn'
 
 # 是否启用按钮权限

+ 28 - 16
src/views/searchTerm/targetingSearchTerm/index.vue

@@ -4,6 +4,7 @@
  * @Description: Targeting-SearchTerm 跳转页面
  * @Author: Cheney
  */
+
 import { useRoute } from 'vue-router';
 import { targetingColumns, searchTermColumns } from './useColumns';
 import { reactive, ref, onBeforeMount } from 'vue';
@@ -17,7 +18,9 @@ const { dateRange } = storeToRefs(publicData);
 const route = useRoute();
 const { searchRoot } = route.query;
 const date = ref([dateRange.value[0], dateRange.value[1]]);
-const searchType = ref('AUTO');
+const searchType = ref('BROAD');
+const targetingSearchRoot = ref('');
+const searchTermSearchRoot = ref('');
 
 const TargetingLoading = ref(false);
 const searchTermLoading = ref(false);
@@ -102,7 +105,7 @@ async function fetchTargetingData() {
     date_end: date.value[1],
     page: targetingPage.currentPage,
     limit: targetingPage.pageSize,
-    search_root: searchRoot,
+    search_root: targetingSearchRoot.value ? targetingSearchRoot.value : searchRoot,
     search_type: searchType.value, // BROAD, PHRASE, EXACT, AUTO
     term_type: 'TARGETING', // TARGETING, SEARCHTERM
   };
@@ -125,7 +128,7 @@ async function fetchSearchTermData() {
     date_end: date.value[1],
     page: targetingPage.currentPage,
     limit: targetingPage.pageSize,
-    search_root: searchRoot,
+    search_root: searchTermSearchRoot.value ? searchTermSearchRoot.value : searchRoot,
     search_type: searchType.value,
     term_type: 'SEARCHTERM',
   };
@@ -142,6 +145,16 @@ async function fetchSearchTermData() {
 </script>
 
 <template>
+  <div class="mx-3">
+    <el-divider>
+      <div class="font-bold text-xl">
+        <!--<el-icon style="top: 3px">-->
+        <!--  <DataAnalysis />-->
+        <!--</el-icon>-->
+        {{ searchRoot }}
+      </div>
+    </el-divider>
+  </div>
   <div class="py-2 px-2.5">
     <el-card shadow="hover" style="border: none" body-class="flex justify-between">
       <div class="flex flex-wrap gap-7">
@@ -173,6 +186,7 @@ async function fetchSearchTermData() {
         <vxe-grid v-bind="targetingOptions">
           <template #toolbar_buttons>
             <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>
           </template>
           <template v-for="col in targetingColumns" #[`${col.field}_default`]="{ row }">
             <div v-if="col.field === 'targeting'">
@@ -183,14 +197,10 @@ async function fetchSearchTermData() {
               </el-tooltip>
             </div>
             <div v-else-if="col.field === 'ctr_1d'">
-              <span class="font-medium">
-                {{ row.ctr_1d }}%
-              </span>
+              <span class="font-medium"> {{ row.ctr_1d }}% </span>
             </div>
             <div v-else-if="col.field === 'cr_1d'">
-              <span class="font-medium">
-                {{ row.cr_1d }}%
-              </span>
+              <span class="font-medium"> {{ row.cr_1d }}% </span>
             </div>
             <div v-else class="font-medium">
               {{ row[col.field] ? row[col.field] : '--' }}
@@ -213,6 +223,7 @@ async function fetchSearchTermData() {
         <vxe-grid v-bind="searchTermOptions">
           <template #toolbar_buttons>
             <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>
           </template>
           <template v-for="col in searchTermColumns" #[`${col.field}_default`]="{ row }">
             <div v-if="col.field === 'searchTerm'">
@@ -223,14 +234,10 @@ async function fetchSearchTermData() {
               </el-tooltip>
             </div>
             <div v-else-if="col.field === 'ctr_1d'">
-              <span class="font-medium">
-                {{ row.ctr_1d }}%
-              </span>
+              <span class="font-medium"> {{ row.ctr_1d }}% </span>
             </div>
             <div v-else-if="col.field === 'cr_1d'">
-              <span class="font-medium">
-                {{ row.cr_1d }}%
-              </span>
+              <span class="font-medium"> {{ row.cr_1d }}% </span>
             </div>
             <div v-else class="font-medium">
               {{ row[col.field] ? row[col.field] : '--' }}
@@ -251,4 +258,9 @@ async function fetchSearchTermData() {
   </div>
 </template>
 
-<style scoped></style>
+<style scoped>
+/* 修改 el-divider 的背景颜色 */
+:deep(.el-divider__text.is-center.el-divider__text) {
+  background-color: #f8f8f8;
+}
+</style>