@flexem/fc-gui 3.0.0-alpha.97 → 3.0.0-alpha.98

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.
@@ -32,6 +32,8 @@ export declare class HistoricalCurveElement extends ConditionalDisplayElement {
32
32
  private elementStatus;
33
33
  private chartElement;
34
34
  private isMobileMode;
35
+ private data;
36
+ private timer;
35
37
  constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, historyDataStore: HistoryDataStore, signalRAppId: string);
36
38
  dispose(): void;
37
39
  private getValidTimePeriods;
@@ -40,6 +42,7 @@ export declare class HistoricalCurveElement extends ConditionalDisplayElement {
40
42
  private reRenderElement;
41
43
  private renderElement;
42
44
  private renderChart;
45
+ initPoint(): void;
43
46
  private getLineChart;
44
47
  private getMultiBarWithFocusChart;
45
48
  private renderCommonProperty;
@@ -29,6 +29,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
29
29
  operationButtonMargin: 4
30
30
  };
31
31
  this.elementStatus = HistoricalCurveElementStatus.Loading;
32
+ this.data = [];
32
33
  this.logger = injector.get(LOGGER_SERVICE_TOKEN);
33
34
  this.localization = injector.get(LOCALIZATION);
34
35
  this.timePeriods = this.getValidTimePeriods();
@@ -140,6 +141,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
140
141
  each(result, v => values.push({ x: moment(v.time).local().toDate().valueOf(), y: v.values[key] }));
141
142
  data.push({ key: channel.name, area: channel.projectEnabled, values: values });
142
143
  });
144
+ this.data = data;
143
145
  nv.addGraph(() => {
144
146
  if (this.model.displaySetting.curveType === CurveType.BarGroup || this.model.displaySetting.curveType === CurveType.BarStack) {
145
147
  return this.getMultiBarWithFocusChart(chartWidth, chartHeight, data);
@@ -149,6 +151,50 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
149
151
  }
150
152
  });
151
153
  }
154
+ initPoint() {
155
+ try {
156
+ const legendList = this.$element
157
+ .find('.nv-legend')
158
+ .find('.nv-series');
159
+ let hiddenCount = 0;
160
+ for (let i = 0; i < this.data.length; i++) {
161
+ const channel = this.model.dataSetting.channels[i];
162
+ if (legendList.eq(i).children().eq(0).css('fill-opacity') === '1') {
163
+ const pointList = this.$element
164
+ .find('.nv-scatterWrap')
165
+ .find('.nv-series-' + (i - hiddenCount))
166
+ .find('.nv-point');
167
+ if (pointList && pointList.length) {
168
+ for (let j = 0; j < pointList.length; j++) {
169
+ const point = pointList.eq(j);
170
+ const previousPoint = pointList.eq(j - 1);
171
+ if (j && point.attr('transform').split(',')[1] !== previousPoint.attr('transform').split(',')[1]) {
172
+ if (channel.enablePoint && channel.pointColor) {
173
+ const pointStyle = {
174
+ 'stroke-opacity': 1,
175
+ 'stroke-width': '2px',
176
+ 'stroke': channel.pointColor,
177
+ 'fill-opacity': 1,
178
+ 'fill': channel.pointColor
179
+ };
180
+ point.addClass('nv-mark-point');
181
+ point.css(pointStyle);
182
+ previousPoint.addClass('nv-mark-point');
183
+ previousPoint.css(pointStyle);
184
+ }
185
+ }
186
+ }
187
+ }
188
+ }
189
+ else {
190
+ hiddenCount++;
191
+ }
192
+ }
193
+ }
194
+ catch (e) {
195
+ console.log(e);
196
+ }
197
+ }
152
198
  getLineChart(chartWidth, chartHeight, data) {
153
199
  const chart = nv.models.lineChart().showLegend(true)
154
200
  .margin({ top: 0, bottom: 0, left: this.displayOption.marginLeft, right: this.displayOption.marginRight })
@@ -164,6 +210,19 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
164
210
  }
165
211
  this.renderCommonProperty(chart, chartWidth, chartHeight, data);
166
212
  this.renderOperationArea(chartWidth, chartHeight);
213
+ this.initPoint();
214
+ chart.legend.dispatch.on('legendClick', () => {
215
+ setTimeout(() => {
216
+ this.$element.find('.nv-mark-point').css({
217
+ 'stroke-opacity': 0,
218
+ 'stroke-width': 0,
219
+ 'stroke': 'unset',
220
+ 'fill-opacity': 0,
221
+ 'fill': 'unset'
222
+ }).removeClass('nv-mark-point');
223
+ this.initPoint();
224
+ }, 1);
225
+ });
167
226
  return chart;
