@flexem/fc-gui 3.0.0-alpha.66 → 3.0.0-alpha.67

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/CHANGELOG.md CHANGED
@@ -274,4 +274,18 @@
274
274
  ### Web端
275
275
  #### Bug Fix
276
276
  1. FLEXCLOUD-2487: 【线上问题】数据库连接池占满导致无响应的问题
277
- - 去掉没有位置信息时的定时器
277
+ - 去掉没有位置信息时的定时器
278
+
279
+ ## 3.0.0-alpha.67(2023-03-06)
280
+ ### Web端
281
+ #### Bug Fix
282
+ 1. FLEXCLOUD-2484 告警等级提示应汉化
283
+ 2. FLEXCLOUD-2493 首次打开模板,字体属性下拉框字被填充框遮挡
284
+ 3. FLEXCLOUD-2495 模板中添加未关联告警的告警表元件,导致不显示组态中配置的画面
285
+ 4. FLEXCLOUD-2497 报警表表头、表格内容向右对齐后格式错误,不显示表格内容
286
+ 5. FLEXCLOUD-2498 告警表线框中线条颜色较浅,可参考表格中颜色配置
287
+ 6. FLEXCLOUD-2500 告警表配置当前报警,无数据时点击切换分页按钮,报错“您的请求无效!”
288
+ 7. FLEXCLOUD-2501 模拟组态画面、刷新组态不应闪烁原型画面
289
+ 8. FLEXCLOUD-2502 编辑告警表时,应保留上一次告警组与告警等级的选择
290
+ 9. FLEXCLOUD-2503 切换告警类型报警勾选框应重置,让客户手动勾选告警监控点
291
+ 10. FLEXCLOUD-2505 组态元件有a控制权限,用户有a组态权限,设备仪表盘中不显示告警元件
@@ -40043,6 +40043,7 @@ var AlarmState;
40043
40043
 
