liuyg
2021-06-30 1b22efb7fa9d35c531e5f4ff2e6d600c23a6546d
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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
///////////////////////////////////////////////////////////////////////////
// Copyright © 2019 zhongsong. All Rights Reserved.
// 模块描述:显示坐标
///////////////////////////////////////////////////////////////////////////
define([
    'dojo/_base/declare',
    'dojo/_base/lang',
    'dojo/_base/array',
    'dojo/_base/html',
    'dojo/topic',
    'jimu/BaseWidget',
    'jimu/utils',
    'jimu/css!libs/zTree_v3/css/zTreeStyle/zTreeStyle.css',
    'libs/zTree_v3/js/jquery.ztree.all'
],
    function (declare,
        lang,
        array,
        html,
        topic,
        BaseWidget,
        aspect,
        string,
        utils
    ) {
        return declare([BaseWidget], {
            baseClass: 'jimu-widget-spatialAnalysis',
            name: 'spatialAnalysis',
            layers: {},
            startup: function () {
                var that = this;
                // 暴露在外的接口
 
                topic.subscribe("closeOnceUse", lang.hitch(this, this.closeOnceUse));
 
 
 
                var domHtmls = [//默认
                    {
                        name: '可视分析',
                        classs: 'visibleArea-tool',
                        img: './images/addL/ksy.png'
                    }, {
                        name: '剖面分析',
                        classs: 'profileAnalysis-tool',
                        img: './images/addL/剖面分析.png'
                    }
                    , {//做好静态,
                        name: '建造实体',
                        classs: 'modelDiagram-tool',
                        img: './images/addL/实体.png'
                    }
                    // , {//https://blog.csdn.net/supermapsupport/article/details/100134590
                    //     //需要iServer发布成三维服务
                    //     name: '坡度分析',
                    //     classs: 'slope-tool',
                    //     img: './images/addL/pdpx.png'
                    // }
                    // , {//SQL查询,//做好
                    //     name: 'SQL查询',
                    //     classs: 'SQLQuery-tool',
                    //     img: './images/addL/pdpx.png'
                    // }
                    , {//地形开挖,//做好
                        name: '地形开挖',
                        classs: 'digTheEarth-tool',
                        img: './images/addL/地形开挖.png'
                    }
                    , {//方量分析//做好
                        name: '方量分析',
                        classs: 'volumeAnalysis-tool',
                        img: './images/addL/方量分析.png'
                    },
                    {//通视分析
                        name: '通视分析',
                        classs: 'throughSee-tool',
                        img: './images/addL/通视分析.png'
                    },
                    {//平面裁剪
                        name: '平面裁剪',
                        classs: 'clippingPlanes-tool',
                        img: './images/addL/pingmian.png'
                    },
                    {//BOX裁剪
                        name: 'BOX裁剪',
                        classs: 'BOXTailoring-tool',
                        img: './images/addL/BOX裁剪.png'
                    }
                    ,
                    {//Cross裁剪
                        name: 'Cross裁剪',
                        classs: 'crossTailoring-tool',
                        img: './images/addL/BOX裁剪.png'
                    }
                ];
 
                that.beginSpatialAnalysis(domHtmls);
                var isit = false;
                $('.ccslius').click(() => {
                    isit = false;
                })
                $('.ccsliu').dblclick(() => {//测试开关 点击图例其他的图片
 
                    if (isit) {
                        var domHtmls2 = [
                            {
                                name: '可视分析',
                                classs: 'visibleArea-tool',
                                img: './images/addL/ksy.png'
                            }, {
                                name: '剖面分析',
                                classs: 'profileAnalysis-tool',
                                img: './images/addL/剖面分析.png'
                            }
                            , {//https://blog.csdn.net/supermapsupport/article/details/100134590
                                //需要iServer发布成三维服务
                                name: '坡度分析',
                                classs: 'slope-tool',
                                img: './images/addL/pdpx.png'
                            }
                            , {//做好静态,
                                name: '建造实体',
                                classs: 'modelDiagram-tool',
                                img: './images/addL/pdpx.png'
                            }
                            , {//SQL查询,//做好
                                name: 'SQL查询',
                                classs: 'SQLQuery-tool',
                                img: './images/addL/pdpx.png'
                            }
                            , {//地形开挖,//做好
                                name: '地形开挖',
                                classs: 'digTheEarth-tool',
                                img: './images/addL/pdpx.png'
                            }, {//方量分析//做好
                                name: '方量分析',
                                classs: 'volumeAnalysis-tool',
                                img: './images/addL/pdpx.png'
                            }
                            , {//空间查询
                                name: '空间查询',
                                classs: 'spatialQuery-tool',
                                img: './images/addL/pdpx.png'
                            }
                            , {//多边形裁剪
                                name: '多边形裁剪',
                                classs: 'polygonClipping-tool',
                                img: './images/addL/pdpx.png'
                            },
                            {//通视分析
                                name: '通视分析',
                                classs: 'throughSee-tool',
                                img: './images/addL/pdpx.png'
                            },
                            {//平面裁剪
                                name: '平面裁剪',
                                classs: 'clippingPlanes-tool',
                                img: './images/addL/pdpx.png'
                            },
                            {//BOX裁剪
                                name: 'BOX裁剪',
                                classs: 'BOXTailoring-tool',
                                img: './images/addL/BOX裁剪.png'
                            }
                            ,
                            {//建造模型
                                name: '建造模型',
                                classs: 'modesssssllll',
                                img: './images/addL/pdpx.png'
                            }
                            ,
                            {//清除模型
                                name: '清除模型',
                                classs: 'modesssss2222',
                                img: './images/addL/pdpx.png'
                            }
                        ];
                        that.beginSpatialAnalysis(domHtmls2);
                        var promise = false;
                        $('.modesssssllll').click(() => {
                            var URL_CONFIG = {
                                SCENE_CBD: 'http://www.supermapol.com/realspace/services/3D-niaochao/rest/realspace',
                            }
                            promise = this.map.scene.open(URL_CONFIG.SCENE_CBD);
                        })
                        $('.modesssss2222').click(() => {
                            if (promise) {
                                Cesium.when(promise, function (layer) {
                                    for (var i = 0; i < layer.length; i++) {
                                        that.map.scene.layers.remove(layer[i].name)
                                    }
                                })
                            }
                        })
                    } else {
                        that.beginSpatialAnalysis(domHtmls);
                    }
                    isit = !isit;
                })
 
            },
            promise: 'NODATA',
            beginSpatialAnalysis: function (domHtmls) {
                var that = this;
                var domHtmls = domHtmls;
                var dom = $('#spatialAnalysis-mains');
                dom.empty();
                var str = '<ul>';
                for (var k in domHtmls) {
                    str += `<li class="${domHtmls[k].classs}">
                     <i class="imgs">
                     <img src="${domHtmls[k].img}" alt="">
                     </i>
                     <span>${domHtmls[k].name}</span>
                     </li>`
                }
                str += '</ul>';
                dom.append(str);
                // console.log(dom, str)
                // dom.replaceWith(str);
 
                $('.closesspatialAnalysis').click(() => {
                    that.closeOnceUse();
                    $('.jimu-widget-spatialAnalysis').hide();
 
                })
                // 可视分析
                $('.visibleArea-tool').click(function () {
                    that.closeOnceUse();
 
                    $(".jimu-widget-visibleArea").show();
                })
                // 剖面分析
                $('.profileAnalysis-tool').click(function () {
                    that.closeOnceUse();
 
                    $(".jimu-widget-profileAnalysis").show();
                })
                //坡度分析
                $('.slope-tool').click(function () {
                    that.closeOnceUse();
 
                    $(".jimu-widget-slope").show();
                    topic.publish('getbeginSlope', 'this.beginSlope');
                })
                //模型
                $('.modelDiagram-tool').click(function () {
                    that.closeOnceUse();
                    $('.jimu-widget-modelDiagram').show();
                })
                //sql查询
                $('.SQLQuery-tool').click(function () {
                    that.closeOnceUse();
                    $(".jimu-widget-SQLQuery").show();
                    topic.publish('beginSQL', 'this.beginSQL');
 
                })
                //地形开挖
                $('.digTheEarth-tool').click(function () {
                    that.closeOnceUse('digTheEarth');
                    $(".jimu-widget-digTheEarth").show();
                    // topic.publish('beginDigTheEarth', 'beginDigTheEarth');
 
                })
 
                //方量分析
                $('.volumeAnalysis-tool').click(function () {
                    that.closeOnceUse('volumeAnalysis');
                    $(".jimu-widget-volumeAnalysis").show();
                    topic.publish('beginVolumeAnalysis', 'beginVolumeAnalysis');
                })
 
                //空间查询
                $('.spatialQuery-tool').click(function () {
                    that.closeOnceUse();
                    $(".jimu-widget-spatialQuery").show();
                    topic.publish('beginSpatialQuery', 'beginSpatialQuery');
                })
 
                //多边形裁剪
                $('.polygonClipping-tool').click(function () {
                    that.closeOnceUse();
                    $(".jimu-widget-polygonClipping").show();
                    topic.publish('beginpolygonClipping', 'beginpolygonClipping');
                })
 
                //通视分析
                $('.throughSee-tool').click(function () {
                    that.closeOnceUse();
                    $(".jimu-widget-throughSee").show();
                    topic.publish('beginthroughSee', 'beginthroughSee');
                })
 
                //平面裁剪
                $('.clippingPlanes-tool').click(function () {
                    that.closeOnceUse();
                    // console.log(that.promise, 22222222222)
                    if (that.promise == 'NODATA') {
                        layer.tips('请选择三维倾斜数据中的图层支持!', '.SelectLayerTool', {
                            tips: [3, 'red']
                        });
                    } else {
                        $(".jimu-widget-clippingPlanes").show();
                        topic.publish('beginclippingPlanes', that.promise);
                    }
                })
 
                //BOX裁剪
                $('.BOXTailoring-tool').click(function () {
                    that.closeOnceUse();
 
                    if (that.promise == 'NODATA') {
                        layer.tips('请选择三维倾斜数据中的图层支持!', '.SelectLayerTool', {
                            tips: [3, 'red']
                        });
                    } else {
                        $(".jimu-widget-BOXTailoring").show();
                        topic.publish('beginBOXTailoring', that.promise);
                    }
                })
 
                //Cross裁剪
                $('.crossTailoring-tool').click(function () {
                    that.closeOnceUse();
 
                    if (that.promise == 'NODATA') {
                        layer.tips('请选择三维倾斜数据中的图层支持!', '.SelectLayerTool', {
                            tips: [3, 'red']
                        });
                    } else {
                        $(".jimu-widget-crossTailoring").show();
                        topic.publish('begincrossTailoring', that.promise);
                    }
                })
 
                $('.SelectLayerTool').click(() => {
                    $('#SelectLayerToolItem').toggle();
                })
                //参照Layemanagement
                topic.subscribe("appendItemS", lang.hitch(this, this.appendItemS));
                topic.subscribe("removeItemS", lang.hitch(this, this.removeItemS));
 
                topic.subscribe("appendTiltS", lang.hitch(this, this.appendTiltS));
                topic.subscribe("removeTiltS", lang.hitch(this, this.removeTiltS));
                this.liClick('默认:天地图影像', '默认:天地图影像');
 
            },
            morenliClick: function (itemid, name) {
                var dom = $('.SelectLayerTool');
                dom.empty();
                var str = `${name} <i class="layui-icon layui-icon-down layui-font-12"></i>`
                dom.append(str);
                // console.log('数据错误默认')
                this.promise = 'NODATA';
                this.SelectClose();//关闭需要三维数据的窗口
 
            },
            SelectClose: function () {
                //关闭平面裁剪
                if ($(".jimu-widget-clippingPlanes").is(":visible")) {//判断是否隐藏
                    $(".jimu-widget-clippingPlanes").hide();
                    topic.publish('closesclippingPlanes');
                }
 
                //关闭BOX裁剪
                if ($(".jimu-widget-BOXTailoring").is(":visible")) {//判断是否隐藏
                    $(".jimu-widget-BOXTailoring").hide();
                    topic.publish('closesBOXTailoring');
                }
 
                //关闭Cross裁剪
                if ($(".jimu-widget-crossTailoring").is(":visible")) {//判断是否隐藏
                    $(".jimu-widget-crossTailoring").hide();
                    topic.publish('closescrossTailoring');
                }
            },
            liClick: function (itemid, name, ourdata = 1) {//点击事件
                var that = this;
                var liList = $(`[itemid='${itemid}s']`);
                // console.log(liList);
                liList.click(() => {
                    // console.log(itemid)
                    var dom = $('.SelectLayerTool');
                    layer.tips('选择了:' + name, dom, { tips: [1, '#5FB878'] });
                    dom.empty();
                    var str = `${name} <i class="layui-icon layui-icon-down layui-font-12"></i>`
                    dom.append(str);
                    dom.attr("title", name);
                    $('#SelectLayerToolItem').hide();
                    // console.log(ourdata);
                    // 定位
                    // console.log(name)
                    if (ourdata != 1) {
                        //     console.log('data')
                        if (ourdata.lon) {
                            //设置相机位置、视角,便于观察场景
                            that.map.scene.camera.setView({
                                destination: new Cesium.Cartesian3.fromDegrees(Number(ourdata.lon), Number(ourdata.lat), Number(ourdata.height)),
                                orientation: {
                                    heading: Cesium.Math.toRadians(Number(ourdata.yawAngle)),
                                    pitch: Cesium.Math.toRadians(Number(ourdata.pitchAngle)),
                                    roll: Cesium.Math.toRadians(Number(ourdata.rollAngle))
                                }
                            });
                        }
                        if (ourdata.src.indexOf('.openrealspace') != -1) {
                            // console.log('数据正确');
                            this.SelectClose();//关闭需要三维数据的窗口
                            that.promise = {
                                src: ourdata.src,
                                ZName: ourdata.title,
                                name: ourdata.serviceName,
                                id: ourdata.id
                            };
 
                        } else {
                            // console.log('数据错误');
                            that.promise = 'NODATA';
                            this.SelectClose();//关闭需要三维数据的窗口
                        }
                    } else {
                        // console.log('数据错误没有data');
                        that.promise = 'NODATA';
                        //关闭平面裁剪
                        this.SelectClose();//关闭需要三维数据的窗口
                    }
 
                })
            },
            appendItemS: function (item, obj, layer) {
                // console.log('a1')
                var that = this;
                if (item == this.name) {
 
                    // $("#SelectLayerToolItemTitle .no-data").stop().hide();
                    var flag = true;
                    var liList = $("#SelectLayerToolItemTitle li");
                    // console.log(liList)
                    // console.log($('#SelectLayerToolItemTitle'))
                    for (var i = 0; i < liList.length; i++) {
                        if ($(liList[i]).attr('itemid') && $(liList[i]).attr('itemid') == obj.id + 's') {
                            flag = false
                        }
                    }
 
                    if (flag == true) {
                        var liItem = $("<li itemid='" + obj.id + "s' itemtitle='" + obj.title + "'> <div>" +
                            "<span title='" + obj.title + "'>" +
                            obj.title +
                            "</span>" +
                            "</div> </li>");
 
                        that[obj.id] = layer;
 
                        $("#SelectLayerToolItemTitle").append(liItem);
                    }
                    that.liClick(obj.id, obj.title, obj);
                }
            },
            removeItemS: function (item, obj) {
                // console.log(obj, 'r1')
                var that = this;
                if (item == this.name) {
                    var liList = $("#SelectLayerToolItemTitle li");
                    for (var i = 0; i < liList.length; i++) {
                        if ($(liList[i]).attr('itemid') && $(liList[i]).attr('itemid') == obj.id + 's') {
                            $(liList[i]).remove();
                            var dom = $('.SelectLayerTool').attr("title");
                            // console.log(dom == obj.title, this.liClick)
                            if (dom == obj.title) {
                                that.morenliClick('默认:天地图影像', '默认:天地图影像');
                                that.promise = 'NODATA';
                            }
                        }
                    }
 
                    if ($("#SelectLayerToolItemTitle li").length == 1 && $("#SelectLayerToolItemTitle li").length == 0) {
                        $("#SelectLayerToolItemTitle .no-data").stop().show();
                        $(".jimu-widget-spatialAnalysis .tree-layer-opcity").stop().hide();
                    }
 
                }
 
                // this.liClick();
            },
            appendTiltS: function (item, obj, layer) {
                // console.log('a2')
                var that = this;
                if (item == this.name) {
 
                    // $("#SelectLayerToolItemTitle .no-data").stop().hide();
 
                    var flag = true;
 
                    var liList = $("#SelectLayerToolItemTitle li");
 
                    for (var i = 0; i < liList.length; i++) {
 
                        if ($(liList[i]).attr('itemid') && $(liList[i]).attr('itemid') == obj.id + 's') {
 
                            flag = false
                        }
                    }
                    if (flag == true) {
                        var liItem = $("<li itemid='" + obj.id + "s' itemtitle='" + obj.title + "'> <div>" +
                            "<span title='" + obj.title + "'>" +
                            obj.title +
                            "</span>" +
                            "</div> </li>");
 
                        $("#SelectLayerToolItemTitle").append(liItem);
                    }
                    that.liClick(obj.id, obj.title, obj);
                }
            },
            removeTiltS: function (item, obj) {
                // console.log(obj, 'r2')
                // console.log('r2')
                var that = this;
                if (item == this.name) {
                    var liList = $("#SelectLayerToolItemTitle li");
                    for (var i = 0; i < liList.length; i++) {
                        if ($(liList[i]).attr('itemid') && $(liList[i]).attr('itemid') == obj.id + 's') {
                            $(liList[i]).remove();
                            var dom = $('.SelectLayerTool').attr("title");
                            if (dom == obj.title) {
                                that.morenliClick('默认:天地图影像', '默认:天地图影像');
                                that.promise = 'NODATA';
                            }
                        }
                    }
 
                    if ($("#SelectLayerToolItemTitle li").length == 1 && $("#SelectLayerToolItemTitle li").length == 0) {
                        // $("#SelectLayerToolItemTitle .no-data").stop().show();
                        // $(".jimu-widget-spatialAnalysis .tree-layer-opcity").stop().hide();
                    }
                }
            },
            closeToolBox: function (item) {
                if (item != this.name) {
                    $('.tool-y-box').hide();
                }
            },
            closeOnceUse: function (who) {
                var that = this;
                that.map.scene.globe.depthTestAgainstTerrain = true;
                // 关闭量算
                topic.publish('closeMeasurement', 'Measurement');
                // 关闭卷帘
                topic.publish('closeRolling', 'Rolling');
                // 关闭分屏
                topic.publish('closeSplitScreen', 'SplitScreen');
                // 关闭标记
                topic.publish('closeSign', 'Sign');
                topic.publish('closeFlyRoute', 'FlyRoute');
                $('.jimu-widget-CoorPosition').hide();
                $('.jimu-widget-MapPrinting').hide();
                // 关闭可视
                topic.publish('closev', '');
                // 关闭剖面
                topic.publish('closep', '');
                // 关闭坡度
                topic.publish('closes', '');
                $(".jimu-widget-visibleArea").hide();
                $(".jimu-widget-profileAnalysis").hide();
                $(".jimu-widget-slope").hide();
                $('.tool-y-box').stop().hide();
                //关闭飞行
                $('.jimu-widget-visualAngle').find('.v-a-Two').removeClass('on');//清楚样式
                topic.publish('closeFly', 'closeFly');
                //清除实体
                this.map.entities.removeAll();
                $(".jimu-widget-modelDiagram").hide();
                //清除SQL查询
                $(".jimu-widget-SQLQuery").hide();
                topic.publish('closesSQL', 'closesSQL');
                //关闭地形开挖
                if ($(".jimu-widget-digTheEarth").is(":visible")) {//判断是否隐藏
                    $(".jimu-widget-digTheEarth").hide();
                    topic.publish('closesDigTheEarth');
                }
                //关闭方量贩分析
                if ($(".jimu-widget-volumeAnalysis").is(":visible")) {//判断是否隐藏
                    $(".jimu-widget-volumeAnalysis").hide();
                    topic.publish('closesVolumeAnalysis');
                }
                //关闭空间查询
                if ($(".jimu-widget-spatialQuery").is(":visible")) {//判断是否隐藏
                    $(".jimu-widget-spatialQuery").hide();
                    topic.publish('closesSpatialQuery');
                }
                //关闭多边形裁剪
                if ($(".jimu-widget-polygonClipping").is(":visible")) {//判断是否隐藏
                    $(".jimu-widget-polygonClipping").hide();
                    topic.publish('closespolygonClipping');
                }
                //关闭通视分析
                if ($(".jimu-widget-throughSee").is(":visible")) {//判断是否隐藏
                    $(".jimu-widget-throughSee").hide();
                    topic.publish('closesthroughSee');
                }
                //关闭平面裁剪
                if ($(".jimu-widget-clippingPlanes").is(":visible")) {//判断是否隐藏
                    $(".jimu-widget-clippingPlanes").hide();
                    topic.publish('closesclippingPlanes');
                }
 
                //关闭BOX裁剪
                if ($(".jimu-widget-BOXTailoring").is(":visible")) {//判断是否隐藏
                    $(".jimu-widget-BOXTailoring").hide();
                    topic.publish('closesBOXTailoring');
                }
 
                //关闭Cross裁剪
                if ($(".jimu-widget-crossTailoring").is(":visible")) {//判断是否隐藏
                    $(".jimu-widget-crossTailoring").hide();
                    topic.publish('closescrossTailoring');
                }
 
            },
            onOpen: function () {
            },
 
            onClose: function () {
                //面板关闭的时候触发 (when this panel is closed trigger)
            },
 
            onMinimize: function () {
                this.resize();
            },
 
            onMaximize: function () {
                this.resize();
            },
 
            resize: function () {
 
            },
 
 
            destroy: function () {
                //销毁的时候触发
                //todo
                //do something before this func
                this.inherited(arguments);
            }
 
        });
    });