@flexem/fc-gui 3.0.0-alpha.176 → 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.
- package/bundles/@flexem/fc-gui.umd.js +20 -4
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +2 -2
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/base/readable-element.js +4 -1
- package/elements/historical-curve/historical-curve.element.js +12 -1
- package/localization/localization.service.d.ts +1 -0
- package/localization/localization.service.js +3 -2
- package/localization/localization.service.metadata.json +1 -1
- package/localization/localization.service.zh_CN.js +1 -0
- package/localization/localization.service.zh_CN.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -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 ? '告警' : '
|
|
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
|
}
|
|
@@ -811,8 +811,15 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
811
811
|
: new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0));
|
|
812
812
|
const defaultEnd = this.fmtDatetimeLocal(this.customEndTime ? this.customEndTime.toDate()
|
|
813
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;
|
|
814
819
|
const overlay = document.createElement('div');
|
|
815
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;
|
|
816
823
|
const modal = document.createElement('div');
|
|
817
824
|
let modalCss = 'position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);'
|
|
818
825
|
+ 'background:#fff;border-radius:4px;';
|
|
@@ -828,7 +835,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
828
835
|
header.style.cssText = 'display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #e8e8e8;';
|
|
829
836
|
const title = document.createElement('span');
|
|
830
837
|
title.style.cssText = 'font-size:16px;font-weight:500;color:#333;';
|
|
831
|
-
title.textContent = this.
|
|
838
|
+
title.textContent = this.localization.customTimeRange;
|
|
832
839
|
const closeBtn = document.createElement('span');
|
|
833
840
|
closeBtn.style.cssText = 'cursor:pointer;font-size:18px;color:#999;line-height:1;';
|
|
834
841
|
closeBtn.textContent = '×';
|
|
@@ -843,6 +850,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
843
850
|
const startInput = document.createElement('input');
|
|
844
851
|
startInput.type = 'datetime-local';
|
|
845
852
|
startInput.setAttribute('step', '1');
|
|
853
|
+
startInput.setAttribute('lang', currentLang);
|
|
846
854
|
startInput.value = defaultStart;
|
|
847
855
|
startInput.style.cssText = inputStyle;
|
|
848
856
|
const separator = document.createElement('span');
|
|
@@ -851,6 +859,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
851
859
|
const endInput = document.createElement('input');
|
|
852
860
|
endInput.type = 'datetime-local';
|
|
853
861
|
endInput.setAttribute('step', '1');
|
|
862
|
+
endInput.setAttribute('lang', currentLang);
|
|
854
863
|
endInput.value = defaultEnd;
|
|
855
864
|
endInput.style.cssText = inputStyle;
|
|
856
865
|
body.appendChild(label);
|
|
@@ -873,6 +882,8 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
873
882
|
overlay.appendChild(modal);
|
|
874
883
|
document.body.appendChild(overlay);
|
|
875
884
|
const close = (revert) => {
|
|
885
|
+
// 还原弹窗打开前的 <html lang>,避免影响页面其他部分
|
|
886
|
+
document.documentElement.lang = prevDocLang;
|
|
876
887
|
document.body.removeChild(overlay);
|
|
877
888
|
if (revert) {
|
|
878
889
|
const selectEl = this.$element && this.$element.find('select');
|
|
@@ -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
|
|
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
|
|
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"}}}]
|
|
@@ -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":"暂未获取设备地址"}}}]
|