[Forntend] Forge 燈光程序調整
This commit is contained in:
		
							parent
							
								
									f0af802f0d
								
							
						
					
					
						commit
						d63e517b3c
					
				@ -367,9 +367,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    function show3DModel(urn) {
 | 
					    function show3DModel(urn) {
 | 
				
			||||||
        $(loadEle).Loading("start");
 | 
					        $(loadEle).Loading("start");
 | 
				
			||||||
        if (pageAct.sysMainTag == "LT") { 
 | 
					 | 
				
			||||||
            setLightPoint(allDevList);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        launchViewerForHotspot(urn, (viewer, nodeIds) => {
 | 
					        launchViewerForHotspot(urn, (viewer, nodeIds) => {
 | 
				
			||||||
            let devDbIds = allDevList.map(x => x.forge_dbid);
 | 
					            let devDbIds = allDevList.map(x => x.forge_dbid);
 | 
				
			||||||
            /*hideAllObjects(devDbIds);*/
 | 
					            /*hideAllObjects(devDbIds);*/
 | 
				
			||||||
@ -475,6 +472,10 @@
 | 
				
			|||||||
                })
 | 
					                })
 | 
				
			||||||
               
 | 
					               
 | 
				
			||||||
                setHotspotPoint(myDataList);
 | 
					                setHotspotPoint(myDataList);
 | 
				
			||||||
 | 
					                if (pageAct.sysMainTag == "LT") {
 | 
				
			||||||
 | 
					                    setLightPoint(myDataList);
 | 
				
			||||||
 | 
					                    console.log("myDataList", myDataList)
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
                callback ? callback() : "";
 | 
					                callback ? callback() : "";
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }, null, "POST").send();
 | 
					        }, null, "POST").send();
 | 
				
			||||||
 | 
				
			|||||||
