dcim-topology2d 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,13 +1,13 @@
1
- import { registerNode, loadJS } from '../../core';
1
+ import { registerNode } from '../../core';
2
2
  import { echarts } from './echarts';
3
3
  import { echartsDataStore } from '../../static';
4
- import './echarts/echarts.min.js';
4
+ // import './echarts/echarts.min.js';
5
5
  export function register(_echarts) {
6
6
  echartsDataStore.echarts = _echarts;
7
- if (process.browser && !echartsDataStore.echarts && !window.echarts) {
8
- //loadJS('https://cdn.bootcdn.net/ajax/libs/echarts/4.8.0/echarts.min.js', null, true);
9
- loadJS(`${location.origin}/libary/echarts.min.js`, null, true);
10
- }
7
+ // if (process.browser && !echartsDataStore.echarts && !window.echarts) {
8
+ // //loadJS('https://cdn.bootcdn.net/ajax/libs/echarts/4.8.0/echarts.min.js', null, true);
9
+ // loadJS(`${location.origin}/libary/echarts.min.js`, null, true);
10
+ // }
11
11
  registerNode('echarts', echarts, null, null, null);
12
12
  }
13
13
  //# sourceMappingURL=register.js.map
package/core/src/core.js CHANGED
@@ -677,23 +677,40 @@ var Topology = (function (_super) {
677
677
  return;
678
678
  var obj = JSON.parse(json);
679
679
  event.preventDefault();
680
- if (obj.name && obj.name == 'arbitraryGraph') {
681
- Store.set('addingArbitraryGraph', true);
682
- _this.addingArbitraryGraph = true;
683
- _this.dispatch('addingArbitraryGraph', true);
684
- return
680
+ if(obj.type && obj.type === 'temp') {
681
+ obj.locked = 0;
682
+ // 模板
683
+ _this.animateLayer.stop();
684
+ _this.closeMqtt();
685
+ _this.open(obj);
686
+ const tempData = {
687
+ name: obj.name,
688
+ component: obj.component,
689
+ image: obj.image,
690
+ useType: obj.useType,
691
+ data: JSON.parse(json)
692
+ };
693
+ delete tempData.data['pens'];
694
+ _this.dispatch('template', tempData);
695
+ }else {
696
+ if (obj.name && obj.name == 'arbitraryGraph') {
697
+ Store.set('addingArbitraryGraph', true);
698
+ _this.addingArbitraryGraph = true;
699
+ _this.dispatch('addingArbitraryGraph', true);
700
+ return
701
+ }
702
+ _this.addingArbitraryGraph = false;
703
+ Store.set('addingArbitraryGraph', false);
704
+ _this.arbitrarygGraphData = {
705
+ points: [],
706
+ circles: [],
707
+ indexCircle: 0, //当前点击的圆圈
708
+ oZindex: -1, //是否达到起点
709
+ isDragging: false, //是否在抓取
710
+ close: false, //闭合
711
+ };
712
+ _this.dropNodes(Array.isArray(obj) ? obj : [obj], event.offsetX, event.offsetY);
685
713
  }
686
- _this.addingArbitraryGraph = false;
687
- Store.set('addingArbitraryGraph', false);
688
- _this.arbitrarygGraphData = {
689
- points: [],
690
- circles: [],
691
- indexCircle: 0, //当前点击的圆圈
692
- oZindex: -1, //是否达到起点
693
- isDragging: false, //是否在抓取
694
- close: false, //闭合
695
- };
696
- _this.dropNodes(Array.isArray(obj) ? obj : [obj], event.offsetX, event.offsetY);
697
714
  } catch (_a) {
698
715
  }
699
716
  };
@@ -84,20 +84,20 @@ export function createDiv(node) {
84
84
  return div;
85
85
  }
86
86
 
87
- export function loadJS(url, callback, render) {
88
- var loaderScript = document.createElement('script');
89
- loaderScript.type = 'text/javascript';
90
- loaderScript.src = url;
91
- loaderScript.addEventListener('load', function () {
92
- if (callback) {
93
- callback();
94
- }
95
- // how to do
96
- if (render) {
97
- Store.set('LT:render', true);
98
- }
99
- });
100
- document.body.appendChild(loaderScript);
101
- }
87
+ // export function loadJS(url, callback, render) {
88
+ // var loaderScript = document.createElement('script');
89
+ // loaderScript.type = 'text/javascript';
90
+ // loaderScript.src = url;
91
+ // loaderScript.addEventListener('load', function () {
92
+ // if (callback) {
93
+ // callback();
94
+ // }
95
+ // // how to do
96
+ // if (render) {
97
+ // Store.set('LT:render', true);
98
+ // }
99
+ // });
100
+ // document.body.appendChild(loaderScript);
101
+ // }
102
102
 
103
103
  //# sourceMappingURL=dom.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcim-topology2d",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "",
5
5
  "main": "-",
6
6
  "scripts": {