@flexem/fc-gui 3.0.0-alpha.124 → 3.0.0-alpha.125

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.
Files changed (48) hide show
  1. package/bundles/@flexem/fc-gui.umd.js +899 -316
  2. package/bundles/@flexem/fc-gui.umd.js.map +1 -1
  3. package/bundles/@flexem/fc-gui.umd.min.js +4 -4
  4. package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
  5. package/communication/variable/variable-communicator.d.ts +2 -0
  6. package/elements/alarm/alarm-element.d.ts +17 -2
  7. package/elements/alarm/alarm-element.js +74 -6
  8. package/elements/alarm/alarm-element.metadata.json +1 -1
  9. package/elements/base/readable-element.js +14 -5
  10. package/elements/base/state-control-element.js +2 -2
  11. package/elements/historical-curve/historical-curve.element.d.ts +17 -2
  12. package/elements/historical-curve/historical-curve.element.js +64 -4
  13. package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
  14. package/elements/main-element.js +7 -7
  15. package/elements/numerical-display/numerical-display-element.d.ts +9 -2
  16. package/elements/numerical-display/numerical-display-element.js +22 -2
  17. package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
  18. package/elements/shared/text/text-element.d.ts +9 -0
  19. package/elements/shared/text/text-element.js +20 -0
  20. package/elements/shared/text/text-element.metadata.json +1 -1
  21. package/elements/shared/text/text-state-element.d.ts +15 -2
  22. package/elements/shared/text/text-state-element.js +70 -10
  23. package/elements/shared/text/text-state-element.metadata.json +1 -1
  24. package/elements/static-elements/hyperlink-element.d.ts +15 -1
  25. package/elements/static-elements/hyperlink-element.js +69 -10
  26. package/elements/static-elements/hyperlink-element.metadata.json +1 -1
  27. package/elements/static-elements/text-element.d.ts +14 -1
  28. package/elements/static-elements/text-element.js +64 -10
  29. package/elements/static-elements/text-element.metadata.json +1 -1
  30. package/elements/switch-indicator-light/switch-indicator-light-element.d.ts +7 -1
  31. package/elements/switch-indicator-light/switch-indicator-light-element.js +25 -2
  32. package/elements/switch-indicator-light/switch-indicator-light-element.metadata.json +1 -1
  33. package/elements/view-operation/view-operation.element.d.ts +23 -2
  34. package/elements/view-operation/view-operation.element.js +95 -1
  35. package/elements/view-operation/view-operation.element.metadata.json +1 -1
  36. package/gui/gui-context.d.ts +7 -1
  37. package/gui/gui-view.js +20 -4
  38. package/modal/write-value/write-value-modal-args.d.ts +3 -1
  39. package/modal/write-value/write-value-modal-args.js +2 -1
  40. package/modal/write-value/write-value-modal-args.metadata.json +1 -1
  41. package/modal/write-value/write-value-modal.component.d.ts +4 -0
  42. package/modal/write-value/write-value-modal.component.js +25 -0
  43. package/modal/write-value/write-value-modal.component.metadata.json +1 -1
  44. package/model/view-operation/view-operation-element.model.d.ts +7 -1
  45. package/package.json +1 -1
  46. package/remote/communication/variable/remote-variable-communicator.d.ts +15 -0
  47. package/remote/communication/variable/remote-variable-communicator.js +76 -2
  48. package/remote/communication/variable/remote-variable-communicator.metadata.json +1 -1
@@ -22136,7 +22136,7 @@ class VariableUtil {
22136
22136
  "use strict";
22137
22137
 
22138
22138
  // EXTERNAL MODULE: ./.tmp/localization/localization.service.ts
22139
- var localization_service = __webpack_require__(18);
22139
+ var localization_service = __webpack_require__(19);
22140
22140
 
22141
22141
  // CONCATENATED MODULE: ./.tmp/localization/localization.service.zh_CN.ts
22142
22142
  const Localization_zh_CN = {
@@ -22933,246 +22933,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__17__;
22933
22933
 
22934
22934
  /***/ }),
22935
22935
  /* 18 */
