Kaynağa Gözat

Merge branch 'master' into feature/v1.5.21

lianbingjie 2 yıl önce
ebeveyn
işleme
3edf790635

+ 9 - 0
src/api/modules/project.js

@@ -94,3 +94,12 @@ export function showAnnouncement (data) {
     data
   })
 }
+
+// 首页-已认领的项目
+export function getClaimList () {
+  return request({
+    baseURL: '/bigmember',
+    url: '/project/claim/list',
+    method: 'get'
+  })
+}

+ 1 - 0
src/store/user.js

@@ -296,6 +296,7 @@ export default {
     // 15.中标企业预测
     // 17.18.结构化数据
     power: state => state.power,
+    getInfo: state => state.info,
     // 是否免费用户
     free (_, getters) {
       const { entniche, bigmember, svip } = getters

+ 8 - 0
src/store/workspace.js

@@ -32,6 +32,14 @@ export default {
     customerWatcherShow (state, getters) {
       return getters.isNewEntniche
     },
+    /**
+     * 用于判断是否拥有拟建项目搜索权益,对应大会员商机版、专家版,商机版2.0、专家版2.0 [1, 3, 6, 7]
+     * 后调整为大会员用户都可享受权益
+     */
+    hasMemberNJPower (state, getters, rootState, rootGetters) {
+      const { 'user/getInfo': info } = rootGetters
+      return info?.memberStatus > 0
+    },
     // 10: 周报月报+定制化报告
     dataReportShow (state, getters, rootState, rootGetters) {
       const { 'user/power': power } = rootGetters

+ 89 - 0
src/views/workspace/components/ClaimList.vue

@@ -0,0 +1,89 @@
+<template>
+  <ListCard
+    class="claim-list"
+    :list="claimList"
+    title="已认领项目"
+    @clickListItem="clickListItem"
+    @linkMore="linkMore"
+    :loading="loading"
+    :loaded="loaded">
+    <div slot="empty-content" class="empty-content">
+      <p>暂无认领项目</p>
+    </div>
+  </ListCard>
+</template>
+
+<script>
+import ListCard from '../ui/ListCard'
+import { tryCallHooks } from '@jianyu/easy-inject-qiankun'
+import { getClaimList } from '@/api/modules/'
+import qs from 'qs'
+
+export default {
+  name: 'ClaimList',
+  components: {
+    ListCard
+  },
+  data () {
+    return {
+      loading: true,
+      loaded: false,
+      claimList: [],
+      baseLinks: {
+        more: '',
+        detail: ''
+      }
+    }
+  },
+  created () {
+    this.getList()
+  },
+  methods: {
+    getList () {
+      this.loading = true
+      getClaimList().then(res => {
+        if (res?.data && res?.data?.moreJump) {
+          this.baseLinks.more = res?.data?.moreJump
+          this.baseLinks.detail = res?.data?.detailsJump
+          if (Array.isArray(res?.data?.list)) {
+            this.claimList = res.data.list.map((item) => {
+              const query = qs.stringify({
+                pid: item.project_id,
+                cid: item.id
+              })
+              return {
+                title: item.projectname,
+                time: item.lasttime,
+                source: item.source_type,
+                _id: item.project_id,
+                id: item.id,
+                link: `${this.baseLinks.detail}?${query}`
+              }
+            })
+          }
+        }
+        this.loading = false
+        this.loaded = true
+      })
+    },
+    clickListItem (item) {
+      window.open(item.link)
+    },
+    linkMore () {
+      tryCallHooks({
+        fn: () => {
+          this.$BRACE.methods.open({
+            route: {
+              link: this.baseLinks.more,
+              appType: 'iframe'
+            }
+          })
+        },
+        spareFn: () => {
+          window.open(this.baseLinks.more)
+        }
+      })
+    }
+  }
+}
+</script>

+ 6 - 2
src/views/workspace/dashboard.vue

@@ -32,6 +32,7 @@ import ProjectFollow from './components/ProjectFollow.vue'
 import EntFollow from './components/EntFollow.vue'
 import DataReport from './components/DataReport.vue'
 import AsideOthers from './components/AsideOthers.vue'
+import ClaimList from './components/ClaimList.vue'
 const BusinessProfile = () => import('./components/BusinessProfile.vue')
 const MyCustomer = () => import('./components/MyCustomer.vue')
 const CustomerWatcher = () => import('./components/CustomerWatcher.vue')
@@ -51,12 +52,14 @@ export default {
     ProjectFollow,
     DataReport,
     AsideOthers,
-    EntFollow
+    EntFollow,
+    ClaimList
   },
   computed: {
     componentsPowerMap () {
-      const { myCustomerShow, customerWatcherShow } = this
+      const { myCustomerShow, customerWatcherShow, hasMemberNJPower } = this
       return {
+        ClaimList: hasMemberNJPower,
         MyCustomer: myCustomerShow,
         CustomerWatcher: customerWatcherShow,
         SubscribeList: true,
@@ -78,6 +81,7 @@ export default {
       'businessProfileShow',
       'myCustomerShow',
       'customerWatcherShow',
+      'hasMemberNJPower',
       'dataReportShow'
     ])
   }