dcim-topology2d 2.2.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/activity-diagram/src/final/final.d.ts +1 -1
 - package/activity-diagram/src/final/final.rect.d.ts +1 -1
 - package/activity-diagram/src/final/final.rect.js +1 -1
 - package/activity-diagram/src/fork/fork.anchor.d.ts +1 -1
 - package/activity-diagram/src/fork/fork.anchor.js +1 -1
 - package/activity-diagram/src/fork/fork.d.ts +1 -1
 - package/activity-diagram/src/fork/fork.rect.d.ts +1 -1
 - package/activity-diagram/src/fork/fork.rect.js +1 -1
 - package/activity-diagram/src/register.js +1 -1
 - package/activity-diagram/src/swimlaneH/swimlaneH.d.ts +1 -1
 - package/activity-diagram/src/swimlaneH/swimlaneH.rect.d.ts +1 -1
 - package/activity-diagram/src/swimlaneH/swimlaneH.rect.js +1 -1
 - package/activity-diagram/src/swimlaneV/swimlaneV.d.ts +1 -1
 - package/activity-diagram/src/swimlaneV/swimlaneV.rect.d.ts +1 -1
 - package/activity-diagram/src/swimlaneV/swimlaneV.rect.js +1 -1
 - package/chart-diagram/index.d.ts +1 -3
 - package/chart-diagram/index.js +1 -2
 - package/chart-diagram/src/echarts/index.d.ts +2 -1
 - package/chart-diagram/src/echarts/index.js +104 -112
 - package/chart-diagram/src/register.js +8 -9
 - package/class-diagram/src/class/class.d.ts +1 -1
 - package/class-diagram/src/class/class.rect.d.ts +1 -1
 - package/class-diagram/src/class/class.rect.js +1 -1
 - package/class-diagram/src/register.js +1 -1
 - package/core/index.d.ts +0 -2
 - package/core/index.js +0 -2
 - package/core/src/activeLayer.d.ts +10 -2
 - package/core/src/activeLayer.js +47 -42
 - package/core/src/animateLayer.d.ts +7 -3
 - package/core/src/animateLayer.js +12 -10
 - package/core/src/calling.d.ts +4 -1
 - package/core/src/calling.js +41 -43
 - package/core/src/canvas.d.ts +6 -1
 - package/core/src/canvas.js +21 -22
 - package/core/src/common.d.ts +7 -6
 - package/core/src/common.js +675 -343
 - package/core/src/core.d.ts +4 -5
 - package/core/src/core.js +385 -536
 - package/core/src/divLayer.d.ts +36 -2
 - package/core/src/divLayer.js +305 -33
 - package/core/src/healps/changeData.d.ts +2 -1
 - package/core/src/healps/changeData.js +100 -86
 - package/core/src/hoverLayer.d.ts +9 -2
 - package/core/src/hoverLayer.js +34 -31
 - package/core/src/middles/default.d.ts +3 -1
 - package/core/src/middles/default.js +51 -63
 - package/core/src/middles/index.js +2 -3
 - package/core/src/middles/nodes/arbitrarygraph.js +9 -11
 - package/core/src/middles/nodes/pentagon.rect.js +1 -1
 - package/core/src/middles/nodes/rectangle.rect.js +1 -1
 - package/core/src/models/data.d.ts +26 -0
 - package/core/src/models/data.js +77 -0
 - package/core/src/models/data.js.map +1 -0
 - package/core/src/models/index.d.ts +1 -0
 - package/core/src/models/index.js +1 -0
 - package/core/src/models/line.js +7 -7
 - package/core/src/models/node.d.ts +0 -10
 - package/core/src/models/node.js +101 -148
 - package/core/src/models/pen.js +67 -27
 - package/core/src/models/rect.js +2 -2
 - package/core/src/mqtt.d.ts +14 -0
 - package/core/src/mqtt.js +82 -0
 - package/core/src/mqtt.js.map +1 -0
 - package/core/src/offscreen.d.ts +4 -1
 - package/core/src/offscreen.js +24 -26
 - package/core/src/options.d.ts +1 -3
 - package/core/src/options.js +0 -2
 - package/core/src/poll.js +39 -0
 - package/core/src/preview.d.ts +13 -2
 - package/core/src/preview.js +43 -144
 - package/core/src/renderLayer.d.ts +9 -11
 - package/core/src/renderLayer.js +61 -60
 - package/core/src/socket.d.ts +10 -0
 - package/core/src/socket.js +51 -0
 - package/core/src/socket.js.map +1 -0
 - package/core/src/utils/canvas.js +1 -1
 - package/core/src/utils/construction.d.ts +3 -36
 - package/core/src/utils/construction.js +1 -29
 - package/core/src/utils/conversion.d.ts +0 -15
 - package/core/src/utils/conversion.js +0 -319
 - package/core/src/utils/dom.d.ts +8 -0
 - package/core/src/utils/dom.js +67 -0
 - package/core/src/utils/dom.js.map +1 -0
 - package/core/src/utils/index.d.ts +1 -2
 - package/core/src/utils/index.js +1 -2
 - package/core/src/utils/onmousevent.d.ts +0 -3
 - package/core/src/utils/onmousevent.js +10 -42
 - package/flow-diagram/src/comment/comment.anchor.d.ts +1 -1
 - package/flow-diagram/src/comment/comment.anchor.js +1 -1
 - package/flow-diagram/src/comment/comment.d.ts +1 -1
 - package/flow-diagram/src/data/data.anchor.d.ts +1 -1
 - package/flow-diagram/src/data/data.anchor.js +1 -1
 - package/flow-diagram/src/data/data.d.ts +1 -1
 - package/flow-diagram/src/data/data.rect.d.ts +1 -1
 - package/flow-diagram/src/data/data.rect.js +1 -1
 - package/flow-diagram/src/db/db.d.ts +1 -1
 - package/flow-diagram/src/db/db.rect.d.ts +1 -1
 - package/flow-diagram/src/db/db.rect.js +1 -1
 - package/flow-diagram/src/display/display.anchor.d.ts +1 -1
 - package/flow-diagram/src/display/display.anchor.js +1 -1
 - package/flow-diagram/src/display/display.d.ts +1 -1
 - package/flow-diagram/src/display/display.rect.d.ts +1 -1
 - package/flow-diagram/src/display/display.rect.js +1 -1
 - package/flow-diagram/src/document/document.anchor.d.ts +1 -1
 - package/flow-diagram/src/document/document.anchor.js +1 -1
 - package/flow-diagram/src/document/document.d.ts +1 -1
 - package/flow-diagram/src/document/document.rect.d.ts +1 -1
 - package/flow-diagram/src/document/document.rect.js +1 -1
 - package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +1 -1
 - package/flow-diagram/src/externStorage/externStorage.anchor.js +1 -1
 - package/flow-diagram/src/externStorage/externStorage.d.ts +1 -1
 - package/flow-diagram/src/externStorage/externStorage.rect.d.ts +1 -1
 - package/flow-diagram/src/externStorage/externStorage.rect.js +1 -1
 - package/flow-diagram/src/internalStorage/internalStorage.d.ts +1 -1
 - package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +1 -1
 - package/flow-diagram/src/internalStorage/internalStorage.rect.js +1 -1
 - package/flow-diagram/src/manually/manually.anchor.d.ts +1 -1
 - package/flow-diagram/src/manually/manually.anchor.js +1 -1
 - package/flow-diagram/src/manually/manually.d.ts +1 -1
 - package/flow-diagram/src/manually/manually.rect.d.ts +1 -1
 - package/flow-diagram/src/manually/manually.rect.js +1 -1
 - package/flow-diagram/src/parallel/parallel.anchor.d.ts +1 -1
 - package/flow-diagram/src/parallel/parallel.anchor.js +1 -1
 - package/flow-diagram/src/parallel/parallel.d.ts +1 -1
 - package/flow-diagram/src/queue/queue.d.ts +1 -1
 - package/flow-diagram/src/queue/queue.rect.d.ts +1 -1
 - package/flow-diagram/src/queue/queue.rect.js +1 -1
 - package/flow-diagram/src/register.js +1 -1
 - package/flow-diagram/src/subprocess/subprocess.d.ts +1 -1
 - package/flow-diagram/src/subprocess/subprocess.rect.d.ts +1 -1
 - package/flow-diagram/src/subprocess/subprocess.rect.js +1 -1
 - package/layout/src/align.d.ts +1 -1
 - package/layout/src/align.js +1 -1
 - package/layout/src/layout.d.ts +1 -1
 - package/layout/src/layout.js +1 -1
 - package/myShape-diagram/{index.js → myShape.js} +1 -4
 - package/package.json +1 -1
 - package/sequence-diagram/src/focus/focus.anchor.d.ts +1 -1
 - package/sequence-diagram/src/focus/focus.anchor.js +1 -1
 - package/sequence-diagram/src/focus/focus.d.ts +1 -1
 - package/sequence-diagram/src/focus/focus.rect.d.ts +1 -1
 - package/sequence-diagram/src/focus/focus.rect.js +1 -1
 - package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +1 -1
 - package/sequence-diagram/src/lifeline/lifeline.anchor.js +1 -1
 - package/sequence-diagram/src/lifeline/lifeline.d.ts +1 -1
 - package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +1 -1
 - package/sequence-diagram/src/lifeline/lifeline.rect.js +1 -1
 - package/sequence-diagram/src/register.js +1 -1
 - package/chart-diagram/src/utils/changeOptions.d.ts +0 -8
 - package/chart-diagram/src/utils/changeOptions.js +0 -267
 - package/chart-diagram/src/utils/conversion.d.ts +0 -19
 - package/chart-diagram/src/utils/conversion.js +0 -560
 - package/chart-diagram/src/utils/drawGraphic.d.ts +0 -3
 - package/chart-diagram/src/utils/drawGraphic.js +0 -97
 - package/chart-diagram/src/utils/formatter.d.ts +0 -1
 - package/chart-diagram/src/utils/formatter.js +0 -206
 - package/chart-diagram/src/utils/index.d.ts +0 -5
 - package/chart-diagram/src/utils/index.js +0 -5
 - package/chart-diagram/src/utils/render.d.ts +0 -8
 - package/chart-diagram/src/utils/render.js +0 -219
 - package/chart-diagram/src/utils/surfaceParametricConversion.d.ts +0 -3
 - package/chart-diagram/src/utils/surfaceParametricConversion.js +0 -252
 - package/core/src/element/common.d.ts +0 -6
 - package/core/src/element/common.js +0 -63
 - package/core/src/element/datePicker.d.ts +0 -3
 - package/core/src/element/datePicker.js +0 -44
 - package/core/src/element/iframe.d.ts +0 -3
 - package/core/src/element/iframe.js +0 -12
 - package/core/src/element/index.d.ts +0 -5
 - package/core/src/element/index.js +0 -6
 - package/core/src/element/select.d.ts +0 -11
 - package/core/src/element/select.js +0 -273
 - package/core/src/element/tab.d.ts +0 -1
 - package/core/src/element/tab.js +0 -20
 - package/core/src/element/time.d.ts +0 -3
 - package/core/src/element/time.js +0 -44
 - package/core/src/middles/arrows/index.d.ts +0 -4
 - package/core/src/middles/arrows/index.js +0 -5
 - package/core/src/middles/lines/index.d.ts +0 -4
 - package/core/src/middles/lines/index.js +0 -5
 - package/core/src/middles/nodes/formDatePicker.d.ts +0 -2
 - package/core/src/middles/nodes/formDatePicker.js +0 -107
 - package/core/src/middles/nodes/formoverflow.js +0 -61
 - package/core/src/middles/nodes/formselect.d.ts +0 -2
 - package/core/src/middles/nodes/formselect.js +0 -111
 - package/core/src/middles/nodes/iframe.d.ts +0 -2
 - package/core/src/middles/nodes/iframe.js +0 -29
 - package/core/src/middles/nodes/index.d.ts +0 -51
 - package/core/src/middles/nodes/index.js +0 -53
 - package/core/src/middles/nodes/switchs.d.ts +0 -2
 - package/core/src/middles/nodes/switchs.js +0 -46
 - package/core/src/middles/nodes/time.d.ts +0 -2
 - package/core/src/middles/nodes/time.js +0 -98
 - package/core/src/store/common.d.ts +0 -9
 - package/core/src/store/common.js +0 -5
 - package/core/src/store/data.d.ts +0 -196
 - package/core/src/store/data.js +0 -193
 - package/core/src/store/index.d.ts +0 -2
 - package/core/src/store/index.js +0 -2
 - package/core/src/utils/assignment.d.ts +0 -7
 - package/core/src/utils/assignment.js +0 -216
 - package/core/src/utils/params.d.ts +0 -3
 - package/core/src/utils/params.js +0 -136
 - package/static/echartsDefaultData.js +0 -178
 - package/static/element.js +0 -14
 - package/static/form.js +0 -11
 - package/static/index.js +0 -3
 - package/store/actions.js +0 -1
 - package/store/clear.js +0 -10
 - package/store/default.js +0 -22
 - package/store/index.js +0 -3
 - package/style/common.css +0 -15
 - package/style/datePicker.css +0 -44
 - package/style/editor.css +0 -16
 - package/style/index.css +0 -5
 - package/style/select.css +0 -143
 - /package/myShape-diagram/{index.ts → myShape.ts} +0 -0
 
    
        package/core/src/common.js
    CHANGED
    
    | 
         @@ -3,21 +3,15 @@ import {DivLayer} from './divLayer'; 
     | 
|
| 
       3 
3 
     | 
    
         
             
            import {AnimateLayer} from './animateLayer';
         
     | 
| 
       4 
4 
     | 
    
         
             
            import {RenderLayer} from './renderLayer';
         
     | 
| 
       5 
5 
     | 
    
         
             
            import {Offscreen} from './offscreen';
         
     | 