22936
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
22937
-
22938
- "use strict";
22939
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return LOCALIZATION; });
22940
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DefaultLocalization; });
22941
- /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
22942
- /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
22943
-
22944
- const LOCALIZATION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('fc.gui.loc');
22945
- const DefaultLocalization = {
22946
- loadFailed: 'Load failed.',
22947
- setting: 'Setting',
22948
- submit: 'Submit',
22949
- submitting: 'Submitting···',
22950
- numericalValueRequired: 'Numerical value can\'t be emtpy',
22951
- invalidNumericalValue: 'Numerical value is not valid',
22952
- writeValueTimeout: 'Write value error: Timeout',
22953
- binaryType: 'Binary',
22954
- decimalType: 'Decimal',
22955
- hexadecimalType: 'Hexadecimal',
22956
- stringType: 'String',
22957
- numericalValueTooLong: 'Numerical value too long',
22958
- fractionDigitsMustLessThan: 'Fraction digits must be less than ',
22959
- canNotBeNegative: 'Can not be negative',
22960
- valueOutOfRange: 'Numerical value is out of range',
22961
- timeout: 'timeout',
22962
- confirmOperationPrompt: 'Are you sure you want to perform this operation?',
22963
- confirm: 'Yes',
22964
- cancel: 'Cancel',
22965
- characterInputRequired: 'Character input can\'t be empty',
22966
- character: '(Character)',
22967
- characterOutofRange: 'Character length is out of range',
22968
- writeValueRange: 'Write value range',
22969
- loading: 'Loading',
22970
- unbind: 'Unbind',
22971
- offline: 'Offline',
22972
- abnormal: 'Data abnormal',
22973
- disable: 'Disable',
22974
- permissiontip: 'You have no permission to operate.',
22975
- conditionIsNotMetTip: 'Operation conditions not met or variable anomalies.',
22976
- chartNoData: 'No Data Available',
22977
- lastThirtyMinutes: 'Last thirty minutes',
22978
- lastOneHour: 'Last one hour',
22979
- lastEightHour: 'Last eight hours',
22980
- lastTwentyFourHours: 'Last 24 hours',
22981
- lastSevenDays: 'Last 7 days',
22982
- lastThirtyDays: 'Last 30 days',
22983
- lastOneYear: 'Last 1 year',
22984
- grouped: 'Grouped',
22985
- stacked: 'Stacked',
22986
- passwordVerify: 'Password verifiers',
22987
- passwordError: 'Password error',
22988
- password: 'Password',
22989
- passwordToolTip: 'Password error, please re-enter',
22990
- passwordRequired: 'Password can\'t be empty',
22991
- invalidVideoAddress: 'Invalid video address',
22992
- unconfiguredVideoAddress: 'Unconfigured Video Address',
22993
- weatherNotSupport: 'Location not supported',
22994
- weatherNotAddress: 'Address not configured',
22995
- weatherNotAvailable: 'Address not yet available',
22996
- airQualityNotSupport: 'Location not supported',
22997
- airQualityNotAddress: 'Address not configured',
22998
- airQualityNotAvailable: 'Address not yet available'
22999
- };
23000
-
23001
-
23002
- /***/ }),
23003
- /* 19 */
23004
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
23005
-
23006
- "use strict";
23007
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VerifyPasswordModalComponent; });
23008
- /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
23009
- /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
23010
- /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40);
23011
- /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
23012
- /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
23013
- /* harmony import */ var _localization__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9);
23014
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
23015
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23016
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23017
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
23018
- return c > 3 && r && Object.defineProperty(target, key, r), r;
23019
- };
23020
- var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
23021
- return function (target, key) { decorator(target, key, paramIndex); }
23022
- };
23023
-
23024
-
23025
-
23026
-
23027
- let VerifyPasswordModalComponent = class VerifyPasswordModalComponent {
23028
- constructor(localization) {
23029
- this.localization = localization;
23030
- this._onClosed = new rxjs__WEBPACK_IMPORTED_MODULE_1__[/* Subject */ "a"]();
23031
- this.passwordError = false;
23032
- }
23033
- get onClosed() {
23034
- return this._onClosed;
23035
- }
23036
- ngOnInit() {
23037
- this.validate();
23038
- }
23039
- validate() {
23040
- if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isNil"])(this.password) || '' === this.password.trim()) {
23041
- this.passwordError = true;
23042
- this.validationErrorText = this.localization.passwordRequired;
23043
- }
23044
- else {
23045
- this.passwordError = false;
23046
- this.validationErrorText = '';
23047
- }
23048
- }
23049
- checkSecurity() {
23050
- this.securityChecker.isValid(this.password).then(isValid => {
23051
- if (isValid) {
23052
- this.close(true);
23053
- }
23054
- else {
23055
- this.passwordError = true;
23056
- this.validationErrorText = this.localization.passwordToolTip;
23057
- }
23058
- }).catch(() => {
23059
- throw new Error('Failure of the checkSecurity');
23060
- });
23061
- }
23062
- close(modalResult) {
23063
- this._onClosed.next(modalResult);
23064
- this._onClosed.complete();
23065
- }
23066
- };
23067
- VerifyPasswordModalComponent = __decorate([
23068
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
23069
- selector: 'verify-password',
23070
- template: "<form #verifyPasswordForm=\"ngForm\" novalidate (ngSubmit)=\"checkSecurity()\" bs-modal-drag> <div class=\"modal-header\"> <h4 class=\"modal-title\"> <span>{{localization.passwordVerify}}</span> </h4> <button type=\"button\" class=\"close pull-right\" aria-label=\"Close\" (click)=\"close()\"> <span aria-hidden=\"true\">&times;</span> </button> </div> <div class=\"modal-body\"> <span class=\"password-span\">{{localization.password}}: </span> <input type=\"password\" name=\"password\" autoFocus class=\"form-control element-password\" [(ngModel)]=\"password\" (keyup)=\"validate()\" autocomplete=\"off\"> <span class=\"help-block text-danger\" [hidden]=\"!passwordError\">{{validationErrorText}}</span> </div> <div class=\"modal-footer\"> <button type=\"button\" class=\"btn md-skip btn-cancel\" (click)=\"close()\">{{localization.cancel}} </button> <button type=\"submit\" class=\"btn md-skip btn-primary\" [disabled]=\"passwordError\">{{localization.submit}}</button> </div> </form> ",
23071
- styles: [".modal-header { padding: 10px; border-color: transparent; } .modal-body { position: relative; padding: 0px 5px !important; padding-top: 10px !important; } .modal-title { display: unset; margin-left: -6px; font-size: 16px !important; } .form-control { margin: 0 5%; float: none; width: 90%; } .modal-footer { padding: 10px 4px 20px 5px !important; text-align: right; border-color: transparent; color: #fff; } .text-danger { display: block; color: #ed6b75; font-size: 14px; margin: 5px 0px 0px 15px; } .btn-primary { color: #fff; height: 32px; margin-right: 10px; line-height: 0px } .password-span { color: #7f939e; font-size: 14px; margin-left: 15px; } .btn-cancel { color: #fff; height: 32px; min-width: 71px; margin-right: 6px; background-color: #dddddd; line-height: 0px } .element-password { padding-left: 8px; height: 32px; min-width: 71px; margin-left: 16px; } "]
23072
- }),
23073
- __param(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_localization__WEBPACK_IMPORTED_MODULE_3__[/* LOCALIZATION */ "b"]))
23074
- ], VerifyPasswordModalComponent);
23075
-
23076
-
23077
-
23078
- /***/ }),
23079
- /* 20 */
23080
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
23081
-
23082
- "use strict";
23083
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ConfirmOperationModalComponent; });
23084
- /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
23085
- /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
23086
- /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40);
23087
- /* harmony import */ var _localization_localization_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18);
23088
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
23089
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23090
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23091
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
23092
- return c > 3 && r && Object.defineProperty(target, key, r), r;
23093
- };
23094
- var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
23095
- return function (target, key) { decorator(target, key, paramIndex); }
23096
- };
23097
-
23098
-
23099
-
23100
- let ConfirmOperationModalComponent = class ConfirmOperationModalComponent {
23101
- constructor(localization) {
23102
- this.localization = localization;
23103
- this._onClosed = new rxjs__WEBPACK_IMPORTED_MODULE_1__[/* Subject */ "a"]();
23104
- }
23105
- get onClosed() {
23106
- return this._onClosed;
23107
- }
23108
- close(modalResult) {
23109
- this._onClosed.next(modalResult);
23110
- this._onClosed.complete();
23111
- }
23112
- confirm() {
23113
- this.close(true);
23114
- }
23115
- };
23116
- ConfirmOperationModalComponent = __decorate([
23117
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
23118
- selector: 'confirmOperationModal',
23119
- template: "<form novalidate (ngSubmit)=\"confirm()\" bs-modal-drag> <div class=\"modal-body\"> <div style=\"text-align:center;margin-top:20px;\"> <div class=\"alertIcon\"></div> <h3 class=\"confirm-h3\">{{localization.confirmOperationPrompt}}</h3> </div> </div> <div class=\"modal-footer form-group confirm-btn-group\"> <button type=\"button\" class=\"sweet-alert-btn\" (click)=\"close()\"> {{localization.cancel}} </button> <button type=\"submit\" class=\"sweet-alert-btn\"> {{localization.confirm}} </button> </div> </form> ",
23120
- styles: [".modal-body { padding: 17px; position: relative; text-align: center; } .modal-footer { padding: 10px 5px; text-align: center; border-color: transparent; } .confirm-modal { max-width: 478px; } .confirm-modal>.modal-content { padding: 17px; } h3.confirm-h3 { font-size: 20px; font-weight: bold; } .confirm-btn-group { padding: 0; margin-bottom: 28px; margin-right: 50px; } .confirm-btn-group button { display: inline-block; } .confirm-btn-group button:last-child { background-color: rgb(221, 107, 85); box-shadow: rgba(221, 107, 85, 0.8) 0px 0px 2px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px; } .alertIcon { background: url(assets/img/alert.svg); width: 88px; height: 88px; display: inline-block; } .sweet-alert-btn { color: #fff; border: none; background: #ddd; font-size: 17px; font-weight: 500; border-radius: 5px; padding: 10px 32px; margin: 26px 5px 0; cursor: pointer } "]
23121
- }),
23122
- __param(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_localization_localization_service__WEBPACK_IMPORTED_MODULE_2__[/* LOCALIZATION */ "b"]))
23123
- ], ConfirmOperationModalComponent);
23124
-
23125
-
23126
-
23127
- /***/ }),
23128
- /* 21 */
23129
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
23130
-
23131
- "use strict";
23132
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AlertModalComponent; });
23133
- /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
23134
- /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
23135
- /* harmony import */ var _localization_localization_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18);
23136
- /* harmony import */ var rxjs_internal_Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(273);
23137
- /* harmony import */ var rxjs_internal_Subject__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(rxjs_internal_Subject__WEBPACK_IMPORTED_MODULE_2__);
23138
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
23139
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23140
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23141
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
23142
- return c > 3 && r && Object.defineProperty(target, key, r), r;
23143
- };
23144
- var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
23145
- return function (target, key) { decorator(target, key, paramIndex); }
23146
- };
23147
-
23148
-
23149
-
23150
- let AlertModalComponent = class AlertModalComponent {
23151
- constructor(localization) {
23152
- this.localization = localization;
23153
- this._onClosed = new rxjs_internal_Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
23154
- }
23155
- get onClosed() {
23156
- return this._onClosed;
23157
- }
23158
- close() {
23159
- this._onClosed.next();
23160
- this._onClosed.complete();
23161
- }
23162
- };
23163
- AlertModalComponent = __decorate([
23164
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
23165
- selector: 'alertModal',
23166
- template: "<div class=\"modal-body\"> <div style=\"text-align:center\"> <div class=\"alertIcon\"></div> <h3 class=\"alert-h3\">{{alermMessage}}</h3> </div> </div> <div class=\"modal-footer form-group confirm-btn\"> <button type=\"button\" class=\"sweet-alert-btn\" (click)=\"close()\"> {{localization.confirm}} </button> </div> ",
23167
- styles: [".modal-header { padding: 17px; border-color: transparent; } .modal-body { padding: 17px; position: relative; text-align: center; } .modal-footer { padding: 10px 5px; text-align: center; border-color: transparent; } .alert-modal { max-width: 478px; } .alert-modal>.modal-content { padding: 17px; } h3.alert-h3 { font-size: 20px; font-weight: bold; } .alert-btn { padding: 0; margin-bottom: 0; } .alert-btn button { display: inline-block; } .alertIcon { background: url(assets/img/alert.svg); width: 88px; height: 88px; display: inline-block; } .sweet-alert-btn { color: #fff; border: none; background: #ddd; font-size: 17px; font-weight: 500; border-radius: 5px; padding: 10px 32px; margin: 26px 5px 0; cursor: point; background-color: rgb(221, 107, 85); box-shadow: rgba(221, 107, 85, 0.8) 0px 0px 2px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px; } "]
23168
- }),
23169
- __param(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_localization_localization_service__WEBPACK_IMPORTED_MODULE_1__[/* LOCALIZATION */ "b"]))
23170
- ], AlertModalComponent);
23171
-
23172
-
23173
-
23174
- /***/ }),
23175
- /* 22 */
23176
22936
  /***/ (function(module, exports, __webpack_require__) {
23177
22937
 
23178
22938
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;!function() {
@@ -32733,6 +32493,246 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;!function() {
32733
32493
  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); else {}
32734
32494
  }();
32735
32495
 
32496
+ /***/ }),
32497
+ /* 19 */
32498
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
32499
+
32500
+ "use strict";
32501
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return LOCALIZATION; });
32502
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DefaultLocalization; });
32503
+ /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
32504
+ /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
32505
+
32506
+ const LOCALIZATION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('fc.gui.loc');
32507
+ const DefaultLocalization = {
32508
+ loadFailed: 'Load failed.',
32509
+ setting: 'Setting',
32510
+ submit: 'Submit',
32511
+ submitting: 'Submitting···',
32512
+ numericalValueRequired: 'Numerical value can\'t be emtpy',
32513
+ invalidNumericalValue: 'Numerical value is not valid',
32514
+ writeValueTimeout: 'Write value error: Timeout',
32515
+ binaryType: 'Binary',
32516
+ decimalType: 'Decimal',
32517
+ hexadecimalType: 'Hexadecimal',
32518
+ stringType: 'String',
32519
+ numericalValueTooLong: 'Numerical value too long',
32520
+ fractionDigitsMustLessThan: 'Fraction digits must be less than ',
32521
+ canNotBeNegative: 'Can not be negative',
32522
+ valueOutOfRange: 'Numerical value is out of range',
32523
+ timeout: 'timeout',
32524
+ confirmOperationPrompt: 'Are you sure you want to perform this operation?',
32525
+ confirm: 'Yes',
32526
+ cancel: 'Cancel',
32527
+ characterInputRequired: 'Character input can\'t be empty',
32528
+ character: '(Character)',
32529
+ characterOutofRange: 'Character length is out of range',
32530
+ writeValueRange: 'Write value range',
32531
+ loading: 'Loading',
32532
+ unbind: 'Unbind',
32533
+ offline: 'Offline',
32534
+ abnormal: 'Data abnormal',
32535
+ disable: 'Disable',
32536
+ permissiontip: 'You have no permission to operate.',
32537
+ conditionIsNotMetTip: 'Operation conditions not met or variable anomalies.',
32538
+ chartNoData: 'No Data Available',
32539
+ lastThirtyMinutes: 'Last thirty minutes',
32540
+ lastOneHour: 'Last one hour',
32541
+ lastEightHour: 'Last eight hours',
32542
+ lastTwentyFourHours: 'Last 24 hours',
32543
+ lastSevenDays: 'Last 7 days',
32544
+ lastThirtyDays: 'Last 30 days',
32545
+ lastOneYear: 'Last 1 year',
32546
+ grouped: 'Grouped',
32547
+ stacked: 'Stacked',
32548
+ passwordVerify: 'Password verifiers',
32549
+ passwordError: 'Password error',
32550
+ password: 'Password',
32551
+ passwordToolTip: 'Password error, please re-enter',
32552
+ passwordRequired: 'Password can\'t be empty',
32553
+ invalidVideoAddress: 'Invalid video address',
32554
+ unconfiguredVideoAddress: 'Unconfigured Video Address',
32555
+ weatherNotSupport: 'Location not supported',
32556
+ weatherNotAddress: 'Address not configured',
32557
+ weatherNotAvailable: 'Address not yet available',
32558
+ airQualityNotSupport: 'Location not supported',
32559
+ airQualityNotAddress: 'Address not configured',
32560
+ airQualityNotAvailable: 'Address not yet available'
32561
+ };
32562
+
32563
+
32564
+ /***/ }),
32565
+ /* 20 */
32566
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
32567
+
32568
+ "use strict";
32569
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VerifyPasswordModalComponent; });
32570
+ /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
32571
+ /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
32572
+ /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40);
32573
+ /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
32574
+ /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
32575
+ /* harmony import */ var _localization__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9);
32576
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
32577
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
32578
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
32579
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
32580
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
32581
+ };
32582
+ var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
32583
+ return function (target, key) { decorator(target, key, paramIndex); }
32584
+ };
32585
+
32586
+
32587
+
32588
+
32589
+ let VerifyPasswordModalComponent = class VerifyPasswordModalComponent {
32590
+ constructor(localization) {
32591
+ this.localization = localization;
32592
+ this._onClosed = new rxjs__WEBPACK_IMPORTED_MODULE_1__[/* Subject */ "a"]();
32593
+ this.passwordError = false;
32594
+ }
32595
+ get onClosed() {
32596
+ return this._onClosed;
32597
+ }
32598
+ ngOnInit() {
32599
+ this.validate();
32600
+ }
32601
+ validate() {
32602
+ if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isNil"])(this.password) || '' === this.password.trim()) {
32603
+ this.passwordError = true;
32604
+ this.validationErrorText = this.localization.passwordRequired;
32605
+ }
32606
+ else {
32607
+ this.passwordError = false;
32608
+ this.validationErrorText = '';
32609
+ }
32610
+ }
32611
+ checkSecurity() {
32612
+ this.securityChecker.isValid(this.password).then(isValid => {
32613
+ if (isValid) {
32614
+ this.close(true);
32615
+ }
32616
+ else {
32617
+ this.passwordError = true;
32618
+ this.validationErrorText = this.localization.passwordToolTip;
32619
+ }
32620
+ }).catch(() => {
32621
+ throw new Error('Failure of the checkSecurity');
32622
+ });
32623
+ }
32624
+ close(modalResult) {
32625
+ this._onClosed.next(modalResult);
32626
+ this._onClosed.complete();
32627
+ }
32628
+ };
32629
+ VerifyPasswordModalComponent = __decorate([
32630
+ Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
32631
+ selector: 'verify-password',
32632
+ template: "<form #verifyPasswordForm=\"ngForm\" novalidate (ngSubmit)=\"checkSecurity()\" bs-modal-drag> <div class=\"modal-header\"> <h4 class=\"modal-title\"> <span>{{localization.passwordVerify}}</span> </h4> <button type=\"button\" class=\"close pull-right\" aria-label=\"Close\" (click)=\"close()\"> <span aria-hidden=\"true\">&times;</span> </button> </div> <div class=\"modal-body\"> <span class=\"password-span\">{{localization.password}}: </span> <input type=\"password\" name=\"password\" autoFocus class=\"form-control element-password\" [(ngModel)]=\"password\" (keyup)=\"validate()\" autocomplete=\"off\"> <span class=\"help-block text-danger\" [hidden]=\"!passwordError\">{{validationErrorText}}</span> </div> <div class=\"modal-footer\"> <button type=\"button\" class=\"btn md-skip btn-cancel\" (click)=\"close()\">{{localization.cancel}} </button> <button type=\"submit\" class=\"btn md-skip btn-primary\" [disabled]=\"passwordError\">{{localization.submit}}</button> </div> </form> ",
32633
+ styles: [".modal-header { padding: 10px; border-color: transparent; } .modal-body { position: relative; padding: 0px 5px !important; padding-top: 10px !important; } .modal-title { display: unset; margin-left: -6px; font-size: 16px !important; } .form-control { margin: 0 5%; float: none; width: 90%; } .modal-footer { padding: 10px 4px 20px 5px !important; text-align: right; border-color: transparent; color: #fff; } .text-danger { display: block; color: #ed6b75; font-size: 14px; margin: 5px 0px 0px 15px; } .btn-primary { color: #fff; height: 32px; margin-right: 10px; line-height: 0px } .password-span { color: #7f939e; font-size: 14px; margin-left: 15px; } .btn-cancel { color: #fff; height: 32px; min-width: 71px; margin-right: 6px; background-color: #dddddd; line-height: 0px } .element-password { padding-left: 8px; height: 32px; min-width: 71px; margin-left: 16px; } "]
32634
+ }),
32635
+ __param(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_localization__WEBPACK_IMPORTED_MODULE_3__[/* LOCALIZATION */ "b"]))
32636
+ ], VerifyPasswordModalComponent);
32637
+
32638
+
32639
+
32640
+ /***/ }),
32641
+ /* 21 */
32642
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
32643
+
32644
+ "use strict";
32645
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ConfirmOperationModalComponent; });
32646
+ /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
32647
+ /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
32648
+ /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40);
32649
+ /* harmony import */ var _localization_localization_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(19);
32650
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
32651
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
32652
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
32653
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
32654
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
32655
+ };
32656
+ var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
32657
+ return function (target, key) { decorator(target, key, paramIndex); }
32658
+ };
32659
+
32660
+
32661
+
32662
+ let ConfirmOperationModalComponent = class ConfirmOperationModalComponent {
32663
+ constructor(localization) {
32664
+ this.localization = localization;
32665
+ this._onClosed = new rxjs__WEBPACK_IMPORTED_MODULE_1__[/* Subject */ "a"]();
32666
+ }
32667
+ get onClosed() {
32668
+ return this._onClosed;
32669
+ }
32670
+ close(modalResult) {
32671
+ this._onClosed.next(modalResult);
32672
+ this._onClosed.complete();
32673
+ }
32674
+ confirm() {
32675
+ this.close(true);
32676
+ }
32677
+ };
32678
+ ConfirmOperationModalComponent = __decorate([
32679
+ Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
32680
+ selector: 'confirmOperationModal',
32681
+ template: "<form novalidate (ngSubmit)=\"confirm()\" bs-modal-drag> <div class=\"modal-body\"> <div style=\"text-align:center;margin-top:20px;\"> <div class=\"alertIcon\"></div> <h3 class=\"confirm-h3\">{{localization.confirmOperationPrompt}}</h3> </div> </div> <div class=\"modal-footer form-group confirm-btn-group\"> <button type=\"button\" class=\"sweet-alert-btn\" (click)=\"close()\"> {{localization.cancel}} </button> <button type=\"submit\" class=\"sweet-alert-btn\"> {{localization.confirm}} </button> </div> </form> ",
32682
+ styles: [".modal-body { padding: 17px; position: relative; text-align: center; } .modal-footer { padding: 10px 5px; text-align: center; border-color: transparent; } .confirm-modal { max-width: 478px; } .confirm-modal>.modal-content { padding: 17px; } h3.confirm-h3 { font-size: 20px; font-weight: bold; } .confirm-btn-group { padding: 0; margin-bottom: 28px; margin-right: 50px; } .confirm-btn-group button { display: inline-block; } .confirm-btn-group button:last-child { background-color: rgb(221, 107, 85); box-shadow: rgba(221, 107, 85, 0.8) 0px 0px 2px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px; } .alertIcon { background: url(assets/img/alert.svg); width: 88px; height: 88px; display: inline-block; } .sweet-alert-btn { color: #fff; border: none; background: #ddd; font-size: 17px; font-weight: 500; border-radius: 5px; padding: 10px 32px; margin: 26px 5px 0; cursor: pointer } "]
32683
+ }),
32684
+ __param(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_localization_localization_service__WEBPACK_IMPORTED_MODULE_2__[/* LOCALIZATION */ "b"]))
32685
+ ], ConfirmOperationModalComponent);
32686
+
32687
+
32688
+
32689
+ /***/ }),
32690
+ /* 22 */
32691
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
32692
+
32693
+ "use strict";
32694
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AlertModalComponent; });
32695
+ /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
32696
+ /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
32697
+ /* harmony import */ var _localization_localization_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19);
32698
+ /* harmony import */ var rxjs_internal_Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(273);
32699
+ /* harmony import */ var rxjs_internal_Subject__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(rxjs_internal_Subject__WEBPACK_IMPORTED_MODULE_2__);
32700
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
32701
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
32702
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
32703
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
32704
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
32705
+ };
32706
+ var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
32707
+ return function (target, key) { decorator(target, key, paramIndex); }
32708
+ };
32709
+
32710
+
32711
+
32712
+ let AlertModalComponent = class AlertModalComponent {
32713
+ constructor(localization) {
32714
+ this.localization = localization;
32715
+ this._onClosed = new rxjs_internal_Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
32716
+ }
32717
+ get onClosed() {
32718
+ return this._onClosed;
32719
+ }
32720
+ close() {
32721
+ this._onClosed.next();
32722
+ this._onClosed.complete();
32723
+ }
32724
+ };
32725
+ AlertModalComponent = __decorate([
32726
+ Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
32727
+ selector: 'alertModal',
32728
+ template: "<div class=\"modal-body\"> <div style=\"text-align:center\"> <div class=\"alertIcon\"></div> <h3 class=\"alert-h3\">{{alermMessage}}</h3> </div> </div> <div class=\"modal-footer form-group confirm-btn\"> <button type=\"button\" class=\"sweet-alert-btn\" (click)=\"close()\"> {{localization.confirm}} </button> </div> ",
32729
+ styles: [".modal-header { padding: 17px; border-color: transparent; } .modal-body { padding: 17px; position: relative; text-align: center; } .modal-footer { padding: 10px 5px; text-align: center; border-color: transparent; } .alert-modal { max-width: 478px; } .alert-modal>.modal-content { padding: 17px; } h3.alert-h3 { font-size: 20px; font-weight: bold; } .alert-btn { padding: 0; margin-bottom: 0; } .alert-btn button { display: inline-block; } .alertIcon { background: url(assets/img/alert.svg); width: 88px; height: 88px; display: inline-block; } .sweet-alert-btn { color: #fff; border: none; background: #ddd; font-size: 17px; font-weight: 500; border-radius: 5px; padding: 10px 32px; margin: 26px 5px 0; cursor: point; background-color: rgb(221, 107, 85); box-shadow: rgba(221, 107, 85, 0.8) 0px 0px 2px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px; } "]
32730
+ }),
32731
+ __param(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_localization_localization_service__WEBPACK_IMPORTED_MODULE_1__[/* LOCALIZATION */ "b"]))
32732
+ ], AlertModalComponent);
32733
+
32734
+
32735
+
32736
32736
  /***/ }),
