fix: 协同拜访副本判断 — 主记录不再被误判为副本
- 原逻辑: 只要 visit_group_id 存在就当副本,导致主记录被误判 - 且用 companions[0](第一个同访人)当作创建者,显示错误的协同人 - 新逻辑: 用 edit_log[0].editor 判断 — editor==归属经理 是主记录, editor!=归属经理 才是副本 - 副本提示的创建者改为 edit_log[0].editor,不再依赖 companions[0] Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -81,15 +81,16 @@ onMounted(async () => {
|
|||||||
const parts = v.time_range.split('-')
|
const parts = v.time_range.split('-')
|
||||||
timeRangeValue.value = [parts[0], parts[1]]
|
timeRangeValue.value = [parts[0], parts[1]]
|
||||||
}
|
}
|
||||||
// Check if this is a companion record
|
// Check if this is a companion copy (a record created BY someone else
|
||||||
if (v.visit_group_id) {
|
// and copied to you as a co-visitor). The original (主记录) has
|
||||||
|
// editor == manager; a copy has editor != manager.
|
||||||
|
const creatorName = (v.edit_log && v.edit_log[0] && v.edit_log[0].editor) || ''
|
||||||
|
if (v.visit_group_id && creatorName && creatorName !== (v.manager_name || '')) {
|
||||||
isCompanionRecord.value = true
|
isCompanionRecord.value = true
|
||||||
// The companions field on a companion record contains the primary creator
|
companionOf.value = creatorName
|
||||||
const creatorId = (v.companions || [])[0]
|
} else {
|
||||||
if (creatorId) {
|
isCompanionRecord.value = false
|
||||||
const creator = managers.value.find((m: any) => m.id === String(creatorId))
|
companionOf.value = ''
|
||||||
companionOf.value = creator?.name || ''
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (const key of (v.photos || [])) {
|
for (const key of (v.photos || [])) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user