| 
       6 
     | 
    
         
            -
            import { 
     | 
| 
       7 
     | 
    
         
            -
            import {
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
                setConnectionTagForConf,
         
     | 
| 
       14 
     | 
    
         
            -
                setInitConfData,
         
     | 
| 
       15 
     | 
    
         
            -
                getParams,
         
     | 
| 
       16 
     | 
    
         
            -
                tabHideShowOperation,
         
     | 
| 
       17 
     | 
    
         
            -
                tabStaticOperation, pageZoom
         
     | 
| 
       18 
     | 
    
         
            -
            } from './utils';
         
     | 
| 
       19 
     | 
    
         
            -
            import {useStore, clearStore, commonStore} from './store'
         
     | 
| 
      
 6 
     | 
    
         
            +
            import {Socket} from './socket';
         
     | 
| 
      
 7 
     | 
    
         
            +
            import {Line, Node, Pen, Point, TopologyData, EventAction} from './models';
         
     | 
| 
      
 8 
     | 
    
         
            +
            import {setConfItemNode} from './healps';
         
     | 
| 
      
 9 
     | 
    
         
            +
            import {s8, formatPadding, getRect, previewType} from './utils';
         
     | 
| 
      
 10 
     | 
    
         
            +
            import {DefalutOptions} from './options';
         
     | 
| 
      
 11 
     | 
    
         
            +
            import {POLL} from './poll';
         
     | 
| 
      
 12 
     | 
    
         
            +
            import axios from 'axios';
         
     | 
| 
       20 
13 
     | 
    
         
             
            import * as mqtt from './mqtt.min';
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
       21 
15 
     | 
    
         
             
            var MoveInType;
         
     | 
| 
       22 
16 
     | 
    
         
             
            (function (MoveInType) {
         
     | 
| 
       23 
17 
     | 
    
         
             
                MoveInType[MoveInType["None"] = 0] = "None";
         
     | 
| 
         @@ -36,33 +30,27 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       36 
30 
     | 
    
         
             
                    var _this = this;
         
     | 
| 
       37 
31 
     | 
    
         
             
                    _this.moveInType = MoveInType;
         
     | 
| 
       38 
32 
     | 
    
         
             
                    this.mouseDown = null;
         
     | 
| 
       39 
     | 
    
         
            -
                    this.renderTimer = 0;
         
     | 
| 
       40 
     | 
    
         
            -
                    this.lastRender = 0;
         
     | 
| 
       41 
     | 
    
         
            -
                    this.pageResizeTim = null;
         
     | 
| 
       42 
     | 
    
         
            -
                    this.isResize = false;
         
     | 
| 
       43 
     | 
    
         
            -
                    this.id = s8();
         
     | 
| 
       44 
     | 
    
         
            -
                    this.store = useStore(this.id);
         
     | 
| 
       45 
33 
     | 
    
         
             
                    if (typeof parent === 'string') {
         
     | 
| 
       46 
     | 
    
         
            -
                        this. 
     | 
| 
      
 34 
     | 
    
         
            +
                        this.parentElem = document.getElementById(parent);
         
     | 
| 
       47 
35 
     | 
    
         
             
                    } else {
         
     | 
| 
       48 
     | 
    
         
            -
                        this. 
     | 
| 
      
 36 
     | 
    
         
            +
                        this.parentElem = parent;
         
     | 
| 
       49 
37 
     | 
    
         
             
                    }
         
     | 
| 
       50 
38 
     | 
    
         
             
                    if (!options) {
         
     | 
| 
       51 
39 
     | 
    
         
             
                        options = {};
         
     | 
| 
       52 
40 
     | 
    
         
             
                    }
         
     | 
| 
       53 
     | 
    
         
            -
                    this. 
     | 
| 
       54 
     | 
    
         
            -
                    this. 
     | 
| 
       55 
     | 
    
         
            -
                     
     | 
| 
       56 
     | 
    
         
            -
                     
     | 
| 
       57 
     | 
    
         
            -
                     
     | 
| 
       58 
     | 
    
         
            -
                     
     | 
| 
       59 
     | 
    
         
            -
                    this. 
     | 
| 
       60 
     | 
    
         
            -
                     
     | 
| 
      
 41 
     | 
    
         
            +
                    this.parentElem.style.position = 'relative';
         
     | 
| 
      
 42 
     | 
    
         
            +
                    this.parentElem.style.overflow = 'auto';
         
     | 
| 
      
 43 
     | 
    
         
            +
                    var font = Object.assign({}, DefalutOptions.font, options.font);
         
     | 
| 
      
 44 
     | 
    
         
            +
                    options.font = font;
         
     | 
| 
      
 45 
     | 
    
         
            +
                    this.options = Object.assign({}, DefalutOptions, options);
         
     | 
| 
      
 46 
     | 
    
         
            +
                    this.data = new TopologyData();
         
     | 
| 
      
 47 
     | 
    
         
            +
                    this.id = s8();
         
     | 
| 
      
 48 
     | 
    
         
            +
                    Store.set(this.generateStoreKey('topology-data'), this.data);
         
     | 
| 
       61 
49 
     | 
    
         
             
                    var id = this.id;
         
     | 
| 
       62 
     | 
    
         
            -
                    this.animateLayer = new AnimateLayer(id);
         
     | 
| 
       63 
     | 
    
         
            -
                    this.offscreen = new Offscreen(id);
         
     | 
| 
       64 
     | 
    
         
            -
                    this.canvas = new RenderLayer(id);
         
     | 
| 
       65 
     | 
    
         
            -
                    this.divLayer = new DivLayer(id);
         
     | 
| 
      
 50 
     | 
    
         
            +
                    this.animateLayer = new AnimateLayer(this.options, id);
         
     | 
| 
      
 51 
     | 
    
         
            +
                    this.offscreen = new Offscreen(this.parentElem, this.options, id);
         
     | 
| 
      
 52 
     | 
    
         
            +
                    this.canvas = new RenderLayer(this.parentElem, this.options, id);
         
     | 
| 
      
 53 
     | 
    
         
            +
                    this.divLayer = new DivLayer(this.parentElem, this.options, id);
         
     | 
| 
       66 
54 
     | 
    
         
             
                    this.divLayer.canvas.tabIndex = 0;
         
     | 
| 
       67 
55 
     | 
    
         
             
                    this.divLayer.canvas.ondblclick = this.ondblclick;
         
     | 
| 
       68 
56 
     | 
    
         
             
                    this.divLayer.canvas.onblur = function () {
         
     | 
| 
         @@ -92,6 +80,7 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       92 
80 
     | 
    
         
             
                                _this.offscreen.render();
         
     | 
| 
       93 
81 
     | 
    
         
             
                                break;
         
     | 
| 
       94 
82 
     | 
    
         
             
                        }
         
     | 
| 
      
 83 
     | 
    
         
            +
                        _this.divLayer.playNext(e.data.nextAnimate);
         
     | 
| 
       95 
84 
     | 
    
         
             
                        _this.dispatch('animateEnd', e);
         
     | 
| 
       96 
85 
     | 
    
         
             
                    });
         
     | 
| 
       97 
86 
     | 
    
         
             
                    this.subcribeTableData = Store.subscribe('SYNC:tableData', function (data) {
         
     | 
| 
         @@ -119,6 +108,8 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       119 
108 
     | 
    
         
             
                        }
         
     | 
| 
       120 
109 
     | 
    
         
             
                    };
         
     | 
| 
       121 
110 
     | 
    
         
             
                    this.openCount = 0;
         
     | 
| 
      
 111 
     | 
    
         
            +
                    this.timmerByTopology = null;
         
     | 
| 
      
 112 
     | 
    
         
            +
                    this.ratioCord = null;
         
     | 
| 
       122 
113 
     | 
    
         
             
                    this.lastTranlated = {x: 0, y: 0};
         
     | 
| 
       123 
114 
     | 
    
         
             
                    this.moveIn = {
         
     | 
| 
       124 
115 
     | 
    
         
             
                        type: 'None',
         
     | 
| 
         @@ -131,9 +122,21 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       131 
122 
     | 
    
         
             
                        lineControlPoint: null,
         
     | 
| 
       132 
123 
     | 
    
         
             
                        eventNode: null
         
     | 
| 
       133 
124 
     | 
    
         
             
                    };
         
     | 
| 
      
 125 
     | 
    
         
            +
                    this.initType = ''; // 初始化类型
         
     | 
| 
      
 126 
     | 
    
         
            +
                    this.pathRewrite = '';
         
     | 
| 
      
 127 
     | 
    
         
            +
                    this.initData = null; // 初始化数据
         
     | 
| 
      
 128 
     | 
    
         
            +
                    this.tagParams = {}; // 数据属性的集合,对应不同的事件类型
         
     | 
| 
      
 129 
     | 
    
         
            +
                    this.assetPoperties = {}; // 固定的资产详情的集合
         
     | 
| 
      
 130 
     | 
    
         
            +
                    this.isExistAssetKey = false; // 是否存在固定的资产详情
         
     | 
| 
      
 131 
     | 
    
         
            +
                    this.pollTime = { // 轮询的方式的定时器
         
     | 
| 
      
 132 
     | 
    
         
            +
                        Poll: null,
         
     | 
| 
      
 133 
     | 
    
         
            +
                        Poll1: null,
         
     | 
| 
      
 134 
     | 
    
         
            +
                        Poll2: null,
         
     | 
| 
      
 135 
     | 
    
         
            +
                    };
         
     | 
| 
       134 
136 
     | 
    
         
             
                    this.tip = '';
         
     | 
| 
       135 
137 
     | 
    
         
             
                    this.rendering = false;
         
     | 
| 
       136 
138 
     | 
    
         
             
                    this.isFullScreen = false;
         
     | 
| 
      
 139 
     | 
    
         
            +
                    this.socket = null;
         
     | 
| 
       137 
140 
     | 
    
         
             
                    this.inputObj = null;
         
     | 
| 
       138 
141 
     | 
    
         
             
                    this.input = document.createElement('textarea');
         
     | 
| 
       139 
142 
     | 
    
         
             
                    this.input.style.position = 'absolute';
         
     | 
| 
         @@ -144,11 +147,11 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       144 
147 
     | 
    
         
             
                    this.input.style.outline = 'none';
         
     | 
| 
       145 
148 
     | 
    
         
             
                    this.input.style.border = '1px solid #cdcdcd';
         
     | 
| 
       146 
149 
     | 
    
         
             
                    this.input.style.resize = 'none';
         
     | 
| 
       147 
     | 
    
         
            -
                    this. 
     | 
| 
      
 150 
     | 
    
         
            +
                    this.parentElem.appendChild(this.input);
         
     | 
| 
       148 
151 
     | 
    
         
             
                    this.paginationPageListBox = document.createElement('ul');
         
     | 
| 
       149 
152 
     | 
    
         
             
                    this.pagenationPageInput = document.createElement('input');
         
     | 
| 
       150 
153 
     | 
    
         
             
                    this.tablePaginationPageStyle();
         
     | 
| 
       151 
     | 
    
         
            -
                    this. 
     | 
| 
      
 154 
     | 
    
         
            +
                    this.parentElem.appendChild(this.paginationPageListBox);
         
     | 
| 
       152 
155 
     | 
    
         
             
                    // 列表数据选取
         
     | 
| 
       153 
156 
     | 
    
         
             
                    this.paginationPageListNode = function (ev) {
         
     | 
| 
       154 
157 
     | 
    
         
             
                        const node = _this.moveIn.activeNode;
         
     | 
| 
         @@ -170,182 +173,110 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       170 
173 
     | 
    
         
             
                    this.createMarkdownTip();
         
     | 
| 
       171 
174 
     | 
    
         
             
                    window.topology = this;
         
     | 
| 
       172 
175 
     | 
    
         
             
                }
         
     | 
| 
       173 
     | 
    
         
            -
                Common.prototype.categoryDataParams = function (data){
         
     | 
| 
       174 
     | 
    
         
            -
                    getParams(this.id, data);
         
     | 
| 
       175 
     | 
    
         
            -
                };
         
     | 
| 
       176 
     | 
    
         
            -
                Common.prototype.getParams = function (assetId){
         
     | 
| 
       177 
     | 
    
         
            -
                    const params = {
         
     | 
| 
       178 
     | 
    
         
            -
                        doorIds: this.store.mqttParams.doorIds,
         
     | 
| 
       179 
     | 
    
         
            -
                        tagIds: this.store.mqttParams.tagIds.join(","),
         
     | 
| 
       180 
     | 
    
         
            -
                        assetIds: this.store.mqttParams.assetIds.join(","),
         
     | 
| 
       181 
     | 
    
         
            -
                        areaIds: this.store.mqttParams.areaIds.join(","),
         
     | 
| 
       182 
     | 
    
         
            -
                        routingkey: this.store.mqttParams.routingkey,
         
     | 
| 
       183 
     | 
    
         
            -
                        echart: this.store.mqttParams.tagEcharts.join(","),
         
     | 
| 
       184 
     | 
    
         
            -
                        echartData: this.store.mqttParams.echartData,
         
     | 
| 
       185 
     | 
    
         
            -
                        dataConfig: this.store.mqttParams.dataConfig.data
         
     | 
| 
       186 
     | 
    
         
            -
                    }
         
     | 
| 
       187 
     | 
    
         
            -
                    if (this.store.mqttParams.echartAssemblyData.length) params.echartAssemblyData = [...this.store.mqttParams.echartAssemblyData];
         
     | 
| 
       188 
     | 
    
         
            -
                    if(assetId) {
         
     | 
| 
       189 
     | 
    
         
            -
                        params.varValueIds = this.store.mqttParams.varVaule.join(",");
         
     | 
| 
       190 
     | 
    
         
            -
                        params.branchAddrs = this.store.mqttParams.branchValue.join(",");
         
     | 
| 
       191 
     | 
    
         
            -
                    }else {
         
     | 
| 
       192 
     | 
    
         
            -
                        if(this.store.mqttParams.assetIds.length && this.store.mqttParams.varVaule.length) {
         
     | 
| 
       193 
     | 
    
         
            -
                            const assetId = this.store.mqttParams.assetIds[this.store.mqttParams.assetIds.length -1];
         
     | 
| 
       194 
     | 
    
         
            -
                            for(let va = 0; va < this.store.mqttParams.varVaule.length; va++) {
         
     | 
| 
       195 
     | 
    
         
            -
                                this.store.mqttParams.varVaule[va] = `${assetId}_${this.store.mqttParams.varVaule[va]}`;
         
     | 
| 
       196 
     | 
    
         
            -
                            }
         
     | 
| 
       197 
     | 
    
         
            -
                            params.varValueIds = this.store.mqttParams.varVaule.join(",");
         
     | 
| 
       198 
     | 
    
         
            -
                        }else {
         
     | 
| 
       199 
     | 
    
         
            -
                            params.varVaule = this.store.mqttParams.varVaule.join(",");
         
     | 
| 
       200 
     | 
    
         
            -
                        }
         
     | 
| 
       201 
     | 
    
         
            -
                    }
         
     | 
| 
       202 
     | 
    
         
            -
                    return params;
         
     | 
| 
       203 
     | 
    
         
            -
                };
         
     | 
| 
       204 
     | 
    
         
            -
                // 根据图表id数据获取测点数据
         
     | 
| 
       205 
     | 
    
         
            -
                Common.prototype.getTagIdsForEchartsIds = function (data){
         
     | 
| 
       206 
     | 
    
         
            -
                    this.store.mqttParams.echartAssemblyData = data;
         
     | 
| 
       207 
     | 
    
         
            -
                };
         
     | 
| 
       208 
     | 
    
         
            -
                // 根据指标地址数据获取测点数据
         
     | 
| 
       209 
     | 
    
         
            -
                Common.prototype.getTagIdsForKpiAddrs = function (data){
         
     | 
| 
       210 
     | 
    
         
            -
                    let tagIds = [];
         
     | 
| 
       211 
     | 
    
         
            -
                    data.map((item) => {
         
     | 
| 
       212 
     | 
    
         
            -
                        tagIds.push(item.tagId);
         
     | 
| 
       213 
     | 
    
         
            -
                    });
         
     | 
| 
       214 
     | 
    
         
            -
                    this.store.mqttParams.tagIds = tagIds;
         
     | 
| 
       215 
     | 
    
         
            -
                };
         
     | 
| 
       216 
     | 
    
         
            -
                // 获取绑定值类型参数
         
     | 
| 
       217 
     | 
    
         
            -
                Common.prototype.getVarValueIdsForVarData = function (data){
         
     | 
| 
       218 
     | 
    
         
            -
                    const ids = [];
         
     | 
| 
       219 
     | 
    
         
            -
                    data.map((item) => {
         
     | 
| 
       220 
     | 
    
         
            -
                        if(item.varVal) ids.push(item.assetVarIds);
         
     | 
| 
       221 
     | 
    
         
            -
                    })
         
     | 
| 
       222 
     | 
    
         
            -
                    this.store.mqttParams.varVaule = ids;
         
     | 
| 
       223 
     | 
    
         
            -
                };
         
     | 
| 
       224 
     | 
    
         
            -
                Common.prototype.getBranchValueIdsForBranchsData = function (data){
         
     | 
| 
       225 
     | 
    
         
            -
                    const ids = [];
         
     | 
| 
       226 
     | 
    
         
            -
                    data.map((item) => {
         
     | 
| 
       227 
     | 
    
         
            -
                        if(item.branchAddr) ids.push(`${item.assetId}_${item.branchAddr}`);
         
     | 
| 
       228 
     | 
    
         
            -
                    })
         
     | 
| 
       229 
     | 
    
         
            -
                    this.store.mqttParams.branchValue = ids;
         
     | 
| 
       230 
     | 
    
         
            -
                };
         
     | 
| 
       231 
     | 
    
         
            -
                // 固定资产详情数据赋值
         
     | 
| 
       232 
     | 
    
         
            -
                Common.prototype.renderForAssetPoperties = function (asset, data){
         
     | 
| 
       233 
     | 
    
         
            -
                    if(!Object.keys(asset).length) return;
         
     | 
| 
       234 
     | 
    
         
            -
                    data.map((node) => {
         
     | 
| 
       235 
     | 
    
         
            -
                        if (node.data && Array.isArray(node.data) && node.data.length) {
         
     | 
| 
       236 
     | 
    
         
            -
                            node.data.map((item) => {
         
     | 
| 
       237 
     | 
    
         
            -
                                if (item.key === 'assetKey' && asset[item.value]) {
         
     | 
| 
       238 
     | 
    
         
            -
                                    if (['imgUrl', 'principleImg'].includes(item.value)) {
         
     | 
| 
       239 
     | 
    
         
            -
                                        node.text = '';
         
     | 
| 
       240 
     | 
    
         
            -
                                        node.image = `${this.store.mqttParams.pathRewrite}${asset[item.value]}`;
         
     | 
| 
       241 
     | 
    
         
            -
                                    } else {
         
     | 
| 
       242 
     | 
    
         
            -
                                        node.text = asset[item.value];
         
     | 
| 
       243 
     | 
    
         
            -
                                    }
         
     | 
| 
       244 
     | 
    
         
            -
                                }
         
     | 
| 
       245 
     | 
    
         
            -
                            })
         
     | 
| 
       246 
     | 
    
         
            -
                        }
         
     | 
| 
       247 
     | 
    
         
            -
                        if (node.children && node.children.length) {
         
     | 
| 
       248 
     | 
    
         
            -
                            this.renderForAssetPoperties(asset, node.children);
         
     | 
| 
       249 
     | 
    
         
            -
                        }
         
     | 
| 
       250 
     | 
    
         
            -
                    });
         
     | 
| 
       251 
     | 
    
         
            -
                };
         
     | 
| 
       252 
176 
     | 
    
         | 
| 
       253 
177 
     | 
    
         
             
                Common.prototype.conversionData = function (obj) {
         
     | 
| 
       254 
     | 
    
         
            -
                    this. 
     | 
| 
       255 
     | 
    
         
            -
                     
     | 
| 
       256 
     | 
    
         
            -
             
     | 
| 
       257 
     | 
    
         
            -
                     
     | 
| 
      
 178 
     | 
    
         
            +
                    this.parentElem.scrollLeft = 0;
         
     | 
| 
      
 179 
     | 
    
         
            +
                    this.parentElem.scrollTop = 0;
         
     | 
| 
      
 180 
     | 
    
         
            +
                    this.canvas.clearBkImg();
         
     | 
| 
      
 181 
     | 
    
         
            +
                    this.divLayer.clear();
         
     | 
| 
       258 
182 
     | 
    
         
             
                    let data = JSON.parse(JSON.stringify(obj));
         
     | 
| 
       259 
     | 
    
         
            -
                     
     | 
| 
       260 
     | 
    
         
            -
             
     | 
| 
       261 
     | 
    
         
            -
                     
     | 
| 
       262 
     | 
    
         
            -
             
     | 
| 
       263 
     | 
    
         
            -
             
     | 
| 
       264 
     | 
    
         
            -
             
     | 
| 
       265 
     | 
    
         
            -
                         
     | 
| 
       266 
     | 
    
         
            -
                         
     | 
| 
       267 
     | 
    
         
            -
                         
     | 
| 
       268 
     | 
    
         
            -
                    }
         
     | 
| 
       269 
     | 
    
         
            -
                    this.store.data.pens = [];
         
     | 
| 
      
 183 
     | 
    
         
            +
                    if (!data) {
         
     | 
| 
      
 184 
     | 
    
         
            +
                        data = {pens: []};
         
     | 
| 
      
 185 
     | 
    
         
            +
                    }
         
     | 
| 
      
 186 
     | 
    
         
            +
                    Object.assign(this.data, data);
         
     | 
| 
      
 187 
     | 
    
         
            +
                    this.setBKImageRect();
         
     | 
| 
      
 188 
     | 
    
         
            +
                    this.ratioCord = {
         
     | 
| 
      
 189 
     | 
    
         
            +
                        ratio: 1,
         
     | 
| 
      
 190 
     | 
    
         
            +
                        scaleX: 1,
         
     | 
| 
      
 191 
     | 
    
         
            +
                        scaleY: 1
         
     | 
| 
      
 192 
     | 
    
         
            +
                    };
         
     | 
| 
       270 
193 
     | 
    
         
             
                    this.openCount = 0
         
     | 
| 
       271 
     | 
    
         
            -
                     
     | 
| 
      
 194 
     | 
    
         
            +
                    this.data.pens = [];
         
     | 
| 
       272 
195 
     | 
    
         
             
                    // for old data.
         
     | 
| 
       273 
196 
     | 
    
         
             
                    if (data.nodes) {
         
     | 
| 
       274 
197 
     | 
    
         
             
                        for (var _i = 0, _a = data.nodes; _i < _a.length; _i++) {
         
     | 
| 
       275 
     | 
    
         
            -
                             
     | 
| 
       276 
     | 
    
         
            -
                             
     | 
| 
       277 
     | 
    
         
            -
                            this. 
     | 
| 
       278 
     | 
    
         
            -
                            ///this.store.pens[item.id] = item;
         
     | 
| 
       279 
     | 
    
         
            -
                            setConnectionTagForConf(item);
         
     | 
| 
      
 198 
     | 
    
         
            +
                            var item = new Node(_a[_i]);
         
     | 
| 
      
 199 
     | 
    
         
            +
                            this.data.pens.push(item);
         
     | 
| 
      
 200 
     | 
    
         
            +
                            this.setSwitchTabData(item, _i);
         
     | 
| 
       280 
201 
     | 
    
         
             
                        }
         
     | 
| 
       281 
202 
     | 
    
         
             
                        for (var _b = 0, _c = data.lines; _b < _c.length; _b++) {
         
     | 
| 
       282 
     | 
    
         
            -
                            _c[_b] 
     | 
| 
       283 
     | 
    
         
            -
                             
     | 
| 
       284 
     | 
    
         
            -
                            this.store.data.pens.push(item);
         
     | 
| 
       285 
     | 
    
         
            -
                            //this.store.pens[item.id] = item;
         
     | 
| 
      
 203 
     | 
    
         
            +
                            var item = _c[_b];
         
     | 
| 
      
 204 
     | 
    
         
            +
                            this.data.pens.push(new Line(item));
         
     | 
| 
       286 
205 
     | 
    
         
             
                        }
         
     | 
| 
       287 
206 
     | 
    
         
             
                    }
         
     | 
| 
       288 
207 
     | 
    
         
             
                    // end.
         
     | 
| 
       289 
208 
     | 
    
         
             
                    if (data.pens) {
         
     | 
| 
       290 
209 
     | 
    
         
             
                        for (var _d = 0, _e = data.pens; _d < _e.length; _d++) {
         
     | 
| 
       291 
     | 
    
         
            -
                             
     | 
| 
      
 210 
     | 
    
         
            +
                            var item = _e[_d];
         
     | 
| 
       292 
211 
     | 
    
         
             
                            if (!item.from) {
         
     | 
| 
       293 
     | 
    
         
            -
                                 
     | 
| 
       294 
     | 
    
         
            -
                                 
     | 
| 
       295 
     | 
    
         
            -
                                this. 
     | 
| 
       296 
     | 
    
         
            -
                                //this.store.pens[item.id] = node;
         
     | 
| 
       297 
     | 
    
         
            -
                                setConnectionTagForConf(node);
         
     | 
| 
      
 212 
     | 
    
         
            +
                                var node = new Node(item);
         
     | 
| 
      
 213 
     | 
    
         
            +
                                this.data.pens.push(node);
         
     | 
| 
      
 214 
     | 
    
         
            +
                                this.setSwitchTabData(node, _d);
         
     | 
| 
       298 
215 
     | 
    
         
             
                            } else {
         
     | 
| 
       299 
     | 
    
         
            -
                                 
     | 
| 
       300 
     | 
    
         
            -
                                this.store.data.pens.push(linNode);
         
     | 
| 
       301 
     | 
    
         
            -
                                //this.store.pens[item.id] = linNode;
         
     | 
| 
      
 216 
     | 
    
         
            +
                                this.data.pens.push(new Line(item));
         
     | 
| 
       302 
217 
     | 
    
         
             
                            }
         
     | 
| 
       303 
218 
     | 
    
         
             
                        }
         
     | 
| 
       304 
219 
     | 
    
         
             
                    }
         
     | 
| 
       305 
220 
     | 
    
         
             
                };
         
     | 
