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

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.
@@ -151,7 +151,6 @@ export class AlarmElement extends ConditionalDisplayElement {
151
151
  }
152
152
  fontString += this.model.generalSetting.headerFont.fontSize + ' ' + this.model.generalSetting.headerFont.fontFamily;
153
153
  tr.style.cssText = `height: ${this.model.heights[0]}px;
154
- background: ${this.model.generalSetting.headerFillColor};
155
154
  color: ${this.model.generalSetting.headerFont.color};
156
155
  font: ${fontString};
157
156
  text-align: ${this.model.generalSetting.headerFont.textAlign};
@@ -171,7 +170,6 @@ export class AlarmElement extends ConditionalDisplayElement {
171
170
  for (let row = 0; row < this.pageSize; row++) {
172
171
  tr = document.createElement('tr');
173
172
  tr.style.cssText = `height: ${this.model.heights[row + 1]}px;
174
- background: ${this.model.generalSetting.tableFillColor};
175
173
  font: ${this.model.generalSetting.fontStyle};
176
174
  color: ${this.model.generalSetting.fontColor};
177
175
  text-align: ${this.model.generalSetting.textAlign};
@@ -251,18 +249,18 @@ export class AlarmElement extends ConditionalDisplayElement {
251
249
  }
252
250
  const buttonWidth = this.displayOption.operationButtonWidth + 'px', buttonHeight = this.displayOption.operationButtonHeight + 'px';
253
251
  operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
254
- .style('float', 'right').style('background', 'white').style('background-image', 'url(assets/img/last_page.svg)')
252
+ .style('float', 'right').style('background-image', 'url(assets/img/last_page.svg)')
255
253
  .on('click', () => { this.loadLastPage(); });
256
254
  operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
257
- .style('float', 'right').style('background', 'white').style('background-image', 'url(assets/img/next_page.svg)')
255
+ .style('float', 'right').style('background-image', 'url(assets/img/next_page.svg)')
258
256
  .style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
259
257
  .on('click', () => { this.loadNextPage(); });
260
258
  operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
261
- .style('float', 'right').style('background', 'white').style('background-image', 'url(assets/img/previous_page.svg)')
259
+ .style('float', 'right').style('background-image', 'url(assets/img/previous_page.svg)')
262
260
  .style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
263
261
  .on('click', () => { this.loadPreviousPage(); });
264
262
  operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
265
- .style('float', 'right').style('background', 'white').style('background-image', 'url(assets/img/first_page.svg)')
263
+ .style('float', 'right').style('background-image', 'url(assets/img/first_page.svg)')
266
264
  .style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
267
265
  .on('click', () => { this.loadFirstPage(); });
268
266
  this.setStatusAsNormal();
@@ -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
  }
@@ -341,27 +412,31 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
341
412
  .append('foreignObject').attr('width', chartWidth).attr('height', this.displayOption.operationAreaHeight).attr('fill', 'none')
342
413
  .append('xhtml:div').style('height', (this.displayOption.operationAreaHeight - 4) + 'px').style('overflow', 'hidden').style('margin-top', '4px');
343
414
  const selectElement = operationArea.append('select').style('margin-left', this.displayOption.marginLeft + 'px')
415
+ .style('background-color', 'inherit')
344
416
  .style('font-size', this.displayOption.operationSelectFontSize).on('change', () => {
345
417
  const displayTimePeriod = this.rootElement.select('select').property('value');
346
418
  this.updateTimeRange(displayTimePeriod);
347
419
  this.reRenderElement(this.startTime, this.endTime, this.displayOption.dataLimit, HistoricalCurveTimeRange.BeginOpenEndOpen);
348
420
  });
421
+ const rect = this.$element.parent().parent().find('rect');
422
+ const fillColor = rect.attr('fill');
349
423
  const options = selectElement.selectAll('option').data(this.timePeriods).enter().append('option');
350
- options.text(d => d.name).attr('value', d => d.key).property('selected', d => d.key === Number(this.currentTimePeriod));
424
+ options.text(d => d.name).attr('value', d => d.key).property('selected', d => d.key === Number(this.currentTimePeriod))
425
+ .style('background-color', fillColor);
351
426
  const buttonWidth = this.displayOption.operationButtonWidth + 'px', buttonHeight = this.displayOption.operationButtonHeight + 'px';
352
427
  operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
353
- .style('float', 'right').style('background', 'white').style('background-image', 'url(assets/img/last_page.svg)')
428
+ .style('float', 'right').style('background-image', 'url(assets/img/last_page.svg)')
354
429
  .on('click', () => { this.loadLastPage(); });
355
430
  operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
356
- .style('float', 'right').style('background', 'white').style('background-image', 'url(assets/img/next_page.svg)')
431
+ .style('float', 'right').style('background-image', 'url(assets/img/next_page.svg)')
357
432
  .style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
358
433
  .on('click', () => { this.loadNextPage(); });
359
434
  operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
360
- .style('float', 'right').style('background', 'white').style('background-image', 'url(assets/img/previous_page.svg)')
435
+ .style('float', 'right').style('background-image', 'url(assets/img/previous_page.svg)')
361
436
  .style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
362
437
  .on('click', () => { this.loadPreviousPage(); });
363
438
  operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
364
- .style('float', 'right').style('background', 'white').style('background-image', 'url(assets/img/first_page.svg)')
439
+ .style('float', 'right').style('background-image', 'url(assets/img/first_page.svg)')
365
440
  .style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
366
441
  .on('click', () => { this.loadFirstPage(); });
367
442
  }
@@ -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.99",
4
4
  "module": "public_api.js",
5
5
  "typings": "public_api.d.ts",
6
6
  "license": "UNLICENSED",