Kaynağa Gözat

SEO管理关键词管理重构

zq940222 5 ay önce
ebeveyn
işleme
e8e543518e

+ 196 - 247
src/views/adweb/keywords/SeoKeywords.data.ts

@@ -1,302 +1,251 @@
-import {BasicColumn} from '/@/components/Table';
-import {FormSchema} from '/@/components/Table';
-import { rules} from '/@/utils/helper/validator';
-import { render } from '/@/utils/common/renderUtils';
-import { getWeekMonthQuarterYear } from '/@/utils';
+import { BasicColumn } from "/@/components/Table";
+import { FormSchema } from "/@/components/Table";
+import { rules } from "/@/utils/helper/validator";
+import { render } from "/@/utils/common/renderUtils";
+import { getWeekMonthQuarterYear } from "/@/utils";
 //列表数据
 export const columns: BasicColumn[] = [
-   {
-    title: '平台标识',
-    align:"center",
-    dataIndex: 'appKey'
-   },
-   {
-    title: '用户标识',
-    align:"center",
-    dataIndex: 'siteCode'
-   },
-   {
-    title: '关键词',
-    align:"center",
-    dataIndex: 'keywords'
-   },
-   {
-    title: '关键词所属域名',
-    align:"center",
-    dataIndex: 'domain'
-   },
-   {
-    title: '语种',
-    align:"center",
-    dataIndex: 'lang'
-   },
-   {
-    title: '最新搜索时间',
-    align:"center",
-    dataIndex: 'lastSearchTime'
-   },
-   {
-    title: '定时器的最新搜索时间',
-    align:"center",
-    dataIndex: 'timerLastSearchTime'
-   },
-   {
-    title: '0删除,1有效,2过期',
-    align:"center",
-    dataIndex: 'status'
-   },
-   {
-    title: '数据复制源ID',
-    align:"center",
-    dataIndex: 'sourceId'
-   },
-   {
-    title: '关键词优先级(1:高;2:中;3:低)',
-    align:"center",
-    dataIndex: 'priority'
-   },
-   {
-    title: 'SEO关键词优化完成时间',
-    align:"center",
-    dataIndex: 'finishTime'
-   },
-   {
-    title: '优化进度(默认0)',
-    align:"center",
-    dataIndex: 'optimizeProcess'
-   },
-   {
-    title: '优化状态(0:未完成;1:已完成)',
-    align:"center",
-    dataIndex: 'optimizeStatus'
-   },
-   {
-    title: '关键词类型(1:指定;2:长尾)',
-    align:"center",
-    dataIndex: 'keywordType'
-   },
-   {
-    title: '最近一次搜索排名',
-    align:"center",
-    dataIndex: 'lastRank'
-   },
-   {
-    title: '搜索状态,0为普通状态,1为搜索进行中状态',
-    align:"center",
-    dataIndex: 'searchStatus'
-   },
-   {
-    title: '关键词所在URL',
-    align:"center",
-    dataIndex: 'positionUrl'
-   },
-   {
-    title: '相关关键词关联的关键词的id',
-    align:"center",
-    dataIndex: 'relatedKeywordId'
-   },
-   {
-    title: '关键词对应套餐的ID',
-    align:"center",
-    dataIndex: 'planId'
-   },
-   {
-    title: '订购表ID',
-    align:"center",
-    dataIndex: 'subscriptionId'
-   },
-   {
-    title: '网站表ID',
-    align:"center",
-    dataIndex: 'siteId'
-   },
-];
-//查询数据
-export const searchFormSchema: FormSchema[] = [
-];
-//表单数据
-export const formSchema: FormSchema[] = [
   {
-    label: '平台标识',
-    field: 'appKey',
-    component: 'Input',
-    dynamicRules: ({model,schema}) => {
-          return [
-                 { required: true, message: '请输入平台标识!'},
-          ];
-     },
+    title: "关键词",
+    align: "center",
+    dataIndex: "keywords"
+  },
+  {
+    title: "关键词所在URL",
+    align: "center",
+    dataIndex: "positionUrl",
+  },
+  {
+    title: "关键词类型",
+    align: "center",
+    dataIndex: "keywordType"
   },
   {
-    label: '用户标识',
-    field: 'siteCode',
-    component: 'Input',
-    dynamicRules: ({model,schema}) => {
-          return [
-                 { required: true, message: '请输入用户标识!'},
-          ];
-     },
+    title: '添加时间',
+    align: 'left',
+    dataIndex: 'createTime',
+    sorter: true,
   },
   {
-    label: '关键词',
-    field: 'keywords',
-    component: 'Input',
-    dynamicRules: ({model,schema}) => {
-          return [
-                 { required: true, message: '请输入关键词!'},
-          ];
-     },
+    title: '最新排名日期',
+    align: 'left',
+    dataIndex: 'lastSearchTime',
+    sorter: true,
   },
   {
-    label: '关键词所属域名',
-    field: 'domain',
-    component: 'Input',
-    dynamicRules: ({model,schema}) => {
-          return [
-                 { required: true, message: '请输入关键词所属域名!'},
-          ];
-     },
+    title: '查询日期(定时任务)',
+    align: 'left',
+    dataIndex: 'timerLastSearchTime',
   },
+
   {
-    label: '语种',
-    field: 'lang',
-    component: 'Input',
+    title: '最新排名',
+    align: 'left',
+    dataIndex: 'lastRank',
+    sorter: true,
   },
+];
+//查询数据
+export const searchFormSchema: FormSchema[] = [];
+//表单数据
+export const formSchema: FormSchema[] = [
   {
-    label: '最新搜索时间',
-    field: 'lastSearchTime',
-    component: 'DatePicker',
+    label: "平台标识",
+    field: "appKey",
+    component: "Input",
+    dynamicRules: ({ model, schema }) => {
+      return [
+        { required: true, message: "请输入平台标识!" }
+      ];
+    }
+  },
+  {
+    label: "用户标识",
+    field: "siteCode",
+    component: "Input",
+    dynamicRules: ({ model, schema }) => {
+      return [
+        { required: true, message: "请输入用户标识!" }
+      ];
+    }
+  },
+  {
+    label: "关键词",
+    field: "keywords",
+    component: "Input",
+    dynamicRules: ({ model, schema }) => {
+      return [
+        { required: true, message: "请输入关键词!" }
+      ];
+    }
+  },
+  {
+    label: "关键词所属域名",
+    field: "domain",
+    component: "Input",
+    dynamicRules: ({ model, schema }) => {
+      return [
+        { required: true, message: "请输入关键词所属域名!" }
+      ];
+    }
+  },
+  {
+    label: "语种",
+    field: "lang",
+    component: "Input"
+  },
+  {
+    label: "最新搜索时间",
+    field: "lastSearchTime",
+    component: "DatePicker",
     componentProps: {
-       showTime: true,
-       valueFormat: 'YYYY-MM-DD HH:mm:ss'
-     },
+      showTime: true,
+      valueFormat: "YYYY-MM-DD"
+    }
   },
   {
-    label: '定时器的最新搜索时间',
-    field: 'timerLastSearchTime',
-    component: 'DatePicker',
+    label: "定时器的最新搜索时间",
+    field: "timerLastSearchTime",
+    component: "DatePicker",
     componentProps: {
-       showTime: true,
-       valueFormat: 'YYYY-MM-DD HH:mm:ss'
-     },
+      showTime: true,
+      valueFormat: "YYYY-MM-DD"
+    }
   },
   {
-    label: '0删除,1有效,2过期',
-    field: 'status',
-    component: 'InputNumber',
+    label: "0删除,1有效,2过期",
+    field: "status",
+    component: "InputNumber"
   },
   {
-    label: '数据复制源ID',
-    field: 'sourceId',
-    component: 'InputNumber',
+    label: "数据复制源ID",
+    field: "sourceId",
+    component: "InputNumber"
   },
   {
-    label: '关键词优先级(1:高;2:中;3:低)',
-    field: 'priority',
-    component: 'InputNumber',
+    label: "关键词优先级(1:高;2:中;3:低)",
+    field: "priority",
+    component: "InputNumber"
   },
   {
-    label: 'SEO关键词优化完成时间',
-    field: 'finishTime',
-    component: 'DatePicker',
+    label: "SEO关键词优化完成时间",
+    field: "finishTime",
+    component: "DatePicker",
     componentProps: {
-       showTime: true,
-       valueFormat: 'YYYY-MM-DD HH:mm:ss'
-     },
+      showTime: true,
+      valueFormat: "YYYY-MM-DD"
+    }
+  },
+  {
+    label: "优化进度",
+    field: "optimizeProcess",
+    component: "InputNumber"
   },
   {
-    label: '优化进度(默认0)',
-    field: 'optimizeProcess',
-    component: 'InputNumber',
+    label: "优化状态",
+    field: "optimizeStatus",
+    component: "InputNumber"
   },
   {
-    label: '优化状态(0:未完成;1:已完成)',
-    field: 'optimizeStatus',
-    component: 'InputNumber',
+    label: "关键词类型",
+    field: "keywordType",
+    component: "InputNumber",
+    dynamicRules: ({ model, schema }) => {
+      return [
+        { required: true, message: "请输入关键词类型(1:指定;2:长尾)!" }
+      ];
+    }
   },
   {
-    label: '关键词类型(1:指定;2:长尾)',
-    field: 'keywordType',
-    component: 'InputNumber',
-    dynamicRules: ({model,schema}) => {
-          return [
-                 { required: true, message: '请输入关键词类型(1:指定;2:长尾)!'},
-          ];
-     },
+    label: "最近一次搜索排名",
+    field: "lastRank",
+    component: "InputNumber"
   },
   {
-    label: '最近一次搜索排名',
-    field: 'lastRank',
-    component: 'InputNumber',
+    label: "搜索状态,0为普通状态,1为搜索进行中状态",
+    field: "searchStatus",
+    component: "InputNumber"
   },
   {
-    label: '搜索状态,0为普通状态,1为搜索进行中状态',
-    field: 'searchStatus',
-    component: 'InputNumber',
+    label: "关键词所在URL",
+    field: "positionUrl",
+    component: "InputTextArea"
   },
   {
-    label: '关键词所在URL',
-    field: 'positionUrl',
-    component: 'InputTextArea',
+    label: "相关关键词关联的关键词的id",
+    field: "relatedKeywordId",
+    component: "InputNumber"
   },
   {
-    label: '相关关键词关联的关键词的id',
-    field: 'relatedKeywordId',
-    component: 'InputNumber',
+    label: "关键词对应套餐的ID",
+    field: "planId",
+    component: "Input"
   },
   {
-    label: '关键词对应套餐的ID',
-    field: 'planId',
-    component: 'Input',
+    label: "订购表ID",
+    field: "subscriptionId",
+    component: "Input"
   },
   {
-    label: '订购表ID',
-    field: 'subscriptionId',
-    component: 'Input',
+    label: "网站表ID",
+    field: "siteId",
+    component: "Input"
   },