| 
       306 
     | 
    
         
            -
                Common.prototype. 
     | 
| 
       307 
     | 
    
         
            -
                     
     | 
| 
       308 
     | 
    
         
            -
             
     | 
| 
       309 
     | 
    
         
            -
             
     | 
| 
       310 
     | 
    
         
            -
             
     | 
| 
       311 
     | 
    
         
            -
             
     | 
| 
       312 
     | 
    
         
            -
             
     | 
| 
       313 
     | 
    
         
            -
             
     | 
| 
       314 
     | 
    
         
            -
             
     | 
| 
       315 
     | 
    
         
            -
                         
     | 
| 
       316 
     | 
    
         
            -
                        //this.canvas.bkImgRectResize(size);
         
     | 
| 
       317 
     | 
    
         
            -
                        this.offscreen.resize(size);
         
     | 
| 
       318 
     | 
    
         
            -
                        this.divLayer.resize(size);
         
     | 
| 
       319 
     | 
    
         
            -
                    }catch (err) {
         
     | 
| 
       320 
     | 
    
         
            -
                        //console.log('resize-----', err)
         
     | 
| 
      
 221 
     | 
    
         
            +
                Common.prototype.setBKImageRect = function () {
         
     | 
| 
      
 222 
     | 
    
         
            +
                    if (this.data.bkImageRect) {
         
     | 
| 
      
 223 
     | 
    
         
            +
                        this.data.bkImageRect.x = this.data.bkImageRect.x ? Number(this.data.bkImageRect.x) : 0;
         
     | 
| 
      
 224 
     | 
    
         
            +
                        this.data.bkImageRect.y = this.data.bkImageRect.y ? Number(this.data.bkImageRect.y) : 0;
         
     | 
| 
      
 225 
     | 
    
         
            +
                        this.data.bkImageRect.width = this.data.bkImageRect.width ? Number(this.data.bkImageRect.width) : this.canvas.width;
         
     | 
| 
      
 226 
     | 
    
         
            +
                        this.data.bkImageRect.height = this.data.bkImageRect.height ? Number(this.data.bkImageRect.height) : this.canvas.height;
         
     | 
| 
      
 227 
     | 
    
         
            +
                        this.data.bkImageRect.center = {
         
     | 
| 
      
 228 
     | 
    
         
            +
                            x: this.data.bkImageRect.x + this.data.bkImageRect.width / 2,
         
     | 
| 
      
 229 
     | 
    
         
            +
                            y: this.data.bkImageRect.y + this.data.bkImageRect.height / 2
         
     | 
| 
      
 230 
     | 
    
         
            +
                        }
         
     | 
| 
       321 
231 
     | 
    
         
             
                    }
         
     | 
| 
       322 
232 
     | 
    
         
             
                };
         
     | 
| 
       323 
     | 
    
         
            -
                 
     | 
| 
       324 
     | 
    
         
            -
             
     | 
| 
       325 
     | 
    
         
            -
             
     | 
| 
       326 
     | 
    
         
            -
                         
     | 
| 
       327 
     | 
    
         
            -
             
     | 
| 
       328 
     | 
    
         
            -
             
     | 
| 
       329 
     | 
    
         
            -
                             
     | 
| 
       330 
     | 
    
         
            -
             
     | 
| 
      
 233 
     | 
    
         
            +
                Common.prototype.setSwitchTabData = function (node, index, type) {
         
     | 
| 
      
 234 
     | 
    
         
            +
                    if (type) {
         
     | 
| 
      
 235 
     | 
    
         
            +
                        let topologyChangeData = Store.get('TCD:topologyChangeData');
         
     | 
| 
      
 236 
     | 
    
         
            +
                        if (topologyChangeData) {
         
     | 
| 
      
 237 
     | 
    
         
            +
                            const switchTabData = node.tags.find((t) => {
         
     | 
| 
      
 238 
     | 
    
         
            +
                                return t.includes('switchTabType');
         
     | 
| 
      
 239 
     | 
    
         
            +
                            });
         
     | 
| 
      
 240 
     | 
    
         
            +
                            const switchTabTypeData = topologyChangeData[`${switchTabData}Data`];
         
     | 
| 
      
 241 
     | 
    
         
            +
                            if (switchTabTypeData) {
         
     | 
| 
      
 242 
     | 
    
         
            +
                                delete switchTabTypeData[node.id];
         
     | 
| 
      
 243 
     | 
    
         
            +
                                for (let switchNode of Object.values(switchTabTypeData)) {
         
     | 
| 
      
 244 
     | 
    
         
            +
                                    if (switchNode.tagOrder > index) switchNode.tagOrder--;
         
     | 
| 
      
 245 
     | 
    
         
            +
                                }
         
     | 
| 
       331 
246 
     | 
    
         
             
                            }
         
     | 
| 
       332 
     | 
    
         
            -
                            _this.renderTimer = requestAnimationFrame(_this.render);
         
     | 
| 
       333 
     | 
    
         
            -
             
     | 
| 
       334 
     | 
    
         
            -
                            return;
         
     | 
| 
       335 
247 
     | 
    
         
             
                        }
         
     | 
| 
       336 
     | 
    
         
            -
                         
     | 
| 
       337 
     | 
    
         
            -
             
     | 
| 
       338 
     | 
    
         
            -
             
     | 
| 
       339 
     | 
    
         
            -
             
     | 
| 
      
 248 
     | 
    
         
            +
                        return;
         
     | 
| 
      
 249 
     | 
    
         
            +
                    }
         
     | 
| 
      
 250 
     | 
    
         
            +
                    if (node.tags && node.tags.length > 0) {
         
     | 
| 
      
 251 
     | 
    
         
            +
                        const tagTypeData = node.tags.find((t) => {
         
     | 
| 
      
 252 
     | 
    
         
            +
                            return t === 'statisticType' || t.includes('switchTabType');
         
     | 
| 
      
 253 
     | 
    
         
            +
                        });
         
     | 
| 
      
 254 
     | 
    
         
            +
                        if (tagTypeData) {
         
     | 
| 
      
 255 
     | 
    
         
            +
                            node.tagOrder = index;
         
     | 
| 
      
 256 
     | 
    
         
            +
                            let topologyChangeData = Store.get('TCD:topologyChangeData');
         
     | 
| 
      
 257 
     | 
    
         
            +
                            if (!topologyChangeData) topologyChangeData = {};
         
     | 
| 
      
 258 
     | 
    
         
            +
                            if (!topologyChangeData[`${tagTypeData}Data`]) topologyChangeData[`${tagTypeData}Data`] = {};
         
     | 
| 
      
 259 
     | 
    
         
            +
                            topologyChangeData[`${tagTypeData}Data`][node.id] = node;
         
     | 
| 
      
 260 
     | 
    
         
            +
                            Store.set('TCD:topologyChangeData', topologyChangeData);
         
     | 
| 
       340 
261 
     | 
    
         
             
                        }
         
     | 
| 
       341 
     | 
    
         
            -
                        this.rendering = true;
         
     | 
| 
       342 
     | 
    
         
            -
                        this.offscreen.render();
         
     | 
| 
       343 
     | 
    
         
            -
                        this.canvas.render();
         
     | 
| 
       344 
     | 
    
         
            -
                        this.rendering = false;
         
     | 
| 
       345 
     | 
    
         
            -
                    }catch (e) {
         
     | 
| 
       346 
     | 
    
         
            -
                        //console.log(e)
         
     | 
| 
       347 
262 
     | 
    
         
             
                    }
         
     | 
| 
       348 
263 
     | 
    
         
             
                };
         
     | 
| 
      
 264 
     | 
    
         
            +
                Common.prototype.canvasResize = function (size) {
         
     | 
| 
      
 265 
     | 
    
         
            +
                    this.canvas.resize(size);
         
     | 
| 
      
 266 
     | 
    
         
            +
                    //this.canvas.bkImgRectResize(size);
         
     | 
| 
      
 267 
     | 
    
         
            +
                    this.offscreen.resize(size);
         
     | 
| 
      
 268 
     | 
    
         
            +
                    this.divLayer.resize(size);
         
     | 
| 
      
 269 
     | 
    
         
            +
                };
         
     | 
| 
      
 270 
     | 
    
         
            +
                // Render or redraw
         
     | 
| 
      
 271 
     | 
    
         
            +
                Common.prototype.render = function (noFocus) {
         
     | 
| 
      
 272 
     | 
    
         
            +
                    if (this.rendering) {
         
     | 
| 
      
 273 
     | 
    
         
            +
                        return this;
         
     | 
| 
      
 274 
     | 
    
         
            +
                    }
         
     | 
| 
      
 275 
     | 
    
         
            +
                    this.rendering = true;
         
     | 
| 
      
 276 
     | 
    
         
            +
                    this.offscreen.render();
         
     | 
| 
      
 277 
     | 
    
         
            +
                    this.canvas.render();
         
     | 
| 
      
 278 
     | 
    
         
            +
                    this.rendering = false;
         
     | 
| 
      
 279 
     | 
    
         
            +
                };
         
     | 
| 
       349 
280 
     | 
    
         
             
                Common.prototype.generateStoreKey = function (key) {
         
     | 
| 
       350 
281 
     | 
    
         
             
                    return this.id + "-" + key;
         
     | 
| 
       351 
282 
     | 
    
         
             
                };
         
     | 
| 
         @@ -427,7 +358,7 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       427 
358 
     | 
    
         
             
                    this.pagenationPageInput.style.left = node.paginationData.targetPageLocal.x + 'px';
         
     | 
| 
       428 
359 
     | 
    
         
             
                    this.pagenationPageInput.style.top = node.paginationData.targetPageLocal.y + 'px';
         
     | 
| 
       429 
360 
     | 
    
         
             
                    this.pagenationPageInput.style.height = node.rect.height + 'px';
         
     | 
| 
       430 
     | 
    
         
            -
                    this. 
     | 
| 
      
 361 
     | 
    
         
            +
                    this.parentElem.appendChild(this.pagenationPageInput);
         
     | 
| 
       431 
362 
     | 
    
         
             
                };
         
     | 
