|
@@ -6,6 +6,7 @@ var vNode = {
|
|
|
hisproComponent: hisproComponent,
|
|
|
forwardshare: vmForward,
|
|
|
mobilePortrayalFooter:mobilePortrayalFooter,
|
|
|
+ mobilePortrayalGroupingScript: mobilePortrayalGroupingScript,
|
|
|
downloadpopup: downloadpopup,
|
|
|
|
|
|
},
|
|
@@ -194,7 +195,20 @@ var vNode = {
|
|
|
isFree: false,
|
|
|
balance:0,
|
|
|
moreSesame: false,
|
|
|
- isOneRow: false
|
|
|
+ isOneRow: false,
|
|
|
+ showGroupingDialog: false,
|
|
|
+ groupingList: [],
|
|
|
+ sourceMap: {
|
|
|
+ app: 'app_ent_more',
|
|
|
+ wx: 'wx_ent_more',
|
|
|
+ h5: 'h5_ent_more'
|
|
|
+ },
|
|
|
+ sourceLimitMap: {
|
|
|
+ app: 'app_ent_limit',
|
|
|
+ wx: 'wx_ent_limit',
|
|
|
+ h5: 'h5_ent_limit'
|
|
|
+ },
|
|
|
+ setGroupState: '' // 如果为put说明是企业画像-已监控-更改
|
|
|
}
|
|
|
},
|
|
|
created: function () {
|
|
@@ -214,6 +228,7 @@ var vNode = {
|
|
|
// 判断用户是否登录
|
|
|
this.getUserSimpleInfo()
|
|
|
this.getPowerInfo()
|
|
|
+ this.getEntGroupList()
|
|
|
if (!this.restore) {
|
|
|
// 获取企业基本信息
|
|
|
this.getEntBaseInfo()
|
|
@@ -386,6 +401,48 @@ var vNode = {
|
|
|
referer: location.href
|
|
|
}
|
|
|
},
|
|
|
+ updateGroupList () {
|
|
|
+ this.getEntGroupList()
|
|
|
+ },
|
|
|
+ // 获取企业分组列表
|
|
|
+ getEntGroupList () {
|
|
|
+ var _this = this
|
|
|
+ $.ajax({
|
|
|
+ url: '/bigmember/follow/ent/labelGroupList',
|
|
|
+ type: 'POST',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.error_code === 0) {
|
|
|
+ _this.groupingList = res.data?.groupUserArr || []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ confirmGrouping (params) {
|
|
|
+ var _this = this;
|
|
|
+ // 确认分组事件
|
|
|
+ console.log(params, 'params')
|
|
|
+ this.showGroupingDialog = false
|
|
|
+ // 企业画像-已监控-更改分组
|
|
|
+ if(this.setGroupState === 'put') {
|
|
|
+ $.ajax({
|
|
|
+ url: '/bigmember/follow/ent/changeGroup',
|
|
|
+ type: 'POST',
|
|
|
+ data: params,
|
|
|
+ success: function (res) {
|
|
|
+ if (res.data === 'success') {
|
|
|
+ _this.$toast('修改分组成功')
|
|
|
+ // 更新分组内容
|
|
|
+ _this.getEntFollowState()
|
|
|
+ } else {
|
|
|
+ // 处理错误情况
|
|
|
+ _this.$toast(res.error_msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.changeFollowStateRequest(params)
|
|
|
+ }
|
|
|
+ },
|
|
|
// 监听画像页面滚动
|
|
|
onEntScroll: utils.debounce(function (e) {
|
|
|
this.pageScrollTop = e.target.scrollTop
|
|
@@ -814,6 +871,20 @@ var vNode = {
|
|
|
},
|
|
|
})
|
|
|
},
|
|
|
+ changeGroupState: function (type) {
|
|
|
+ console.log(type);
|
|
|
+
|
|
|
+ this.setGroupState = type
|
|
|
+ this.showGroupingDialog = true
|
|
|
+ const followedGroup = this.entInfo.followedGroup
|
|
|
+ let groupList = []
|
|
|
+ if(followedGroup.indexOf(',') !== -1) {
|
|
|
+ groupList = followedGroup.split(',')
|
|
|
+ } else {
|
|
|
+ groupList = [followedGroup]
|
|
|
+ }
|
|
|
+ this.$refs.portrayalGrouping.setState(groupList)
|
|
|
+ },
|
|
|
// 查询企业是否存在和企业关注状态
|
|
|
getEntFollowState: function () {
|
|
|
var _this = this
|
|
@@ -831,6 +902,8 @@ var vNode = {
|
|
|
if (res.data) {
|
|
|
_this.entInfo.follow = !!res.data.followed
|
|
|
_this.entInfo.entExist = !!res.data.isShow
|
|
|
+ _this.entInfo.followedGroup = res.data.followedGroup
|
|
|
+
|
|
|
} else {
|
|
|
_this.entInfo.entExist = false
|
|
|
}
|
|
@@ -843,25 +916,31 @@ var vNode = {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- changeFollowState: function () {
|
|
|
+ changeFollowState: function (state) {
|
|
|
var _this = this
|
|
|
if(!this.isLogin) {
|
|
|
window.location.href = "/jyapp/free/login?to=back";
|
|
|
return
|
|
|
}
|
|
|
if (this.entInfo.follow) {
|
|
|
- this.$dialog.confirm({
|
|
|
- title: '提示信息',
|
|
|
- message: '取消对“' + _this.entInfo.name + '”的关注?',
|
|
|
- confirmButtonColor: '#2cb7ca'
|
|
|
- }).then(function () {
|
|
|
- _this.changeFollowStateRequest()
|
|
|
- })
|
|
|
+ if(!state) {
|
|
|
+ this.$dialog.confirm({
|
|
|
+ title: '提示信息',
|
|
|
+ message: '取消对“' + _this.entInfo.name + '”的关注?',
|
|
|
+ confirmButtonColor: '#2cb7ca'
|
|
|
+ }).then(function () {
|
|
|
+ _this.changeFollowStateRequest()
|
|
|
+ })
|
|
|
.catch(function () {
|
|
|
console.log('取消操作')
|
|
|
})
|
|
|
+ } else {
|
|
|
+ _this.changeFollowStateRequest()
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
- this.changeFollowStateRequest()
|
|
|
+ this.showGroupingDialog = true
|
|
|
+ // this.changeFollowStateRequest()
|
|
|
}
|
|
|
},
|
|
|
canReadConf13: function () {
|
|
@@ -1004,7 +1083,7 @@ var vNode = {
|
|
|
})
|
|
|
},
|
|
|
// 修改企业关注状态
|
|
|
- changeFollowStateRequest: function () {
|
|
|
+ changeFollowStateRequest: function (params = {}) {
|
|
|
var _this = this
|
|
|
var loading = this.showLoading()
|
|
|
var urls = {
|
|
@@ -1016,7 +1095,8 @@ var vNode = {
|
|
|
type: 'POST',
|
|
|
url: url,
|
|
|
data: {
|
|
|
- entId: _this.entInfo.id
|
|
|
+ entId: _this.entInfo.id,
|
|
|
+ ...params
|
|
|
},
|
|
|
timeout: 5000,
|
|
|
success: function (res) {
|
|
@@ -1026,6 +1106,8 @@ var vNode = {
|
|
|
loading.clear()
|
|
|
if (res.data === 'success' || res.data.status) {
|
|
|
_this.entInfo.follow = !_this.entInfo.follow
|
|
|
+ _this.getEntFollowState()
|
|
|
+ _this.$refs.portrayalFooter.no_monitor(res.data)
|
|
|
} else {
|
|
|
return _this.showToast(res.error_msg || '监控失败')
|
|
|
}
|
|
@@ -1033,9 +1115,9 @@ var vNode = {
|
|
|
_this.pointsTaskSuccessTip()
|
|
|
}
|
|
|
|
|
|
- if (!_this.entInfo.follow) {
|
|
|
- history.back()
|
|
|
- }
|
|
|
+ // if (!_this.entInfo.follow) {
|
|
|
+ // history.back()
|
|
|
+ // }
|
|
|
} else {
|
|
|
_this.showToast(res.error_msg)
|
|
|
}
|