|
@@ -0,0 +1,226 @@
|
|
|
+<template>
|
|
|
+ <section class="my-equity-list">
|
|
|
+ <header class="card-header">我的</header>
|
|
|
+ <main class="card-main">
|
|
|
+ <EquityItem
|
|
|
+ v-for="(item, index) in calcList"
|
|
|
+ :key="index"
|
|
|
+ v-bind="item"
|
|
|
+ v-show="item.show"
|
|
|
+ @click="onClickItem(item)"
|
|
|
+ ></EquityItem>
|
|
|
+ </main>
|
|
|
+ </section>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { getWorkspaceEquityCount } from '@/api/modules/'
|
|
|
+import { mapState, mapActions, mapGetters } from 'vuex'
|
|
|
+import EquityItem from '../ui/EquityItem.vue'
|
|
|
+import { getAssetsFile } from '@/utils'
|
|
|
+import { tryCallHooks } from '@jianyu/easy-inject-qiankun'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'MyEquityList',
|
|
|
+ components: {
|
|
|
+ EquityItem
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ list: [
|
|
|
+ {
|
|
|
+ name: '项目进度监控',
|
|
|
+ count: 0,
|
|
|
+ unit: '个',
|
|
|
+ background: 'linear-gradient(#D2EEFB, #EBF6FB)',
|
|
|
+ icon: getAssetsFile('workspace/my-project.png'),
|
|
|
+ noText: '前往添加',
|
|
|
+ link: '/swordfish/page_big_pc/free/project_progress',
|
|
|
+ addLink: '/jylab/supsearch/index.html',
|
|
|
+ appType: 'outer',
|
|
|
+ addAppType: 'iframe',
|
|
|
+ openType: '_blank',
|
|
|
+ addOpenType: '_self'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '企业情报监控',
|
|
|
+ count: 0,
|
|
|
+ unit: '个',
|
|
|
+ background: 'linear-gradient(#D2FDEE, #ECFCF6)',
|
|
|
+ icon: getAssetsFile('workspace/my-gen.png'),
|
|
|
+ noText: '前往添加',
|
|
|
+ link: '/swordfish/page_big_pc/free/ent_follow',
|
|
|
+ addLink: '/jylab/entSearch/index.html',
|
|
|
+ appType: 'outer',
|
|
|
+ addAppType: 'iframe',
|
|
|
+ openType: '_blank',
|
|
|
+ addOpenType: '_self'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '收藏的标讯',
|
|
|
+ count: 0,
|
|
|
+ unit: '条',
|
|
|
+ background: 'linear-gradient(#FFEBD7, #FFF8F1)',
|
|
|
+ icon: getAssetsFile('workspace/my-collect.png'),
|
|
|
+ noText: '前往收藏',
|
|
|
+ link: '/swordfish/frontPage/collection/sess/index',
|
|
|
+ addLink: '/jylab/supsearch/index.html',
|
|
|
+ appType: 'outer',
|
|
|
+ addAppType: 'iframe',
|
|
|
+ openType: '_blank',
|
|
|
+ addOpenType: '_self'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '客户监控',
|
|
|
+ count: 0,
|
|
|
+ unit: '个',
|
|
|
+ background: 'linear-gradient(#FFE2DE, #FFF6F4)',
|
|
|
+ icon: getAssetsFile('workspace/my-customer.png'),
|
|
|
+ noText: '前往添加',
|
|
|
+ link: '/entpc/newBus/myCustomer?m1=1&m2=1',
|
|
|
+ addLink: '/jylab/purSearch/index.html',
|
|
|
+ appType: 'outer',
|
|
|
+ addAppType: 'iframe',
|
|
|
+ openType: '_blank',
|
|
|
+ addOpenType: '_self'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '已认领项目',
|
|
|
+ count: 0,
|
|
|
+ unit: '个',
|
|
|
+ background: 'linear-gradient(#FFE2DE, #FFF6F4)',
|
|
|
+ icon: getAssetsFile('workspace/my-claim.png'),
|
|
|
+ noText: '前往认领',
|
|
|
+ link: '/succbi/nzj/app/nzj.app/nzj_claim.spg',
|
|
|
+ addLink: '/succbi/nzj/app/nzj.app/nzj_search_1.spg',
|
|
|
+ appType: 'iframe',
|
|
|
+ addAppType: 'iframe',
|
|
|
+ addOpenType: '_self'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ my: {
|
|
|
+ claimCount: 0,
|
|
|
+ projectFollowCount: 0,
|
|
|
+ entFollowCount: 0,
|
|
|
+ collectCount: 0,
|
|
|
+ customerCount: 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState({
|
|
|
+ customerCount: (state) => state.workspace.customer.count
|
|
|
+ }),
|
|
|
+ ...mapGetters('workspace', ['myCustomerShow', 'hasMemberNJPower']),
|
|
|
+ calcList() {
|
|
|
+ const {
|
|
|
+ claimCount,
|
|
|
+ projectFollowCount,
|
|
|
+ entFollowCount,
|
|
|
+ collectCount,
|
|
|
+ customerCount
|
|
|
+ } = this.my
|
|
|
+ const list = this.list.map((v) => {
|
|
|
+ switch (v.name) {
|
|
|
+ case '客户监控':
|
|
|
+ v.show = this.myCustomerShow
|
|
|
+ v.count = customerCount
|
|
|
+ break
|
|
|
+ case '已认领项目':
|
|
|
+ v.show = this.hasMemberNJPower
|
|
|
+ v.count = claimCount
|
|
|
+ break
|
|
|
+ case '项目进度监控':
|
|
|
+ v.show = this.hasMemberNJPower
|
|
|
+ v.count = projectFollowCount
|
|
|
+ break
|
|
|
+ case '企业情报监控':
|
|
|
+ v.show = this.hasMemberNJPower
|
|
|
+ v.count = entFollowCount
|
|
|
+ break
|
|
|
+ case '收藏的标讯':
|
|
|
+ v.show = true
|
|
|
+ v.count = collectCount
|
|
|
+ break
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ ...v
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return list
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList()
|
|
|
+ this.getWorkspaceEquity()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapActions('workspace/customer', ['getList']),
|
|
|
+ async getWorkspaceEquity() {
|
|
|
+ this.my.customerCount = this.customerCount || 0
|
|
|
+ const { data } = await getWorkspaceEquityCount()
|
|
|
+ if (data) {
|
|
|
+ this.my.claimCount = data.claimCount || 0
|
|
|
+ this.my.projectFollowCount = data.projectFollowCount || 0
|
|
|
+ this.my.entFollowCount = data.entFollowCount || 0
|
|
|
+ this.my.collectCount = data.collectCount || 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onClickItem(item) {
|
|
|
+ /*
|
|
|
+ * 前往认领to拟在建搜索(bi)
|
|
|
+ * 客户监控to采购单位搜索(iframe)
|
|
|
+ * 前往收藏to招标采购搜索(iframe)
|
|
|
+ * 企业情报监控to企业搜索(iframe)
|
|
|
+ * 项目进度监控to招标采购搜索(iframe)
|
|
|
+ */
|
|
|
+ tryCallHooks({
|
|
|
+ fn: () => {
|
|
|
+ this.$BRACE.methods.open({
|
|
|
+ route: {
|
|
|
+ link: item.count ? item.link : encodeURIComponent(item.addLink),
|
|
|
+ appType: item.count ? item.appType : item.addAppType,
|
|
|
+ openType: item.count ? item.openType : item.addOpenType
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ spareFn: () => {
|
|
|
+ const url = item.count ? item.link : encodeURIComponent(item.addLink)
|
|
|
+ if (item.count) {
|
|
|
+ if (item.openType === '_blank') {
|
|
|
+ window.open(url)
|
|
|
+ } else {
|
|
|
+ location.href = url
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (item.addOpenType === '_blank') {
|
|
|
+ window.open(url)
|
|
|
+ } else {
|
|
|
+ location.href = url
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@include diy-icon('blue-more', 16, 16);
|
|
|
+.my-equity-list {
|
|
|
+ margin-top: 16px;
|
|
|
+ border-radius: 8px;
|
|
|
+ background: #fff;
|
|
|
+ .card-header {
|
|
|
+ padding: 12px 20px 8px;
|
|
|
+ font-size: 18px;
|
|
|
+ line-height: 28px;
|
|
|
+ }
|
|
|
+ .card-main {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 8px 20px 16px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|