| 
       432 
363 
     | 
    
         
             
                // 展开分页列表
         
     | 
| 
       433 
364 
     | 
    
         
             
                Common.prototype.spreadPageListHandle = function (node, e) {
         
     | 
| 
         @@ -461,65 +392,116 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       461 
392 
     | 
    
         
             
                };
         
     | 
| 
       462 
393 
     | 
    
         
             
                // 获取表格分页数据
         
     | 
| 
       463 
394 
     | 
    
         
             
                Common.prototype.getSyncTableDataFromServer = async function (data, node) {
         
     | 
| 
       464 
     | 
    
         
            -
                     
     | 
| 
       465 
     | 
    
         
            -
                     
     | 
| 
       466 
     | 
    
         
            -
                    // 
     | 
| 
       467 
     | 
    
         
            -
                     
     | 
| 
       468 
     | 
    
         
            -
                     
     | 
| 
       469 
     | 
    
         
            -
                     
     | 
| 
       470 
     | 
    
         
            -
                     
     | 
| 
       471 
     | 
    
         
            -
             
     | 
| 
       472 
     | 
    
         
            -
             
     | 
| 
       473 
     | 
    
         
            -
             
     | 
| 
       474 
     | 
    
         
            -
             
     | 
| 
       475 
     | 
    
         
            -
             
     | 
| 
       476 
     | 
    
         
            -
             
     | 
| 
       477 
     | 
    
         
            -
             
     | 
| 
       478 
     | 
    
         
            -
             
     | 
| 
       479 
     | 
    
         
            -
                     
     | 
| 
       480 
     | 
    
         
            -
                     
     | 
| 
       481 
     | 
    
         
            -
             
     | 
| 
       482 
     | 
    
         
            -
                     
     | 
| 
       483 
     | 
    
         
            -
             
     | 
| 
       484 
     | 
    
         
            -
                     
     | 
| 
      
 395 
     | 
    
         
            +
                    const path = this.pathRewrite ? this.pathRewrite + '/user/cockpit/mqtt-echart' : '/user/cockpit/mqtt-echart';
         
     | 
| 
      
 396 
     | 
    
         
            +
                    const ret = await axios.post(path, data);
         
     | 
| 
      
 397 
     | 
    
         
            +
                    //console.log('ret.data==========', ret, ret.data)
         
     | 
| 
      
 398 
     | 
    
         
            +
                    const tableData = {};
         
     | 
| 
      
 399 
     | 
    
         
            +
                    tableData[node.id] = {loading: true};
         
     | 
| 
      
 400 
     | 
    
         
            +
                    Store.set('SYNC:tableData', tableData);
         
     | 
| 
      
 401 
     | 
    
         
            +
                    if (ret.data && ret.data.data) {
         
     | 
| 
      
 402 
     | 
    
         
            +
                        console.log(ret.data.data)
         
     | 
| 
      
 403 
     | 
    
         
            +
                        tableData[node.id] = {
         
     | 
| 
      
 404 
     | 
    
         
            +
                            loading: false,
         
     | 
| 
      
 405 
     | 
    
         
            +
                            tableBody: ret.data.data.rows,
         
     | 
| 
      
 406 
     | 
    
         
            +
                            total: ret.data.data.total
         
     | 
| 
      
 407 
     | 
    
         
            +
                        }
         
     | 
| 
      
 408 
     | 
    
         
            +
                        Store.set('SYNC:tableData', tableData);
         
     | 
| 
      
 409 
     | 
    
         
            +
                        this.render();
         
     | 
| 
      
 410 
     | 
    
         
            +
                    }
         
     | 
| 
      
 411 
     | 
    
         
            +
                    if (ret.error) {
         
     | 
| 
      
 412 
     | 
    
         
            +
                        console.log('获取数据失败==================')
         
     | 
| 
      
 413 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 414 
     | 
    
         
            +
                        console.log('获取数据成功==================')
         
     | 
| 
      
 415 
     | 
    
         
            +
                    }
         
     | 
| 
      
 416 
     | 
    
         
            +
             
     | 
| 
       485 
417 
     | 
    
         
             
                };
         
     | 
| 
       486 
418 
     | 
    
         
             
                Common.prototype.switchStaticsCheckType = function (node, staticTypeNode) {
         
     | 
| 
       487 
     | 
    
         
            -
                    const staticType = staticTypeNode.dcimStaticForType;
         
     | 
| 
       488 
     | 
    
         
            -
                    if(!staticType || staticType === 'NONE') return;
         
     | 
| 
       489 
419 
     | 
    
         
             
                    // 点击切换统计图统计类别
         
     | 
| 
       490 
420 
     | 
    
         
             
                    const switchTabData = node.tags.find((t) => {
         
     | 
| 
       491 
421 
     | 
    
         
             
                        return t.includes('switchTabType');
         
     | 
| 
       492 
422 
     | 
    
         
             
                    }); // 获取按钮组类型
         
     | 
| 
       493 
423 
     | 
    
         
             
                    if(!switchTabData) return;
         
     | 
| 
       494 
     | 
    
         
            -
                    const topologyChangeData =  
     | 
| 
      
 424 
     | 
    
         
            +
                    const topologyChangeData = Store.get('TCD:topologyChangeData'); // 获取所有按钮组和按类型统计图组数据
         
     | 
| 
       495 
425 
     | 
    
         
             
                    const changeNode = topologyChangeData[`${switchTabData}Data`]; // 分别获取按钮组数据
         
     | 
| 
       496 
     | 
    
         
            -
                    if(!changeNode || !changeNode[node.id]) return;
         
     | 
| 
       497 
426 
     | 
    
         
             
                    // 如果存在按钮组节点数据
         
     | 
| 
       498 
     | 
    
         
            -
                     
     | 
| 
       499 
     | 
    
         
            -
             
     | 
| 
       500 
     | 
    
         
            -
             
     | 
| 
       501 
     | 
    
         
            -
             
     | 
| 
       502 
     | 
    
         
            -
             
     | 
| 
       503 
     | 
    
         
            -
             
     | 
| 
       504 
     | 
    
         
            -
             
     | 
| 
       505 
     | 
    
         
            -
             
     | 
| 
       506 
     | 
    
         
            -
                        const  
     | 
| 
       507 
     | 
    
         
            -
                        if(! 
     | 
| 
       508 
     | 
    
         
            -
             
     | 
| 
       509 
     | 
    
         
            -
             
     | 
| 
       510 
     | 
    
         
            -
             
     | 
| 
       511 
     | 
    
         
            -
             
     | 
| 
       512 
     | 
    
         
            -
             
     | 
| 
       513 
     | 
    
         
            -
                         
     | 
| 
       514 
     | 
    
         
            -
                    }
         
     | 
| 
       515 
     | 
    
         
            -
                    // 对绑定的图表进行数据处理
         
     | 
| 
       516 
     | 
    
         
            -
                    tabStaticOperation(staticType, node, tabAreaData, visitParams);
         
     | 
| 
       517 
     | 
    
         
            -
                    this.store.data.dataResize = 1;
         
     | 
| 
      
 427 
     | 
    
         
            +
                    if (changeNode[node.id]) {
         
     | 
| 
      
 428 
     | 
    
         
            +
                        for (let switchNode of Object.values(changeNode)) {
         
     | 
| 
      
 429 
     | 
    
         
            +
                            if (this.data.pens[switchNode.tagOrder]) {
         
     | 
| 
      
 430 
     | 
    
         
            +
                                this.data.pens[switchNode.tagOrder].activeImgeIndex = switchNode.id !== node.id;
         
     | 
| 
      
 431 
     | 
    
         
            +
                            }
         
     | 
| 
      
 432 
     | 
    
         
            +
                        }
         
     | 
| 
      
 433 
     | 
    
         
            +
                    }
         
     | 
| 
      
 434 
     | 
    
         
            +
                    if (node.bindStaticId) {
         
     | 
| 
      
 435 
     | 
    
         
            +
                        const statisticTypeData = topologyChangeData.statisticTypeData;
         
     | 
| 
      
 436 
     | 
    
         
            +
                        if(!statisticTypeData) return;
         
     | 
| 
      
 437 
     | 
    
         
            +
                        const findCurentEchart = statisticTypeData[node.bindStaticId]; // 获取当前点中的节点绑定的统计图表数据
         
     | 
| 
      
 438 
     | 
    
         
            +
                        if (findCurentEchart && findCurentEchart.data.params) {
         
     | 
| 
      
 439 
     | 
    
         
            +
                            findCurentEchart.data.params['staticForType'] = staticTypeNode.dcimStaticForType; // 统计类型赋值
         
     | 
| 
      
 440 
     | 
    
         
            +
                            const mqttSyncData = Store.get('mqtt:responseData');
         
     | 
| 
      
 441 
     | 
    
         
            +
                            if (mqttSyncData) setConfItemNode(findCurentEchart, mqttSyncData);
         
     | 
| 
      
 442 
     | 
    
         
            +
                        }
         
     | 
| 
      
 443 
     | 
    
         
            +
                    }
         
     | 
| 
       518 
444 
     | 
    
         
             
                    this.render();
         
     | 
| 
       519 
445 
     | 
    
         
             
                };
         
     | 
| 
       520 
446 
     | 
    
         
             
                Common.prototype.s8 = function () {
         
     | 
| 
       521 
447 
     | 
    
         
             
                    return s8()
         
     | 
| 
       522 
448 
     | 
    
         
             
                };
         
     | 
| 
      
 449 
     | 
    
         
            +
                Common.prototype.openSocket = function (url) {
         
     | 
| 
      
 450 
     | 
    
         
            +
                    this.closeSocket();
         
     | 
| 
      
 451 
     | 
    
         
            +
                    if (url || this.data.websocket) {
         
     | 
| 
      
 452 
     | 
    
         
            +
                        this.socket = new Socket(url || this.data.websocket, this.data);
         
     | 
| 
      
 453 
     | 
    
         
            +
                    }
         
     | 
| 
      
 454 
     | 
    
         
            +
                };
         
     | 
| 
      
 455 
     | 
    
         
            +
                Common.prototype.closeSocket = function () {
         
     | 
| 
      
 456 
     | 
    
         
            +
                    if (this.socket) {
         
     | 
| 
      
 457 
     | 
    
         
            +
                        this.socket.close();
         
     | 
| 
      
 458 
     | 
    
         
            +
                    }
         
     | 
| 
      
 459 
     | 
    
         
            +
                };
         
     | 
| 
      
 460 
     | 
    
         
            +
                Common.prototype.openMqtt = function (url, options) {
         
     | 
| 
      
 461 
     | 
    
         
            +
                    this.closeMqtt();
         
     | 
| 
      
 462 
     | 
    
         
            +
                    if (url || this.data.mqttUrl) {
         
     | 
| 
      
 463 
     | 
    
         
            +
                        url = url || this.data.mqttUrl;
         
     | 
| 
      
 464 
     | 
    
         
            +
                        const mqttTopics = this.initData && this.initData.mqttTopics ? this.initData.mqttTopics : this.data.mqttTopics;
         
     | 
| 
      
 465 
     | 
    
         
            +
                        options = options || this.data.mqttOptions
         
     | 
| 
      
 466 
     | 
    
         
            +
                        let topics = mqttTopics
         
     | 
| 
      
 467 
     | 
    
         
            +
                        this.isEnd = false;
         
     | 
| 
      
 468 
     | 
    
         
            +
                        // let num = 0; // 记录推送的次数,用于判单丢失情况
         
     | 
| 
      
 469 
     | 
    
         
            +
                        this.mqttClient = mqtt.connect(url, options);
         
     | 
| 
      
 470 
     | 
    
         
            +
                        var _this = this;
         
     | 
| 
      
 471 
     | 
    
         
            +
                        this.mqttClient.on('message', function (topic, message) {
         
     | 
| 
      
 472 
     | 
    
         
            +
                            //console.log('openMqtt11===================', topic, message)
         
     | 
| 
      
 473 
     | 
    
         
            +
                            if (!_this.data.pens.length || !topic || topic != _this.data.mqttTopics) {
         
     | 
| 
      
 474 
     | 
    
         
            +
                                return;
         
     | 
| 
      
 475 
     | 
    
         
            +
                            }
         
     | 
| 
      
 476 
     | 
    
         
            +
                            if (!this.isEnd) {
         
     | 
| 
      
 477 
     | 
    
         
            +
                                _this.doMqttDrow(message.toString())
         
     | 
| 
      
 478 
     | 
    
         
            +
                            }
         
     | 
| 
      
 479 
     | 
    
         
            +
                        });
         
     | 
| 
      
 480 
     | 
    
         
            +
                        if (topics) {
         
     | 
| 
      
 481 
     | 
    
         
            +
                            this.mqttClient.subscribe(topics.split(','));
         
     | 
| 
      
 482 
     | 
    
         
            +
                        }
         
     | 
| 
      
 483 
     | 
    
         
            +
                    }
         
     | 
| 
      
 484 
     | 
    
         
            +
                };
         
     | 
| 
      
 485 
     | 
    
         
            +
                Common.prototype.openPoll = function (message, val) {
         
     | 
| 
      
 486 
     | 
    
         
            +
                    if (message) {
         
     | 
| 
      
 487 
     | 
    
         
            +
                        this.poll = new POLL(this.data, message, val);
         
     | 
| 
      
 488 
     | 
    
         
            +
                    }
         
     | 
| 
      
 489 
     | 
    
         
            +
                };
         
     | 
| 
      
 490 
     | 
    
         
            +
                Common.prototype.clearInterValAll = function () {
         
     | 
| 
      
 491 
     | 
    
         
            +
                    clearTimeout(this.timmerByTopology);
         
     | 
| 
      
 492 
     | 
    
         
            +
                    this.timmerByTopology = null;
         
     | 
| 
      
 493 
     | 
    
         
            +
                };
         
     | 
| 
      
 494 
     | 
    
         
            +
                Common.prototype.closeMqtt = function () {
         
     | 
| 
      
 495 
     | 
    
         
            +
                    if (this.mqttClient) {
         
     | 
| 
      
 496 
     | 
    
         
            +
                        this.isEnd = true
         
     | 
| 
      
 497 
     | 
    
         
            +
                        this.mqttClient.end();
         
     | 
| 
      
 498 
     | 
    
         
            +
                    }
         
     | 
| 
      
 499 
     | 
    
         
            +
                };
         
     | 
| 
      
 500 
     | 
    
         
            +
                Common.prototype.closePoll = function () {
         
     | 
| 
      
 501 
     | 
    
         
            +
                    for (let key in this.pollTime) {
         
     | 
| 
      
 502 
     | 
    
         
            +
                        clearInterval(this.pollTime[key])
         
     | 
| 
      
 503 
     | 
    
         
            +
                    }
         
     | 
| 
      
 504 
     | 
    
         
            +
                };
         
     | 
| 
       523 
505 
     | 
    
         
             
                Common.prototype.setNodeText = function () {
         
     | 
| 
       524 
506 
     | 
    
         
             
                    this.inputObj.text = this.input.value;
         
     | 
| 
       525 
507 
     | 
    
         
             
                    this.input.style.zIndex = '-1';
         
     | 
| 
         @@ -530,10 +512,10 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       530 
512 
     | 
    
         
             
                    this.inputObj = null;
         
     | 
| 
       531 
513 
     | 
    
         
             
                };
         
     | 
| 
       532 
