@flexem/fc-gui 3.0.0-alpha.15 → 3.0.0-alpha.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/CHANGELOG.md +429 -1
  2. package/assets/img/black_first_page.png +0 -0
  3. package/assets/img/black_last_page.png +0 -0
  4. package/assets/img/black_next_page.png +0 -0
  5. package/assets/img/black_previous_page.png +0 -0
  6. package/bundles/@flexem/fc-gui.umd.js +24059 -19951
  7. package/bundles/@flexem/fc-gui.umd.js.map +1 -1
  8. package/bundles/@flexem/fc-gui.umd.min.js +5 -5
  9. package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
  10. package/communication/variable/variable-communicator.d.ts +4 -0
  11. package/communication/variable/variable-value.d.ts +4 -1
  12. package/communication/variable/variable-value.js +4 -1
  13. package/communication/variable/variable-value.metadata.json +1 -1
  14. package/config/alarm/alarm.store.d.ts +6 -0
  15. package/config/alarm/alarm.store.js +0 -0
  16. package/config/alarm/alarm.store.metadata.json +1 -0
  17. package/config/alarm/get-alarms-args.d.ts +12 -0
  18. package/config/alarm/get-alarms-args.js +13 -0
  19. package/config/alarm/get-alarms-args.metadata.json +1 -0
  20. package/config/alarm/index.d.ts +2 -0
  21. package/config/alarm/index.js +1 -0
  22. package/config/alarm/index.metadata.json +1 -0
  23. package/config/config-store.d.ts +2 -0
  24. package/config/index.d.ts +1 -0
  25. package/config/index.js +1 -0
  26. package/config/index.metadata.json +1 -1
  27. package/elements/air-quality/air-quality-element.d.ts +31 -0
  28. package/elements/air-quality/air-quality-element.js +194 -0
  29. package/elements/air-quality/air-quality-element.metadata.json +1 -0
  30. package/elements/alarm/alarm-element.d.ts +69 -0
  31. package/elements/alarm/alarm-element.js +497 -0
  32. package/elements/alarm/alarm-element.metadata.json +1 -0
  33. package/elements/bar-graph-element.d.ts +10 -2
  34. package/elements/bar-graph-element.js +135 -5
  35. package/elements/bar-graph-element.metadata.json +1 -1
  36. package/elements/base/readable-element.d.ts +6 -1
  37. package/elements/base/readable-element.js +65 -2
  38. package/elements/base/readable-element.metadata.json +1 -1
  39. package/elements/base/state-control-element.d.ts +3 -1
  40. package/elements/base/state-control-element.js +3 -0
  41. package/elements/datetime-display/datetime-display-element.d.ts +1 -0
  42. package/elements/datetime-display/datetime-display-element.js +10 -2
  43. package/elements/datetime-display/datetime-display-element.metadata.json +1 -1
  44. package/elements/datetime-display/time-zone-select-json.d.ts +8 -0
  45. package/elements/datetime-display/time-zone-select-json.js +558 -0
  46. package/elements/historical-curve/historical-curve.element.d.ts +33 -3
  47. package/elements/historical-curve/historical-curve.element.js +368 -26
  48. package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
  49. package/elements/main-element.d.ts +1 -0
  50. package/elements/main-element.js +59 -9
  51. package/elements/main-element.metadata.json +1 -1
  52. package/elements/meter-element.d.ts +7 -1
  53. package/elements/meter-element.js +76 -7
  54. package/elements/meter-element.metadata.json +1 -1
  55. package/elements/numerical-display/numerical-display-element.d.ts +16 -3
  56. package/elements/numerical-display/numerical-display-element.js +83 -11
  57. package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
  58. package/elements/per-view-variable-communicator.d.ts +3 -0
  59. package/elements/per-view-variable-communicator.js +15 -1
  60. package/elements/per-view-variable-communicator.metadata.json +1 -1
  61. package/elements/ring-graph/ring-graph-element.d.ts +13 -1
  62. package/elements/ring-graph/ring-graph-element.js +164 -3
  63. package/elements/ring-graph/ring-graph-element.metadata.json +1 -1
  64. package/elements/scroll-alarm/scroll-alarm-element.d.ts +74 -0
  65. package/elements/scroll-alarm/scroll-alarm-element.js +761 -0
  66. package/elements/scroll-alarm/scroll-alarm-element.metadata.json +1 -0
  67. package/elements/shared/graph/graph-state-element.d.ts +1 -0
  68. package/elements/shared/graph/graph-state-element.js +30 -4
  69. package/elements/shared/graph/graph-state-element.metadata.json +1 -1
  70. package/elements/shared/text/text-element.d.ts +9 -0
  71. package/elements/shared/text/text-element.js +34 -3
  72. package/elements/shared/text/text-element.metadata.json +1 -1
  73. package/elements/shared/text/text-state-element.d.ts +28 -2
  74. package/elements/shared/text/text-state-element.js +188 -65
  75. package/elements/shared/text/text-state-element.metadata.json +1 -1
  76. package/elements/static-elements/hyperlink-element.d.ts +24 -2
  77. package/elements/static-elements/hyperlink-element.js +124 -3
  78. package/elements/static-elements/hyperlink-element.metadata.json +1 -1
  79. package/elements/static-elements/text-element.d.ts +24 -2
  80. package/elements/static-elements/text-element.js +120 -3
  81. package/elements/static-elements/text-element.metadata.json +1 -1
  82. package/elements/switch-indicator-light/bit-indicator-light-operator.d.ts +1 -0
  83. package/elements/switch-indicator-light/bit-indicator-light-operator.js +5 -2
  84. package/elements/switch-indicator-light/bit-indicator-light-operator.metadata.json +1 -1
  85. package/elements/switch-indicator-light/switch-indicator-light-element.d.ts +11 -2
  86. package/elements/switch-indicator-light/switch-indicator-light-element.js +55 -11
  87. package/elements/switch-indicator-light/switch-indicator-light-element.metadata.json +1 -1
  88. package/elements/switch-indicator-light/word-indicator-light-operator.d.ts +1 -0
  89. package/elements/switch-indicator-light/word-indicator-light-operator.js +5 -2
  90. package/elements/switch-indicator-light/word-indicator-light-operator.metadata.json +1 -1
  91. package/elements/video/video-element.d.ts +10 -0
  92. package/elements/video/video-element.js +119 -21
  93. package/elements/video/video-element.metadata.json +1 -1
  94. package/elements/view-operation/view-operation.element.d.ts +24 -2
  95. package/elements/view-operation/view-operation.element.js +128 -4
  96. package/elements/view-operation/view-operation.element.metadata.json +1 -1
  97. package/elements/weather/weater-element.js +0 -1
  98. package/gui/gui-context.d.ts +12 -2
  99. package/gui/gui-host.d.ts +1 -1
  100. package/gui/gui-view.d.ts +4 -1
  101. package/gui/gui-view.js +51 -7
  102. package/gui/gui-view.metadata.json +1 -1
  103. package/gui/gui.component.d.ts +3 -0
  104. package/gui/gui.component.js +15 -2
  105. package/gui/gui.component.metadata.json +1 -1
  106. package/localization/localization.service.d.ts +7 -0
  107. package/localization/localization.service.js +10 -3
  108. package/localization/localization.service.metadata.json +1 -1
  109. package/localization/localization.service.zh_CN.js +8 -1
  110. package/localization/localization.service.zh_CN.metadata.json +1 -1
  111. package/modal/write-value/write-value-modal-args.d.ts +5 -1
  112. package/modal/write-value/write-value-modal-args.js +3 -1
  113. package/modal/write-value/write-value-modal-args.metadata.json +1 -1
  114. package/modal/write-value/write-value-modal.component.d.ts +13 -7
  115. package/modal/write-value/write-value-modal.component.html +10 -5
  116. package/modal/write-value/write-value-modal.component.js +87 -15
  117. package/modal/write-value/write-value-modal.component.metadata.json +1 -1
  118. package/model/air-quality/air-quality-info.d.ts +23 -0
  119. package/model/air-quality/air-quality-info.js +4 -0
  120. package/model/air-quality/air-quality-info.metadata.json +1 -0
  121. package/model/air-quality/air-quality.model.d.ts +7 -0
  122. package/model/air-quality/air-quality.model.js +0 -0
  123. package/model/air-quality/air-quality.model.metadata.json +1 -0
  124. package/model/alarm/alarm.model.d.ts +13 -0
  125. package/model/alarm/alarm.model.js +0 -0
  126. package/model/alarm/alarm.model.metadata.json +1 -0
  127. package/model/bar-graph/bar-graph.d.ts +4 -0
  128. package/model/base/font-setting-model.d.ts +12 -1
  129. package/model/base/font-setting-model.metadata.json +1 -1
  130. package/model/base/readable-model.d.ts +4 -0
  131. package/model/datetime-display/datetime-display.d.ts +1 -0
  132. package/model/historical-curve/historical-curve-axis-settings.d.ts +11 -0
  133. package/model/historical-curve/historical-curve-axis-settings.js +5 -0
  134. package/model/historical-curve/historical-curve-axis-settings.metadata.json +1 -1
  135. package/model/historical-curve/historical-curve-chanel.model.d.ts +8 -0
  136. package/model/meter/meter.d.ts +4 -0
  137. package/model/ring-graph/ring-graph.model.d.ts +8 -0
  138. package/model/scroll-alarm/scroll-alarm.model.d.ts +21 -0
  139. package/model/scroll-alarm/scroll-alarm.model.js +0 -0
  140. package/model/scroll-alarm/scroll-alarm.model.metadata.json +1 -0
  141. package/model/shared/text/text.d.ts +3 -0
  142. package/model/switch-indicator-light/switch-indicator-light.d.ts +2 -0
  143. package/model/view-operation/view-operation-element.model.d.ts +7 -1
  144. package/package.json +1 -1
  145. package/public_api.js +1 -0
  146. package/remote/communication/variable/remote-variable-communicator.d.ts +27 -0
  147. package/remote/communication/variable/remote-variable-communicator.js +148 -3
  148. package/remote/communication/variable/remote-variable-communicator.metadata.json +1 -1
  149. package/remote/communication/variable/remote-variable-protocol.d.ts +5 -0
  150. package/service/index.d.ts +4 -0
  151. package/service/index.js +1 -0
  152. package/service/index.metadata.json +1 -1
  153. package/service/language.service.d.ts +37 -0
  154. package/service/language.service.js +0 -0
  155. package/service/language.service.metadata.json +1 -0
  156. package/service/released-variable/index.d.ts +1 -0
  157. package/service/released-variable/index.js +0 -0
  158. package/service/released-variable/index.metadata.json +1 -0
  159. package/service/released-variable/released-variable.service.d.ts +4 -0
  160. package/service/released-variable/released-variable.service.js +0 -0
  161. package/service/released-variable/released-variable.service.metadata.json +1 -0
  162. package/service/system-text-library.service.d.ts +76 -0
  163. package/service/system-text-library.service.js +28 -0
  164. package/service/system-text-library.service.metadata.json +1 -0
  165. package/service/text-library.service.d.ts +49 -0
  166. package/service/text-library.service.js +0 -0
  167. package/service/text-library.service.metadata.json +1 -0
  168. package/service/weather.service.d.ts +1 -0
  169. package/shared/gui-consts.d.ts +3 -0
  170. package/shared/gui-consts.js +3 -0
  171. package/shared/gui-consts.metadata.json +1 -1
  172. package/utils/data-type/fbox-data-type.service.js +40 -0