+  // TODO 主键隐藏字段,目前写死为ID
   {
-    label: '网站表ID',
-    field: 'siteId',
-    component: 'Input',
-  },
-	// TODO 主键隐藏字段,目前写死为ID
-	{
-	  label: '',
-	  field: 'id',
-	  component: 'Input',
-	  show: false
-	},
+    label: "",
+    field: "id",
+    component: "Input",
+    show: false
+  }
 ];
 
 // 高级查询数据
 export const superQuerySchema = {
-  appKey: {title: '平台标识',order: 0,view: 'text', type: 'string',},
-  siteCode: {title: '用户标识',order: 1,view: 'text', type: 'string',},
-  keywords: {title: '关键词',order: 2,view: 'text', type: 'string',},
-  domain: {title: '关键词所属域名',order: 3,view: 'text', type: 'string',},
-  lang: {title: '语种',order: 4,view: 'text', type: 'string',},
-  lastSearchTime: {title: '最新搜索时间',order: 5,view: 'datetime', type: 'string',},
-  timerLastSearchTime: {title: '定时器的最新搜索时间',order: 6,view: 'datetime', type: 'string',},
-  status: {title: '0删除,1有效,2过期',order: 7,view: 'number', type: 'number',},
-  sourceId: {title: '数据复制源ID',order: 8,view: 'number', type: 'number',},
-  priority: {title: '关键词优先级(1:高;2:中;3:低)',order: 9,view: 'number', type: 'number',},
-  finishTime: {title: 'SEO关键词优化完成时间',order: 10,view: 'datetime', type: 'string',},
-  optimizeProcess: {title: '优化进度(默认0)',order: 11,view: 'number', type: 'number',},
-  optimizeStatus: {title: '优化状态(0:未完成;1:已完成)',order: 12,view: 'number', type: 'number',},
-  keywordType: {title: '关键词类型(1:指定;2:长尾)',order: 13,view: 'number', type: 'number',},
-  lastRank: {title: '最近一次搜索排名',order: 14,view: 'number', type: 'number',},
-  searchStatus: {title: '搜索状态,0为普通状态,1为搜索进行中状态',order: 15,view: 'number', type: 'number',},
-  positionUrl: {title: '关键词所在URL',order: 16,view: 'textarea', type: 'string',},
-  relatedKeywordId: {title: '相关关键词关联的关键词的id',order: 17,view: 'number', type: 'number',},
-  planId: {title: '关键词对应套餐的ID',order: 18,view: 'text', type: 'string',},
-  subscriptionId: {title: '订购表ID',order: 19,view: 'text', type: 'string',},
-  siteId: {title: '网站表ID',order: 20,view: 'text', type: 'string',},
+  keywords: { title: "关键词", order: 2, view: "text", type: "string" },
+  lastSearchTime: { title: "最新搜索时间", order: 5, view: "datetime", type: "string" },
+  timerLastSearchTime: {
+    title: "定时器的最新搜索时间",
+    order: 6,
+    view: "datetime",
+    type: "string"
+  },
+  status: { title: "0删除,1有效,2过期", order: 7, view: "number", type: "number" },
+  sourceId: { title: "数据复制源ID", order: 8, view: "number", type: "number" },
+  priority: { title: "关键词优先级(1:高;2:中;3:低)", order: 9, view: "number", type: "number" },
+  finishTime: { title: "SEO关键词优化完成时间", order: 10, view: "datetime", type: "string" },
+  optimizeProcess: { title: "优化进度(默认0)", order: 11, view: "number", type: "number" },
+  optimizeStatus: {
+    title: "优化状态(0:未完成;1:已完成)",
+    order: 12,
+    view: "number",
+    type: "number"
+  },
+  keywordType: { title: "关键词类型(1:指定;2:长尾)", order: 13, view: "number", type: "number" },
+  lastRank: { title: "最近一次搜索排名", order: 14, view: "number", type: "number" },
+  searchStatus: {
+    title: "搜索状态,0为普通状态,1为搜索进行中状态",
+    order: 15,
+    view: "number",
+    type: "number"
+  },
+  positionUrl: { title: "关键词所在URL", order: 16, view: "textarea", type: "string" },
+  relatedKeywordId: {
+    title: "相关关键词关联的关键词的id",
+    order: 17,
+    view: "number",
+    type: "number"
+  },
+  planId: { title: "关键词对应套餐的ID", order: 18, view: "text", type: "string" },
+  subscriptionId: { title: "订购表ID", order: 19, view: "text", type: "string" },
+  siteId: { title: "网站表ID", order: 20, view: "text", type: "string" }
 };
 
 /**
-* 流程表单调用这个方法获取formSchema
-* @param param
-*/
-export function getBpmFormSchema(_formData): FormSchema[]{
+ * 流程表单调用这个方法获取formSchema
+ * @param param
+ */
+export function getBpmFormSchema(_formData): FormSchema[] {
   // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
   return formSchema;
-}
+}

