北京经济技术开发区经开区虚拟城市项目-【前端】-移动端Web
lixuliang
2024-05-08 f5233339920a59103d53e8efadc6f3f5d0b64f31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
layui.use(['element', 'form', 'laydate'], function () {
    var $ = layui.jquery
        , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块
    var form = layui.form;
    var laydate = layui.laydate;
    var sgworld = parent.sgworld;
 
    laydate.render({
        elem: '#timeShadow'
        , type: 'datetime'
        , done: function (value, date, endDate) {
            yyfx_handleSetCurrentTime(value);
            window.parent.fnLayerHauto(window.parent.SmartEarthPopupData.layerProp,'290')
        }
        ,ready: function(date){
            window.parent.fnLayerHauto(window.parent.SmartEarthPopupData.layerProp,'500')
        }
    });
    laydate.render({
        elem: '#timez'
        , type: 'datetime'
        , done: function (value, date, endDate) {
            yyfx_handleSetCurrentTime(value);
            window.parent.fnLayerHauto(window.parent.SmartEarthPopupData.layerProp,'215')
        }
        ,ready: function(date){
            window.parent.fnLayerHauto(window.parent.SmartEarthPopupData.layerProp,'425')
        }
    });
    //开启阴影分析
    //监听指定开关
    form.on('switch(switchShadow)', function (data) {
        var chk = this.checked ? true : false;
        if (chk) {
            parent.shadows = true;
            $('.dateBox').show();
            //当前操作
            sgworld.ProjectTree.pushStateItem("阴影分析");
            yyfx_handleGetCurrentTime();
            // window.parent.fnLayerHauto(window.parent.SmartEarthPopupData.layerProp,'290')
        } else {
            parent.shadows = false;
            $('.dateBox').hide();
            sgworld.ProjectTree.endtemporaryItem();
            //yyfx_handlePause();
            sgworld._Viewer.shadows = false;
            // window.parent.fnLayerHauto(window.parent.SmartEarthPopupData.layerProp,'90')
        }
    });
    if (parent.shadows) {
        $('#switchShadow').next().click();
        $('#switchShadow').attr('value', 'on');
        $('.dateBox').show();
        yyfx_handleGetCurrentTime()
    }
});