package/gui/gui-view.js CHANGED
@@ -16,6 +16,8 @@ export class GuiView {
16
16
  this.context = context;
17
17
  this.parentView = parentView;
18
18
  this.viewId = Guid.newGuid().toString('n');
19
+ this.openVariablesSubscriptions = [];
20
+ this.openedVariableNamesForValues = new Set();
19
21
  this.logger = injector.get(LOGGER_SERVICE_TOKEN);
20
22
  this.childViews = new Array();
21
23
  if (parentView) {
@@ -71,16 +73,49 @@ export class GuiView {
71
73
  if (this.openVariableStatesSubscription) {
72
74
  this.openVariableStatesSubscription.unsubscribe();
73
75
  }
76
+ this.openVariablesSubscriptions.forEach(s => s.unsubscribe());
77
+ this.openVariablesSubscriptions = [];
78
+ this.openedVariableNamesForValues.clear();
74
79
  this.openedVariableNames = this.mainElement.getVariableNames();
75
- if (this.openedVariableNames.length === 0) {
80
+ // 分离系统变量和普通变量
81
+ const systemVariables = [];
82
+ const normalVariablesForState = [];
83
+ this.openedVariableNames.forEach(variableName => {
84
+ if (variableName === '当前语种ID') {
85
+ // 系统变量直接订阅,不需要等待状态
86
+ systemVariables.push(variableName);
87
+ }
88
+ else {
89
+ normalVariablesForState.push(variableName);
90
+ }
91
+ });
92
+ // 立即订阅系统变量
93
+ if (systemVariables.length > 0) {
94
+ this.normalOpenedVariableNames(systemVariables);
95
+ }
96
+ if (normalVariablesForState.indexOf('设备状态') !== -1) {
97
+ if (this.requestVirtualDeviceState) {
98
+ this.requestVirtualDeviceState.unsubscribe();
99
+ }
100
+ if (this.requestVirtualDeviceState) {
101
+ this.requestVirtualDeviceState.unsubscribe();
102
+ }
103
+ this.normalOpenedVariableNames(['设备状态']);
104
+ this.requestVirtualDeviceState =
105
+ this.perViewVariableCommunicator.requestVirtualDeviceState().subscribe({
106
+ complete: () => { }
107
+ });
108
+ normalVariablesForState.splice(normalVariablesForState.indexOf('设备状态'), 1);
109
+ }
110
+ if (normalVariablesForState.length === 0) {
76
111
  return;
77
112
  }
78
113
  this.openVariableStatesSubscription =
79
- this.perViewVariableCommunicator.subscribeVariableStates(this.openedVariableNames).subscribe((states) => {
114
+ this.perViewVariableCommunicator.subscribeVariableStates(normalVariablesForState).subscribe((states) => {
80
115
  this.mainElement.reportVariableStates(states);
81
116
  const normalVariableNames = [];
82
117
  each(states, v => {
83
- if (v.state === VariableStateEnum.Normal && normalVariableNames.indexOf(v.variableName) === -1) {
118
+ if ((v.state === VariableStateEnum.Normal || v.state === VariableStateEnum.Offline) && normalVariableNames.indexOf(v.variableName) === -1) {
84
119
  normalVariableNames.push(v.variableName);
85
120
  }
86
121
  });
@@ -181,8 +216,14 @@ export class GuiView {
181
216
  if (this.openVariableStatesSubscription) {
182
217
  this.openVariableStatesSubscription.unsubscribe();
183
218
  }
184
- if (this.openVariablesSubscription) {
185
- this.openVariablesSubscription.unsubscribe();
219
+ if (this.requestVirtualDeviceState) {
220
+ this.requestVirtualDeviceState.unsubscribe();
221
+ }
222
+ if (this.virtualDeviceStatesChanged) {
223
+ this.virtualDeviceStatesChanged.unsubscribe();
224
+ }
225
+ if (this.openVariablesSubscriptions) {
226
+ this.openVariablesSubscriptions.forEach(s => s.unsubscribe());
186
227
  }
187
228
  if (this.perViewVariableCommunicator) {
188
229
  this.perViewVariableCommunicator.dispose();
@@ -196,9 +237,12 @@ export class GuiView {
196
237
  this.logger.debug('[GUI] View disposed.');
197
238
  }
198
239
  normalOpenedVariableNames(normalVariableNames) {
199
- if (normalVariableNames.length > 0) {
200
- this.openVariablesSubscription = this.perViewVariableCommunicator.openVariables(normalVariableNames, this.signalRAppId)
240
+ const newVariables = normalVariableNames.filter(v => !this.openedVariableNamesForValues.has(v));
241
+ if (newVariables.length > 0) {
242
+ newVariables.forEach(v => this.openedVariableNamesForValues.add(v));
243
+ const sub = this.perViewVariableCommunicator.openVariables(newVariables, this.signalRAppId)
201
244
  .subscribe(variableValues => this.mainElement.reportVariableValues(variableValues));
245
+ this.openVariablesSubscriptions.push(sub);
202
246
  }
203
247
  }
204
248
  }
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"GuiView":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":47,"character":43},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":48,"character":41},{"__symbolic":"reference","module":"./gui-context","name":"GuiContext","line":49,"character":34},{"__symbolic":"reference","name":"GuiView"}]}],"resize":[{"__symbolic":"method"}],"load":[{"__symbolic":"method"}],"loadElementState":[{"__symbolic":"method"}],"popView":[{"__symbolic":"method"}],"closeView":[{"__symbolic":"method"}],"moveView":[{"__symbolic":"method"}],"showMusk":[{"__symbolic":"method"}],"showShadow":[{"__symbolic":"method"}],"hideMusk":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}],"normalOpenedVariableNames":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"GuiView":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":50,"character":43},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":51,"character":41},{"__symbolic":"reference","module":"./gui-context","name":"GuiContext","line":52,"character":34},{"__symbolic":"reference","name":"GuiView"}]}],"resize":[{"__symbolic":"method"}],"load":[{"__symbolic":"method"}],"loadElementState":[{"__symbolic":"method"}],"popView":[{"__symbolic":"method"}],"closeView":[{"__symbolic":"method"}],"moveView":[{"__symbolic":"method"}],"showMusk":[{"__symbolic":"method"}],"showShadow":[{"__symbolic":"method"}],"hideMusk":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}],"normalOpenedVariableNames":[{"__symbolic":"method"}]}}}}]
@@ -24,10 +24,12 @@ export declare class GuiComponent implements OnChanges, OnDestroy {
24
24
  initHeight: number;
25
25
  lastScale: number;
26
26
  isMobileMode: boolean;
27
+ hostContainerId: string;
27
28
  private $svg;
28
29
  private host;
29
30
  private get viewResizeMode();
30
31
  private readonly globalSettings;
32
+ private readonly viewService;
31
33
  constructor(el: ElementRef, localization: Localization, injector: Injector, bsModalService: BsModalService);
32
34
  ngOnChanges(changes: {
33
35
  [propKey: string]: SimpleChange;
@@ -39,4 +41,5 @@ export declare class GuiComponent implements OnChanges, OnDestroy {
39
41
  private onSizeChanged;
40
42
  private onResizeModeChanged;
41
43
  private onDisplayModeChanged;
44
+ refreshCurrentPage(): boolean;
42
45
  }
@@ -18,6 +18,7 @@ import { Size } from '../model';
18
18
  import { DisplayMode, GlobalSettings, ViewResizeMode } from '../settings';
19
19
  import { GuiHost } from './gui-host';
20
20
  import { Guid } from '../utils/guid';
21
+ import { ViewService } from '../view/view.service';
21
22
  let GuiComponent = class GuiComponent {
22
23
  constructor(el, localization, injector, bsModalService) {
23
24
  this.el = el;
@@ -29,6 +30,7 @@ let GuiComponent = class GuiComponent {
29
30
  this.lastScale = 1;
30
31
  this.isMobileMode = false;
31
32
  this.globalSettings = this.injector.get(GlobalSettings);
33
+ this.viewService = injector.get(ViewService);
32
34
  }
33
35
  get viewResizeMode() {
34
36
  switch (this.resizeMode) {
@@ -131,11 +133,11 @@ let GuiComponent = class GuiComponent {
131
133
  this.$svg = $(this.el.nativeElement).find('div.svgView').first();
132
134
  this.$svg.empty();
133
135
  const svgRootClass = 'S' + Guid.newGuid().toString('n');
134
- const hostContainerId = 'H' + Guid.newGuid().toString('n');
136
+ this.hostContainerId = 'H' + Guid.newGuid().toString('n');
135
137
  this.$svg.addClass(svgRootClass);
136
138
  const guiOptions = {
137
139
  svgRootClass: svgRootClass,
138
- hostContainerId: hostContainerId,
140
+ hostContainerId: this.hostContainerId,
139
141
  el: this.el
140
142
  };
141
143
  const host = new GuiHost(this.injector, this.bsModalService, newValue, guiOptions, this.el);
@@ -190,6 +192,17 @@ let GuiComponent = class GuiComponent {
190
192
  this.isMobileMode = this.displayMode === 'Mobile';
191
193
  this.globalSettings.displayMode = this.isMobileMode ? DisplayMode.Mobile : DisplayMode.Web;
192
194
  }
195
+ refreshCurrentPage() {
196
+ if (this.host.currentViewIndex === undefined) {
197
+ return false;
198
+ }
199
+ const toggleView = this.viewService.toggleViews.get(this.el);
200
+ if (!toggleView) {
201
+ return false;
202
+ }
203
+ toggleView(this.host.currentViewIndex, this.hostContainerId, this.el).subscribe();
204
+ return true;
205
+ }
193
206
  };
194
207
  __decorate([
195
208
  Input(),
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"GuiComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":11,"character":1},"arguments":[{"selector":"fc-gui","template":"<div> <div class='svgView' style=\"position: relative;display: flex;justify-content: center;align-items: center;\"></div> </div> "}]}],"members":{"context":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":5}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":5}}]}],"resizeMode":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":5}}]}],"displayMode":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":5}}]}],"loadFailed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":21,"character":5}}]}],"loaded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":22,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":46,"character":9},"arguments":[{"__symbolic":"reference","module":"../localization","name":"LOCALIZATION","line":46,"character":16}]}],null,null],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":45,"character":37},{"__symbolic":"reference","module":"../localization","name":"Localization","line":46,"character":61},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":47,"character":35},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":48,"character":41}]}],"ngOnChanges":[{"__symbolic":"method"}],"doubleFingerZooming":[{"__symbolic":"method"}],"getDistance":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"onProviderChanged":[{"__symbolic":"method"}],"onSizeChanged":[{"__symbolic":"method"}],"onResizeModeChanged":[{"__symbolic":"method"}],"onDisplayModeChanged":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"GuiComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":12,"character":1},"arguments":[{"selector":"fc-gui","template":"<div> <div class='svgView' style=\"position: relative;display: flex;justify-content: center;align-items: center;\"></div> </div> "}]}],"members":{"context":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":5}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":5}}]}],"resizeMode":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":5}}]}],"displayMode":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":5}}]}],"loadFailed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":22,"character":5}}]}],"loaded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":23,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":50,"character":9},"arguments":[{"__symbolic":"reference","module":"../localization","name":"LOCALIZATION","line":50,"character":16}]}],null,null],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":49,"character":37},{"__symbolic":"reference","module":"../localization","name":"Localization","line":50,"character":61},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":51,"character":35},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":52,"character":41}]}],"ngOnChanges":[{"__symbolic":"method"}],"doubleFingerZooming":[{"__symbolic":"method"}],"getDistance":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"onProviderChanged":[{"__symbolic":"method"}],"onSizeChanged":[{"__symbolic":"method"}],"onResizeModeChanged":[{"__symbolic":"method"}],"onDisplayModeChanged":[{"__symbolic":"method"}],"refreshCurrentPage":[{"__symbolic":"method"}]}}}}]
@@ -4,8 +4,10 @@ export interface Localization {
4
4
  loadFailed: any;
5
5
  setting: any;
6
6
  submit: any;
7
+ submitting: any;
7
8
  numericalValueRequired: any;
8
9
  invalidNumericalValue: any;
10
+ writeValueTimeout: any;
9
11
  binaryType: any;
10
12
  decimalType: any;
11
13
  hexadecimalType: any;
@@ -30,7 +32,9 @@ export interface Localization {
30
32
  permissiontip: any;
31
33
  conditionIsNotMetTip: any;
32
34
  chartNoData: any;
35
+ lastThirtyMinutes: any;
33
36
  lastOneHour: any;
37
+ lastEightHour: any;
34
38
  lastTwentyFourHours: any;
35
39
  lastSevenDays: any;
36
40
  lastThirtyDays: any;
@@ -47,5 +51,8 @@ export interface Localization {
47
51
  weatherNotSupport: any;
48
52
  weatherNotAddress: any;
49
53
  weatherNotAvailable: any;
54
+ airQualityNotSupport: any;
55
+ airQualityNotAddress: any;
56
+ airQualityNotAvailable: any;
50
57
  }
51
58
  export declare const DefaultLocalization: Localization;
@@ -4,8 +4,10 @@ export const DefaultLocalization = {
4
4
  loadFailed: 'Load failed.',
5
5
  setting: 'Setting',
6
6
  submit: 'Submit',
7
+ submitting: 'Submitting···',
7
8
  numericalValueRequired: 'Numerical value can\'t be emtpy',
8
9
  invalidNumericalValue: 'Numerical value is not valid',
10
+ writeValueTimeout: 'Write value error: Timeout',
9
11
  binaryType: 'Binary',
10
12
  decimalType: 'Decimal',
11
13
  hexadecimalType: 'Hexadecimal',
@@ -15,7 +17,7 @@ export const DefaultLocalization = {
15
17
  canNotBeNegative: 'Can not be negative',
16
18
  valueOutOfRange: 'Numerical value is out of range',
17
19
  timeout: 'timeout',
18
- confirmOperationPrompt: 'Sure to do this operation?',
20
+ confirmOperationPrompt: 'Are you sure you want to perform this operation?',
19
21
  confirm: 'Yes',
20
22
  cancel: 'Cancel',
21
23
  characterInputRequired: 'Character input can\'t be empty',
@@ -28,9 +30,11 @@ export const DefaultLocalization = {
28
30
  abnormal: 'Data abnormal',
29
31
  disable: 'Disable',
30
32
  permissiontip: 'You have no permission to operate.',
31
- conditionIsNotMetTip: 'Unsatisfied operating conditions or variable abnorma.',
33
+ conditionIsNotMetTip: 'Operation conditions not met or variable anomalies.',
32
34
  chartNoData: 'No Data Available',
35
+ lastThirtyMinutes: 'Last thirty minutes',
33
36
  lastOneHour: 'Last one hour',
37
+ lastEightHour: 'Last eight hours',
34
38
  lastTwentyFourHours: 'Last 24 hours',
35
39
  lastSevenDays: 'Last 7 days',
36
40
  lastThirtyDays: 'Last 30 days',
@@ -46,5 +50,8 @@ export const DefaultLocalization = {
46
50
  unconfiguredVideoAddress: 'Unconfigured Video Address',
47
51
  weatherNotSupport: 'Location not supported',
48
52
  weatherNotAddress: 'Address not configured',
49
- weatherNotAvailable: 'Address not yet available'
53
+ weatherNotAvailable: 'Address not yet available',
54
+ airQualityNotSupport: 'Location not supported',
55
+ airQualityNotAddress: 'Address not configured',
56
+ airQualityNotAvailable: 'Address not yet available'
50
57
  };
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"LOCALIZATION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":2,"character":32},"arguments":["fc.gui.loc"]},"Localization":{"__symbolic":"interface"},"DefaultLocalization":{"loadFailed":"Load failed.","setting":"Setting","submit":"Submit","numericalValueRequired":"Numerical value can't be emtpy","invalidNumericalValue":"Numerical value is not valid","binaryType":"Binary","decimalType":"Decimal","hexadecimalType":"Hexadecimal","stringType":"String","numericalValueTooLong":"Numerical value too long","fractionDigitsMustLessThan":"Fraction digits must be less than ","canNotBeNegative":"Can not be negative","valueOutOfRange":"Numerical value is out of range","timeout":"timeout","confirmOperationPrompt":"Sure to do this operation?","confirm":"Yes","cancel":"Cancel","characterInputRequired":"Character input can't be empty","character":"(Character)","characterOutofRange":"Character length is out of range","writeValueRange":"Write value range","loading":"Loading","unbind":"Unbind","offline":"Offline","abnormal":"Data abnormal","disable":"Disable","permissiontip":"You have no permission to operate.","conditionIsNotMetTip":"Unsatisfied operating conditions or variable abnorma.","chartNoData":"No Data Available","lastOneHour":"Last one hour","lastTwentyFourHours":"Last 24 hours","lastSevenDays":"Last 7 days","lastThirtyDays":"Last 30 days","lastOneYear":"Last 1 year","grouped":"Grouped","stacked":"Stacked","passwordVerify":"Password verifiers","passwordError":"Password error","password":"Password","passwordToolTip":"Password error, please re-enter","passwordRequired":"Password can't be empty","invalidVideoAddress":"Invalid video address","unconfiguredVideoAddress":"Unconfigured Video Address","weatherNotSupport":"Location not supported","weatherNotAddress":"Address not configured","weatherNotAvailable":"Address not yet available"}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"LOCALIZATION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":2,"character":32},"arguments":["fc.gui.loc"]},"Localization":{"__symbolic":"interface"},"DefaultLocalization":{"loadFailed":"Load failed.","setting":"Setting","submit":"Submit","submitting":"Submitting···","numericalValueRequired":"Numerical value can't be emtpy","invalidNumericalValue":"Numerical value is not valid","writeValueTimeout":"Write value error: Timeout","binaryType":"Binary","decimalType":"Decimal","hexadecimalType":"Hexadecimal","stringType":"String","numericalValueTooLong":"Numerical value too long","fractionDigitsMustLessThan":"Fraction digits must be less than ","canNotBeNegative":"Can not be negative","valueOutOfRange":"Numerical value is out of range","timeout":"timeout","confirmOperationPrompt":"Are you sure you want to perform this operation?","confirm":"Yes","cancel":"Cancel","characterInputRequired":"Character input can't be empty","character":"(Character)","characterOutofRange":"Character length is out of range","writeValueRange":"Write value range","loading":"Loading","unbind":"Unbind","offline":"Offline","abnormal":"Data abnormal","disable":"Disable","permissiontip":"You have no permission to operate.","conditionIsNotMetTip":"Operation conditions not met or variable anomalies.","chartNoData":"No Data Available","lastThirtyMinutes":"Last thirty minutes","lastOneHour":"Last one hour","lastEightHour":"Last eight hours","lastTwentyFourHours":"Last 24 hours","lastSevenDays":"Last 7 days","lastThirtyDays":"Last 30 days","lastOneYear":"Last 1 year","grouped":"Grouped","stacked":"Stacked","passwordVerify":"Password verifiers","passwordError":"Password error","password":"Password","passwordToolTip":"Password error, please re-enter","passwordRequired":"Password can't be empty","invalidVideoAddress":"Invalid video address","unconfiguredVideoAddress":"Unconfigured Video Address","weatherNotSupport":"Location not supported","weatherNotAddress":"Address not configured","weatherNotAvailable":"Address not yet available","airQualityNotSupport":"Location not supported","airQualityNotAddress":"Address not configured","airQualityNotAvailable":"Address not yet available"}}}]
@@ -2,8 +2,10 @@ export const Localization_zh_CN = {
2
2
  loadFailed: '加载失败.',
3
3
  setting: '设置',
4
4
  submit: '提交',
5
+ submitting: '提交中···',
5
6
  numericalValueRequired: '数值不能为空',
6
7
  invalidNumericalValue: '数值格式不正确',
8
+ writeValueTimeout: '写值错误:超时',
7
9
  binaryType: '二进制',
8
10
  decimalType: '十进制',
9
11
  hexadecimalType: '十六进制',
@@ -28,7 +30,9 @@ export const Localization_zh_CN = {
28
30
  permissiontip: '您无权限执行此操作',
29
31
  conditionIsNotMetTip: '操作条件不满足或逻辑控制变量异常',
30
32
  chartNoData: '无数据',
33
+ lastThirtyMinutes: '最近30分钟',
31
34
  lastOneHour: '最近1小时',
35
+ lastEightHour: '最近8小时',
32
36
  lastTwentyFourHours: '最近24小时',
33
37
  lastSevenDays: '最近7天',
34
38
  lastThirtyDays: '最近30天',
@@ -44,5 +48,8 @@ export const Localization_zh_CN = {
44
48
  unconfiguredVideoAddress: '未配置视频地址',
45
49
  weatherNotSupport: '当前位置暂不支持',
46
50
  weatherNotAddress: '当前设备未设置地址',
47
- weatherNotAvailable: '暂未获取设备地址'
51
+ weatherNotAvailable: '暂未获取设备地址',
52
+ airQualityNotSupport: '当前位置暂不支持',
53
+ airQualityNotAddress: '当前设备未设置地址',
54
+ airQualityNotAvailable: '暂未获取设备地址'
48
55
  };
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"Localization_zh_CN":{"loadFailed":"加载失败.","setting":"设置","submit":"提交","numericalValueRequired":"数值不能为空","invalidNumericalValue":"数值格式不正确","binaryType":"二进制","decimalType":"十进制","hexadecimalType":"十六进制","stringType":"字符串","numericalValueTooLong":"数值超长","fractionDigitsMustLessThan":"小数位不能超过","canNotBeNegative":"不能为负数","valueOutOfRange":"数值超出范围","timeout":"超时","confirmOperationPrompt":"是否确认要执行此操作?","confirm":"确定","cancel":"取消","characterInputRequired":"请输入至少一个字符","character":"(字符串)","characterOutofRange":"字符长度超限","writeValueRange":"写值范围","loading":"加载中","unbind":"未绑定","offline":"离线","abnormal":"数据异常","disable":"禁用","permissiontip":"您无权限执行此操作","conditionIsNotMetTip":"操作条件不满足或逻辑控制变量异常","chartNoData":"无数据","lastOneHour":"最近1小时","lastTwentyFourHours":"最近24小时","lastSevenDays":"最近7天","lastThirtyDays":"最近30天","lastOneYear":"最近1年","grouped":"分组","stacked":"叠加","passwordVerify":"密码校验","passwordError":"密码错误","password":"密码","passwordToolTip":"密码错误,请重新输入","passwordRequired":"密码不能为空","invalidVideoAddress":"无效的视频地址","unconfiguredVideoAddress":"未配置视频地址","weatherNotSupport":"当前位置暂不支持","weatherNotAddress":"当前设备未设置地址","weatherNotAvailable":"暂未获取设备地址"}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"Localization_zh_CN":{"loadFailed":"加载失败.","setting":"设置","submit":"提交","submitting":"提交中···","numericalValueRequired":"数值不能为空","invalidNumericalValue":"数值格式不正确","writeValueTimeout":"写值错误:超时","binaryType":"二进制","decimalType":"十进制","hexadecimalType":"十六进制","stringType":"字符串","numericalValueTooLong":"数值超长","fractionDigitsMustLessThan":"小数位不能超过","canNotBeNegative":"不能为负数","valueOutOfRange":"数值超出范围","timeout":"超时","confirmOperationPrompt":"是否确认要执行此操作?","confirm":"确定","cancel":"取消","characterInputRequired":"请输入至少一个字符","character":"(字符串)","characterOutofRange":"字符长度超限","writeValueRange":"写值范围","loading":"加载中","unbind":"未绑定","offline":"离线","abnormal":"数据异常","disable":"禁用","permissiontip":"您无权限执行此操作","conditionIsNotMetTip":"操作条件不满足或逻辑控制变量异常","chartNoData":"无数据","lastThirtyMinutes":"最近30分钟","lastOneHour":"最近1小时","lastEightHour":"最近8小时","lastTwentyFourHours":"最近24小时","lastSevenDays":"最近7天","lastThirtyDays":"最近30天","lastOneYear":"最近1年","grouped":"分组","stacked":"叠加","passwordVerify":"密码校验","passwordError":"密码错误","password":"密码","passwordToolTip":"密码错误,请重新输入","passwordRequired":"密码不能为空","invalidVideoAddress":"无效的视频地址","unconfiguredVideoAddress":"未配置视频地址","weatherNotSupport":"当前位置暂不支持","weatherNotAddress":"当前设备未设置地址","weatherNotAvailable":"暂未获取设备地址","airQualityNotSupport":"当前位置暂不支持","airQualityNotAddress":"当前设备未设置地址","airQualityNotAvailable":"暂未获取设备地址"}}}]
@@ -1,4 +1,6 @@
1
1
  import { NumericalOperation } from '../../model';