32737
32737
  /* 23 */
32738
32738
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
@@ -35156,8 +35156,8 @@ class state_control_element_StateControlElement extends conditional_dynamic_disp
35156
35156
  if (!this.currentRect.length) {
35157
35157
  return;
35158
35158
  }
35159
- // 元件绑定设备状态时不需要在右上角显示状态
35160
- if (this.$element[0].dataset.model.includes('设备状态'))
35159
+ // 元件绑定设备状态或当前语种ID时不需要在右上角显示状态
35160
+ if (this.$element[0].dataset.model.includes('设备状态') || this.$element[0].dataset.model.includes('当前语种ID'))
35161
35161
  return;
35162
35162
  const document = this.$element[0].ownerDocument;
35163
35163
  const imgObj = document.createElementNS('http://www.w3.org/2000/svg', 'image');
@@ -35383,11 +35383,7 @@ class readable_element_ReadableElement extends conditional_enable_element_Condit
35383
35383
  this.changeStates();
35384
35384
  }
35385
35385
  });
35386
- if (value.systemName !== '设备状态' && (this.state === _tmp_model["State"].Normal || this.state === _tmp_model["State"].Disable
35387
- || value.variableName === this.minVariableName
35388
- || value.variableName === this.maxVariableName)) {
35389
- this.updateVariableValue(value.value, value.variableName);
35390
- }
35386
+ // 处理系统变量"设备状态"
35391
35387
  if (value.systemName === '设备状态') {
35392
35388
  let name = value.customStatus;
35393
35389
  const language = ((_b = (_a = window.abp.localization) === null || _a === void 0 ? void 0 : _a.currentLanguage) === null || _b === void 0 ? void 0 : _b.name) || ((_d = (_c = this.localization.localizationService) === null || _c === void 0 ? void 0 : _c.translate) === null || _d === void 0 ? void 0 : _d.currentLang);
@@ -35410,6 +35406,19 @@ class readable_element_ReadableElement extends conditional_enable_element_Condit
35410
35406
  }
35411
35407
  }
35412
35408
  this.updateVariableValue(name, '设备状态');
35409
+ return; // 处理完"设备状态"后直接返回
35410
+ }
35411
+ // 处理系统变量"当前语种ID"
35412
+ if (value.variableName === '当前语种ID') {
35413
+ // 直接使用变量值(数字或null)
35414
+ this.updateVariableValue(value.value, value.variableName);
35415
+ return;
35416
+ }
35417
+ // 处理普通变量
35418
+ if (this.state === _tmp_model["State"].Normal || this.state === _tmp_model["State"].Disable
35419
+ || value.variableName === this.minVariableName
35420
+ || value.variableName === this.maxVariableName) {
35421
+ this.updateVariableValue(value.value, value.variableName);
35413
35422
  }
35414
35423
  }
35415
35424
  }
@@ -35688,10 +35697,10 @@ bar_graph_element_BarGraphElement.DEFAULT_MAX_VALUE = 100;
35688
35697
  var _tmp_config = __webpack_require__(10);
35689
35698
 
35690
35699
  // EXTERNAL MODULE: ./.tmp/modal/alert/alert-modal.component.ts
35691
- var alert_modal_component = __webpack_require__(21);
35700
+ var alert_modal_component = __webpack_require__(22);
35692
35701
 
35693
35702
  // EXTERNAL MODULE: ./.tmp/modal/confirm-operation/confirm-operation-modal.component.ts
35694
- var confirm_operation_modal_component = __webpack_require__(20);
35703
+ var confirm_operation_modal_component = __webpack_require__(21);
35695
35704
 
35696
35705
  // CONCATENATED MODULE: ./.tmp/modal/write-character/write-character-modal-args.ts
