@flexem/fc-gui 3.0.0-alpha.175 → 3.0.0-alpha.177

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.
@@ -22319,6 +22319,7 @@ const Localization_zh_CN = {
22319
22319
  loadFailed: '加载失败.',
22320
22320
  setting: '设置',
22321
22321
  submit: '提交',
22322
+ save: '保存',
22322
22323
  submitting: '提交中···',
22323
22324
  numericalValueRequired: '数值不能为空',
22324
22325
  invalidNumericalValue: '数值格式不正确',
@@ -32518,7 +32519,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;!function() {
32518
32519
  const LOCALIZATION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('fc.gui.loc');
32519
32520
  const DefaultLocalization = {
32520
32521
  loadFailed: 'Load failed.',
32521
- setting: 'Setting',
32522
+ setting: 'Setting ',
32523
+ save: 'Save',
32522
32524
  submit: 'Submit',
32523
32525
  submitting: 'Submitting···',
32524
32526
  numericalValueRequired: 'Numerical value can\'t be emtpy',
@@ -32563,7 +32565,7 @@ const DefaultLocalization = {
32563
32565
  endTime: 'End Time',
32564
32566
  grouped: 'Grouped',
32565
32567
  stacked: 'Stacked',
32566
- passwordVerify: 'Password verifiers',
32568
+ passwordVerify: 'Password Verification',
32567
32569
  passwordError: 'Password error',
32568
32570
  password: 'Password',
32569
32571
  passwordToolTip: 'Password error, please re-enter',
@@ -35433,7 +35435,7 @@ class readable_element_ReadableElement extends conditional_enable_element_Condit
35433
35435
  name = isTraditionalChinese ? '離線' : (isChinese ? '离线' : 'Offline');
35434
35436
  break;
35435
35437
  case 4:
35436
- name = isTraditionalChinese ? '告警' : (isChinese ? '告警' : 'Alarming');
35438
+ name = isTraditionalChinese ? '告警' : (isChinese ? '告警' : 'Alarm');
35437
35439
  break;
35438
35440
  case 5:
35439
35441
  name = isTraditionalChinese ? '未綁定' : (isChinese ? '未绑定' : 'Unbound');
@@ -35441,6 +35443,9 @@ class readable_element_ReadableElement extends conditional_enable_element_Condit
35441
35443
  default:
35442
35444
  }
35443
35445
  }
35446
+ if (value.state === 4) {
35447
+ name = isTraditionalChinese ? '告警' : (isChinese ? '告警' : 'Alarm');
35448
+ }
35444
35449
  this.updateVariableValue(name, '设备状态');
35445
35450
  return; // 处理完"设备状态"后直接返回
35446
35451
  }
@@ -37778,27 +37783,24 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37778
37783
  .style('margin-left', this.displayOption.marginLeft + 'px')
37779
37784
  .style('vertical-align', 'middle');
37780
37785
  const selectedText = this.timePeriods.find(t => t.key === Number(this.currentTimePeriod));
37786
+ const arrowIconUrl = 'url("data:image/svg+xml,'
37787
+ + '%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%228%22 height=%225%22 viewBox=%220 0 8 5%22%3E'
37788
+ + '%3Cpath d=%22M0 0L4 5L8 0z%22 fill=%22%23666%22/%3E%3C/svg%3E")';
37781
37789
  const dropdownTrigger = dropdownWrapper.append('div')
37782
37790
  .attr('class', 'hc-dropdown-trigger')
37783
37791
  .style('background-color', backgroundColor)
37792
+ .style('background-image', arrowIconUrl)
37793
+ .style('background-repeat', 'no-repeat')
37794
+ .style('background-position', 'right 4px center')
37784
37795
  .style('font-size', this.displayOption.operationSelectFontSize)
37785
37796
  .style('cursor', 'pointer')
37786
37797
  .style('padding', '0 18px 0 4px')
37787
37798
  .style('border', '1px solid #ccc')
37788
37799
  .style('border-radius', '2px')
37789
- .style('position', 'relative')
37790
37800
  .style('white-space', 'nowrap')
37791
37801
  .style('line-height', (this.displayOption.operationAreaHeight - 8) + 'px')
37792
37802
  .style('min-height', (this.displayOption.operationAreaHeight - 8) + 'px')
37793
37803
  .text(selectedText ? selectedText.name : '');
37794
- dropdownTrigger.append('span')
37795
- .style('position', 'absolute')
37796
- .style('right', '4px')
37797
- .style('top', '50%')
37798
- .style('transform', 'translateY(-50%)')
37799
- .style('font-size', '10px')
37800
- .style('pointer-events', 'none')
37801
- .text('▼');
37802
37804
  const dropdownListEl = document.createElement('div');
37803
37805
  dropdownListEl.style.cssText = 'display:none;position:fixed;background:' + dropdownBg
37804
37806
  + ';border:1px solid #ccc;border-radius:2px;z-index:9999;box-shadow:0 2px 6px rgba(0,0,0,0.15);';
@@ -37836,14 +37838,6 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37836
37838
  const currentPeriod = this.timePeriods.find(p => p.key === tp.key);
37837
37839
  const currentName = currentPeriod ? currentPeriod.name : tp.name;
37838
37840
  dropdownTrigger.text(currentName);
37839
- dropdownTrigger.append('span')
37840
- .style('position', 'absolute')
37841
- .style('right', '4px')
37842
- .style('top', '50%')
37843
- .style('transform', 'translateY(-50%)')
37844
- .style('font-size', '10px')
37845
- .style('pointer-events', 'none')
37846
- .text('▼');
37847
37841
  // 更新选中状态
37848
37842
  dropdownList.selectAll('.hc-dropdown-item')
37849
37843
  .classed('hc-dropdown-selected', false)
@@ -37973,8 +37967,15 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37973
37967
  : new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0));