168
227
  }
169
228
  getMultiBarWithFocusChart(chartWidth, chartHeight, data) {
@@ -207,6 +266,18 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
207
266
  chart.tooltip.headerFormatter(d => this.timeFormat(d, '%x %X'));
208
267
  if (this.model.displaySetting.showAxis) {
209
268
  chart.xAxis.showMaxMin(true).tickFormat(d => {
269
+ this.$element.find('.nv-mark-point').css({
270
+ 'stroke-opacity': 0,
271
+ 'stroke-width': 0,
272
+ 'stroke': 'unset',
273
+ 'fill-opacity': 0,
274
+ 'fill': 'unset'
275
+ }).removeClass('nv-mark-point');
276
+ clearTimeout(this.timer);
277
+ this.timer = undefined;
278
+ this.timer = setTimeout(() => {
279
+ this.initPoint();
280
+ }, 100);
210
281
  if (this.currentTimePeriod === 3 || this.currentTimePeriod === 4 || this.currentTimePeriod === 5) {
211
282
  return this.timeFormat(d, '%y-%m-%d');
212
283
  }
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":21,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":63,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":64,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":65,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":66,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":67,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":68,"character":43},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"initElementStatus":[{"__symbolic":"method"}],"updateElementStatus":[{"__symbolic":"method"}],"setStatusAsUnbound":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"setStatusAsLoadFailed":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":21,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":65,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":66,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":67,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":68,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":69,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":70,"character":43},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"initPoint":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"initElementStatus":[{"__symbolic":"method"}],"updateElementStatus":[{"__symbolic":"method"}],"setStatusAsUnbound":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"setStatusAsLoadFailed":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
@@ -113,7 +113,12 @@ export class VideoElement extends ConditionalDisplayElement {
113
113
  else if (isIos) {
114
114
  this.setIosVideo(this.videoUrl, videoId);
115
115
  }
116
- this.videoPlayer = new EZUIPlayer(videoId);
116
+ try {
117
+ this.videoPlayer = new EZUIPlayer(videoId);
118
+ }
119
+ catch (err) {
120
+ console.log(err);
121
+ }
117
122
  }, 1000);
118
123
  const style = document.createElement('style');
119
124
  style.innerHTML = `#${videoId}::-webkit-media-controls-enclosure {
@@ -110,13 +110,24 @@ let WriteValueModalComponent = class WriteValueModalComponent {
110
110
  value = this.formatWriteValue();
111
111
  }
112
112
  }
113
+ if (!this.args.releasedVariableService) {
114
+ this.onClosed({
115
+ value: value,
116
+ showValue: showValue,
117
+ enableNumericalOperation: false,
118
+ isNumericalOperation: this.isNumericalOperation,
119
+ variableRwType: 6
120
+ });
121
+ return;
122
+ }
113
123
  this.args.releasedVariableService.getVariableWithValueTransform(this.variableName).subscribe(result => {
114
124
  const valueTransform = JSON.parse(result.valueTransform);
115
125
  if ((valueTransform === null || valueTransform === void 0 ? void 0 : valueTransform.Type) !== 0) {
116
126
  this.isNumericalOperation = true;
117
127
  }
118
128
  this.onClosed({
119
- value, showValue,
129
+ value: value,
130
+ showValue: showValue,
120
131
  enableNumericalOperation: this.enableNumericalOperation,
121
132
  isNumericalOperation: this.isNumericalOperation,
122
133
  variableRwType: result.variableRwType
@@ -7,6 +7,14 @@ export interface HistroicalCurveChannelModel {
7
7
  * 连接线颜色
8
8
  */
9
9
  readonly connectorColor: string;
10
+ /**
11
+ * 启用标记点
12
+ */
13
+ readonly enablePoint: boolean;
14
+ /**
15
+ * 标记点颜色
16
+ */
17
+ readonly pointColor: string;
10
18
  /**
11
19
  * 是否投影颜色
12
20
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "main": "bundles/fc-gui.umd.js",
3
- "version": "3.0.0-alpha.97",
3
+ "version": "3.0.0-alpha.98",
4
4
  "module": "public_api.js",
5
5
  "typings": "public_api.d.ts",
6
6
  "license": "UNLICENSED",