Merge branch 'master' of http://xny.yj-3d.com:3000/zh/sdk4.0_new
This commit is contained in:
		| @ -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 | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * 删除 | ||||
|  | ||||
| @ -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() { } | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -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() { } | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -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 | ||||
|  | ||||
| @ -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++) { | ||||
|  | ||||
| @ -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 = ` | ||||
|       <div class="tr"> | ||||
|           <div class="td">` + this.options.attribute.link.content[i].name + `</div> | ||||
|           <div class="td">` + this.options.attribute.link.content[i].url + `</div> | ||||
|           <div class="td"> | ||||
|               <button @click="linkEdit">编辑</button> | ||||
|               <button @click="linkDelete">删除</button> | ||||
|           </div> | ||||
|       </div>` | ||||
|       let trElm = document.createRange().createContextualFragment(tr) | ||||
|       tableContent.appendChild(trElm) | ||||
|     } | ||||
|     let item = tableContent.getElementsByClassName('tr') | ||||
|     let fun = { | ||||
|       linkEdit: async (index) => { | ||||
|         this.attributeLink = await this.options.attribute.link.content | ||||
|         let table = this._DialogObject._element.content.getElementsByClassName('attribute-content-link')[1].getElementsByClassName('table')[0] | ||||
|         let tableContent = table.getElementsByClassName('table-body')[0] | ||||
|         let item = tableContent.getElementsByClassName('tr') | ||||
|         for (let i = 0; i < item.length; i++) { | ||||
|           if (index === i) { | ||||
|             let height = item[i].offsetHeight | ||||
|             let html = ` | ||||
|               <div class="td"> | ||||
|                 <input class="input" type="text"> | ||||
|               </div> | ||||
|               <div class="td"> | ||||
|                 <textarea class="input link-edit" type="text"></textarea> | ||||
|               </div> | ||||
|               <div class="td"> | ||||
|                   <button @click="confirmEdit">确认</button> | ||||
|                   <button @click="cancelEdit">取消</button> | ||||
|               </div>` | ||||
|             item[i].innerHTML = html | ||||
|             let textareaElm = item[i].getElementsByClassName('link-edit')[0] | ||||
|             textareaElm.style.height = (height - 10) + 'px' | ||||
|             let td = item[i].getElementsByClassName('td') | ||||
|             td[0].getElementsByClassName('input')[0].value = this.options.attribute.link.content[index].name | ||||
|             td[1].getElementsByClassName('input')[0].value = this.options.attribute.link.content[index].url | ||||
|             let btn = item[i].getElementsByTagName('button') | ||||
|             for (let n = 0; n < btn.length; n++) { | ||||
|               if (!btn[n] || !btn[n].attributes) { | ||||
|                 continue; | ||||
|               } | ||||
|               for (let m of btn[n].attributes) { | ||||
|                 if (m.name === '@click') { | ||||
|                   btn[n].addEventListener('click', (e) => { | ||||
|                     if (typeof (fun[m.value]) === 'function') { | ||||
|                       fun[m.value]({ name: td[0].getElementsByClassName('input')[0].value, url: td[1].getElementsByClassName('input')[0].value }, i) | ||||
|                     } | ||||
|                   }); | ||||
|                   btn[n].attributes.removeNamedItem(m.name) | ||||
|                   break | ||||
|                 } | ||||
|               } | ||||
|             } | ||||
|             break | ||||
|           } | ||||
|         } | ||||
|       }, | ||||
|       linkDelete: (i) => { | ||||
|         this.options.attribute.link.content.splice(i, 1) | ||||
|         this.attributeLink = this.options.attribute.link.content | ||||
|       }, | ||||
|  | ||||
|       confirmEdit: (value, i) => { | ||||
|         let name = value.name && value.name.replace(/\s/g, "") | ||||
|         let url = value.url && value.url.replace(/\s/g, "") | ||||
|         if (name && url) { | ||||
|           this.options.attribute.link.content[i] = value | ||||
|         } | ||||
|         else { | ||||
|           window.ELEMENT && window.ELEMENT.Message({ | ||||
|             message: '名称或链接不能为空!', | ||||
|             type: 'warning', | ||||
|             duration: 1500 | ||||
|           }); | ||||
|         } | ||||
|         this.attributeLink = this.options.attribute.link.content | ||||
|       }, | ||||
|       cancelEdit: () => { | ||||
|         this.attributeLink = this.options.attribute.link.content | ||||
|       }, | ||||
|       fileSelect: (value, i) => { | ||||
|         let fileElm = item[i].getElementsByClassName('file-select')[0] | ||||
|         fileElm.click() | ||||
|         fileElm.removeEventListener('change', fileSelect) | ||||
|         fileElm.addEventListener('change', fileSelect) | ||||
|       } | ||||
|     } | ||||
|     let fileSelect = (event) => { | ||||
|       if (event.target.value) { | ||||
|         let td = item[event.target.getAttribute('index')].getElementsByClassName('td') | ||||
|         td[1].getElementsByClassName('input')[0].value = event.target.value | ||||
|         event.target.value = null | ||||
|       } | ||||
|     } | ||||
|     for (let i = 0; i < item.length; i++) { | ||||
|       let btn = item[i].getElementsByTagName('button') | ||||
|       for (let n = 0; n < btn.length; n++) { | ||||
|         if (!btn[n] || !btn[n].attributes) { | ||||
|           continue; | ||||
|         } | ||||
|         for (let m of btn[n].attributes) { | ||||
|           if (m.name === '@click') { | ||||
|             btn[n].addEventListener('click', (e) => { | ||||
|               if (typeof (fun[m.value]) === 'function') { | ||||
|                 fun[m.value](i) | ||||
|               } | ||||
|             }); | ||||
|             btn[n].attributes.removeNamedItem(m.name) | ||||
|             break | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   get attributeCamera() { | ||||
|     return this.options.attribute.camera.content | ||||
|   } | ||||
|  | ||||
|   set attributeCamera(v) { | ||||
|     this.options.attribute.camera.content = v | ||||
|   } | ||||
|  | ||||
|   get attributeISC() { | ||||
|     return this.options.attribute.ISC.content | ||||
|   } | ||||
|  | ||||
|   set attributeISC(v) { | ||||
|     this.options.attribute.ISC.content = v | ||||
|   } | ||||
|  | ||||
|   get attributeVr() { | ||||
|     return this.options.attribute.vr.content | ||||
|   } | ||||
|  | ||||
|   set attributeVr(v) { | ||||
|     this.options.attribute.vr.content = v | ||||
|     if (!this._DialogObject || !this._DialogObject._element || !this._DialogObject._element.content || this._DialogObject._element.content.getElementsByClassName('attribute-content-vr').length == 0) { | ||||
|       return | ||||
|     } | ||||
|     let table = this._DialogObject._element.content.getElementsByClassName('attribute-content-vr')[1].getElementsByClassName('table')[0] | ||||
|     let tableContent = table.getElementsByClassName('table-body')[0] | ||||
|     tableContent.innerHTML = '' | ||||
|     if (this.options.attribute.vr.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.vr.content.length; i++) { | ||||
|       let tr = ` | ||||
|       <div class="tr"> | ||||
|           <div class="td">` + this.options.attribute.vr.content[i].name + `</div> | ||||
|           <div class="td">` + this.options.attribute.vr.content[i].url + `</div> | ||||
|           <div class="td"> | ||||
|               <button @click="vrEdit">编辑</button> | ||||
|               <button @click="vrDelete">删除</button> | ||||
|           </div> | ||||
|       </div>` | ||||
|       let trElm = document.createRange().createContextualFragment(tr) | ||||
|       tableContent.appendChild(trElm) | ||||
|     } | ||||
|     let item = tableContent.getElementsByClassName('tr') | ||||
|     let fun = { | ||||
|       vrEdit: async (index) => { | ||||
|         this.attributeVr = await this.options.attribute.vr.content | ||||
|         let table = this._DialogObject._element.content.getElementsByClassName('attribute-content-vr')[1].getElementsByClassName('table')[0] | ||||
|         let tableContent = table.getElementsByClassName('table-body')[0] | ||||
|         let item = tableContent.getElementsByClassName('tr') | ||||
|         for (let i = 0; i < item.length; i++) { | ||||
|           if (index === i) { | ||||
|             let height = item[i].offsetHeight | ||||
|             let html = ` | ||||
|               <div class="td"> | ||||
|                 <input class="input" type="text"> | ||||
|               </div> | ||||
|               <div class="td"> | ||||
|                 <textarea class="input link-edit" type="text"></textarea> | ||||
|               </div> | ||||
|               <div class="td"> | ||||
|                   <button @click="confirmEdit">确认</button> | ||||
|                   <button @click="cancelEdit">取消</button> | ||||
|               </div>` | ||||
|             item[i].innerHTML = html | ||||
|             let textareaElm = item[i].getElementsByClassName('link-edit')[0] | ||||
|             textareaElm.style.height = (height - 10) + 'px' | ||||
|             let td = item[i].getElementsByClassName('td') | ||||
|             td[0].getElementsByClassName('input')[0].value = this.options.attribute.vr.content[index].name | ||||
|             td[1].getElementsByClassName('input')[0].value = this.options.attribute.vr.content[index].url | ||||
|             let btn = item[i].getElementsByTagName('button') | ||||
|             for (let n = 0; n < btn.length; n++) { | ||||
|               if (!btn[n] || !btn[n].attributes) { | ||||
|                 continue; | ||||
|               } | ||||
|               for (let m of btn[n].attributes) { | ||||
|                 if (m.name === '@click') { | ||||
|                   btn[n].addEventListener('click', (e) => { | ||||
|                     if (typeof (fun[m.value]) === 'function') { | ||||
|                       fun[m.value]({ name: td[0].getElementsByClassName('input')[0].value, url: td[1].getElementsByClassName('input')[0].value }, i) | ||||
|                     } | ||||
|                   }); | ||||
|                   btn[n].attributes.removeNamedItem(m.name) | ||||
|                   break | ||||
|                 } | ||||
|               } | ||||
|             } | ||||
|             break | ||||
|           } | ||||
|         } | ||||
|       }, | ||||
|       vrDelete: (i) => { | ||||
|         this.options.attribute.vr.content.splice(i, 1) | ||||
|         this.attributeVr = this.options.attribute.vr.content | ||||
|       }, | ||||
|  | ||||
|       confirmEdit: (value, i) => { | ||||
|         let name = value.name && value.name.replace(/\s/g, "") | ||||
|         let url = value.url && value.url.replace(/\s/g, "") | ||||
|         if (name && url) { | ||||
|           this.options.attribute.vr.content[i] = value | ||||
|         } | ||||
|         else { | ||||
|           window.ELEMENT && window.ELEMENT.Message({ | ||||
|             message: '名称或链接不能为空!', | ||||
|             type: 'warning', | ||||
|             duration: 1500 | ||||
|           }); | ||||
|         } | ||||
|         this.attributeVr = this.options.attribute.vr.content | ||||
|       }, | ||||
|       cancelEdit: () => { | ||||
|         this.attributeVr = this.options.attribute.vr.content | ||||
|       }, | ||||
|       fileSelect: (value, i) => { | ||||
|         let fileElm = item[i].getElementsByClassName('file-select')[0] | ||||
|         fileElm.click() | ||||
|         fileElm.removeEventListener('change', fileSelect) | ||||
|         fileElm.addEventListener('change', fileSelect) | ||||
|       } | ||||
|     } | ||||
|     let fileSelect = (event) => { | ||||
|       if (event.target.value) { | ||||
|         let td = item[event.target.getAttribute('index')].getElementsByClassName('td') | ||||
|         td[1].getElementsByClassName('input')[0].value = event.target.value | ||||
|         event.target.value = null | ||||
|       } | ||||
|     } | ||||
|     for (let i = 0; i < item.length; i++) { | ||||
|       let btn = item[i].getElementsByTagName('button') | ||||
|       for (let n = 0; n < btn.length; n++) { | ||||
|         if (!btn[n] || !btn[n].attributes) { | ||||
|           continue; | ||||
|         } | ||||
|         for (let m of btn[n].attributes) { | ||||
|           if (m.name === '@click') { | ||||
|             btn[n].addEventListener('click', (e) => { | ||||
|               if (typeof (fun[m.value]) === 'function') { | ||||
|                 fun[m.value](i) | ||||
|               } | ||||
|             }); | ||||
|             btn[n].attributes.removeNamedItem(m.name) | ||||
|             break | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   get attributeGoods() { | ||||
|     return this.options.attribute.goods.content | ||||
|   } | ||||
|  | ||||
|   set attributeGoods(v) { | ||||
|     this.options.attribute.goods.content = v | ||||
|   } | ||||
|  | ||||
|   calculatePositions3() { | ||||
|     let optionsPositions = this.deepCopyObj(this.options.positions) | ||||
|     if (this.noseToTail) { | ||||
| @ -1290,6 +946,7 @@ class WallRealStereoscopic extends Base { | ||||
|  | ||||
|   // 编辑框 | ||||
|   async edit(state) { | ||||
|     return | ||||
|     let _this = this | ||||
|     this.originalOptions = this.deepCopyObj(this.options) | ||||
|  | ||||
| @ -1344,9 +1001,6 @@ class WallRealStereoscopic extends Base { | ||||
|       let contentElm = document.createElement('div'); | ||||
|       contentElm.innerHTML = html(this) | ||||
|       this._DialogObject.contentAppChild(contentElm) | ||||
|       this.attributeType = this.options.attributeType | ||||
|       this.attributeCamera = this.options.attribute.camera.content | ||||
|       this.attributeISC = this.options.attribute.ISC.content | ||||
|  | ||||
|       // 拐角类型下拉 | ||||
|       let cornerTypeList = [ | ||||
| @ -1532,10 +1186,7 @@ class WallRealStereoscopic extends Base { | ||||
|  | ||||
|       setTimeout(() => { | ||||
|         this.attributeLink = this.options.attribute.link.content | ||||
|         this.ISCSelect && this.ISCSelect() | ||||
|         this.goodsSelect && this.goodsSelect() | ||||
|         this.cameraSelect && this.cameraSelect() | ||||
|         this.attributeVr = this.options.attribute.vr.content | ||||
|  | ||||
|         let tagData = this.attributeSelect | ||||
|         let legpObject = legp(this._DialogObject._element.content.getElementsByClassName('attribute-select-box')[0], ".attribute-select") | ||||
|         legpObject.legp_search(tagData) | ||||
| @ -1622,15 +1273,6 @@ class WallRealStereoscopic extends Base { | ||||
|     this.labelLineColor = this.originalOptions.label.lineColor | ||||
|     this.labelBackgroundColorStart = this.originalOptions.label.backgroundColor[0] | ||||
|     this.labelBackgroundColorEnd = this.originalOptions.label.backgroundColor[1] | ||||
|     this.instruct = this.originalOptions.instruct | ||||
|     this.operatingPoint = this.originalOptions.operatingPoint | ||||
|     this.attributeLink = this.options.attribute.link.content | ||||
|     this.attributeVr = this.options.attribute.vr.content | ||||
|     this.attributeCamera = this.options.attribute.camera.content | ||||
|     this.attributeGoods = this.options.attribute.goods.content | ||||
|     this.attributeISC = this.options.attribute.ISC.content | ||||
|     this.cameraSelect && this.cameraSelect() | ||||
|     this.goodsSelect && this.goodsSelect() | ||||
|  | ||||
|     let positions = this.options.positions | ||||
|     let fromDegreesArray = [] | ||||
| @ -1660,60 +1302,6 @@ class WallRealStereoscopic extends Base { | ||||
|     await syncData(this.sdk, this.options.id) | ||||
|   } | ||||
|  | ||||
|   instructSubmit() { | ||||
|     this.Dialog.instructSubmit && this.Dialog.instructSubmit(this.options.id, this.options.label.text, this.instruct) | ||||
|     this.originalOptions.instruct = this.instruct | ||||
|   } | ||||
|  | ||||
|   operatingPointSubmit() { | ||||
|     this.Dialog.operatingPointSubmit && this.Dialog.operatingPointSubmit(this.options.id, this.options.label.text, this.operatingPoint) | ||||
|     this.originalOptions.operatingPoint = this.operatingPoint | ||||
|   } | ||||
|  | ||||
|   _addLink() { | ||||
|     // document.getElementsByClassName | ||||
|     if (this._DialogObject._element.content.getElementsByClassName('link_add')[0].value) { | ||||
|       this.options.attribute.link.content.push({ | ||||
|         name: '链接', | ||||
|         url: this._DialogObject._element.content.getElementsByClassName('link_add')[0].value | ||||
|       }) | ||||
|       this._DialogObject._element.content.getElementsByClassName('link_add')[0].value = '' | ||||
|       this.attributeLink = this.options.attribute.link.content | ||||
|     } | ||||
|     else { | ||||
|       this.Dialog.clickAddLink && this.Dialog.clickAddLink() | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   addAttributeLink(link) { | ||||
|     this.options.attribute.link.content.push({ | ||||
|       name: '链接', | ||||
|       url: link | ||||
|     }) | ||||
|     this.attributeLink = this.options.attribute.link.content | ||||
|   } | ||||
|  | ||||
|   _addRr() { | ||||
|     if (this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value) { | ||||
|       this.options.attribute.vr.content.push({ | ||||
|         name: '全景图' , | ||||
|         url: this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value | ||||
|       }) | ||||
|       this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value = '' | ||||
|       this.attributeVr = this.options.attribute.vr.content | ||||
|     } | ||||
|     else { | ||||
|       this.Dialog.clickAddVr && this.Dialog.clickAddVr() | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   addAttributeRr(vr) { | ||||
|     this.options.attribute.vr.content.push({ | ||||
|       name: '全景图' , | ||||
|       url: vr | ||||
|     }) | ||||
|     this.attributeVr = this.options.attribute.vr.content | ||||
|   } | ||||
|  | ||||
|   getMaterial(id) { | ||||
|     let material | ||||
| @ -1814,7 +1402,8 @@ class WallRealStereoscopic extends Base { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   static nodeEdit(that, cb = () => { }) { | ||||
|   nodeEdit(cb = () => { }) { | ||||
|     let that = this | ||||
|     if (YJ.Measure.GetMeasureStatus()) { | ||||
|       cb('上一次测量未结束') | ||||
|     } else { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user