37974
37968
  const defaultEnd = this.fmtDatetimeLocal(this.customEndTime ? this.customEndTime.toDate()
37975
37969
  : new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59));
37970
+ // 临时将 <html lang> 切换为当前应用语言,使原生 datetime-local
37971
+ // 弹出日历的 UI(星期/月份文字等)跟随应用语种显示,关闭时还原
37972
+ const currentLang = this.getCurrentCulture();
37973
+ const prevDocLang = document.documentElement.lang;
37974
+ document.documentElement.lang = currentLang;
37976
37975
  const overlay = document.createElement('div');
37977
37976
  overlay.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);z-index:9999;';
37977
+ // 部分浏览器可直接读取元素上的 lang 属性来本地化原生控件
37978
+ overlay.lang = currentLang;
37978
37979
  const modal = document.createElement('div');
37979
37980
  let modalCss = 'position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);'
37980
37981
  + 'background:#fff;border-radius:4px;';
@@ -37990,7 +37991,7 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37990
37991
  header.style.cssText = 'display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #e8e8e8;';
37991
37992
  const title = document.createElement('span');
37992
37993
  title.style.cssText = 'font-size:16px;font-weight:500;color:#333;';
37993
- title.textContent = this.getTimePeriodText(service["TIME_PERIOD_KEYS"].CUSTOM);
37994
+ title.textContent = this.localization.customTimeRange;
37994
37995
  const closeBtn = document.createElement('span');
37995
37996
  closeBtn.style.cssText = 'cursor:pointer;font-size:18px;color:#999;line-height:1;';
37996
37997
  closeBtn.textContent = '×';
@@ -38005,6 +38006,7 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
38005
38006
  const startInput = document.createElement('input');
38006
38007
  startInput.type = 'datetime-local';
38007
38008
  startInput.setAttribute('step', '1');
38009
+ startInput.setAttribute('lang', currentLang);
38008
38010
  startInput.value = defaultStart;
38009
38011
  startInput.style.cssText = inputStyle;
38010
38012
  const separator = document.createElement('span');
@@ -38013,6 +38015,7 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
38013
38015
  const endInput = document.createElement('input');
38014
38016
  endInput.type = 'datetime-local';
38015
38017
  endInput.setAttribute('step', '1');
38018
+ endInput.setAttribute('lang', currentLang);
38016
38019
  endInput.value = defaultEnd;
38017
38020
  endInput.style.cssText = inputStyle;
38018
38021
  body.appendChild(label);
@@ -38035,6 +38038,8 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
38035
38038
  overlay.appendChild(modal);
38036
38039
  document.body.appendChild(overlay);
38037
38040
  const close = (revert) => {
38041
+ // 还原弹窗打开前的 <html lang>,避免影响页面其他部分
38042
+ document.documentElement.lang = prevDocLang;
38038
38043
  document.body.removeChild(overlay);
38039
38044
  if (revert) {
38040
38045
  const selectEl = this.$element && this.$element.find('select');