CN-1582 fix: 1、修复不能识别schema中新增的subscriber.id字段导致的左侧filter报错的问题;2、修复获取tag列表时,因subscriber没有tag导致的接口url为空造成的报错

This commit is contained in:
刘洪洪
2024-03-28 14:46:12 +08:00
parent 5a8e2359c3
commit 46da17f75e
2 changed files with 12 additions and 10 deletions

View File

@@ -293,16 +293,18 @@ export default {
break
}
}
axios.get(`${url}?resource=${this.entity.entityValue}`).then(responese => {
const res = responese.data
if (responese.status === 200) {
formatTags(res.data, this.entity.entityType, this.levelTwoTags)
if (_.isArray(res.data.userDefinedTags)) {
this.levelTwoTags = _.concat(this.levelTwoTags, res.data.userDefinedTags.map(tag => ({ value: tag.tagValue, color: tag.knowledgeBase ? tag.knowledgeBase.color : entityDefaultColor })))
if (this.entity.entityType !== 'subscriber_id') {
axios.get(`${url}?resource=${this.entity.entityValue}`).then(responese => {
const res = responese.data
if (responese.status === 200) {
formatTags(res.data, this.entity.entityType, this.levelTwoTags)
if (_.isArray(res.data.userDefinedTags)) {
this.levelTwoTags = _.concat(this.levelTwoTags, res.data.userDefinedTags.map(tag => ({ value: tag.tagValue, color: tag.knowledgeBase ? tag.knowledgeBase.color : entityDefaultColor })))
}
this.hideTagArea = _.isEmpty(this.levelTwoTags)
}
this.hideTagArea = _.isEmpty(this.levelTwoTags)
}
})
})
}
},
/* 切换折叠状态 */
switchCollapse () {