514 
     | 
    
         
             
                Common.prototype.showInput = function (item) {
         
     | 
| 
       533 
     | 
    
         
            -
                    if (this. 
     | 
| 
      
 515 
     | 
    
         
            +
                    if (this.data.locked ||
         
     | 
| 
       534 
516 
     | 
    
         
             
                            item.locked ||
         
     | 
| 
       535 
517 
     | 
    
         
             
                            item.hideInput ||
         
     | 
| 
       536 
     | 
    
         
            -
                            this. 
     | 
| 
      
 518 
     | 
    
         
            +
                            this.options.hideInput) {
         
     | 
| 
       537 
519 
     | 
    
         
             
                        return;
         
     | 
| 
       538 
520 
     | 
    
         
             
                    }
         
     | 
| 
       539 
521 
     | 
    
         
             
                    this.inputObj = item;
         
     | 
| 
         @@ -552,9 +534,9 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       552 
534 
     | 
    
         
             
                    this.input.focus();
         
     | 
| 
       553 
535 
     | 
    
         
             
                };
         
     | 
| 
       554 
536 
     | 
    
         
             
                Common.prototype.getRect = function (pens) {
         
     | 
| 
       555 
     | 
    
         
            -
                    if (!this. 
     | 
| 
      
 537 
     | 
    
         
            +
                    if (!this.data) return;
         
     | 
| 
       556 
538 
     | 
    
         
             
                    if (!pens) {
         
     | 
| 
       557 
     | 
    
         
            -
                        pens = this. 
     | 
| 
      
 539 
     | 
    
         
            +
                        pens = this.data.pens;
         
     | 
| 
       558 
540 
     | 
    
         
             
                    }
         
     | 
| 
       559 
541 
     | 
    
         
             
                    return getRect(pens);
         
     | 
| 
       560 
542 
     | 
    
         
             
                };
         
     | 
| 
         @@ -572,7 +554,7 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       572 
554 
     | 
    
         
             
                    }
         
     | 
| 
       573 
555 
     | 
    
         
             
                    var offsetX = x - this.lastTranlated.x;
         
     | 
| 
       574 
556 
     | 
    
         
             
                    var offsetY = y - this.lastTranlated.y;
         
     | 
| 
       575 
     | 
    
         
            -
                    for (var _i = 0, _a = this. 
     | 
| 
      
 557 
     | 
    
         
            +
                    for (var _i = 0, _a = this.data.pens; _i < _a.length; _i++) {
         
     | 
| 
       576 
558 
     | 
    
         
             
                        var item = _a[_i];
         
     | 
| 
       577 
559 
     | 
    
         
             
                        item.translate(offsetX, offsetY);
         
     | 
| 
       578 
560 
     | 
    
         
             
                    }
         
     | 
| 
         @@ -591,7 +573,7 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       591 
573 
     | 
    
         
             
                    var viewCenter = this.getViewCenter(padding);
         
     | 
| 
       592 
574 
     | 
    
         
             
                    var center = rect.center;
         
     | 
| 
       593 
575 
     | 
    
         
             
                    this.translate(viewCenter.x - center.x, viewCenter.y - center.y);
         
     | 
| 
       594 
     | 
    
         
            -
                    var parentElem = this. 
     | 
| 
      
 576 
     | 
    
         
            +
                    var parentElem = this.canvas.parentElem;
         
     | 
| 
       595 
577 
     | 
    
         
             
                    var x = (parentElem.scrollWidth - parentElem.offsetWidth) / 2;
         
     | 
| 
       596 
578 
     | 
    
         
             
                    var y = (parentElem.scrollHeight - parentElem.offsetHeight) / 2;
         
     | 
| 
       597 
579 
     | 
    
         
             
                    parentElem.scrollTo(x, y);
         
     | 
| 
         @@ -602,7 +584,7 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       602 
584 
     | 
    
         
             
                    return !(rect.width === 99999 || rect.height === 99999);
         
     | 
| 
       603 
585 
     | 
    
         
             
                };
         
     | 
| 
       604 
586 
     | 
    
         
             
                Common.prototype.getViewCenter = function (viewPadding) {
         
     | 
| 
       605 
     | 
    
         
            -
                    var padding = formatPadding(viewPadding || this. 
     | 
| 
      
 587 
     | 
    
         
            +
                    var padding = formatPadding(viewPadding || this.options.viewPadding);
         
     | 
| 
       606 
588 
     | 
    
         
             
                    var _a = this.canvas, width = _a.width, height = _a.height;
         
     | 
| 
       607 
589 
     | 
    
         
             
                    return {
         
     | 
| 
       608 
590 
     | 
    
         
             
                        x: (width - padding[1] - padding[3]) / 2 + padding[3],
         
     | 
| 
         @@ -666,7 +648,7 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       666 
648 
     | 
    
         
             
                    }
         
     | 
| 
       667 
649 
     | 
    
         
             
                    var tipMarkdownMarginLeft = count * 3 + 11
         
     | 
| 
       668 
650 
     | 
    
         | 
| 
       669 
     | 
    
         
            -
                    var parentRect = this. 
     | 
| 
      
 651 
     | 
    
         
            +
                    var parentRect = this.parentElem.getBoundingClientRect();
         
     | 
| 
       670 
652 
     | 
    
         
             
                    var elemRect = elem.getBoundingClientRect();
         
     | 
| 
       671 
653 
     | 
    
         
             
                    var x = parentRect.left + dataRect.x;
         
     | 
| 
       672 
654 
     | 
    
         
             
                    var y = pos.y + parentRect.top;
         
     | 
| 
         @@ -674,8 +656,8 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       674 
656 
     | 
    
         
             
                        x = x + dataRect.width / 2 - tipMarkdownMarginLeft
         
     | 
| 
       675 
657 
     | 
    
         
             
                        y = parentRect.top + dataRect.ey - dataRect.height - 46
         
     | 
| 
       676 
658 
     | 
    
         
             
                    }
         
     | 
| 
       677 
     | 
    
         
            -
                    x -= this. 
     | 
| 
       678 
     | 
    
         
            -
                    y -= this. 
     | 
| 
      
 659 
     | 
    
         
            +
                    x -= this.parentElem.scrollLeft;
         
     | 
| 
      
 660 
     | 
    
         
            +
                    y -= this.parentElem.scrollTop;
         
     | 
| 
       679 
661 
     | 
    
         
             
                    if (x < 0) {
         
     | 
| 
       680 
662 
     | 
    
         
             
                        x = 0;
         
     | 
| 
       681 
663 
     | 
    
         
             
                    }
         
     | 
| 
         @@ -706,91 +688,461 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       706 
688 
     | 
    
         
             
                    this.divLayer.canvas.title = '';
         
     | 
| 
       707 
689 
     | 
    
         
             
                    this.tip = '';
         
     | 
| 
       708 
690 
     | 
    
         
             
                };
         
     | 
| 
       709 
     | 
    
         
            -
                Common.prototype.dispatch = function (event,  
     | 
| 
       710 
     | 
    
         
            -
                    if( 
     | 
| 
       711 
     | 
    
         
            -
             
     | 
| 
       712 
     | 
    
         
            -
             
     | 
| 
       713 
     | 
    
         
            -
                     
     | 
| 
       714 
     | 
    
         
            -
             
     | 
| 
       715 
     | 
    
         
            -
             
     | 
| 
       716 
     | 
    
         
            -
             
     | 
| 
       717 
     | 
    
         
            -
             
     | 
| 
       718 
     | 
    
         
            -
             
     | 
| 
       719 
     | 
    
         
            -
             
     | 
| 
       720 
     | 
    
         
            -
             
     | 
| 
       721 
     | 
    
         
            -
             
     | 
| 
       722 
     | 
    
         
            -
             
     | 
| 
       723 
     | 
    
         
            -
                     
     | 
| 
       724 
     | 
    
         
            -
             
     | 
| 
      
 691 
     | 
    
         
            +
                Common.prototype.dispatch = function (event, data) {
         
     | 
| 
      
 692 
     | 
    
         
            +
                    if (this.options.on) {
         
     | 
| 
      
 693 
     | 
    
         
            +
                        this.options.on(event, data);
         
     | 
| 
      
 694 
     | 
    
         
            +
                    }
         
     | 
| 
      
 695 
     | 
    
         
            +
                    if (event === 'node' && data.name == 'tablePagination' && this.options.type !== 'topology') {
         
     | 
| 
      
 696 
     | 
    
         
            +
                        const tableNodes = Store.get('FORM:tableData').data.tableNodes[data.paginationData.bindFromTableId];
         
     | 
| 
      
 697 
     | 
    
         
            +
                        const pageSize = data.paginationData.pageSize;
         
     | 
| 
      
 698 
     | 
    
         
            +
                        const offset = (parseInt(data.paginationData.pageNumber) - 1) * pageSize;
         
     | 
| 
      
 699 
     | 
    
         
            +
                        const params = {
         
     | 
| 
      
 700 
     | 
    
         
            +
                            id: tableNodes.id, // 表格ID
         
     | 
| 
      
 701 
     | 
    
         
            +
                            limit: data.paginationData.pageSize,
         
     | 
| 
      
 702 
     | 
    
         
            +
                            offset: offset
         
     | 
| 
      
 703 
     | 
    
         
            +
                        };
         
     | 
| 
      
 704 
     | 
    
         
            +
                        this.getSyncTableDataFromServer(params, tableNodes);
         
     | 
| 
      
 705 
     | 
    
         
            +
                    }
         
     | 
| 
      
 706 
     | 
    
         
            +
                };
         
     | 
| 
      
 707 
     | 
    
         
            +
                Common.prototype.onContent = async function (resetDCIM, data, type) {
         
     | 
| 
      
 708 
     | 
    
         
            +
                    //this.shareComponentData = data.shareComponent // 共享组件数据
         
     | 
| 
      
 709 
     | 
    
         
            +
                    if (resetDCIM) {
         
     | 
| 
      
 710 
     | 
    
         
            +
                        if (resetDCIM.pathRewrite != '') {
         
     | 
| 
      
 711 
     | 
    
         
            +
                            this.pathRewrite = resetDCIM.pathRewrite // 路径重写
         
     | 
| 
      
 712 
     | 
    
         
            +
                        }
         
     | 
| 
      
 713 
     | 
    
         
            +
                        if (resetDCIM.mqttUrl) {
         
     | 
| 
      
 714 
     | 
    
         
            +
                            data.mqttUrl = resetDCIM.mqttUrl
         
     | 
| 
      
 715 
     | 
    
         
            +
                            data.mqttOptions.username = resetDCIM.mqttUsername
         
     | 
| 
      
 716 
     | 
    
         
            +
                            data.mqttOptions.password = resetDCIM.mqttPassword
         
     | 
| 
      
 717 
     | 
    
         
            +
                        }
         
     | 
| 
      
 718 
     | 
    
         
            +
                    }
         
     | 
| 
      
 719 
     | 
    
         
            +
                    this.initType = type
         
     | 
| 
      
 720 
     | 
    
         
            +
                    this.initData = data
         
     | 
| 
      
 721 
     | 
    
         
            +
                    const canvasData = data ? data : this.data
         
     | 
| 
      
 722 
     | 
    
         
            +
                    //this.topologyDetailData = initData
         
     | 
| 
      
 723 
     | 
    
         
            +
                    const url = canvasData.mqttUrl
         
     | 
| 
      
 724 
     | 
    
         
            +
                    // if(url && url.indexOf('://') > -1){
         
     | 
| 
      
 725 
     | 
    
         
            +
                    this.onContentForEventType('Mqtt')
         
     | 
| 
       725 
726 
     | 
    
         
             
                    // }
         
     | 
| 
      
 727 
     | 
    
         
            +
                    if (canvasData.pollUrl) {
         
     | 
| 
      
 728 
     | 
    
         
            +
                        this.onContentForEventType('Poll')
         
     | 
| 
      
 729 
     | 
    
         
            +
                    }
         
     | 
| 
      
 730 
     | 
    
         
            +
                    if (canvasData.pollUrl1) {
         
     | 
| 
      
 731 
     | 
    
         
            +
                        this.onContentForEventType('Poll1')
         
     | 
| 
      
 732 
     | 
    
         
            +
                    }
         
     | 
| 
      
 733 
     | 
    
         
            +
                    if (canvasData.pollUrl2) {
         
     | 
| 
      
 734 
     | 
    
         
            +
                        this.onContentForEventType('Poll2')
         
     | 
| 
      
 735 
     | 
    
         
            +
                    }
         
     | 
| 
       726 
736 
     | 
    
         
             
                };
         
     | 
| 
       727 
     | 
    
         
            -
                Common.prototype. 
     | 
| 
       728 
     | 
    
         
            -
                     
     | 
| 
       729 
     | 
    
         
            -
                     
     | 
| 
       730 
     | 
    
         
            -
             
     | 
| 
       731 
     | 
    
         
            -
             
     | 
| 
       732 
     | 
    
         
            -
                         
     | 
| 
       733 
     | 
    
         
            -
                         
     | 
| 
       734 
     | 
    
         
            -
             
     | 
| 
       735 
     | 
    
         
            -
             
     | 
| 
       736 
     | 
    
         
            -
             
     | 
| 
       737 
     | 
    
         
            -
                        connectParams.mqttUrl = resetDCIM.mqttUrl;
         
     | 
| 
       738 
     | 
    
         
            -
                        connectParams.username = resetDCIM.mqttUsername;
         
     | 
| 
       739 
     | 
    
         
            -
                        connectParams.password = resetDCIM.mqttPassword;
         
     | 
| 
      
 737 
     | 
    
         
            +
                Common.prototype.onContentForEventType = async function (eventType) {
         
     | 
| 
      
 738 
     | 
    
         
            +
                    // 获取属性中数据的集合
         
     | 
| 
      
 739 
     | 
    
         
            +
                    if (!this.initType) await this.initTagParams(eventType);
         
     | 
| 
      
 740 
     | 
    
         
            +
                    let tagParams = this.tagParams[eventType]
         
     | 
| 
      
 741 
     | 
    
         
            +
                    if (eventType === 'Mqtt') {
         
     | 
| 
      
 742 
     | 
    
         
            +
                        // 连接测试,MQTT
         
     | 
| 
      
 743 
     | 
    
         
            +
                        this.onMqttContent(tagParams)
         
     | 
| 
      
 744 
     | 
    
         
            +
                    } else if (eventType.indexOf('Poll') > -1) {
         
     | 
| 
      
 745 
     | 
    
         
            +
                        // 连接测试,轮询地址
         
     | 
| 
      
 746 
     | 
    
         
            +
                        this.onPollContent(tagParams, eventType)
         
     | 
| 
       740 
747 
     | 
    
         
             
                    }
         
     | 
| 
       741 
     | 
    
         
            -
                    // 连接测试,MQTT
         
     | 
| 
       742 
     | 
    
         
            -
                    this.openMqtt(connectParams, resetDCIM.mqttDebug);
         
     | 
| 
       743 
748 
     | 
    
         
             
                };
         
     | 
| 
       744 
     | 
    
         
            -
                Common.prototype. 
     | 
| 
       745 
     | 
    
         
            -
                     
     | 
| 
       746 
     | 
    
         
            -
                     
     | 
| 
       747 
     | 
    
         
            -
                     
     | 
| 
       748 
     | 
    
         
            -
                     
     | 
| 
       749 
     | 
    
         
            -
                     
     | 
| 
       750 
     | 
    
         
            -
                     
     | 
| 
       751 
     | 
    
         
            -
                     
     | 
| 
       752 
     | 
    
         
            -
             
     | 
| 
       753 
     | 
    
         
            -
             
     | 
| 
       754 
     | 
    
         
            -
             
     | 
| 
       755 
     | 
    
         
            -
                     
     | 
| 
       756 
     | 
    
         
            -
                    const  
     | 
| 
       757 
     | 
    
         
            -
                     
     | 
| 
       758 
     | 
    
         
            -
             
     | 
| 
      
 749 
     | 
    
         
            +
                Common.prototype.clearTagParams = function (eventType) {
         
     | 
| 
      
 750 
     | 
    
         
            +
                    this.tagParams[eventType] = {};
         
     | 
| 
      
 751 
     | 
    
         
            +
                    this.tagParams[eventType].tagIds = [];
         
     | 
| 
      
 752 
     | 
    
         
            +
                    this.tagParams[eventType].kpiAddrs = [];
         
     | 
| 
      
 753 
     | 
    
         
            +
                    this.tagParams[eventType].tagEcharts = [];
         
     | 
| 
      
 754 
     | 
    
         
            +
                    this.tagParams[eventType].assetIds = [];
         
     | 
| 
      
 755 
     | 
    
         
            +
                    this.tagParams[eventType].areaIds = [];
         
     | 
| 
      
 756 
     | 
    
         
            +
                    // this.tagParams[eventType].cockpitLayoutData = [];//统计图表组件类型ID
         
     | 
| 
      
 757 
     | 
    
         
            +
                    this.tagParams[eventType].echartData = [];//统计图表组件类型ID
         
     | 
| 
      
 758 
     | 
    
         
            +
                };
         
     | 
| 
      
 759 
     | 
    
         
            +
                Common.prototype.initTagParams = async function (eventType) {
         
     | 
| 
      
 760 
     | 
    
         
            +
                    this.clearTagParams(eventType)
         
     | 
| 
      
 761 
     | 
    
         
            +
                    const pensData = this.data.pens
         
     | 
| 
      
 762 
     | 
    
         
            +
                    let tagParams = this.getTagParams(pensData, eventType);
         
     | 
| 
      
 763 
     | 
    
         
            +
                    // 详情页面,即URL配置了资产id的页面
         
     | 
| 
      
 764 
     | 
    
         
            +
                    let assetId = this.getUrlParams('assetId')
         
     | 
| 
      
 765 
     | 
    
         
            +
                    // console.log('详情页面,即URL配置了资产id的页面',assetId,eventType, tagParams)
         
     | 
| 
      
 766 
     | 
    
         
            +
                    if (assetId && eventType === 'Mqtt') {
         
     | 
| 
      
 767 
     | 
    
         
            +
                        //if(assetId){
         
     | 
| 
      
 768 
     | 
    
         
            +
                        // 获取属性中绑定指标数据的集合
         
     | 
| 
      
 769 
     | 
    
         
            +
                        await this.getTagParamsForKpiAddrs(assetId, tagParams)
         
     | 
| 
      
 770 
     | 
    
         
            +
                        // 存在固定的资产详情,更新页面数据
         
     | 
| 
      
 771 
     | 
    
         
            +
                        // if(this.assetPoperties && this.isExistAssetKey === true){
         
     | 
| 
      
 772 
     | 
    
         
            +
                        if (this.assetPoperties) {
         
     | 
| 
      
 773 
     | 
    
         
            +
                            // 更新画布上固定的资产详情对应的值
         
     | 
| 
      
 774 
     | 
    
         
            +
                            //const canvasPens = this.pathRewrite ? canvasData.pens : this.canvas.data.pens
         
     | 
| 
      
 775 
     | 
    
         
            +
                            this.renderForAssetPoperties(this.canvas.data.pens);
         
     | 
| 
      
 776 
     | 
    
         
            +
                        }
         
     | 
| 
       759 
777 
     | 
    
         
             
                    }
         
     | 
| 
       760 
778 
     | 
    
         
             
                };
         
     | 
| 
       761 
     | 
    
         
            -
                Common.prototype. 
     | 
| 
       762 
     | 
    
         
            -
                     
     | 
| 
       763 
     | 
    
         
            -
             
     | 
| 
       764 
     | 
    
         
            -
                         
     | 
| 
      
 779 
     | 
    
         
            +
                Common.prototype.getTagParams = function (pens, eventType) {
         
     | 
| 
      
 780 
     | 
    
         
            +
                    const _this = this;
         
     | 
| 
      
 781 
     | 
    
         
            +
                    pens.forEach((pen) => {
         
     | 
| 
      
 782 
     | 
    
         
            +
                        if (pen.children != undefined && pen.children.length > 0) {
         
     | 
| 
      
 783 
     | 
    
         
            +
                            _this.getTagParams(pen.children, eventType)
         
     | 
| 
      
 784 
     | 
    
         
            +
                        } else {
         
     | 
| 
      
 785 
     | 
    
         
            +
                            _this.getTagParamsChildren(pen, eventType)
         
     | 
| 
      
 786 
     | 
    
         
            +
                        }
         
     | 
| 
      
 787 
     | 
    
         
            +
                    })
         
     | 
| 
      
 788 
     | 
    
         
            +
                    return this.tagParams[eventType]
         
     | 
| 
      
 789 
     | 
    
         
            +
                };
         
     | 
| 
      
 790 
     | 
    
         
            +
                Common.prototype.getTagParamsChildren = function (pen, eventType) {
         
     | 
| 
      
 791 
     | 
    
         
            +
                    let tagIds = []
         
     | 
| 
      
 792 
     | 
    
         
            +
                    let kpiAddrs = []
         
     | 
| 
      
 793 
     | 
    
         
            +
                    let assetIds = []
         
     | 
| 
      
 794 
     | 
    
         
            +
                    let areaIds = []
         
     | 
| 
      
 795 
     | 
    
         
            +
                    let tagEcharts = []
         
     | 
| 
      
 796 
     | 
    
         
            +
                    // let cockpitLayoutData = []
         
     | 
| 
      
 797 
     | 
    
         
            +
                    let echartData = []
         
     | 
| 
      
 798 
     | 
    
         
            +
                    let isEventType = false;
         
     | 
| 
      
 799 
     | 
    
         
            +
                    for (var _b = 0, _c = pen.events; _b < _c.length; _b++) {
         
     | 
| 
      
 800 
     | 
    
         
            +
                        var event_1 = _c[_b];
         
     | 
| 
      
 801 
     | 
    
         
            +
                        if ((event_1.type === 3 && eventType === 'Mqtt') || (event_1.type === 4 && eventType === 'Poll')
         
     | 
| 
      
 802 
     | 
    
         
            +
                                || (event_1.type === 5 && eventType === 'Poll1') || (event_1.type === 6 && eventType === 'Poll2')) {
         
     | 
| 
      
 803 
     | 
    
         
            +
                            isEventType = true;
         
     | 
| 
      
 804 
     | 
    
         
            +
                        }
         
     | 
| 
      
 805 
     | 
    
         
            +
                    }
         
     | 
| 
      
 806 
     | 
    
         
            +
                    if (isEventType === true) {
         
     | 
| 
      
 807 
     | 
    
         
            +
                        if (pen.data != undefined && this.checkType(pen.data) === 'Array' && pen.data.length > 0) {
         
     | 
| 
      
 808 
     | 
    
         
            +
                            pen.data.forEach((item) => {
         
     | 
| 
      
 809 
     | 
    
         
            +
                                if (item.key === 'tagId') {
         
     | 
| 
      
 810 
     | 
    
         
            +
                                    tagIds.push(item.value)
         
     | 
| 
      
 811 
     | 
    
         
            +
                                }
         
     | 
| 
      
 812 
     | 
    
         
            +
                                if (item.key === 'kpiAddr') {
         
     | 
| 
      
 813 
     | 
    
         
            +
                                    kpiAddrs.push(item.value)
         
     | 
| 
      
 814 
     | 
    
         
            +
                                }
         
     | 
| 
      
 815 
     | 
    
         
            +
                                if (item.key === 'assetKey') {
         
     | 
| 
      
 816 
     | 
    
         
            +
                                    this.isExistAssetKey = true
         
     | 
| 
      
 817 
     | 
    
         
            +
                                }
         
     | 
| 
      
 818 
     | 
    
         
            +
                                if (item.key === 'assetId') {
         
     | 
| 
      
 819 
     | 
    
         
            +
                                    assetIds.push(item.value)
         
     | 
| 
      
 820 
     | 
    
         
            +
                                }
         
     | 
| 
      
 821 
     | 
    
         
            +
                                if (item.key === 'areaId') {
         
     | 
| 
      
 822 
     | 
    
         
            +
                                    areaIds.push(item.value)
         
     | 
| 
      
 823 
     | 
    
         
            +
                                }
         
     | 
| 
      
 824 
     | 
    
         
            +
                            })
         
     | 
| 
      
 825 
     | 
    
         
            +
                        }
         
     | 
| 
      
 826 
     | 
    
         
            +
                                // else if(pen.data != undefined && this.checkType(pen.data) === 'Object' && pen.tags != undefined && this.checkType(pen.tags) === 'Array' && pen.tags.length>0){
         
     | 
| 
      
 827 
     | 
    
         
            +
                                //     pen.tags.forEach((item)=>{
         
     | 
| 
      
 828 
     | 
    
         
            +
                                //         if( item.indexOf('echart') > -1){
         
     | 
| 
      
 829 
     | 
    
         
            +
                                //             tagEcharts.push(item)
         
     | 
| 
      
 830 
     | 
    
         
            +
                                //         }
         
     | 
| 
      
 831 
     | 
    
         
            +
                                //     })
         
     | 
| 
      
 832 
     | 
    
         
            +
                        // }
         
     | 
| 
      
 833 
     | 
    
         
            +
                        else if (pen.data != undefined && this.checkType(pen.data) === 'Object' && this.checkType(pen.data.params) === 'Object') {
         
     | 
| 
      
 834 
     | 
    
         
            +
             
     | 
| 
      
 835 
     | 
    
         
            +
                            // pen.data.echarts && pen.data.echarts.option.series.length > 1 ? echartData.push(pen.data.params.id) : cockpitLayoutData.push(pen.data.params.id)
         
     | 
| 
      
 836 
     | 
    
         
            +
                            echartData.push(pen.data.params.id)
         
     | 
| 
      
 837 
     | 
    
         
            +
             
     | 
| 
      
 838 
     | 
    
         
            +
                        }
         
     | 
| 
      
 839 
     | 
    
         
            +
                        this.tagParams[eventType].tagIds = [...new Set(this.tagParams[eventType].tagIds.concat(tagIds))]
         
     | 
| 
      
 840 
     | 
    
         
            +
                        this.tagParams[eventType].kpiAddrs = [...new Set(this.tagParams[eventType].kpiAddrs.concat(kpiAddrs))]
         
     | 
| 
      
 841 
     | 
    
         
            +
                        this.tagParams[eventType].assetIds = [...new Set(this.tagParams[eventType].assetIds.concat(assetIds))]
         
     | 
| 
      
 842 
     | 
    
         
            +
                        this.tagParams[eventType].areaIds = [...new Set(this.tagParams[eventType].areaIds.concat(areaIds))]
         
     | 
| 
      
 843 
     | 
    
         
            +
                        this.tagParams[eventType].tagEcharts = [...new Set(this.tagParams[eventType].tagEcharts.concat(tagEcharts))]
         
     | 
| 
      
 844 
     | 
    
         
            +
                        // this.tagParams[eventType].cockpitLayoutData = [...new Set(this.tagParams[eventType].cockpitLayoutData.concat(cockpitLayoutData))]
         
     | 
| 
      
 845 
     | 
    
         
            +
                        this.tagParams[eventType].echartData = [...new Set(this.tagParams[eventType].echartData.concat(echartData))]
         
     | 
| 
       765 
846 
     | 
    
         
             
                    }
         
     | 
| 
       766 
847 
     | 
    
         
             
                };
         
     | 
| 
       767 
     | 
    
         
            -
                Common.prototype. 
     | 
| 
       768 
     | 
    
         
            -
                    let  
     | 
| 
       769 
     | 
    
         
            -
                     
     | 
| 
       770 
     | 
    
         
            -
                     
     | 
| 
       771 
     | 
    
         
            -
                     
     | 
| 
       772 
     | 
    
         
            -
                    this. 
     | 
| 
      
 848 
     | 
    
         
            +
                Common.prototype.getMqttData = async function (tagParams, panelData) {
         
     | 
| 
      
 849 
     | 
    
         
            +
                    let ret = {};
         
     | 
| 
      
 850 
     | 
    
         
            +
                    let data = {};
         
     | 
| 
      
 851 
     | 
    
         
            +
                    let path = '';
         
     | 
| 
      
 852 
     | 
    
         
            +
                    let assetData = null;
         
     | 
| 
      
 853 
     | 
    
         
            +
                    let pathRewrite = this.pathRewrite;
         
     | 
| 
      
 854 
     | 
    
         
            +
                    let canvasData = JSON.parse(JSON.stringify(this.canvas.data));
         
     | 
| 
      
 855 
     | 
    
         
            +
                    let mqttTopics = this.data.mqttTopics;
         
     | 
| 
      
 856 
     | 
    
         
            +
                    let tagParamsData = tagParams;
         
     | 
| 
      
 857 
     | 
    
         
            +
                    let detailJson = null;
         
     | 
| 
      
 858 
     | 
    
         
            +
                    Store.set('TIMEOUT:currentPage', `locationPath${this.s8()}`);
         
     | 
| 
      
 859 
     | 
    
         
            +
                    if (panelData) {
         
     | 
| 
      
 860 
     | 
    
         
            +
                        this.data.mqttTopics = mqttTopics
         
     | 
| 
      
 861 
     | 
    
         
            +
                        pathRewrite = panelData.pathRewrite;
         
     | 
| 
      
 862 
     | 
    
         
            +
                        canvasData = JSON.parse(JSON.stringify(panelData.data));
         
     | 
| 
      
 863 
     | 
    
         
            +
                        mqttTopics = panelData.mqttTopics;
         
     | 
| 
      
 864 
     | 
    
         
            +
                        if (panelData.assetId) {
         
     | 
| 
      
 865 
     | 
    
         
            +
                            const detailData = await this.getTagParamsForKpiAddrs(panelData.assetId, tagParams, pathRewrite);
         
     | 
| 
      
 866 
     | 
    
         
            +
                            if (detailData.data) {
         
     | 
| 
      
 867 
     | 
    
         
            +
                                tagParamsData.tagIds = detailData.tagIds;
         
     | 
| 
      
 868 
     | 
    
         
            +
                                assetData = detailData.data.asset;
         
     | 
| 
      
 869 
     | 
    
         
            +
                                detailJson = detailData.data;
         
     | 
| 
      
 870 
     | 
    
         
            +
                                tagParamsData.echartAssemblyData = detailJson.echartAssemblyData;
         
     | 
| 
      
 871 
     | 
    
         
            +
                            }
         
     | 
| 
      
 872 
     | 
    
         
            +
                        }
         
     | 
| 
      
 873 
     | 
    
         
            +
                    }
         
     | 
| 
      
 874 
     | 
    
         
            +
                    tagParamsData.locationPath = Store.get('TIMEOUT:currentPage');
         
     | 
| 
      
 875 
     | 
    
         
            +
                    if (!tagParams) {
         
     | 
| 
      
 876 
     | 
    
         
            +
                        data = this.theData
         
     | 
| 
      
 877 
     | 
    
         
            +
                        path = this.thePath
         
     | 
| 
      
 878 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 879 
     | 
    
         
            +
                        data = {
         
     | 
| 
      
 880 
     | 
    
         
            +
                            tagIds: tagParamsData.tagIds.join(","),
         
     | 
| 
      
 881 
     | 
    
         
            +
                            assetIds: tagParamsData.assetIds.join(","),
         
     | 
| 
      
 882 
     | 
    
         
            +
                            areaIds: tagParamsData.areaIds.join(","),
         
     | 
| 
      
 883 
     | 
    
         
            +
                            routingkey: mqttTopics,
         
     | 
| 
      
 884 
     | 
    
         
            +
                            echart: tagParamsData.tagEcharts.join(","),
         
     | 
| 
      
 885 
     | 
    
         
            +
                            echartData: tagParamsData.echartData
         
     | 
| 
      
 886 
     | 
    
         
            +
                        }
         
     | 
| 
      
 887 
     | 
    
         
            +
                        if (tagParamsData.echartAssemblyData) {
         
     | 
| 
      
 888 
     | 
    
         
            +
                            data.echartAssemblyData = tagParamsData.echartAssemblyData;
         
     | 
| 
      
 889 
     | 
    
         
            +
                        }
         
     | 
| 
      
 890 
     | 
    
         
            +
                        //const pathRewrite = panelData ? panelData.pathRewrite : this.pathRewrite
         
     | 
| 
      
 891 
     | 
    
         
            +
                        path = pathRewrite ? pathRewrite + '/user/cockpit/mqtt-data' : '/user/cockpit/mqtt-data'
         
     | 
| 
      
 892 
     | 
    
         
            +
                        this.thePath = path
         
     | 
| 
      
 893 
     | 
    
         
            +
                        this.theData = data
         
     | 
| 
      
 894 
     | 
    
         
            +
                    }
         
     | 
| 
      
 895 
     | 
    
         
            +
                    let drawedData = null
         
     | 
| 
      
 896 
     | 
    
         
            +
                    ret = await axios.post(path, data);
         
     | 
| 
      
 897 
     | 
    
         
            +
                    if (ret.data && ret.data.data) {
         
     | 
| 
      
 898 
     | 
    
         
            +
                        if (assetData) ret.data.data.asset = assetData
         
     | 
| 
      
 899 
     | 
    
         
            +
                        drawedData = this.mqttDataDrawing(canvasData, ret.data.data, detailJson)
         
     | 
| 
      
 900 
     | 
    
         
            +
                    }
         
     | 
| 
      
 901 
     | 
    
         
            +
                    this.clearInterValAll();
         
     | 
| 
      
 902 
     | 
    
         
            +
                    this.timmerByTopology = setTimeout(() => {
         
     | 
| 
      
 903 
     | 
    
         
            +
                        const locationPath = Store.get('TIMEOUT:currentPage');
         
     | 
| 
      
 904 
     | 
    
         
            +
                        if (locationPath === tagParamsData.locationPath) {
         
     | 
| 
      
 905 
     | 
    
         
            +
                            this.getMqttData(tagParamsData);
         
     | 
| 
      
 906 
     | 
    
         
            +
                        }
         
     | 
| 
      
 907 
     | 
    
         
            +
                    }, 180000); // 每3分钟定时请求,超过3分钟未收到MQTT将停止推送数据 180000
         
     | 
| 
      
 908 
     | 
    
         
            +
                    if (ret.error) {
         
     | 
| 
      
 909 
     | 
    
         
            +
                        return null;
         
     | 
| 
      
 910 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 911 
     | 
    
         
            +
                        return {
         
     | 
| 
      
 912 
     | 
    
         
            +
                            mqttData: drawedData,
         
     | 
| 
      
 913 
     | 
    
         
            +
                            detailData: detailJson
         
     | 
| 
      
 914 
     | 
    
         
            +
                        }
         
     | 
| 
      
 915 
     | 
    
         
            +
                    }
         
     | 
| 
       773 
916 
     | 
    
         
             
                };
         
     | 
| 
       774 
     | 
    
         
            -
                Common.prototype.mqttDataDrawing = function (data, retData) {
         
     | 
| 
      
 917 
     | 
    
         
            +
                Common.prototype.mqttDataDrawing = function (data, retData, detailJson) {
         
     | 
| 
      
 918 
     | 
    
         
            +
                    const syncData = retData
         
     | 
| 
      
 919 
     | 
    
         
            +
                    const detailData = detailJson ? detailJson.data : [];
         
     | 
| 
       775 
920 
     | 
    
         
             
                    // console.log('收到消息', syncData)
         
     | 
| 
       776 
     | 
    
         
            -
                     
     | 
| 
       777 
     | 
    
         
            -
                    data.map((item) => {
         
     | 
| 
       778 
     | 
    
         
            -
                        if( 
     | 
| 
       779 
     | 
    
         
            -
             
     | 
| 
       780 
     | 
    
         
            -
             
     | 
| 
       781 
     | 
    
         
            -
             
     | 
| 
       782 
     | 
    
         
            -
             
     | 
| 
       783 
     | 
    
         
            -
             
     | 
| 
       784 
     | 
    
         
            -
             
     | 
| 
      
 921 
     | 
    
         
            +
                    Store.set('mqtt:responseData', syncData);
         
     | 
| 
      
 922 
     | 
    
         
            +
                    data.pens.map((item) => {
         
     | 
| 
      
 923 
     | 
    
         
            +
                        if (item.children != undefined) {
         
     | 
| 
      
 924 
     | 
    
         
            +
                            item.children.map((_item) => {
         
     | 
| 
      
 925 
     | 
    
         
            +
                                item.defaultFillStyle = item.fillStyle;
         
     | 
| 
      
 926 
     | 
    
         
            +
                                item.defaultFontColor = item.font.color;
         
     | 
| 
      
 927 
     | 
    
         
            +
                                if (item.name === 'line') item.defaultLineColor = item.strokeStyle;
         
     | 
| 
      
 928 
     | 
    
         
            +
                                if (!_item.data) return
         
     | 
| 
      
 929 
     | 
    
         
            +
                                //const node = detailData.length > 0 ? detailData : syncData
         
     | 
| 
      
 930 
     | 
    
         
            +
                                const functionData = _item.events.filter((ev) => {
         
     | 
| 
      
 931 
     | 
    
         
            +
                                    return ev.action === EventAction.Function
         
     | 
| 
      
 932 
     | 
    
         
            +
                                })
         
     | 
| 
      
 933 
     | 
    
         
            +
                                const dataValue = functionData[0]
         
     | 
| 
      
 934 
     | 
    
         
            +
                                if (functionData.length > 0 && dataValue.value && retData) {
         
     | 
| 
      
 935 
     | 
    
         
            +
                                    _item.data.map((d) => {
         
     | 
| 
      
 936 
     | 
    
         
            +
                                        const {kpiData, tagData} = retData;
         
     | 
| 
      
 937 
     | 
    
         
            +
                                        const key = d.key;
         
     | 
| 
      
 938 
     | 
    
         
            +
                                        const value = d.value;
         
     | 
| 
      
 939 
     | 
    
         
            +
                                        const _syncItem = key === 'tagId' ? tagData[value] : kpiData[value];
         
     | 
| 
      
 940 
     | 
    
         
            +
                                        if ((key === 'tagId' || key === 'kpiAddr') && _syncItem) {
         
     | 
| 
      
 941 
     | 
    
         
            +
                                            const isControl = parseInt(_syncItem.isControlDis); // 是否可控,0可控,1不可控
         
     | 
| 
      
 942 
     | 
    
         
            +
                                            if (!isControl) {
         
     | 
| 
      
 943 
     | 
    
         
            +
                                                d.tagVal = value
         
     | 
| 
      
 944 
     | 
    
         
            +
                                                d.controlParams = _syncItem
         
     | 
| 
      
 945 
     | 
    
         
            +
                                                // delete _syncItem[value]
         
     | 
| 
      
 946 
     | 
    
         
            +
                                                // Object.assign(d, _syncItem)
         
     | 
| 
      
 947 
     | 
    
         
            +
                                            }
         
     | 
| 
      
 948 
     | 
    
         
            +
                                        }
         
     | 
| 
      
 949 
     | 
    
         
            +
                                    })
         
     | 
| 
      
 950 
     | 
    
         
            +
                                    //console.log('定制函数=====')
         
     | 
| 
      
 951 
     | 
    
         
            +
                                    console.log('定制函数------')
         
     | 
| 
      
 952 
     | 
    
         
            +
                                    const func = new Function('pen', 'params', dataValue.value)
         
     | 
| 
      
 953 
     | 
    
         
            +
                                    func(_item, JSON.stringify(retData))
         
     | 
| 
      
 954 
     | 
    
         
            +
                                } else {
         
     | 
| 
      
 955 
     | 
    
         
            +
                                    // console.log('默认函数')
         
     | 
| 
      
 956 
     | 
    
         
            +
                                    setConfItemNode(_item, syncData);
         
     | 
| 
      
 957 
     | 
    
         
            +
                                }
         
     | 
| 
      
 958 
     | 
    
         
            +
                                this.machAnimateReset(item);
         
     | 
| 
      
 959 
     | 
    
         
            +
                            })
         
     | 
| 
      
 960 
     | 
    
         
            +
                        } else {
         
     | 
| 
      
 961 
     | 
    
         
            +
                            item.defaultFillStyle = item.fillStyle;
         
     | 
| 
      
 962 
     | 
    
         
            +
                            item.defaultFontColor = item.font.color;
         
     | 
| 
      
 963 
     | 
    
         
            +
                            if (item.name === 'line') item.defaultLineColor = item.strokeStyle;
         
     | 
| 
      
 964 
     | 
    
         
            +
                            if (!item.data) return
         
     | 
| 
      
 965 
     | 
    
         
            +
                            //const node = detailData.length > 0 ? detailData : syncData
         
     | 
| 
      
 966 
     | 
    
         
            +
                            const functionData = item.events.filter((ev) => {
         
     | 
| 
      
 967 
     | 
    
         
            +
                                return ev.action === EventAction.Function
         
     | 
| 
      
 968 
     | 
    
         
            +
                            })
         
     | 
| 
      
 969 
     | 
    
         
            +
                            const dataValue = functionData[0]
         
     | 
| 
      
 970 
     | 
    
         
            +
                            if (functionData.length > 0 && dataValue.value && retData) {
         
     | 
| 
      
 971 
     | 
    
         
            +
                                item.data.map((d) => {
         
     | 
| 
      
 972 
     | 
    
         
            +
                                    const {kpiData, tagData} = retData;
         
     | 
| 
      
 973 
     | 
    
         
            +
                                    const key = d.key;
         
     | 
| 
      
 974 
     | 
    
         
            +
                                    const value = d.value;
         
     | 
| 
      
 975 
     | 
    
         
            +
                                    const _syncItem = key === 'tagId' ? tagData[value] : kpiData[value];
         
     | 
| 
      
 976 
     | 
    
         
            +
                                    if ((key === 'tagId' || key === 'kpiAddr') && _syncItem) {
         
     | 
| 
      
 977 
     | 
    
         
            +
                                        const isControl = parseInt(_syncItem.isControlDis); // 是否可控,0可控,1不可控
         
     | 
| 
      
 978 
     | 
    
         
            +
                                        if (!isControl) {
         
     | 
| 
      
 979 
     | 
    
         
            +
                                            d.tagVal = value;
         
     | 
| 
      
 980 
     | 
    
         
            +
                                            d.controlParams = _syncItem;
         
     | 
| 
      
 981 
     | 
    
         
            +
                                            // delete _syncItem[value]
         
     | 
| 
      
 982 
     | 
    
         
            +
                                            // Object.assign(d, _syncItem)
         
     | 
| 
      
 983 
     | 
    
         
            +
                                        }
         
     | 
| 
      
 984 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 985 
     | 
    
         
            +
                                });
         
     | 
| 
      
 986 
     | 
    
         
            +
                                const func = new Function('pen', 'params', dataValue.value);
         
     | 
| 
      
 987 
     | 
    
         
            +
                                func(item, JSON.stringify(retData));
         
     | 
| 
      
 988 
     | 
    
         
            +
                                //const machData = func(item, JSON.stringify(retData));
         
     | 
| 
      
 989 
     | 
    
         
            +
                                console.log('定制函数------------');
         
     | 
| 
      
 990 
     | 
    
         
            +
                            } else {
         
     | 
| 
      
 991 
     | 
    
         
            +
                                // console.log('默认函数')
         
     | 
| 
      
 992 
     | 
    
         
            +
                                setConfItemNode(item, syncData);
         
     | 
| 
      
 993 
     | 
    
         
            +
                            }
         
     | 
| 
      
 994 
     | 
    
         
            +
                            this.machAnimateReset(item);
         
     | 
| 
       785 
995 
     | 
    
         
             
                        }
         
     | 
| 
       786 
     | 
    
         
            -
                    }) 
     | 
| 
       787 
     | 
    
         
            -
                    //console.log(' 
     | 
| 
      
 996 
     | 
    
         
            +
                    })
         
     | 
| 
      
 997 
     | 
    
         
            +
                    // console.log('执行完毕')
         
     | 
| 
       788 
998 
     | 
    
         
             
                    this.render();
         
     | 
| 
       789 
999 
     | 
    
         
             
                    this.animate(true);
         
     | 
| 
       790 
     | 
    
         
            -
                    // 九所的 服务器状态监测功能中用到
         
     | 
| 
       791 
     | 
    
         
            -
                    if(this.store.options.storeSubscribe) Store.set(this.generateStoreKey('M:monitor'), this.store.monitorAlarm);
         
     | 
| 
       792 
1000 
     | 
    
         
             
                    return data
         
     | 
| 
       793 
1001 
     | 
    
         
             
                };
         
     | 
| 
      
 1002 
     | 
    
         
            +
                Common.prototype.machAnimateReset = function (pen) {
         
     | 
| 
      
 1003 
     | 
    
         
            +
                    if (!pen.animateFrames || pen.animateFrames.length <= 0) return;
         
     | 
| 
      
 1004 
     | 
    
         
            +
                    for (var _a = 0, _af = pen.animateFrames; _a < _af.length; _a++) {
         
     | 
| 
      
 1005 
     | 
    
         
            +
                        var ani = _af[_a];
         
     | 
| 
      
 1006 
     | 
    
         
            +
                        ani.state.strokeStyle = pen.strokeStyle;
         
     | 
| 
      
 1007 
     | 
    
         
            +
                        ani.state.fillStyle = pen.fillStyle;
         
     | 
| 
      
 1008 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1009 
     | 
    
         
            +
                };
         
     | 
| 
      
 1010 
     | 
    
         
            +
                Common.prototype.getTagParamsForKpiAddrs = async function (assetId, tagParams, apiStr) {
         
     | 
| 
      
 1011 
     | 
    
         
            +
                    let params = {
         
     | 
| 
      
 1012 
     | 
    
         
            +
                        assetId: assetId,
         
     | 
| 
      
 1013 
     | 
    
         
            +
                        tagIds: tagParams.tagIds.join(","),
         
     | 
| 
      
 1014 
     | 
    
         
            +
                        kpiAddrs: tagParams.kpiAddrs.join(","),
         
     | 
| 
      
 1015 
     | 
    
         
            +
                        echartAssemblyIds: tagParams.echartData,
         
     | 
| 
      
 1016 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1017 
     | 
    
         
            +
                    let pathRewrite = apiStr ? apiStr : this.pathRewrite
         
     | 
| 
      
 1018 
     | 
    
         
            +
                    const path = pathRewrite ? pathRewrite + '/place/place_monitor/getPlaceAssetDetail' : '/place/place_monitor/getPlaceAssetDetail'
         
     | 
| 
      
 1019 
     | 
    
         
            +
                    let ret = await axios.post(path, params);
         
     | 
| 
      
 1020 
     | 
    
         
            +
                    // 遍历得到属性中绑定指标数据的集合
         
     | 
| 
      
 1021 
     | 
    
         
            +
                    const tagIds = this.getTagIdsForKpiAddrs(ret.data);
         
     | 
| 
      
 1022 
     | 
    
         
            +
                    // 详情页面,固定的资产详情的数据集合
         
     | 
| 
      
 1023 
     | 
    
         
            +
                    this.assetPoperties = ret.asset
         
     | 
| 
      
 1024 
     | 
    
         
            +
             
     | 
| 
      
 1025 
     | 
    
         
            +
                    return {
         
     | 
| 
      
 1026 
     | 
    
         
            +
                        data: ret.data,
         
     | 
| 
      
 1027 
     | 
    
         
            +
                        echartAssemblyData: ret.echartAssemblyData,
         
     | 
| 
      
 1028 
     | 
    
         
            +
                        tagIds: tagIds
         
     | 
| 
      
 1029 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1030 
     | 
    
         
            +
                };
         
     | 
| 
      
 1031 
     | 
    
         
            +
                Common.prototype.getTagIdsForKpiAddrs = function (data) {
         
     | 
| 
      
 1032 
     | 
    
         
            +
                    let tagIds = [];
         
     | 
| 
      
 1033 
     | 
    
         
            +
                    const delData = this.pathRewrite ? data : data.data;
         
     | 
| 
      
 1034 
     | 
    
         
            +
                    if (delData && delData.length > 0) {
         
     | 
| 
      
 1035 
     | 
    
         
            +
                        delData.forEach((item) => {
         
     | 
| 
      
 1036 
     | 
    
         
            +
                            tagIds.push(item.tagId);
         
     | 
| 
      
 1037 
     | 
    
         
            +
                        })
         
     | 
| 
      
 1038 
     | 
    
         
            +
                        this.tagParams.detailAssetData = data;
         
     | 
| 
      
 1039 
     | 
    
         
            +
                        this.tagParams.Mqtt.tagIds = tagIds;
         
     | 
| 
      
 1040 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1041 
     | 
    
         
            +
                    return tagIds
         
     | 
| 
      
 1042 
     | 
    
         
            +
                };
         
     | 
| 
      
 1043 
     | 
    
         
            +
                Common.prototype.renderForAssetPoperties = function (pens) {
         
     | 
| 
      
 1044 
     | 
    
         
            +
                    const _this = this;
         
     | 
| 
      
 1045 
     | 
    
         
            +
                    pens.forEach((pen) => {
         
     | 
| 
      
 1046 
     | 
    
         
            +
                        if (pen.children != undefined) {
         
     | 
| 
      
 1047 
     | 
    
         
            +
                            _this.renderForAssetPoperties(pen.children)
         
     | 
| 
      
 1048 
     | 
    
         
            +
                        } else {
         
     | 
| 
      
 1049 
     | 
    
         
            +
                            _this.renderForAssetPopertiesChildren(pen)
         
     | 
| 
      
 1050 
     | 
    
         
            +
                        }
         
     | 
| 
      
 1051 
     | 
    
         
            +
                    })
         
     | 
| 
      
 1052 
     | 
    
         
            +
                };
         
     | 
| 
      
 1053 
     | 
    
         
            +
                Common.prototype.renderForAssetPopertiesChildren = function (pen) {
         
     | 
| 
      
 1054 
     | 
    
         
            +
                    if (pen.data != undefined && pen.data != '' && typeof pen.data === 'object' && Array.isArray(pen.data) && pen.data.length > 0) {
         
     | 
| 
      
 1055 
     | 
    
         
            +
                        pen.data.forEach((item) => {
         
     | 
| 
      
 1056 
     | 
    
         
            +
                            Object.keys(this.assetPoperties).forEach(key => {
         
     | 
| 
      
 1057 
     | 
    
         
            +
                                if (item.key === 'assetKey') {
         
     | 
| 
      
 1058 
     | 
    
         
            +
                                    if (item.value === key) {
         
     | 
| 
      
 1059 
     | 
    
         
            +
                                        if (key === 'imgUrl' || key === 'principleImg') {
         
     | 
| 
      
 1060 
     | 
    
         
            +
                                            pen.text = ''
         
     | 
| 
      
 1061 
     | 
    
         
            +
                                            pen.image = this.pathRewrite ? this.pathRewrite + this.assetPoperties[key] : this.assetPoperties[key]
         
     | 
| 
      
 1062 
     | 
    
         
            +
                                        } else {
         
     | 
| 
      
 1063 
     | 
    
         
            +
                                            pen.text = this.assetPoperties[key]
         
     | 
| 
      
 1064 
     | 
    
         
            +
                                        }
         
     | 
| 
      
 1065 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 1066 
     | 
    
         
            +
                                }
         
     | 
| 
      
 1067 
     | 
    
         
            +
                            })
         
     | 
| 
      
 1068 
     | 
    
         
            +
                        })
         
     | 
| 
      
 1069 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1070 
     | 
    
         
            +
                };
         
     | 
| 
      
 1071 
     | 
    
         
            +
                Common.prototype.onMqttContent = async function (tagParams) {
         
     | 
| 
      
 1072 
     | 
    
         
            +
                    if (!this.initType) this.data.mqttTopics = 'mqtt-' + s8();
         
     | 
| 
      
 1073 
     | 
    
         
            +
                    // 告知MQTT属性中数据的集合
         
     | 
| 
      
 1074 
     | 
    
         
            +
                    const ret = !this.initType ? await this.getMqttData(tagParams) : this.initType;
         
     | 
| 
      
 1075 
     | 
    
         
            +
                    if (ret) {
         
     | 
| 
      
 1076 
     | 
    
         
            +
                        let mqttUrlStr = this.data.mqttUrl, mqttOption = this.data.mqttOptions
         
     | 
| 
      
 1077 
     | 
    
         
            +
                        if (this.initData) {
         
     | 
| 
      
 1078 
     | 
    
         
            +
                            const {mqttUrl, mqttOptions} = this.initData
         
     | 
| 
      
 1079 
     | 
    
         
            +
                            mqttUrlStr = mqttUrl
         
     | 
| 
      
 1080 
     | 
    
         
            +
                            mqttOption = mqttOptions
         
     | 
| 
      
 1081 
     | 
    
         
            +
                        }
         
     | 
| 
      
 1082 
     | 
    
         
            +
                        mqttOption.clientId = s8()
         
     | 
| 
      
 1083 
     | 
    
         
            +
                        this.openMqtt(mqttUrlStr, mqttOption);
         
     | 
| 
      
 1084 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 1085 
     | 
    
         
            +
                        console.log('请求出错')
         
     | 
| 
      
 1086 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1087 
     | 
    
         
            +
                };
         
     | 
| 
      
 1088 
     | 
    
         
            +
                Common.prototype.onPollContent = function (tagParams, eventType) {
         
     | 
| 
      
 1089 
     | 
    
         
            +
                    const index = eventType[4] ? eventType[4] : ''
         
     | 
| 
      
 1090 
     | 
    
         
            +
                    // const url = 'pollUrl'+index;
         
     | 
| 
      
 1091 
     | 
    
         
            +
                    // const second = 'pollSecond'+index;
         
     | 
| 
      
 1092 
     | 
    
         
            +
                    const pollUrl = this.data['pollUrl' + index]
         
     | 
| 
      
 1093 
     | 
    
         
            +
                    const pollSecond = this.data['pollSecond' + index]
         
     | 
| 
      
 1094 
     | 
    
         
            +
                    this.onpollStop(eventType);
         
     | 
| 
      
 1095 
     | 
    
         
            +
                    if (pollUrl && pollSecond) {
         
     | 
| 
      
 1096 
     | 
    
         
            +
                        this.renderForPoll(tagParams, pollUrl, eventType);
         
     | 
| 
      
 1097 
     | 
    
         
            +
                        if (pollSecond != 0) { // 轮询
         
     | 
| 
      
 1098 
     | 
    
         
            +
                            let millisecond = parseInt(pollSecond * 1000)
         
     | 
| 
      
 1099 
     | 
    
         
            +
                            this.pollTime[eventType] = setInterval(() => {
         
     | 
| 
      
 1100 
     | 
    
         
            +
                                this.renderForPoll(tagParams, pollUrl, eventType);
         
     | 
| 
      
 1101 
     | 
    
         
            +
                            }, millisecond);
         
     | 
| 
      
 1102 
     | 
    
         
            +
                        }
         
     | 
| 
      
 1103 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1104 
     | 
    
         
            +
                };
         
     | 
| 
      
 1105 
     | 
    
         
            +
                Common.prototype.onpollStop = function (eventType) {
         
     | 
| 
      
 1106 
     | 
    
         
            +
                    if (this.pollTime[eventType]) {
         
     | 
| 
      
 1107 
     | 
    
         
            +
                        clearInterval(this.pollTime[eventType])
         
     | 
| 
      
 1108 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1109 
     | 
    
         
            +
                };
         
     | 
| 
      
 1110 
     | 
    
         
            +
                Common.prototype.renderForPoll = async function (tagParams, pollUrl, eventType) {
         
     | 
| 
      
 1111 
     | 
    
         
            +
                    let data = {
         
     | 
| 
      
 1112 
     | 
    
         
            +
                        tagIds: tagParams.tagIds.join(","),
         
     | 
| 
      
 1113 
     | 
    
         
            +
                        // assetIds: tagParams.assetIds.join(","),
         
     | 
| 
      
 1114 
     | 
    
         
            +
                        // echart: tagParams.tagEcharts.join(",")
         
     | 
| 
      
 1115 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1116 
     | 
    
         
            +
                    const _this = this
         
     | 
| 
      
 1117 
     | 
    
         
            +
                    axios.post(pollUrl, data)
         
     | 
| 
      
 1118 
     | 
    
         
            +
                            .then((res) => {
         
     | 
| 
      
 1119 
     | 
    
         
            +
                                _this.openPoll(res, eventType);
         
     | 
| 
      
 1120 
     | 
    
         
            +
                            })
         
     | 
| 
      
 1121 
     | 
    
         
            +
                            .catch((error) => {
         
     | 
| 
      
 1122 
     | 
    
         
            +
                                console.log('轮询地址,连接失败', error)
         
     | 
| 
      
 1123 
     | 
    
         
            +
                                _this.onpollStop(eventType);
         
     | 
| 
      
 1124 
     | 
    
         
            +
                            });
         
     | 
| 
      
 1125 
     | 
    
         
            +
                };
         
     | 
| 
      
 1126 
     | 
    
         
            +
                Common.prototype.getUrlParams = function (name) {
         
     | 
| 
      
 1127 
     | 
    
         
            +
                    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i')
         
     | 
| 
      
 1128 
     | 
    
         
            +
                    var r = window.location.search.substr(1).match(reg)
         
     | 
| 
      
 1129 
     | 
    
         
            +
                    if (r != null) return unescape(r[2])
         
     | 
| 
      
 1130 
     | 
    
         
            +
                    return null
         
     | 
| 
      
 1131 
     | 
    
         
            +
                };
         
     | 
| 
      
 1132 
     | 
    
         
            +
                Common.prototype.checkType = function (data) {
         
     | 
| 
      
 1133 
     | 
    
         
            +
                    return Object.prototype.toString.call(data).slice(8, -1)
         
     | 
| 
      
 1134 
     | 
    
         
            +
                };
         
     | 
| 
      
 1135 
     | 
    
         
            +
                Common.prototype.mqttLostMessage = function () {
         
     | 
| 
      
 1136 
     | 
    
         
            +
                    // console.log('发送请求mqtt-data')
         
     | 
| 
      
 1137 
     | 
    
         
            +
                    this.getMqttData(this.tagParams.Mqtt);
         
     | 
| 
      
 1138 
     | 
    
         
            +
                };
         
     | 
| 
      
 1139 
     | 
    
         
            +
                Common.prototype.doMqttDrow = function (ret) {
         
     | 
| 
      
 1140 
     | 
    
         
            +
                    let canvasData = this.canvas.data;
         
     | 
| 
      
 1141 
     | 
    
         
            +
                    ret = JSON.parse(ret);
         
     | 
| 
      
 1142 
     | 
    
         
            +
                    // console.log('处理消息')
         
     | 
| 
      
 1143 
     | 
    
         
            +
                    // console.log('this.canvas.data',this.canvas.data)
         
     | 
| 
      
 1144 
     | 
    
         
            +
                    this.mqttDataDrawing(canvasData, ret)
         
     | 
| 
      
 1145 
     | 
    
         
            +
                };
         
     | 
| 
       794 
1146 
     | 
    
         
             
                Common.prototype.hidePenByTag = function (pens, val) {
         
     | 
| 
       795 
1147 
     | 
    
         
             
                    const _this = this;
         
     | 
| 
       796 
1148 
     | 
    
         
             
                    pens.forEach((pen) => {
         
     | 
| 
         @@ -803,11 +1155,11 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       803 
1155 
     | 
    
         
             
                Common.prototype.hidePenVal = function (pen, val) {
         
     | 
| 
       804 
1156 
     | 
    
         
             
                    const tags = pen.tags
         
     | 
| 
       805 
1157 
     | 
    
         
             
                    const obj = val ? JSON.parse(val) : {}
         
     | 
| 
       806 
     | 
    
         
            -
                    const visibleRange = obj.visibleRange 
     | 
| 
       807 
     | 
    
         
            -
                    const visibleFnRange = obj.visibleFnRange 
     | 
| 
       808 
     | 
    
         
            -
                    const visibleValue = obj.visibleValue 
     | 
| 
       809 
     | 
    
         
            -
                    const hiddenRange = obj.hiddenRange 
     | 
| 
       810 
     | 
    
         
            -
                    const tabsValue = obj.tabsValue 
     | 
| 
      
 1158 
     | 
    
         
            +
                    const visibleRange = obj.visibleRange
         
     | 
| 
      
 1159 
     | 
    
         
            +
                    const visibleFnRange = obj.visibleFnRange
         
     | 
| 
      
 1160 
     | 
    
         
            +
                    const visibleValue = obj.visibleValue
         
     | 
| 
      
 1161 
     | 
    
         
            +
                    const hiddenRange = obj.hiddenRange
         
     | 
| 
      
 1162 
     | 
    
         
            +
                    const tabsValue = obj.tabsValue
         
     | 
| 
       811 
1163 
     | 
    
         
             
                    if (tags.length > 0) {
         
     | 
| 
       812 
1164 
     | 
    
         
             
                        if (visibleRange == '1') {
         
     | 
| 
       813 
1165 
     | 
    
         
             
                            if (this.openCount % 2 == 0) {
         
     | 
| 
         @@ -845,34 +1197,13 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       845 
1197 
     | 
    
         
             
                            }
         
     | 
| 
       846 
1198 
     | 
    
         
             
                        }
         
     | 
| 
       847 
1199 
     | 
    
         
             
                    }
         
     | 
| 
       848 
     | 
    
         
            -
             
     | 
| 
       849 
     | 
    
         
            -
                Common.prototype.formOverflowConversionData = function (obj) {
         
     | 
| 
       850 
     | 
    
         
            -
                    if (!obj) {
         
     | 
| 
       851 
     | 
    
         
            -
                        obj = {pens: []};
         
     | 
| 
       852 
     | 
    
         
            -
                    }
         
     | 
| 
       853 
     | 
    
         
            -
                    let data = JSON.parse(JSON.stringify(obj));
         
     | 
| 
       854 
     | 
    
         
            -
                    Object.assign(this.store.data, data);
         
     | 
| 
       855 
     | 
    
         
            -
                    this.store.data.pens = [];
         
     | 
| 
       856 
     | 
    
         
            -
                    this.openCount = 0
         
     | 
| 
       857 
     | 
    
         
            -
                    const type = this.store.options.type;
         
     | 
| 
       858 
     | 
    
         
            -
                    if (data.pens) {
         
     | 
| 
       859 
     | 
    
         
            -
                        for (var _d = 0, _e = data.pens; _d < _e.length; _d++) {
         
     | 
| 
       860 
     | 
    
         
            -
                            const item = _e[_d];
         
     | 
| 
       861 
     | 
    
         
            -
                            if (!item.from) {
         
     | 
| 
       862 
     | 
    
         
            -
                                const node = new Node(item);
         
     | 
| 
       863 
     | 
    
         
            -
                                this.store.data.pens.push(node);
         
     | 
| 
       864 
     | 
    
         
            -
                            } else {
         
     | 
| 
       865 
     | 
    
         
            -
                                const linNode = new Line(item);
         
     | 
| 
       866 
     | 
    
         
            -
                                this.store.data.pens.push(linNode);
         
     | 
| 
       867 
     | 
    
         
            -
                            }
         
     | 
| 
       868 
     | 
    
         
            -
                        }
         
     | 
| 
       869 
     | 
    
         
            -
                    }
         
     | 
| 
      
 1200 
     | 
    
         
            +
                    this.render();
         
     | 
| 
       870 
1201 
     | 
    
         
             
                };
         
     | 
| 
       871 
1202 
     | 
    
         
             
                Common.prototype.destroyStatic = function () {
         
     | 
| 
       872 
     | 
    
         
            -
                    this. 
     | 
| 
       873 
     | 
    
         
            -
                     
     | 
| 
      
 1203 
     | 
    
         
            +
                    this.clearInterValAll();
         
     | 
| 
      
 1204 
     | 
    
         
            +
                    this.closeSocket();
         
     | 
| 
       874 
1205 
     | 
    
         
             
                    this.closeMqtt();
         
     | 
| 
       875 
     | 
    
         
            -
                     
     | 
| 
      
 1206 
     | 
    
         
            +
                    this.closePoll();
         
     | 
| 
       876 
1207 
     | 
    
         
             
                    this.subcribe.unsubscribe();
         
     | 
| 
       877 
1208 
     | 
    
         
             
                    this.subcribeRender.unsubscribe();
         
     | 
| 
       878 
1209 
     | 
    
         
             
                    this.subcribeImage.unsubscribe();
         
     | 
| 
         @@ -886,8 +1217,9 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       886 
1217 
     | 
    
         
             
                    this.canvas = null;
         
     | 
| 
       887 
1218 
     | 
    
         
             
                    this.offscreen.destroy();
         
     | 
| 
       888 
1219 
     | 
    
         
             
                    this.offscreen = null;
         
     | 
| 
       889 
     | 
    
         
            -
                    this. 
     | 
| 
      
 1220 
     | 
    
         
            +
                    this.data = null;
         
     | 
| 
       890 
1221 
     | 
    
         
             
                    Store.set('form:tableData', null);
         
     | 
| 
      
 1222 
     | 
    
         
            +
                    Store.set('TIMEOUT:currentPage', `empty${this.s8()}`);
         
     | 
| 
       891 
1223 
     | 
    
         
             
                    Store.set('FORM:tableData', {
         
     | 
| 
       892 
1224 
     | 
    
         
             
                        data: {
         
     | 
| 
       893 
1225 
     | 
    
         
             
                            tableNodes: {},
         
     | 
| 
         @@ -913,7 +1245,7 @@ var Common = /** @class */ (function () { 
     | 
|
| 
       913 
1245 
     | 
    
         
             
                        this[item] = null;
         
     | 
| 
       914 
1246 
     | 
    
         | 
| 
       915 
1247 
     | 
    
         
             
                    })
         
     | 
| 
       916 
     | 
    
         
            -
                    //end 
     | 
| 
      
 1248 
     | 
    
         
            +
                    //end
         
     | 
| 
       917 
1249 
     | 
    
         
             
                    window.topology = null;
         
     | 
| 
       918 
1250 
     | 
    
         
             
                };
         
     | 
| 
       919 
1251 
     | 
    
         
             
                // Render or redraw
         
     |