|
|
@ -51,6 +51,7 @@ |
|
|
@platform-style-saved="onPlatformStyleSaved" |
|
|
@platform-style-saved="onPlatformStyleSaved" |
|
|
@whiteboard-draw-complete="handleWhiteboardDrawComplete" |
|
|
@whiteboard-draw-complete="handleWhiteboardDrawComplete" |
|
|
@whiteboard-platform-updated="handleWhiteboardPlatformUpdated" |
|
|
@whiteboard-platform-updated="handleWhiteboardPlatformUpdated" |
|
|
|
|
|
@whiteboard-platform-style-updated="handleWhiteboardPlatformStyleUpdated" |
|
|
@whiteboard-entity-deleted="handleWhiteboardEntityDeleted" |
|
|
@whiteboard-entity-deleted="handleWhiteboardEntityDeleted" |
|
|
@whiteboard-drawing-updated="handleWhiteboardDrawingUpdated" /> |
|
|
@whiteboard-drawing-updated="handleWhiteboardDrawingUpdated" /> |
|
|
<div v-show="!screenshotMode" class="map-overlay-text"> |
|
|
<div v-show="!screenshotMode" class="map-overlay-text"> |
|
|
@ -164,6 +165,7 @@ |
|
|
@layer-favorites="layerFavorites" |
|
|
@layer-favorites="layerFavorites" |
|
|
@route-favorites="routeFavorites" |
|
|
@route-favorites="routeFavorites" |
|
|
@show-online-members="showOnlineMembersDialog" |
|
|
@show-online-members="showOnlineMembersDialog" |
|
|
|
|
|
@edit-user-profile="openUserProfileDialog" |
|
|
/> |
|
|
/> |
|
|
<!-- 左侧折叠菜单栏 - 蓝色主题 --> |
|
|
<!-- 左侧折叠菜单栏 - 蓝色主题 --> |
|
|
<left-menu |
|
|
<left-menu |
|
|
@ -330,6 +332,12 @@ |
|
|
@rollback-done="onOperationRollbackDone" |
|
|
@rollback-done="onOperationRollbackDone" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<user-profile-dialog |
|
|
|
|
|
v-model="showUserProfileDialog" |
|
|
|
|
|
:profile="roomUserProfile" |
|
|
|
|
|
@profile-updated="handleUserProfileUpdated" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 平台编辑弹窗(与 4T 一致:可拖动、记录位置、不阻挡地图) --> |
|
|
<!-- 平台编辑弹窗(与 4T 一致:可拖动、记录位置、不阻挡地图) --> |
|
|
<platform-edit-dialog |
|
|
<platform-edit-dialog |
|
|
v-model="showPlatformDialog" |
|
|
v-model="showPlatformDialog" |
|
|
@ -511,6 +519,7 @@ import ScaleDialog from '@/views/dialogs/ScaleDialog' |
|
|
import ExternalParamsDialog from '@/views/dialogs/ExternalParamsDialog' |
|
|
import ExternalParamsDialog from '@/views/dialogs/ExternalParamsDialog' |
|
|
import PageLayoutDialog from '@/views/dialogs/PageLayoutDialog' |
|
|
import PageLayoutDialog from '@/views/dialogs/PageLayoutDialog' |
|
|
import KTimeSetDialog from '@/views/dialogs/KTimeSetDialog' |
|
|
import KTimeSetDialog from '@/views/dialogs/KTimeSetDialog' |
|
|
|
|
|
import UserProfileDialog from '@/views/dialogs/UserProfileDialog' |
|
|
import LeftMenu from './LeftMenu' |
|
|
import LeftMenu from './LeftMenu' |
|
|
import RightPanel from './RightPanel' |
|
|
import RightPanel from './RightPanel' |
|
|
import BottomLeftPanel from './BottomLeftPanel' |
|
|
import BottomLeftPanel from './BottomLeftPanel' |
|
|
@ -526,7 +535,16 @@ import { listLib,addLib,delLib} from "@/api/system/lib"; |
|
|
import { getRooms, updateRooms, listRooms } from "@/api/system/rooms"; |
|
|
import { getRooms, updateRooms, listRooms } from "@/api/system/rooms"; |
|
|
import { getMenuConfig, saveMenuConfig } from "@/api/system/userMenuConfig"; |
|
|
import { getMenuConfig, saveMenuConfig } from "@/api/system/userMenuConfig"; |
|
|
import { listByRoomId as listRoomPlatformIcons, addRoomPlatformIcon, updateRoomPlatformIcon, delRoomPlatformIcon } from "@/api/system/roomPlatformIcon"; |
|
|
import { listByRoomId as listRoomPlatformIcons, addRoomPlatformIcon, updateRoomPlatformIcon, delRoomPlatformIcon } from "@/api/system/roomPlatformIcon"; |
|
|
import { listWhiteboards, getWhiteboard, createWhiteboard, updateWhiteboard, deleteWhiteboard } from "@/api/system/whiteboard"; |
|
|
import { |
|
|
|
|
|
listWhiteboards, |
|
|
|
|
|
getWhiteboard, |
|
|
|
|
|
createWhiteboard, |
|
|
|
|
|
updateWhiteboard, |
|
|
|
|
|
deleteWhiteboard, |
|
|
|
|
|
saveWhiteboardPlatformStyle, |
|
|
|
|
|
deleteWhiteboardPlatformStyle, |
|
|
|
|
|
getRoomUserProfile |
|
|
|
|
|
} from "@/api/system/whiteboard"; |
|
|
import PlatformImportDialog from "@/views/dialogs/PlatformImportDialog.vue"; |
|
|
import PlatformImportDialog from "@/views/dialogs/PlatformImportDialog.vue"; |
|
|
import ExportRoutesDialog from "@/views/dialogs/ExportRoutesDialog.vue"; |
|
|
import ExportRoutesDialog from "@/views/dialogs/ExportRoutesDialog.vue"; |
|
|
import ImportRoutesDialog from "@/views/dialogs/ImportRoutesDialog.vue"; |
|
|
import ImportRoutesDialog from "@/views/dialogs/ImportRoutesDialog.vue"; |
|
|
@ -553,6 +571,7 @@ export default { |
|
|
ExternalParamsDialog, |
|
|
ExternalParamsDialog, |
|
|
PageLayoutDialog, |
|
|
PageLayoutDialog, |
|
|
KTimeSetDialog, |
|
|
KTimeSetDialog, |
|
|
|
|
|
UserProfileDialog, |
|
|
LeftMenu, |
|
|
LeftMenu, |
|
|
RightPanel, |
|
|
RightPanel, |
|
|
BottomLeftPanel, |
|
|
BottomLeftPanel, |
|
|
@ -571,6 +590,7 @@ export default { |
|
|
mapDragEnabled: false, |
|
|
mapDragEnabled: false, |
|
|
// 在线成员弹窗 |
|
|
// 在线成员弹窗 |
|
|
showOnlineMembers: false, |
|
|
showOnlineMembers: false, |
|
|
|
|
|
showUserProfileDialog: false, |
|
|
// 编辑弹窗控制 |
|
|
// 编辑弹窗控制 |
|
|
showPlatformDialog: false, |
|
|
showPlatformDialog: false, |
|
|
selectedPlatform: null, |
|
|
selectedPlatform: null, |
|
|
@ -801,6 +821,13 @@ export default { |
|
|
|
|
|
|
|
|
// 用户 |
|
|
// 用户 |
|
|
userAvatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png', |
|
|
userAvatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png', |
|
|
|
|
|
roomUserProfile: { |
|
|
|
|
|
userId: null, |
|
|
|
|
|
userName: '', |
|
|
|
|
|
displayName: '', |
|
|
|
|
|
avatar: '' |
|
|
|
|
|
}, |
|
|
|
|
|
avatarRefreshTs: Date.now(), |
|
|
/** 当前连接的 WebSocket sessionId 集合(用于过滤自己发出的同步消息,避免重复应用) */ |
|
|
/** 当前连接的 WebSocket sessionId 集合(用于过滤自己发出的同步消息,避免重复应用) */ |
|
|
mySyncSessionIds: [], |
|
|
mySyncSessionIds: [], |
|
|
}; |
|
|
}; |
|
|
@ -1047,6 +1074,7 @@ export default { |
|
|
created() { |
|
|
created() { |
|
|
this.currentRoomId = this.$route.query.roomId; |
|
|
this.currentRoomId = this.$route.query.roomId; |
|
|
console.log("从路由接收到的真实房间 ID:", this.currentRoomId); |
|
|
console.log("从路由接收到的真实房间 ID:", this.currentRoomId); |
|
|
|
|
|
this.fetchRoomUserProfile(); |
|
|
this.getPlatformList(); |
|
|
this.getPlatformList(); |
|
|
if (this.currentRoomId) { |
|
|
if (this.currentRoomId) { |
|
|
this.getRoomDetail(() => this.getList()); |
|
|
this.getRoomDetail(() => this.getList()); |
|
|
@ -1934,6 +1962,53 @@ export default { |
|
|
showOnlineMembersDialog() { |
|
|
showOnlineMembersDialog() { |
|
|
this.showOnlineMembers = true; |
|
|
this.showOnlineMembers = true; |
|
|
}, |
|
|
}, |
|
|
|
|
|
openUserProfileDialog() { |
|
|
|
|
|
this.showUserProfileDialog = true; |
|
|
|
|
|
}, |
|
|
|
|
|
async fetchRoomUserProfile() { |
|
|
|
|
|
try { |
|
|
|
|
|
const res = await getRoomUserProfile(); |
|
|
|
|
|
const p = res.data || {}; |
|
|
|
|
|
this.roomUserProfile = { |
|
|
|
|
|
userId: p.userId, |
|
|
|
|
|
userName: p.userName || this.$store.getters.name || '', |
|
|
|
|
|
displayName: p.displayName || p.userName || this.$store.getters.name || '', |
|
|
|
|
|
avatar: p.avatar || '' |
|
|
|
|
|
}; |
|
|
|
|
|
this.userAvatar = this.resolveAvatarUrl(this.roomUserProfile.avatar) || this.userAvatar; |
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
// 保持默认头像,不阻断页面逻辑 |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
handleUserProfileUpdated(profile) { |
|
|
|
|
|
if (!profile) return; |
|
|
|
|
|
this.avatarRefreshTs = Date.now(); |
|
|
|
|
|
const fixedAvatar = profile.avatar || profile.imgUrl || profile.fullImgUrl || this.roomUserProfile.avatar || ''; |
|
|
|
|
|
const instantPreview = profile.localAvatarPreview || profile.previewAvatarUrl || ''; |
|
|
|
|
|
this.roomUserProfile = { |
|
|
|
|
|
...this.roomUserProfile, |
|
|
|
|
|
...profile, |
|
|
|
|
|
avatar: fixedAvatar |
|
|
|
|
|
}; |
|
|
|
|
|
this.userAvatar = instantPreview || this.resolveAvatarUrl(this.roomUserProfile.avatar) || this.userAvatar; |
|
|
|
|
|
// 更新当前在线成员列表中的本人展示,避免等待重连后才生效 |
|
|
|
|
|
const myId = this.currentUserId; |
|
|
|
|
|
if (myId != null && Array.isArray(this.wsOnlineMembers)) { |
|
|
|
|
|
this.wsOnlineMembers = this.wsOnlineMembers.map(m => { |
|
|
|
|
|
if (Number(m.userId) !== Number(myId)) return m; |
|
|
|
|
|
return { |
|
|
|
|
|
...m, |
|
|
|
|
|
name: this.roomUserProfile.displayName || m.name, |
|
|
|
|
|
avatar: instantPreview || this.resolveAvatarUrl(this.roomUserProfile.avatar) || m.avatar |
|
|
|
|
|
}; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
if (fixedAvatar) { |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
this.fetchRoomUserProfile(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
onOperationRollbackDone() { |
|
|
onOperationRollbackDone() { |
|
|
// 回滚后同时刷新房间内航线/航点和平台库列表 |
|
|
// 回滚后同时刷新房间内航线/航点和平台库列表 |
|
|
this.getList(); |
|
|
this.getList(); |
|
|
@ -1962,14 +2037,22 @@ export default { |
|
|
return m; |
|
|
return m; |
|
|
}).filter(Boolean); |
|
|
}).filter(Boolean); |
|
|
}, |
|
|
}, |
|
|
|
|
|
resolveAvatarUrl(avatar) { |
|
|
|
|
|
if (!avatar) return ''; |
|
|
|
|
|
if (avatar.startsWith('http')) return avatar; |
|
|
|
|
|
const baseUrl = process.env.VUE_APP_BACKEND_URL || (window.location.origin + (process.env.VUE_APP_BASE_API || '')); |
|
|
|
|
|
const fullUrl = baseUrl + avatar; |
|
|
|
|
|
const sep = fullUrl.includes('?') ? '&' : '?'; |
|
|
|
|
|
return `${fullUrl}${sep}t=${this.avatarRefreshTs}`; |
|
|
|
|
|
}, |
|
|
sendPrivateChat(targetUserId, targetUserName, content) { |
|
|
sendPrivateChat(targetUserId, targetUserName, content) { |
|
|
if (!this.wsConnection || !this.wsConnection.sendPrivateChat) return; |
|
|
if (!this.wsConnection || !this.wsConnection.sendPrivateChat) return; |
|
|
this.wsConnection.sendPrivateChat(targetUserId, targetUserName, content); |
|
|
this.wsConnection.sendPrivateChat(targetUserId, targetUserName, content); |
|
|
const sender = { |
|
|
const sender = { |
|
|
userId: this.currentUserId, |
|
|
userId: this.currentUserId, |
|
|
userName: this.$store.getters.name, |
|
|
userName: this.$store.getters.name, |
|
|
nickName: this.$store.getters.nickName || this.$store.getters.name, |
|
|
nickName: this.roomUserProfile.displayName || this.$store.getters.nickName || this.$store.getters.name, |
|
|
avatar: this.$store.getters.avatar || '' |
|
|
avatar: this.roomUserProfile.avatar || '' |
|
|
}; |
|
|
}; |
|
|
const msg = { type: 'PRIVATE_CHAT', sender, targetUserId, targetUserName, content, timestamp: Date.now() }; |
|
|
const msg = { type: 'PRIVATE_CHAT', sender, targetUserId, targetUserName, content, timestamp: Date.now() }; |
|
|
const list = this.privateChatMessages[targetUserId] || []; |
|
|
const list = this.privateChatMessages[targetUserId] || []; |
|
|
@ -1990,9 +2073,11 @@ export default { |
|
|
role: m.role === 'owner' ? '房主' : (m.role === 'admin' ? '管理员' : '成员'), |
|
|
role: m.role === 'owner' ? '房主' : (m.role === 'admin' ? '管理员' : '成员'), |
|
|
status: '在线', |
|
|
status: '在线', |
|
|
isEditing: false, |
|
|
isEditing: false, |
|
|
avatar: m.avatar ? (m.avatar.startsWith('http') ? m.avatar : (baseUrl + m.avatar)) : '' |
|
|
avatar: m.avatar ? (m.avatar.startsWith('http') ? m.avatar : (baseUrl + m.avatar)) : '', |
|
|
|
|
|
// 来源房间:用于统计“本房间真实在线人数” |
|
|
|
|
|
roomId: m.roomId |
|
|
})); |
|
|
})); |
|
|
this.onlineCount = this.wsOnlineMembers.length; |
|
|
this.onlineCount = this.wsOnlineMembers.filter(x => x.roomId != null && String(x.roomId) === String(this.currentRoomId)).length; |
|
|
const myId = this.$store.getters.id; |
|
|
const myId = this.$store.getters.id; |
|
|
this.mySyncSessionIds = (members || []).filter(m => myId != null && String(m.userId) === String(myId)).map(m => m.sessionId).filter(Boolean); |
|
|
this.mySyncSessionIds = (members || []).filter(m => myId != null && String(m.userId) === String(myId)).map(m => m.sessionId).filter(Boolean); |
|
|
}, |
|
|
}, |
|
|
@ -2006,11 +2091,12 @@ export default { |
|
|
role: member.role === 'owner' ? '房主' : (member.role === 'admin' ? '管理员' : '成员'), |
|
|
role: member.role === 'owner' ? '房主' : (member.role === 'admin' ? '管理员' : '成员'), |
|
|
status: '在线', |
|
|
status: '在线', |
|
|
isEditing: false, |
|
|
isEditing: false, |
|
|
avatar: member.avatar ? (member.avatar.startsWith('http') ? member.avatar : (baseUrl + member.avatar)) : '' |
|
|
avatar: member.avatar ? (member.avatar.startsWith('http') ? member.avatar : (baseUrl + member.avatar)) : '', |
|
|
|
|
|
roomId: member.roomId |
|
|
}; |
|
|
}; |
|
|
if (!this.wsOnlineMembers.find(x => x.id === m.id)) { |
|
|
if (!this.wsOnlineMembers.find(x => x.id === m.id)) { |
|
|
this.wsOnlineMembers = [...this.wsOnlineMembers, m]; |
|
|
this.wsOnlineMembers = [...this.wsOnlineMembers, m]; |
|
|
this.onlineCount = this.wsOnlineMembers.length; |
|
|
this.onlineCount = this.wsOnlineMembers.filter(x => x.roomId != null && String(x.roomId) === String(this.currentRoomId)).length; |
|
|
} |
|
|
} |
|
|
const myId = this.$store.getters.id; |
|
|
const myId = this.$store.getters.id; |
|
|
if (myId != null && String(member.userId) === String(myId) && member.sessionId) { |
|
|
if (myId != null && String(member.userId) === String(myId) && member.sessionId) { |
|
|
@ -2021,7 +2107,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
onMemberLeft: (member, sessionId) => { |
|
|
onMemberLeft: (member, sessionId) => { |
|
|
this.wsOnlineMembers = this.wsOnlineMembers.filter(m => m.id !== sessionId && m.id !== member.sessionId); |
|
|
this.wsOnlineMembers = this.wsOnlineMembers.filter(m => m.id !== sessionId && m.id !== member.sessionId); |
|
|
this.onlineCount = this.wsOnlineMembers.length; |
|
|
this.onlineCount = this.wsOnlineMembers.filter(x => x.roomId != null && String(x.roomId) === String(this.currentRoomId)).length; |
|
|
this.mySyncSessionIds = this.mySyncSessionIds.filter(s => s !== sessionId && s !== member.sessionId); |
|
|
this.mySyncSessionIds = this.mySyncSessionIds.filter(s => s !== sessionId && s !== member.sessionId); |
|
|
// 该成员离开后清除其编辑锁定状态 |
|
|
// 该成员离开后清除其编辑锁定状态 |
|
|
Object.keys(this.routeLockedBy).forEach(rid => { |
|
|
Object.keys(this.routeLockedBy).forEach(rid => { |
|
|
@ -3817,22 +3903,83 @@ export default { |
|
|
this.saveCurrentWhiteboard({ contentByTime }) |
|
|
this.saveCurrentWhiteboard({ contentByTime }) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** 白板平台拖拽/旋转后更新 contentByTime 并保存 */ |
|
|
/** 白板平台拖拽/旋转后更新 contentByTime 并保存(仅位置与朝向) */ |
|
|
handleWhiteboardPlatformUpdated(entityData) { |
|
|
handleWhiteboardPlatformUpdated(entityData) { |
|
|
if (!this.currentWhiteboard || !this.currentWhiteboardTimeBlock || !entityData || !entityData.id) return |
|
|
if (!this.currentWhiteboard || !this.currentWhiteboardTimeBlock || !entityData || !entityData.id) return |
|
|
const contentByTime = { ...(this.currentWhiteboard.contentByTime || {}) } |
|
|
const contentByTime = { ...(this.currentWhiteboard.contentByTime || {}) } |
|
|
const currentContent = contentByTime[this.currentWhiteboardTimeBlock] || { entities: [] } |
|
|
const currentContent = contentByTime[this.currentWhiteboardTimeBlock] || { entities: [] } |
|
|
const ents = [...(currentContent.entities || [])] |
|
|
const ents = [...(currentContent.entities || [])] |
|
|
const idx = ents.findIndex(e => e.id === entityData.id) |
|
|
const normalizeId = (id) => { |
|
|
|
|
|
if (id == null) return '' |
|
|
|
|
|
const str = String(id) |
|
|
|
|
|
return str.startsWith('wb_') ? str.slice(3) : str |
|
|
|
|
|
} |
|
|
|
|
|
const targetId = String(entityData.id) |
|
|
|
|
|
const targetIdNormalized = normalizeId(targetId) |
|
|
|
|
|
const idx = ents.findIndex((e) => { |
|
|
|
|
|
const eid = String((e && e.id) || '') |
|
|
|
|
|
return eid === targetId || normalizeId(eid) === targetIdNormalized |
|
|
|
|
|
}) |
|
|
if (idx >= 0) { |
|
|
if (idx >= 0) { |
|
|
const updated = { ...ents[idx], lat: entityData.lat, lng: entityData.lng, heading: entityData.heading != null ? entityData.heading : 0 } |
|
|
const updated = { |
|
|
if (entityData.iconScale != null) updated.iconScale = entityData.iconScale |
|
|
...ents[idx], |
|
|
|
|
|
lat: entityData.lat, |
|
|
|
|
|
lng: entityData.lng, |
|
|
|
|
|
heading: entityData.heading != null ? entityData.heading : 0 |
|
|
|
|
|
} |
|
|
|
|
|
// 样式(颜色/大小)交由专门事件保存,避免位置更新覆盖样式 |
|
|
ents[idx] = updated |
|
|
ents[idx] = updated |
|
|
contentByTime[this.currentWhiteboardTimeBlock] = { ...currentContent, entities: ents } |
|
|
contentByTime[this.currentWhiteboardTimeBlock] = { ...currentContent, entities: ents } |
|
|
this.saveCurrentWhiteboard({ contentByTime }) |
|
|
this.saveCurrentWhiteboard({ contentByTime }) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** 白板平台样式更新(颜色/大小)单独落库,避免被位置事件覆盖 */ |
|
|
|
|
|
handleWhiteboardPlatformStyleUpdated(stylePayload) { |
|
|
|
|
|
if (!this.currentWhiteboard || !stylePayload || !stylePayload.id) return |
|
|
|
|
|
const normalizeId = (id) => { |
|
|
|
|
|
if (id == null) return '' |
|
|
|
|
|
const str = String(id) |
|
|
|
|
|
return str.startsWith('wb_') ? str.slice(3) : str |
|
|
|
|
|
} |
|
|
|
|
|
const targetId = String(stylePayload.id) |
|
|
|
|
|
const targetIdNormalized = normalizeId(targetId) |
|
|
|
|
|
let platformInstanceId = targetId |
|
|
|
|
|
let styleColor = stylePayload.color |
|
|
|
|
|
let styleScale = stylePayload.iconScale |
|
|
|
|
|
|
|
|
|
|
|
// 尝试在当前时间块查找实体,拿到稳定 id 以及最新样式 |
|
|
|
|
|
const contentByTime = { ...(this.currentWhiteboard.contentByTime || {}) } |
|
|
|
|
|
const currentContent = contentByTime[this.currentWhiteboardTimeBlock] || { entities: [] } |
|
|
|
|
|
const ents = [...(currentContent.entities || [])] |
|
|
|
|
|
const idx = ents.findIndex((e) => { |
|
|
|
|
|
const eid = String((e && e.id) || '') |
|
|
|
|
|
return eid === targetId || normalizeId(eid) === targetIdNormalized |
|
|
|
|
|
}) |
|
|
|
|
|
if (idx >= 0) { |
|
|
|
|
|
const updated = { ...ents[idx] } |
|
|
|
|
|
if (stylePayload.color) updated.color = stylePayload.color |
|
|
|
|
|
if (stylePayload.iconScale != null) updated.iconScale = stylePayload.iconScale |
|
|
|
|
|
ents[idx] = updated |
|
|
|
|
|
contentByTime[this.currentWhiteboardTimeBlock] = { ...currentContent, entities: ents } |
|
|
|
|
|
this.saveCurrentWhiteboard({ contentByTime }) |
|
|
|
|
|
platformInstanceId = updated.id || targetId |
|
|
|
|
|
styleColor = updated.color |
|
|
|
|
|
styleScale = updated.iconScale |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 无有效样式不写默认值,避免误覆盖 |
|
|
|
|
|
if (!styleColor || styleScale == null) return |
|
|
|
|
|
saveWhiteboardPlatformStyle({ |
|
|
|
|
|
schemeId: this.currentWhiteboard.id, |
|
|
|
|
|
platformInstanceId, |
|
|
|
|
|
style: { |
|
|
|
|
|
color: styleColor, |
|
|
|
|
|
iconScale: styleScale |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(() => {}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
/** 白板平台从右键菜单删除后,从 contentByTime 移除并保存 */ |
|
|
/** 白板平台从右键菜单删除后,从 contentByTime 移除并保存 */ |
|
|
handleWhiteboardEntityDeleted(entityData) { |
|
|
handleWhiteboardEntityDeleted(entityData) { |
|
|
if (!this.currentWhiteboard || !this.currentWhiteboardTimeBlock || !entityData || !entityData.id) return |
|
|
if (!this.currentWhiteboard || !this.currentWhiteboardTimeBlock || !entityData || !entityData.id) return |
|
|
@ -3841,6 +3988,10 @@ export default { |
|
|
const ents = (currentContent.entities || []).filter(e => e.id !== entityData.id) |
|
|
const ents = (currentContent.entities || []).filter(e => e.id !== entityData.id) |
|
|
contentByTime[this.currentWhiteboardTimeBlock] = { ...currentContent, entities: ents } |
|
|
contentByTime[this.currentWhiteboardTimeBlock] = { ...currentContent, entities: ents } |
|
|
this.saveCurrentWhiteboard({ contentByTime }) |
|
|
this.saveCurrentWhiteboard({ contentByTime }) |
|
|
|
|
|
deleteWhiteboardPlatformStyle({ |
|
|
|
|
|
schemeId: this.currentWhiteboard.id, |
|
|
|
|
|
platformInstanceId: entityData.id |
|
|
|
|
|
}).catch(() => {}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** 白板空域/图形编辑后(调整位置、修改属性等)更新 contentByTime 并保存 */ |
|
|
/** 白板空域/图形编辑后(调整位置、修改属性等)更新 contentByTime 并保存 */ |
|
|
|