@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.
@@ -95,7 +95,7 @@ export class ReadableElement extends ConditionalEnableElement {
95
95
  name = isTraditionalChinese ? '離線' : (isChinese ? '离线' : 'Offline');
96
96
  break;
97
97
  case 4:
98
- name = isTraditionalChinese ? '告警' : (isChinese ? '告警' : 'Alarming');
98
+ name = isTraditionalChinese ? '告警' : (isChinese ? '告警' : 'Alarm');
99
99
  break;
100
100
  case 5:
101
101
  name = isTraditionalChinese ? '未綁定' : (isChinese ? '未绑定' : 'Unbound');
@@ -103,6 +103,9 @@ export class ReadableElement extends ConditionalEnableElement {
103
103
  default:
104
104
  }
105
105
  }
106
+ if (value.state === 4) {
107
+ name = isTraditionalChinese ? '告警' : (isChinese ? '告警' : 'Alarm');
108
+ }
106
109
  this.updateVariableValue(name, '设备状态');
107
110
  return; // 处理完"设备状态"后直接返回
108
111
  }
@@ -627,27 +627,24 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
627
627
  .style('margin-left', this.displayOption.marginLeft + 'px')
628
628
  .style('vertical-align', 'middle');
629
629
  const selectedText = this.timePeriods.find(t => t.key === Number(this.currentTimePeriod));
630
+ const arrowIconUrl = 'url("data:image/svg+xml,'
631
+ + '%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%228%22 height=%225%22 viewBox=%220 0 8 5%22%3E'
632
+ + '%3Cpath d=%22M0 0L4 5L8 0z%22 fill=%22%23666%22/%3E%3C/svg%3E")';
630
633
  const dropdownTrigger = dropdownWrapper.append('div')
631
634
  .attr('class', 'hc-dropdown-trigger')
632
635
  .style('background-color', backgroundColor)
636
+ .style('background-image', arrowIconUrl)
637
+ .style('background-repeat', 'no-repeat')
638
+ .style('background-position', 'right 4px center')
633
639
  .style('font-size', this.displayOption.operationSelectFontSize)
634
640
  .style('cursor', 'pointer')
635
641
  .style('padding', '0 18px 0 4px')
636
642
  .style('border', '1px solid #ccc')
637
643
  .style('border-radius', '2px')
638
- .style('position', 'relative')
639
644
  .style('white-space', 'nowrap')
640
645
  .style('line-height', (this.displayOption.operationAreaHeight - 8) + 'px')
641
646
  .style('min-height', (this.displayOption.operationAreaHeight - 8) + 'px')
642
647
  .text(selectedText ? selectedText.name : '');
643
- dropdownTrigger.append('span')
644
- .style('position', 'absolute')
645
- .style('right', '4px')
646
- .style('top', '50%')
647
- .style('transform', 'translateY(-50%)')
648
- .style('font-size', '10px')
649
- .style('pointer-events', 'none')
650
- .text('▼');
651
648
  const dropdownListEl = document.createElement('div');
652
649
  dropdownListEl.style.cssText = 'display:none;position:fixed;background:' + dropdownBg
653
650
  + ';border:1px solid #ccc;border-radius:2px;z-index:9999;box-shadow:0 2px 6px rgba(0,0,0,0.15);';
@@ -685,14 +682,6 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
685
682
  const currentPeriod = this.timePeriods.find(p => p.key === tp.key);
686
683
  const currentName = currentPeriod ? currentPeriod.name : tp.name;
687
684
  dropdownTrigger.text(currentName);
688
- dropdownTrigger.append('span')
689
- .style('position', 'absolute')
690
- .style('right', '4px')
691
- .style('top', '50%')
692
- .style('transform', 'translateY(-50%)')
693
- .style('font-size', '10px')
694
- .style('pointer-events', 'none')
695
- .text('▼');
696
685
  // 更新选中状态
697
686
  dropdownList.selectAll('.hc-dropdown-item')
698
687
  .classed('hc-dropdown-selected', false)
@@ -822,8 +811,15 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
822
811
  : new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0));
823
812
  const defaultEnd = this.fmtDatetimeLocal(this.customEndTime ? this.customEndTime.toDate()
824
813
  : new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59));
814
+ // 临时将 <html lang> 切换为当前应用语言,使原生 datetime-local
815
+ // 弹出日历的 UI(星期/月份文字等)跟随应用语种显示,关闭时还原
816
+ const currentLang = this.getCurrentCulture();
817
+ const prevDocLang = document.documentElement.lang;
818
+ document.documentElement.lang = currentLang;
825
819
  const overlay = document.createElement('div');
