|  | @@ -315,3 +315,198 @@ function registerEvent() {
 | 
	
		
			
				|  |  |          checkBtnActives(['#mapBg', '#sceneSetting']);
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |      // 鼠标键按下事件,功能按钮隐藏
 | 
	
		
			
				|  |  | +    app.on(THING.EventType.MouseDown, function () {
 | 
	
		
			
				|  |  | +        app.pauseEvent(THING.EventType.CameraZoom, null, '摄像机前后滚动,功能图片隐藏');
 | 
	
		
			
				|  |  | +        if (showControlTimer != null) {
 | 
	
		
			
				|  |  | +            clearTimeout(showControlTimer);
 | 
	
		
			
				|  |  | +            showControlTimer = null;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        stopRotate();
 | 
	
		
			
				|  |  | +        if (hiddenControlTimer == null) {
 | 
	
		
			
				|  |  | +            clearTimeout(showControlTimer);
 | 
	
		
			
				|  |  | +            hiddenControlTimer = setTimeout(function () {
 | 
	
		
			
				|  |  | +                $('#all-controls').css('display', 'none');
 | 
	
		
			
				|  |  | +                clearTimeout(hiddenControlTimer);
 | 
	
		
			
				|  |  | +                hiddenControlTimer = null;
 | 
	
		
			
				|  |  | +            }, 300);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +    // 鼠标键抬起事件,功能按钮显示
 | 
	
		
			
				|  |  | +    app.on(THING.EventType.MouseUp, function () {
 | 
	
		
			
				|  |  | +        app.resumeEvent(THING.EventType.CameraZoom, null, '摄像机前后滚动,功能图片隐藏');
 | 
	
		
			
				|  |  | +        if (hiddenControlTimer != null) {
 | 
	
		
			
				|  |  | +            clearTimeout(hiddenControlTimer);
 | 
	
		
			
				|  |  | +            hiddenControlTimer = null;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (showControlTimer == null) {
 | 
	
		
			
				|  |  | +            showControlTimer = setTimeout(function () {
 | 
	
		
			
				|  |  | +                $('#all-controls').css('display', 'block');
 | 
	
		
			
				|  |  | +                clearTimeout(showControlTimer);
 | 
	
		
			
				|  |  | +                showControlTimer = null;
 | 
	
		
			
				|  |  | +                restarRotate();
 | 
	
		
			
				|  |  | +            }, 300);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +    let count = 0;
 | 
	
		
			
				|  |  | +    // 鼠标滑轮滚动
 | 
	
		
			
				|  |  | +    app.on(THING.EventType.CameraZoom, function () {
 | 
	
		
			
				|  |  | +        if (showControlTimer != null) {
 | 
	
		
			
				|  |  | +            count = 0;
 | 
	
		
			
				|  |  | +            return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        stopRotate();
 | 
	
		
			
				|  |  | +        if (showControlTimer == null) {
 | 
	
		
			
				|  |  | +            $('#all-controls').css('display', 'none');
 | 
	
		
			
				|  |  | +            showControlTimer = setInterval(function () {
 | 
	
		
			
				|  |  | +                count++;
 | 
	
		
			
				|  |  | +                if (count >= 2) {
 | 
	
		
			
				|  |  | +                    $('#all-controls').css('display', 'block');
 | 
	
		
			
				|  |  | +                    restarRotate();
 | 
	
		
			
				|  |  | +                    clearInterval(showControlTimer);
 | 
	
		
			
				|  |  | +                    showControlTimer = null;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }, 300);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }, '摄像机前后滚动,功能图片隐藏');
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    // 鼠标移动事件,已创建的红色胶囊跟随鼠标移动
 | 
	
		
			
				|  |  | +    app.on(THING.EventType.MouseMove, function (ev) {
 | 
	
		
			
				|  |  | +        if (box != null) {
 | 
	
		
			
				|  |  | +            if (ev.picked) {
 | 
	
		
			
				|  |  | +                box.position = ev.pickedPosition;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +    // 摄像机位置改变结束事件,记录当前摄像机位置与目标点x,y,z的差
 | 
	
		
			
				|  |  | +    app.on(THING.EventType.CameraChangeEnd, function () {
 | 
	
		
			
				|  |  | +        if (cameraDistace.length > 0) {
 | 
	
		
			
				|  |  | +            let caPos = app.camera.position;
 | 
	
		
			
				|  |  | +            let scePos = app.root.defaultCampus.position;
 | 
	
		
			
				|  |  | +            cameraDistace = [caPos[0] - scePos[0], caPos[1] - scePos[1], caPos[2] - scePos[2]];
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        restarRotate();
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +    // 点击事件,放置红色胶囊,进入第一人称行走
 | 
	
		
			
				|  |  | +    app.on(THING.EventType.Click, function (ev) {
 | 
	
		
			
				|  |  | +        stopRotate();
 | 
	
		
			
				|  |  | +        if (ev.button == 0 && box != null) {
 | 
	
		
			
				|  |  | +            let pos = box.position;
 | 
	
		
			
				|  |  | +            box.destroy();
 | 
	
		
			
				|  |  | +            box = null;
 | 
	
		
			
				|  |  | +            app.camera.flyTo(pos);
 | 
	
		
			
				|  |  | +            enterFps([pos[0], pos[1] + 2, pos[2]]);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        checkBtnActives(['#mapBg', '#sceneSetting']);
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +    // 进入层级事件,退出第一人称行走
 | 
	
		
			
				|  |  | +    app.on(THING.EventType.EnterLevel, function () {
 | 
	
		
			
				|  |  | +        if (fpsCtrl != null) {
 | 
	
		
			
				|  |  | +            exitFps();
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +    // 离开层级事件,停止旋转
 | 
	
		
			
				|  |  | +    app.on(THING.EventType.LeaveLevel, function () {
 | 
	
		
			
				|  |  | +        stopRotate();
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +    // 鼠标滑轮事件,停止旋转
 | 
	
		
			
				|  |  | +    app.on(THING.EventType.MouseWheel, function () {
 | 
	
		
			
				|  |  | +        stopRotate();
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +    // 场景添加键盘按下事件,当进入第一人称行走时,按下esc键退出第一人称行走
 | 
	
		
			
				|  |  | +    app.on(THING.EventType.KeyDown, function (ev) {
 | 
	
		
			
				|  |  | +        if (ev.code == 'Escape') {
 | 
	
		
			
				|  |  | +            if (box != null) {
 | 
	
		
			
				|  |  | +                app.resumeEvent(THING.EventType.DBLClick, '*', THING.EventTag.LevelEnterOperation);
 | 
	
		
			
				|  |  | +                app.resumeEvent(THING.EventType.Click, '*', THING.EventTag.LevelBackOperation);
 | 
	
		
			
				|  |  | +                box.destroy();
 | 
	
		
			
				|  |  | +                box = null;
 | 
	
		
			
				|  |  | +                $('#moveByFps').removeClass('active');
 | 
	
		
			
				|  |  | +                restarRotate();
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if (fpsCtrl != null) {
 | 
	
		
			
				|  |  | +                exitFps();
 | 
	
		
			
				|  |  | +                restarRotate();
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            checkBtnActives(['#mapBg', '#sceneSetting']);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +    window.onresize = function () {
 | 
	
		
			
				|  |  | +        if (!checkFull()) {
 | 
	
		
			
				|  |  | +            //要执行的动作
 | 
	
		
			
				|  |  | +            if (fullScreenState == true) {
 | 
	
		
			
				|  |  | +                $('.btn-full-screen').css('display', 'block');
 | 
	
		
			
				|  |  | +                $('.btn-narrow').css('display', 'none');
 | 
	
		
			
				|  |  | +                $('#fullScreen span').text('全屏');
 | 
	
		
			
				|  |  | +                fullScreenState = false;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +//====设备闪烁提示====
 | 
	
		
			
				|  |  | +function flash(objArray) {
 | 
	
		
			
				|  |  | +    objArray.forEach(function (obj) {
 | 
	
		
			
				|  |  | +        obj.on('update', function () {
 | 
	
		
			
				|  |  | +            obj.style.color = '#FFF000'
 | 
	
		
			
				|  |  | +            obj.style.opacity = 0.5 + 0.5 * Math.sin(2 * app.elapsedTime / 500);
 | 
	
		
			
				|  |  | +        }, '每帧改变透明度');
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +function queryDeviceStatus(evt) {
 | 
	
		
			
				|  |  | +    objArray = evt.data;
 | 
	
		
			
				|  |  | +    // objArray.forEach(function (deviceobj) {
 | 
	
		
			
				|  |  | +    //     obj = app.query("#" + deviceobj.ownerCode)[0];
 | 
	
		
			
				|  |  | +    //     obj.on('update', function () {
 | 
	
		
			
				|  |  | +    //         obj.style.color = '#FF0000'
 | 
	
		
			
				|  |  | +    //         obj.style.opacity = 0.5 + 0.5 * Math.sin(2 * app.elapsedTime / 500);
 | 
	
		
			
				|  |  | +    //     }, '每帧改变透明度');
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    // })
 | 
	
		
			
				|  |  | +    obj = app.query("#" + objArray)[0];
 | 
	
		
			
				|  |  | +    obj.on('update', function () {
 | 
	
		
			
				|  |  | +        obj.style.color = '#FF0000'
 | 
	
		
			
				|  |  | +        obj.style.opacity = 0.5 + 0.5 * Math.sin(2 * app.elapsedTime / 500);
 | 
	
		
			
				|  |  | +    }, '每帧改变透明度');
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +function reset(objArray) {
 | 
	
		
			
				|  |  | +    objArray.forEach(function (obj) {
 | 
	
		
			
				|  |  | +        obj.style.opacity = 1.0;
 | 
	
		
			
				|  |  | +        obj.style.color = null;
 | 
	
		
			
				|  |  | +        obj.off('update', null, '每帧改变透明度');
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +var timer = null;
 | 
	
		
			
				|  |  | +function getTabledata(d) {
 | 
	
		
			
				|  |  | +    var ygArray = [];
 | 
	
		
			
				|  |  | +    d.forEach(function (d) {
 | 
	
		
			
				|  |  | +        var deviceInfo = {
 | 
	
		
			
				|  |  | +            "设备编号": d.ownerCode,
 | 
	
		
			
				|  |  | +            "设备名称": d.ownerName,
 | 
	
		
			
				|  |  | +            "安装位置": d.unitinfo,
 | 
	
		
			
				|  |  | +        };
 | 
	
		
			
				|  |  | +        ygArray.push(deviceInfo)
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +    // 表格数据//创建对象 book
 | 
	
		
			
				|  |  | +    var tableData = {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        // 列标题
 | 
	
		
			
				|  |  | +        props: ['设备编号', '设备名称', '安装位置'],
 | 
	
		
			
				|  |  | +        // 列数据
 | 
	
		
			
				|  |  | +        items: ygArray
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +    return tableData;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +function createPerson(name, age, family) {
 | 
	
		
			
				|  |  | +    var o = new Object();
 | 
	
		
			
				|  |  | +    o.name = name;
 | 
	
		
			
				|  |  | +    o.age = age;
 | 
	
		
			
				|  |  | +    o.family = family;
 | 
	
		
			
				|  |  | +    o.say = function () {
 | 
	
		
			
				|  |  | +        alert(this.name);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    return o;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +function destroyPanel() {
 | 
	
		
			
				|  |  | +    var mydiv = document.getElementById('mydiv')
 |