+ 60 - 1
src/views/adweb/keywords/SeoKeywordsList.vue

@@ -29,7 +29,42 @@
       </template>
       <!--字段回显插槽-->
       <template v-slot:bodyCell="{ column, record, index, text }">
+        <a-radio-group v-if="column.key === 'keywordType'" button-style="solid" @change="onchange($event,record.id)" :value="record.keywordType">
+          <a-radio-button :value=1>
+            指定关键词
+          </a-radio-button>
+          <a-radio-button :value=2>
+            长尾关键词
+          </a-radio-button>
+        </a-radio-group>
       </template>
+     <template #positionUrl="{ text }">
+       <a v-if="text !== null && text !== undefined" :href=text target="_blank">{{ text.replace('https://','').replace('http://','') }}</a>
+       <a v-else>-</a>
+     </template>
+
+     <template #priority="{ text }">
+       <a-tag color="#f50" v-if="text == 1">高</a-tag>
+       <a-tag color="#108ee9" v-if="text == 2">中</a-tag>
+       <a-tag color="#87d068" v-if="text == 3">低</a-tag>
+     </template>
+
+     <template #prioritySlot="{ record, text }">
+       <a-radio-group button-style="solid" @change="onPriorityChange($event, record.id)" :value="text">
+         <a-radio-button :value="1">
+           高
+         </a-radio-button>
+         <a-radio-button :value="2">
+           中
+         </a-radio-button>
+         <a-radio-button :value="3">
+           低
+         </a-radio-button>
+       </a-radio-group>
+     </template>
+     <template #createTime="{ text }">
+
+     </template>
     </BasicTable>
     <!-- 表单区域 -->
     <SeoKeywordsModal @register="registerModal" @success="handleSuccess"></SeoKeywordsModal>
