21 lines
535 B
JavaScript
21 lines
535 B
JavaScript
export function removeDev() {
|
|
if (!this.targetPoint.hasDevice) {
|
|
alert("该附着点不存在设备");
|
|
return;
|
|
} else {
|
|
// 删除模型逻辑
|
|
const devId = this.targetPoint.info.devId;
|
|
|
|
const model = this.scene.getObjectById(devId);
|
|
this.scene.remove(model);
|
|
|
|
// 附着点可见
|
|
this.targetPoint.visible = true;
|
|
this.targetPoint.info = null;
|
|
// 按钮可否操作情况
|
|
this.addBtn.disabled = false;
|
|
this.removeBtn.disabled = true;
|
|
this.targetPoint.hasDevice = false;
|
|
}
|
|
}
|