xiebaomin 1 year ago
parent
commit
7420c3505e

File diff suppressed because it is too large
+ 1 - 24635
package-lock.json


+ 1 - 0
package.json

@@ -39,6 +39,7 @@
     "three-dots": "^0.3.2",
     "vue": "2.6.10",
     "vue-count-to": "1.0.13",
+    "vue-preview": "^1.1.3",
     "vue-router": "3.0.2",
     "vue-splitpane": "1.0.4",
     "vuedraggable": "2.20.0",

File diff suppressed because it is too large
+ 1081 - 3237
pnpm-lock.yaml


BIN
public/temp/tag-import.xlsx


+ 66 - 12
src/api/library/keyword.js

@@ -59,6 +59,17 @@ export function importKeywordXlsx(data) {
   })
 }
 
+export function importKeywordLabelXlsx(data) {
+  return request({
+    url: '/keyword/import/keywordLabel',
+    method: 'post',
+    data,
+    headers: {
+      'Content-Type': 'multipart/form-data'
+    }
+  })
+}
+
 // 关键词下拉联动开启
 export function findLinkageStatus(params) {
   return request({
@@ -95,18 +106,6 @@ export function getStatekeywordList(params) {
     params
   })
 }
-/**
- * 保存静态标签
- * @param {*} keyword 标签
- * @returns
- */
-export function saveLabelByState(params) {
-  return request({
-    url: '/keyword/saveLabelByState',
-    method: 'get',
-    params
-  })
-}
 /**
  * 优先展示标签列表
  * @param {*} keyword 标签
@@ -163,3 +162,58 @@ export function delPriorKeyword(params) {
     params: params
   })
 }
+/**
+ * 删除动静态标签
+ * @param {*} id 标签Id
+ * @returns
+ */
+export function deleteTrendsLabel(params) {
+  return request({
+    url: '/keyword/delete/TrendsLabel',
+    method: 'get',
+    params
+  })
+}
+/**
+ * 选择子标签弹窗列表(未关联父标签的子标签列表)
+ * @param {*} keyword 标签
+ * @param {*} pageNum 页码
+ * @param {*} pageSize 条数
+ * @returns
+ */
+export function getSubtagKeyword(params) {
+  return request({
+    url: '/keyword/getSubtagKeyword',
+    method: 'get',
+    params
+  })
+}
+/**
+ * 保存静态&动态标签
+ * @param {*} keyword 标签名称
+ * @param {*} dynamicStatus	0:动态标签;1:静态标签
+ * @param {*} subtagId	子标签集合
+ * @returns
+ */
+export function saveLabelByState(data) {
+  return request({
+    url: '/keyword/saveLabelByState',
+    method: 'post',
+    data: data
+  })
+}
+
+/**
+ * 获取标签详情
+ * @param {*} id 标签id
+ * @param {*} pageNum 页码
+ * @param {*} pageSize 条数
+ * @returns
+ */
+export function editKeyword(params) {
+  return request({
+    url: '/keyword/editKeyword',
+    method: 'get',
+    params
+  })
+}

+ 22 - 0
src/api/user/record/record.js

@@ -22,3 +22,25 @@ export function importExportToday(params) {
     params
   })
 }
+/**
+ * 获取父标签
+ * @returns
+ */
+export function getKeyword(params) {
+  return request({
+    url: '/user/behavior/getKeyword',
+    method: 'get',
+    params
+  })
+}
+/**
+ * 获取页面类型
+ * @returns
+ */
+export function getPageType(params) {
+  return request({
+    url: '/user/behavior/getPageType',
+    method: 'get',
+    params
+  })
+}

+ 2 - 2
src/components/AppLoading/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
-    <img src="/favicon.svg" alt="">
-    <div class="dot-wrapper dot-carousel" />
+    <img src="/favicon.svg" alt="" />
+    <div class="dot-wrapper dot-carousel"></div>
     <h2>采美管理系统</h2>
   </div>
 </template>

+ 6 - 0
src/router/modules/keywordLibrary.js

@@ -51,6 +51,12 @@ const keywordLibraryRouter = {
           component: () => import('@/views/library/tag/static-list'),
           meta: { title: '静态标签列表' }
         },