@@ -177,7 +212,31 @@
          }
        ]
    }
+  function onPriorityChange($event, id) {
+    // postAction('/serp/seoKeywords/changePriority' + '?id=' + id + '&value=' + $event.target.value).then(function(res) {
+    //   if (res.code === 200) {
+    //     that.$message.success('优先级更改成功!')
+    //     that.loadData()
+    //   } else {
+    //     that.$message.error('优先级更改失败!')
+    //     return
+    //   }
+    // })
+  }
+  //关键词指定
+  function onchange($event, id) {
 
+    // let that = this
+    // postAction(that.url.changeTypeUrl + '?id=' + id + '&type=' + $event.target.value).then(function(res) {
+    //   if (res.code === 200) {
+    //     that.$message.success('关键词类型更改成功!')
+    //     that.loadData()
+    //   } else {
+    //     that.$message.error(res.message)
+    //     return
+    //   }
+    // })
+  }
 
 </script>
 
@@ -185,4 +244,4 @@
   :deep(.ant-picker),:deep(.ant-input-number){
     width: 100%;
   }
-</style>
+</style>

+ 9 - 8
src/views/adweb/seo/SeoKeywordsRankList.vue

@@ -8,16 +8,16 @@
           <a-popover placement="bottom" v-show="selectSiteInfo.planName  && selectSiteInfo.planType !== 'STATIONCONSTRUCTION'">
             <template #content>
               <span>
