Explorar o código

Merge branch 'main' into feature/v1.0.92

yuelujie hai 5 meses
pai
achega
724701b1fc

+ 4 - 6
apps/bigmember_pc/src/components/common/MonitorPopover.vue

@@ -10,15 +10,13 @@
       >
         {{ textConfig.more }}
       </li>
-      <!-- <li
+      <li
         class="monitor-more-actions"
         :class="{ 'b-style-none': !followedGroup }"
         v-if="followedGroup"
       >
-        <div style="color: #686868;">{{ textConfig.group }}</div>
-        <div
-          class="flex flex-(items-center justify-between)"
-          >
+        <div style="color: #686868">{{ textConfig.group }}</div>
+        <div class="flex flex-(items-center justify-between)">
           <span class="list-center ellipsis list-group-name">
             {{ followedGroup }}
           </span>
@@ -30,7 +28,7 @@
             <i class="el-icon-arrow-right"></i>
           </span>
         </div>
-      </li> -->
+      </li>
       <li v-if="showList">
         <div class="list-top" @click="$emit('click', 'list')">
           <span>{{ textConfig.list }}</span>

+ 5 - 0
apps/bigmember_pc/src/components/dialog/Dialog.vue

@@ -92,6 +92,11 @@ export default {
       default: false
     }
   },
+  watch: {
+    visible(val) {
+      //  console.log(val, 'visible')
+    }
+  },
   methods: {
     update(e) {
       this.$emit('update:visible', e)

+ 119 - 3
apps/bigmember_pc/src/components/forecast/ForFilter.vue

@@ -6,7 +6,7 @@
       <!-- <div>
         <GroupTag selectorType="line" @onChange="getGroupTag"></GroupTag>
       </div> -->
-      <div class="selected-list">
+      <div class="selected-list flex-1">
         <el-tag
           class="tag-item"
           :class="tag.checked ? 'active' : ''"
@@ -17,6 +17,9 @@
           >{{ tag.name }}</el-tag
         >
       </div>
+      <el-button class="search-btn" @click="dialog.group = true"
+        >分组管理</el-button
+      >
     </div>
     <div class="filter-item">
       <span class="item-label">企业名称:</span>
@@ -35,12 +38,56 @@
         >
       </div>
     </div>
+    <!-- 分组dialog -->
+    <common-dialog
+      custom-class="monitor-class"
+      :visible.sync="dialog.group"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      :show-close="true"
+      :destroy-on-close="true"
+      center
+      title="分组管理"
+      width="464px"
+      :showFooter="false"
+    >
+      <MonitorGroup
+        :list="manageGroupList"
+        :is-manage="true"
+        @emitDisabled="onGroupDisabled"
+        @add="onAddGroup"
+        @edit="onEditGroup"
+        @delete="onDeleteGroup"
+      ></MonitorGroup>
+    </common-dialog>
+    <common-dialog
+      custom-class="monitor-class"
+      :visible.sync="dialog.delete"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      :destroy-on-close="true"
+      center
+      title="删除分组"
+      width="380px"
+    >
+      删除后,该分组内的企业将自动移至“默认分组”,是否确认删除?
+      <template #footer>
+        <button class="action-button confirm" @click="confirmDeleteGroup">
+          确定
+        </button>
+        <button class="action-button cancel" @click="dialog.delete = false">
+          取消
+        </button>
+      </template>
+    </common-dialog>
   </div>
 </template>
 
 <script>
 import { Input, Button, Tag } from 'element-ui'
 import GroupTag from '@/components/selector/GroupSelectorContent.vue'
+import commonDialog from '@/components/dialog/Dialog.vue'
+import MonitorGroup from '@/composables/quick-monitor/component/MonitorGroup.vue'
 export default {
   name: 'ent-filter',
   props: {
@@ -54,13 +101,22 @@ export default {
     [Input.name]: Input,
     [Button.name]: Button,
     [Tag.name]: Tag,
-    GroupTag
+    GroupTag,
+    commonDialog,
+    MonitorGroup
   },
   data() {
     return {
       formatGroupList: [],
       entVal: '',
-      curGroup: ''
+      curGroup: '',
+      dialog: {
+        group: false,
+        delete: false
+      },
+      groupActionDisabled: false,
+      manageGroupList: [],
+      deleteGroupId: ''
     }
   },
   destroyed() {
@@ -83,6 +139,9 @@ export default {
           checked: selectedGroup.includes(item.id)
         }
       })
+      this.manageGroupList = this.groupList.filter((item, index) => {
+        return item.name !== '全部'
+      })
     },
     getGroupTag(data) {
       this.curGroup = data
@@ -158,6 +217,44 @@ export default {
         }
       })
       return data.toString()
+    },
+    // 编辑分组弹框确定/取消按钮是否禁用
+    onGroupDisabled(val) {
+      this.groupActionDisabled = val
+      this.$forceUpdate()
+    },
+    // 新增分组
+    onAddGroup(data) {
+      this.$emit('updateGroup', {
+        type: 'add',
+        name: data?.name
+      })
+    },
+    // 编辑分组
+    onEditGroup(data) {
+      this.$emit('updateGroup', {
+        type: 'put',
+        groupId: data?.groupId,
+        name: data?.name
+      })
+    },
+    // 删除分组
+    onDeleteGroup(data) {
+      this.dialog.delete = true
+      // this.$emit('updateGroup', {
+      //   type: 'del',
+      //   groupId: data?.groupId
+      // })
+      this.deleteGroupId = data?.groupId
+    },
+    confirmDeleteGroup() {
+      this.curGroup = ''
+      this.$emit('updateGroup', {
+        type: 'del',
+        groupId: this.deleteGroupId
+      })
+      this.dialog.delete = false
+      this.$emit('updateList')
     }
   }
 }