+        {
+          path: 'tag-form',
+          name: 'TagForm',
+          component: () => import('@/views/library/tag/tag-form'),
+          meta: { title: '动态标签添加/编辑' }
+        },
         {
           path: 'priority-list',
           name: 'PriorityList',

+ 36 - 23
src/views/library/keyword/list.vue

@@ -4,23 +4,28 @@
     <div class="filter-container">
       <div class="filter-control">
         <span>关键词:</span>
-        <el-input v-model="listQuery.keyword" placeholder="关键词" clearable @keyup.enter.native="getList"
-                  @clear="getList"
+        <el-input
+          v-model="listQuery.keyword"
+          placeholder="关键词"
+          clearable
+          @keyup.enter.native="getList"
+          @clear="getList"
         />
       </div>
       <div class="filter-control">
         <span>搜索统计:</span>
-        <el-date-picker v-model="time" type="daterange" unlink-panels range-separator="至" start-placeholder="开始日期"
-                        end-placeholder="结束日期" :picker-options="pickerOptions" value-format="yyyy-MM-dd" @change="getList"
+        <el-date-picker
+          v-model="time"
+          type="daterange"
+          unlink-panels
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :picker-options="pickerOptions"
+          value-format="yyyy-MM-dd"
+          @change="getList"
         />
       </div>
-      <div class="filter-control">
-        <span>标签库状态:</span>
-        <el-select v-model="listQuery.labelStatus" clearable @change="getList">
-          <el-option :value="0" label="未添加" />
-          <el-option :value="1" label="已添加" />
-        </el-select>
-      </div>
       <div class="filter-control">
         <el-button type="primary" @click="getList">查询</el-button>
         <el-button v-permission="'keyword:list:join'" type="primary" :disabled="disabled" @click="handleAddLibrary">
@@ -33,14 +38,24 @@
     </div>
 
     <!-- 关键词列表 -->
-    <el-table ref="table" v-loading="isLoading" :data="list" border
-              :default-sort="{ prop: 'frequency', order: 'descending' }" @selection-change="handleSelectionChange"
+    <el-table
+      ref="table"
+      v-loading="isLoading"
+      :data="list"
+      border
+      :default-sort="{ prop: 'frequency', order: 'descending' }"
+      @selection-change="handleSelectionChange"
     >
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="序号" :index="indexMethod" type="index" sortable="custom" align="center" width="80" />
       <el-table-column prop="keyword" label="关键词" align="center" />
-      <el-table-column prop="pv" label="搜索次数" width="120" align="center" sortable
-                       :sort-orders="['ascending', 'descending']"
+      <el-table-column
+        prop="pv"
+        label="搜索次数"
+        width="120"
+        align="center"
+        sortable
+        :sort-orders="['ascending', 'descending']"
       />
       <el-table-column label="最近搜索时间" align="center">
         <template slot-scope="{ row }">
@@ -48,9 +63,6 @@
           <span v-else>-</span>
         </template>
       </el-table-column>
-      <el-table-column width="140" label="标签库状态" align="center">
-        <template slot-scope="{ row }">{{ row.labelStatus === 1 ? '已添加' : '未添加' }}</template>
-      </el-table-column>
       <el-table-column label="操作" align="center" width="240">
         <template slot-scope="{ row }">
           <div class="labelCenter">
@@ -61,9 +73,7 @@
               </el-button>
             </template>
             <template v-else>
-              <el-button class="labelPoint" type="primary" size="mini">
-                加入标签库
-              </el-button>
+              <el-button class="labelPoint" type="primary" size="mini"> 加入标签库 </el-button>
             </template>
           </div>
         </template>
@@ -71,8 +81,11 @@
     </el-table>
 
     <!-- 页码 -->
-    <pagination :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize"
-                @pagination="fetchKeywordList"
+    <pagination
+      :total="total"
+      :page.sync="listQuery.pageNum"
+      :limit.sync="listQuery.pageSize"
+      @pagination="fetchKeywordList"
     />
 
     <!-- 去搜索跳转 -->

+ 16 - 17
src/views/library/supplierTag/list.vue

@@ -25,7 +25,6 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="序号" :index="indexMethod" type="index" sortable="custom" align="center" width="80" />
       <el-table-column prop="keyword" label="关键词" align="center" />
-      <el-table-column prop="frequency" label="搜索次数" width="120" align="center" sortable />
       <el-table-column width="180" label="来源" align="center">
         <template slot-scope="{ row }">
           <span v-if="row.fromSearch === 1">单个添加</span>
@@ -33,12 +32,6 @@
           <span v-else>导入</span>
         </template>
       </el-table-column>
-      <el-table-column label="最近搜索时间" align="center" width="200">
-        <template slot-scope="{ row }">
-          <span v-if="row.searchTime">{{ row.searchTime | parseTime }}</span>
-          <span v-else>-</span>
-        </template>
-      </el-table-column>
       <el-table-column label="添加时间" align="center" width="200">
         <template slot-scope="{ row }">
           <span v-if="row.pickTime">{{ row.pickTime | parseTime }}</span>
@@ -85,16 +78,16 @@
           <el-button type="primary" @click="handleAddTag">新增标签</el-button>
         </div>
       </div>
-      <el-table ref="table" v-loading="isLoading" :data="labelList" height="340px" border @selection-change="handleSelectionTagChange">
+      <el-table
+        ref="table"
+        v-loading="isLoading"
+        :data="labelList"
+        height="340px"
+        border
+        @selection-change="handleSelectionTagChange"
+      >
         <el-table-column type="selection" width="55" />
         <el-table-column prop="keyword" label="标签" align="center" />
-        <el-table-column prop="frequency" label="搜索次数" width="120" align="center" sortable />
-        <el-table-column label="最近搜索时间" align="center" width="200">
-          <template slot-scope="{ row }">
-            <span v-if="row.searchTime">{{ row.searchTime | parseTime }}</span>
-            <span v-else>-</span>
-          </template>
-        </el-table-column>
         <el-table-column label="添加时间" align="center" width="200">
           <template slot-scope="{ row }">
             <span v-if="row.addTime">{{ row.addTime | parseTime }}</span>
@@ -130,7 +123,13 @@
 </template>
 
 <script>
-import { fetchShopLabelList, fetchLabelList, relevanceInsertLabel, delShopLabelList, addInsertSearch } from '@/api/user/supplier/supplier'
+import {
+  fetchShopLabelList,
+  fetchLabelList,
+  relevanceInsertLabel,
+  delShopLabelList,
+  addInsertSearch
+} from '@/api/user/supplier/supplier'
 export default {
   data() {
     return {
@@ -152,7 +151,7 @@ export default {
         shopId: '', // 供应商Id
         keyword: '', // 标签名
         pageNum: 1, // 页码
-        pageSize: 100// 页面数据数
+        pageSize: 100 // 页面数据数
       },
       tagForm: {
         keyword: ''

+ 186 - 0
src/views/library/tag/components/tags-dialog.vue

@@ -0,0 +1,186 @@
+<template>
+  <div>
+    <el-dialog
+      title="选择子标签"
+      :visible.sync="visible"
+      width="1200px"
+      :close-on-click-modal="false"
+      :show-close="false"
+    >
+      <div class="filter-container">
+        <div class="filter-control">
+          <span>子标签名称:</span>
+          <el-input
+            v-model="listQuery.keyword"
+            placeholder="子标签名称"
+            clearable
+            style="width: 160px"
+            @keyup.enter.native="getList"
+            @clear="getList"
+          />
+        </div>
+        <div class="filter-control">
+          <el-button type="primary" @click="getList"> 查询 </el-button>
+          <el-button type="primary" @click="addTagDialog = true"> 添加标签 </el-button>
+        </div>
+      </div>
+      <el-table
+        ref="table"
+        v-loading="isLoading"
+        :data="list"
+        height="380px"
+        border
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column type="selection" width="55" />
+        <el-table-column label="子标签名称" prop="keyword" align="center" />
+        <el-table-column label="添加时间" prop="addTime" align="center">
+          <template slot-scope="{ row }">
+            {{ row.addTime | parseTime }}
+          </template>
+        </el-table-column>
+      </el-table>
+      <!-- 页码 -->
+      <pagination
+        :total="total"
+        :page-sizes="[10, 20]"
+        :page-size="10"
+        :page.sync="listQuery.pageNum"
+        :limit.sync="listQuery.pageSize"
+        @pagination="getSubtagKeyword"
+      />
+      <div slot="footer">
+        <el-button @click="handleCanle"> 取 消 </el-button>
+        <el-button type="primary" :disabled="disabled" @click="handleConfirm"> 确 定 </el-button>
+      </div>
+    </el-dialog>
+    <!-- 添加标签 -->
+    <el-dialog
+      title="添加标签"
+      :visible.sync="addTagDialog"
+      width="460px"
+      :close-on-click-modal="false"
+      :show-close="false"
+    >
+      <el-form ref="tagForm" :model="tagForm" :rules="tagFormRules">
+        <el-form-item label="标签名:" prop="keyword">
+          <el-input v-model="tagForm.keyword" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer">
+        <el-button @click="closeAddTagDialog"> 取 消 </el-button>
+        <el-button type="primary" @click="handleAddTagConfirm"> 确 定 </el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { saveLabelByState, getSubtagKeyword } from '@/api/library/keyword'
+export default {
+  name: 'TagsDialog',
+  filters: {
+    NumFormat(value) {
+      // 处理金额
+      return Number(value).toFixed(2)
+    }
+  },
+  data() {
+    return {
+      visible: false,
+      listQuery: {
+        pageNum: 1, // 页码
+        pageSize: 10, // 页面数据数
+        keyword: '' // 子标签名称
+      },
+      list: [],
+      total: 0,
+      addTagDialog: false,
+      tagForm: {
+        id: '',
+        keyword: '',
+        dynamicStatus: 0,
+        parentLabel: 0
+      },
+      tagsRadio: null,
+      isLoading: true,
+      tagFormRules: {
+        keyword: [{ required: true, message: '请输入标签名称', trigger: ['blur'] }]
+      }
+    }
+  },
+  computed: {
+    disabled() {
+      return this.tagsRadio === null
+    }
+  },
+  created() {
+    this.visible = true
+    this.getList()
+  },
+  methods: {
+    // 子标签弹窗列表(未关联父标签的子标签列表)
+    async getList() {
+      this.list = []
+      this.listQuery.pageNum = 1
+      this.getSubtagKeyword()
+    },
+    // 子标签弹窗列表(未关联父标签的子标签列表)
+    async getSubtagKeyword() {
+      try {
+        const res = await getSubtagKeyword(this.listQuery)
+        const data = res.data
+        this.list = data.results.map((tags) => {
+          return {
+            ...tags,
+            ...{ subtagId: tags.id }
+          }
+        })
+        this.total = res.data.totalRecord
+        this.isLoading = false
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 多选子标签
+    handleSelectionChange(row) {
+      this.tagsRadio = row
+      console.log('row', row)
+    },
+    // 确认选择子标签
+    handleConfirm() {
+      this.$emit('confirm', this.tagsRadio)
+    },
+    handleCanle() {
+      // 取消弹窗
+      this.$emit('cancel')
+    },
+    // 添加标签取消
+    closeAddTagDialog() {
+      this.$refs.tagForm.resetFields()
+      this.addTagDialog = false
+    },
+    // 添加标签确定
+    async handleAddTagConfirm() {
+      try {
+        await this.$refs.tagForm.validate()
+        this.addTagSubmit()
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 提交添加标签信息
+    async addTagSubmit() {
+      try {
+        await saveLabelByState(this.tagForm)
+        this.$message.success('添加标签成功')
+        this.getList()
+      } catch (error) {
+        console.log(error)
+      }
+      this.closeAddTagDialog()
+    }
+  }
+}
+</script>
+<style lang="scss" scoped></style>

+ 66 - 156
src/views/library/tag/list.vue

@@ -21,25 +21,19 @@
           <el-option :value="4" label="协销填写" />
         </el-select>
       </div>
-      <!-- <div class="filter-control">
-        <span>搜索统计:</span>
-        <el-date-picker
-          v-model="time"
-          type="daterange"
-          unlink-panels
-          range-separator="至"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          :picker-options="pickerOptions"
-          value-format="yyyy-MM-dd"
-          @change="getList"
-        />
-      </div> -->
+      <div class="filter-control">
+        <span>父标签:</span>
+        <el-select v-model="listQuery.parentLabel" clearable @change="getList">
+          <el-option value="" label="请选择" />
+          <el-option :value="1" label="是" />
+          <el-option :value="0" label="否" />
+        </el-select>
+      </div>
       <div class="filter-control">
         <el-button type="primary" @click="getList"> 查询 </el-button>
-        <el-button v-permission="'tag:list:add'" type="primary" @click="handleAddTag"> 添加标签 </el-button>
+        <el-button v-permission="'tag:list:add'" type="primary" @click="handleOerate('add')"> 添加标签 </el-button>
         <el-button v-permission="'tag:list:del'" type="danger" :disabled="disabled" @click="handleDeleteTag">
-          删除
+          批量删除
         </el-button>
         <el-button v-permission="'tag:list:improt'" type="primary" @click="importDialog = true"> 导入 </el-button>
         <el-button v-permission="'tag:list:export'" type="primary" :disabled="disabled" @click="handleExport">
@@ -50,15 +44,7 @@
         </el-button>
       </div>
     </div>
-
     <!-- 标签列表 -->
-    <!-- <el-table
-      v-loading="isLoading"
-      :data="list"
-      border
-      :default-sort="{ prop: 'frequency', order: 'descending' }"
-      @selection-change="handleSelectionChange"
-    > -->
     <el-table v-loading="isLoading" :data="list" border @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="序号" :index="indexMethod" type="index" sortable="custom" align="center" width="80" />
@@ -68,14 +54,6 @@
           <el-switch v-model="scope.row.linkageStatus" @change="handleStatusChange(scope.row)" />
         </template>
       </el-table-column>
-      <el-table-column
-        prop="frequency"
-        label="搜索次数"
-        width="120"
-        align="center"
-        sortable
-        :sort-orders="['ascending', 'descending']"
-      />
       <el-table-column width="180" label="来源" align="center">
         <template slot-scope="{ row }">
           <span v-if="row.fromSearch === 1">单个添加</span>
@@ -84,6 +62,12 @@
           <span v-else>协销填写</span>
         </template>
       </el-table-column>
+      <el-table-column width="100" label="是否为父标签" align="center">
+        <template slot-scope="{ row }">
+          <el-tag v-if="row.parentLabel === 1" type="success" size="small">是</el-tag>
+          <el-tag v-else type="warning" size="small">否</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="添加时间" align="center" width="200">
         <template slot-scope="{ row }">
           <span v-if="row.addTime">{{ row.addTime | parseTime }}</span>
@@ -92,10 +76,10 @@
       </el-table-column>
       <el-table-column label="操作" align="center" width="240">
         <template slot-scope="{ row }">
+          <el-button type="primary" size="mini" @click="handleOerate('edit', row)"> 编辑 </el-button>
           <el-button v-permission="'tag:list:del'" type="danger" size="mini" @click="handleDeleteTag(row)">
             删除
           </el-button>
-          <!-- <el-button type="primary" size="mini" @click="handleSearch(row.keyword)"> 去搜索 </el-button> -->
         </template>
       </el-table-column>
     </el-table>
@@ -105,35 +89,12 @@
       :total="total"
       :page.sync="listQuery.pageNum"
       :limit.sync="listQuery.pageSize"
-      @pagination="fetchKeywordList"
+      @pagination="getStatekeywordList"
     />
 
     <!-- 去搜索跳转 -->
     <SearchModel v-model="searchDialog" :keyword="visibleKeyword" />
 
-    <!-- 添加标签 -->
-    <el-dialog
-      title="添加标签"
-      :visible.sync="addTagDialog"
-      width="460px"
-      :close-on-click-modal="false"
-      :show-close="false"
-    >
-      <el-form ref="tagForm" :model="tagForm" :rules="tagFormRules">
-        <el-form-item label="标签名:" prop="keyword">
-          <el-input v-model="tagForm.keyword" />
-        </el-form-item>
-        <!-- <el-form-item label="下拉联动搜索开关:" prop="isTrue">
-          <el-switch v-model="tagForm.isTrue" />
-          <div style="color: #ccc;font-size: 14px;">注:开启后,用户才能使用联动搜索</div>
-        </el-form-item> -->
-      </el-form>
-      <div slot="footer">
-        <el-button @click="closeAddTagDialog"> 取 消 </el-button>
-        <el-button type="primary" @click="handleAddTagConfirm"> 确 定 </el-button>
-      </div>
-    </el-dialog>
-
     <!-- 导入标签 -->
     <el-dialog
       title="导入标签"
@@ -171,65 +132,18 @@
 
 <script>
 import SearchModel from '@/components/SearchModel'
-import { downloadWithUrl, getYestodayTime, parseTime } from '@/utils'
+import { downloadWithUrl, parseTime } from '@/utils'
 import {
-  addKeyword,
-  deleteKeyword,
-  fetchKeywordList,
-  importKeywordXlsx,
+  deleteTrendsLabel,
+  getStatekeywordList,
+  importKeywordLabelXlsx,
   findLinkageStatus
 } from '@/api/library/keyword'
 import { export_json_to_excel } from '@/vendor/Export2Excel'
+import pickerOptions from '@/utils/time-picker.js'
 export default {
   components: { SearchModel },
   data() {
-    const pickerOptions = {
-      shortcuts: [
-        {
-          text: '近1年',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 365)
-            picker.$emit('pick', [start, end])
-          }
-        },
-        {
-          text: '近半年',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 183)
-            picker.$emit('pick', [start, end])
-          }
-        },
-        {
-          text: '近1月',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
-            picker.$emit('pick', [start, end])
-          }
-        },
-        {
-          text: '近1周',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 6)
-            picker.$emit('pick', [start, end])
-          }
-        },
-        {
-          text: '昨天',
-          onClick(picker) {
-            const { start, end } = getYestodayTime()
-            picker.$emit('pick', [start, end])
-          }
-        }
-      ]
-    }
     return {
       isLoading: true,
       pickerOptions,
@@ -237,25 +151,18 @@ export default {
       listQuery: {
         keyword: '',
         beginTime: '',
+        dynamicStatus: 0,
+        parentLabel: '',
         endTime: '',
-        labelStatus: 1,
-        searchTimeCode: '',
-        fromSearch: '',
+        serviceProviderId: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 20
       },
       list: [],
       total: 0,
       currentList: [],
       searchDialog: false,
       visibleKeyword: '',
-      addTagDialog: false,
-      tagForm: {
-        keyword: ''
-      },
-      tagFormRules: {
-        keyword: [{ required: true, message: '请输入标签名称', trigger: ['blur'] }]
-      },
       exportKeywordList: [],
       importDialog: false,
       fileList: [],
@@ -281,7 +188,7 @@ export default {
       const res = await findLinkageStatus({ id: $event.id, linkageStatus: $event.linkageStatus ? 1 : 0 })
       if (res.code === 0) {
         if (res.data === 0) {
-          await this.fetchKeywordList()
+          await this.getStatekeywordList()
           return this.$message({
             type: 'success',
             message: `${res.msg}`
@@ -305,7 +212,7 @@ export default {
               $event.linkageStatus = !$event.linkageStatus
             })
         }
-        await this.fetchKeywordList()
+        await this.getStatekeywordList()
       }
     },
 
@@ -319,14 +226,14 @@ export default {
         this.listQuery.beginTime = ''
         this.listQuery.endTime = ''
       }
-      this.fetchKeywordList()
+      this.getStatekeywordList()
     },
 
     // 获取标签列表
-    async fetchKeywordList() {
+    async getStatekeywordList() {
       try {
         this.isLoading = true
-        const res = await fetchKeywordList(this.listQuery)
+        const res = await getStatekeywordList(this.listQuery)
         this.list = res.data.results.map((i) => ({
           addTime: i.addTime,
           frequency: i.frequency,
@@ -336,7 +243,8 @@ export default {
           labelStatus: i.labelStatus,
           linkageStatus: i.linkageStatus === 1, // 0 关闭,1 打开
           recommendTime: i.recommendTime,
-          searchTime: i.searchTime
+          searchTime: i.searchTime,
+          parentLabel: i.parentLabel
         }))
         this.total = res.data.totalRecord
         this.isLoading = false
@@ -360,39 +268,41 @@ export default {
     handleAddTag() {
       this.addTagDialog = true
     },
-
-    // 添加标签取消
-    closeAddTagDialog() {
-      this.$refs.tagForm.resetFields()
-      this.addTagDialog = false
-    },
-
-    // 添加标签确定
-    async handleAddTagConfirm() {
-      try {
-        await this.$refs.tagForm.validate()
-        this.addTagSubmit()
-      } catch (error) {
-        console.log(error)
-      }
-    },
-
-    // 提交添加标签信息
-    async addTagSubmit() {
-      try {
-        await addKeyword(this.tagForm)
-        this.$message.success('添加标签成功')
-        this.getList()
-      } catch (error) {
-        console.log(error)
+    // 添加标签
+    handleOerate(type, row) {
+      if (type === 'add') {
+        this.$router.push({
+          path: '/library/tag/tag-form',
+          query: { type: type }
+        })
+      } else {
+        this.$router.push({
+          path: '/library/tag/tag-form',
+          query: { id: row.id, type: type }
+        })
       }
-      this.closeAddTagDialog()
     },
-
     // 删除标签
     async handleDeleteTag(row) {
       try {
-        await this.$confirm('确定删除已选标签?', {
+        let confirmText = ''
+        if (row && row.parentLabel === 1) {
+          confirmText = '该标签为父标签删除后将失去和子标签的联系,确定删除吗?'
+        } else {
+          const parentLabel = []
+          this.currentList.forEach((el) => {
+            if (el.parentLabel === 1) {
+              parentLabel.push(`【${el.keyword}】`)
+              console.log('parentLabel', parentLabel)
+            }
+          })
+          if (parentLabel.length > 0) {
+            confirmText = `所选标签中含有父标签,删除后将失去和子标签的联系,确定删除吗?`
+          } else {
+            confirmText = '确定删除已选标签?'
+          }
+        }
+        await this.$confirm(confirmText, {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
@@ -408,7 +318,7 @@ export default {
       const keywords = row instanceof Event ? this.currentList : [].concat(row)
       const ids = keywords.map((item) => item.id).join(',')
       try {
-        await deleteKeyword({ id: ids })
+        await deleteTrendsLabel({ id: ids })
         this.$message.success('标签删除成功')
         this.getList()
       } catch (error) {
@@ -444,7 +354,7 @@ export default {
         this.fileList = []
         this.importDialog = false
         formData.append('keywordFile', file.raw)
-        await importKeywordXlsx(formData)
+        await importKeywordLabelXlsx(formData)
         this.$message.success('导入标签成功')
         this.getList()
       } catch (error) {

+ 9 - 51
src/views/library/tag/static-list.vue

@@ -115,64 +115,17 @@
 
 <script>
 import SearchModel from '@/components/SearchModel'
-import { getYestodayTime } from '@/utils'
+import pickerOptions from '@/utils/time-picker.js'
 import {
   getServiceList,
   saveLabelByState,
-  deleteKeyword,
+  deleteTrendsLabel,
   getStatekeywordList,
   findLinkageStatus
 } from '@/api/library/keyword'
 export default {
   components: { SearchModel },
   data() {
-    const pickerOptions = {
-      shortcuts: [
-        {
-          text: '近1年',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 365)
-            picker.$emit('pick', [start, end])
-          }
-        },
-        {
-          text: '近半年',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 183)
-            picker.$emit('pick', [start, end])
-          }
-        },
-        {
-          text: '近1月',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
-            picker.$emit('pick', [start, end])
-          }
-        },
-        {
-          text: '近1周',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 6)
-            picker.$emit('pick', [start, end])
-          }
-        },
-        {
-          text: '昨天',
-          onClick(picker) {
-            const { start, end } = getYestodayTime()
-            picker.$emit('pick', [start, end])
-          }
-        }
-      ]
-    }
     return {
       isLoading: true,
       pickerOptions,
@@ -180,6 +133,8 @@ export default {
       listQuery: {
         keyword: '',
         beginTime: '',
+        dynamicStatus: 1,
+        parentLabel: '',
         endTime: '',
         serviceProviderId: '',
         pageNum: 1,
@@ -192,7 +147,10 @@ export default {
       visibleKeyword: '',
       addTagDialog: false,
       tagForm: {
-        keyword: ''
+        id: '',
+        keyword: '',
+        dynamicStatus: 1,
+        parentLabel: 0
       },
       tagFormRules: {
         keyword: [{ required: true, message: '请输入标签名称', trigger: ['blur'] }]
@@ -358,7 +316,7 @@ export default {
       const keywords = row instanceof Event ? this.currentList : [].concat(row)
       const ids = keywords.map((item) => item.id).join(',')
       try {
-        await deleteKeyword({ id: ids })
+        await deleteTrendsLabel({ id: ids })
         this.$message.success('标签删除成功')
         this.getList()
       } catch (error) {

+ 183 - 0
src/views/library/tag/tag-form.vue

@@ -0,0 +1,183 @@
+<template>
+  <div class="app-container" style="width: 800px; margin: 100px auto 0 50px">
+    <el-form ref="tagsForm" :model="form" label-width="130px">
+      <el-form-item label="标签名:" prop="keyword" :rules="rules.keyword">
+        <el-input v-model="form.keyword" placeholder="请填写标签名称" maxlength="20" />
+      </el-form-item>
+      <el-form-item label="父标签:" prop="parentLabel" :rules="rules.parentLabel">
+        <el-radio v-model="form.parentLabel" :label="0">否</el-radio>
+        <el-radio v-model="form.parentLabel" :label="1">是</el-radio>
+      </el-form-item>
+      <el-form-item v-if="form.parentLabel === 1" label="子标签" prop="subtag" :rules="rules.subtag">
+        <template v-if="form.subtag && form.subtag.length === 0">
+          <el-button type="primary" autofocussize="mini" size="mini" icon="el-icon-plus" @click="handleDialogVisible">
+            选择子标签
+          </el-button>
+          <el-checkbox-group v-show="false" v-model="form.subtag" />
+        </template>
+        <template v-else>
+          <el-table :data="form.subtag" border width="1000">
+            <el-table-column prop="keyword" label="子标签名称" align="center" />
+            <el-table-column label="添加时间" prop="addTime" align="center">
+              <template slot-scope="{ row }">
+                {{ row.addTime | parseTime }}
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" align="center">
+              <template slot-scope="scope">
+                <el-button type="text" @click="handleDeleteTags(scope.$index)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </template>
+      </el-form-item>
+    </el-form>
+    <div class="el-dialog__footer" style="text-align: center">
+      <el-button type="primary" @click="onSubmit('tagsForm')"> 保存 </el-button>
+      <el-button plain @click="backToList"> 返回 </el-button>
+    </div>
+    <!-- 子标签弹框 -->
+    <tags-dialog v-if="tagsDialogVisible" ref="tagsDialog" @confirm="handleAddTagsConfirm" @cancel="handleCancel" />
+  </div>
+</template>
+
+<script>
+import { editKeyword, saveLabelByState } from '@/api/library/keyword'
+import tagsDialog from './components/tags-dialog'
+
+export default {
+  name: 'TagForm',
+  components: { tagsDialog },
+  data() {
+    const defaultForm = () => {
+      return {
+        id: '',
+        keyword: '',
+        subtag: [],
+        dynamicStatus: 0,
+        parentLabel: 0 // 父标签 0 否 1 是
+      }
+    }
+    return {
+      form: defaultForm(),
+      editType: 'add',
+      tagsDialogVisible: false,
+      rules: {
+        keyword: [{ required: true, message: '请填写标签名称', trigger: 'blur' }],
+        subtag: [{ required: true, type: 'array', message: '请添加子标签', trigger: ['change'] }],
+        parentLabel: [{ required: true, message: '请选择是否为父标签', trigger: 'blur' }]
+      }
+    }
+  },
+  computed: {},
+  created() {
+    this.editType = this.$route.query.type || 'edit'
+    if (this.editType === 'edit') {
+      console.log('edit')
+      this.editKeyword(this.$route.query.id)
+    }
+  },
+  methods: {
+    async editKeyword(id) {
+      // 获取菜单详情
+      try {
+        const res = await editKeyword({ id: id })
+        this.form = { ...this.form, ...res.data }
+      } catch (error) {
+        console.log('error', error)
+      }
+    },
+    // 显示选择商品弹窗
+    handleDialogVisible() {
+      this.tagsDialogVisible = true
+    },
+    handleGoodDialogVisible(index) {
+      // 显示选择商品弹窗
+      this.addIndex = index
+      this.dialogGoodVisible = true
+    },
+    handleDeleteTags(index) {
+      // 清除子标签
+      this.form.subtag.splice(index, 1)
+    },
+    handleAddTagsConfirm(data) {
+      // 确认选择子标签
+      this.form.subtag = [...this.form.subtag, ...data]
+      this.handleCancel()
+    },
+    onSubmit(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          this.$confirm('是否提交数据', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            console.log('form', this.form)
+            this.saveLabelByState(this.form)
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    async saveLabelByState(params) {
+      // 保存
+      await saveLabelByState(params)
+      this.$message.success('保存成功')
+      setTimeout(() => {
+        this.backToList()
+      }, 1000)
+    },
+    // 取消选择商品
+    handleCancel() {
+      this.tagsDialogVisible = false
+      this.$refs.tagsDialog.visible = false
+    },
+    backToList() {
+      this.$store.dispatch('tagsView/delView', this.$route).then(() => {
+        this.$nextTick(() => {
+          this.$router.replace({ path: '/library/tag/list' })
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style>
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+  float: left;
+}
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+.avatar-uploader-icon {
+  font-size: 30px;
+  color: #999999;
+}
+.el-form-item__label {
+  text-align: right !important;
+}
+.el-upload__tip {
+  line-height: 20px;
+  color: red;
+  text-align: left;
+  position: absolute;
+  right: -50%;
+  bottom: 0;
+}
+.span_tip {
+  font-size: 12px;
+  color: red;
+  margin-left: 5px;
+}
+.filter-item-temp {
+  width: 100px;
+}
+</style>

+ 46 - 22
src/views/sys/menus/list.vue

@@ -5,47 +5,61 @@
       <el-select v-model="listQuery.status" style="width: 140px" class="filter-item" @change="handleFilter">
         <el-option v-for="item in statusOptions" :key="item.key" :label="item.label" :value="item.key" />
       </el-select>
-      <el-button v-if="checkPermission('sys:menu:edit')" class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleCreate">
+      <el-button
+        v-if="checkPermission('sys:menu:edit')"
+        class="filter-item"
+        style="margin-left: 10px"
+        type="primary"
+        icon="el-icon-edit"
+        @click="handleCreate"
+      >
         添加菜单
       </el-button>
     </div>
-    <el-table :key="tableKey" v-loading="listLoading" :data="list" border fit highlight-current-row style="width:100%">
+    <el-table :key="tableKey" v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
       <el-table-column label="序号" align="center" width="50">
         <template slot-scope="scope">{{ scope.$index + 1 }}</template>
       </el-table-column>
       <el-table-column label="菜单ID" align="center">
-        <template slot-scope="{row}">{{ row.id }}</template>
+        <template slot-scope="{ row }">{{ row.id }}</template>
       </el-table-column>
       <el-table-column label="菜单名称" align="center">
-        <template slot-scope="{row}">{{ row.title }}</template>
+        <template slot-scope="{ row }">{{ row.title }}</template>
       </el-table-column>
       <el-table-column label="路由名称" align="center">
-        <template slot-scope="{row}">{{ row.name }}</template>
+        <template slot-scope="{ row }">{{ row.name }}</template>
       </el-table-column>
       <el-table-column label="前端图标" width="80" align="center">
-        <template slot-scope="{row}">
-          <i v-if="isElementIcon(row.icon)" :class="row.icon" />
+        <template slot-scope="{ row }">
+          <i v-if="isElementIcon(row.icon)" :class="row.icon"> </i>
           <svg-icon v-else-if="row.icon" :icon-class="row.icon" />
         </template>
       </el-table-column>
       <el-table-column label="状态" width="80" align="center">
-        <template slot-scope="{row}">
-          <el-switch v-model="row.status" :active-value="0" :inactive-value="1" active-color="#1890ff" inactive-color="#DCDFE6" @change="handleHiddenChange($index, row)" />
+        <template slot-scope="{ row }">
+          <el-switch
+            v-model="row.status"
+            :active-value="0"
+            :inactive-value="1"
+            active-color="#1890ff"
+            inactive-color="#DCDFE6"
+            @change="handleHiddenChange($index, row)"
+          />
         </template>
       </el-table-column>
       <el-table-column label="排序" width="80" align="center">
-        <template slot-scope="{row}">
+        <template slot-scope="{ row }">
           <el-input v-model="row.sort" maxlength="4" minlength="1" @blur="handleOnInputBlur(row)" />
         </template>
       </el-table-column>
       <el-table-column label="设置" width="250" align="center">
-        <template slot-scope="{row}">
+        <template slot-scope="{ row }">
           <el-button plain size="mini" :disabled="row.childCount | disableNextLevel" @click="handleShowNextLevel(row)">查看子菜单</el-button>
           <el-button v-if="checkPermission('sys:menu:edit')" plain size="mini" @click="handleCreateNextLevel(row)">添加子菜单</el-button>
         </template>
       </el-table-column>
       <el-table-column label="操作" width="150" align="center">
-        <template slot-scope="{row}">
+        <template slot-scope="{ row }">
           <el-button v-if="checkPermission('sys:menu:edit')" size="mini" type="primary" @click="handleUpdate(row)">编辑
           </el-button>
           <el-button v-if="checkPermission('sys:menu:del')" size="mini" type="danger" @click="handleDelete(row)">删除
@@ -54,8 +68,13 @@
       </el-table-column>
     </el-table>
 
-    <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
-
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="listQuery.pageNum"
+      :limit.sync="listQuery.pageSize"
+      @pagination="getList"
+    />
   </div>
 </template>
 
@@ -128,7 +147,7 @@ export default {
     },
     getList() {
       this.listLoading = true
-      fetchList(this.listQuery).then(response => {
+      fetchList(this.listQuery).then((response) => {
         this.listLoading = false
         this.list = response.data.results
         this.total = response.data.totalRecord
@@ -145,10 +164,16 @@ export default {
       this.$router.go(-1)
     },
     handleCreate() {
-      this.$router.push({ path: '/sys/menus/add', query: { parentId: this.listQuery.parentId, title: this.parentTitle }})
+      this.$router.push({
+        path: '/sys/menus/add',
+        query: { parentId: this.listQuery.parentId, title: this.parentTitle }
+      })
     },
     handleUpdate(row) {
-      this.$router.push({ path: '/sys/menus/edit', query: { id: row.id, parentId: this.listQuery.parentId, title: this.parentTitle }})
+      this.$router.push({
+        path: '/sys/menus/edit',
+        query: { id: row.id, parentId: this.listQuery.parentId, title: this.parentTitle }
+      })
     },
     handleShowNextLevel(row) {
       this.$router.push({ path: '/sys/menus/list', query: { parentId: row.id, title: row.title }})
@@ -162,7 +187,7 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        deleteMenu(row.id).then(response => {
+        deleteMenu(row.id).then((response) => {
           this.$message({
             message: '删除成功',
             type: 'success',
@@ -174,7 +199,7 @@ export default {
     },
     handleOnInputBlur(row) {
       // 更新排序
-      updateSelective(row.id, { sort: row.sort }).then(response => {
+      updateSelective(row.id, { sort: row.sort }).then((response) => {
         this.$message({
           message: '操作成功',
           type: 'success',
@@ -185,7 +210,7 @@ export default {
     },
     handleHiddenChange(index, row) {
       // 操作开关
-      updateSelective(row.id, { status: row.status }).then(response => {
+      updateSelective(row.id, { status: row.status }).then((response) => {
         this.$message({
           message: '操作成功',
           type: 'success',
@@ -210,5 +235,4 @@ export default {
 }
 </script>
 
-<style scoped>
-</style>
+<style scoped></style>

+ 29 - 11
src/views/sys/users/list.vue

@@ -1,17 +1,24 @@
 <template>
   <div class="app-container">
     <div class="filter-container">
-      <el-button v-permission="'sys:user:edit'" class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleCreate">
+      <el-button
+        v-permission="'sys:user:edit'"
+        class="filter-item"
+        style="margin-left: 10px"
+        type="primary"
+        icon="el-icon-edit"
+        @click="handleCreate"
+      >
         添加用户
       </el-button>
     </div>
-    <el-table :key="tableKey" v-loading="listLoading" :data="list" border fit highlight-current-row style="width:100%">
+    <el-table :key="tableKey" v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
       <el-table-column label="序号" align="center" width="50">
         <template slot-scope="scope">{{ scope.$index + 1 }}</template>
       </el-table-column>
       <el-table-column label="头像" align="center" width="100">
         <template slot-scope="scope">
-          <img :src="scope.row.avatar" alt="" width="50" height="50">
+          <img :src="scope.row.avatar" alt="" width="50" height="50" />
         </template>
       </el-table-column>
       <el-table-column label="登录名" align="center">
@@ -28,14 +35,23 @@
       </el-table-column>
       <el-table-column label="操作" width="200" align="center">
         <template slot-scope="scope">
-          <el-button v-permission="'sys:user:edit'" size="mini" type="primary" @click="handleUpdate(scope.row)">修改</el-button>
-          <el-button v-permission="'sys:user:del'" size="mini" type="danger" @click="handleDelete(scope.row)">删除</el-button>
+          <el-button v-permission="'sys:user:edit'" size="mini" type="primary" @click="handleUpdate(scope.row)">
+            修改
+          </el-button>
+          <el-button v-permission="'sys:user:del'" size="mini" type="danger" @click="handleDelete(scope.row)">
+            删除
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
 
-    <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
-
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="listQuery.pageNum"
+      :limit.sync="listQuery.pageSize"
+      @pagination="getList"
+    />
   </div>
 </template>
 
@@ -83,7 +99,7 @@ export default {
     },
     getList() {
       this.listLoading = true
-      fetchList(this.listQuery).then(response => {
+      fetchList(this.listQuery).then((response) => {
         this.listLoading = false
         console.log(response)
         this.list = response.data.results
@@ -98,7 +114,10 @@ export default {
       this.$router.push({ path: '/sys/users/add' })
     },
     handleUpdate(row) {
-      this.$router.push({ path: '/sys/users/edit', query: { id: row.id }})
+      this.$router.push({
+        path: '/sys/users/edit',
+        query: { id: row.id }
+      })
     },
     handleDelete(row) {
       this.$confirm('是否要删除该用户', '提示', {
@@ -120,5 +139,4 @@ export default {
 }
 </script>
 
-<style scoped>
-</style>
+<style scoped></style>

+ 11 - 6
src/views/user/consult/detail.vue

@@ -185,7 +185,7 @@
               <el-col v-if="item.consultType" :span="12">
                 <b>咨询类别:</b>
                 <el-tag
-                  v-for="(consultType, consultTypeIndex) in item.consultType.split(',')"
+                  v-for="(consultType, consultTypeIndex) in handleFormatStr(item.consultType)"
                   :key="consultTypeIndex"
                   style="margin: 0 1px"
                   type="info"
@@ -214,7 +214,7 @@
               <el-col :span="24">
                 <b>标签词:</b>
                 <el-tag
-                  v-for="(remarks, remarksIndex) in item.remarks.split(',')"
+                  v-for="(remarks, remarksIndex) in handleFormatStr(item.remarks)"
                   :key="remarksIndex"
                   style="margin: 0 1px"
                   type="success"
@@ -236,17 +236,19 @@
                 <b>图片:</b>
               </el-col>
               <el-col :span="24">
-                <div
+                <a
                   v-for="(image, imageIndex) in item.imageList"
                   :key="imageIndex"
+                  :href="image"
                   class="item-image"
+                  target="_blank"
                   style="width: 100px; height: 100px; margin: 5px; float: left"
                 >
                   <el-popover placement="top-start" title="" width="180" trigger="hover">
                     <img :src="image" alt="" style="width: 150px; height: 150px" />
                     <img slot="reference" :src="image" alt="" style="width: 100px; height: 100px" />
                   </el-popover>
-                </div>
+                </a>
               </el-col>
             </el-row>
             <el-row v-if="item.fileList.length > 0" :gutter="24" class="box-row">
@@ -272,7 +274,7 @@
     <!-- 页码 -->
     <pagination
       :total="total"
-      :page-sizes="[20]"
+      :page-sizes="[10, 20, 30, 100]"
       :page-size="20"
       :page.sync="listQuery.pageNum"
       :limit.sync="listQuery.pageSize"
@@ -321,7 +323,7 @@ export default {
     sourceActionsFilters(value) {
       // 客户来源
       const map = {
-        0: '搜引擎',
+        0: '搜引擎',
         1: '小程序',
         2: '公众号',
         3: '小红书',
@@ -434,6 +436,9 @@ export default {
       } catch (error) {
         console.log(error)
       }
+    },
+    handleFormatStr(data) {
+      return data.split(',')
     }
   }
 }

+ 1 - 1
src/views/user/consult/genre-list.vue

@@ -67,7 +67,7 @@
     <!-- 页码 -->
     <pagination
       :total="total"
-      :page-sizes="[20]"
+      :page-sizes="[10, 20, 30, 100]"
       :page-size="20"
       :page.sync="listQuery.pageNum"
       :limit.sync="listQuery.pageSize"

+ 27 - 7
src/views/user/consult/list.vue

@@ -22,7 +22,7 @@
           placeholder="机构名称"
           clearable
           @keyup.enter.native="getList"
-          @clear="getList"
+          @clear="handleClear"
         />
       </div>
       <div class="filter-control">
@@ -240,7 +240,7 @@
               <el-col v-if="item.consultType" :span="12">
                 <b>咨询类别:</b>
                 <el-tag
-                  v-for="(consultType, consultTypeIndex) in item.consultType.split(',')"
+                  v-for="(consultType, consultTypeIndex) in handleFormatStr(item.consultType)"
                   :key="consultTypeIndex"
                   style="margin: 0 1px"
                   type="info"
@@ -269,7 +269,7 @@
               <el-col :span="24">
                 <b>标签词:</b>
                 <el-tag
-                  v-for="(remarks, remarksIndex) in item.remarks.split(',')"
+                  v-for="(remarks, remarksIndex) in handleFormatStr(item.remarks)"
                   :key="remarksIndex"
                   style="margin: 0 1px"
                   type="success"
@@ -291,17 +291,19 @@
                 <b>图片:</b>
               </el-col>
               <el-col :span="24">
-                <div
+                <a
                   v-for="(image, imageIndex) in item.imageList"
                   :key="imageIndex"
+                  :href="image"
                   class="item-image"
+                  target="_blank"
                   style="width: 100px; height: 100px; margin: 5px; float: left"
                 >
                   <el-popover placement="top-start" title="" width="180" trigger="hover">
                     <img :src="image" alt="" style="width: 150px; height: 150px" />
                     <img slot="reference" :src="image" alt="" style="width: 100px; height: 100px" />
                   </el-popover>
-                </div>
+                </a>
               </el-col>
             </el-row>
             <el-row v-if="item.fileList.length > 0" :gutter="24" class="box-row">
@@ -327,7 +329,7 @@
     <!-- 页码 -->
     <pagination
       :total="total"
-      :page-sizes="[20]"
+      :page-sizes="[10, 20, 30, 100]"
       :page-size="20"
       :page.sync="listQuery.pageNum"
       :limit.sync="listQuery.pageSize"
@@ -382,7 +384,7 @@ export default {
       // 客户来源
       console.log('value', value)
       const map = {
-        0: '搜引擎',
+        0: '搜引擎',
         1: '小程序',
         2: '公众号',
         3: '小红书',
@@ -404,6 +406,7 @@ export default {
       listQuery: {
         remarks: '', // 标签词
         consult: '', // 咨询类别
+        clubId: '', // 机构Id
         clubName: '', // 机构名称
         newDeal: '', // 新分配机构状态 0 全部 1 是  2否
         isRegister: '', // 是否注册 0 全部 1 未注册 2已注册
@@ -431,10 +434,24 @@ export default {
   methods: {
     initDate() {
       // 初始化获取当前年月
+      this.handleInfo()
       this.getClassName()
       this.getServiceList(this.listQuery.startTime, this.listQuery.endTime)
       this.getList()
     },
+    handleInfo() {
+      if (this.$route.query.clubId) {
+        this.listQuery.clubId = this.$route.query.clubId
+      }
+      if (this.$route.query.clubName) {
+        this.listQuery.clubName = this.$route.query.clubName
+      }
+    },
+    // 清除机构名称
+    handleClear() {
+      this.listQuery.clubId = ''
+      this.getList()
+    },
     // 选择时间
     handleDatePick() {
       if (this.time && this.time.length > 0) {
@@ -556,6 +573,9 @@ export default {
       this.listQuery.serviceProviderId = item.serviceProviderId
       this.listQuery.pageNum = 1
       this.getList()
+    },
+    handleFormatStr(data) {
+      return data.split(',')
     }
   }
 }

+ 1 - 1
src/views/user/consult/report-list.vue

@@ -117,7 +117,7 @@
     <!-- 页码 -->
     <pagination
       :total="total"
-      :page-sizes="[20]"
+      :page-sizes="[10, 20, 30, 100]"
       :page-size="20"
       :page.sync="listQuery.pageNum"
       :limit.sync="listQuery.pageSize"

+ 11 - 6
src/views/user/consult/unreg-detail.vue

@@ -156,7 +156,7 @@
               <el-col v-if="item.consultType" :span="12">
                 <b>咨询类别:</b>
                 <el-tag
-                  v-for="(consultType, consultTypeIndex) in item.consultType.split(',')"
+                  v-for="(consultType, consultTypeIndex) in handleFormatStr(item.consultType)"
                   :key="consultTypeIndex"
                   style="margin: 0 1px"
                   type="info"
@@ -185,7 +185,7 @@
               <el-col :span="24">
                 <b>标签词:</b>
                 <el-tag
-                  v-for="(remarks, remarksIndex) in item.remarks.split(',')"
+                  v-for="(remarks, remarksIndex) in handleFormatStr(item.remarks)"
                   :key="remarksIndex"
                   style="margin: 0 1px"
                   type="success"
@@ -207,17 +207,19 @@
                 <b>图片:</b>
               </el-col>
               <el-col :span="24">
-                <div
+                <a
                   v-for="(image, imageIndex) in item.imageList"
                   :key="imageIndex"
+                  :href="image"
                   class="item-image"
+                  target="_blank"
                   style="width: 100px; height: 100px; margin: 5px; float: left"
                 >
                   <el-popover placement="top-start" title="" width="180" trigger="hover">
                     <img :src="image" alt="" style="width: 150px; height: 150px" />
                     <img slot="reference" :src="image" alt="" style="width: 100px; height: 100px" />
                   </el-popover>
-                </div>
+                </a>
               </el-col>
             </el-row>
             <el-row v-if="item.fileList.length > 0" :gutter="24" class="box-row">
@@ -243,7 +245,7 @@
     <!-- 页码 -->
     <pagination
       :total="total"
-      :page-sizes="[20]"
+      :page-sizes="[10, 20, 30, 100]"
       :page-size="20"
       :page.sync="listQuery.pageNum"
       :limit.sync="listQuery.pageSize"
@@ -292,7 +294,7 @@ export default {
     sourceActionsFilters(value) {
       // 客户来源
       const map = {
-        0: '搜引擎',
+        0: '搜引擎',
         1: '小程序',
         2: '公众号',
         3: '小红书',
@@ -387,6 +389,9 @@ export default {
       const params = `fileName=${encodeURIComponent(file.fileName)}&ossName=${encodeURIComponent(file.ossName)}`
       const url = process.env.VUE_APP_BASE_API + `/user/remarks/remarks/download?${params}`
       downloadWithUrl(url, file.fileName)
+    },
+    handleFormatStr(data) {
+      return data.split(',')
     }
   }
 }

+ 1 - 1
src/views/user/consult/unreg-list.vue

@@ -72,7 +72,7 @@
     <!-- 页码 -->
     <pagination
       :total="total"
-      :page-sizes="[20]"
+      :page-sizes="[10, 20, 30, 100]"
       :page-size="20"
       :page.sync="listQuery.pageNum"
       :limit.sync="listQuery.pageSize"

+ 48 - 27
src/views/user/record/detail-list.vue

@@ -1,12 +1,20 @@
 <template>
   <div class="app-container">
+    <div v-if="summarize.length > 0" class="tags-sms">
+      <span class="tags-sms-span">意向标签:</span>
+      <el-tag v-for="(sum, sumIndex) in summarize" :key="sumIndex" effect="dark" style="font-size: 15px; margin: 0 2px">
+        {{ sum.value }}
+      </el-tag>
+    </div>
     <!-- 顶部操作区域 -->
-    <div class="filter-container">
+    <div class="filter-container" style="margin-top: 10px">
       <!-- 关键词列表 -->
       <el-table v-loading="isLoading" :data="list" border>
         <el-table-column prop="pagePath" label="页面路径" align="center" width="300">
           <template slot-scope="{ row }">
-            <a v-if="row.accessClient === '0'" style="color:#2fa4e7;" target="_blank" :href="row.pagePath"> {{ row.pagePath }}</a>
+            <a v-if="row.accessClient === '0'" style="color: #2fa4e7" target="_blank" :href="row.pagePath">{{
+              row.pagePath
+            }}</a>
             <span v-else> {{ row.pagePath }} </span>
           </template>
         </el-table-column>
@@ -27,14 +35,9 @@
         </el-table-column>
         <el-table-column prop="pagePath" label="商品图片" align="center" width="100">
           <template v-if="row.productId" slot-scope="{ row }">
-            <el-popover
-              placement="top-start"
-              title=""
-              width="180"
-              trigger="hover"
-            >
-              <img :src="row.productImage" alt="" style="width:150px;height:150px;">
-              <img slot="reference" :src="row.productImage" alt="" style="width:30px;height:30px;">
+            <el-popover placement="top-start" title="" width="180" trigger="hover">
+              <img :src="row.productImage" alt="" style="width: 150px; height: 150px" />
+              <img slot="reference" :src="row.productImage" alt="" style="width: 80px; height: 80px" />
             </el-popover>
           </template>
           <template v-else>
@@ -64,8 +67,8 @@
       <!-- 页码 -->
       <pagination
         :total="total"
-        :page-sizes="[20]"
-        :page-size="20"
+        :page-sizes="[10, 20, 30, 100]"
+        :page-size="100"
         :page.sync="listQuery.pageNum"
         :limit.sync="listQuery.pageSize"
         @pagination="fetchBehaviorList"
@@ -83,14 +86,14 @@ export default {
     accessSourceFilters(value) {
       // 公司类型
       const map = {
-        '0': '直接访问',
-        '1': '百度搜索',
-        '2': '360搜索',
-        '3': '谷歌搜索',
-        '4': '神马搜索',
-        '5': '头条搜索',
-        '6': '搜狗搜索',
-        '7': '直接访问'
+        0: '直接访问',
+        1: '百度搜索',
+        2: '360搜索',
+        3: '谷歌搜索',
+        4: '神马搜索',
+        5: '头条搜索',
+        6: '搜狗搜索',
+        7: '直接访问'
       }
       return map[value]
     }
@@ -98,20 +101,19 @@ export default {
   data() {
     return {
       isLoading: true,
+      summarize: [],
       listQuery: {
         ip: '',
         accessDate: '',
         userId: 0,
         pageNum: 1,
-        pageSize: 20
+        pageSize: 100
       },
       list: [],
       total: 0
     }
   },
-  computed: {
-
-  },
+  computed: {},
   created() {
     this.listQuery = { ...this.listQuery, ...this.$route.query }
     console.log('listQuery', this.listQuery)
@@ -128,8 +130,10 @@ export default {
       try {
         this.isLoading = true
         const res = await fetchBehaviorList(this.listQuery)
-        this.list = res.data.results
-        this.total = res.data.totalRecord
+        const data = res.data
+        this.summarize = data.label
+        this.list = data.page.results
+        this.total = data.page.totalRecord
         this.isLoading = false
       } catch (error) {
         console.log(error)
@@ -143,4 +147,21 @@ export default {
 }
 </script>
 
-<style></style>
+<style>
+.tags-sms {
+  width: 100%;
+  height: auto;
+  font-size: 14px;
+  color: #666666;
+  line-height: 40px;
+  border-radius: 4px;
+  box-sizing: border-box;
+  padding: 5px;
+  border: 1px solid #e1e1e1;
+}
+.tags-sms .tags-sms-span {
+  font-size: 18px;
+  font-weight: bold;
+  color: #333333;
+}
+</style>

+ 68 - 9
src/views/user/record/list.vue

@@ -82,6 +82,20 @@
             <el-option v-for="item in tagsOptions" :key="item.id" :label="item.value" :value="item.value" />
           </el-select>
         </div>
+        <div class="filter-control">
+          <span>父标签:</span>
+          <el-select v-model="listQuery.pageLabels" filterable @change="getList">
+            <el-option value="" label="请选择" />
+            <el-option v-for="item in labelsOptions" :key="item.id" :label="item.value" :value="item.value" />
+          </el-select>
+        </div>
+        <div class="filter-control">
+          <span>页面类型:</span>
+          <el-select v-model="listQuery.pageTypes" filterable @change="getList">
+            <el-option value="" label="请选择" />
+            <el-option v-for="item in typesOptions" :key="item.id" :label="item.pageType" :value="item.pageType" />
+          </el-select>
+        </div>
         <div v-if="tabsCurrent === 1" class="filter-control">
           <span>访问日期:</span>
           <el-date-picker
@@ -191,7 +205,7 @@
       <!-- 页码 -->
       <pagination
         :total="total"
-        :page-sizes="[100]"
+        :page-sizes="[10, 20, 30, 100]"
         :page-size="100"
         :page.sync="listQuery.pageNum"
         :limit.sync="listQuery.pageSize"
@@ -203,13 +217,14 @@
 
 <script>
 import { downloadWithUrl } from '@/utils'
-import { fetchRecordList } from '@/api/user/record/record'
+import { fetchRecordList, getKeyword, getPageType } from '@/api/user/record/record'
 import { fetchShopRelevanceList, searchBehaviorList } from '@/api/user/supplier/supplier'
 import { export_json_to_excel } from '@/vendor/Export2Excel'
 import pickerOptions from '@/utils/time-picker.js'
 const defaultListQuery = {
   todayType: 0, // 0 今日数据 1 以往数据
   ip: '', // 访问人ID
+  clubId: '', // 机构Id
   corporateName: '', // 公司名称
   companyType: '', // 公司类型
   accessClient: '', // 访问客户端
@@ -218,6 +233,8 @@ const defaultListQuery = {
   contacts: '', //  联系人
   phoneNumber: '', // 手机号
   spName: '', // 协销
+  pageTypes: '', // 页面类型
+  pageLabels: '', // 父级标签
   startTime: '',
   endTime: '',
   pageNum: 1,
@@ -262,6 +279,8 @@ export default {
       total: 0,
       currentList: [],
       supplierList: [], // 关联供应商列表
+      labelsOptions: [], // 父级标签
+      typesOptions: [], // 页面类型
       tagsOptions: [],
       tagsList: [],
       tabsCurrent: 0,
@@ -278,16 +297,18 @@ export default {
     }
   },
   created() {
-    console.log('query', this.$route.query)
     if (this.$route.query.type === 'second') {
       this.activeName = 'second'
       this.tabsCurrent = this.listQuery.todayType = 1
-      this.listQuery.corporateName = this.$route.query.corporateName
-      this.time.push(this.$route.query.startTime)
-      this.time.push(this.$route.query.endTime)
+    } else {
+      this.activeName = 'first'
+      this.tabsCurrent = this.listQuery.todayType = 0
     }
     this.getHeigth()
+    this.handleInfo()
     this.getList()
+    this.getKeyword()
+    this.getPageType()
   },
   mounted() {
     // window.onresize:浏览器尺寸变化响应事件
@@ -310,14 +331,35 @@ export default {
       }
       console.log('tabheight', this.tableheight)
     },
+    handleInfo() {
+      // 初始化
+      console.log('query', this.$route.query)
+      if (this.$route.query.type === 'second') {
+        this.listQuery.clubId = this.$route.query.clubId
+        this.listQuery.corporateName = this.$route.query.corporateName
+        this.time.push(this.$route.query.startTime)
+        this.time.push(this.$route.query.endTime)
+      } else {
+        this.listQuery.clubId = this.$route.query.clubId
+        this.listQuery.corporateName = this.$route.query.corporateName
+      }
+    },
     // tab切换
     handleClick(tab, event) {
       if (tab.name === 'first') {
-        this.listQuery = Object.assign({}, defaultListQuery)
+        if (this.$route.query.type) {
+          this.handleInfo()
+        } else {
+          this.listQuery = Object.assign({}, defaultListQuery)
+        }
         this.tabsCurrent = this.listQuery.todayType = 0
         this.getList()
       } else if (tab.name === 'second') {
-        this.listQuery = Object.assign({}, defaultListQuery)
+        if (this.$route.query.type) {
+          this.handleInfo()
+        } else {
+          this.listQuery = Object.assign({}, defaultListQuery)
+        }
         this.tabsCurrent = this.listQuery.todayType = 1
         this.getList()
       }
@@ -354,7 +396,24 @@ export default {
         console.log(error)
       }
     },
-
+    // 获取父级标签列表
+    async getKeyword() {
+      try {
+        const res = await getKeyword()
+        this.labelsOptions = res.data
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 获取页面类型列表
+    async getPageType() {
+      try {
+        const res = await getPageType()
+        this.typesOptions = res.data
+      } catch (error) {
+        console.log(error)
+      }
+    },
     // 获取关联供应商列表选项
     async fetchShopRelevanceList() {
       try {

+ 26 - 13
src/views/wechat/components/menusForm.vue

@@ -1,11 +1,11 @@
 <template>
   <div class="app-container">
-    <el-page-header :content="isEdit?'编辑菜单':'添加菜单'" @back="goBack" />
+    <el-page-header :content="isEdit ? '编辑菜单' : '添加菜单'" @back="goBack" />
     <el-card class="form-container" shadow="never">
       <el-form ref="weChatMenuFrom" :model="menu" :rules="rules" label-width="150px">
         <el-form-item label="上级菜单:" prop="parentId">
           <el-input v-model="parentTitle" readonly />
-          <input v-model="menu.parentId" type="hidden">
+          <input v-model="menu.parentId" type="hidden" />
         </el-form-item>
         <el-form-item label="菜单标题:" prop="name">
           <el-input v-model="menu.name" />
@@ -27,19 +27,33 @@
             <el-option value="location_select" label="弹出地理位置选择器" />
           </el-select>
         </el-form-item>
-        <el-form-item v-show="menu.type=='view'" label="网页链接:" prop="url">
+        <el-form-item v-show="menu.type == 'view'" label="网页链接:" prop="url">
           <el-input v-model="menu.url" />
         </el-form-item>
-        <el-form-item v-show="menu.type=='miniprogram'" label="小程序APPID:" prop="appid">
+        <el-form-item v-show="menu.type == 'miniprogram'" label="小程序APPID:" prop="appid">
           <el-input v-model="menu.appid" />
         </el-form-item>
-        <el-form-item v-show="menu.type=='miniprogram'" label="小程序页面链接:" prop="pagePath">
+        <el-form-item v-show="menu.type == 'miniprogram'" label="小程序页面链接:" prop="pagePath">
           <el-input v-model="menu.pagePath" />
         </el-form-item>
-        <el-form-item v-show="menu.type=='view_limited' || menu.type=='media_id'" label="mediaId:" prop="mediaId">
+        <el-form-item v-show="menu.type == 'view_limited' || menu.type == 'media_id'" label="mediaId:" prop="mediaId">
           <el-input v-model="menu.mediaId" />
         </el-form-item>
-        <el-form-item v-show="['click','scancode_push','scancode_waitmsg','pic_sysphoto','pic_photo_or_album','pic_weixin','location_select'].indexOf(menu.type)>=0" label="KEY:" prop="key">
+        <el-form-item
+          v-show="
+            [
+              'click',
+              'scancode_push',
+              'scancode_waitmsg',
+              'pic_sysphoto',
+              'pic_photo_or_album',
+              'pic_weixin',
+              'location_select'
+            ].indexOf(menu.type) >= 0
+          "
+          label="KEY:"
+          prop="key"
+        >
           <el-input v-model="menu.key" />
         </el-form-item>
         <el-form-item label="排序:">
@@ -99,7 +113,7 @@ export default {
       if (this.$route.query.id) {
         this.menu.id = this.$route.query.id
         this.isEdit = true
-        getMenu(this.menu.id).then(response => {
+        getMenu(this.menu.id).then((response) => {
           this.menu.name = response.data.name
           this.menu.type = response.data.type
           this.menu.url = response.data.url
@@ -129,7 +143,7 @@ export default {
       this.getFormData()
     },
     onSubmit(formName) {
-      this.$refs[formName].validate(valid => {
+      this.$refs[formName].validate((valid) => {
         console.log(this.menu)
         if (valid) {
           this.$confirm('是否提交数据', '提示', {
@@ -139,7 +153,7 @@ export default {
           }).then(() => {
             const self = this
             if (this.isEdit) {
-              updateMenu(this.$route.query.id, this.menu).then(response => {
+              updateMenu(this.$route.query.id, this.menu).then((response) => {
                 this.$message({
                   message: '修改成功',
                   type: 'success',
@@ -148,7 +162,7 @@ export default {
                 self.goBack()
               })
             } else {
-              createMenu(this.menu).then(response => {
+              createMenu(this.menu).then((response) => {
                 this.$refs[formName].resetFields()
                 this.resetForm(formName)
                 this.$message({
@@ -174,5 +188,4 @@ export default {
 }
 </script>
 
-<style scoped>
-</style>
+<style scoped></style>

Some files were not shown because too many files changed in this diff