فهرست منبع

Merge branch 'feature/v1.5.4' of http://192.168.3.207:8080/jianyu/page_bigmember_pc into feature/v1.5.4

zhangyuhan 3 سال پیش
والد
کامیت
c215d7652a

+ 1 - 1
package.json

@@ -15,7 +15,7 @@
     "@jianyu/easy-fix-sub-app": "^0.0.1",
     "@jianyu/easy-inject-qiankun": "^0.1.10",
     "@jianyu/icon": "^0.1.7",
-    "@jianyu/reset.css": "^0.0.2",
+    "@jianyu/reset.css": "~0.1.1",
     "axios": "^0.21.1",
     "core-js": "^3.4.3",
     "echarts": "4.8.0",

+ 1 - 0
src/components/push-list/PotentialList.vue

@@ -424,6 +424,7 @@ export default {
     .info-list {
       min-height: 100px;
       border-top: 1px solid transparent;
+      position: relative;
     }
     .add-key-button {
       display: flex;

+ 1 - 0
src/components/push-list/ProjectList.vue

@@ -255,6 +255,7 @@ export default {
     .info-list {
       min-height: 300px;
       border-top: 1px solid transparent;
+      position: relative;
     }
     .add-key-button {
       display: flex;

+ 1 - 0
src/components/push-list/ProjectProgressList.vue

@@ -451,6 +451,7 @@ export default {
     .info-list {
       min-height: 300px;
       border-top: 1px solid transparent;
+      position: relative;
     }
     .add-key-button {
       display: flex;

+ 1 - 0
src/components/push-list/PushList.vue

@@ -1734,6 +1734,7 @@ export default {
   .info-list {
     min-height: 300px;
     border-top: 1px solid transparent;
+    position: relative;
   }
 
   .add-key-button {

+ 1 - 1
src/main.js

@@ -3,7 +3,7 @@ import Vue from 'vue'
 import App from './App.vue'
 import store from './store/'
 import router from './router/'
-import '@jianyu/reset.css'
+import '@jianyu/reset.css/reset-pc.scss'
 import { easySubAppRegister } from '@jianyu/easy-inject-qiankun'
 import { fixGetComputedStyle } from '@jianyu/easy-fix-sub-app/lib/getComputedStyle'
 import VueCookies from 'vue-cookies'

+ 2 - 0
src/store/user.js

@@ -254,6 +254,8 @@ export default {
     },
     // 是否是商机管理
     entniche: state => state.info.entniche,
+    // 是否新商机管理
+    isNewEntNiche: state => state.isNewEnt.isNew,
     // 是否大会员
     bigmember: state => state.info.memberStatus > 0,
     // 是否是超级订阅

+ 9 - 6
src/store/workspace.js

@@ -16,18 +16,21 @@ export default {
   mutations: {},
   actions: {},
   getters: {
-    entniche (state, getters, rootState, rootGetters) {
-      const { 'user/entniche': entniche } = rootGetters
-      return entniche
+    isNewEntniche (state, getters, rootState, rootGetters) {
+      const {
+        'user/entniche': entniche,
+        'user/isNewEntNiche': newEnt
+      } = rootGetters
+      return entniche && newEnt
     },
     businessProfileShow (state, getters) {
-      return getters.entniche
+      return getters.isNewEntniche
     },
     myCustomerShow (state, getters) {
-      return getters.entniche
+      return getters.isNewEntniche
     },
     customerWatcherShow (state, getters) {
-      return getters.entniche
+      return getters.isNewEntniche
     },
     // 10: 周报月报+定制化报告
     dataReportShow (state, getters, rootState, rootGetters) {

+ 1 - 1
src/store/workspace/business-profile.js

@@ -8,7 +8,7 @@ export default {
   }),
   mutations: {
     setBoardInfo (state, obj = {}) {
-      Object.assign(state.boardInfo, obj)
+      state.boardInfo = obj
     }
   },
   actions: {

+ 21 - 14
src/store/workspace/common-use.js

@@ -30,6 +30,22 @@ export default {
     changeDialogState (state, show) {
       state.dialogShow = show
     },
+    sortMenuFunctions (state, menuInfoList = []) {
+      const menuList = flatMenuList(menuInfoList, 0)
+      // 排除无权限的
+      const usableMenu = menuList.filter(menu => menu.level === 3 && menu.usable)
+      // 按照name去重
+      const list = []
+      const nameList = []
+      usableMenu.forEach(menu => {
+        const { name } = menu
+        if (!nameList.includes(name)) {
+          list.push(menu)
+          nameList.push(name)
+        }
+      })
+      this.commit('workspace/commonUse/setAllFunctions', list)
+    },
     setAllFunctions (state, list = []) {
       if (Array.isArray(list)) {
         state.allFunctions = list
@@ -59,6 +75,10 @@ export default {
           }).then(({ type = '', data: store }) => {
             if (type === 'success') {
               console.log('base store', store)
+              const { getters = {} } = store
+              if (getters.getMenus && getters.getMenus.menus) {
+                commit('sortMenuFunctions', getters.getMenus.menus)
+              }
             } else {
               dispatch('getWorkspaceMenu')
             }
@@ -77,20 +97,7 @@ export default {
         // 平台参数 platform 平台:默认PC,微信:WX,app:APP, 可不传
         const { data = [], error_code: code } = await getWorkspaceMenu()
         if (code === 0 && data) {
-          const menuList = flatMenuList(data.menuList, 0)
-          // 排除无权限的
-          const usableMenu = menuList.filter(menu => menu.level === 3 && menu.usable)
-          // 按照name去重
-          const list = []
-          const nameList = []
-          usableMenu.forEach(menu => {
-            const { name } = menu
-            if (!nameList.includes(name)) {
-              list.push(menu)
-              nameList.push(name)
-            }
-          })
-          commit('setAllFunctions', list)
+          commit('sortMenuFunctions', data.menuList)
         } else {
           commit('setAllFunctions', [])
         }

+ 1 - 1
src/store/workspace/my-customer.js

@@ -60,7 +60,7 @@ export default {
               _id: v.customer_id,
               title: v.customer_name,
               unread: false,
-              time: 0
+              time: v.updatetime ? +new Date(v.updatetime * 1000) : 0
             }
           })
           commit('changeList', list)

+ 16 - 10
src/views/SubPush.vue

@@ -19,29 +19,29 @@
       </div>
       <div class="border-box">
         <TimeSelector ref="timeSelector" selectorTime="sub"  @onChange="changeTime" selectorType="line">
-          <div class="filter-label" slot="header">选择时间:<span class="el-icon-jy-vip visibility-hidden"></span></div>
+          <div class="filter-label" slot="header">选择时间:<span class="el-icon-jy-vip visibility-hidden" v-if="showVipTag"></span></div>
         </TimeSelector>
         <AreaSelector @onChange="changeArea" :beforeTabClick="beforeSelected" ref="areaSelector" selectorType="line">
-          <div class="filter-label" slot="header">选择区域:<span class="el-icon-jy-vip"></span></div>
+          <div class="filter-label" slot="header">选择区域:<span class="el-icon-jy-vip" v-if="showVipTag"></span></div>
         </AreaSelector>
         <IndustrySelector @onChange="changeIndustry" :beforeChange="beforeSelected" selectorType="line">
-          <div class="filter-label" slot="header">行业:<span class="el-icon-jy-vip"></span></div>
+          <div class="filter-label" slot="header">行业:<span class="el-icon-jy-vip" v-if="showVipTag"></span></div>
         </IndustrySelector>
         <PriceSelector @onChange="onPriceChange" :beforeConfirm="beforeSelected" selectorType="line">
-          <div class="filter-label" slot="header">价格区间:<span class="el-icon-jy-vip"></span></div>
+          <div class="filter-label" slot="header">价格区间:<span class="el-icon-jy-vip" v-if="showVipTag"></span></div>
         </PriceSelector>
-        <IndustrySelector class="buyer" @onChange="changeBuyer" :beforeChange="beforeSelected" dataType="buyer" selectorType="line">
-          <div class="filter-label" slot="header">采购单位类型:<span class="el-icon-jy-vip"></span></div>
+        <IndustrySelector :class="{ pdl6: this.showVipTag }" @onChange="changeBuyer" :beforeChange="beforeSelected" dataType="buyer" selectorType="line">
+          <div class="filter-label" slot="header">采购单位类型:<span class="el-icon-jy-vip" v-if="showVipTag"></span></div>
         </IndustrySelector>
         <InfoTypeSelector class="my-line" @onChange="changeInfo" :beforeChange="beforeSelected" selectorType="line">
-          <div class="filter-label" slot="header">信息类型:<span class="el-icon-jy-vip"></span></div>
+          <div class="filter-label" slot="header">信息类型:<span class="el-icon-jy-vip" v-if="showVipTag"></span></div>
         </InfoTypeSelector>
         <PopSelector @onChange="changeKeys" ref="keySelector" :beforeTabClick="beforeSelected" selectorType="line">
-          <div class="filter-label" slot="header">关键词:<span class="el-icon-jy-vip"></span></div>
+          <div class="filter-label" slot="header">关键词:<span class="el-icon-jy-vip" v-if="showVipTag"></span></div>
         </PopSelector>
         <selectorCard cardType="line">
           <div slot="header" class="s-header filter-label">
-            <slot name="header">附件:<span class="el-icon-jy-vip"></span></slot>
+            <slot name="header">附件:<span class="el-icon-jy-vip" v-if="showVipTag"></span></slot>
           </div>
           <RadioGroup
             :sourceList="withFileList"
@@ -156,6 +156,11 @@ export default {
         return this.autoVt
       }
     },
+    showVipTag () {
+      // 商机管理和大会员不显示vip标记
+      const isVip = this.entniche || this.bigmember
+      return !isVip
+    },
     showManageButton () {
       // 免费f / 商机管理s / 超级订阅v / 大会员m
       // 商机管理不显示
@@ -443,7 +448,7 @@ export default {
     .visibility-hidden {
       visibility: hidden;
     }
-    .buyer {
+    .pdl6 {
       padding-left: 6px;
     }
 
@@ -481,6 +486,7 @@ export default {
       display: flex;
       align-items: center;
       justify-content: flex-end;
+      font-size: 16px;
     }
 
     .sub-manager {

+ 3 - 1
src/views/ent-intel/EntIntel.vue

@@ -93,7 +93,9 @@ export default {
           this.myDataObj.maxCount = res.data.followMax
           this.myDataObj.match = match
           this.myDataObj.group = group
-          this.myDataObj.initTotal = res.data.count
+          if (!group) {
+            this.myDataObj.initTotal = res.data.count
+          }
           this.myDataObj.total = res.data.total
           this.$refs.myList.entInitData(this.myDataObj)
           this.$refs.myList.$forceUpdate()

+ 4 - 130
src/views/portrayal/EntPortrayal.vue

@@ -2,27 +2,8 @@
   <Layout class="ent-portrayal">
     <div class="ent-header">
       <div class="name">{{ entName }}</div>
-      <div class="ent_follow" @click="setFollow()">
-        <span :class="follow.classActive"></span>
-        <span class="follow_text">{{ follow.text }}</span>
-      </div>
+      <EntFollowStar :id="eId" />
     </div>
-    <!-- 关注分组选择dialog -->
-    <el-dialog
-      custom-class="sub-dialog"
-      :visible.sync="follow.dialog"
-      :close-on-click-modal="false"
-      :show-close="false"
-      center
-      top="25vh"
-      width="460px"
-    >
-      <GroupSelector
-        :initGroupInfo="follow.groupInitData.join(',')"
-        @onCancel="setFollowCancel"
-        @onConfirm="setFollowConfirmed"
-      ></GroupSelector>
-    </el-dialog>
     <div class="ent-content" v-loading="loading">
       <div class="tab-header" :class="{'fixed-nav': navFixed}" id="entTabNav">
         <a :class="[activeName == '1' ? 'active' : '']" @click="handleClick('1')">企业信息</a>
@@ -89,13 +70,13 @@ import Layout from '@/components/common/ContentLayout.vue'
 import BidInfoActive from './components/BidInfoActive'
 import ContactList from '@/components/contact-info/ContactInfo'
 import MaskCard from '@/components/mask-card/MaskCard.vue'
-import GroupSelector from '@/components/selector/GroupSelector.vue'
 import Empty from '@/components/common/Empty'
 import DynamicList from './components/DynamicList'
+import EntFollowStar from './components/EntFollowStar.vue'
 import { mapState } from 'vuex'
 import { Dialog, Input, TabPane, Tabs } from 'element-ui'
 import { dateFormatter, moneyUnit } from '@/utils'
-import { getEntWinnerSelect, getfollowCheck, setCancelEnt, setFollowEnt } from '@/api/modules'
+import { getEntWinnerSelect } from '@/api/modules'
 
 function getImgForVipUpgrade (name, bg = false, suffix = '.png') {
   return require('@/assets/images/vip/' + (bg ? 'bg/mask/' : '') + name + suffix)
@@ -115,8 +96,8 @@ export default {
     BidInfoActive,
     ContactList,
     MaskCard,
-    GroupSelector,
     Empty,
+    EntFollowStar,
     DynamicList
   },
   data () {
@@ -133,13 +114,6 @@ export default {
         start: 0,
         end: 0
       },
-      follow: {
-        classActive: 'icon_heart_gray',
-        text: '关注',
-        groupInitData: ['A'],
-        dialog: false,
-        loading: false
-      },
       eId: this.$route.params.eId,
       entName: '',
       EntHistoryTip: {
@@ -268,7 +242,6 @@ export default {
     }
   },
   created () {
-    this.getFollow()
     this.getSelect()
   },
   mounted () {
@@ -334,20 +307,6 @@ export default {
         }
       })
     },
-    // 查询项目是否关注
-    getFollow () {
-      getfollowCheck({ entId: this.eId }).then(res => {
-        if (res.error_code === 0) {
-          if (res.data.followed) {
-            this.follow.classActive = 'icon_heart_red'
-            this.follow.text = '已关注'
-          } else {
-            this.follow.classActive = 'icon_heart_gray'
-            this.follow.text = '关注'
-          }
-        }
-      })
-    },
     getEntInfo (data) {
       this.proData = [
         {
@@ -370,49 +329,6 @@ export default {
       this.dateRange.start = dateFormatter(data.timeRange.start * 1000, 'yyyy/MM/dd')
       this.dateRange.end = dateFormatter(data.timeRange.end * 1000, 'yyyy/MM/dd')
     },
-    // 关注
-    setFollow () {
-      if (this.follow.text === '关注') {
-        this.follow.dialog = true
-      } else {
-        setCancelEnt({ entId: this.eId }).then(res => {
-          if (res.error_code === 0) {
-            if (res.data === 'success') {
-              this.follow.classActive = 'icon_heart_gray'
-              this.follow.text = '关注'
-              this.$toast('取消关注成功')
-            } else {
-              this.$toast(res.error_msg || '取消关注失败')
-            }
-          }
-        })
-      }
-    },
-    setFollowConfirmed (data) {
-      if (this.follow.loading) return
-      this.follow.loading = true
-      setFollowEnt({
-        entId: this.eId,
-        group: data
-      }).then(res => {
-        if (res.error_code === 0) {
-          // 关闭弹窗
-          this.setFollowCancel()
-          if (res.data === 'success') {
-            this.follow.classActive = 'icon_heart_red'
-            this.follow.text = '已关注'
-          }
-          this.$toast(res.error_msg || '关注成功,已添加至企业情报监控内')
-        } else {
-          this.$toast(res.error_msg || '关注失败')
-        }
-      }).finally(() => {
-        this.follow.loading = false
-      })
-    },
-    setFollowCancel () {
-      this.follow.dialog = false
-    },
     openBigPage (item) {
       try {
         // eslint-disable-next-line no-undef
@@ -432,16 +348,6 @@ export default {
 }
 </script>
 <style lang="scss" scoped>
-::v-deep .sub-dialog {
-  background-color: transparent;
-  box-shadow: none;
-
-  .el-dialog__header,
-  .el-dialog__body {
-    padding: 0;
-  }
-}
-
 .ent-portrayal {
   margin: 32px auto;
 
@@ -456,38 +362,6 @@ export default {
       font-size: 24px;
       color: #171826;
     }
-
-    .ent_follow {
-      display: flex;
-      align-items: center;
-      cursor: pointer;
-
-      .icon_heart_gray {
-        margin-right: 4px;
-        display: flex;
-        width: 18px;
-        height: 18px;
-        background: url('~@/assets/images/icon/icon-heart.png') no-repeat;
-        background-size: contain;
-      }
-
-      .icon_heart_red {
-        margin-right: 4px;
-        display: flex;
-        width: 18px;
-        height: 18px;
-        background: url('~@/assets/images/icon/icon-favorite.png') no-repeat;
-        background-size: contain;
-      }
-
-      .follow_text {
-        font-size: 14px;
-        font-family: Microsoft YaHei, Microsoft YaHei-Regular;
-        font-weight: 400;
-        color: #686868;
-        line-height: 22px;
-      }
-    }
   }
 
   .tab-header {

+ 3 - 31
src/views/portrayal/EntSearchPortrayal.vue

@@ -2,6 +2,7 @@
   <Layout class="ent-portrayal">
     <div class="ent-header">
       <div class="name">{{ entName }}</div>
+      <EntFollowStar :id="eId" />
     </div>
     <div class="ent-content" v-loading="loading">
       <div class="tab-header" :class="{'fixed-nav': navFixed}" id="entTabNav">
@@ -96,6 +97,7 @@ import FreeExpBanner from './components/FreeExpBanner.vue'
 import ContactList from '@/components/contact-info/ContactInfo'
 import CollectInfo from '@/components/collect-info/CollectInfo.vue'
 import DynamicList from './components/DynamicList'
+import EntFollowStar from './components/EntFollowStar.vue'
 import { mapState } from 'vuex'
 import { TabPane, Tabs } from 'element-ui'
 import { dateFormatter, moneyUnit } from '@/utils'
@@ -119,6 +121,7 @@ export default {
     CollectInfo,
     ContactList,
     FreeExpBanner,
+    EntFollowStar,
     DynamicList
   },
   data () {
@@ -601,37 +604,6 @@ export default {
       font-size: 24px;
       color: #171826;
     }
-
-    .ent_follow {
-      display: flex;
-      cursor: pointer;
-
-      .icon_heart_gray {
-        margin-right: 4px;
-        display: flex;
-        width: 18px;
-        height: 18px;
-        background: url('~@/assets/images/icon/icon-heart.png') no-repeat;
-        background-size: contain;
-      }
-
-      .icon_heart_red {
-        margin-right: 4px;
-        display: flex;
-        width: 18px;
-        height: 18px;
-        background: url('~@/assets/images/icon/icon-favorite.png') no-repeat;
-        background-size: contain;
-      }
-
-      .follow_text {
-        font-size: 14px;
-        font-family: Microsoft YaHei, Microsoft YaHei-Regular;
-        font-weight: 400;
-        color: #686868;
-        line-height: 22px;
-      }
-    }
   }
 
   .tab-header {

+ 1 - 0
src/views/portrayal/components/DynamicList.vue

@@ -1948,6 +1948,7 @@ export default {
   .info-list {
     min-height: 150px;
     border-top: 1px solid transparent;
+    position: relative;
   }
 
   .add-key-button {

+ 160 - 0
src/views/portrayal/components/EntFollowStar.vue

@@ -0,0 +1,160 @@
+<template>
+  <div class="ent-follow-container" @click="setFollow()">
+    <span :class="follow.classActive"></span>
+    <span class="follow_text">{{ follow.text }}</span>
+    <!-- 关注分组选择dialog -->
+    <el-dialog
+      custom-class="sub-dialog"
+      append-to-body
+      :visible.sync="follow.dialog"
+      :close-on-click-modal="false"
+      :show-close="false"
+      center
+      top="25vh"
+      width="460px">
+      <GroupSelector
+        :initGroupInfo="follow.groupInitData.join(',')"
+        @onCancel="setFollowCancel"
+        @onConfirm="setFollowConfirmed"
+      ></GroupSelector>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getfollowCheck, setCancelEnt, setFollowEnt } from '@/api/modules'
+import GroupSelector from '@/components/selector/GroupSelector.vue'
+import { Dialog } from 'element-ui'
+export default {
+  name: 'EntFollowStar',
+  components: {
+    [Dialog.name]: Dialog,
+    GroupSelector
+  },
+  props: {
+    id: {
+      type: String,
+      default: ''
+    }
+  },
+  watch: {
+    id () {
+      this.getfollowCheck()
+    }
+  },
+  data () {
+    return {
+      follow: {
+        classActive: 'icon_heart_gray',
+        text: '关注',
+        groupInitData: ['A'],
+        dialog: false,
+        loading: false
+      }
+    }
+  },
+  created () {
+    this.getFollow()
+  },
+  methods: {
+    // 查询项目是否关注
+    getFollow () {
+      getfollowCheck({ entId: this.id }).then(res => {
+        if (res.error_code === 0) {
+          if (res.data.followed) {
+            this.follow.classActive = 'icon_heart_red'
+            this.follow.text = '已关注'
+          } else {
+            this.follow.classActive = 'icon_heart_gray'
+            this.follow.text = '关注'
+          }
+        }
+      })
+    },
+    // 关注
+    setFollow () {
+      if (this.follow.text === '关注') {
+        this.follow.dialog = true
+      } else {
+        setCancelEnt({ entId: this.id }).then(res => {
+          if (res.error_code === 0) {
+            if (res.data === 'success') {
+              this.follow.classActive = 'icon_heart_gray'
+              this.follow.text = '关注'
+              this.$toast('取消关注成功')
+            } else {
+              this.$toast(res.error_msg || '取消关注失败')
+            }
+          }
+        })
+      }
+    },
+    setFollowConfirmed (data) {
+      if (this.follow.loading) return
+      this.follow.loading = true
+      setFollowEnt({
+        entId: this.id,
+        group: data
+      }).then(res => {
+        if (res.error_code === 0) {
+          // 关闭弹窗
+          this.setFollowCancel()
+          if (res.data === 'success') {
+            this.follow.classActive = 'icon_heart_red'
+            this.follow.text = '已关注'
+          }
+          this.$toast(res.error_msg || '关注成功,已添加至企业情报监控内')
+        } else {
+          this.$toast(res.error_msg || '关注失败')
+        }
+      }).finally(() => {
+        this.follow.loading = false
+      })
+    },
+    setFollowCancel () {
+      this.follow.dialog = false
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .sub-dialog {
+  background-color: transparent;
+  box-shadow: none;
+
+  .el-dialog__header,
+  .el-dialog__body {
+    padding: 0;
+  }
+}
+.ent-follow-container {
+  display: flex;
+  align-items: center;
+  cursor: pointer;
+
+  .icon_heart_gray {
+    margin-right: 4px;
+    display: flex;
+    width: 18px;
+    height: 18px;
+    background: url('~@/assets/images/icon/icon-heart.png') no-repeat;
+    background-size: contain;
+  }
+
+  .icon_heart_red {
+    margin-right: 4px;
+    display: flex;
+    width: 18px;
+    height: 18px;
+    background: url('~@/assets/images/icon/icon-favorite.png') no-repeat;
+    background-size: contain;
+  }
+
+  .follow_text {
+    font-size: 14px;
+    color: #686868;
+    line-height: 22px;
+  }
+}
+</style>

+ 4 - 4
yarn.lock

@@ -940,10 +940,10 @@
     core-js "^3.8.3"
     vue "^2.6.14"
 
-"@jianyu/reset.css@^0.0.2":
-  version "0.0.2"
-  resolved "http://192.168.3.207:4873/@jianyu%2freset.css/-/reset.css-0.0.2.tgz#e8ad217c4cc473a68a6d1d45959e77d467dbd39c"
-  integrity sha512-uO77rqmXia5D/KkzkcM++U6sPHsbnBv8BKzuJGht486plKa5utrpR6DKCgV+haIJ5WpwyuTQtLadMvFNoOSjyQ==
+"@jianyu/reset.css@~0.1.1":
+  version "0.1.1"
+  resolved "http://192.168.3.207:4873/@jianyu%2freset.css/-/reset.css-0.1.1.tgz#2c097a1811fe187e8750fe33b0a6bdf86bf4ecc3"
+  integrity sha512-RlTzmEoCVfJMQXwXqQ+JD+I7zkCou/a+4KiHcG0RbEr00D48R3dgHqf5rmvjahJ1jr4ZuDDxg/ms+IlidERWvw==
 
 "@mrmlnc/readdir-enhanced@^2.2.1":
   version "2.2.1"