35697
35706
  class WriteCharacterModalArgs {
@@ -35755,12 +35764,17 @@ var numerical_operation_service = __webpack_require__(42);
35755
35764
 
35756
35765
 
35757
35766
  // EXTERNAL MODULE: ./.tmp/modal/verify-password/verify-password-modal.component.ts
35758
- var verify_password_modal_component = __webpack_require__(19);
35767
+ var verify_password_modal_component = __webpack_require__(20);
35759
35768
 
35760
35769
  // CONCATENATED MODULE: ./.tmp/elements/shared/text/text-element.ts
35761
35770
 
35762
35771
  class text_element_TextElementModal {
35763
35772
  constructor(content, font, width, height, isVariableText) {
35773
+ // 保存参数以便后续更新文本
35774
+ this.font = font;
35775
+ this.width = width;
35776
+ this.height = height;
35777
+ this.isVariableText = isVariableText;
35764
35778
  if (/iPhone|iPod/i.test(navigator.userAgent)) {
35765
35779
  width += 10;
35766
35780
  }
@@ -35772,6 +35786,21 @@ class text_element_TextElementModal {
35772
35786
  get Element() {
35773
35787
  return this._element;
35774
35788
  }
35789
+ /**
35790
+ * 更新文本内容
35791
+ * @param content 新的文本内容
35792
+ */
35793
+ updateText(content) {
35794
+ // 清空现有内容
35795
+ this._element.innerHTML = '';
35796
+ // 创建新的文本元素
35797
+ let width = this.width;
35798
+ if (/iPhone|iPod/i.test(navigator.userAgent)) {
35799
+ width += 10;
35800
+ }
35801
+ const text = this.createNewForeignObjectText(content, this.font, width, this.height, this.isVariableText);
35802
+ this._element.appendChild(text);
35803
+ }
35775
35804
  getforeignObjectElement(width, height) {
35776
35805
  const textElement = document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject');
35777
35806
  textElement.setAttribute('width', width.toString());
@@ -36993,7 +37022,7 @@ class datetime_display_element_DatetimeDisplayElement extends conditional_displa
36993
37022
  }
36994
37023
 
36995
37024
  // EXTERNAL MODULE: ./node_modules/d3/d3.js
36996
- var d3 = __webpack_require__(22);
37025
+ var d3 = __webpack_require__(18);
36997
37026
 
36998
37027
  // EXTERNAL MODULE: ./node_modules/nvd3/build/nv.d3.js
36999
37028
  var nv_d3 = __webpack_require__(39);
@@ -37065,11 +37094,12 @@ var AxisRangeType;
37065
37094
 
37066
37095
 
37067
37096
  class historical_curve_element_HistoricalCurveElement extends conditional_display_element_ConditionalDisplayElement {
37068
- constructor(element, injector, permissionChecker, variableCommunicator, variableStore, historyDataStore, signalRAppId, systemTextLibraryService, languageService) {
37097
+ constructor(element, injector, permissionChecker, variableCommunicator, variableStore, historyDataStore, signalRAppId, systemTextLibraryService, languageService, guiContext) {
37069
37098
  super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
37070
37099
  this.historyDataStore = historyDataStore;
37071
37100
  this.systemTextLibraryService = systemTextLibraryService;
37072
37101
  this.languageService = languageService;
37102
+ this.guiContext = guiContext;
37073
37103
  this.displayOption = {
37074
37104
  dataLimit: 500,
37075
37105
  dataZoomHeight: 32,
@@ -37111,6 +37141,8 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37111
37141
  }
37112
37142
  this.loadFirstPage();
37113
37143
  this.initKeyboardListener();
37144
+ // 订阅语种变化事件
37145
+ this.subscribeLanguageChange();
37114
37146
  }
37115
37147
  dispose() {
37116
37148
  clearInterval(this.refreshIntervalId);
@@ -37124,6 +37156,11 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37124
37156
  window.removeEventListener('native.keyboardshow', this.setNeedResize);
37125
37157
  window.removeEventListener('native.keyboardhide', this.setNeedResize);
37126
37158
  }
37159
+ // 取消语种变化订阅
37160
+ if (this.languageChangeSubscription) {
37161
+ this.languageChangeSubscription.unsubscribe();
37162
+ this.languageChangeSubscription = undefined;
37163
+ }
37127
37164
  this.logger.debug(`[GUI]Dispose Histoical Curve Refresh Interval:${d3["time"].format('%x %X')(new Date())}`);
37128
37165
  }
37129
37166
  initKeyboardListener() {
@@ -37133,6 +37170,59 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37133
37170
  window.addEventListener('native.keyboardhide', this.setNeedResize);
37134
37171
  }
37135
37172
  }
37173
+ /**
37174
+ * 订阅语种变化事件
37175
+ */
37176
+ subscribeLanguageChange() {
37177
+ if (this.guiContext && this.guiContext.languageChanged$) {
37178
+ this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
37179
+ // 只更新时间段选择器的文案,不重新查询数据
37180
+ this.updateLanguageTexts();
37181
+ });
37182
+ }
37183
+ }
37184
+ /**
37185
+ * 更新语种相关的文案(时间段选择器)
37186
+ */
37187
+ updateLanguageTexts() {
37188
+ const selectElement = this.rootElement.select('select');
37189
+ if (!selectElement.empty()) {
37190
+ // 重新生成时间段数据
37191
+ const updatedTimePeriods = this.getValidTimePeriods();
37192
+ // 更新选项文本
37193
+ const options = selectElement.selectAll('option');
37194
+ options.each(function (_d, i) {
37195
+ if (i < updatedTimePeriods.length) {
37196
+ d3["select"](this).text(updatedTimePeriods[i].name);
37197
+ }
37198
+ });
37199
+ }
37200
+ }
37201
+ /**
37202
+ * 获取当前语种的 culture 代码
37203
+ */
37204
+ getCurrentCulture() {
37205
+ var _a, _b, _c, _e, _f, _g;
37206
+ // 获取当前语种ID
37207
+ const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
37208
+ // 确定要使用的语种代码(culture)
37209
+ const defaultLanguage = ((_e = this.languageService) === null || _e === void 0 ? void 0 : _e.getDefaultLanguage()) || 'zh-CN';
37210
+ if (currentLanguageId === null || currentLanguageId === undefined) {
37211
+ // 设备未设置当前语种,使用默认语种
37212
+ return defaultLanguage;
37213
+ }
37214
+ else {
37215
+ // 设备已设置当前语种,获取对应的语种代码
37216
+ const currentLanguage = (_g = (_f = this.guiContext) === null || _f === void 0 ? void 0 : _f.getLanguageCultureById) === null || _g === void 0 ? void 0 : _g.call(_f, currentLanguageId);
37217
+ if (currentLanguage) {
37218
+ return currentLanguage;
37219
+ }
37220
+ else {
37221
+ // 无法获取语种代码,使用默认语种
37222
+ return defaultLanguage;
37223
+ }
37224
+ }
37225
+ }
37136
37226
  getValidTimePeriods() {
37137
37227
  const timePeriods = new Array();
37138
37228
  timePeriods.push({ key: 6, name: this.getTimePeriodText(service["TIME_PERIOD_KEYS"].LAST_THIRTY_MINUTES) });
@@ -37145,11 +37235,10 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37145
37235
  return timePeriods;
37146
37236
  }
37147
37237
  /**
37148
- * 获取时间段文案(从系统文本库获取多语种翻译,fallback 使用 localization)
37238
+ * 获取时间段文案(从系统文本库获取多语种翻译)
37149
37239
  */
37150
37240
  getTimePeriodText(textKey) {
37151
- var _a;
37152
- const currentCulture = ((_a = this.languageService) === null || _a === void 0 ? void 0 : _a.getDefaultLanguage()) || 'zh-CN';
37241
+ const currentCulture = this.getCurrentCulture();
37153
37242
  const systemType = service["SYSTEM_TEXT_LIBRARY_TYPES"].COMPONENT_BUILTIN;
37154
37243
  if (this.systemTextLibraryService) {
37155
37244
  const translation = this.systemTextLibraryService.getSystemTextValue(systemType, textKey, currentCulture);
@@ -37883,7 +37972,7 @@ meter_element_MeterElement.DEFAULT_MAX_VALUE = 100;
37883
37972
 
37884
37973
  // CONCATENATED MODULE: ./.tmp/modal/write-value/write-value-modal-args.ts
37885
37974
  class WriteValueModalArgs {
37886
- constructor(variableName, dataType, fBoxDataType, integerDigits, fractionDigits, numericalOperation, version, enableDataParsed, releasedVariableService) {
37975
+ constructor(variableName, dataType, fBoxDataType, integerDigits, fractionDigits, numericalOperation, version, enableDataParsed, releasedVariableService, guiContext) {
37887
37976
  this.variableName = variableName;
37888
37977
  this.dataType = dataType;
37889
37978
  this.fBoxDataType = fBoxDataType;
@@ -37893,6 +37982,7 @@ class WriteValueModalArgs {
37893
37982
  this.version = version;
37894
37983
  this.enableDataParsed = enableDataParsed;
37895
37984
  this.releasedVariableService = releasedVariableService;
37985
+ this.guiContext = guiContext;
37896
37986
  }
37897
37987
  }
37898
37988
 
@@ -37923,13 +38013,14 @@ var variableRwTypeEnum;
37923
38013
  variableRwTypeEnum[variableRwTypeEnum["readWiter"] = 6] = "readWiter";
37924
38014
  })(variableRwTypeEnum || (variableRwTypeEnum = {}));
37925
38015
  class numerical_display_element_NumericalDisplayElement extends readable_element_ReadableElement {
37926
- constructor(element, injector, modalService, permissionChecker, variableCommunicator, graphStore, operationRecordService, releasedVariableService, securityChecker, variableStore, localization, signalRAppId) {
38016
+ constructor(element, injector, modalService, permissionChecker, variableCommunicator, graphStore, operationRecordService, releasedVariableService, securityChecker, variableStore, localization, signalRAppId, guiContext) {
37927
38017
  super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
37928
38018
  this.modalService = modalService;
37929
38019
  this.graphStore = graphStore;
37930
38020
  this.operationRecordService = operationRecordService;
37931
38021
  this.releasedVariableService = releasedVariableService;
37932
38022
  this.securityChecker = securityChecker;
38023
+ this.guiContext = guiContext;
37933
38024
  this.displayText = '';
37934
38025
  this.enableDataParsed = false;
37935
38026
  this.logger = injector.get(logger["b" /* LOGGER_SERVICE_TOKEN */]);
@@ -37962,6 +38053,25 @@ class numerical_display_element_NumericalDisplayElement extends readable_element
37962
38053
  this.$element.remove();
37963
38054
  }
37964
38055
  }
38056
+ /**
38057
+ * 重写父类方法,处理"当前语种ID"系统变量
38058
+ * 当值为null时,显示默认语种ID
38059
+ */
38060
+ reportValueChanged(value) {
38061
+ var _a, _b, _c;
38062
+ // 处理系统变量"当前语种ID"
38063
+ if (value.variableName === '当前语种ID') {
38064
+ let displayValue = value.value;
38065
+ // 如果值为null,使用默认语种ID
38066
+ if (displayValue === null || displayValue === undefined) {
38067
+ displayValue = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getDefaultLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : 0;
38068
+ }
38069
+ this.updateVariableValue(displayValue);
38070
+ return;
38071
+ }
38072
+ // 其他变量调用父类方法
38073
+ super.reportValueChanged(value);
38074
+ }
37965
38075
  initElement() {
37966
38076
  const { rootElement } = this;
37967
38077
  rootElement.selectAll('*').remove();
@@ -38085,7 +38195,7 @@ class numerical_display_element_NumericalDisplayElement extends readable_element
38085
38195
  if (null == this.writeVariableName) {
38086
38196
  return;
38087
38197
  }
38088
- const args = new WriteValueModalArgs(this.writeVariableName, this.model.dataType, this.model.fBoxDataType, this.model.integerDigits, this.model.fractionDigits, this.numericalOperationService.getNumericalOperations(this.model), this.model.version, this.enableDataParsed, this.releasedVariableService);
38198
+ const args = new WriteValueModalArgs(this.writeVariableName, this.model.dataType, this.model.fBoxDataType, this.model.integerDigits, this.model.fractionDigits, this.numericalOperationService.getNumericalOperations(this.model), this.model.version, this.enableDataParsed, this.releasedVariableService, this.guiContext);
38089
38199
  this.writeValueMmodalRef = this.modalService.show(write_value_modal_component["a" /* WriteValueModalComponent */], {
38090
38200
  initialState: { args: args }, backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
38091
38201
  });
@@ -38990,11 +39100,12 @@ class image_element_ImageElement extends conditional_dynamic_display_element_Con
38990
39100
 
38991
39101
 
38992
39102
  class text_element_TextElement extends conditional_dynamic_display_element_ConditionalDynamicDisplayElement {
38993
- constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore, signalRAppId, textLibraryService, languageService) {
39103
+ constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore, signalRAppId, textLibraryService, languageService, guiContext) {
38994
39104
  super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
38995
39105
  this.graphStore = graphStore;
38996
39106
  this.textLibraryService = textLibraryService;
38997
39107
  this.languageService = languageService;
39108
+ this.guiContext = guiContext;
38998
39109
  this.logger = injector.get(logger["b" /* LOGGER_SERVICE_TOKEN */]);
38999
39110
  if (this.model.text && this.model.size) {
39000
39111
  const width = this.model.size.width;
@@ -39017,8 +39128,10 @@ class text_element_TextElement extends conditional_dynamic_display_element_Condi
39017
39128
  };
39018
39129
  // 获取显示文本(支持文本库)
39019
39130
  const displayText = this.getDisplayText();
39020
- const textElement = new text_element_TextElementModal(displayText, font, width, height);
39021
- this.$element.append(textElement.Element);
39131
+ this.textElementModal = new text_element_TextElementModal(displayText, font, width, height);
39132
+ this.$element.append(this.textElementModal.Element);
39133
+ // 订阅语种变化
39134
+ this.subscribeLanguageChange();
39022
39135
  }
39023
39136
  else {
39024
39137
  this.handleTextValue();
@@ -39028,35 +39141,86 @@ class text_element_TextElement extends conditional_dynamic_display_element_Condi
39028
39141
  }
39029
39142
  }
39030
39143
  dispose() {
39144
+ // 取消语种变化订阅
39145
+ if (this.languageChangeSubscription) {
39146
+ this.languageChangeSubscription.unsubscribe();
39147
+ this.languageChangeSubscription = undefined;
39148
+ }
39031
39149
  if (this.$element) {
39032
39150
  this.$element.remove();
39033
39151
  }
39034
39152
  }
39153
+ /**
39154
+ * 订阅语种变化事件
39155
+ * 当设备的语种ID改变时,重新渲染文本
39156
+ */
39157
+ subscribeLanguageChange() {
39158
+ // 只有使用文本库时才需要订阅语种变化
39159
+ if (!this.model.textLibrary || this.model.textLibrary.labelType !== 'textLibrary') {
39160
+ return;
39161
+ }
39162
+ if (this.guiContext && this.guiContext.languageChanged$) {
39163
+ this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
39164
+ // 重新渲染文本
39165
+ this.reRenderText();
39166
+ });
39167
+ }
39168
+ }
39169
+ /**
39170
+ * 重新渲染文本
39171
+ */
39172
+ reRenderText() {
39173
+ if (!this.textElementModal || !this.model.size) {
39174
+ return;
39175
+ }
39176
+ // 获取新的显示文本
39177
+ const displayText = this.getDisplayText();
39178
+ // 直接更新文本内容,而不是重新创建元素
39179
+ this.textElementModal.updateText(displayText);
39180
+ }
39035
39181
  /**
39036
39182
  * 获取显示文本
39037
39183
  * 如果配置了文本库,则从文本库中获取对应语种的文本
39038
39184
  * 否则返回默认文本
39039
39185
  */
39040
39186
  getDisplayText() {
39041
- var _a;
39187
+ var _a, _b, _c, _d, _e, _f;
39042
39188
  // 检查是否使用文本库
39043
39189
  if (this.model.textLibrary && this.model.textLibrary.labelType === 'textLibrary') {
39044
39190
  const textLibraryId = this.model.textLibrary.selectedTextLibraryItem;
39045
39191
  const textItem = this.model.textLibrary.selectedTextItem;
39046
39192
  if (textLibraryId && textItem && this.textLibraryService) {
39047
- // 获取当前默认语种
39048
- const currentLanguage = ((_a = this.languageService) === null || _a === void 0 ? void 0 : _a.getDefaultLanguage()) || 'zh-CN';
39049
39193
  // 获取文本库数据
39050
39194
  const textLibraryData = this.textLibraryService.getTextLibraryById(typeof textLibraryId === 'string' ? parseInt(textLibraryId, 10) : textLibraryId);
39051
39195
  if (textLibraryData && textLibraryData.data) {
39052
39196
  // 查找对应的文本条目
39053
39197
  const textEntry = textLibraryData.data.find(entry => entry.key === textItem.toString());
39054
39198
  if (textEntry) {
39055
- // 优先返回对应语种的文本
39056
- if (textEntry.cultures && textEntry.cultures[currentLanguage]) {
39057
- return textEntry.cultures[currentLanguage];
39199
+ // 获取当前语种ID
39200
+ const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
39201
+ // 确定要使用的语种代码(culture)
39202
+ let targetLanguage;
39203
+ const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
39204
+ if (currentLanguageId === null || currentLanguageId === undefined) {
39205
+ // 设备未设置当前语种,使用默认语种
39206
+ targetLanguage = defaultLanguage;
39207
+ }
39208
+ else {
39209
+ // 设备已设置当前语种,获取对应的语种代码
39210
+ const currentLanguage = (_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId);
39211
+ if (currentLanguage) {
39212
+ targetLanguage = currentLanguage;
39213
+ }
39214
+ else {
39215
+ // 无法获取语种代码,使用默认语种
39216
+ targetLanguage = defaultLanguage;
39217
+ }
39218
+ }
39219
+ // 返回对应语种的文本
39220
+ if (textEntry.cultures && textEntry.cultures[targetLanguage]) {
39221
+ return textEntry.cultures[targetLanguage];
39058
39222
  }
39059
- // 如果没有对应语种,返回默认值
39223
+ // 如果没有对应语种,返回空字符串
39060
39224
  return '';
39061
39225
  }
39062
39226
  }
@@ -39083,7 +39247,7 @@ class text_element_TextElement extends conditional_dynamic_display_element_Condi
39083
39247
  // CONCATENATED MODULE: ./.tmp/elements/shared/text/text-state-element.ts
39084
39248
 
39085
39249
  class text_state_element_TextStateElement {
39086
- constructor(textStates, width, height, logger, version, faultFlickers, textLibrarySetting, textLibraryService, languageService) {
39250
+ constructor(textStates, width, height, logger, version, faultFlickers, textLibrarySetting, textLibraryService, languageService, guiContext) {
39087
39251
  this.textStates = textStates;
39088
39252
  this.width = width;
39089
39253
  this.height = height;
@@ -39093,14 +39257,19 @@ class text_state_element_TextStateElement {
39093
39257
  this.textLibrarySetting = textLibrarySetting;
39094
39258
  this.textLibraryService = textLibraryService;
39095
39259
  this.languageService = languageService;
39260
+ this.guiContext = guiContext;
39096
39261
  this.faultFlickerStatus = false;
39097
39262
  this.faultFlickerInterval = undefined;
39098
39263
  this._element = document.createElementNS('http://www.w3.org/2000/svg', 'g');
39264
+ // 订阅语种变化事件
39265
+ this.subscribeLanguageChange();
39099
39266
  }
39100
39267
  get Element() {
39101
39268
  return this._element;
39102
39269
  }
39103
39270
  switchToState(stateId) {
39271
+ // 保存当前状态ID,用于语种切换时重新渲染
39272
+ this.currentStateId = stateId;
39104
39273
  const textState = this.textStates.find(t => t.id === stateId);
39105
39274
  if (textState === undefined) {
39106
39275
  this.removeForeignObjectlement();
@@ -39152,6 +39321,39 @@ class text_state_element_TextStateElement {
39152
39321
  }
39153
39322
  this.doFaultFlicker(textElement, stateId);
39154
39323
  }
39324
+ /**
39325
+ * 订阅语种变化事件
39326
+ * 当设备的语种ID改变时,重新渲染当前状态的文本
39327
+ */
39328
+ subscribeLanguageChange() {
39329
+ // 只有使用文本库时才需要订阅语种变化
39330
+ if (!this.textLibrarySetting || this.textLibrarySetting.labelType !== 'textLibrary') {
39331
+ return;
39332
+ }
39333
+ if (this.guiContext && this.guiContext.languageChanged$) {
39334
+ this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
39335
+ // 如果当前有状态,重新渲染
39336
+ if (this.currentStateId !== undefined) {
39337
+ this.switchToState(this.currentStateId);
39338
+ }
39339
+ });
39340
+ }
39341
+ }
39342
+ /**
39343
+ * 释放资源
39344
+ */
39345
+ dispose() {
39346
+ // 取消语种变化订阅
39347
+ if (this.languageChangeSubscription) {
39348
+ this.languageChangeSubscription.unsubscribe();
39349
+ this.languageChangeSubscription = undefined;
39350
+ }
39351
+ // 清除闪烁定时器
39352
+ if (this.faultFlickerInterval) {
39353
+ clearInterval(this.faultFlickerInterval);
39354
+ this.faultFlickerInterval = undefined;
39355
+ }
39356
+ }
39155
39357
  getforeignObjectElement() {
39156
39358
  if (!this.textElement) {
39157
39359
  this.textElement = document.createElementNS('http://www.w3.org/2000/svg', 'text');
@@ -39200,29 +39402,51 @@ class text_state_element_TextStateElement {
39200
39402
  }
39201
39403
  /**
39202
39404
  * 获取显示文本
39203
- * 如果配置了文本库,则根据状态ID从文本库中获取对应语种的文本
39405
+ * 如果配置了文本库,则根据状态ID和当前语种ID从文本库中获取对应语种的文本
39204
39406
  * 否则返回默认文本
39205
39407
  */
39206
39408
  getDisplayText(stateId, defaultContent) {
39207
- var _a;
39409
+ var _a, _b, _c, _d, _e, _f;
39208
39410
  // 检查是否使用文本库
39209
39411
  if (this.textLibrarySetting && this.textLibrarySetting.labelType === 'textLibrary') {
39210
39412
  const textLibraryId = this.textLibrarySetting.selectedTextLibraryItem;
39211
39413
  if (textLibraryId && this.textLibraryService) {
39212
- // 获取当前默认语种
39213
- const currentLanguage = ((_a = this.languageService) === null || _a === void 0 ? void 0 : _a.getDefaultLanguage()) || 'zh-CN';
39214
39414
  // 获取文本库数据
39215
39415
  const textLibraryData = this.textLibraryService.getTextLibraryById(typeof textLibraryId === 'string' ? parseInt(textLibraryId, 10) : textLibraryId);
39216
39416
  if (textLibraryData && textLibraryData.data) {
39217
39417
  // 使用状态ID作为value查找对应的文本条目
39218
39418
  const textEntry = textLibraryData.data.find(entry => entry.value === stateId.toString());
39219
39419
  if (textEntry) {
39220
- // 优先返回对应语种的文本
39221
- if (textEntry.cultures && textEntry.cultures[currentLanguage]) {
39222
- return textEntry.cultures[currentLanguage];
39420
+ // 获取当前语种ID
39421
+ const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
39422
+ // 确定要使用的语种代码(culture)
39423
+ let targetLanguage;
39424
+ const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
39425
+ if (currentLanguageId === null || currentLanguageId === undefined) {
39426
+ // 设备未设置当前语种,使用默认语种
39427
+ targetLanguage = defaultLanguage;
39428
+ }
39429
+ else {
39430
+ // 设备已设置当前语种,获取对应的语种代码
39431
+ const currentLanguage = (_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId);
39432
+ if (currentLanguage) {
39433
+ // 直接使用设备设置的语种,不再fallback
39434
+ targetLanguage = currentLanguage;
39435
+ }
39436
+ else {
39437
+ // 无法获取语种代码(可能是配置错误),返回空字符串
39438
+ return '';
39439
+ }
39440
+ }
39441
+ // 返回对应语种的文本,如果没有则返回空字符串
39442
+ if (textEntry.cultures && textEntry.cultures[targetLanguage]) {
39443
+ const text = textEntry.cultures[targetLanguage];
39444
+ return text;
39445
+ }
39446
+ else {
39447
+ // 对应语种没有文本,返回空字符串
39448
+ return '';
39223
39449
  }
39224
- // 如果没有对应语种,返回key作为默认值
39225
- return '';
39226
39450
  }
39227
39451
  }
39228
39452
  }
@@ -39600,7 +39824,7 @@ class word_switch_operator_WordSwitchOperator {
39600
39824
 
39601
39825
 
39602
39826
  class switch_indicator_light_element_SwitchIndicatorLightElement extends conditional_enable_element_ConditionalEnableElement {
39603
- constructor(element, injector, modalService, variableCommunicator, graphStore, permissionChecker, operationRecordService, securityChecker, variableStore, localization, signalRAppId, textLibraryService, languageService) {
39827
+ constructor(element, injector, modalService, variableCommunicator, graphStore, permissionChecker, operationRecordService, securityChecker, variableStore, localization, signalRAppId, textLibraryService, languageService, guiContext) {
39604
39828
  super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
39605
39829
  this.modalService = modalService;
39606
39830
  this.graphStore = graphStore;
@@ -39608,6 +39832,7 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
39608
39832
  this.securityChecker = securityChecker;
39609
39833
  this.textLibraryService = textLibraryService;
39610
39834
  this.languageService = languageService;
39835
+ this.guiContext = guiContext;
39611
39836
  this.isBitRestoration = false; // 是否是 位设定且执行设置是复位
39612
39837
  this.isVerifiedForRestoration = false; // 位设定且执行设置是复位情况下,是否已经完成了验证
39613
39838
  this.isWriteRestorationDownValue = false;
@@ -39823,9 +40048,31 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
39823
40048
  this.graphStateElement = new graph_state_element_GraphStateElement(this.model.graphSetting, width, height, this.graphStore, this.logger, this.model.version, this.model.states);
39824
40049
  this.$element.append(this.graphStateElement.Element);
39825
40050
  }
39826
- this.textStateElement = new text_state_element_TextStateElement(this.model.states, width, height, this.logger, this.model.version, this.model.states, this.model.textLibrary, this.textLibraryService, this.languageService);
40051
+ this.textStateElement = new text_state_element_TextStateElement(this.model.states, width, height, this.logger, this.model.version, this.model.states, this.model.textLibrary, this.textLibraryService, this.languageService, this.guiContext);
39827
40052
  this.$element.append(this.textStateElement.Element);
39828
40053
  }
40054
+ /**
40055
+ * 释放资源
40056
+ */
40057
+ dispose() {
40058
+ // 释放文本元素资源(取消语种变化订阅等)
40059
+ if (this.textStateElement) {
40060
+ this.textStateElement.dispose();
40061
+ }
40062
+ // 释放指示灯操作器资源
40063
+ if (this.indicatorLightOperator) {
40064
+ // indicatorLightOperator 可能有自己的dispose方法
40065
+ }
40066
+ // 清除定时器
40067
+ if (this.restorationTimer) {
40068
+ clearTimeout(this.restorationTimer);
40069
+ this.restorationTimer = undefined;
40070
+ }
40071
+ // 移除事件监听
40072
+ if (this.onDocMouseUp) {
40073
+ document.removeEventListener(this.isMobileMode ? 'touchend' : 'mouseup', this.onDocMouseUp);
40074
+ }
40075
+ }
39829
40076
  checkState() {
39830
40077
  if (!this.model.states) {
39831
40078
  throw new Error('The switch indicator light\'s states is undefined.');
@@ -40205,7 +40452,7 @@ var view_service = __webpack_require__(27);
40205
40452
 
40206
40453
 
40207
40454
  class view_operation_element_ViewOperationElement extends conditional_enable_element_ConditionalEnableElement {
40208
- constructor(element, injector, modalService, variableCommunicator, variableStore, graphStore, permissionChecker, operationRecordService, securityChecker, localization, popupViewService, hostContainerId, el, signalRAppId) {
40455
+ constructor(element, injector, modalService, variableCommunicator, variableStore, graphStore, permissionChecker, operationRecordService, securityChecker, localization, popupViewService, hostContainerId, el, signalRAppId, textLibraryService, languageService, guiContext) {
40209
40456
  super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
40210
40457
  this.modalService = modalService;
40211
40458
  this.graphStore = graphStore;
@@ -40214,20 +40461,27 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
40214
40461
  this.popupViewService = popupViewService;
40215
40462
  this.hostContainerId = hostContainerId;
40216
40463
  this.el = el;
40464
+ this.textLibraryService = textLibraryService;
40465
+ this.languageService = languageService;
40466
+ this.guiContext = guiContext;
40217
40467
  this.touchedScreenX = 0;
40218
40468
  this.touchedScreenY = 0;
40219
40469
  this.logger = injector.get(logger["b" /* LOGGER_SERVICE_TOKEN */]);
40220
40470
  this.viewService = injector.get(view_service["a" /* ViewService */]);
40221
40471
  this.initElement();
40472
+ this.subscribeLanguageChange();
40222
40473
  }
40223
40474
  initElement() {
40224
40475
  const width = this.model.size.width;
40225
40476
  const height = this.model.size.height;
40226
40477
  this.initGraph(width, height);
40227
40478
  this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', width).attr('height', height).attr('fill', 'transparent');
40479
+ // 初始化文本显示
40228
40480
  const $dateTimeText = this.$element.find('text').last();
40229
40481
  const fontStyle = this.model.label.font.fontStyle;
40230
40482
  $dateTimeText.css('font', fontStyle + ',msyh');
40483
+ // 设置初始文本内容(支持文本库)
40484
+ this.updateTextContent($dateTimeText);
40231
40485
  this.switchToState(0);
40232
40486
  this.rootElement.on('mousedown', () => {
40233
40487
  if (!this.isInitialized) {
@@ -40395,6 +40649,93 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
40395
40649
  this.operationRecordService.record({ operationDescription: this.model.operationDescription });
40396
40650
  }
40397
40651
  }
40652
+ /**
40653
+ * 订阅语种变化事件
40654
+ */
40655
+ subscribeLanguageChange() {
40656
+ // 只有使用文本库时才需要订阅语种变化
40657
+ if (!this.model.textLibrary || this.model.textLibrary.labelType !== 'textLibrary') {
40658
+ return;
40659
+ }
40660
+ if (this.guiContext && this.guiContext.languageChanged$) {
40661
+ this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
40662
+ // 更新文本内容
40663
+ const $dateTimeText = this.$element.find('text').last();
40664
+ this.updateTextContent($dateTimeText);
40665
+ });
40666
+ }
40667
+ }
40668
+ /**
40669
+ * 更新文本内容(支持文本库和语种切换)
40670
+ */
40671
+ updateTextContent($textElement) {
40672
+ const displayText = this.getDisplayText();
40673
+ $textElement.text(displayText);
40674
+ }
40675
+ /**
40676
+ * 获取显示文本
40677
+ */
40678
+ getDisplayText() {
40679
+ var _a, _b, _c, _d, _e, _f;
40680
+ // 检查是否使用文本库
40681
+ if (this.model.textLibrary && this.model.textLibrary.labelType === 'textLibrary') {
40682
+ const textLibraryId = this.model.textLibrary.selectedTextLibraryItem;
40683
+ const textItem = this.model.textLibrary.selectedTextItem;
40684
+ if (textLibraryId && textItem && this.textLibraryService) {
40685
+ // 获取文本库数据
40686
+ const textLibraryData = this.textLibraryService.getTextLibraryById(typeof textLibraryId === 'string' ? parseInt(textLibraryId, 10) : textLibraryId);
40687
+ if (textLibraryData && textLibraryData.data) {
40688
+ // 查找对应的文本条目
40689
+ const textEntry = textLibraryData.data.find(entry => entry.key === textItem.toString());
40690
+ if (textEntry) {
40691
+ // 获取当前语种ID
40692
+ const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
40693
+ // 确定要使用的语种代码(culture)
40694
+ let targetLanguage;
40695
+ const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
40696
+ if (currentLanguageId === null || currentLanguageId === undefined) {
40697
+ // 设备未设置当前语种,使用默认语种
40698
+ targetLanguage = defaultLanguage;
40699
+ }
40700
+ else {
40701
+ // 设备已设置当前语种,获取对应的语种代码
40702
+ const currentLanguage = (_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId);
40703
+ if (currentLanguage) {
40704
+ targetLanguage = currentLanguage;
40705
+ }
40706
+ else {
40707
+ // 无法获取语种代码,使用默认语种
40708
+ targetLanguage = defaultLanguage;
40709
+ }
40710
+ }
40711
+ // 返回对应语种的文本
40712
+ if (textEntry.cultures && textEntry.cultures[targetLanguage]) {
40713
+ return textEntry.cultures[targetLanguage];
40714
+ }
40715
+ // 如果没有对应语种,返回空字符串
40716
+ return '';
40717
+ }
40718
+ }
40719
+ }
40720
+ // 文本库配置但未找到数据,返回空字符串
40721
+ return '';
40722
+ }
40723
+ // 默认返回文本内容
40724
+ return this.model.label.content || '';
40725
+ }
40726
+ /**
40727
+ * 释放资源
40728
+ */
40729
+ dispose() {
40730
+ // 取消语种变化订阅
40731
+ if (this.languageChangeSubscription) {
40732
+ this.languageChangeSubscription.unsubscribe();
40733
+ this.languageChangeSubscription = undefined;
40734
+ }
40735
+ if (this.$element) {
40736
+ this.$element.remove();
40737
+ }
40738
+ }
40398
40739
  }
40399
40740
 
40400
40741
  // CONCATENATED MODULE: ./.tmp/elements/vector-graphics/straight-line-element.ts
@@ -40466,14 +40807,17 @@ class polygon_element_PolygonElement extends conditional_dynamic_display_element
40466
40807
 
40467
40808
 
40468
40809
  class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_element_ConditionalDynamicDisplayElement {
40469
- constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore, signalRAppId, textLibraryService, languageService) {
40810
+ constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore, signalRAppId, textLibraryService, languageService, guiContext) {
40470
40811
  super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
40471
40812
  this.graphStore = graphStore;
40472
40813
  this.textLibraryService = textLibraryService;
40473
40814
  this.languageService = languageService;
40815
+ this.guiContext = guiContext;
40474
40816
  this.logger = injector.get(logger["b" /* LOGGER_SERVICE_TOKEN */]);
40475
40817
  if (this.model.size) {
40476
40818
  this.initGraphAndText();
40819
+ // 订阅语种变化
40820
+ this.subscribeLanguageChange();
40477
40821
  }
40478
40822
  if (this.model && this.model.linkAddress) {
40479
40823
  this.rootElement.style('cursor', 'hand');
@@ -40487,6 +40831,44 @@ class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_ele
40487
40831
  });
40488
40832
  }
40489
40833
  }
40834
+ dispose() {
40835
+ // 取消语种变化订阅
40836
+ if (this.languageChangeSubscription) {
40837
+ this.languageChangeSubscription.unsubscribe();
40838
+ this.languageChangeSubscription = undefined;
40839
+ }
40840
+ if (this.$element) {
40841
+ this.$element.remove();
40842
+ }
40843
+ }
40844
+ /**
40845
+ * 订阅语种变化事件
40846
+ * 当设备的语种ID改变时,重新渲染文本
40847
+ */
40848
+ subscribeLanguageChange() {
40849
+ // 只有使用文本库时才需要订阅语种变化
40850
+ if (!this.model.textLibrary || this.model.textLibrary.labelType !== 'textLibrary') {
40851
+ return;
40852
+ }
40853
+ if (this.guiContext && this.guiContext.languageChanged$) {
40854
+ this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
40855
+ // 重新渲染文本
40856
+ this.reRenderText();
40857
+ });
40858
+ }
40859
+ }
40860
+ /**
40861
+ * 重新渲染文本
40862
+ */
40863
+ reRenderText() {
40864
+ if (!this.textElementModal || !this.model.size) {
40865
+ return;
40866
+ }
40867
+ // 获取新的显示文本
40868
+ const displayText = this.getDisplayText();
40869
+ // 直接更新文本内容,而不是重新创建元素
40870
+ this.textElementModal.updateText(displayText);
40871
+ }
40490
40872
  initGraphAndText() {
40491
40873
  this.rootElement.selectAll('*').remove();
40492
40874
  const size = this.model.size;
@@ -40509,8 +40891,8 @@ class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_ele
40509
40891
  };
40510
40892
  // 获取显示文本(支持文本库)
40511
40893
  const displayText = this.getDisplayText();
40512
- const textElement = new text_element_TextElementModal(displayText, font, width, height);
40513
- this.$element.append(textElement.Element);
40894
+ this.textElementModal = new text_element_TextElementModal(displayText, font, width, height);
40895
+ this.$element.append(this.textElementModal.Element);
40514
40896
  }
40515
40897
  /**
40516
40898
  * 获取显示文本
@@ -40518,25 +40900,43 @@ class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_ele
40518
40900
  * 否则返回默认文本
40519
40901
  */
40520
40902
  getDisplayText() {
40521
- var _a;
40903
+ var _a, _b, _c, _d, _e, _f;
40522
40904
  // 检查是否使用文本库
40523
40905
  if (this.model.textLibrary && this.model.textLibrary.labelType === 'textLibrary') {
40524
40906
  const textLibraryId = this.model.textLibrary.selectedTextLibraryItem;
40525
40907
  const textItem = this.model.textLibrary.selectedTextItem;
40526
40908
  if (textLibraryId && textItem && this.textLibraryService) {
40527
- // 获取当前默认语种
40528
- const currentLanguage = ((_a = this.languageService) === null || _a === void 0 ? void 0 : _a.getDefaultLanguage()) || 'zh-CN';
40529
40909
  // 获取文本库数据
40530
40910
  const textLibraryData = this.textLibraryService.getTextLibraryById(typeof textLibraryId === 'string' ? parseInt(textLibraryId, 10) : textLibraryId);
40531
40911
  if (textLibraryData && textLibraryData.data) {
40532
40912
  // 查找对应的文本条目
40533
40913
  const textEntry = textLibraryData.data.find(entry => entry.key === textItem.toString());
40534
40914
  if (textEntry) {
40535
- // 优先返回对应语种的文本
40536
- if (textEntry.cultures && textEntry.cultures[currentLanguage]) {
40537
- return textEntry.cultures[currentLanguage];
40915
+ // 获取当前语种ID
40916
+ const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
40917
+ // 确定要使用的语种代码(culture)
40918
+ let targetLanguage;
40919
+ const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
40920
+ if (currentLanguageId === null || currentLanguageId === undefined) {
40921
+ // 设备未设置当前语种,使用默认语种
40922
+ targetLanguage = defaultLanguage;
40538
40923
  }
40539
- // 如果没有对应语种,返回默认值
40924
+ else {
40925
+ // 设备已设置当前语种,获取对应的语种代码
40926
+ const currentLanguage = (_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId);
40927
+ if (currentLanguage) {
40928
+ targetLanguage = currentLanguage;
40929
+ }
40930
+ else {
40931
+ // 无法获取语种代码,使用默认语种
40932
+ targetLanguage = defaultLanguage;
40933
+ }
40934
+ }
40935
+ // 返回对应语种的文本
40936
+ if (textEntry.cultures && textEntry.cultures[targetLanguage]) {
40937
+ return textEntry.cultures[targetLanguage];
40938
+ }
40939
+ // 如果没有对应语种,返回空字符串
40540
40940
  return '';
40541
40941
  }
40542
40942
  }
@@ -41222,12 +41622,13 @@ var AlaertElementStatus;
41222
41622
  AlaertElementStatus[AlaertElementStatus["Loading"] = 1] = "Loading"; // 加载中
41223
41623
  })(AlaertElementStatus || (AlaertElementStatus = {}));
41224
41624
  class alarm_element_AlarmElement extends conditional_display_element_ConditionalDisplayElement {
41225
- constructor(element, injector, permissionChecker, variableCommunicator, variableStore, alarmsStore, signalRAppId, systemTextLibraryService, languageService) {
41625
+ constructor(element, injector, permissionChecker, variableCommunicator, variableStore, alarmsStore, signalRAppId, systemTextLibraryService, languageService, guiContext) {
41226
41626
  var _a;
41227
41627
  super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
41228
41628
  this.alarmsStore = alarmsStore;
41229
41629
  this.systemTextLibraryService = systemTextLibraryService;
41230
41630
  this.languageService = languageService;
41631
+ this.guiContext = guiContext;
41231
41632
  this.elementStatus = AlaertElementStatus.Loading;
41232
41633
  this.displayOption = {
41233
41634
  dataLimit: 500,
@@ -41255,6 +41656,8 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
41255
41656
  this.timePeriods = this.getValidTimePeriods();
41256
41657
  this.pageSize = this.model.generalSetting.pageSize;
41257
41658
  localStorage.setItem('simulate-time', moment().valueOf() + '');
41659
+ // 订阅语种变化事件
41660
+ this.subscribeLanguageChange();
41258
41661
  if (this.model.filterSetting) {
41259
41662
  this.alarmNames = this.model.filterSetting.detailsData.map(item => item.name);
41260
41663
  this.currentTimePeriod = (_a = this.model.filterSetting) === null || _a === void 0 ? void 0 : _a.displayPeriod;
@@ -41288,18 +41691,84 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
41288
41691
  if (this.element) {
41289
41692
  this.element.tooltip.hidden(true);
41290
41693
  }
41694
+ // 取消语种变化订阅
41695
+ if (this.languageChangeSubscription) {
41696
+ this.languageChangeSubscription.unsubscribe();
41697
+ this.languageChangeSubscription = undefined;
41698
+ }
41291
41699
  this.logger.debug(`[GUI]Dispose Alarm Table Refresh Interval:${d3["time"].format('%x %X')(new Date())}`);
41292
41700
  }
41701
+ /**
41702
+ * 订阅语种变化事件
41703
+ */
41704
+ subscribeLanguageChange() {
41705
+ if (this.guiContext && this.guiContext.languageChanged$) {
41706
+ this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
41707
+ // 只更新文案,不重新查询数据
41708
+ this.updateLanguageTexts();
41709
+ });
41710
+ }
41711
+ }
41712
+ /**
41713
+ * 更新语种相关的文案(表头和时间段选择器)
41714
+ */
41715
+ updateLanguageTexts() {
41716
+ var _a;
41717
+ // 更新表头文本
41718
+ const headerCells = this.$element.find('table th');
41719
+ for (let col = 0; col < 4 && col < headerCells.length; col++) {
41720
+ headerCells.eq(col).text(this.getHeaderTextByColumn(col));
41721
+ }
41722
+ // 更新时间段选择器选项
41723
+ if ((_a = this.model.filterSetting) === null || _a === void 0 ? void 0 : _a.alarmType) {
41724
+ const selectElement = this.rootElement.select('select');
41725
+ if (!selectElement.empty()) {
41726
+ // 重新生成时间段数据
41727
+ const updatedTimePeriods = this.getValidTimePeriods();
41728
+ // 更新选项文本
41729
+ const options = selectElement.selectAll('option');
41730
+ options.each(function (_d, i) {
41731
+ if (i < updatedTimePeriods.length) {
41732
+ d3["select"](this).text(updatedTimePeriods[i].name);
41733
+ }
41734
+ });
41735
+ }
41736
+ }
41737
+ }
41738
+ /**
41739
+ * 获取当前语种的 culture 代码
41740
+ */
41741
+ getCurrentCulture() {
41742
+ var _a, _b, _c, _e, _f, _g;
41743
+ // 获取当前语种ID
41744
+ const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
41745
+ // 确定要使用的语种代码(culture)
41746
+ const defaultLanguage = ((_e = this.languageService) === null || _e === void 0 ? void 0 : _e.getDefaultLanguage()) || 'zh-CN';
41747
+ if (currentLanguageId === null || currentLanguageId === undefined) {
41748
+ // 设备未设置当前语种,使用默认语种
41749
+ return defaultLanguage;
41750
+ }
41751
+ else {
41752
+ // 设备已设置当前语种,获取对应的语种代码
41753
+ const currentLanguage = (_g = (_f = this.guiContext) === null || _f === void 0 ? void 0 : _f.getLanguageCultureById) === null || _g === void 0 ? void 0 : _g.call(_f, currentLanguageId);
41754
+ if (currentLanguage) {
41755
+ return currentLanguage;
41756
+ }
41757
+ else {
41758
+ // 无法获取语种代码,使用默认语种
41759
+ return defaultLanguage;
41760
+ }
41761
+ }
41762
+ }
41293
41763
  /**
41294
41764
  * 根据列索引获取表头翻译(从系统文本库获取多语种翻译)
41295
41765
  * 固定4项表头,按列索引顺序:告警名称、告警内容、告警等级、时间
41296
41766
  */
41297
41767
  getHeaderTextByColumn(columnIndex) {
41298
- var _a;
41299
41768
  if (columnIndex < 0 || columnIndex > 3) {
41300
41769
  return '';
41301
41770
  }
41302
- const currentCulture = ((_a = this.languageService) === null || _a === void 0 ? void 0 : _a.getDefaultLanguage()) || 'zh-CN';
41771
+ const currentCulture = this.getCurrentCulture();
41303
41772
  const systemType = service["SYSTEM_TEXT_LIBRARY_TYPES"].COMPONENT_BUILTIN;
41304
41773
  const headerKeys = [
41305
41774
  service["ALARM_TABLE_HEADER_KEYS"].ALARM_NAME,
@@ -41328,11 +41797,10 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
41328
41797
  return timePeriods;
41329
41798
  }
41330
41799
  /**
41331
- * 获取时间段文案(从系统文本库获取多语种翻译,fallback 使用 localization)
41800
+ * 获取时间段文案(从系统文本库获取多语种翻译)
41332
41801
  */
41333
41802
  getTimePeriodText(textKey) {
41334
- var _a;
41335
- const currentCulture = ((_a = this.languageService) === null || _a === void 0 ? void 0 : _a.getDefaultLanguage()) || 'zh-CN';
41803
+ const currentCulture = this.getCurrentCulture();
41336
41804
  const systemType = service["SYSTEM_TEXT_LIBRARY_TYPES"].COMPONENT_BUILTIN;
41337
41805
  if (this.systemTextLibraryService) {
41338
41806
  const translation = this.systemTextLibraryService.getSystemTextValue(systemType, textKey, currentCulture);
@@ -42222,7 +42690,7 @@ class main_element_MainElement {
42222
42690
  const category = $(element).data('model').category;
42223
42691
  switch (category) {
42224
42692
  case shared["d" /* GuiConsts */].components.numericalDisplayKey:
42225
- const numericalDisplayElement = new numerical_display_element_NumericalDisplayElement(element, this.injector, this.bsModalService, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.graphStore, this.context.operationRecordService, this.context.releasedVariableService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(_tmp_localization["b" /* LOCALIZATION */]), this.signalRAppId);
42693
+ const numericalDisplayElement = new numerical_display_element_NumericalDisplayElement(element, this.injector, this.bsModalService, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.graphStore, this.context.operationRecordService, this.context.releasedVariableService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(_tmp_localization["b" /* LOCALIZATION */]), this.signalRAppId, this.context);
42226
42694
  this.elements.push(numericalDisplayElement);
42227
42695
  break;
42228
42696
  case shared["d" /* GuiConsts */].components.imageKey:
@@ -42235,23 +42703,23 @@ class main_element_MainElement {
42235
42703
  this.elements.push(new pipe_element_PipeElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(_tmp_localization["b" /* LOCALIZATION */]), this.signalRAppId));
42236
42704
  break;
42237
42705
  case shared["d" /* GuiConsts */].components.switchIndicatorLightKey:
42238
- this.elements.push(new switch_indicator_light_element_SwitchIndicatorLightElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(_tmp_localization["b" /* LOCALIZATION */]), this.signalRAppId, this.context.textLibraryService, this.context.languageService));
42706
+ this.elements.push(new switch_indicator_light_element_SwitchIndicatorLightElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(_tmp_localization["b" /* LOCALIZATION */]), this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
42239
42707
  break;
42240
42708
  case shared["d" /* GuiConsts */].components.barGraphKey:
42241
42709
  this.elements.push(new bar_graph_element_BarGraphElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(_tmp_localization["b" /* LOCALIZATION */]), this.signalRAppId));
42242
42710
  break;
42243
42711
  case shared["d" /* GuiConsts */].components.toggleViewKey:
42244
42712
  case shared["d" /* GuiConsts */].components.viewOperationElement:
42245
- this.elements.push(new view_operation_element_ViewOperationElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.injector.get(_tmp_localization["b" /* LOCALIZATION */]), this.popupViewService, guiOptions.hostContainerId, guiOptions.el, this.signalRAppId));
42713
+ this.elements.push(new view_operation_element_ViewOperationElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.injector.get(_tmp_localization["b" /* LOCALIZATION */]), this.popupViewService, guiOptions.hostContainerId, guiOptions.el, this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
42246
42714
  break;
42247
42715
  case shared["d" /* GuiConsts */].components.characterKey:
42248
42716
  this.elements.push(new character_display_element_CharacterDisplayElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(_tmp_localization["b" /* LOCALIZATION */]), this.signalRAppId));
42249
42717
  break;
42250
42718
  case shared["d" /* GuiConsts */].components.textKey:
42251
- this.elements.push(new text_element_TextElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId, this.context.textLibraryService, this.context.languageService));
42719
+ this.elements.push(new text_element_TextElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
42252
42720
  break;
42253
42721
  case shared["d" /* GuiConsts */].components.hyperlinkKey:
42254
- this.elements.push(new hyperlink_element_HyperlinkElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId, this.context.textLibraryService, this.context.languageService));
42722
+ this.elements.push(new hyperlink_element_HyperlinkElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
42255
42723
  break;
42256
42724
  case shared["d" /* GuiConsts */].components.straightLineKey:
42257
42725
  this.elements.push(new straight_line_element_StraightLineElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.signalRAppId));
@@ -42272,7 +42740,7 @@ class main_element_MainElement {
42272
42740
  this.elements.push(new datetime_display_element_DatetimeDisplayElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId));
42273
42741
  break;
42274
42742
  case shared["d" /* GuiConsts */].components.historicalCurveKey:
42275
- this.elements.push(new historical_curve_element_HistoricalCurveElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.historyDataStore, this.signalRAppId, this.context.systemTextLibraryService, this.context.languageService));
42743
+ this.elements.push(new historical_curve_element_HistoricalCurveElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.historyDataStore, this.signalRAppId, this.context.systemTextLibraryService, this.context.languageService, this.context));
42276
42744
  break;
42277
42745
  case shared["d" /* GuiConsts */].components.ringGraphKey:
42278
42746
  this.elements.push(new ring_graph_element_RingGraphElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(_tmp_localization["b" /* LOCALIZATION */]), this.signalRAppId));
@@ -42293,7 +42761,7 @@ class main_element_MainElement {
42293
42761
  this.elements.push(new air_quality_element_AirQualityElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.weatherService, this.signalRAppId));
42294
42762
  break;
42295
42763
  case shared["d" /* GuiConsts */].components.alarmKey:
42296
- this.elements.push(new alarm_element_AlarmElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.alarmsStore, this.signalRAppId, this.context.systemTextLibraryService, this.context.languageService));
42764
+ this.elements.push(new alarm_element_AlarmElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.alarmsStore, this.signalRAppId, this.context.systemTextLibraryService, this.context.languageService, this.context));
42297
42765
  break;
42298
42766
  case shared["d" /* GuiConsts */].components.scrollAlarmKey:
42299
42767
  this.elements.push(new scroll_alarm_element_ScrollAlarmElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.alarmsStore, this.signalRAppId));
@@ -42654,7 +43122,23 @@ class gui_view_GuiView {
42654
43122
  this.openVariableStatesSubscription.unsubscribe();
42655
43123
  }
42656
43124
  this.openedVariableNames = this.mainElement.getVariableNames();
42657
- if (this.openedVariableNames.indexOf('设备状态') !== -1) {
43125
+ // 分离系统变量和普通变量
43126
+ const systemVariables = [];
43127
+ const normalVariablesForState = [];
43128
+ this.openedVariableNames.forEach(variableName => {
43129
+ if (variableName === '当前语种ID') {
43130
+ // 系统变量直接订阅,不需要等待状态
43131
+ systemVariables.push(variableName);
43132
+ }
43133
+ else {
43134
+ normalVariablesForState.push(variableName);
43135
+ }
43136
+ });
43137
+ // 立即订阅系统变量
43138
+ if (systemVariables.length > 0) {
43139
+ this.normalOpenedVariableNames(systemVariables);
43140
+ }
43141
+ if (normalVariablesForState.indexOf('设备状态') !== -1) {
42658
43142
  if (this.requestVirtualDeviceState) {
42659
43143
  this.requestVirtualDeviceState.unsubscribe();
42660
43144
  }
@@ -42666,13 +43150,13 @@ class gui_view_GuiView {
42666
43150
  this.perViewVariableCommunicator.requestVirtualDeviceState().subscribe({
42667
43151
  complete: () => { }
42668
43152
  });
42669
- this.openedVariableNames = this.openedVariableNames.filter(name => name !== '设备状态');
43153
+ normalVariablesForState.splice(normalVariablesForState.indexOf('设备状态'), 1);
42670
43154
  }
42671
- if (this.openedVariableNames.length === 0) {
43155
+ if (normalVariablesForState.length === 0) {
42672
43156
  return;
42673
43157
  }
42674
43158
  this.openVariableStatesSubscription =
42675
- this.perViewVariableCommunicator.subscribeVariableStates(this.openedVariableNames).subscribe((states) => {
43159
+ this.perViewVariableCommunicator.subscribeVariableStates(normalVariablesForState).subscribe((states) => {
42676
43160
  this.mainElement.reportVariableStates(states);
42677
43161
  const normalVariableNames = [];
42678
43162
  Object(lodash["each"])(states, v => {
@@ -43435,6 +43919,11 @@ let WriteValueModalComponent = class WriteValueModalComponent {
43435
43919
  value = this.formatWriteValue();
43436
43920
  }
43437
43921
  }
43922
+ // 处理系统变量"当前语种ID"
43923
+ if (this.variableName === '当前语种ID') {
43924
+ this.handleCurrentLanguageIdSave(value);
43925
+ return;
43926
+ }
43438
43927
  if (!this.args.releasedVariableService) {
43439
43928
  this.onClosed({
43440
43929
  value: value,
@@ -43459,6 +43948,26 @@ let WriteValueModalComponent = class WriteValueModalComponent {
43459
43948
  });
43460
43949
  });
43461
43950
  }
43951
+ /**
43952
+ * 处理"当前语种ID"系统变量的保存
43953
+ */
43954
+ handleCurrentLanguageIdSave(value) {
43955
+ if (!this.args.guiContext || !this.args.guiContext.updateCurrentLanguageId) {
43956
+ this.showValidationErrorInfo(this.localization.loadFailed);
43957
+ this.isSubmitting = false;
43958
+ return;
43959
+ }
43960
+ // 转换为数字类型
43961
+ const languageId = value === '' || value == null ? null : Number(value);
43962
+ // 调用 GuiContext 的更新方法
43963
+ this.args.guiContext.updateCurrentLanguageId(languageId).then(() => {
43964
+ // 更新成功,关闭弹窗
43965
+ this.bsModalRef.hide();
43966
+ }).catch(() => {
43967
+ this.showValidationErrorInfo(this.localization.loadFailed);
43968
+ this.isSubmitting = false;
43969
+ });
43970
+ }
43462
43971
  close() {
43463
43972
  this.bsModalRef.hide();
43464
43973
  }
@@ -43651,7 +44160,7 @@ nv.dom = {}; //DOM manipulation functions
43651
44160
 
43652
44161
  // Node/CommonJS - require D3
43653
44162
  if (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined' && typeof(d3) == 'undefined') {
43654
- d3 = __webpack_require__(22);
44163
+ d3 = __webpack_require__(18);
43655
44164
  }
43656
44165
 
43657
44166
  nv.dispatch = d3.dispatch('render_start', 'render_end');
@@ -65030,6 +65539,8 @@ class remote_variable_communicator_RemoteVariableCommunicator {
65030
65539
  this.variableStateObservers = new Map();
65031
65540
  this.variableStateCache = new Map();
65032
65541
  this.alarmObservers = [];
65542
+ // 系统变量处理器
65543
+ this.systemVariableHandlers = new Map();
65033
65544
  this.variableValueCache = new core["a" /* StringifyingMap */](k => JSON.stringify(k));
65034
65545
  this.connectedSubscription = this.remoteVariableProtocol.connected.subscribe(() => {
65035
65546
  const variableNamesToStart = [];
@@ -65194,7 +65705,33 @@ class remote_variable_communicator_RemoteVariableCommunicator {
65194
65705
  }
65195
65706
  }
65196
65707
  });
65197
- variablesToStart = Object(lodash["uniq"])(variablesToStart);
65708
+ // 过滤掉系统变量,它们不需要通过SignalR订阅
65709
+ const normalVariables = variablesToStart.filter(v => !this.systemVariableHandlers.has(v));
65710
+ const systemVariables = variablesToStart.filter(v => this.systemVariableHandlers.has(v));
65711
+ // 处理系统变量的初始值
65712
+ systemVariables.forEach(variableName => {
65713
+ const handler = this.systemVariableHandlers.get(variableName);
65714
+ if (handler && handler.getValue) {
65715
+ void handler.getValue().then(value => {
65716
+ const variableValue = {
65717
+ variableName: variableName,
65718
+ value: value,
65719
+ state: 1 // Normal state
65720
+ };
65721
+ this.variableValueCache.set(variableName, variableValue);
65722
+ if (this.observers.has(variableName)) {
65723
+ Object(lodash["each"])(this.observers.get(variableName), ob => {
65724
+ ob.next([variableValue]);
65725
+ });
65726
+ }
65727
+ }).catch(error => {
65728
+ if (this.logger) {
65729
+ this.logger.error(`[RemoteVariableCommunicator] Failed to get system variable "${variableName}" value:`, error);
65730
+ }
65731
+ });
65732
+ }
65733
+ });
65734
+ variablesToStart = Object(lodash["uniq"])(normalVariables);
65198
65735
  if (variablesToStart && variablesToStart.length > 0) {
65199
65736
  if (!this.variablesToBeOpened) {
65200
65737
  this.variablesToBeOpened = [];
@@ -65239,8 +65776,24 @@ class remote_variable_communicator_RemoteVariableCommunicator {
65239
65776
  }
65240
65777
  write(variableName, value) {
65241
65778
  if (!variableName) {
65242
- return;
65779
+ return new Observable["a" /* Observable */](observer => {
65780
+ observer.complete();
65781
+ });
65782
+ }
65783
+ // 检查是否为系统变量
65784
+ if (this.systemVariableHandlers.has(variableName)) {
65785
+ const handler = this.systemVariableHandlers.get(variableName);
65786
+ // 调用系统变量的setValue处理器
65787
+ void handler.setValue(value).catch(error => {
65788
+ if (this.logger) {
65789
+ this.logger.error('[RemoteVariableCommunicator] Failed to set system variable value:', error);
65790
+ }
65791
+ });
65792
+ return new Observable["a" /* Observable */](__ => {
65793
+ /* 系统变量通过自己的机制通知变化 */
65794
+ });
65243
65795
  }
65796
+ // 普通变量通过SignalR写入
65244
65797
  this.remoteVariableProtocol.writeVariable(variableName, value);
65245
65798
  return new Observable["a" /* Observable */](__ => {
65246
65799
  /* do nothing right now, if want value change immediately, can use this code below:
@@ -65266,6 +65819,36 @@ class remote_variable_communicator_RemoteVariableCommunicator {
65266
65819
  };
65267
65820
  });
65268
65821
  }
65822
+ /**
65823
+ * 注册系统变量处理器
65824
+ * @param variableName 变量名(如"当前语种ID")
65825
+ * @param getValue 获取值的函数
65826
+ * @param setValue 设置值的函数
65827
+ */
65828
+ registerSystemVariableHandler(variableName, getValue, setValue) {
65829
+ this.systemVariableHandlers.set(variableName, { getValue, setValue });
65830
+ }
65831
+ /**
65832
+ * 通知系统变量值变化
65833
+ * 用于在系统变量值改变时通知所有订阅者
65834
+ * @param variableName 变量名
65835
+ * @param value 新值
65836
+ */
65837
+ notifySystemVariableChange(variableName, value) {
65838
+ const variableValue = {
65839
+ variableName: variableName,
65840
+ value: value,
65841
+ state: 1 // Normal state
65842
+ };
65843
+ // 更新缓存
65844
+ this.variableValueCache.set(variableName, variableValue);
65845
+ // 通知所有订阅者
65846
+ if (this.observers.has(variableName)) {
65847
+ Object(lodash["each"])(this.observers.get(variableName), ob => {
65848
+ ob.next([variableValue]);
65849
+ });
65850
+ }
65851
+ }
65269
65852
  dispose() {
65270
65853
  // TODO调用所有的ob.complete()。
65271
65854
  this.connectedSubscription.unsubscribe();
@@ -72872,13 +73455,13 @@ var ngx_bootstrap_tooltip_TooltipModule = /** @class */ (function () {
72872
73455
  var gui_component = __webpack_require__(36);
72873
73456
 
72874
73457
  // EXTERNAL MODULE: ./.tmp/localization/localization.service.ts
72875
- var localization_service = __webpack_require__(18);
73458
+ var localization_service = __webpack_require__(19);
72876
73459
 
72877
73460
  // EXTERNAL MODULE: ./.tmp/modal/alert/alert-modal.component.ts
72878
- var alert_modal_component = __webpack_require__(21);
73461
+ var alert_modal_component = __webpack_require__(22);
72879
73462
 
72880
73463
  // EXTERNAL MODULE: ./.tmp/modal/confirm-operation/confirm-operation-modal.component.ts
72881
- var confirm_operation_modal_component = __webpack_require__(20);
73464
+ var confirm_operation_modal_component = __webpack_require__(21);
72882
73465
 
72883
73466
  // EXTERNAL MODULE: ./.tmp/modal/write-character/write-character-modal.component.ts
72884
73467
  var write_character_modal_component = __webpack_require__(38);
@@ -72969,7 +73552,7 @@ var view_service = __webpack_require__(27);
72969
73552
  var logger = __webpack_require__(7);
72970
73553
 
72971
73554
  // EXTERNAL MODULE: ./.tmp/modal/verify-password/verify-password-modal.component.ts
72972
- var verify_password_modal_component = __webpack_require__(19);
73555
+ var verify_password_modal_component = __webpack_require__(20);
72973
73556
 
72974
73557
  // EXTERNAL MODULE: ./.tmp/utils/data-type/fbox-data-type.service.ts
72975
73558
  var fbox_data_type_service = __webpack_require__(48);