dcim-topology2d 2.1.0 → 2.2.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.
Files changed (63) hide show
  1. package/chart-diagram/index.d.ts +1 -1
  2. package/chart-diagram/index.js +1 -1
  3. package/chart-diagram/src/echarts/index.js +112 -109
  4. package/chart-diagram/src/utils/changeOptions.d.ts +8 -8
  5. package/chart-diagram/src/utils/changeOptions.js +8 -2
  6. package/chart-diagram/src/utils/conversion.d.ts +19 -19
  7. package/chart-diagram/src/utils/conversion.js +601 -559
  8. package/chart-diagram/src/utils/drawGraphic.d.ts +3 -3
  9. package/chart-diagram/src/utils/drawGraphic.js +97 -97
  10. package/chart-diagram/src/utils/index.d.ts +5 -5
  11. package/chart-diagram/src/utils/index.js +5 -5
  12. package/chart-diagram/src/utils/render.js +4 -0
  13. package/core/index.js +1 -19
  14. package/core/src/activeLayer.js +23 -23
  15. package/core/src/calling.js +32 -33
  16. package/core/src/common.d.ts +1 -0
  17. package/core/src/common.js +115 -83
  18. package/core/src/core.js +15 -1
  19. package/core/src/element/common.js +12 -4
  20. package/core/src/element/datePicker.js +13 -16
  21. package/core/src/element/select.d.ts +1 -1
  22. package/core/src/element/select.js +1 -3
  23. package/core/src/element/tab.js +3 -8
  24. package/core/src/healps/changeData.js +64 -41
  25. package/core/src/middles/default.js +49 -43
  26. package/core/src/middles/index.d.ts +1 -2
  27. package/core/src/middles/index.js +3 -2
  28. package/core/src/middles/nodes/formDatePicker.js +54 -12
  29. package/core/src/middles/nodes/formoverflow.js +17 -16
  30. package/core/src/middles/nodes/formselect.js +14 -5
  31. package/core/src/middles/nodes/index.d.ts +3 -1
  32. package/core/src/middles/nodes/index.js +2 -0
  33. package/core/src/middles/nodes/progress.d.ts +2 -0
  34. package/core/src/middles/nodes/progress.js +63 -0
  35. package/core/src/middles/nodes/progress.js.map +1 -0
  36. package/core/src/middles/nodes/rectangle.js +54 -15
  37. package/core/src/middles/nodes/switchs.d.ts +2 -0
  38. package/core/src/middles/nodes/switchs.js +46 -0
  39. package/core/src/models/line.js +7 -7
  40. package/core/src/models/node.js +90 -81
  41. package/core/src/models/pen.js +21 -12
  42. package/core/src/offscreen.js +19 -19
  43. package/core/src/preview.js +75 -40
  44. package/core/src/store/data.d.ts +11 -0
  45. package/core/src/store/data.js +11 -0
  46. package/core/src/utils/assignment.d.ts +1 -1
  47. package/core/src/utils/assignment.js +50 -6
  48. package/core/src/utils/construction.d.ts +24 -0
  49. package/core/src/utils/construction.js +22 -1
  50. package/core/src/utils/conversion.d.ts +2 -0
  51. package/core/src/utils/conversion.js +109 -0
  52. package/core/src/utils/math.d.ts +0 -1
  53. package/core/src/utils/math.js +0 -3
  54. package/core/src/utils/onmousevent.js +1 -1
  55. package/core/src/utils/params.d.ts +1 -0
  56. package/core/src/utils/params.js +75 -4
  57. package/package.json +1 -1
  58. package/static/echartsDefaultData.js +178 -178
  59. package/store/actions.js +2 -1
  60. package/store/clear.js +4 -0
  61. package/store/default.js +22 -0
  62. package/store/index.js +2 -1
  63. /package/myShape-diagram/{index.ts → index.d.ts} +0 -0
@@ -1,6 +1,114 @@
1
1
  import {commonStore} from '../store';
2
2
  import {setElementSwitchTabState} from '../element';
3
3
  import {echartsStaticType} from '../utils';
