地质所 沉降监测网建设项目
zmk
2024-05-15 9e3afc6d0fa514f986d3fea40fa23124e6fb5070
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('地图')" />
    <link rel="stylesheet" th:href="@{/map/map.css}"/>
    <link rel="stylesheet" th:href="@{/map/tab.css}"/>
</head>
  <style>
      #map {
          width: calc(100% - 400px);
          z-index: 0;
      }
  </style>
<body>
 
    <div id="container">
<!--        <div id="menu">-->
<!--            <div class="menu-title">-->
<!--                <span>工程项目分布图</span>-->
<!--            </div>-->
<!--            <ul class="menu-tree">-->
<!--                <li class="active"><i class="fa fa-building-o"></i>项目详情</li>-->
<!--                <li><i class="fa fa-map-marker"></i>勘探点</li>-->
<!--                <li><i class="fa fa-paper-plane-o"></i>参与人</li>-->
<!--                <li><i class="fa fa-bar-chart"></i>工作量</li>-->
<!--                &lt;!&ndash;<li><i class="fa fa-print"></i>打印导出</li>&ndash;&gt;-->
<!--            </ul>-->
<!--        </div>-->
        <div id="map"></div>
    </div>
 
    <div class="custom-tab" id ="customData">
          <ul class="custom-tab-title">
            <li class="active">勘探点详情</li>
            <li>原始记录</li>
          </ul>
          <div class="custom-tab-content">
            <div class="custom-tab-item active">
                <table class="prospect-detail">
                    <tr>
                        <td>编号</td>
                        <td style="min-width: 90px;">{{hole.code}}</td>
                        <td>类型</td>
                        <td style="min-width: 90px;">{{hole.type}}</td>
                    </tr>
                    <tr>
                        <td>设计深度(m)</td>
                        <td colspan="3">{{hole.depth}}</td>
                    </tr>
                    <tr>
                        <td>记录深度(m)</td>
                        <td>{{hole.endDepth}}</td>
                        <td>总记录数</td>
                        <td>{{hole.datacount}}</td>
                    </tr>
                    <tr>
                        <td>发布坐标</td>
                        <td>{{hole.longitude}}</br>{{hole.latitude}}</td>
                        <td>基准点坐标</td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>测量坐标</td>
                        <td>{{hole.mapLongitude}}</br>{{hole.mapLatitude}}</td>
                        <td>测量相对坐标</td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>发布时间</td>
                        <td>{{hole.mapTime}}</td>
                        <td>更新时间</td>
                        <td>{{hole.updateTime}}</td>
                    </tr>
                    <tr>
                        <td>负责人</td>
                        <td></td>
                        <td>描述员</td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>司钻员</td>
                        <td></td>
                        <td>钻机</td>
                        <td></td>
                    </tr>
                </table>
            </div>
            <div class="custom-tab-item">
                <div class="chart-label">
                    <span onclick="histogram()" ><i class="fa fa-external-link"></i>柱状图</span>
                    <span><i class="fa fa-external-link" ></i>记录分布点</span>
                </div>
 
                <div v-for="(record,index) in recordList" class="record-item">
                    <div class="item-title">
                        <i class="fa fa-star-o star" aria-hidden="true"></i>
                        <span class="biaohao">{{index}}</span>
                        <i class="fa fa-paperclip clip" aria-hidden="true"></i>
                        <span>{{record.beginDepth}}m~{{record.endDepth}}m</span>
                    </div>
                    <div class="item-title">
                        <i class="fa fa-square square"></i>
                        <span>{{record.frequencyType}}</span>
                        <span class="date">{{record.gpsTime}}</span>
                    </div>
                    <div class="record-content">
                        {{record.content}}
                    </div>
                </div>
 
            </div>
          </div>
     </div>
    <script th:src="@{/js/jquery.min.js}"></script> 
    <script th:src="@{/js/tdt.js}"></script>
    <script th:src="@{/js/vue.min.js}"></script>
 
    <th:block th:include="include :: footer" />
 
    <script th:inline="javascript">
        var project =[[${project}]];
        var holes= [[${holes}]];
        var clickHoleId;//存储点击的钻孔id
 
        var map ;
        var zkicon = new T.Icon({
            iconUrl: '/bjfw/images/icons/zk.png',
            iconSize: new T.Point(30, 30),
            iconAnchor: new T.Point(6, 40),
        });
 
        $(function(){
            map = new T.Map('map');
            map.centerAndZoom(new T.LngLat(116.38, 39.9), 16);
            var control = new T.Control.Zoom();
            control.setPosition(T_ANCHOR_TOP_RIGHT);
            map.addControl(control);// 添加缩放平移控件
 
            var scale = new T.Control.Scale();// 创建比例尺控件对象
            var ctrl = new T.Control.MapType();
            ctrl.setPosition(T_ANCHOR_BOTTOM_RIGHT);
            // 添加控件
            map.addControl(ctrl);
            bindTabEvent();
            loadHoleOnMap();
            if(holes !=null && holes.length>0){
                clickHoleId=holes[0].ids;
                bindHoleData(holes[0]);
            }
        })
 
 
        var vm = new Vue({
            el: '#customData',
            data() {
                return {
                    hole: {
                        code:'',
                        type:'',
                    },
                    recordList:'',
                }
            },
            mounted: function () {
            },
            methods: {
            }
        });
 
        //显示钻孔
        function loadHoleOnMap() {
            if(holes !=null && holes.length>0 ){
                var centerLng,centerLat;
                for(var i=0;i<holes.length;i++){
                    centerLng=holes[i].mapLongitude;
                    centerLat=holes[i].mapLatitude;
                    var marker = new T.Marker(new T.LngLat(centerLng, centerLat), { title: "钻孔编号:" + holes[i].code , icon : zkicon});
                    addZkClickHandler(holes[i],marker);
                    map.addOverLay(marker);
                    addLabel(holes[i]);
                }
                map.centerAndZoom(new T.LngLat(centerLng, centerLat), 16);
            }
        }
 
        //钻孔的点击事件
        function addZkClickHandler(hole,marker) {
            marker.addEventListener("click", function () {
                clickHoleId = hole.ids;
                bindHoleData(hole);
            });
        }
        //绑定钻孔的信息和原始记录d
        function bindHoleData(hole){
            $.ajax({
                url: ctx + "geo/projectwork/holedata?holeId="+hole.ids,
                type: "GET",
                dataType: "json",
                async: false,
                contentType: "application/json;charset=utf-8",
                success: function (data) {
                    if(data.code == 0){
                        var hole = data.hole;
                        var yantus= data.yantuList;
                        //勘探点类型(1-探井、2-钻孔)
                        hole.type =    hole.type=='1'?"探井":"钻孔";
                        hole.datacount = yantus.length;
                        var endDepth = yantus[yantus.length-1].endDepth;
                        hole.endDepth=endDepth;
                        setRecordList(yantus);
                        vm.hole=hole;
                        vm.recordList = yantus;
                    }else{
                        alert("获取数据失败:" + data.msg);
                    }
                },
                error: function () {
                    console.log("获取数据失败");
                }
            });
        }
 
        //设置岩土信息
        function setRecordList (yantus) {
 
            for(var i =0;i<yantus.length;i++){
                var yantu =yantus[i];
                var content ="";
                content +="岩土类型:"+ yantu.frequencyType +"; ";
                content +="岩土定名:"+ yantu.layerName +"; ";
                content +="起始深度:"+ yantu.beginDepth +"m; ";
                content +="终止深度:"+ yantu.endDepth +"m; ";
 
                if(yantu.zycf !=null){
                    content +="主要成分:"+ yantu.zycf +"; ";
                }
 
                if(yantu.cycf !=null){
                    content +="次要成分:"+ yantu.cycf +"; ";
                }
                if(yantu.ys !=null){
                    content +="颜色:"+ yantu.ys +"; ";
                }
 
                if(yantu.bhw !=null){
                    content +="包含物:"+ yantu.bhw +"; ";
                }
 
                if( yantu.sd !=null){
                    content +="湿度:"+ yantu.sd +"; ";
                }
                if(yantu.zt !=null){
                    content +="状态:"+ yantu.zt +"; ";
                }
                if(yantu.msd !=null){
                    content +="密实度:"+ yantu.msd +"; ";
                }
                if(yantu.klxz !=null){
                    content +="颗粒型装:"+ yantu.klxz +"; ";
                }
                if(yantu.kljp !=null){
                    content +="颗粒级别:"+ yantu.kljp +"; ";
                }
                yantus[i].content =content;
            }
 
        }
 
        //显示钻孔标签
        function addLabel(e) {
            var label = new T.Label({
                text: e.code,
                position: new T.LngLat(e.mapLongitude, e.mapLatitude),
                offset: new T.Point(-25, 0)
            });
            label.setBackgroundColor("transparent");
            label.setBorderLine(0);
            map.addOverLay(label);
        }
 
        //跳转页面 查看点击的钻孔的柱状图
        function histogram(){
            if(clickHoleId !=null){
                $.modal.openTab("柱状图", ctx+"/geo/projectwork/histogram?id="+clickHoleId);
            }
        }
 
 
        //绑定切换tab 的时间
        function bindTabEvent() {
            $("#menu li").on("click", function() {
                $(this).siblings().removeClass("active");
                $(this).addClass("active");
            })
 
            $(".custom-tab-title li").on("click", function() {
                $(this).siblings().removeClass("active");
                $(this).addClass("active");
                var index = $(this).index();
                $(".custom-tab-item").removeClass("active");
                $(".custom-tab-item").eq(index).addClass("active");
            })
        }
 
 
    </script>
</body>
 
</html>