826
820
  overlay.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);z-index:9999;';
821
+ // 部分浏览器可直接读取元素上的 lang 属性来本地化原生控件
822
+ overlay.lang = currentLang;
827
823
  const modal = document.createElement('div');
828
824
  let modalCss = 'position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);'
829
825
  + 'background:#fff;border-radius:4px;';
@@ -839,7 +835,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
839
835
  header.style.cssText = 'display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #e8e8e8;';
840
836
  const title = document.createElement('span');
841
837
  title.style.cssText = 'font-size:16px;font-weight:500;color:#333;';
842
- title.textContent = this.getTimePeriodText(TIME_PERIOD_KEYS.CUSTOM);
838
+ title.textContent = this.localization.customTimeRange;
843
839
  const closeBtn = document.createElement('span');
844
840
  closeBtn.style.cssText = 'cursor:pointer;font-size:18px;color:#999;line-height:1;';
845
841
  closeBtn.textContent = '×';
@@ -854,6 +850,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
854
850
  const startInput = document.createElement('input');
855
851
  startInput.type = 'datetime-local';
856
852
  startInput.setAttribute('step', '1');
853
+ startInput.setAttribute('lang', currentLang);
857
854
  startInput.value = defaultStart;
858
855
  startInput.style.cssText = inputStyle;
859
856
  const separator = document.createElement('span');
@@ -862,6 +859,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
862
859
  const endInput = document.createElement('input');
863
860
  endInput.type = 'datetime-local';
864
861
  endInput.setAttribute('step', '1');
862
+ endInput.setAttribute('lang', currentLang);
865
863
  endInput.value = defaultEnd;
866
864
  endInput.style.cssText = inputStyle;
867
865
  body.appendChild(label);
@@ -884,6 +882,8 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
884
882
  overlay.appendChild(modal);
885
883
  document.body.appendChild(overlay);