@@ -229,4 +326,23 @@ export default {
     }
   }
 }
+::v-deep {
+  .monitor-class {
+    padding: 32px;
+    left: 50%;
+    top: 50%;
+    transform: translate(-50%, -50%);
+    margin: 0px !important;
+    .el-dialog__header {
+      padding: 0;
+    }
+    .el-dialog__body {
+      padding: 20px 0 32px;
+      text-align: center;
+    }
+    .el-dialog__footer {
+      padding: 0;
+    }
+  }
+}
 </style>

+ 18 - 12
apps/bigmember_pc/src/components/forecast/ForeCast.vue

@@ -146,7 +146,7 @@
     <!-- 企业情报 -->
     <div v-if="type == 'entintel'" style="padding: 0 40px">
       <div class="entintel-thead">
-        <span style="width: 810px">企业</span>
+        <span style="width: 800px">企业</span>
         <span style="width: 100px" class="thead-flex">
           <em>更新时间</em>
           <el-tooltip class="item" effect="dark" placement="top">
@@ -160,7 +160,7 @@
             <i class="icon-quesion"></i>
           </el-tooltip>
         </span>
-        <span style="width: 100px">分组</span>
+        <span style="width: 120px">分组</span>
         <span style="width: 100px">操作</span>
       </div>
       <ul
@@ -180,7 +180,7 @@
           :key="index"
         >
           <div
-            style="padding: 0 12px; width: 810px; cursor: pointer"
+            style="padding: 0 12px; width: 800px; cursor: pointer"
             @click="goViewEnt(item.s_entId, item)"
           >
             <div class="list_name ent_li_name visited-hd">
@@ -224,11 +224,11 @@
                 : '--'
             }}
           </div>
-          <div class="list_li_item item-flex-column">
+          <div class="list_li_item item-flex-column" style="width: 120px">
             <span
               v-for="(s, j) in formatGroup(item.s_grousp)"
               :key="'00' + j"
-              style="line-height: 20px"
+              class="item-group-name"
               >{{ s }}</span
             >
           </div>
