evui 3.4.22 → 3.4.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evui",
3
- "version": "3.4.22",
3
+ "version": "3.4.23",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
@@ -113,6 +113,7 @@ class EvChart {
113
113
  }
114
114
 
115
115
  if (realTimeScatter?.use) {
116
+ this.dataSet = {};
116
117
  this.createRealTimeScatterDataSet(data);
117
118
  } else {
118
119
  this.createDataSet(data, labels);
@@ -723,6 +724,7 @@ class EvChart {
723
724
 
724
725
  this.resetProps();
725
726
 
727
+ this.updateSeries = updateSeries;
726
728
  if (updateSeries) {
727
729
  this.seriesInfo = null;
728
730
  this.seriesList = null;
@@ -71,10 +71,6 @@ const modules = {
71
71
  createRealTimeScatterDataSet(datas) {
72
72
  const keys = Object.keys(datas);
73
73
 
74
- if (!this.isInit) {
75
- this.dataSet = {};
76
- }
77
-
78
74
  const minMaxValues = {
79
75
  maxY: 0,
80
76
  minY: Infinity,
@@ -88,8 +84,8 @@ const modules = {
88
84
  const storeLength = data.length;
89
85
  let lastTime = 0;
90
86
 
91
- if (!this.isInit) {
92
- this.dataSet[key] = {
87
+ if (!this.isInit || this.updateSeries) {
88
+ const defaultValues = {
93
89
  dataGroup: [],
94
90
  startIndex: 0,
95
91
  endIndex: 0,
@@ -97,6 +93,11 @@ const modules = {
97
93
  fromTime: 0,
98
94
  toTime: 0,
99
95
  };
96
+
97
+ this.dataSet[key] = {
98
+ ...defaultValues,
99
+ ...this.dataSet[key],
100
+ };
100
101
  this.dataSet[key].length = this.options.realTimeScatter.range || 300;
101
102
  this.dataSet[key].toTime = Math.floor(Date.now() / 1000) * 1000;
102
103
  this.dataSet[key].fromTime = this.dataSet[key].toTime
@@ -127,13 +128,18 @@ const modules = {
127
128
  - this.dataSet[key].length * 1000;
128
129
  }
129
130
 
130
- if (!this.isInit) {
131
+ if (!this.isInit || this.updateSeries) {
131
132
  for (let i = 0; i < this.dataSet[key].length; i++) {
132
- this.dataSet[key].dataGroup[i] = {
133
+ const defaultValues = {
133
134
  data: [],
134
135
  max: 0,
135
136
  min: Infinity,
136
137
  };
138
+
139
+ this.dataSet[key].dataGroup[i] = {
140
+ ...defaultValues,
141
+ ...this.dataSet[key].dataGroup[i],
142
+ };
137
143
  }
138
144
  } else if (gapCount > 0) {
139
145
  if (gapCount >= this.dataSet[key].length) {
@@ -160,10 +160,12 @@
160
160
  disabled: item.disabled
161
161
  }"
162
162
  :title="item.name"
163
- @click.self.prevent="[clickItem(item.value), changeDropboxPosition()]"
163
+ @click.self.prevent="item.disabled
164
+ ? [] : [clickItem(item.value), changeDropboxPosition()]"
164
165
  >
165
166
  <ev-checkbox
166
167
  :label="item.value"
168
+ :disabled="item.disabled"
167
169
  >
168
170
  <i
169
171
  v-if="item.iconClass"
@@ -194,10 +196,12 @@
194
196
  disabled: item.disabled
195
197
  }"
196
198
  :title="item.name"
197
- @click.stop.prevent="[clickItem(item.value), changeDropboxPosition()]"
199
+ @click.stop.prevent="item.disabled
200
+ ? [] : [clickItem(item.value), changeDropboxPosition()]"
198
201
  >
199
202
  <ev-checkbox
200
203
  :model-value="mv === item.value"
204
+ :disabled="item.disabled"
201
205
  >
202
206
  <i
203
207
  v-if="item.iconClass"
@@ -228,7 +232,8 @@
228
232
  disabled: item.disabled
229
233
  }"
230
234
  :title="item.name"
231
- @click.stop.prevent="[clickItem(item.value), changeDropboxPosition()]"
235
+ @click.stop.prevent="item.disabled
236
+ ? [] : [clickItem(item.value), changeDropboxPosition()]"
232
237
  >
233
238
  <i
234
239
  v-if="item.iconClass"
@@ -541,6 +546,7 @@ export default {
541
546
  &.disabled {
542
547
  opacity: 1;
543
548
  color: #C0C4CC;
549
+ cursor: not-allowed;
544
550
  }
545
551
  }
546
552
 
@@ -232,7 +232,7 @@ export const useDropdown = (param) => {
232
232
  allCheck.value = !allCheck.value;
233
233
  }
234
234
  if (allCheck.value) {
235
- mv.value = filteredItems.value.map(item => item.value);
235
+ mv.value = filteredItems.value.filter(item => !item.disabled).map(item => item.value);
236
236
  } else {
237
237
  mv.value = [];
238
238
  }
@@ -261,7 +261,7 @@ export const useDropdown = (param) => {
261
261
  const idx = mv.value.indexOf(val);
262
262
  mv.value.splice(idx, 1);
263
263
  }
264
- allCheck.value = mv.value.length === filteredItems.value.length;
264
+ allCheck.value = mv.value.length === filteredItems.value.filter(item => !item.disabled).length;
265
265
  changeMv();
266
266
  };
267
267
  const clickItem = !props.multiple ? singleClickItem : multipleClickItem;
@@ -277,7 +277,7 @@ export const useDropdown = (param) => {
277
277
 
278
278
  watch(() => mv.value, (curr) => {
279
279
  if (props.multiple && props.checkable) {
280
- allCheck.value = curr.length === filteredItems.value.length;
280
+ allCheck.value = curr.length === filteredItems.value.filter(item => !item.disabled).length;
281
281
  changeDropboxPosition();
282
282
  }
283
283
  });