2
+ import { ReleasedVariableService } from '../../service';
3
+ import { GuiContext } from '../../gui/gui-context';
2
4
  export declare class WriteValueModalArgs {
3
5
  variableName: string;
4
6
  dataType: number;
@@ -8,5 +10,7 @@ export declare class WriteValueModalArgs {
8
10
  numericalOperation: NumericalOperation;
9
11
  version: number;
10
12
  enableDataParsed: boolean;
11
- constructor(variableName: string, dataType: number, fBoxDataType: number, integerDigits: number, fractionDigits: number, numericalOperation: NumericalOperation, version: number, enableDataParsed: boolean);
13
+ releasedVariableService: ReleasedVariableService;
14
+ guiContext?: GuiContext;
15
+ constructor(variableName: string, dataType: number, fBoxDataType: number, integerDigits: number, fractionDigits: number, numericalOperation: NumericalOperation, version: number, enableDataParsed: boolean, releasedVariableService: ReleasedVariableService, guiContext?: GuiContext);
12
16
  }
@@ -1,5 +1,5 @@
1
1
  export class WriteValueModalArgs {
2
- constructor(variableName, dataType, fBoxDataType, integerDigits, fractionDigits, numericalOperation, version, enableDataParsed) {
2
+ constructor(variableName, dataType, fBoxDataType, integerDigits, fractionDigits, numericalOperation, version, enableDataParsed, releasedVariableService, guiContext) {
3
3
  this.variableName = variableName;
4
4
  this.dataType = dataType;
5
5
  this.fBoxDataType = fBoxDataType;
@@ -8,5 +8,7 @@ export class WriteValueModalArgs {
8
8
  this.numericalOperation = numericalOperation;
9
9
  this.version = version;
10
10
  this.enableDataParsed = enableDataParsed;
11
+ this.releasedVariableService = releasedVariableService;
12
+ this.guiContext = guiContext;
11
13
  }
12
14
  }
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"WriteValueModalArgs":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","module":"../../model","name":"NumericalOperation","line":9,"character":35},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"boolean"}]}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"WriteValueModalArgs":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","module":"../../model","name":"NumericalOperation","line":11,"character":35},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"boolean"},{"__symbolic":"reference","module":"../../service","name":"ReleasedVariableService","line":14,"character":40},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":15,"character":28}]}]}}}}]
@@ -1,19 +1,18 @@
1
1
  import { OnInit } from '@angular/core';
2
- import { Observable } from 'rxjs';
3
2
  import { Localization } from '../../localization';
4
3
  import { NumericalOperation } from '../../model/numerical-display/numerical-operation';
5
4
  import { DataTypeService } from '../../utils/data-type/data-type.service';
6
5
  import { FractionDigitService } from '../../utils/fraction-digit.service';
7
6
  import { NumericalOperationService } from '../../utils/numerical-operation.service';
8
7
  import { WriteValueModalArgs } from './write-value-modal-args';
9
- import { WriteValueModelResult } from './write-value-model-result';
8
+ import { BsModalRef } from 'ngx-bootstrap/modal';
10
9
  export declare class WriteValueModalComponent implements OnInit {
11
10
  localization: Localization;
12
11
  private readonly dataTypeService;
13
12
  private readonly fractionDigitService;
14
13
  private readonly numericalOperationService;
15
- private _onClosed;
16
- get onClosed(): Observable<WriteValueModelResult>;
14
+ private readonly bsModalRef;
15
+ onClosed: any;
17
16
  args: WriteValueModalArgs;
18
17
  private dataType;
19
18
  private fBoxDataType;
@@ -27,22 +26,29 @@ export declare class WriteValueModalComponent implements OnInit {
27
26
  value: string;
28
27
  valueType: string;
29
28
  variableName: string;
29
+ displayVariableName: string;
30
30
  enableNumericalOperation: boolean;
31
+ isNumericalOperation: boolean;
31
32
  numericalOperation: NumericalOperation;
32
33
  validationError: boolean;
33
34
  validationErrorText: string;
34
35
  writeMinValue: number;
35
36
  writeMaxValue: number;
36
37
  writeValueRangeText: string;
38
+ isSubmitting: boolean;
37
39
  get invalidErrorText(): string;
38
- constructor(localization: Localization, dataTypeService: DataTypeService, fractionDigitService: FractionDigitService, numericalOperationService: NumericalOperationService);
40
+ constructor(localization: Localization, dataTypeService: DataTypeService, fractionDigitService: FractionDigitService, numericalOperationService: NumericalOperationService, bsModalRef: BsModalRef);
39
41
  ngOnInit(): void;
40
42
  initData(option: WriteValueModalArgs): void;
41
43
  private setValueRangeAccordToDataParsed;
42
44
  getWriteValueRangeText(): string;
43
45
  save(): void;
44
- close(modalResult?: WriteValueModelResult): void;
45
- validate(): void;
46
+ /**
47
+ * 处理"当前语种ID"系统变量的保存
48
+ */
49
+ private handleCurrentLanguageIdSave;
50
+ close(): void;
51
+ validate(event?: any): void;
46
52
  private showValidationErrorInfo;
47
53
  private hideValidationErrorInfo;
48
54
  private getFractionDigits;
@@ -2,20 +2,25 @@
2
2
  <div class="modal-header">
3
3
  <h4 class="modal-title">
4
4
  <span>{{localization.setting}}</span>
5
- <span>{{variableName}}</span>
5
+ <span>{{displayVariableName}}</span>
6
6
  </h4>
7
7
  <button type="button" class="close pull-right" aria-label="Close" (click)="close()">
8
8
  <span aria-hidden="true">&times;</span>
9
9
  </button>
10
10
  </div>
11
11
  <div class="modal-body">
12
- <span class="write-value-range">{{localization.writeValueRange}}:&nbsp;{{writeValueRangeText}}
12
+ <span class="write-value-range">{{localization.writeValueRange}}:</span>
13
+ <div class="write-value-range">
14
+ {{writeValueRangeText}}
13
15
  <span *ngIf="valueType">({{valueType}})</span>
14
- </span>
15
- <input type="text" name="valueInput" autoFocus class="form-control write-value" [(ngModel)]="value" (keyup)="validate()" autocomplete="off">
16
+ </div>
17
+ <input type="text" name="valueInput" autoFocus class="form-control write-value" [(ngModel)]="value" (keyup)="validate($event)" autocomplete="off">
16
18
  <span class="help-block text-danger" [hidden]="!validationError">{{validationErrorText}}</span>
17
19
  </div>
18
20
  <div class="modal-footer">
19
- <button type="submit" class="btn md-skip btn-primary btn-block" [disabled]="validationError">{{localization.submit}}</button>
21
+ <button type="submit" class="btn md-skip btn-primary btn-block" [disabled]="validationError || isSubmitting">
22
+ <ng-container *ngIf="!isSubmitting">{{localization.submit}}</ng-container>
23
+ <ng-container *ngIf="isSubmitting">{{localization.submitting}}</ng-container>
24
+ </button>
20
25
  </div>
21
26
  </form>
@@ -11,23 +11,22 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
13
  import { Component, Inject, Output } from '@angular/core';
14
- import { Subject } from 'rxjs';
15
14
  import { LOCALIZATION } from '../../localization';
16
15
  import { DataTypeService } from '../../utils/data-type/data-type.service';
17
16
  import { FractionDigitService } from '../../utils/fraction-digit.service';
18
17
  import { NumericalOperationService } from '../../utils/numerical-operation.service';
19
18
  import { isNil } from 'lodash';
19
+ import { BsModalRef } from 'ngx-bootstrap/modal';
20
20
  let WriteValueModalComponent = class WriteValueModalComponent {
21
- constructor(localization, dataTypeService, fractionDigitService, numericalOperationService) {
21
+ constructor(localization, dataTypeService, fractionDigitService, numericalOperationService, bsModalRef) {
22
22
  this.localization = localization;
23
23
  this.dataTypeService = dataTypeService;
24
24
  this.fractionDigitService = fractionDigitService;
25
25
  this.numericalOperationService = numericalOperationService;
26
- this._onClosed = new Subject();
26
+ this.bsModalRef = bsModalRef;
27
+ this.displayVariableName = '';
27
28
  this.writeValueRangeText = '';
28
- }
29
- get onClosed() {
30
- return this._onClosed;
29
+ this.isSubmitting = false;
31
30
  }
32
31
  get invalidErrorText() {
33
32
  return this.localization.loadFailed;
@@ -37,7 +36,20 @@ let WriteValueModalComponent = class WriteValueModalComponent {
37
36
  this.validate();
38
37
  }
39
38
  initData(option) {
39
+ var _a, _b, _c;
40
40
  this.variableName = option.variableName;
41
+ this.displayVariableName = this.variableName;
42
+ if (this.variableName === '当前语种ID') {
43
+ const language = (_c = (_b = (_a = window.abp) === null || _a === void 0 ? void 0 : _a.localization) === null || _b === void 0 ? void 0 : _b.currentLanguage) === null || _c === void 0 ? void 0 : _c.name;
44
+ const isTraditionalChinese = language === 'zh-Hant' || language === 'zh-TW' || language === 'zh-tw';
45
+ const isChinese = language === 'zh-Hans' || language === 'zh';
46
+ if (isTraditionalChinese) {
47
+ this.displayVariableName = '當前語種ID';
48
+ }
49
+ else if (!isChinese) {
50
+ this.displayVariableName = 'Current Language ID';
51
+ }
52
+ }
41
53
  this.dataType = option.dataType;
42
54
  this.fBoxDataType = option.fBoxDataType;
43
55
  this.integerDigits = option.integerDigits ? option.integerDigits : 0;
@@ -101,21 +113,80 @@ let WriteValueModalComponent = class WriteValueModalComponent {
101
113
  return minValue + '~' + maxValue;
102
114
  }
103
115
  save() {
116
+ this.isSubmitting = true;
117
+ let value = this.value;
118
+ const showValue = this.value;
104
119
  if (this.args.enableDataParsed) {
105
120
  if (this.enableNumericalOperation) {
106
- this.value = this.numericalOperationService.getWriteValue(this.args.version, this.value, this.numericalOperation, this.dataType, this.fractionDigits);
121
+ value = this.numericalOperationService.getWriteValue(this.args.version, this.value, this.numericalOperation, this.dataType, this.fractionDigits);
107
122
  }
108
123
  else {
109
- this.value = this.formatWriteValue();
124
+ value = this.formatWriteValue();
125
+ }
126
+ }
127
+ // 处理系统变量"当前语种ID"
128
+ if (this.variableName === '当前语种ID') {
129
+ this.handleCurrentLanguageIdSave(value);
130
+ return;
131
+ }
132
+ if (!this.args.releasedVariableService) {
133
+ this.onClosed({
134
+ value: value,
135
+ showValue: showValue,
136
+ enableNumericalOperation: false,
137
+ isNumericalOperation: this.isNumericalOperation,
138
+ variableRwType: 6
139
+ });
140
+ return;
141
+ }
142
+ this.args.releasedVariableService.getVariableWithValueTransform(this.variableName).subscribe(result => {
143
+ const valueTransform = JSON.parse(result.valueTransform);
144
+ if ((valueTransform === null || valueTransform === void 0 ? void 0 : valueTransform.Type) !== 0) {
145
+ this.isNumericalOperation = true;
110
146
  }
147
+ this.onClosed({
148
+ value: value,
149
+ showValue: showValue,
150
+ enableNumericalOperation: this.enableNumericalOperation,
151
+ isNumericalOperation: this.isNumericalOperation,
152
+ variableRwType: result.variableRwType
153
+ });
154
+ });
155
+ }
156
+ /**
157
+ * 处理"当前语种ID"系统变量的保存
158
+ */
159
+ handleCurrentLanguageIdSave(value) {
160
+ if (!this.args.guiContext || !this.args.guiContext.updateCurrentLanguageId) {
161
+ this.showValidationErrorInfo(this.localization.loadFailed);
162
+ this.isSubmitting = false;
163
+ return;
111
164
  }
112
- this.close({ value: this.value });
165
+ // 转换为数字类型
166
+ const languageId = value === '' || value == null ? null : Number(value);
167
+ // 调用 GuiContext 的语种切换方法
168
+ this.args.guiContext.updateCurrentLanguageId(languageId).then(() => {
169
+ // 语种切换成功,调用 onClosed 回调,让数字显示元件也能更新
170
+ this.onClosed({
171
+ value: value,
172
+ showValue: value,
173
+ enableNumericalOperation: false,
174
+ isNumericalOperation: false,
175
+ variableRwType: 6
176
+ });
177
+ }).catch(() => {
178
+ this.showValidationErrorInfo(this.localization.loadFailed);
179
+ this.isSubmitting = false;
180
+ });
113
181
  }
114
- close(modalResult) {
115
- this._onClosed.next(modalResult);
116
- this._onClosed.complete();
182
+ close() {
183
+ this.bsModalRef.hide();
117
184
  }
118
- validate() {
185
+ validate(event = null) {
186
+ if (event && event.keyCode === 13 && !this.validationError) {
187
+ this.save();
188
+ return;
189
+ }
119
190
  // 校验数值必填
120
191
  if (null == this.value || '' === this.value.trim()) {
121
192
  return this.showValidationErrorInfo(this.localization.numericalValueRequired);
@@ -193,12 +264,13 @@ __decorate([
193
264
  WriteValueModalComponent = __decorate([
194
265
  Component({
195
266
  selector: 'writeValueModal',
196
- template: "<form #writeValueForm=\"ngForm\" novalidate (ngSubmit)=\"save()\" bs-modal-drag> <div class=\"modal-header\"> <h4 class=\"modal-title\"> <span>{{localization.setting}}</span> <span>{{variableName}}</span> </h4> <button type=\"button\" class=\"close pull-right\" aria-label=\"Close\" (click)=\"close()\"> <span aria-hidden=\"true\">&times;</span> </button> </div> <div class=\"modal-body\"> <span class=\"write-value-range\">{{localization.writeValueRange}}:&nbsp;{{writeValueRangeText}} <span *ngIf=\"valueType\">({{valueType}})</span> </span> <input type=\"text\" name=\"valueInput\" autoFocus class=\"form-control write-value\" [(ngModel)]=\"value\" (keyup)=\"validate()\" autocomplete=\"off\"> <span class=\"help-block text-danger\" [hidden]=\"!validationError\">{{validationErrorText}}</span> </div> <div class=\"modal-footer\"> <button type=\"submit\" class=\"btn md-skip btn-primary btn-block\" [disabled]=\"validationError\">{{localization.submit}}</button> </div> </form> ",
267
+ template: "<form #writeValueForm=\"ngForm\" novalidate (ngSubmit)=\"save()\" bs-modal-drag> <div class=\"modal-header\"> <h4 class=\"modal-title\"> <span>{{localization.setting}}</span> <span>{{displayVariableName}}</span> </h4> <button type=\"button\" class=\"close pull-right\" aria-label=\"Close\" (click)=\"close()\"> <span aria-hidden=\"true\">&times;</span> </button> </div> <div class=\"modal-body\"> <span class=\"write-value-range\">{{localization.writeValueRange}}:</span> <div class=\"write-value-range\"> {{writeValueRangeText}} <span *ngIf=\"valueType\">({{valueType}})</span> </div> <input type=\"text\" name=\"valueInput\" autoFocus class=\"form-control write-value\" [(ngModel)]=\"value\" (keyup)=\"validate($event)\" autocomplete=\"off\"> <span class=\"help-block text-danger\" [hidden]=\"!validationError\">{{validationErrorText}}</span> </div> <div class=\"modal-footer\"> <button type=\"submit\" class=\"btn md-skip btn-primary btn-block\" [disabled]=\"validationError || isSubmitting\"> <ng-container *ngIf=\"!isSubmitting\">{{localization.submit}}</ng-container> <ng-container *ngIf=\"isSubmitting\">{{localization.submitting}}</ng-container> </button> </div> </form> ",
197
268
  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; } .text-danger { display: block; color: #ed6b75; font-size: 14px; margin: 5px 0px 0px 15px; } .btn-primary { background-color: #3B97FC; border-color: #3B97FC; padding: 5px 30px; width: 90%; margin: 0 5%; height: 32px; } .write-value-range { color: #7f939e; font-size: 14px; margin-left: 15px; } .write-value { padding-left: 8px; margin-left: 16px; height: 32px; } "]
198
269
  }),
199
270
  __param(0, Inject(LOCALIZATION)),
200
271
  __metadata("design:paramtypes", [Object, DataTypeService,
201
272
  FractionDigitService,
202
- NumericalOperationService])
273
+ NumericalOperationService,
274
+ BsModalRef])
203
275
  ], WriteValueModalComponent);
204
276
  export { WriteValueModalComponent };