-                 指定词数:{{ comprehenInfo.specifyKeywordNum | last }}&nbsp;
+                 指定词数:{{ comprehenInfo.planAppointKeywordNum  }}&nbsp;
               </span>
              <span>
-                 关键词数:{{ comprehenInfo.longTailKeywordNum | last }}&nbsp;
+                 关键词数:{{ comprehenInfo.planLongTailKeywordNum }}&nbsp;
               </span>
               <span>
-                  外链数:{{ comprehenInfo.outerLinkNum | last }}&nbsp;
+                  外链数:{{ comprehenInfo.planOuterLinkNum }}&nbsp;
               </span>
               <span>
-                  文章数:{{ comprehenInfo.articleNum | last }}
+                  文章数:{{ comprehenInfo.planArticleNum }}
               </span>
             </template>
             <img src="https://cutomer-static-bucket.s3.cn-northwest-1.amazonaws.com.cn/public/material/220803883dfy/document/changjianwenti_1676606434975.png" alt="issue" width="25px" height="25px"/>
@@ -28,11 +28,11 @@
     <a-row class="r2" type="flex" justify="center" align="middle">
       <a-col :span="6">
         <p class="t1"><img src="../../../assets/seo/zhidingci.svg"/>指定词</p>
-        <p class="t2" v-if="comprehenInfo.specifyKeywordNum == null">
+        <p class="t2" v-if="comprehenInfo.appointKeywordNum == null">
           -
         </p>
         <p class="t2" v-else>
-          <a @click="changeKeywordType()">{{ comprehenInfo.specifyKeywordNum }}</a>
+          <a @click="changeKeywordType()">{{ comprehenInfo.appointKeywordNum }}</a>
         </p>
       </a-col>
       <a-col :span="6">
@@ -114,7 +114,7 @@
     <a-row>
 
     </a-row>
-    <a-row class="r4" v-if="comprehenInfo.specifyKeywordNum != null">
+    <a-row class="r4">
       <a-card title="指定词" :bordered="false" style="width: 100%" >
         <a-col :span="24">
           <a-row  class="table-tool-wrap" type="flex">
@@ -682,7 +682,7 @@ export default {
       let that = this
       let d = {
         siteCode: that.siteCode,
-        subscriptionId: that.selectSiteInfo.subscriptionId ? that.selectSiteInfo.subscriptionId : ''
+        planId: that.selectSiteInfo.planId ? that.selectSiteInfo.planId : ''
       }
       getAction('/seo/seoKeywordsRank/comprehensiveInfo', d).then(res => {
         if (res.code == 200) {
@@ -1192,6 +1192,7 @@ export default {
 .r3 {
   padding-left: 10px;
   padding-right: 10px;
+  padding-bottom: 10px;
   .wrap {
     padding: 20px;
     background: #fff;