4
+ import {datePickerType, datePickerTypeList} from "../../../store";
5
+
6
+ /**
7
+ * yyyy-MM-dd 格式转换
8
+ * @param valueType 默认值类型:1-默认当天
9
+ * @returns {string}
10
+ */
11
+ // function yyyMMddFormatting(valueType) {
12
+ // if(valueType === 1){
13
+ // // 默认当天
14
+ // return new Date().toISOString().split('T')[0];
15
+ // }
16
+ // }
17
+
18
+ /**
19
+ * yyyy-MM-dd HH:mm:ss 格式转换
20
+ * @param valueType 默认值类型:1-默认当天
21
+ * @returns {string}
22
+ */
23
+ // function yyyMMddHHmmssFormatting(valueType) {
24
+ // if(valueType === 1){
25
+ // // 默认当天
26
+ // return new Date().toISOString().replace('T', ' ').substring(0, 19);
27
+ // }
28
+ // }
29
+
30
+ /**
31
+ * yyyy 格式转换
32
+ * @param valueType 默认值类型:1-默认当天
33
+ * @returns {number}
34
+ */
35
+ // function yyyFormatting(valueType) {
36
+ // if(valueType === 1){
37
+ // // 默认当天
38
+ // return new new Date().getFullYear();
39
+ // }
40
+ // }
41
+
42
+ /**
43
+ * yyyy-MM 格式转换
44
+ * @param valueType 默认值类型:1-默认当天
45
+ * @returns {string}
46
+ */
47
+ // function yyyMMFormatting(valueType) {
48
+ // if(valueType === 1){
49
+ // // 默认当天
50
+ // return new Date().toISOString().slice(0, 7);
51
+ // }
52
+ // }
53
+
54
+ /**
55
+ * HH:mm:ss 格式转换
56
+ * @param valueType 默认值类型:1-默认当天
57
+ * @returns {string}
58
+ */
59
+ // function hhmmssddFormatting(valueType) {
60
+ // if(valueType === 1){
61
+ // // 默认当天
62
+ // Date.prototype.formatTime = function() {
63
+ // return [this.getHours(), this.getMinutes(), this.getSeconds()]
64
+ // .map(v => v.toString().padStart(2, '0')).join(':');
65
+ // };
66
+ // return new Date().formatTime();
67
+ // }
68
+ // }
69
+ export function pageZoom() {
70
+ let screenWidth = 0;
71
+ if(window.screen.width < 1920) {
72
+ // 1920 * 1080分辨率以下的适配
73
+ const zoom = window.screen.width / 1920;
74
+ screenWidth = Math.round(window.screen.width / zoom);
75
+ }else {
76
+ screenWidth = window.screen.width;
77
+ }
78
+ const order = window.screen.width > 1280 ? 12 : 8; // 差值计算
79
+ return window.innerWidth < screenWidth ? (window.innerWidth - order) / screenWidth : 1;
80
+ }
81
+
82
+ /**
83
+ * 日期转换
84
+ * @param data: {formatType: '日期格式', valueType: '默认值类型'}
85
+ * @returns {string}
86
+ */
87
+ export function datePickerValueFormatting(data) {
88
+ if(!Object.keys(datePickerType).length) {
89
+ // 获取日期类型map数据
90
+ const params = datePickerTypeList.reduce((obj, item) => {
91
+ obj[item['id']] = item.format;
92
+ return obj;
93
+ }, {});
94
+ Object.assign(datePickerType, params);
95
+ }
96
+ let now = new Date(); // data.valueType === 1 默认
97
+ const map = {
98
+ yyyy: now.getFullYear(),
99
+ MM: String(now.getMonth() + 1).padStart(2, '0'),
100
+ dd: String(now.getDate()).padStart(2, '0'),
101
+ HH: String(now.getHours()).padStart(2, '0'),
102
+ mm: String(now.getMinutes()).padStart(2, '0'),
103
+ ss: String(now.getSeconds()).padStart(2, '0')
104
+ };
105
+ const date = data.dateType ? datePickerType[data.dateType].replace(/yyyy|MM|dd|HH|mm|ss/g, match => map[match]) : '';
106
+ const dateStr = data.formatType.replace(/yyyy|MM|dd|HH|mm|ss/g, match => map[match]);
107
+ return {
108
+ date,
109
+ dateStr
110
+ };
111
+ }
4
112
  // tab切换页签删除数据处理