40044
40044
  class alarm_element_AlarmElement extends conditional_display_element_ConditionalDisplayElement {
40045
40045
  constructor(element, injector, permissionChecker, variableCommunicator, variableStore, alarmsStore, signalRAppId) {
40046
+ var _a, _b;
40046
40047
  super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
40047
40048
  this.alarmsStore = alarmsStore;
40048
40049
  this.displayOption = {
@@ -40067,54 +40068,61 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
40067
40068
  this.localization = injector.get(_tmp_localization["b" /* LOCALIZATION */]);
40068
40069
  this.variableCommunicator = variableCommunicator;
40069
40070
  this.timePeriods = this.getValidTimePeriods();
40070
- this.currentTimePeriod = this.model.filterSetting.refreshCycle;
40071
40071
  this.pageSize = this.model.generalSetting.pageSize;
40072
- this.currentTimePeriod = this.model.filterSetting.displayPeriod;
40073
- this.updateQueryTimeRange();
40074
- if (this.model.filterSetting.alarmType) {
40075
- this.refreshIntervalId = setInterval(() => {
40076
- this.loadFirstPage();
40077
- this.logger.debug(`[GUI]Refresh Alarm Table:${d3["time"].format('%x %X')(new Date())}`);
40078
- }, this.model.filterSetting.refreshCycle * 60 * 1000);
40079
- }
40080
- else {
40081
- variableCommunicator.subscribeUserDeviceAlarms(signalRAppId).subscribe(alarmWithAppId => {
40082
- if (alarmWithAppId.appId !== this.signalRAppId) {
40083
- return;
40084
- }
40085
- const alarm = alarmWithAppId.alarm;
40086
- if (!Object(lodash["find"])(this.model.filterSetting.detailsData, alarmName => alarmName === alarm.name)) {
40087
- return;
40088
- }
40089
- const currentAlarm = this.currentAlarmList.find(re => re.name === alarm.name);
40090
- if (alarm.state === AlarmState.AlarmStateTriggered.valueOf()) {
40091
- if (!Object(lodash["isNil"])(currentAlarm)) {
40072
+ if (this.model.filterSetting) {
40073
+ this.currentTimePeriod = (_a = this.model.filterSetting) === null || _a === void 0 ? void 0 : _a.refreshCycle;
40074
+ this.currentTimePeriod = (_b = this.model.filterSetting) === null || _b === void 0 ? void 0 : _b.displayPeriod;
40075
+ this.updateQueryTimeRange();
40076
+ if (this.model.filterSetting.alarmType) {
40077
+ this.refreshIntervalId = setInterval(() => {
40078
+ this.loadFirstPage();
40079
+ this.logger.debug(`[GUI]Refresh Alarm Table:${d3["time"].format('%x %X')(new Date())}`);
40080
+ }, this.model.filterSetting.refreshCycle * 60 * 1000);
40081
+ }
40082
+ else {
40083
+ variableCommunicator.subscribeUserDeviceAlarms(signalRAppId).subscribe(alarmWithAppId => {
40084
+ if (alarmWithAppId.appId !== this.signalRAppId) {
40092
40085
  return;
40093
40086
  }
40094
- Object(lodash["pull"])(this.currentAlarmList, this.currentAlarmList.find(record => alarm.name === record.name));
40095
- this.currentAlarmList.unshift(alarm);
40096
- this.totalCount += 1;
40097
- }
40098
- else {
40099
- if (Object(lodash["isNil"])(currentAlarm)) {
40087
+ const alarm = alarmWithAppId.alarm;
40088
+ if (!Object(lodash["find"])(this.model.filterSetting.detailsData, alarmName => alarmName === alarm.name)) {
40100
40089
  return;
40101
40090
  }
40102
- Object(lodash["remove"])(this.currentAlarmList, currentAlarm);
40103
- this.totalCount -= 1;
40104
- }
40105
- this.alarmList = [];
40106
- this.currentAlarmList.forEach(item => {
40107
- this.alarmList.push([
40108
- item.name,
40109
- item.message,
40110
- item.alarmLevel,
40111
- moment(item.triggeredTime).format('YYYY-MM-DD HH:mm:ss')
40112
- ]);
40091
+ const currentAlarm = this.currentAlarmList.find(re => re.name === alarm.name);
40092
+ if (alarm.state === AlarmState.AlarmStateTriggered.valueOf()) {
40093
+ if (!Object(lodash["isNil"])(currentAlarm)) {
40094
+ return;
40095
+ }
40096
+ Object(lodash["pull"])(this.currentAlarmList, this.currentAlarmList.find(record => alarm.name === record.name));
40097
+ this.currentAlarmList.unshift(alarm);
40098
+ this.totalCount += 1;
40099
+ }
40100
+ else {
40101
+ if (Object(lodash["isNil"])(currentAlarm)) {
40102
+ return;
40103
+ }
40104
+ Object(lodash["remove"])(this.currentAlarmList, currentAlarm);
40105
+ this.totalCount -= 1;
40106
+ }
40107
+ this.alarmList = [];
40108
+ this.currentAlarmList.forEach(item => {
40109
+ this.alarmList.push([
40110
+ item.name,
40111
+ item.message,
40112
+ item.alarmLevel,
40113
+ moment(item.triggeredTime).format('YYYY-MM-DD HH:mm:ss')
40114
+ ]);
40115
+ });
40116
+ this.renderElement();
40113
40117
  });
40114
- this.renderElement();
40115
- });
40118
+ }
40119
+ this.init();
40120
+ }
40121
+ else {
40122
+ this.totalCount = 0;
40123
+ this.alarmList = [];
40124
+ this.renderElement();
40116
40125
  }
40117
- this.init();
40118
40126
  }
40119
40127
  dispose() {
40120
40128
  clearInterval(this.refreshIntervalId);
@@ -40135,40 +40143,45 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
40135
40143
  return timePeriods;
40136
40144
  }
40137
40145
  init() {
40146
+ this.rootElement.selectAll('*').remove();
40138
40147
  if (this.model.filterSetting.alarmType) {
40139
40148
  const input = new _tmp_config["c" /* GetAlarmsArgs */](this.model.filterSetting.detailsData, this.startTime, this.endTime, this.pageSize, this.page * this.pageSize);
40140
40149
  this.alarmsStore.getHistoryAlarms(input).subscribe(result => {
40141
- this.totalCount = result.totalCount;
40142
- this.alarmList = result.items.map(item => [
40143
- item.name,
40144
- item.message,
40145
- item.alarmLevel,
40146
- item.triggeredTime.format('YYYY-MM-DD HH:mm:ss')
40147
- ]);
40148
- this.renderElement();
40150
+ if (!result.error) {
40151
+ this.totalCount = result.totalCount;
40152
+ this.alarmList = result.items.map(item => [
40153
+ item.name,
40154
+ item.message,
40155
+ item.alarmLevel,
40156
+ item.triggeredTime.format('YYYY-MM-DD HH:mm:ss')
40157
+ ]);
40158
+ this.renderElement();
40159
+ }
40149
40160
  });
40150
40161
  }
40151
40162
  else {
40152
40163
  const input = new _tmp_config["c" /* GetAlarmsArgs */](this.model.filterSetting.detailsData, undefined, undefined, this.pageSize, this.page * this.pageSize);
40153
40164
  this.alarmsStore.getCurrentAlarms(input).subscribe(result => {
40154
- this.totalCount = result.totalCount;
40155
- this.currentAlarmList = result.items;
40156
- this.alarmList = this.currentAlarmList.map(item => [
40157
- item.name,
40158
- item.message,
40159
- item.alarmLevel,
40160
- item.triggeredTime.format('YYYY-MM-DD HH:mm:ss')
40161
- ]);
40162
- this.renderElement();
40165
+ if (!result.error) {
40166
+ this.totalCount = result.totalCount;
40167
+ this.currentAlarmList = result.items;
40168
+ this.alarmList = this.currentAlarmList.map(item => [
40169
+ item.name,
40170
+ item.message,
40171
+ item.alarmLevel,
40172
+ item.triggeredTime.format('YYYY-MM-DD HH:mm:ss')
40173
+ ]);
40174
+ this.renderElement();
40175
+ }
40163
40176
  });
40164
40177
  }
40165
40178
  }
40166
40179
  renderElement() {
40167
- this.rootElement.selectAll('*').remove();
40168
40180
  const elementHeight = this.model.size.height;
40169
40181
  this.element = document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject');
40170
40182
  this.element.setAttribute('width', this.model.size.width.toString());
40171
40183
  this.element.setAttribute('height', elementHeight.toString());
40184
+ this.$element.append(this.element);
40172
40185
  const table = document.createElement('table');
40173
40186
  table.style.cssText = `border: 2px solid ${this.model.generalSetting.stroke};
40174
40187
  height: ${elementHeight - 39}`;
@@ -40250,14 +40263,14 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
40250
40263
  table.appendChild(tr);
40251
40264
  }
40252
40265
  this.element.appendChild(table);
40253
- this.$element.append(this.element);
40254
40266
  this.renderOperationArea(this.model.size.width, elementHeight - 39);
40255
40267
  }
40256
40268
  renderOperationArea(chartWidth, chartHeight) {
40269
+ var _a;
40257
40270
  const operationArea = this.rootElement.append('g').attr('transform', `translate(0,${chartHeight + this.displayOption.operationAreaMarginTop})`)
40258
40271
  .append('foreignObject').attr('width', chartWidth).attr('height', this.displayOption.operationAreaHeight).attr('fill', 'none')
40259
40272
  .append('xhtml:div').style('height', (this.displayOption.operationAreaHeight - 4) + 'px').style('overflow', 'hidden').style('margin-top', '4px');
40260
- if (this.model.filterSetting.alarmType) {
40273
+ if ((_a = this.model.filterSetting) === null || _a === void 0 ? void 0 : _a.alarmType) {
40261
40274
  const selectElement = operationArea.append('select').style('margin-left', this.displayOption.marginLeft + 'px')
40262
40275
  .style('font-size', this.displayOption.operationSelectFontSize).on('change', () => {
40263
40276
  const displayTimePeriod = this.rootElement.select('select').property('value');
@@ -40318,7 +40331,9 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
40318
40331
  this.init();
40319
40332
  }
40320
40333
  loadNextPage() {
40321
- const last_page = Math.ceil(this.totalCount / this.pageSize) - 1;
40334
+ let last_page = Math.ceil(this.totalCount / this.pageSize);
40335
+ if (last_page)
40336
+ last_page--;
40322
40337
  if (this.page < last_page) {
40323
40338
  this.page++;
40324
40339
  }
@@ -40331,7 +40346,10 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
40331
40346
  this.init();
40332
40347
  }
40333
40348
  loadLastPage() {
40334
- this.page = Math.ceil(this.totalCount / this.pageSize) - 1;
40349
+ let last_page = Math.ceil(this.totalCount / this.pageSize);
40350
+ if (last_page)
40351
+ last_page--;
40352
+ this.page = last_page;
40335
40353
  this.init();
40336
40354
  }
40337
40355
  }