suerprisePlus
2024-06-14 c3be71b180ea95f7928bdffccbec0525911eca9d
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>日照分析</title>
    <link rel="stylesheet" href="../../Workers/layui/css/layui.css" rel="stylesheet" />
    <style>
        html {
            overflow: hidden;
            height: 100%;
        }
        .laydate-btns-clear{
          display: none;
        }
        .dateBox {
            height: 440px;
            overflow: auto;
            margin-right: 6px;
        }
 
        .dateBox::-webkit-scrollbar {
            /*滚动条整体样式*/
            width: 4px;
            /*高宽分别对应横竖滚动条的尺寸*/
            height: 4px;
            scrollbar-arrow-color: red;
        }
 
        .dateBox::-webkit-scrollbar-thumb {
            border-radius: 5px;
            -webkit-box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2);
            box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2);
            background: rgba(255, 255, 255, 0.5);
            scrollbar-arrow-color: red;
        }
 
        .dateBox::-webkit-scrollbar-track {
            -webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
            box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
            border-radius: 0;
            background: rgba(218, 218, 218, 0.1);
        }
 
        .dateBox label {
            color: white;
        }
 
        .bnt-box {
            width: 90%;
            margin: auto;
            height: 58px;
            border-bottom: 1px #999 solid;
        }
 
        .layui-input {
            background-color: #fff !important;
            width: 203px
        }
 
        .layui-form-label {
            font-weight: bold !important;
            font-size: 15px;
        }
 
        .layui-btn {
            background-color: rgba(0, 168, 255, 0.16) !important;
        }
    </style>
</head>
 
<body>
    <div class="dateBox">
        <div class="layui-inline" style="margin-top: 15px">
            <label class="layui-form-label">日期选择</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="date" placeholder="yyyy-MM-dd">
            </div>
        </div>
        <div class="layui-inline" style="margin-top: 15px">
            <label class="layui-form-label">开始时间</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="startTime" placeholder="HH:mm:ss">
            </div>
        </div>
        <div class="layui-inline" style="margin-top: 15px">
            <label class="layui-form-label">结束时间</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="endTime" placeholder="HH:mm:ss">
            </div>
        </div>
        <div class="layui-form-item" style="margin-top: 15px">
            <label class="layui-form-label" style="font-weight: bold">时间间隔</label>
            <div class="layui-input-inline">
                <input id='interval' type="number" lay-verify="pass" value="60" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" style="margin-top: 15px">
            <label class="layui-form-label" style="font-weight: bold">空间间隔</label>
            <div class="layui-input-inline">
                <input id='spacing' type="number" lay-verify="pass" value="10" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" style="margin-top: 15px">
            <label class="layui-form-label" style="font-weight: bold">拉伸高度</label>
            <div class="layui-input-inline">
                <input id='addHeight' type="number" lay-verify="pass" value="30" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="buttonContainer" style="text-align: center;">
            <button type="button" class="layui-btn layui-btn-normal analyse" style="padding: 0 38px;">
                开始分析
            </button>
        </div>
 
    </div>
 
    <script src="../jquery-3.5.0.min.js"></script>
    <script src="../../Workers/layui/layui.js"></script>
    <script>
        $(function () {
            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.earthCtrl;
                var Viewer = parent.Viewer;
                var Cesium = parent.Cesium;
                var layer = parent.layuiLayer;
 
                let date = new Date();
                date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
                let startTime = '13:00:00', stopTime = '15:00:00';
 
                let interval = 60, spacing = 10, addHeight = 30;
 
                laydate.render({
                    elem: '#date'
                    , format: 'yyyy-MM-dd'
                    , value: new Date()
                    , done: function (value, _date, endDate) {
                        date = value;
                    }
                });
                laydate.render({
                    elem: '#startTime'
                    , format: 'HH:mm:ss'
                    , type: 'time'
                    , value: '13:00:00'
                    , done: function (value, _date, endDate) {
                        let sNum = new Date(date + ' ' + value).getTime() / 1000;
                        let eNum = new Date(date + ' ' + stopTime).getTime() / 1000;
                        if (sNum > eNum) {
                            layer.msg('开始时间大于结束时间,请重新选择');
                            return;
                        }
                        startTime = value;
                    }
                });
                laydate.render({
                    elem: '#endTime'
                    , format: 'HH:mm:ss'
                    , value: '15:00:00'
                    , type: 'time'
                    , done: function (value, _date, endDate) {
                        let sNum = new Date(date + ' ' + startTime).getTime() / 1000;
                        let eNum = new Date(date + ' ' + value).getTime() / 1000;
                        if (sNum > eNum) {
                            layer.msg('开始时间大于结束时间,请重新选择');
                            return;
                        }
                        stopTime = value;
                    }
                });
 
                $('.analyse').click(function () {
                    parent.window._AnalysisSunshine = sgworld.analysis.SunshineAnalysisPolygon({
                        start: date + ' ' + startTime,
                        end: date + ' ' + stopTime,
                        interval: interval,
                        spacing: spacing,
                        addHeight: addHeight
                    });
                })
 
                $('#interval').on('input propertychange', function (event) {
                    let value = parseFloat(this.value);
                    if (!isNaN(value)) {
                        interval = value;
                    }
                });
                $('#spacing').on('input propertychange', function (event) {
                    let value = parseFloat(this.value);
                    if (!isNaN(value)) {
                        spacing = value;
                    }
                })
                $('#addHeight').on('input propertychange', function (event) {
                    let value = parseFloat(this.value);
                    if (!isNaN(value)) {
                        addHeight = value;
                    }
                })
            });
        })
    </script>
</body>
 
</html>