@ -782,6 +782,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
 | 
				
			|||||||
                        "lib/chart.js/Chart.min",
 | 
					                        "lib/chart.js/Chart.min",
 | 
				
			||||||
                        "lib/dropzone/dropzone-min",
 | 
					                        "lib/dropzone/dropzone-min",
 | 
				
			||||||
                        "lib/jstree-master/jstree.min",
 | 
					                        "lib/jstree-master/jstree.min",
 | 
				
			||||||
 | 
					                        "lib/notifications/sweetalert2/sweetalert2.bundle",
 | 
				
			||||||
                    ], loadedMasterPack);
 | 
					                    ], loadedMasterPack);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -992,7 +993,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
 | 
				
			|||||||
                })
 | 
					                })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                $(window).on("timeout:3s", function () {
 | 
					                $(window).on("timeout:3s", function () {
 | 
				
			||||||
                    debugger
 | 
					                    
 | 
				
			||||||
                    getSystemAlarmByBaja((data) => {
 | 
					                    getSystemAlarmByBaja((data) => {
 | 
				
			||||||
                        if (typeof getAlarmSub != "undefined" && getAlarmSub) {
 | 
					                        if (typeof getAlarmSub != "undefined" && getAlarmSub) {
 | 
				
			||||||
                            getAlarmSub(data);
 | 
					                            getAlarmSub(data);
 | 
				
			||||||
@ -1027,7 +1028,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
 | 
				
			|||||||
                    dataType: 'json',
 | 
					                    dataType: 'json',
 | 
				
			||||||
                    success: function (rel) {
 | 
					                    success: function (rel) {
 | 
				
			||||||
                        if (rel.code != "0000") {
 | 
					                        if (rel.code != "0000") {
 | 
				
			||||||
                            toast_error(rel.msg || "系統內部發生錯誤,請聯絡系統管理員");
 | 
					                            toast_error(rel.msg || common.SysErr);
 | 
				
			||||||
                            return;
 | 
					                            return;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        else {
 | 
					                        else {
 | 
				
			||||||
@ -1037,7 +1038,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
 | 
				
			|||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                    error: function (xhr, textStatus, thrownError) {
 | 
					                    error: function (xhr, textStatus, thrownError) {
 | 
				
			||||||
                        alert(textStatus);
 | 
					                        alert(common.SysErr);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1602,52 +1603,52 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        function showWarToast() {
 | 
					        function showWarToast() {
 | 
				
			||||||
            let options = {
 | 
					            //let options = {
 | 
				
			||||||
                "closeButton": false,
 | 
					            //    "closeButton": false,
 | 
				
			||||||
                "debug": false,
 | 
					            //    "debug": false,
 | 
				
			||||||
                "newestOnTop": true,
 | 
					            //    "newestOnTop": true,
 | 
				
			||||||
                "progressBar": false,
 | 
					            //    "progressBar": false,
 | 
				
			||||||
                "positionClass": "toast-top-right",
 | 
					            //    "positionClass": "toast-top-right",
 | 
				
			||||||
                "preventDuplicates": false,
 | 
					            //    "preventDuplicates": false,
 | 
				
			||||||
                "onclick": null,
 | 
					            //    "onclick": null,
 | 
				
			||||||
                "showDuration": "300",
 | 
					            //    "showDuration": "300",
 | 
				
			||||||
                "hideDuration": "1000",
 | 
					            //    "hideDuration": "1000",
 | 
				
			||||||
                "timeOut": 0,
 | 
					            //    "timeOut": 0,
 | 
				
			||||||
                "extendedTimeOut": 0,
 | 
					            //    "extendedTimeOut": 0,
 | 
				
			||||||
                "showEasing": "swing",
 | 
					            //    "showEasing": "swing",
 | 
				
			||||||
                "hideEasing": "linear",
 | 
					            //    "hideEasing": "linear",
 | 
				
			||||||
                "showMethod": "fadeIn",
 | 
					            //    "showMethod": "fadeIn",
 | 
				
			||||||
                "hideMethod": "fadeOut",
 | 
					            //    "hideMethod": "fadeOut",
 | 
				
			||||||
                "tapToDismiss": false
 | 
					            //    "tapToDismiss": false
 | 
				
			||||||
            }
 | 
					            //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if ($("#toast-container .toast").length < 2) { 
 | 
					            //if ($("#toast-container .toast").length < 2) { 
 | 
				
			||||||
                let strConHtml = `<div class="col-12">
 | 
					            //    let strConHtml = `<div class="col-12">
 | 
				
			||||||
                                        <div class="row m-0">
 | 
					            //                            <div class="row m-0">
 | 
				
			||||||
                                            <span class="m-0">異常編號:<span>001</span></span>
 | 
					            //                                <span class="m-0">異常編號:<span>001</span></span>
 | 
				
			||||||
                                        </div>
 | 
					            //                            </div>
 | 
				
			||||||
                                        <div class="row m-0">
 | 
					            //                            <div class="row m-0">
 | 
				
			||||||
                                            <span class="m-0">異常等級:<span>2</span></span>
 | 
					            //                                <span class="m-0">異常等級:<span>2</span></span>
 | 
				
			||||||
                                        </div>
 | 
					            //                            </div>
 | 
				
			||||||
                                        <div class="row m-0">
 | 
					            //                            <div class="row m-0">
 | 
				
			||||||
                                            <span class="m-0">異常類別:<span>S01</span></span>
 | 
					            //                                <span class="m-0">異常類別:<span>S01</span></span>
 | 
				
			||||||
                                        </div>
 | 
					            //                            </div>
 | 
				
			||||||
                                        <div class="row m-0">
 | 
					            //                            <div class="row m-0">
 | 
				
			||||||
                                            <span class="m-0">設備名稱:<span>電表01</span></span>
 | 
					            //                                <span class="m-0">設備名稱:<span>電表01</span></span>
 | 
				
			||||||
                                        </div>
 | 
					            //                            </div>
 | 
				
			||||||
                                        <div class="row m-0">
 | 
					            //                            <div class="row m-0">
 | 
				
			||||||
                                            <span class="m-0">異常訊息:<span>壞掉</span></span>
 | 
					            //                                <span class="m-0">異常訊息:<span>壞掉</span></span>
 | 
				
			||||||
                                        </div>
 | 
					            //                            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                </div>`;
 | 
					            //                    </div>`;
 | 
				
			||||||
                let titleHtml = `<div class="col-12">
 | 
					            //    let titleHtml = `<div class="col-12">
 | 
				
			||||||
                                        <div class="row m-0">
 | 
					            //                            <div class="row m-0">
 | 
				
			||||||
                                            <span class="fs-1">異常通知</span>
 | 
					            //                                <span class="fs-1">異常通知</span>
 | 
				
			||||||
                                            <span class="ml-auto">2023/01/01 12:00:00</span>
 | 
					            //                                <span class="ml-auto">2023/01/01 12:00:00</span>
 | 
				
			||||||
                                        </div>
 | 
					            //                            </div>
 | 
				
			||||||
                                    </div>`
 | 
					            //                        </div>`
 | 
				
			||||||
                toastr.warning(strConHtml, titleHtml, options)
 | 
					            //    toastr.warning(strConHtml, titleHtml, options)
 | 
				
			||||||
            }
 | 
					            //}
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    </script>
 | 
					    </script>
 | 
				
			||||||
 | 
				
			|||||||
@ -728,7 +728,7 @@ async function testNewLight(dataList) {
 | 
				
			|||||||
    dataList.forEach((myData, index) => {
 | 
					    dataList.forEach((myData, index) => {
 | 
				
			||||||
        const position = JSON.parse(myData.device_coordinate_3d);
 | 
					        const position = JSON.parse(myData.device_coordinate_3d);
 | 
				
			||||||
        if (lightList.findIndex(x => x.device_guid == myData.device_guid) == -1) { 
 | 
					        if (lightList.findIndex(x => x.device_guid == myData.device_guid) == -1) { 
 | 
				
			||||||
            lightList.push({ dbid: myData.forge_dbid, device_guid: myData.device_guid, lightObject: new THREE.SpotLight(0xffffff, 200, 20, 0.6, 0.5, 10) });
 | 
					            lightList.push({ dbid: myData.forge_dbid, device_guid: myData.device_guid, lightObject: new THREE.SpotLight(0xff0000, 200, 20, 0.6, 0.5, 10) });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        lightList[index].lightObject.position.set(position.x, position.y, position.z);
 | 
					        lightList[index].lightObject.position.set(position.x, position.y, position.z);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user