@flexem/fc-gui 3.0.0-alpha.124 → 3.0.0-alpha.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/@flexem/fc-gui.umd.js +898 -316
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +4 -4
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/communication/variable/variable-communicator.d.ts +2 -0
- package/elements/alarm/alarm-element.d.ts +17 -2
- package/elements/alarm/alarm-element.js +74 -6
- package/elements/alarm/alarm-element.metadata.json +1 -1
- package/elements/base/readable-element.js +14 -5
- package/elements/base/state-control-element.js +2 -2
- package/elements/historical-curve/historical-curve.element.d.ts +17 -2
- package/elements/historical-curve/historical-curve.element.js +64 -4
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/elements/main-element.js +7 -7
- package/elements/numerical-display/numerical-display-element.d.ts +9 -2
- package/elements/numerical-display/numerical-display-element.js +22 -2
- package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
- package/elements/shared/text/text-element.d.ts +9 -0
- package/elements/shared/text/text-element.js +20 -0
- package/elements/shared/text/text-element.metadata.json +1 -1
- package/elements/shared/text/text-state-element.d.ts +15 -2
- package/elements/shared/text/text-state-element.js +69 -10
- package/elements/shared/text/text-state-element.metadata.json +1 -1
- package/elements/static-elements/hyperlink-element.d.ts +15 -1
- package/elements/static-elements/hyperlink-element.js +69 -10
- package/elements/static-elements/hyperlink-element.metadata.json +1 -1
- package/elements/static-elements/text-element.d.ts +14 -1
- package/elements/static-elements/text-element.js +64 -10
- package/elements/static-elements/text-element.metadata.json +1 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.d.ts +7 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.js +25 -2
- package/elements/switch-indicator-light/switch-indicator-light-element.metadata.json +1 -1
- package/elements/view-operation/view-operation.element.d.ts +23 -2
- package/elements/view-operation/view-operation.element.js +95 -1
- package/elements/view-operation/view-operation.element.metadata.json +1 -1
- package/gui/gui-context.d.ts +7 -1
- package/gui/gui-view.js +20 -4
- package/modal/write-value/write-value-modal-args.d.ts +3 -1
- package/modal/write-value/write-value-modal-args.js +2 -1
- package/modal/write-value/write-value-modal-args.metadata.json +1 -1
- package/modal/write-value/write-value-modal.component.d.ts +4 -0
- package/modal/write-value/write-value-modal.component.js +25 -0
- package/modal/write-value/write-value-modal.component.metadata.json +1 -1
- package/model/view-operation/view-operation-element.model.d.ts +7 -1
- package/package.json +1 -1
- package/remote/communication/variable/remote-variable-communicator.d.ts +15 -0
- package/remote/communication/variable/remote-variable-communicator.js +76 -2
- 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__(
|
|
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\">×</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\">×</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
|
-
|
|
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__(
|
|
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__(
|
|
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__(
|
|
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__(
|
|
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
|
-
*
|
|
37238
|
+
* 获取时间段文案(从系统文本库获取多语种翻译)
|
|
37149
37239
|
*/
|
|
37150
37240
|
getTimePeriodText(textKey) {
|
|
37151
|
-
|
|
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
|
-
|
|
39021
|
-
this.$element.append(
|
|
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
|
-
|
|
39057
|
-
|
|
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,50 @@ 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
|
-
|
|
39222
|
-
|
|
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
|
+
targetLanguage = defaultLanguage;
|
|
39438
|
+
}
|
|
39439
|
+
}
|
|
39440
|
+
// 返回对应语种的文本,如果没有则返回空字符串
|
|
39441
|
+
if (textEntry.cultures && textEntry.cultures[targetLanguage]) {
|
|
39442
|
+
const text = textEntry.cultures[targetLanguage];
|
|
39443
|
+
return text;
|
|
39444
|
+
}
|
|
39445
|
+
else {
|
|
39446
|
+
// 对应语种没有文本,返回空字符串
|
|
39447
|
+
return '';
|
|
39223
39448
|
}
|
|
39224
|
-
// 如果没有对应语种,返回key作为默认值
|
|
39225
|
-
return '';
|
|
39226
39449
|
}
|
|
39227
39450
|
}
|
|
39228
39451
|
}
|
|
@@ -39600,7 +39823,7 @@ class word_switch_operator_WordSwitchOperator {
|
|
|
39600
39823
|
|
|
39601
39824
|
|
|
39602
39825
|
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) {
|
|
39826
|
+
constructor(element, injector, modalService, variableCommunicator, graphStore, permissionChecker, operationRecordService, securityChecker, variableStore, localization, signalRAppId, textLibraryService, languageService, guiContext) {
|
|
39604
39827
|
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
39605
39828
|
this.modalService = modalService;
|
|
39606
39829
|
this.graphStore = graphStore;
|
|
@@ -39608,6 +39831,7 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
|
|
|
39608
39831
|
this.securityChecker = securityChecker;
|
|
39609
39832
|
this.textLibraryService = textLibraryService;
|
|
39610
39833
|
this.languageService = languageService;
|
|
39834
|
+
this.guiContext = guiContext;
|
|
39611
39835
|
this.isBitRestoration = false; // 是否是 位设定且执行设置是复位
|
|
39612
39836
|
this.isVerifiedForRestoration = false; // 位设定且执行设置是复位情况下,是否已经完成了验证
|
|
39613
39837
|
this.isWriteRestorationDownValue = false;
|
|
@@ -39823,9 +40047,31 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
|
|
|
39823
40047
|
this.graphStateElement = new graph_state_element_GraphStateElement(this.model.graphSetting, width, height, this.graphStore, this.logger, this.model.version, this.model.states);
|
|
39824
40048
|
this.$element.append(this.graphStateElement.Element);
|
|
39825
40049
|
}
|
|
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);
|
|
40050
|
+
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
40051
|
this.$element.append(this.textStateElement.Element);
|
|
39828
40052
|
}
|
|
40053
|
+
/**
|
|
40054
|
+
* 释放资源
|
|
40055
|
+
*/
|
|
40056
|
+
dispose() {
|
|
40057
|
+
// 释放文本元素资源(取消语种变化订阅等)
|
|
40058
|
+
if (this.textStateElement) {
|
|
40059
|
+
this.textStateElement.dispose();
|
|
40060
|
+
}
|
|
40061
|
+
// 释放指示灯操作器资源
|
|
40062
|
+
if (this.indicatorLightOperator) {
|
|
40063
|
+
// indicatorLightOperator 可能有自己的dispose方法
|
|
40064
|
+
}
|
|
40065
|
+
// 清除定时器
|
|
40066
|
+
if (this.restorationTimer) {
|
|
40067
|
+
clearTimeout(this.restorationTimer);
|
|
40068
|
+
this.restorationTimer = undefined;
|
|
40069
|
+
}
|
|
40070
|
+
// 移除事件监听
|
|
40071
|
+
if (this.onDocMouseUp) {
|
|
40072
|
+
document.removeEventListener(this.isMobileMode ? 'touchend' : 'mouseup', this.onDocMouseUp);
|
|
40073
|
+
}
|
|
40074
|
+
}
|
|
39829
40075
|
checkState() {
|
|
39830
40076
|
if (!this.model.states) {
|
|
39831
40077
|
throw new Error('The switch indicator light\'s states is undefined.');
|
|
@@ -40205,7 +40451,7 @@ var view_service = __webpack_require__(27);
|
|
|
40205
40451
|
|
|
40206
40452
|
|
|
40207
40453
|
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) {
|
|
40454
|
+
constructor(element, injector, modalService, variableCommunicator, variableStore, graphStore, permissionChecker, operationRecordService, securityChecker, localization, popupViewService, hostContainerId, el, signalRAppId, textLibraryService, languageService, guiContext) {
|
|
40209
40455
|
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
40210
40456
|
this.modalService = modalService;
|
|
40211
40457
|
this.graphStore = graphStore;
|
|
@@ -40214,20 +40460,27 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
|
|
|
40214
40460
|
this.popupViewService = popupViewService;
|
|
40215
40461
|
this.hostContainerId = hostContainerId;
|
|
40216
40462
|
this.el = el;
|
|
40463
|
+
this.textLibraryService = textLibraryService;
|
|
40464
|
+
this.languageService = languageService;
|
|
40465
|
+
this.guiContext = guiContext;
|
|
40217
40466
|
this.touchedScreenX = 0;
|
|
40218
40467
|
this.touchedScreenY = 0;
|
|
40219
40468
|
this.logger = injector.get(logger["b" /* LOGGER_SERVICE_TOKEN */]);
|
|
40220
40469
|
this.viewService = injector.get(view_service["a" /* ViewService */]);
|
|
40221
40470
|
this.initElement();
|
|
40471
|
+
this.subscribeLanguageChange();
|
|
40222
40472
|
}
|
|
40223
40473
|
initElement() {
|
|
40224
40474
|
const width = this.model.size.width;
|
|
40225
40475
|
const height = this.model.size.height;
|
|
40226
40476
|
this.initGraph(width, height);
|
|
40227
40477
|
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', width).attr('height', height).attr('fill', 'transparent');
|
|
40478
|
+
// 初始化文本显示
|
|
40228
40479
|
const $dateTimeText = this.$element.find('text').last();
|
|
40229
40480
|
const fontStyle = this.model.label.font.fontStyle;
|
|
40230
40481
|
$dateTimeText.css('font', fontStyle + ',msyh');
|
|
40482
|
+
// 设置初始文本内容(支持文本库)
|
|
40483
|
+
this.updateTextContent($dateTimeText);
|
|
40231
40484
|
this.switchToState(0);
|
|
40232
40485
|
this.rootElement.on('mousedown', () => {
|
|
40233
40486
|
if (!this.isInitialized) {
|
|
@@ -40395,6 +40648,93 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
|
|
|
40395
40648
|
this.operationRecordService.record({ operationDescription: this.model.operationDescription });
|
|
40396
40649
|
}
|
|
40397
40650
|
}
|
|
40651
|
+
/**
|
|
40652
|
+
* 订阅语种变化事件
|
|
40653
|
+
*/
|
|
40654
|
+
subscribeLanguageChange() {
|
|
40655
|
+
// 只有使用文本库时才需要订阅语种变化
|
|
40656
|
+
if (!this.model.textLibrary || this.model.textLibrary.labelType !== 'textLibrary') {
|
|
40657
|
+
return;
|
|
40658
|
+
}
|
|
40659
|
+
if (this.guiContext && this.guiContext.languageChanged$) {
|
|
40660
|
+
this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
|
|
40661
|
+
// 更新文本内容
|
|
40662
|
+
const $dateTimeText = this.$element.find('text').last();
|
|
40663
|
+
this.updateTextContent($dateTimeText);
|
|
40664
|
+
});
|
|
40665
|
+
}
|
|
40666
|
+
}
|
|
40667
|
+
/**
|
|
40668
|
+
* 更新文本内容(支持文本库和语种切换)
|
|
40669
|
+
*/
|
|
40670
|
+
updateTextContent($textElement) {
|
|
40671
|
+
const displayText = this.getDisplayText();
|
|
40672
|
+
$textElement.text(displayText);
|
|
40673
|
+
}
|
|
40674
|
+
/**
|
|
40675
|
+
* 获取显示文本
|
|
40676
|
+
*/
|
|
40677
|
+
getDisplayText() {
|
|
40678
|
+
var _a, _b, _c, _d, _e, _f;
|
|
40679
|
+
// 检查是否使用文本库
|
|
40680
|
+
if (this.model.textLibrary && this.model.textLibrary.labelType === 'textLibrary') {
|
|
40681
|
+
const textLibraryId = this.model.textLibrary.selectedTextLibraryItem;
|
|
40682
|
+
const textItem = this.model.textLibrary.selectedTextItem;
|
|
40683
|
+
if (textLibraryId && textItem && this.textLibraryService) {
|
|
40684
|
+
// 获取文本库数据
|
|
40685
|
+
const textLibraryData = this.textLibraryService.getTextLibraryById(typeof textLibraryId === 'string' ? parseInt(textLibraryId, 10) : textLibraryId);
|
|
40686
|
+
if (textLibraryData && textLibraryData.data) {
|
|
40687
|
+
// 查找对应的文本条目
|
|
40688
|
+
const textEntry = textLibraryData.data.find(entry => entry.key === textItem.toString());
|
|
40689
|
+
if (textEntry) {
|
|
40690
|
+
// 获取当前语种ID
|
|
40691
|
+
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;
|
|
40692
|
+
// 确定要使用的语种代码(culture)
|
|
40693
|
+
let targetLanguage;
|
|
40694
|
+
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
40695
|
+
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
40696
|
+
// 设备未设置当前语种,使用默认语种
|
|
40697
|
+
targetLanguage = defaultLanguage;
|
|
40698
|
+
}
|
|
40699
|
+
else {
|
|
40700
|
+
// 设备已设置当前语种,获取对应的语种代码
|
|
40701
|
+
const currentLanguage = (_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId);
|
|
40702
|
+
if (currentLanguage) {
|
|
40703
|
+
targetLanguage = currentLanguage;
|
|
40704
|
+
}
|
|
40705
|
+
else {
|
|
40706
|
+
// 无法获取语种代码,使用默认语种
|
|
40707
|
+
targetLanguage = defaultLanguage;
|
|
40708
|
+
}
|
|
40709
|
+
}
|
|
40710
|
+
// 返回对应语种的文本
|
|
40711
|
+
if (textEntry.cultures && textEntry.cultures[targetLanguage]) {
|
|
40712
|
+
return textEntry.cultures[targetLanguage];
|
|
40713
|
+
}
|
|
40714
|
+
// 如果没有对应语种,返回空字符串
|
|
40715
|
+
return '';
|
|
40716
|
+
}
|
|
40717
|
+
}
|
|
40718
|
+
}
|
|
40719
|
+
// 文本库配置但未找到数据,返回空字符串
|
|
40720
|
+
return '';
|
|
40721
|
+
}
|
|
40722
|
+
// 默认返回文本内容
|
|
40723
|
+
return this.model.label.content || '';
|
|
40724
|
+
}
|
|
40725
|
+
/**
|
|
40726
|
+
* 释放资源
|
|
40727
|
+
*/
|
|
40728
|
+
dispose() {
|
|
40729
|
+
// 取消语种变化订阅
|
|
40730
|
+
if (this.languageChangeSubscription) {
|
|
40731
|
+
this.languageChangeSubscription.unsubscribe();
|
|
40732
|
+
this.languageChangeSubscription = undefined;
|
|
40733
|
+
}
|
|
40734
|
+
if (this.$element) {
|
|
40735
|
+
this.$element.remove();
|
|
40736
|
+
}
|
|
40737
|
+
}
|
|
40398
40738
|
}
|
|
40399
40739
|
|
|
40400
40740
|
// CONCATENATED MODULE: ./.tmp/elements/vector-graphics/straight-line-element.ts
|
|
@@ -40466,14 +40806,17 @@ class polygon_element_PolygonElement extends conditional_dynamic_display_element
|
|
|
40466
40806
|
|
|
40467
40807
|
|
|
40468
40808
|
class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_element_ConditionalDynamicDisplayElement {
|
|
40469
|
-
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore, signalRAppId, textLibraryService, languageService) {
|
|
40809
|
+
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore, signalRAppId, textLibraryService, languageService, guiContext) {
|
|
40470
40810
|
super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
|
|
40471
40811
|
this.graphStore = graphStore;
|
|
40472
40812
|
this.textLibraryService = textLibraryService;
|
|
40473
40813
|
this.languageService = languageService;
|
|
40814
|
+
this.guiContext = guiContext;
|
|
40474
40815
|
this.logger = injector.get(logger["b" /* LOGGER_SERVICE_TOKEN */]);
|
|
40475
40816
|
if (this.model.size) {
|
|
40476
40817
|
this.initGraphAndText();
|
|
40818
|
+
// 订阅语种变化
|
|
40819
|
+
this.subscribeLanguageChange();
|
|
40477
40820
|
}
|
|
40478
40821
|
if (this.model && this.model.linkAddress) {
|
|
40479
40822
|
this.rootElement.style('cursor', 'hand');
|
|
@@ -40487,6 +40830,44 @@ class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_ele
|
|
|
40487
40830
|
});
|
|
40488
40831
|
}
|
|
40489
40832
|
}
|
|
40833
|
+
dispose() {
|
|
40834
|
+
// 取消语种变化订阅
|
|
40835
|
+
if (this.languageChangeSubscription) {
|
|
40836
|
+
this.languageChangeSubscription.unsubscribe();
|
|
40837
|
+
this.languageChangeSubscription = undefined;
|
|
40838
|
+
}
|
|
40839
|
+
if (this.$element) {
|
|
40840
|
+
this.$element.remove();
|
|
40841
|
+
}
|
|
40842
|
+
}
|
|
40843
|
+
/**
|
|
40844
|
+
* 订阅语种变化事件
|
|
40845
|
+
* 当设备的语种ID改变时,重新渲染文本
|
|
40846
|
+
*/
|
|
40847
|
+
subscribeLanguageChange() {
|
|
40848
|
+
// 只有使用文本库时才需要订阅语种变化
|
|
40849
|
+
if (!this.model.textLibrary || this.model.textLibrary.labelType !== 'textLibrary') {
|
|
40850
|
+
return;
|
|
40851
|
+
}
|
|
40852
|
+
if (this.guiContext && this.guiContext.languageChanged$) {
|
|
40853
|
+
this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
|
|
40854
|
+
// 重新渲染文本
|
|
40855
|
+
this.reRenderText();
|
|
40856
|
+
});
|
|
40857
|
+
}
|
|
40858
|
+
}
|
|
40859
|
+
/**
|
|
40860
|
+
* 重新渲染文本
|
|
40861
|
+
*/
|
|
40862
|
+
reRenderText() {
|
|
40863
|
+
if (!this.textElementModal || !this.model.size) {
|
|
40864
|
+
return;
|
|
40865
|
+
}
|
|
40866
|
+
// 获取新的显示文本
|
|
40867
|
+
const displayText = this.getDisplayText();
|
|
40868
|
+
// 直接更新文本内容,而不是重新创建元素
|
|
40869
|
+
this.textElementModal.updateText(displayText);
|
|
40870
|
+
}
|
|
40490
40871
|
initGraphAndText() {
|
|
40491
40872
|
this.rootElement.selectAll('*').remove();
|
|
40492
40873
|
const size = this.model.size;
|
|
@@ -40509,8 +40890,8 @@ class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_ele
|
|
|
40509
40890
|
};
|
|
40510
40891
|
// 获取显示文本(支持文本库)
|
|
40511
40892
|
const displayText = this.getDisplayText();
|
|
40512
|
-
|
|
40513
|
-
this.$element.append(
|
|
40893
|
+
this.textElementModal = new text_element_TextElementModal(displayText, font, width, height);
|
|
40894
|
+
this.$element.append(this.textElementModal.Element);
|
|
40514
40895
|
}
|
|
40515
40896
|
/**
|
|
40516
40897
|
* 获取显示文本
|
|
@@ -40518,25 +40899,43 @@ class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_ele
|
|
|
40518
40899
|
* 否则返回默认文本
|
|
40519
40900
|
*/
|
|
40520
40901
|
getDisplayText() {
|
|
40521
|
-
var _a;
|
|
40902
|
+
var _a, _b, _c, _d, _e, _f;
|
|
40522
40903
|
// 检查是否使用文本库
|
|
40523
40904
|
if (this.model.textLibrary && this.model.textLibrary.labelType === 'textLibrary') {
|
|
40524
40905
|
const textLibraryId = this.model.textLibrary.selectedTextLibraryItem;
|
|
40525
40906
|
const textItem = this.model.textLibrary.selectedTextItem;
|
|
40526
40907
|
if (textLibraryId && textItem && this.textLibraryService) {
|
|
40527
|
-
// 获取当前默认语种
|
|
40528
|
-
const currentLanguage = ((_a = this.languageService) === null || _a === void 0 ? void 0 : _a.getDefaultLanguage()) || 'zh-CN';
|
|
40529
40908
|
// 获取文本库数据
|
|
40530
40909
|
const textLibraryData = this.textLibraryService.getTextLibraryById(typeof textLibraryId === 'string' ? parseInt(textLibraryId, 10) : textLibraryId);
|
|
40531
40910
|
if (textLibraryData && textLibraryData.data) {
|
|
40532
40911
|
// 查找对应的文本条目
|
|
40533
40912
|
const textEntry = textLibraryData.data.find(entry => entry.key === textItem.toString());
|
|
40534
40913
|
if (textEntry) {
|
|
40535
|
-
//
|
|
40536
|
-
|
|
40537
|
-
|
|
40914
|
+
// 获取当前语种ID
|
|
40915
|
+
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;
|
|
40916
|
+
// 确定要使用的语种代码(culture)
|
|
40917
|
+
let targetLanguage;
|
|
40918
|
+
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
40919
|
+
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
40920
|
+
// 设备未设置当前语种,使用默认语种
|
|
40921
|
+
targetLanguage = defaultLanguage;
|
|
40538
40922
|
}
|
|
40539
|
-
|
|
40923
|
+
else {
|
|
40924
|
+
// 设备已设置当前语种,获取对应的语种代码
|
|
40925
|
+
const currentLanguage = (_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId);
|
|
40926
|
+
if (currentLanguage) {
|
|
40927
|
+
targetLanguage = currentLanguage;
|
|
40928
|
+
}
|
|
40929
|
+
else {
|
|
40930
|
+
// 无法获取语种代码,使用默认语种
|
|
40931
|
+
targetLanguage = defaultLanguage;
|
|
40932
|
+
}
|
|
40933
|
+
}
|
|
40934
|
+
// 返回对应语种的文本
|
|
40935
|
+
if (textEntry.cultures && textEntry.cultures[targetLanguage]) {
|
|
40936
|
+
return textEntry.cultures[targetLanguage];
|
|
40937
|
+
}
|
|
40938
|
+
// 如果没有对应语种,返回空字符串
|
|
40540
40939
|
return '';
|
|
40541
40940
|
}
|
|
40542
40941
|
}
|
|
@@ -41222,12 +41621,13 @@ var AlaertElementStatus;
|
|
|
41222
41621
|
AlaertElementStatus[AlaertElementStatus["Loading"] = 1] = "Loading"; // 加载中
|
|
41223
41622
|
})(AlaertElementStatus || (AlaertElementStatus = {}));
|
|
41224
41623
|
class alarm_element_AlarmElement extends conditional_display_element_ConditionalDisplayElement {
|
|
41225
|
-
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, alarmsStore, signalRAppId, systemTextLibraryService, languageService) {
|
|
41624
|
+
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, alarmsStore, signalRAppId, systemTextLibraryService, languageService, guiContext) {
|
|
41226
41625
|
var _a;
|
|
41227
41626
|
super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
|
|
41228
41627
|
this.alarmsStore = alarmsStore;
|
|
41229
41628
|
this.systemTextLibraryService = systemTextLibraryService;
|
|
41230
41629
|
this.languageService = languageService;
|
|
41630
|
+
this.guiContext = guiContext;
|
|
41231
41631
|
this.elementStatus = AlaertElementStatus.Loading;
|
|
41232
41632
|
this.displayOption = {
|
|
41233
41633
|
dataLimit: 500,
|
|
@@ -41255,6 +41655,8 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
|
|
|
41255
41655
|
this.timePeriods = this.getValidTimePeriods();
|
|
41256
41656
|
this.pageSize = this.model.generalSetting.pageSize;
|
|
41257
41657
|
localStorage.setItem('simulate-time', moment().valueOf() + '');
|
|
41658
|
+
// 订阅语种变化事件
|
|
41659
|
+
this.subscribeLanguageChange();
|
|
41258
41660
|
if (this.model.filterSetting) {
|
|
41259
41661
|
this.alarmNames = this.model.filterSetting.detailsData.map(item => item.name);
|
|
41260
41662
|
this.currentTimePeriod = (_a = this.model.filterSetting) === null || _a === void 0 ? void 0 : _a.displayPeriod;
|
|
@@ -41288,18 +41690,84 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
|
|
|
41288
41690
|
if (this.element) {
|
|
41289
41691
|
this.element.tooltip.hidden(true);
|
|
41290
41692
|
}
|
|
41693
|
+
// 取消语种变化订阅
|
|
41694
|
+
if (this.languageChangeSubscription) {
|
|
41695
|
+
this.languageChangeSubscription.unsubscribe();
|
|
41696
|
+
this.languageChangeSubscription = undefined;
|
|
41697
|
+
}
|
|
41291
41698
|
this.logger.debug(`[GUI]Dispose Alarm Table Refresh Interval:${d3["time"].format('%x %X')(new Date())}`);
|
|
41292
41699
|
}
|
|
41700
|
+
/**
|
|
41701
|
+
* 订阅语种变化事件
|
|
41702
|
+
*/
|
|
41703
|
+
subscribeLanguageChange() {
|
|
41704
|
+
if (this.guiContext && this.guiContext.languageChanged$) {
|
|
41705
|
+
this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
|
|
41706
|
+
// 只更新文案,不重新查询数据
|
|
41707
|
+
this.updateLanguageTexts();
|
|
41708
|
+
});
|
|
41709
|
+
}
|
|
41710
|
+
}
|
|
41711
|
+
/**
|
|
41712
|
+
* 更新语种相关的文案(表头和时间段选择器)
|
|
41713
|
+
*/
|
|
41714
|
+
updateLanguageTexts() {
|
|
41715
|
+
var _a;
|
|
41716
|
+
// 更新表头文本
|
|
41717
|
+
const headerCells = this.$element.find('table th');
|
|
41718
|
+
for (let col = 0; col < 4 && col < headerCells.length; col++) {
|
|
41719
|
+
headerCells.eq(col).text(this.getHeaderTextByColumn(col));
|
|
41720
|
+
}
|
|
41721
|
+
// 更新时间段选择器选项
|
|
41722
|
+
if ((_a = this.model.filterSetting) === null || _a === void 0 ? void 0 : _a.alarmType) {
|
|
41723
|
+
const selectElement = this.rootElement.select('select');
|
|
41724
|
+
if (!selectElement.empty()) {
|
|
41725
|
+
// 重新生成时间段数据
|
|
41726
|
+
const updatedTimePeriods = this.getValidTimePeriods();
|
|
41727
|
+
// 更新选项文本
|
|
41728
|
+
const options = selectElement.selectAll('option');
|
|
41729
|
+
options.each(function (_d, i) {
|
|
41730
|
+
if (i < updatedTimePeriods.length) {
|
|
41731
|
+
d3["select"](this).text(updatedTimePeriods[i].name);
|
|
41732
|
+
}
|
|
41733
|
+
});
|
|
41734
|
+
}
|
|
41735
|
+
}
|
|
41736
|
+
}
|
|
41737
|
+
/**
|
|
41738
|
+
* 获取当前语种的 culture 代码
|
|
41739
|
+
*/
|
|
41740
|
+
getCurrentCulture() {
|
|
41741
|
+
var _a, _b, _c, _e, _f, _g;
|
|
41742
|
+
// 获取当前语种ID
|
|
41743
|
+
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;
|
|
41744
|
+
// 确定要使用的语种代码(culture)
|
|
41745
|
+
const defaultLanguage = ((_e = this.languageService) === null || _e === void 0 ? void 0 : _e.getDefaultLanguage()) || 'zh-CN';
|
|
41746
|
+
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
41747
|
+
// 设备未设置当前语种,使用默认语种
|
|
41748
|
+
return defaultLanguage;
|
|
41749
|
+
}
|
|
41750
|
+
else {
|
|
41751
|
+
// 设备已设置当前语种,获取对应的语种代码
|
|
41752
|
+
const currentLanguage = (_g = (_f = this.guiContext) === null || _f === void 0 ? void 0 : _f.getLanguageCultureById) === null || _g === void 0 ? void 0 : _g.call(_f, currentLanguageId);
|
|
41753
|
+
if (currentLanguage) {
|
|
41754
|
+
return currentLanguage;
|
|
41755
|
+
}
|
|
41756
|
+
else {
|
|
41757
|
+
// 无法获取语种代码,使用默认语种
|
|
41758
|
+
return defaultLanguage;
|
|
41759
|
+
}
|
|
41760
|
+
}
|
|
41761
|
+
}
|
|
41293
41762
|
/**
|
|
41294
41763
|
* 根据列索引获取表头翻译(从系统文本库获取多语种翻译)
|
|
41295
41764
|
* 固定4项表头,按列索引顺序:告警名称、告警内容、告警等级、时间
|
|
41296
41765
|
*/
|
|
41297
41766
|
getHeaderTextByColumn(columnIndex) {
|
|
41298
|
-
var _a;
|
|
41299
41767
|
if (columnIndex < 0 || columnIndex > 3) {
|
|
41300
41768
|
return '';
|
|
41301
41769
|
}
|
|
41302
|
-
const currentCulture =
|
|
41770
|
+
const currentCulture = this.getCurrentCulture();
|
|
41303
41771
|
const systemType = service["SYSTEM_TEXT_LIBRARY_TYPES"].COMPONENT_BUILTIN;
|
|
41304
41772
|
const headerKeys = [
|
|
41305
41773
|
service["ALARM_TABLE_HEADER_KEYS"].ALARM_NAME,
|
|
@@ -41328,11 +41796,10 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
|
|
|
41328
41796
|
return timePeriods;
|
|
41329
41797
|
}
|
|
41330
41798
|
/**
|
|
41331
|
-
*
|
|
41799
|
+
* 获取时间段文案(从系统文本库获取多语种翻译)
|
|
41332
41800
|
*/
|
|
41333
41801
|
getTimePeriodText(textKey) {
|
|
41334
|
-
|
|
41335
|
-
const currentCulture = ((_a = this.languageService) === null || _a === void 0 ? void 0 : _a.getDefaultLanguage()) || 'zh-CN';
|
|
41802
|
+
const currentCulture = this.getCurrentCulture();
|
|
41336
41803
|
const systemType = service["SYSTEM_TEXT_LIBRARY_TYPES"].COMPONENT_BUILTIN;
|
|
41337
41804
|
if (this.systemTextLibraryService) {
|
|
41338
41805
|
const translation = this.systemTextLibraryService.getSystemTextValue(systemType, textKey, currentCulture);
|
|
@@ -42222,7 +42689,7 @@ class main_element_MainElement {
|
|
|
42222
42689
|
const category = $(element).data('model').category;
|
|
42223
42690
|
switch (category) {
|
|
42224
42691
|
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);
|
|
42692
|
+
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
42693
|
this.elements.push(numericalDisplayElement);
|
|
42227
42694
|
break;
|
|
42228
42695
|
case shared["d" /* GuiConsts */].components.imageKey:
|
|
@@ -42235,23 +42702,23 @@ class main_element_MainElement {
|
|
|
42235
42702
|
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
42703
|
break;
|
|
42237
42704
|
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));
|
|
42705
|
+
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
42706
|
break;
|
|
42240
42707
|
case shared["d" /* GuiConsts */].components.barGraphKey:
|
|
42241
42708
|
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
42709
|
break;
|
|
42243
42710
|
case shared["d" /* GuiConsts */].components.toggleViewKey:
|
|
42244
42711
|
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));
|
|
42712
|
+
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
42713
|
break;
|
|
42247
42714
|
case shared["d" /* GuiConsts */].components.characterKey:
|
|
42248
42715
|
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
42716
|
break;
|
|
42250
42717
|
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));
|
|
42718
|
+
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
42719
|
break;
|
|
42253
42720
|
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));
|
|
42721
|
+
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
42722
|
break;
|
|
42256
42723
|
case shared["d" /* GuiConsts */].components.straightLineKey:
|
|
42257
42724
|
this.elements.push(new straight_line_element_StraightLineElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.signalRAppId));
|
|
@@ -42272,7 +42739,7 @@ class main_element_MainElement {
|
|
|
42272
42739
|
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
42740
|
break;
|
|
42274
42741
|
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));
|
|
42742
|
+
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
42743
|
break;
|
|
42277
42744
|
case shared["d" /* GuiConsts */].components.ringGraphKey:
|
|
42278
42745
|
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 +42760,7 @@ class main_element_MainElement {
|
|
|
42293
42760
|
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
42761
|
break;
|
|
42295
42762
|
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));
|
|
42763
|
+
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
42764
|
break;
|
|
42298
42765
|
case shared["d" /* GuiConsts */].components.scrollAlarmKey:
|
|
42299
42766
|
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 +43121,23 @@ class gui_view_GuiView {
|
|
|
42654
43121
|
this.openVariableStatesSubscription.unsubscribe();
|
|
42655
43122
|
}
|
|
42656
43123
|
this.openedVariableNames = this.mainElement.getVariableNames();
|
|
42657
|
-
|
|
43124
|
+
// 分离系统变量和普通变量
|
|
43125
|
+
const systemVariables = [];
|
|
43126
|
+
const normalVariablesForState = [];
|
|
43127
|
+
this.openedVariableNames.forEach(variableName => {
|
|
43128
|
+
if (variableName === '当前语种ID') {
|
|
43129
|
+
// 系统变量直接订阅,不需要等待状态
|
|
43130
|
+
systemVariables.push(variableName);
|
|
43131
|
+
}
|
|
43132
|
+
else {
|
|
43133
|
+
normalVariablesForState.push(variableName);
|
|
43134
|
+
}
|
|
43135
|
+
});
|
|
43136
|
+
// 立即订阅系统变量
|
|
43137
|
+
if (systemVariables.length > 0) {
|
|
43138
|
+
this.normalOpenedVariableNames(systemVariables);
|
|
43139
|
+
}
|
|
43140
|
+
if (normalVariablesForState.indexOf('设备状态') !== -1) {
|
|
42658
43141
|
if (this.requestVirtualDeviceState) {
|
|
42659
43142
|
this.requestVirtualDeviceState.unsubscribe();
|
|
42660
43143
|
}
|
|
@@ -42666,13 +43149,13 @@ class gui_view_GuiView {
|
|
|
42666
43149
|
this.perViewVariableCommunicator.requestVirtualDeviceState().subscribe({
|
|
42667
43150
|
complete: () => { }
|
|
42668
43151
|
});
|
|
42669
|
-
|
|
43152
|
+
normalVariablesForState.splice(normalVariablesForState.indexOf('设备状态'), 1);
|
|
42670
43153
|
}
|
|
42671
|
-
if (
|
|
43154
|
+
if (normalVariablesForState.length === 0) {
|
|
42672
43155
|
return;
|
|
42673
43156
|
}
|
|
42674
43157
|
this.openVariableStatesSubscription =
|
|
42675
|
-
this.perViewVariableCommunicator.subscribeVariableStates(
|
|
43158
|
+
this.perViewVariableCommunicator.subscribeVariableStates(normalVariablesForState).subscribe((states) => {
|
|
42676
43159
|
this.mainElement.reportVariableStates(states);
|
|
42677
43160
|
const normalVariableNames = [];
|
|
42678
43161
|
Object(lodash["each"])(states, v => {
|
|
@@ -43435,6 +43918,11 @@ let WriteValueModalComponent = class WriteValueModalComponent {
|
|
|
43435
43918
|
value = this.formatWriteValue();
|
|
43436
43919
|
}
|
|
43437
43920
|
}
|
|
43921
|
+
// 处理系统变量"当前语种ID"
|
|
43922
|
+
if (this.variableName === '当前语种ID') {
|
|
43923
|
+
this.handleCurrentLanguageIdSave(value);
|
|
43924
|
+
return;
|
|
43925
|
+
}
|
|
43438
43926
|
if (!this.args.releasedVariableService) {
|
|
43439
43927
|
this.onClosed({
|
|
43440
43928
|
value: value,
|
|
@@ -43459,6 +43947,26 @@ let WriteValueModalComponent = class WriteValueModalComponent {
|
|
|
43459
43947
|
});
|
|
43460
43948
|
});
|
|
43461
43949
|
}
|
|
43950
|
+
/**
|
|
43951
|
+
* 处理"当前语种ID"系统变量的保存
|
|
43952
|
+
*/
|
|
43953
|
+
handleCurrentLanguageIdSave(value) {
|
|
43954
|
+
if (!this.args.guiContext || !this.args.guiContext.updateCurrentLanguageId) {
|
|
43955
|
+
this.showValidationErrorInfo(this.localization.loadFailed);
|
|
43956
|
+
this.isSubmitting = false;
|
|
43957
|
+
return;
|
|
43958
|
+
}
|
|
43959
|
+
// 转换为数字类型
|
|
43960
|
+
const languageId = value === '' || value == null ? null : Number(value);
|
|
43961
|
+
// 调用 GuiContext 的更新方法
|
|
43962
|
+
this.args.guiContext.updateCurrentLanguageId(languageId).then(() => {
|
|
43963
|
+
// 更新成功,关闭弹窗
|
|
43964
|
+
this.bsModalRef.hide();
|
|
43965
|
+
}).catch(() => {
|
|
43966
|
+
this.showValidationErrorInfo(this.localization.loadFailed);
|
|
43967
|
+
this.isSubmitting = false;
|
|
43968
|
+
});
|
|
43969
|
+
}
|
|
43462
43970
|
close() {
|
|
43463
43971
|
this.bsModalRef.hide();
|
|
43464
43972
|
}
|
|
@@ -43651,7 +44159,7 @@ nv.dom = {}; //DOM manipulation functions
|
|
|
43651
44159
|
|
|
43652
44160
|
// Node/CommonJS - require D3
|
|
43653
44161
|
if (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined' && typeof(d3) == 'undefined') {
|
|
43654
|
-
d3 = __webpack_require__(
|
|
44162
|
+
d3 = __webpack_require__(18);
|
|
43655
44163
|
}
|
|
43656
44164
|
|
|
43657
44165
|
nv.dispatch = d3.dispatch('render_start', 'render_end');
|
|
@@ -65030,6 +65538,8 @@ class remote_variable_communicator_RemoteVariableCommunicator {
|
|
|
65030
65538
|
this.variableStateObservers = new Map();
|
|
65031
65539
|
this.variableStateCache = new Map();
|
|
65032
65540
|
this.alarmObservers = [];
|
|
65541
|
+
// 系统变量处理器
|
|
65542
|
+
this.systemVariableHandlers = new Map();
|
|
65033
65543
|
this.variableValueCache = new core["a" /* StringifyingMap */](k => JSON.stringify(k));
|
|
65034
65544
|
this.connectedSubscription = this.remoteVariableProtocol.connected.subscribe(() => {
|
|
65035
65545
|
const variableNamesToStart = [];
|
|
@@ -65194,7 +65704,33 @@ class remote_variable_communicator_RemoteVariableCommunicator {
|
|
|
65194
65704
|
}
|
|
65195
65705
|
}
|
|
65196
65706
|
});
|
|
65197
|
-
|
|
65707
|
+
// 过滤掉系统变量,它们不需要通过SignalR订阅
|
|
65708
|
+
const normalVariables = variablesToStart.filter(v => !this.systemVariableHandlers.has(v));
|
|
65709
|
+
const systemVariables = variablesToStart.filter(v => this.systemVariableHandlers.has(v));
|
|
65710
|
+
// 处理系统变量的初始值
|
|
65711
|
+
systemVariables.forEach(variableName => {
|
|
65712
|
+
const handler = this.systemVariableHandlers.get(variableName);
|
|
65713
|
+
if (handler && handler.getValue) {
|
|
65714
|
+
void handler.getValue().then(value => {
|
|
65715
|
+
const variableValue = {
|
|
65716
|
+
variableName: variableName,
|
|
65717
|
+
value: value,
|
|
65718
|
+
state: 1 // Normal state
|
|
65719
|
+
};
|
|
65720
|
+
this.variableValueCache.set(variableName, variableValue);
|
|
65721
|
+
if (this.observers.has(variableName)) {
|
|
65722
|
+
Object(lodash["each"])(this.observers.get(variableName), ob => {
|
|
65723
|
+
ob.next([variableValue]);
|
|
65724
|
+
});
|
|
65725
|
+
}
|
|
65726
|
+
}).catch(error => {
|
|
65727
|
+
if (this.logger) {
|
|
65728
|
+
this.logger.error(`[RemoteVariableCommunicator] Failed to get system variable "${variableName}" value:`, error);
|
|
65729
|
+
}
|
|
65730
|
+
});
|
|
65731
|
+
}
|
|
65732
|
+
});
|
|
65733
|
+
variablesToStart = Object(lodash["uniq"])(normalVariables);
|
|
65198
65734
|
if (variablesToStart && variablesToStart.length > 0) {
|
|
65199
65735
|
if (!this.variablesToBeOpened) {
|
|
65200
65736
|
this.variablesToBeOpened = [];
|
|
@@ -65239,8 +65775,24 @@ class remote_variable_communicator_RemoteVariableCommunicator {
|
|
|
65239
65775
|
}
|
|
65240
65776
|
write(variableName, value) {
|
|
65241
65777
|
if (!variableName) {
|
|
65242
|
-
return
|
|
65778
|
+
return new Observable["a" /* Observable */](observer => {
|
|
65779
|
+
observer.complete();
|
|
65780
|
+
});
|
|
65781
|
+
}
|
|
65782
|
+
// 检查是否为系统变量
|
|
65783
|
+
if (this.systemVariableHandlers.has(variableName)) {
|
|
65784
|
+
const handler = this.systemVariableHandlers.get(variableName);
|
|
65785
|
+
// 调用系统变量的setValue处理器
|
|
65786
|
+
void handler.setValue(value).catch(error => {
|
|
65787
|
+
if (this.logger) {
|
|
65788
|
+
this.logger.error('[RemoteVariableCommunicator] Failed to set system variable value:', error);
|
|
65789
|
+
}
|
|
65790
|
+
});
|
|
65791
|
+
return new Observable["a" /* Observable */](__ => {
|
|
65792
|
+
/* 系统变量通过自己的机制通知变化 */
|
|
65793
|
+
});
|
|
65243
65794
|
}
|
|
65795
|
+
// 普通变量通过SignalR写入
|
|
65244
65796
|
this.remoteVariableProtocol.writeVariable(variableName, value);
|
|
65245
65797
|
return new Observable["a" /* Observable */](__ => {
|
|
65246
65798
|
/* do nothing right now, if want value change immediately, can use this code below:
|
|
@@ -65266,6 +65818,36 @@ class remote_variable_communicator_RemoteVariableCommunicator {
|
|
|
65266
65818
|
};
|
|
65267
65819
|
});
|
|
65268
65820
|
}
|
|
65821
|
+
/**
|
|
65822
|
+
* 注册系统变量处理器
|
|
65823
|
+
* @param variableName 变量名(如"当前语种ID")
|
|
65824
|
+
* @param getValue 获取值的函数
|
|
65825
|
+
* @param setValue 设置值的函数
|
|
65826
|
+
*/
|
|
65827
|
+
registerSystemVariableHandler(variableName, getValue, setValue) {
|
|
65828
|
+
this.systemVariableHandlers.set(variableName, { getValue, setValue });
|
|
65829
|
+
}
|
|
65830
|
+
/**
|
|
65831
|
+
* 通知系统变量值变化
|
|
65832
|
+
* 用于在系统变量值改变时通知所有订阅者
|
|
65833
|
+
* @param variableName 变量名
|
|
65834
|
+
* @param value 新值
|
|
65835
|
+
*/
|
|
65836
|
+
notifySystemVariableChange(variableName, value) {
|
|
65837
|
+
const variableValue = {
|
|
65838
|
+
variableName: variableName,
|
|
65839
|
+
value: value,
|
|
65840
|
+
state: 1 // Normal state
|
|
65841
|
+
};
|
|
65842
|
+
// 更新缓存
|
|
65843
|
+
this.variableValueCache.set(variableName, variableValue);
|
|
65844
|
+
// 通知所有订阅者
|
|
65845
|
+
if (this.observers.has(variableName)) {
|
|
65846
|
+
Object(lodash["each"])(this.observers.get(variableName), ob => {
|
|
65847
|
+
ob.next([variableValue]);
|
|
65848
|
+
});
|
|
65849
|
+
}
|
|
65850
|
+
}
|
|
65269
65851
|
dispose() {
|
|
65270
65852
|
// TODO调用所有的ob.complete()。
|
|
65271
65853
|
this.connectedSubscription.unsubscribe();
|
|
@@ -72872,13 +73454,13 @@ var ngx_bootstrap_tooltip_TooltipModule = /** @class */ (function () {
|
|
|
72872
73454
|
var gui_component = __webpack_require__(36);
|
|
72873
73455
|
|
|
72874
73456
|
// EXTERNAL MODULE: ./.tmp/localization/localization.service.ts
|
|
72875
|
-
var localization_service = __webpack_require__(
|
|
73457
|
+
var localization_service = __webpack_require__(19);
|
|
72876
73458
|
|
|
72877
73459
|
// EXTERNAL MODULE: ./.tmp/modal/alert/alert-modal.component.ts
|
|
72878
|
-
var alert_modal_component = __webpack_require__(
|
|
73460
|
+
var alert_modal_component = __webpack_require__(22);
|
|
72879
73461
|
|
|
72880
73462
|
// EXTERNAL MODULE: ./.tmp/modal/confirm-operation/confirm-operation-modal.component.ts
|
|
72881
|
-
var confirm_operation_modal_component = __webpack_require__(
|
|
73463
|
+
var confirm_operation_modal_component = __webpack_require__(21);
|
|
72882
73464
|
|
|
72883
73465
|
// EXTERNAL MODULE: ./.tmp/modal/write-character/write-character-modal.component.ts
|
|
72884
73466
|
var write_character_modal_component = __webpack_require__(38);
|
|
@@ -72969,7 +73551,7 @@ var view_service = __webpack_require__(27);
|
|
|
72969
73551
|
var logger = __webpack_require__(7);
|
|
72970
73552
|
|
|
72971
73553
|
// EXTERNAL MODULE: ./.tmp/modal/verify-password/verify-password-modal.component.ts
|
|
72972
|
-
var verify_password_modal_component = __webpack_require__(
|
|
73554
|
+
var verify_password_modal_component = __webpack_require__(20);
|
|
72973
73555
|
|
|
72974
73556
|
// EXTERNAL MODULE: ./.tmp/utils/data-type/fbox-data-type.service.ts
|
|
72975
73557
|
var fbox_data_type_service = __webpack_require__(48);
|