@@ -1078,13 +1078,10 @@ export default {
         if (res.data === 'success') {
           this.$toast('修改分组成功')
           this.dialog.group = false
-          this.$emit(
-            'onPageChange',
-            num,
-            filter.entVal ? filter.entVal : '',
-            filter.group ? filter.group : '',
-            this.listState.pageSize
-          )
+          this.$emit('onPageChange')
+          this.$emit('updateGroup', {
+            type: 'get'
+          })
         } else {
           this.$toast(res.error_msg)
         }
@@ -1382,6 +1379,14 @@ export default {
       flex-direction: column;
       align-items: center;
     }
+    .item-group-name {
+      display: block;
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      width: 100%;
+      line-height: 20px;
+    }
   }
 
   .add-btn {
@@ -1482,6 +1487,7 @@ export default {
           font-size: 14px;
           color: #2cb7ca;
           font-weight: 400;
+          //white-space: nowrap;
 
           .unit_label {
             color: #999999;

+ 39 - 11
apps/bigmember_pc/src/components/push-list/PotentialList.vue

@@ -23,7 +23,7 @@
       <div
         v-for="(item, index) in getListData"
         :key="index"
-        @click="$emit('goDetail', item)"
+        @click.prevent="$emit('goDetail', item)"
       >
         <div v-show="!item.remove" class="flex-r-c center sb card-list-item">
           <div class="flex-c-c left">
@@ -55,14 +55,32 @@
             class="pcor-right-group flex-c-c right"
             v-if="filters.pcor === 'R'"
           >
-            <div class="flex-r-c center" @click.stop="changeFollow(item)">
-              <i
-                :class="
-                  'el-icon-jy-heart_' + (item.follow ? 'solid' : 'stroke')
-                "
-              ></i>
-              <span>{{ item.follow ? '已' : '' }}关注</span>
-            </div>
+            <!-- <el-popover placement="left" width="224" trigger="hover">
+              <div slot="reference" class="flex-r-c center" @click.stop="changeFollow(item)">
+                <i
+                  class="icon iconfont"
+                  :class="{
+                    'icon-yijiankong': item.follow,
+                    'icon-jiankong': !item.follow
+                  }"
+                ></i>
+                <span>{{ item.follow ? '已' : '' }}监控</span>
+              </div>
+              <monitor-com
+                @showNeedSubmit="showNeedSubmit"
+                @show="monitorInfo.showD4 = true"
+                :already-num="monitorInfo.alreadyNum"
+                :remain-num="monitorInfo.remainNum"
+                :show-list="monitorInfo.showList"
+              ></monitor-com>
+            </el-popover> -->
+            <quick-monitor
+              class="action-item"
+              type="ent"
+              :params="item.entId"
+              placement="bottom-end"
+              :source="sourceMap"
+            ></quick-monitor>
             <span @click.stop="changeDelete(item)"
               >不是我的潜在竞争对手/合作伙伴</span
             >
@@ -170,6 +188,7 @@ import GroupCard from '@/components/selector/GroupSelector.vue'
 import monitorCom from '@/components/common/Monitor.vue'
 import { moneyUnit, scrollTargetView } from '@/utils/'
 import { getCorList, getStatusCustomer } from '@/api/modules/'
+import QuickMonitor from '@/composables/quick-monitor/component/QuickMonitor.vue'
 
 export default {
   name: 'potential-list',
@@ -183,7 +202,8 @@ export default {
     GroupCard,
     monitorCom,
     CollectInfo,
-    commonDialog
+    commonDialog,
+    QuickMonitor
   },
   filters: {
     formatMoney(value) {
@@ -264,6 +284,10 @@ export default {
         showD2: false,
         showD3: false,
         showD4: false
+      },
+      sourceMap: {
+        limit: 'pc_ent_limit',
+        more: 'pc_ent_more'
       }
     }
   },
@@ -469,7 +493,7 @@ export default {
     padding: 0;
   }
   .el-dialog__body {
-    padding: 0 !important;
+    // padding: 0 !important;
   }
   .empty-container {
     margin-top: 60px;
@@ -495,6 +519,10 @@ export default {
       padding: 0;
     }
   }
+  .quick-monitor-popover .action-icon > span {
+    font-size: 13px;
+    color: #686868;
+  }
 }
 .sub-manager {
   display: flex;

+ 95 - 29
apps/bigmember_pc/src/composables/quick-monitor/component/MonitorGroup.vue

@@ -12,6 +12,11 @@ const props = defineProps({
   list: {
     type: Array,
     default: () => []
+  },
+  // 是否是管理分组
+  isManage: {
+    type: Boolean,
+    default: false
   }
 })
 
@@ -23,7 +28,7 @@ const isDisabled = ref(false)
 const currentSelect = ref([])
 
 // 冒泡事件名
-const emits = defineEmits(['emitDisabled', 'onChange', 'onAdd', 'onEdit'])
+const emits = defineEmits(['emitDisabled', 'onChange', 'add', 'edit', 'delete'])
 
 onMounted(() => {
   initData()
@@ -53,6 +58,7 @@ function initData() {
       input: '',
       showEdit: false,
       canEdit: v.isPut,
+      count: v.count,
       checked: currentSelect.value.length
         ? currentSelect.value.includes(v.id)
         : v.isSelect
@@ -112,13 +118,19 @@ function onItemConfirm(item) {
   if (!item.input) {
     return that.$toast('请输入分组名称')
   }
-  if (list.some((v) => v.name === item.input)) {
+  if (list.some((v) => v.name === item.input) && item.input !== item.name) {
     return that.$toast('分组名称已存在')
   }
-  item.name = item.input
-  item.showEdit = false
-  isDisabled.value = false
-  emits('edit', { groupId: item.id, name: item.name })
+  if (item.input !== item.name) {
+    item.name = item.input
+    item.showEdit = false
+    isDisabled.value = false
+    emits('edit', { groupId: item.id, name: item.name })
+  } else {
+    console.log('分组名称未修改')
+    item.showEdit = false
+    isDisabled.value = false
+  }
 }
 // 单项编辑取消方法
 function onItemCancel(item) {
@@ -127,6 +139,7 @@ function onItemCancel(item) {
 }
 // 分组名称选中事件
 function changeGroupState(item) {
+  if (props.isManage) return
   const list = groupList.value
   if (item.name === '默认分组') {
     list.forEach((v) => {
@@ -174,6 +187,12 @@ function setGroupSelected(data) {
   })
 }
 
+// 删除分组
+function onDeleteGroup(item) {
+  if (!props.isManage) return
+  emits('delete', { groupId: item.id, name: item.name })
+}
+
 defineExpose({
   getSelected
 })
@@ -192,6 +211,7 @@ defineExpose({
           maxlength="15"
           autofocus
           @keyup.enter.native="onAddConfirm"
+          @click.stop.native
         >
           <template #suffix>
             <span class="el-input__count">
@@ -205,15 +225,15 @@ defineExpose({
           </template>
         </el-input>
         <div class="flex flex-items-center add-action">
-          <span class="add-confirm" @click="onAddConfirm">确定</span>
-          <span class="add-cancel" @click="onAddCancel">取消</span>
+          <span class="add-confirm" @click.stop="onAddConfirm">确定</span>
+          <span class="add-cancel" @click.stop="onAddCancel">取消</span>
         </div>
       </div>
       <el-button
         v-else
         type="text"
         icon="el-icon-plus"
-        @click="onAddAction"
+        @click.stop="onAddAction"
         class="add-btn"
       >
         新增分组
@@ -225,27 +245,51 @@ defineExpose({
           v-if="!item.showEdit"
           class="flex flex-(items-center justify-between) item-name-container"
           :class="{ 'item-name-checked': item.checked }"
-          @click="changeGroupState(item)"
+          @click.stop="changeGroupState(item)"
         >
           <div class="flex flex-items-center flex-1">
-            <div
-              v-if="item.name === '默认分组'"
-              class="j-radio"
-              :class="item.checked ? 'r-checked' : ''"
-            ></div>
-            <div
-              v-else
-              class="j-checkbox"
-              :class="item.checked ? 'checked' : ''"
-            ></div>
-            <span class="item-name" :data-id="item.id">{{ item.name }}</span>
+            <div v-if="!isManage" class="flex flex-items-center">
+              <span
+                v-if="item.name === '默认分组'"
+                class="j-radio"
+                :class="item.checked ? 'r-checked' : ''"
+              ></span>
+              <span
+                v-else
+                class="j-checkbox"
+                :class="item.checked ? 'checked' : ''"
+              ></span>
+            </div>
+            <span class="item-name" :data-id="item.id"
+              >{{ item.name
+              }}<em v-if="isManage">({{ item.count }})</em></span
+            >
+          </div>
+          <!-- 管理分组 -->
+          <div v-if="isManage" class="flex flex-items-center">
+            <span
+              class="item-manage-edit"
+              v-if="item.canEdit"
+              @click.stop="onEditGroup(item)"
+              >编辑</span
+            >
+            <span
+              v-if="item.canEdit"
+              class="item-delete"
+              @click.stop="onDeleteGroup(item)"
+            >
+              删除
+            </span>
+          </div>
+          <!-- 非管理分组 -->
+          <div v-else>
+            <span
+              class="item-edit"
+              v-if="item.canEdit"
+              @click.stop="onEditGroup(item)"
+              >编辑</span
+            >
           </div>
-          <span
-            class="item-edit"
-            v-if="item.canEdit"
-            @click.stop="onEditGroup(item)"
-            >编辑</span
-          >
         </div>
         <div
           v-else
@@ -259,6 +303,7 @@ defineExpose({
             autofocus
             @input="onItemInput($event, item)"
             @keyup.enter.native="onItemConfirm(item)"
+            @click.stop.native
           >
             <template #suffix>
               <span class="el-input__count">
@@ -272,8 +317,12 @@ defineExpose({
             </template>
           </el-input>
           <div class="flex items-center add-action">
-            <span class="add-confirm" @click="onItemConfirm(item)">确定</span>
-            <span class="add-cancel" @click="onItemCancel(item)">取消</span>
+            <span class="add-confirm" @click.stop="onItemConfirm(item)"
+              >确定</span
+            >
+            <span class="add-cancel" @click.stop="onItemCancel(item)"
+              >取消</span
+            >
           </div>
         </div>
       </div>
@@ -341,6 +390,17 @@ defineExpose({
       cursor: pointer;
       line-height: 22px;
     }
+    .item-manage-edit {
+      color: $color_main;
+      cursor: pointer;
+      line-height: 22px;
+    }
+    .item-delete {
+      margin-left: 12px;
+      color: #1d1d1d;
+      cursor: pointer;
+      line-height: 22px;
+    }
     .group-item {
       cursor: pointer;
       &:hover {
@@ -444,6 +504,12 @@ defineExpose({
         background-image: url('~@/assets/images/icon/checkbox_checked_disabled.png');
       }
     }
+    .item-manage-edit,
+    .item-delete {
+      color: #999999;
+      pointer-events: none;
+      cursor: not-allowed;
+    }
   }
 }
 </style>

+ 16 - 6
apps/bigmember_pc/src/composables/quick-monitor/component/QuickMonitor.vue

@@ -23,6 +23,10 @@ const props = defineProps({
   source: {
     type: Object,
     default: () => ({})
+  },
+  placement: {
+    type: String,
+    default: 'bottom'
   }
 })
 
@@ -44,9 +48,10 @@ const {
   collectElement,
   // 分组
   groupList,
-  doChangeGroup,
+  changeGroup,
   doUpdateGroup,
-  eleLoading
+  eleLoading,
+  echoGroup
 } = useQuickMonitorModel({
   type: props.type,
   id: props.params,
@@ -78,14 +83,14 @@ function onEditGroup(data) {
 
 // 选择分组组件change回调事件
 function onChangeGroup(id) {
-  doChangeGroup(id)
+  changeGroup(id)
 }
 
 function doClickMonitorActionsFn(item) {
   //  未触发子组件change事件时,手动获取选中的分组
   if (groupRef.value) {
     const selected = groupRef.value.getSelected()
-    doChangeGroup(selected)
+    changeGroup(selected)
   }
   doClickMonitorActions(item.action || 'doCloseDialog')
 }
@@ -101,7 +106,7 @@ defineExpose({
     <div class="quick-monitor-popover">
       <el-popover
         popper-class="monitor-popover"
-        placement="bottom"
+        :placement="placement"
         :append-to-body="false"
         width="224"
         trigger="hover"
@@ -137,6 +142,7 @@ defineExpose({
       :destroy-on-close="true"
       :visible="dialogConfig.show"
       :title="dialogConfig.title"
+      @click.native.stop
     >
       <template #footer>
         <button
@@ -145,7 +151,7 @@ defineExpose({
           class="action-button"
           :class="item.class"
           :disabled="item.disabled"
-          @click="doClickMonitorActionsFn(item)"
+          @click.stop="doClickMonitorActionsFn(item)"
         >
           {{ item.label }}
         </button>
@@ -155,6 +161,7 @@ defineExpose({
         v-if="dialogConfig.template === 'group'"
         ref="groupRef"
         :list="groupList"
+        :echo="echoGroup"
         @emitDisabled="onGroupDisabled"
         @onChange="onChangeGroup"
         @add="onAddGroup"
@@ -212,6 +219,9 @@ defineExpose({
       padding: 0;
     }
   }
+  .action-button {
+    font-size: 16px;
+  }
   .action-button.cancel[disabled] {
     background-color: #e3e4e5;
     color: #999999;

+ 17 - 2
apps/bigmember_pc/src/composables/quick-monitor/use/base.js

@@ -68,7 +68,13 @@ export function useMonitorModel(
       id
     }
   })
-  const { doFetch: doRunFetch, doChange, doFetchGroup } = useMonitor
+  const {
+    doFetch: doRunFetch,
+    doChange,
+    doFetchGroup,
+    doChangeGroup,
+    doOnlyGroup
+  } = useMonitor
 
   function getId() {
     return useMonitor.id
@@ -92,5 +98,14 @@ export function useMonitorModel(
     return await doRunFetch()
   }
 
-  return { model, doChange, doFetch, getId, doFetchGroup, groupList }
+  return {
+    model,
+    doChange,
+    doFetch,
+    getId,
+    doFetchGroup,
+    groupList,
+    doChangeGroup,
+    doOnlyGroup
+  }
 }

+ 70 - 22
apps/bigmember_pc/src/composables/quick-monitor/use/ent.js

@@ -1,4 +1,4 @@
-import { computed, getCurrentInstance, ref } from 'vue'
+import { computed, getCurrentInstance, nextTick, ref } from 'vue'
 import { useMonitorModel, useMonitorTipDialog } from './base'
 import { useStore } from '@/store'
 import {
@@ -81,6 +81,23 @@ const DialogDataMap = {
   },
   'success-toast': '监控成功,您可前往“工作台-商机-企业情报监控”查看',
   'monitor-group': {
+    title: '选择分组',
+    width: '464px',
+    template: 'group',
+    footerActions: [
+      {
+        label: '确定',
+        class: 'confirm',
+        action: 'confirmSelectGroup'
+      },
+      {
+        label: '取消',
+        class: 'cancel',
+        action: ''
+      }
+    ]
+  },
+  'monitor-change-group': {
     title: '选择分组',
     width: '464px',
     template: 'group',
@@ -115,11 +132,20 @@ function useEntQuickMonitorModel({ type, id, source }, options) {
     return store.getters['user/isSuper']
   })
   const loading = ref(false)
-  const { model, doChange, doFetch, getId, doFetchGroup, groupList }
-    = useMonitorModel({ type, id }, options)
+  const {
+    model,
+    doChange,
+    doFetch,
+    getId,
+    doFetchGroup,
+    groupList,
+    doChangeGroup,
+    doOnlyGroup
+  } = useMonitorModel({ type, id }, options)
   const { limit: limitSource, more: moreSource } = source
 
   const eleLoading = ref(false)
+  const echoGroup = ref('')
 
   const monitorPopoverConfig = computed(() => {
     return {
@@ -146,29 +172,29 @@ function useEntQuickMonitorModel({ type, id, source }, options) {
 
   // 打开监控分组弹框(更改)
   async function doOpenSelectGroup() {
-    // doOpenDialog('monitor-group')
-    await doFetchGroup({ type: 'get' }).then((res) => {
+    await doOnlyGroup({ type: 'get' }).then((res) => {
       if (res.success) {
-        doOpenDialog('monitor-group', { groupList: res.data })
-      }
-      else {
-        if (res.data?.limit_count) {
-          if (IsFreeUser.value || IsSVipUser.value) {
-            return doOpenCollectDialog(limitSource || 'pc_article_ent_limit')
-          }
-          else {
-            return doOpenDialog('max-monitor', {
-              count: res.data?.limit_count
-            })
+        const followGroupName = model.value.followedGroup.split(',')
+        const followedGroupId = []
+        res.data?.groupUserArr.forEach((item) => {
+          if (followGroupName.includes(item.name)) {
+            followedGroupId.push(item.id)
           }
-        }
+        })
+        echoGroup.value = followedGroupId.toString()
+        nextTick(() => {
+          doOpenDialog('monitor-change-group', {
+            groupList: res.data?.groupUserArr || []
+          })
+        })
       }
     })
   }
 
   // 选择分组名称change事件
-  function doChangeGroup(groupId) {
+  function changeGroup(groupId) {
     checkedGroupId.value = groupId
+    echoGroup.value = groupId
   }
 
   // 新增、编辑分组
@@ -210,7 +236,9 @@ function useEntQuickMonitorModel({ type, id, source }, options) {
       await doFetchGroup({ type: 'get' })
         .then((res) => {
           if (res.success) {
-            doOpenDialog('monitor-group', { groupList: res.data })
+            nextTick(() => {
+              doOpenDialog('monitor-group', { groupList: res.data })
+            })
           }
           else {
             if (res.data?.limit_count) {
@@ -294,7 +322,7 @@ function useEntQuickMonitorModel({ type, id, source }, options) {
       case 'group':
         doOpenSelectGroup()
         break
-      case 'confirmChangeGroup':
+      case 'confirmSelectGroup':
         if (loading.value)
           return
         loading.value = true
@@ -331,6 +359,25 @@ function useEntQuickMonitorModel({ type, id, source }, options) {
             loading.value = false
           })
         break
+      case 'confirmChangeGroup':
+        if (loading.value)
+          return
+        loading.value = true
+        doChangeGroup({ groupId: checkedGroupId.value })
+          .then((res) => {
+            if (res.success) {
+              doCloseDialog()
+              doFetch()
+              that.$toast('修改分组成功')
+            }
+            else {
+              that.$toast(res.msg)
+            }
+          })
+          .finally(() => {
+            loading.value = false
+          })
+        break
       default:
         break
     }
@@ -352,9 +399,10 @@ function useEntQuickMonitorModel({ type, id, source }, options) {
     // 获取(新增、编辑、删除)分组
     doFetchGroup,
     groupList,
-    doChangeGroup,
+    changeGroup,
     doUpdateGroup,
-    eleLoading
+    eleLoading,
+    echoGroup
   }
 }
 

+ 10 - 7
apps/bigmember_pc/src/views/PotentialList.vue

@@ -350,9 +350,9 @@ export default {
         this.recoverCreate()
       }
     },
-    recoverCreate() {
+    async recoverCreate() {
       this.filters.searchbool = 1
-      this.$refs.pushList.doQuery(this.filters)
+      await this.$refs.pushList.doQuery(this.filters)
     },
     goDetail(item) {
       let routeUrl = {}
@@ -482,12 +482,15 @@ export default {
       return this.$route.query.mark === '1'
     }
   },
-  mounted() {
+  async mounted() {
+    if (!this.isDeleteAllScope) {
+      await this.$store.dispatch('user/getKeywordsList')
+    }
     this.changeBusiness([])
-    this.recoverCreate()
     if (this.isUseCache) {
       this.doResetSelectorForCahce()
     }
+    await this.recoverCreate()
   },
   activated() {
     this.changeBusiness([])
@@ -496,15 +499,15 @@ export default {
     }
   },
   async created() {
+    // if (!this.isDeleteAllScope) {
+    //   await this.$store.dispatch('user/getKeywordsList')
+    // }
     // 从缓存中获取详情页筛选项
     if (this.isUseCache) {
       this.doResetArticleCacheFilter()
     } else {
       this.filters.business_scope = this.scope
     }
-    if (!this.isDeleteAllScope) {
-      await this.$store.dispatch('user/getKeywordsList')
-    }
   }
 }
 </script>

+ 15 - 1
apps/bigmember_pc/src/views/ent-intel/EntIntel.vue

@@ -12,9 +12,11 @@
       <img class="bidfor_img" src="@/assets/images/item_1.png" slot="bidImg" />
       <template v-slot:main>
         <ForFilter
+          ref="filterRef"
           v-if="type == 0"
           :group-list="groupList"
           @onPageChange="getMyFollowList"
+          @updateGroup="onUpdateGroup"
         ></ForFilter>
         <ForeCast
           style="border-radius: 4px"
@@ -95,6 +97,9 @@ export default {
   methods: {
     // 我关注的企业列表
     getMyFollowList(p = 0, match = '', group = '', pageSize = 10) {
+      // console.log(group, p, match, 'list')
+      // console.log(this.$refs.filterRef.getSelectedTag(), 'tag');
+      group = this.$refs.filterRef.getSelectedTag()
       if (this.$refs.myList) {
         this.myDataObj.list = []
       }
@@ -121,7 +126,16 @@ export default {
         name
       })
       if (code === 0) {
-        this.$toast(type === 'add' ? '新增分组成功' : '修改分组成功')
+        if (type === 'add') {
+          this.$toast('新增分组成功')
+        } else if (type === 'put') {
+          this.$toast('分组名称修改成功')
+        } else if (type === 'del') {
+          this.$toast('删除分组成功')
+          setTimeout(() => {
+            this.ajaxGetEntFollowList()
+          }, 500)
+        }
         this.ajaxEntGroupList()
       }
     },

+ 12 - 6
apps/mobile/src/views/entgroup/index.vue

@@ -91,13 +91,15 @@ export default {
       if (code === 0) {
         loading.clear()
         this.groupList = data?.groupUserArr || []
-      } else {
+      }
+      else {
         loading.clear()
         this.$toast('获取分组列表失败')
       }
     },
     setGroupEvent(data) {
-      if (data.name === '默认分组') return
+      if (data.name === '默认分组')
+        return
       this.$router.push({
         path: '/entgroup/detail',
         query: {
@@ -114,9 +116,10 @@ export default {
       if (this.groupingName === '') {
         this.errorMessageText = '分组名称不能为空'
         this.isConfirmButtonDisabled = true
-      } else {
+      }
+      else {
         const exists = this.groupList.some(
-          (item) => item.name === this.groupingName
+          item => item.name === this.groupingName
         )
         if (exists) {
           this.errorMessageText = '分组名称已存在'
@@ -133,8 +136,11 @@ export default {
         this.$toast('新增分组成功')
         this.groupingName = ''
         this.showAddGroupingDialog = false
-        this.getMyFollowList()
-      } else {
+        setTimeout(() => {
+          this.getMyFollowList()
+        }, 1500)
+      }
+      else {
         this.$toast('新增分组失败')
       }
     },

+ 20 - 0
data/data-models/modules/quick-monitor/api/follow-ent.js

@@ -38,3 +38,23 @@ export function ajaxMonitorGroup(data) {
     data
   })
 }
+
+// 企业监控更改分组
+export function ajaxChangeEntGroup(data) {
+  data = qs.stringify(data)
+  return useRequest({
+    url: '/bigmember/follow/ent/changeGroup',
+    method: 'post',
+    data
+  })
+}
+
+// 企业监控分组(仅获取,场景:企业情报监控筛选项、编辑分组、企业画像、标讯详情页更改分组)
+export function ajaxGetGroupList(data) {
+  data = qs.stringify(data)
+  return useRequest({
+    url: '/bigmember/follow/ent/labelGroupList',
+    method: 'post',
+    data
+  })
+}

+ 10 - 0
data/data-models/modules/quick-monitor/plugins/base.js

@@ -14,6 +14,8 @@ class MonitorApiBase {
     this.doFetch = this.runFetch.bind(this)
     this.doChange = this.runChange.bind(this)
     this.doFetchGroup = this.runFetchGroup.bind(this)
+    this.doChangeGroup = this.ajaxChange.bind(this)
+    this.doOnlyGroup = this.ajaxOnlyGroup.bind(this)
   }
 
   /**
@@ -98,6 +100,14 @@ class MonitorApiBase {
   async ajaxGroup() {
     return {}
   }
+
+  async ajaxChange() {
+    return {}
+  }
+
+  async ajaxOnlyGroup() {
+    return {}
+  }
 }
 
 export default MonitorApiBase

+ 43 - 0
data/data-models/modules/quick-monitor/plugins/ent-api.js

@@ -1,7 +1,9 @@
 import {
+  ajaxChangeEntGroup,
   ajaxFollowEntAdd,
   ajaxFollowEntCancel,
   ajaxFollowEntInfo,
+  ajaxGetGroupList,
   ajaxMonitorGroup
 } from '../api/follow-ent'
 import MonitorApiBase from './base'
@@ -102,4 +104,45 @@ export default class MonitorEntApi extends MonitorApiBase {
       return result
     })
   }
+
+  async ajaxChange(params = {}) {
+    const { groupId, callback } = params
+    return ajaxChangeEntGroup({ entId: this.id, groups: groupId }).then(
+      (res) => {
+        const result = {
+          success: false,
+          msg: '',
+          data: {}
+        }
+        result.success = res?.error_code === 0 && res?.data === 'success'
+        result.data = res?.data
+        if (result.success) {
+          callback && callback()
+        }
+        else {
+          result.msg = res?.error_msg || '抱歉,操作失败'
+        }
+        return result
+      }
+    )
+  }
+
+  async ajaxOnlyGroup(type = 'get') {
+    return ajaxGetGroupList(type).then((res) => {
+      const result = {
+        success: false,
+        msg: '',
+        data: {}
+      }
+      result.success = res?.error_code === 0
+      result.data = res?.data
+      if (result.success) {
+        this.groupList = res.data?.groupUserArr
+      }
+      else {
+        result.msg = res?.error_msg || '抱歉,操作失败'
+      }
+      return result
+    })
+  }
 }

+ 3 - 3
pnpm-lock.yaml

@@ -5297,7 +5297,7 @@ packages:
       vite: ^3.0.0 || ^4.0.0
       vue: ^2.7.0-0
     dependencies:
-      vite: 4.5.3(less@4.1.3)(sass@1.63.2)(terser@5.19.2)
+      vite: 4.5.3(sass@1.71.1)(terser@5.19.2)
       vue: 2.7.16
     dev: true
 
@@ -16728,7 +16728,7 @@ packages:
       '@types/eslint': 8.44.1
       eslint: 8.37.0
       rollup: 2.79.1
-      vite: 4.5.3(less@4.1.3)(sass@1.63.2)(terser@5.19.2)
+      vite: 4.5.3(sass@1.71.1)(terser@5.19.2)
     dev: true
 
   /vite-plugin-externals@0.6.2(vite@4.5.3):
@@ -16741,7 +16741,7 @@ packages:
       es-module-lexer: 0.4.1
       fs-extra: 10.1.0
       magic-string: 0.25.9
-      vite: 4.5.3(less@4.1.3)(sass@1.63.2)(terser@5.19.2)
+      vite: 4.5.3(sass@1.71.1)(terser@5.19.2)
     dev: true
 
   /vite-plugin-html-redirect@1.0.4: