yxh
yxh
7 天以前 09dc74e264b6262cbe41c9c8476e24705871d4a6
src/layout/components/CurrentRoomTag.vue
@@ -30,19 +30,30 @@
})
const tagText = computed(() => {
  if (!hasView.value) return '未选择工位'
  if (canOperate.value) return `诊室:${roomStore.getViewText}`
  // 【本需求】顶栏统一显示「当前工位:+ 实际工位」,替代原来的「诊室:…」/「围观:…」前缀
  if (!hasView.value) return '当前工位:未选择'
  // 【本需求·一人多工位】占多个工位时补一个数量提示,便于知道"我还在别的岗位"
  const seatCount = roomStore.getMySeatCount
  const countSuffix = seatCount > 1 ? `(我的工位 ${seatCount} 个)` : ''
  if (canOperate.value) return `当前工位:${roomStore.getViewText}${countSuffix}`
  const owner = roomStore.viewOwnerName
  return `围观:${roomStore.getViewText}${owner ? `(主人 ${owner})` : '(只读)'}`
  return `当前工位:${roomStore.getViewText}(围观${owner ? `,主人 ${owner}` : ',只读'})`
})
const tooltip = computed(() => {
  if (!hasView.value) return '尚未选择工位,点击选择要查看/入座的工位'
  if (canOperate.value) return `当前工位:${roomStore.getViewText}(点击切换工位)`
  const seats = roomStore.getMySeats || []
  const seatListText =
    seats.length > 0
      ? '我的工位:' + seats.map((s) => `${s.roomName || '诊室' + (s.roomId ?? '')} · ${s.bedNo ?? ''}`).join('、')
      : ''
  if (canOperate.value) {
    return `当前工位:${roomStore.getViewText}(点击切换工位)` + (seatListText ? `;${seatListText}` : '')
  }
  const mine = roomStore.getSeatText
  return `围观模式(只读):正在查看「${roomStore.getViewText}」`
    + (roomStore.viewOwnerName ? `,主人 ${roomStore.viewOwnerName}` : '')
    + (mine ? `;我入座的工位:${mine}` : ';我还没有入座')
    + (seatListText ? `;${seatListText}` : (mine ? `;我入座的工位:${mine}` : ';我还没有入座'))
    + '。点击可切换工位'
})