From ad305ae16fccff0f5ccc4510e1a57f6f88b403ba Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Wed, 24 Sep 2025 17:58:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Base/Explosion/index.js | 13 + src/Obj/Base/ParticleEffects/Flame/index.js | 14 + .../Base/ParticleEffects/Fountain/index.js | 26 +- src/Obj/Base/ParticleEffects/Smoke/index.js | 32 +- src/Obj/Base/ParticleEffects/Spout/index.js | 12 + src/Obj/Base/WallRealStereoscopic/index.js | 435 +----------------- 6 files changed, 94 insertions(+), 438 deletions(-) diff --git a/src/Obj/Base/Explosion/index.js b/src/Obj/Base/Explosion/index.js index f8e636f..1875fa7 100644 --- a/src/Obj/Base/Explosion/index.js +++ b/src/Obj/Base/Explosion/index.js @@ -86,6 +86,7 @@ class Explosion extends Base { // 编辑框 async edit(state) { + return let _this = this this.originalOptions = this.deepCopyObj(this.options) @@ -317,6 +318,10 @@ class Explosion extends Base { this.event.mouse_right(() => { }) this.event.gesture_pinck_start(() => { }) this.event.gesture_pinck_end(() => { }) + if(this._positionEditingCallback) { + this._positionEditingCallback() + this._positionEditingCallback = null + } this.positionEditing = false }) this.event.mouse_right((movement, cartesian) => { @@ -368,6 +373,14 @@ class Explosion extends Base { get positionEditing() { return this.operate.positionEditing } + openPositionEditing(cd) { + this.positionEditing = true + this._positionEditingCallback = cd + } + closePositionEditing() { + this.positionEditing = false + this._positionEditingCallback = null + } /** * 删除 diff --git a/src/Obj/Base/ParticleEffects/Flame/index.js b/src/Obj/Base/ParticleEffects/Flame/index.js index 0720ce5..efb3dc9 100644 --- a/src/Obj/Base/ParticleEffects/Flame/index.js +++ b/src/Obj/Base/ParticleEffects/Flame/index.js @@ -464,6 +464,7 @@ class Flame extends Base { * @param state=false {boolean} 状态: true打开, false关闭 */ async edit(state = false) { + return let _this = this this.originalOptions = this.deepCopyObj(this.options) @@ -663,6 +664,10 @@ class Flame extends Base { this.event.mouse_right(() => { }) this.event.gesture_pinck_start(() => { }) this.event.gesture_pinck_end(() => { }) + if(this._positionEditingCallback) { + this._positionEditingCallback() + this._positionEditingCallback = null + } this.positionEditing = false }) this.event.mouse_right((movement, cartesian) => { @@ -737,6 +742,15 @@ class Flame extends Base { return this.operate.positionEditing } + openPositionEditing(cd) { + this.positionEditing = true + this._positionEditingCallback = cd + } + closePositionEditing() { + this.positionEditing = false + this._positionEditingCallback = null + } + flicker() { } } diff --git a/src/Obj/Base/ParticleEffects/Fountain/index.js b/src/Obj/Base/ParticleEffects/Fountain/index.js index 9fa1d77..c074b1f 100644 --- a/src/Obj/Base/ParticleEffects/Fountain/index.js +++ b/src/Obj/Base/ParticleEffects/Fountain/index.js @@ -9,7 +9,7 @@ import MouseEvent from '../../../../Event/index' import { syncData, getSdk as get2DSdk } from '../../../../Global/MultiViewportMode' import MouseTip from '../../../../MouseTip' import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen' -import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../../Global/global' +import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../Global/global' class Fountain extends Base { /** @@ -110,7 +110,7 @@ class Fountain extends Base { this.label.show = false } } - if(this._DialogObject && this._DialogObject.showBtn) { + if (this._DialogObject && this._DialogObject.showBtn) { this._DialogObject.showBtn.checked = v } syncData(this.sdk, this.options.id) @@ -197,7 +197,7 @@ class Fountain extends Base { this.entity.position = { lng: this.options.lng, lat: this.options.lat, alt: this.options.alt } // this.editObj = new EditParticle(this.sdk, this.entity) syncData(this.sdk, this.options.id) - if(this.options.show) { + if (this.options.show) { setSplitDirection(0, this.options.id) } @@ -221,7 +221,7 @@ class Fountain extends Base { } setActiveViewer(0) closeRotateAround(this.sdk) - closeViewFollow(this.sdk) + closeViewFollow(this.sdk) if (this.options.customView && this.options.customView.relativePosition && this.options.customView.orientation) { let orientation = { @@ -485,6 +485,7 @@ class Fountain extends Base { * @param state=false {boolean} 状态: true打开, false关闭 */ async edit(state = false) { + return let _this = this this.originalOptions = this.deepCopyObj(this.options) @@ -667,7 +668,7 @@ class Fountain extends Base { ) }) this.event.mouse_left((movement, cartesian) => { - if(!movPos || movPos.x !== movement.position.x || movPos.y !== movement.position.y-2) { + if (!movPos || movPos.x !== movement.position.x || movPos.y !== movement.position.y - 2) { let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer) this.options.lng = positions.lng this.options.lat = positions.lat @@ -683,6 +684,10 @@ class Fountain extends Base { this.event.mouse_right(() => { }) this.event.gesture_pinck_start(() => { }) this.event.gesture_pinck_end(() => { }) + if(this._positionEditingCallback) { + this._positionEditingCallback() + this._positionEditingCallback = null + } this.positionEditing = false }) this.event.mouse_right((movement, cartesian) => { @@ -733,7 +738,7 @@ class Fountain extends Base { this.event.gesture_pinck_end(() => { }) } this.tip && this.tip.destroy() - if(!this.sdk || !this.sdk.viewer || !this.entity) { + if (!this.sdk || !this.sdk.viewer || !this.entity) { return } this.options.lng = this.entity.position.lng @@ -759,6 +764,15 @@ class Fountain extends Base { return this.operate.positionEditing } + openPositionEditing(cd) { + this.positionEditing = true + this._positionEditingCallback = cd + } + closePositionEditing() { + this.positionEditing = false + this._positionEditingCallback = null + } + flicker() { } } diff --git a/src/Obj/Base/ParticleEffects/Smoke/index.js b/src/Obj/Base/ParticleEffects/Smoke/index.js index d7495e3..76b18d2 100644 --- a/src/Obj/Base/ParticleEffects/Smoke/index.js +++ b/src/Obj/Base/ParticleEffects/Smoke/index.js @@ -9,7 +9,7 @@ import MouseEvent from '../../../../Event/index' import { syncData, getSdk as get2DSdk } from '../../../../Global/MultiViewportMode' import MouseTip from '../../../../MouseTip' import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen' -import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../../Global/global' +import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../Global/global' class Smoke extends Base { /** @@ -109,7 +109,7 @@ class Smoke extends Base { this.label.show = false } } - if(this._DialogObject && this._DialogObject.showBtn) { + if (this._DialogObject && this._DialogObject.showBtn) { this._DialogObject.showBtn.checked = v } syncData(this.sdk, this.options.id) @@ -159,7 +159,7 @@ class Smoke extends Base { emitter: new Cesium.CircleEmitter(0.2), performance: false, modelMatrix: matrix, - updateCallback: (r)=>{ + updateCallback: (r) => { r._billboard.id = this.options.id } }) @@ -171,8 +171,8 @@ class Smoke extends Base { this.entity.position = { lng: this.options.lng, lat: this.options.lat, alt: this.options.alt } // this.editObj = new EditParticle(this.sdk, this.entity) syncData(this.sdk, this.options.id) - if(this.options.show) { - + if (this.options.show) { + setSplitDirection(0, this.options.id) } @@ -196,7 +196,7 @@ class Smoke extends Base { } setActiveViewer(0) closeRotateAround(this.sdk) - closeViewFollow(this.sdk) + closeViewFollow(this.sdk) if (this.options.customView && this.options.customView.relativePosition && this.options.customView.orientation) { let orientation = { @@ -460,6 +460,7 @@ class Smoke extends Base { * @param state=false {boolean} 状态: true打开, false关闭 */ async edit(state = false) { + return let _this = this this.originalOptions = this.deepCopyObj(this.options) @@ -642,7 +643,7 @@ class Smoke extends Base { ) }) this.event.mouse_left((movement, cartesian) => { - if(!movPos || movPos.x !== movement.position.x || movPos.y !== movement.position.y-2) { + if (!movPos || movPos.x !== movement.position.x || movPos.y !== movement.position.y - 2) { let positions = this.cartesian3Towgs84(cartesian, this.sdk.viewer) this.options.lng = positions.lng this.options.lat = positions.lat @@ -658,6 +659,10 @@ class Smoke extends Base { this.event.mouse_right(() => { }) this.event.gesture_pinck_start(() => { }) this.event.gesture_pinck_end(() => { }) + if(this._positionEditingCallback) { + this._positionEditingCallback() + this._positionEditingCallback = null + } this.positionEditing = false }) this.event.mouse_right((movement, cartesian) => { @@ -708,7 +713,7 @@ class Smoke extends Base { this.event.gesture_pinck_end(() => { }) } this.tip && this.tip.destroy() - if(!this.sdk || !this.sdk.viewer || !this.entity) { + if (!this.sdk || !this.sdk.viewer || !this.entity) { return } this.options.lng = this.entity.position.lng @@ -733,7 +738,16 @@ class Smoke extends Base { return this.operate.positionEditing } - flicker() {} + openPositionEditing(cd) { + this.positionEditing = true + this._positionEditingCallback = cd + } + closePositionEditing() { + this.positionEditing = false + this._positionEditingCallback = null + } + + flicker() { } } export default Smoke diff --git a/src/Obj/Base/ParticleEffects/Spout/index.js b/src/Obj/Base/ParticleEffects/Spout/index.js index 9b4169f..371545c 100644 --- a/src/Obj/Base/ParticleEffects/Spout/index.js +++ b/src/Obj/Base/ParticleEffects/Spout/index.js @@ -796,6 +796,10 @@ class Spout extends Base { this.event.mouse_right(() => { }) this.event.gesture_pinck_start(() => { }) this.event.gesture_pinck_end(() => { }) + if(this._positionEditingCallback) { + this._positionEditingCallback() + this._positionEditingCallback = null + } this.positionEditing = false }) this.event.mouse_right((movement, cartesian) => { @@ -871,6 +875,14 @@ class Spout extends Base { get positionEditing() { return this.operate.positionEditing } + openPositionEditing(cd) { + this.positionEditing = true + this._positionEditingCallback = cd + } + closePositionEditing() { + this.positionEditing = false + this._positionEditingCallback = null + } static EventBinding(that, elements) { for (let i = 0; i < elements.length; i++) { diff --git a/src/Obj/Base/WallRealStereoscopic/index.js b/src/Obj/Base/WallRealStereoscopic/index.js index 1834f4d..f3489bd 100644 --- a/src/Obj/Base/WallRealStereoscopic/index.js +++ b/src/Obj/Base/WallRealStereoscopic/index.js @@ -76,7 +76,7 @@ class WallRealStereoscopic extends Base { this._elms = {}; this.options.color = options.color || "#ffffff" this.options.width = options.width || 0.24 - this.options['nose-to-tail'] = options['nose-to-tail'] || false + this.options.noseToTail = options.noseToTail || false this.options.extrudedHeight = options.extrudedHeight || 2.4 this.cornerType = options.cornerType this.options.positions = options.positions @@ -100,20 +100,14 @@ class WallRealStereoscopic extends Base { near: (options.label.near || options.label.near === 0) ? options.label.near : 2000, far: (options.label.far || options.label.far === 0) ? options.label.far : 100000, } - this.options.instruct = options.instruct || "" - this.options.operatingPoint = options.operatingPoint || "" + this.options.attribute = options.attribute || {} - this.options.attribute.vr = this.options.attribute.vr || {} - this.options.attribute.vr.content = this.options.attribute.vr.content || [] this.options.attribute.link = this.options.attribute.link || {} this.options.attribute.link.content = this.options.attribute.link.content || [] - this.options.attribute.camera = this.options.attribute.camera || {} - this.options.attribute.camera.content = this.options.attribute.camera.content || [] - this.options.attribute.ISC = this.options.attribute.ISC || {} - this.options.attribute.ISC.content = this.options.attribute.ISC.content || [] - this.options.attribute.goods = this.options.attribute.goods || {} - this.options.attribute.goods.content = this.options.attribute.goods.content || [] - this.options.attributeType = options.attributeType || 'richText' + + delete this.options.attribute.camera + delete this.options.attribute.vr + delete this.options.attribute.goods this.options.richTextContent = options.richTextContent || '' this.Dialog = _Dialog @@ -259,11 +253,11 @@ class WallRealStereoscopic extends Base { } get noseToTail() { - return this.options['nose-to-tail'] + return this.options.noseToTail } set noseToTail(v) { - this.options['nose-to-tail'] = v + this.options.noseToTail = v this.update() this.material = this.material this._elms.noseToTail && @@ -495,344 +489,6 @@ class WallRealStereoscopic extends Base { } } - get instruct() { - return this.options.instruct - } - set instruct(v) { - this.options.instruct = v - this._elms.instruct && this._elms.instruct.forEach((item) => { - item.value = v - }) - } - - get operatingPoint() { - return this.options.operatingPoint - } - set operatingPoint(v) { - this.options.operatingPoint = v - this._elms.operatingPoint && this._elms.operatingPoint.forEach((item) => { - item.value = v - }) - } - - get attributeType() { - return this.options.attributeType - } - - set attributeType(v) { - this.options.attributeType = v - this._elms.attributeType && this._elms.attributeType.forEach((item) => { - item.value = v - }) - let attributeContent = this._DialogObject._element.content.getElementsByClassName('attribute-content') - for (let i = 0; i < attributeContent.length; i++) { - if (attributeContent[i].className.indexOf('attribute-content-' + v) > -1) { - attributeContent[i].style.display = 'block'; - } - else { - attributeContent[i].style.display = 'none'; - } - } - } - - get attributeLink() { - return this.options.attribute.link.content - } - - set attributeLink(v) { - this.options.attribute.link.content = v - if (!this._DialogObject || !this._DialogObject._element || !this._DialogObject._element.content || this._DialogObject._element.content.getElementsByClassName('attribute-content-link').length == 0) { - return - } - let table = this._DialogObject._element.content.getElementsByClassName('attribute-content-link')[1].getElementsByClassName('table')[0] - let tableContent = table.getElementsByClassName('table-body')[0] - tableContent.innerHTML = '' - if (this.options.attribute.link.content.length > 0) { - table.getElementsByClassName('table-empty')[0].style.display = 'none' - } - else { - table.getElementsByClassName('table-empty')[0].style.display = 'flex' - } - for (let i = 0; i < this.options.attribute.link.content.length; i++) { - let tr = ` -