5
113
  export function getTabConnectSHConf(node) {
6
114
  const switchTabType = node.tags.find((t) => {
@@ -82,6 +190,7 @@ export function tabHideShowOperation(node, areaData, isActive) {
82
190
  if(!(areaNode && pens[areaNode.order])) return;
83
191
  const tagNode = pens[areaNode.order];
84
192
  tagNode.visible = !isActive;
193
+ tagNode.visibleSwitch = tagNode.visible;
85
194
  setElementSwitchTabState(tagNode);
86
195
  }
87
196
  }
@@ -1,4 +1,3 @@
1
1
  export declare function pSBC(p: any, c0: any, c1?: any, l?: any): string;
2
2
  export declare function abs(num: number, percent: number | string): number;
3
3
  export declare function ptInPolyXY(pt: any, poly: []): boolean;
4
- export declare function jsonLength(obj: {}): number;
@@ -115,7 +115,4 @@ export function ptInPolyXY(pt, poly) {
115
115
  }
116
116
  return c;
117
117
  }
118
- export function jsonLength(obj) {
119
- return Object.keys(obj).length;
120
- }
121
118
  //# sourceMappingURL=math.js.map
@@ -77,7 +77,7 @@ export function mousDownFun(type, eventNode) {
77
77
  params.eventType = downDataType.Tabswitch; // Tab切换
78
78
  }else if(action === 11) {
79
79
  params.eventType = downDataType.Formselect; // select下拉切换
80
- params.staticType = eventNode.dcimStaticForType; // 1: 数据统计;2:数据展示;3:显示隐藏
80
+ // params.staticType = eventNode.dcimStaticForType; // 1: 数据统计;2:数据展示;3:显示隐藏;4:日期类型
81
81
  }else {
82
82
  // action === 5 远程控制比较特殊,无论是否绑定远程控制事件,只要数据中有远程控制属性且值为0都会认定为远程控制
83
83
  params.eventType = downDataType.Target; // 链接跳转
@@ -1,2 +1,3 @@
1
+ // @ts-ignore
1
2
  export declare function getParams(id: string, data: []): void;
2
3
  export declare function filterParams(node: any): void;
@@ -1,7 +1,11 @@
1
1
  import {commonStore} from '../store';
2
+ import {datePickerValueFormatting} from "./conversion";
3
+ import {datePickerBindType, confBindValueType} from "./construction";
4
+ const confConfigMap = new Map();
2
5
  // 获取绑定数据的参数
3
6
  export function getParams(id, data) {
4
- data.map((item) => {
7
+ for (let i = 0, length = data.length; i < length; i++) {
8
+ const item = data[i];
5
9
  filterParams(id, item);
6
10
  if (item.children && item.children.length) {
7
11
  getParams(id, item.children);
@@ -9,7 +13,8 @@ export function getParams(id, data) {
9
13
  if (item.formData && item.formData.detailPageData && item.formData.detailPageData.pens && item.formData.detailPageData.pens.length) {
10
14
  getParams(id, item.formData.detailPageData.pens);
11
15
  }
12
- });
16
+ }
17
+ confConfigMap.clear();
13
18
  }
14
19
  // 过滤出参数
15
20
  export function filterParams(id, node) {
@@ -23,36 +28,48 @@ export function filterParams(id, node) {
23
28
  let branchValue = [];
24
29
  let doorIds = [];
25
30
  let isMqttEventType = false;
31
+ let dcimStaticForType = '';
26
32
  node.events.map((ev) => {
27
33
  if(ev.value && ev.value === 'entranceGuard') doorIds.push(ev.params); // 门禁参数
28
34
  if(ev.type === 3) isMqttEventType = true;
35
+ if(ev.type === 4) dcimStaticForType = ev.dcimStaticForType;
29
36
  });
30
37
  if(doorIds.length) commonStore[id].mqttParams.doorIds = [...commonStore[id].mqttParams.doorIds, ...doorIds];
31
38
  if(!isMqttEventType) return;
32
39
  if (node.data && Array.isArray(node.data) && node.data.length) {
33
- node.data.map((item) => {
40
+ for (let i = 0, length = node.data.length; i < length; i ++) {
41
+ const item = node.data[i];
42
+ let type = 0;
34
43
  if (item.key === 'tagId') {
35
44
  tagIds.push(item.value);
45
+ type = datePickerBindType.tag;
36
46
  }
37
47
  if (item.key === 'kpiAddr') {
38
48
  kpiAddrs.push(item.value);
49
+ type = datePickerBindType.kpi;
39
50
  }
40
51
  if (item.key === 'assetId') {
41
52
  assetIds.push(item.value);
53
+ type = datePickerBindType.asset;
42
54
  }
43
55
  if (item.key === 'areaId') {
44
56
  areaIds.push(item.value);
57
+ type = datePickerBindType.area;
45
58
  }
46
59
  if (item.key.includes('varValue')) {
47
60
  varVaule.push(item.value);
61
+ type = datePickerBindType.varType;
48
62
  }
49
63
  if (item.key === 'branchVal') {
50
64
  branchValue.push(item.value);
65
+ type = datePickerBindType.branch;
51
66
  }
52
- })
67
+ if(dcimStaticForType && node.formData && type) setConfConfigMap(node.id, id, node.formData, item.value, type);
68
+ }
53
69
  }
54
70
  if (node.data && Object.prototype.toString.call(node.data) === '[object Object]' && node.data.params && node.data.params.id) {
55
71
  echartData.push(node.data.params.id);
72
+ if(dcimStaticForType && node.formData) setConfConfigMap(node.id, id, node.formData, node.data.params.id, 1);
56
73
  }
57
74
  commonStore[id].mqttParams.tagIds = [...commonStore[id].mqttParams.tagIds, ...tagIds];
58
75
  commonStore[id].mqttParams.kpiAddrs = [...commonStore[id].mqttParams.kpiAddrs, ...kpiAddrs];
@@ -62,4 +79,58 @@ export function filterParams(id, node) {
62
79
  commonStore[id].mqttParams.branchValue = [...commonStore[id].mqttParams.branchValue, ...branchValue];
63
80
  commonStore[id].mqttParams.tagEcharts = [...commonStore[id].mqttParams.tagEcharts, ...tagEcharts];
64
81
  commonStore[id].mqttParams.echartData = [...commonStore[id].mqttParams.echartData, ...echartData];
82
+ }
83
+
84
+ /**
85
+ * 设置绑定日期的配置数据
86
+ * @param formData 元件关联的日期数据
87
+ * @param id 当前元件id
88
+ * @param tid
89
+ * @param realData 当前元件绑定的数据
90
+ * @param type 当前元件绑定的数据类型 1:echart 3:测点 6:指标 9:资产 12:变量类型 15:支路地址 21:区域
91
+ */
92
+ function setConfConfigMap(id, tid, formData, realData, type) {
93
+ if(!formData.dateId) return;
94
+ const dateId = formData.dateId;
95
+ let value = null;
96
+ let valueStr = '';
97
+ if(confConfigMap.has(dateId)) {
98
+
99
+ const {date, dateStr} = confConfigMap.get(dateId);
100
+
101
+ value = date;
102
+
103
+ valueStr = dateStr;
104
+
105
+ }else {
106
+
107
+ const {date, dateStr} = datePickerValueFormatting({
108
+ formatType: formData.dateFormat,
109
+ valueType: formData.valueType,
110
+ dateType: formData.dateType
111
+ });
112
+
113
+ value = date;
114
+
115
+ valueStr = dateStr;
116
+
117
+ confConfigMap.set(dateId, {date, dateStr});
118
+
119
+ }
120
+ const dataConfig = commonStore[tid].mqttParams.dataConfig;
121
+ if(!dataConfig.data){
122
+ dataConfig.data = {};
123
+ dataConfig.picker = new Map();
124
+ }
125
+ dataConfig.data[id] = {
126
+ id: realData,
127
+ date: value,
128
+ dataType: type,
129
+ valueType: confBindValueType.increment
130
+ };
131
+ dataConfig.picker.set(id, {
132
+ dateId,
133
+ date: value,
134
+ dateStr: valueStr
135
+ });
65
136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcim-topology2d",
3
- "version": "2.1.0",
3
+ "version": "2.2.2",
4
4
  "description": "",
5
5
  "main": "-",
6
6
  "scripts": {
@@ -1,178 +1,178 @@
1
- // 图例默认数据
2
- export const echartsLegendDefaultData = {
3
- icon: 'rect', // 图标类型:'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none'
4
- itemWidth: 12, // 图标宽
5
- itemHeight: 12, // 图标高
6
- itemGap: 8, // 图例之间的间隔
7
- top: '0%', // 图例距离容器上边位置
8
- right: 'auto', // 图例距离容器右边位置
9
- bottom: 'auto', // 图例距离容器下边位置
10
- left: '60', // 图例距离容器左边位置
11
- padding: [20, 0, 0, 0], // 图例内边距 string
12
- color: '#fff', // 文字颜色
13
- height: 8, // 文本显示高度 number
14
- fontSize: 12 // 文字大小 number
15
- };
16
- // 柱状图和折线图默认标注
17
- export const echartsLineBarDefaultLegendData = {
18
- data: ['标注1'],
19
- icon: 'rich',
20
- show: true,
21
- itemWidth: 14,
22
- itemHeight: 14,
23
- textStyle: {
24
- color: '#C6D1DB',
25
- fontSize: '14px',
26
- },
27
- top: '12%',
28
- left: '10%',
29
- itemGap: 8
30
- };
31
- // 曲线默认配置数据
32
- export const echartsLineSeriesStyleData = {
33
- smooth: false,
34
- symbol: 'none',
35
- symbolSize: 18,
36
- itemLineStyle:{
37
- color: '#2F86ED', //改变折线颜色
38
- type: 'solid',
39
- width: 1
40
- },
41
- area: false, // 是否是区域图
42
- linear: false, // 是否是线性渐变
43
- areaColor: {
44
- type: 'linear',
45
- x: 0,
46
- y: 0,
47
- x2: 0,
48
- y2: 1,
49
- global: false // 缺省为 false
50
- },
51
- areaColorStops:[{
52
- offset: 0,
53
- color: 'rgba(49, 144, 255, 0.21)' // 0% 处的颜色
54
- }, {
55
- offset: 1,
56
- color: 'rgba(49, 144, 255, 0)' // 100% 处的颜色
57
- }]
58
- }
59
- // 图表X轴默认配置数据
60
- export const echartsXAxisDefaultStyleData = {
61
- x1AxisLabel: {
62
- color: '#fff',
63
- fontSize:"12"
64
- }
65
- }
66
- // 图表Y轴默认配置数据
67
- export const echartsYAxisDefaultStyleData = {
68
- ySplitLineShow: true, // y轴轴线是否显示
69
- //坐标轴线样式
70
- ysplitLineLineStyle: {
71
- type: 'solid', //solid实线;dashed虚线
72
- color: 'rgba(148, 147, 197, 0.5)'
73
- },
74
- y1axisLabelTextStyle: {
75
- //坐标轴颜色
76
- color: '#fff',
77
- fontSize:"12",
78
- padding: 5
79
- },
80
- // y轴刻度最大最小值和分隔值
81
- y1MinMaxData: {
82
- min: 0,
83
- max: 60,
84
- interval: 20
85
- },
86
- // y轴名称
87
- y1NameData: {
88
- name: '℃',
89
- nameTextStyle: {
90
- color: '#FDFDFD',
91
- padding: [0, 0, 0, -52],
92
- },
93
- nameGap: 25
94
- },
95
- // y轴刻度标签文字样式
96
- y2axisLabelTextStyle: {
97
- //坐标轴颜色
98
- color: '#fff',
99
- fontSize:"12",
100
- padding: 5
101
- },
102
- y2MinMaxData: {
103
- name: '%',
104
- nameTextStyle: {
105
- color: '#FDFDFD',
106
- padding: [0, -42, 0, 0],
107
- },
108
- nameGap: 25
109
- },
110
- y2NameData: {
111
- min: 0,
112
- max: 90,
113
- interval: 30
114
- }
115
- }
116
- // 图表的数据缩放
117
- export const echartsDataRoom = [{ //给x轴设置滚动条
118
- start: 0, //默认为0
119
- end: 50, //默认为100
120
- type: 'slider',
121
- show: false,
122
- xAxisIndex: [0],
123
- handleSize: 10, //滑动条的 左右2个滑动条的大小
124
- height: 0, //组件高度
125
- }, { //下面这个属性是里面拖到
126
- type: 'inside',
127
- show: true,
128
- xAxisIndex: [0],
129
- start: 0, //默认为1
130
- end: 50 // 100 - 1500 / 31, //默认为100
131
- }];
132
- // 图表类型Map
133
- export const echartsTypeMap = {
134
- 'type_1': 'line',
135
- 'type_2': 'bar',
136
- 'type_3': 'ring',
137
- 'type_4': 'TOP',
138
- 'type_5': 'pie',
139
- 'type_6': 'gauge'
140
- };
141
- // 图表颜色
142
- export const echartsColorData = [
143
- '#2648E9',
144
- '#E513F7',
145
- '#79E10E',
146
- '#0D9BE7',
147
- '#23CEE2',
148
- '#E5B903',
149
- '#2BDB8E',
150
- '#CAD804',
151
- '#117BEE',
152
- '#DB8407',
153
- '#E72B2B',
154
- '#E96812',
155
- '#7612D6',
156
- '#A117B8',
157
- 'rgb(21, 151, 224)',
158
- 'rgb(36, 220, 132)',
159
- 'rgb(154, 77, 251)',
160
- 'rgb(226, 182, 56)',
161
- 'rgb(253, 92, 71)',
162
- 'rgb(175, 215, 14)',
163
- 'rgb(214, 154, 37)',
164
- 'rgb(66, 251, 251)',
165
- 'rgb(255, 158, 4)',
166
- 'rgb(19, 236, 236)',
167
- 'rgb(68, 237, 146)',
168
- 'rgb(251, 94, 45)',
169
- 'rgb(18, 255, 113)'];
170
- // TOP排行榜默认颜色
171
- export const rankingTopColorList = [
172
- 'rgba(239, 120, 66, .6)',
173
- 'rgba(255, 225, 65, .5)',
174
- 'rgba(55, 240, 151, .5)',
175
- 'rgba(72, 211, 255, .6)',
176
- 'rgba(67, 153, 255, .5)'
177
- ];
178
- export const rankingTopImageName = ['orange', 'yellow', 'ching', 'lightBlue', 'blue'];
1
+ // 图例默认数据
2
+ export const echartsLegendDefaultData = {
3
+ icon: 'rect', // 图标类型:'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none'
4
+ itemWidth: 12, // 图标宽
5
+ itemHeight: 12, // 图标高
6
+ itemGap: 8, // 图例之间的间隔
7
+ top: '0%', // 图例距离容器上边位置
8
+ right: 'auto', // 图例距离容器右边位置
9
+ bottom: 'auto', // 图例距离容器下边位置
10
+ left: '60', // 图例距离容器左边位置
11
+ padding: [20, 0, 0, 0], // 图例内边距 string
12
+ color: '#fff', // 文字颜色
13
+ height: 8, // 文本显示高度 number
14
+ fontSize: 12 // 文字大小 number
15
+ };
16
+ // 柱状图和折线图默认标注
17
+ export const echartsLineBarDefaultLegendData = {
18
+ data: ['标注1'],
19
+ icon: 'rich',
20
+ show: true,
21
+ itemWidth: 14,
22
+ itemHeight: 14,
23
+ textStyle: {
24
+ color: '#C6D1DB',
25
+ fontSize: '14px',
26
+ },
27
+ top: '12%',
28
+ left: '10%',
29
+ itemGap: 8
30
+ };
31
+ // 曲线默认配置数据
32
+ export const echartsLineSeriesStyleData = {
33
+ smooth: false,
34
+ symbol: 'none',
35
+ symbolSize: 18,
36
+ itemLineStyle:{
37
+ color: '#2F86ED', //改变折线颜色
38
+ type: 'solid',
39
+ width: 1
40
+ },
41
+ area: false, // 是否是区域图
42
+ linear: false, // 是否是线性渐变
43
+ areaColor: {
44
+ type: 'linear',
45
+ x: 0,
46
+ y: 0,
47
+ x2: 0,
48
+ y2: 1,
49
+ global: false // 缺省为 false
50
+ },
51
+ areaColorStops:[{
52
+ offset: 0,
53
+ color: 'rgba(49, 144, 255, 0.21)' // 0% 处的颜色
54
+ }, {
55
+ offset: 1,
56
+ color: 'rgba(49, 144, 255, 0)' // 100% 处的颜色
57
+ }]
58
+ }
59
+ // 图表X轴默认配置数据
60
+ export const echartsXAxisDefaultStyleData = {
61
+ x1AxisLabel: {
62
+ color: '#fff',
63
+ fontSize:"12"
64
+ }
65
+ }
66
+ // 图表Y轴默认配置数据
67
+ export const echartsYAxisDefaultStyleData = {
68
+ ySplitLineShow: true, // y轴轴线是否显示
69
+ //坐标轴线样式
70
+ ysplitLineLineStyle: {
71
+ type: 'solid', //solid实线;dashed虚线
72
+ color: 'rgba(148, 147, 197, 0.5)'
73
+ },
74
+ y1axisLabelTextStyle: {
75
+ //坐标轴颜色
76
+ color: '#fff',
77
+ fontSize:"12",
78
+ padding: 5
79
+ },
80
+ // y轴刻度最大最小值和分隔值
81
+ y1MinMaxData: {
82
+ min: 0,
83
+ max: 60,
84
+ interval: 20
85
+ },
86
+ // y轴名称
87
+ y1NameData: {
88
+ name: '℃',
89
+ nameTextStyle: {
90
+ color: '#FDFDFD',
91
+ padding: [0, 0, 0, -52],
92
+ },
93
+ nameGap: 25
94
+ },
95
+ // y轴刻度标签文字样式
96
+ y2axisLabelTextStyle: {
97
+ //坐标轴颜色
98
+ color: '#fff',
99
+ fontSize:"12",
100
+ padding: 5
101
+ },
102
+ y2MinMaxData: {
103
+ name: '%',
104
+ nameTextStyle: {
105
+ color: '#FDFDFD',
106
+ padding: [0, -42, 0, 0],
107
+ },
108
+ nameGap: 25
109
+ },
110
+ y2NameData: {
111
+ min: 0,
112
+ max: 90,
113
+ interval: 30
114
+ }
115
+ }
116
+ // 图表的数据缩放
117
+ export const echartsDataRoom = [{ //给x轴设置滚动条
118
+ start: 0, //默认为0
119
+ end: 50, //默认为100
120
+ type: 'slider',
121
+ show: false,
122
+ xAxisIndex: [0],
123
+ handleSize: 10, //滑动条的 左右2个滑动条的大小
124
+ height: 0, //组件高度
125
+ }, { //下面这个属性是里面拖到
126
+ type: 'inside',
127
+ show: true,
128
+ xAxisIndex: [0],
129
+ start: 0, //默认为1
130
+ end: 50 // 100 - 1500 / 31, //默认为100
131
+ }];
132
+ // 图表类型Map
133
+ export const echartsTypeMap = {
134
+ 'type_1': 'line',
135
+ 'type_2': 'bar',
136
+ 'type_3': 'ring',
137
+ 'type_4': 'TOP',
138
+ 'type_5': 'pie',
139
+ 'type_6': 'gauge'
140
+ };
141
+ // 图表颜色
142
+ export const echartsColorData = [
143
+ '#2648E9',
144
+ '#E513F7',
145
+ '#79E10E',
146
+ '#0D9BE7',
147
+ '#23CEE2',
148
+ '#E5B903',
149
+ '#2BDB8E',
150
+ '#CAD804',
151
+ '#117BEE',
152
+ '#DB8407',
153
+ '#E72B2B',
154
+ '#E96812',
155
+ '#7612D6',
156
+ '#A117B8',
157
+ 'rgb(21, 151, 224)',
158
+ 'rgb(36, 220, 132)',
159
+ 'rgb(154, 77, 251)',
160
+ 'rgb(226, 182, 56)',
161
+ 'rgb(253, 92, 71)',
162
+ 'rgb(175, 215, 14)',
163
+ 'rgb(214, 154, 37)',
164
+ 'rgb(66, 251, 251)',
165
+ 'rgb(255, 158, 4)',
166
+ 'rgb(19, 236, 236)',
167
+ 'rgb(68, 237, 146)',
168
+ 'rgb(251, 94, 45)',
169
+ 'rgb(18, 255, 113)'];
170
+ // TOP排行榜默认颜色
171
+ export const rankingTopColorList = [
172
+ 'rgba(239, 120, 66, .6)',
173
+ 'rgba(255, 225, 65, .5)',
174
+ 'rgba(55, 240, 151, .5)',
175
+ 'rgba(72, 211, 255, .6)',
176
+ 'rgba(67, 153, 255, .5)'
177
+ ];
178
+ export const rankingTopImageName = ['orange', 'yellow', 'ching', 'lightBlue', 'blue'];
package/store/actions.js CHANGED
@@ -1 +1,2 @@
1
- export const plugsPool = {};
1
+ export const plugsPool = {};
2
+ export const tabsPageContentData = {};
package/store/clear.js CHANGED
@@ -1,5 +1,9 @@
1
1
  import {setEventListener} from "../core";
2
+ import {tabsPageContentData} from "./actions";
2
3
  export const removeAllElement = function (){
4
+ for (let key of Object.keys(tabsPageContentData)) {
5
+ delete tabsPageContentData[key];
6
+ }
3
7
  const documentDefineEle = document.querySelectorAll('.documentDefine');
4
8
  if(documentDefineEle) {
5
9
  documentDefineEle.forEach(function(element) {