886
884
  const close = (revert) => {
885
+ // 还原弹窗打开前的 <html lang>,避免影响页面其他部分
886
+ document.documentElement.lang = prevDocLang;
887
887
  document.body.removeChild(overlay);
888
888
  if (revert) {
889
889
  const selectEl = this.$element && this.$element.find('select');
@@ -3,6 +3,7 @@ export declare const LOCALIZATION: InjectionToken<Localization>;
3
3
  export interface Localization {
4
4
  loadFailed: any;
5
5
  setting: any;
6
+ save: any;
6
7
  submit: any;
7
8
  submitting: any;
8
9
  numericalValueRequired: any;
@@ -2,7 +2,8 @@ import { InjectionToken } from '@angular/core';
2
2
  export const LOCALIZATION = new InjectionToken('fc.gui.loc');
3
3
  export const DefaultLocalization = {
4
4
  loadFailed: 'Load failed.',
5
- setting: 'Setting',
5
+ setting: 'Setting ',
6
+ save: 'Save',
6
7
  submit: 'Submit',
7
8
  submitting: 'Submitting···',
8
9
  numericalValueRequired: 'Numerical value can\'t be emtpy',
@@ -47,7 +48,7 @@ export const DefaultLocalization = {
47
48
  endTime: 'End Time',
48
49
  grouped: 'Grouped',
49
50
  stacked: 'Stacked',
50
- passwordVerify: 'Password verifiers',
51
+ passwordVerify: 'Password Verification',
51
52
  passwordError: 'Password error',
52
53
  password: 'Password',
53
54
  passwordToolTip: 'Password error, please re-enter',
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"LOCALIZATION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":2,"character":32},"arguments":["fc.gui.loc"]},"Localization":{"__symbolic":"interface"},"DefaultLocalization":{"loadFailed":"Load failed.","setting":"Setting","submit":"Submit","submitting":"Submitting···","numericalValueRequired":"Numerical value can't be emtpy","invalidNumericalValue":"Numerical value is not valid","writeValueTimeout":"Write value error: Timeout","binaryType":"Binary","decimalType":"Decimal","hexadecimalType":"Hexadecimal","stringType":"String","numericalValueTooLong":"Numerical value too long","fractionDigitsMustLessThan":"Fraction digits must be less than ","canNotBeNegative":"Can not be negative","valueOutOfRange":"Numerical value is out of range","timeout":"timeout","confirmOperationPrompt":"Are you sure you want to perform this operation?","confirm":"Yes","cancel":"Cancel","characterInputRequired":"Character input can't be empty","character":"(Character)","characterOutofRange":"Character length is out of range","writeValueRange":"Write value range","loading":"Loading","unbind":"Unbind","offline":"Offline","abnormal":"Data abnormal","disable":"Disable","invalidMonitor":"Element binding monitor point is invalid","variableChanged":"Variable changed, please re-import the device template","permissiontip":"You have no permission to operate.","conditionIsNotMetTip":"Operation conditions not met or variable anomalies.","chartNoData":"No Data Available","lastThirtyMinutes":"Last thirty minutes","lastOneHour":"Last one hour","lastEightHour":"Last eight hours","lastTwentyFourHours":"Last 24 hours","lastSevenDays":"Last 7 days","lastThirtyDays":"Last 30 days","lastOneYear":"Last 6 months","customTimeRange":"Custom","timeRange":"Time Range","startTime":"Start Time","endTime":"End Time","grouped":"Grouped","stacked":"Stacked","passwordVerify":"Password verifiers","passwordError":"Password error","password":"Password","passwordToolTip":"Password error, please re-enter","passwordRequired":"Password can't be empty","invalidVideoAddress":"Invalid video address","unconfiguredVideoAddress":"Unconfigured Video Address","weatherNotSupport":"Location not supported","weatherNotAddress":"Address not configured","weatherNotAvailable":"Address not yet available","airQualityNotSupport":"Location not supported","airQualityNotAddress":"Address not configured","airQualityNotAvailable":"Address not yet available"}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"LOCALIZATION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":2,"character":32},"arguments":["fc.gui.loc"]},"Localization":{"__symbolic":"interface"},"DefaultLocalization":{"loadFailed":"Load failed.","setting":"Setting ","save":"Save","submit":"Submit","submitting":"Submitting···","numericalValueRequired":"Numerical value can't be emtpy","invalidNumericalValue":"Numerical value is not valid","writeValueTimeout":"Write value error: Timeout","binaryType":"Binary","decimalType":"Decimal","hexadecimalType":"Hexadecimal","stringType":"String","numericalValueTooLong":"Numerical value too long","fractionDigitsMustLessThan":"Fraction digits must be less than ","canNotBeNegative":"Can not be negative","valueOutOfRange":"Numerical value is out of range","timeout":"timeout","confirmOperationPrompt":"Are you sure you want to perform this operation?","confirm":"Yes","cancel":"Cancel","characterInputRequired":"Character input can't be empty","character":"(Character)","characterOutofRange":"Character length is out of range","writeValueRange":"Write value range","loading":"Loading","unbind":"Unbind","offline":"Offline","abnormal":"Data abnormal","disable":"Disable","invalidMonitor":"Element binding monitor point is invalid","variableChanged":"Variable changed, please re-import the device template","permissiontip":"You have no permission to operate.","conditionIsNotMetTip":"Operation conditions not met or variable anomalies.","chartNoData":"No Data Available","lastThirtyMinutes":"Last thirty minutes","lastOneHour":"Last one hour","lastEightHour":"Last eight hours","lastTwentyFourHours":"Last 24 hours","lastSevenDays":"Last 7 days","lastThirtyDays":"Last 30 days","lastOneYear":"Last 6 months","customTimeRange":"Custom","timeRange":"Time Range","startTime":"Start Time","endTime":"End Time","grouped":"Grouped","stacked":"Stacked","passwordVerify":"Password Verification","passwordError":"Password error","password":"Password","passwordToolTip":"Password error, please re-enter","passwordRequired":"Password can't be empty","invalidVideoAddress":"Invalid video address","unconfiguredVideoAddress":"Unconfigured Video Address","weatherNotSupport":"Location not supported","weatherNotAddress":"Address not configured","weatherNotAvailable":"Address not yet available","airQualityNotSupport":"Location not supported","airQualityNotAddress":"Address not configured","airQualityNotAvailable":"Address not yet available"}}}]
@@ -2,6 +2,7 @@ export const Localization_zh_CN = {
2
2
  loadFailed: '加载失败.',
3
3
  setting: '设置',
4
4
  submit: '提交',
5
+ save: '保存',
5
6
  submitting: '提交中···',
6
7
  numericalValueRequired: '数值不能为空',
7
8
  invalidNumericalValue: '数值格式不正确',
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"Localization_zh_CN":{"loadFailed":"加载失败.","setting":"设置","submit":"提交","submitting":"提交中···","numericalValueRequired":"数值不能为空","invalidNumericalValue":"数值格式不正确","writeValueTimeout":"写值错误:超时","binaryType":"二进制","decimalType":"十进制","hexadecimalType":"十六进制","stringType":"字符串","numericalValueTooLong":"数值超长","fractionDigitsMustLessThan":"小数位不能超过","canNotBeNegative":"不能为负数","valueOutOfRange":"数值超出范围","timeout":"超时","confirmOperationPrompt":"是否确认要执行此操作?","confirm":"确定","cancel":"取消","characterInputRequired":"请输入至少一个字符","character":"(字符串)","characterOutofRange":"字符长度超限","writeValueRange":"写值范围","loading":"加载中","unbind":"未绑定","offline":"离线","abnormal":"数据异常","disable":"禁用","invalidMonitor":"元件绑定的监控点无效","variableChanged":"变量已变更,请重新导入设备模板","permissiontip":"您无权限执行此操作","conditionIsNotMetTip":"操作条件不满足或逻辑控制变量异常","chartNoData":"无数据","lastThirtyMinutes":"最近30分钟","lastOneHour":"最近1小时","lastEightHour":"最近8小时","lastTwentyFourHours":"最近24小时","lastSevenDays":"最近7天","lastThirtyDays":"最近30天","lastOneYear":"最近半年","customTimeRange":"自定义","timeRange":"时间范围","startTime":"开始时间","endTime":"结束时间","grouped":"分组","stacked":"叠加","passwordVerify":"密码校验","passwordError":"密码错误","password":"密码","passwordToolTip":"密码错误,请重新输入","passwordRequired":"密码不能为空","invalidVideoAddress":"无效的视频地址","unconfiguredVideoAddress":"未配置视频地址","weatherNotSupport":"当前位置暂不支持","weatherNotAddress":"当前设备未设置地址","weatherNotAvailable":"暂未获取设备地址","airQualityNotSupport":"当前位置暂不支持","airQualityNotAddress":"当前设备未设置地址","airQualityNotAvailable":"暂未获取设备地址"}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"Localization_zh_CN":{"loadFailed":"加载失败.","setting":"设置","submit":"提交","save":"保存","submitting":"提交中···","numericalValueRequired":"数值不能为空","invalidNumericalValue":"数值格式不正确","writeValueTimeout":"写值错误:超时","binaryType":"二进制","decimalType":"十进制","hexadecimalType":"十六进制","stringType":"字符串","numericalValueTooLong":"数值超长","fractionDigitsMustLessThan":"小数位不能超过","canNotBeNegative":"不能为负数","valueOutOfRange":"数值超出范围","timeout":"超时","confirmOperationPrompt":"是否确认要执行此操作?","confirm":"确定","cancel":"取消","characterInputRequired":"请输入至少一个字符","character":"(字符串)","characterOutofRange":"字符长度超限","writeValueRange":"写值范围","loading":"加载中","unbind":"未绑定","offline":"离线","abnormal":"数据异常","disable":"禁用","invalidMonitor":"元件绑定的监控点无效","variableChanged":"变量已变更,请重新导入设备模板","permissiontip":"您无权限执行此操作","conditionIsNotMetTip":"操作条件不满足或逻辑控制变量异常","chartNoData":"无数据","lastThirtyMinutes":"最近30分钟","lastOneHour":"最近1小时","lastEightHour":"最近8小时","lastTwentyFourHours":"最近24小时","lastSevenDays":"最近7天","lastThirtyDays":"最近30天","lastOneYear":"最近半年","customTimeRange":"自定义","timeRange":"时间范围","startTime":"开始时间","endTime":"结束时间","grouped":"分组","stacked":"叠加","passwordVerify":"密码校验","passwordError":"密码错误","password":"密码","passwordToolTip":"密码错误,请重新输入","passwordRequired":"密码不能为空","invalidVideoAddress":"无效的视频地址","unconfiguredVideoAddress":"未配置视频地址","weatherNotSupport":"当前位置暂不支持","weatherNotAddress":"当前设备未设置地址","weatherNotAvailable":"暂未获取设备地址","airQualityNotSupport":"当前位置暂不支持","airQualityNotAddress":"当前设备未设置地址","airQualityNotAvailable":"暂未获取设备地址"}}}]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "main": "bundles/fc-gui.umd.js",
3
- "version": "3.0.0-alpha.175",
3
+ "version": "3.0.0-alpha.177",
4
4
  "module": "public_api.js",
5
5
  "typings": "public_api.d.ts",
6
6
  "license": "UNLICENSED",