|
@@ -1,10 +1,10 @@
|
|
|
<template>
|
|
|
<div class="ent-follow-container" v-show="followCheck.isShow">
|
|
|
<div class="ent-follow" @click="setFollow()">
|
|
|
- <span :class="follow.classActive"></span>
|
|
|
+ <span class="iconfont" :class="follow.classActive"></span>
|
|
|
<span class="follow_text">{{ follow.text }}</span>
|
|
|
</div>
|
|
|
- <!-- 关注分组选择dialog -->
|
|
|
+ <!-- 监控分组选择dialog -->
|
|
|
<el-dialog
|
|
|
custom-class="sub-dialog"
|
|
|
:visible.sync="follow.dialog"
|
|
@@ -52,8 +52,8 @@ export default {
|
|
|
isShow: true
|
|
|
},
|
|
|
follow: {
|
|
|
- classActive: 'icon_heart_gray',
|
|
|
- text: '关注',
|
|
|
+ classActive: 'icon-jiankong',
|
|
|
+ text: '监控',
|
|
|
groupInitData: ['A'],
|
|
|
dialog: false,
|
|
|
loading: false
|
|
@@ -64,7 +64,7 @@ export default {
|
|
|
this.getFollow()
|
|
|
},
|
|
|
methods: {
|
|
|
- // 查询项目是否关注
|
|
|
+ // 查询项目是否监控
|
|
|
getFollow() {
|
|
|
getfollowCheck({ entId: this.id }).then((res) => {
|
|
|
if (res.error_code === 0) {
|
|
@@ -72,18 +72,18 @@ export default {
|
|
|
Object.assign(this.followCheck, res.data)
|
|
|
}
|
|
|
if (res.data.followed) {
|
|
|
- this.follow.classActive = 'icon_heart_red'
|
|
|
- this.follow.text = '已关注'
|
|
|
+ this.follow.classActive = 'icon-yijiankong'
|
|
|
+ this.follow.text = '已监控'
|
|
|
} else {
|
|
|
- this.follow.classActive = 'icon_heart_gray'
|
|
|
- this.follow.text = '关注'
|
|
|
+ this.follow.classActive = 'icon-jiankong'
|
|
|
+ this.follow.text = '监控'
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 关注
|
|
|
+ // 监控
|
|
|
async setFollow() {
|
|
|
- if (this.follow.text === '关注') {
|
|
|
+ if (this.follow.text === '监控') {
|
|
|
if (this.beforeFollowFn) {
|
|
|
const pass = await this.beforeFollowFn()
|
|
|
if (!pass) {
|
|
@@ -95,11 +95,11 @@ export default {
|
|
|
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('取消关注成功')
|
|
|
+ this.follow.classActive = 'icon-jiankong'
|
|
|
+ this.follow.text = '监控'
|
|
|
+ this.$toast('取消监控成功')
|
|
|
} else {
|
|
|
- this.$toast(res.error_msg || '取消关注失败')
|
|
|
+ this.$toast(res.error_msg || '取消监控失败')
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -116,14 +116,14 @@ export default {
|
|
|
if (res.error_code === 0) {
|
|
|
// 关闭弹窗
|
|
|
this.setFollowCancel()
|
|
|
- this.$toast(res.error_msg || '关注成功,已添加至企业情报监控内')
|
|
|
- if (res.data === 'success') {
|
|
|
- this.follow.classActive = 'icon_heart_red'
|
|
|
- this.follow.text = '已关注'
|
|
|
+ this.$toast(res.error_msg || '监控成功,已添加至企业情报监控内')
|
|
|
+ if (res.data?.status) {
|
|
|
+ this.follow.classActive = 'icon-yijiankong'
|
|
|
+ this.follow.text = '已监控'
|
|
|
}
|
|
|
this.$emit('followSuccess')
|
|
|
} else {
|
|
|
- this.$toast(res.error_msg || '关注失败')
|
|
|
+ this.$toast(res.error_msg || '监控失败')
|
|
|
}
|
|
|
})
|
|
|
.finally(() => {
|
|
@@ -152,22 +152,9 @@ export default {
|
|
|
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 {
|
|
|
+ .iconfont {
|
|
|
margin-right: 4px;
|
|
|
- display: flex;
|
|
|
- width: 18px;
|
|
|
- height: 18px;
|
|
|
- background: url('~@/assets/images/icon/icon-favorite.png') no-repeat;
|
|
|
- background-size: contain;
|
|
|
+ font-size: 18px;
|
|
|
}
|
|
|
|
|
|
.follow_text {
|