@flexem/fc-gui 3.0.0-alpha.102 → 3.0.0-alpha.104

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/CHANGELOG.md CHANGED
@@ -456,7 +456,12 @@
456
456
  #### Features
457
457
  1. FLEXCLOUD-2957 切换仪表盘时console报错,由于历史曲线中设置了windowResize但未清除,导致resize会执行已经不存在的历史曲线的数据
458
458
 
459
- ## 3.0.0-alpha.102(2023-12-18)
459
+ ## 3.0.0-alpha.102(2023-12-18),3.0.0-alpha.103(2024-03-07)
460
460
  ### Web端
461
461
  #### Features
462
- 1. FLEXCLOUD-2619 棒图、环形图设置最大值、最小值为参数后,刻度数值对齐及模糊问题
462
+ 1. FLEXCLOUD-2619 棒图、环形图设置最大值、最小值为参数后,刻度数值对齐及模糊问题
463
+
464
+ ## 3.0.0-alpha.104(2024-03-13)
465
+ ### Web端
466
+ #### Features
467
+ 1. FLEXCLOUD-2619 环形图配置常数后再配置变量导致刻度值间隔较大
@@ -22111,7 +22111,7 @@ class ConsoleLoggerService {
22111
22111
 
22112
22112
  "use strict";
22113
22113
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VariableUtil; });
22114
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
22114
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13);
22115
22115
 
22116
22116
  class VariableUtil {
22117
22117
  static getConvertedVariableName(variableStore, variable) {
@@ -22226,6 +22226,19 @@ class VariableDefinition {
22226
22226
  /* 11 */
22227
22227
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
22228
22228
 
22229
+ "use strict";
22230
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VariableValueType; });
22231
+ var VariableValueType;
22232
+ (function (VariableValueType) {
22233
+ VariableValueType[VariableValueType["Constant"] = 0] = "Constant";
22234
+ VariableValueType[VariableValueType["Variable"] = 1] = "Variable";
22235
+ })(VariableValueType || (VariableValueType = {}));
22236
+
22237
+
22238
+ /***/ }),
22239
+ /* 12 */
22240
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
22241
+
22229
22242
  "use strict";
22230
22243
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __extends; });
22231
22244
  /* unused harmony export __assign */
@@ -22435,7 +22448,7 @@ function __importDefault(mod) {
22435
22448
 
22436
22449
 
22437
22450
  /***/ }),
22438
- /* 12 */
22451
+ /* 13 */
22439
22452
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
22440
22453
 
22441
22454
  "use strict";
@@ -22598,19 +22611,6 @@ class GetAlarmsArgs {
22598
22611
 
22599
22612
 
22600
22613
 
22601
- /***/ }),
22602
- /* 13 */
22603
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
22604
-
22605
- "use strict";
22606
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VariableValueType; });
22607
- var VariableValueType;
22608
- (function (VariableValueType) {
22609
- VariableValueType[VariableValueType["Constant"] = 0] = "Constant";
22610
- VariableValueType[VariableValueType["Variable"] = 1] = "Variable";
22611
- })(VariableValueType || (VariableValueType = {}));
22612
-
22613
-
22614
22614
  /***/ }),
22615
22615
  /* 14 */
22616
22616
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
@@ -32958,7 +32958,7 @@ class Guid {
32958
32958
  "use strict";
32959
32959
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscriber; });
32960
32960
  /* unused harmony export SafeSubscriber */
32961
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
32961
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
32962
32962
  /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51);
32963
32963
  /* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53);
32964
32964
  /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23);
@@ -35342,7 +35342,7 @@ function degreesToRadians(degrees) {
35342
35342
  }
35343
35343
 
35344
35344
  // EXTERNAL MODULE: ./.tmp/model/shared/condition/variable-value-type.ts
35345
- var variable_value_type = __webpack_require__(13);
35345
+ var variable_value_type = __webpack_require__(11);
35346
35346
 
35347
35347
  // CONCATENATED MODULE: ./.tmp/elements/bar-graph-element.ts
35348
35348
 
@@ -35359,6 +35359,8 @@ class bar_graph_element_BarGraphElement extends readable_element_ReadableElement
35359
35359
  this.barText = '';
35360
35360
  this.valueObj = {};
35361
35361
  this.isNeedUpdateScale = false;
35362
+ this.needAddNumber = 0;
35363
+ this.needInitTransform = true;
35362
35364
  if ((this.model.minValueType === variable_value_type["a" /* VariableValueType */].Constant && this.model.maxValueType === variable_value_type["a" /* VariableValueType */].Variable)
35363
35365
  || this.model.maxValueType === variable_value_type["a" /* VariableValueType */].Constant && this.model.minValueType === variable_value_type["a" /* VariableValueType */].Variable) {
35364
35366
  this.isNeedUpdateScale = true;
@@ -35374,8 +35376,10 @@ class bar_graph_element_BarGraphElement extends readable_element_ReadableElement
35374
35376
  this.$barRect.attr('transform', this.defaultTransform);
35375
35377
  }
35376
35378
  setTimeout(() => {
35377
- this.initFrameNode();
35378
- }, 0);
35379
+ if (this.model.maxValueType !== variable_value_type["a" /* VariableValueType */].Variable || this.model.minValueType !== variable_value_type["a" /* VariableValueType */].Variable) {
35380
+ this.initFrameNode();
35381
+ }
35382
+ });
35379
35383
  }
35380
35384
  get readVariableName() {
35381
35385
  if (!this.model) {
@@ -35392,10 +35396,42 @@ class bar_graph_element_BarGraphElement extends readable_element_ReadableElement
35392
35396
  return variable_util["a" /* VariableUtil */].getConvertedVariableName(this.variableStore, variable);
35393
35397
  }
35394
35398
  }
35399
+ initTransform() {
35400
+ if (this.needAddNumber <= 3)
35401
+ return;
35402
+ this.$element[0].childNodes.forEach((node, index) => {
35403
+ const matrixE = node.transform.baseVal[0].matrix.e;
35404
+ node.transform.baseVal[0].matrix.e = matrixE + (this.needAddNumber - 3) * 7;
35405
+ if (node.nodeName === 'g') {
35406
+ const nodeValue = node.attributes['clip-path'].value.replace('url(#', '').replace(')', '');
35407
+ const rootNode = node.parentNode.parentNode.parentElement;
35408
+ const clipPath = $(rootNode).find(`clipPath[id="${nodeValue}"]`);
35409
+ const demoPath = clipPath.find('path');
35410
+ const dValues = demoPath.attr('d').split(',');
35411
+ const retValues = [];
35412
+ dValues.forEach((line) => {
35413
+ const values = [];
35414
+ line.split(' ').forEach((item) => {
35415
+ const nItem = Number(item);
35416
+ if (!isNaN(nItem) && item < 100) {
35417
+ item = nItem > 0 ? nItem + (this.needAddNumber - 3) * 7 : nItem - (this.needAddNumber - 3) * 7;
35418
+ }
35419
+ values.push(item);
35420
+ });
35421
+ retValues.push(values.join(' '));
35422
+ });
35423
+ demoPath.attr('d', retValues.join(','));
35424
+ }
35425
+ else if (index === this.$element[0].childNodes.length - 1) {
35426
+ this.defaultTransform = node.attributes['transform'].value;
35427
+ }
35428
+ });
35429
+ }
35395
35430
  initFrameNode() {
35396
35431
  const arcPath = Snap(this.$element[0]);
35397
35432
  const b = arcPath.getBBox(true);
35398
- this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', b.width).attr('height', b.height).attr('fill', 'transparent');
35433
+ const width = this.needAddNumber <= 3 ? b.width : b.width + (this.needAddNumber - 3) * 7;
35434
+ this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', width).attr('height', b.height).attr('fill', 'transparent');
35399
35435
  }
35400
35436
  updateValueObj(value, variableName) {
35401
35437
  var _a, _b, _c;
@@ -35425,6 +35461,14 @@ class bar_graph_element_BarGraphElement extends readable_element_ReadableElement
35425
35461
  min = bar_graph_element_BarGraphElement.DEFAULT_MIN_VALUE;
35426
35462
  max = bar_graph_element_BarGraphElement.DEFAULT_MAX_VALUE;
35427
35463
  }
35464
+ if (this.model.maxValueType === variable_value_type["a" /* VariableValueType */].Variable && this.model.minValueType === variable_value_type["a" /* VariableValueType */].Variable) {
35465
+ this.needAddNumber = max.toString().length > min.toString().length ? max.toString().length : min.toString().length;
35466
+ if (this.needInitTransform) {
35467
+ this.initTransform();
35468
+ this.initFrameNode();
35469
+ this.needInitTransform = false;
35470
+ }
35471
+ }
35428
35472
  const avgSacle = ((max - min) / this.model.masterDivisionNumber).toFixed(5);
35429
35473
  for (let i = 0; i < textElements.length; i++) {
35430
35474
  const text = textElements[i];
@@ -35441,7 +35485,8 @@ class bar_graph_element_BarGraphElement extends readable_element_ReadableElement
35441
35485
  if (this.model.minValueType !== variable_value_type["a" /* VariableValueType */].Constant || this.model.maxValueType !== variable_value_type["a" /* VariableValueType */].Constant) {
35442
35486
  // FLEXCLOUD-2619 刻度未对齐问题
35443
35487
  let translateX = 0;
35444
- switch (sacleValue.toString().length) {
35488
+ const sacleLen = sacleValue.toString().length;
35489
+ switch (sacleLen) {
35445
35490
  case 1:
35446
35491
  translateX = 13;
35447
35492
  break;
@@ -35452,6 +35497,9 @@ class bar_graph_element_BarGraphElement extends readable_element_ReadableElement
35452
35497
  translateX = this.model.fractionDigits ? 5 : 0;
35453
35498
  break;
35454
35499
  default:
35500
+ if (sacleLen > 3 && this.needAddNumber > 3) {
35501
+ translateX = -(sacleLen - 3) * 7;
35502
+ }
35455
35503
  break;
35456
35504
  }
35457
35505
  text.transform.baseVal[0].matrix.e = translateX;
@@ -35550,7 +35598,7 @@ bar_graph_element_BarGraphElement.DEFAULT_MAX_VALUE = 100;
35550
35598
 
35551
35599
 
35552
35600
  // EXTERNAL MODULE: ./.tmp/config/index.ts + 11 modules
35553
- var _tmp_config = __webpack_require__(12);
35601
+ var _tmp_config = __webpack_require__(13);
35554
35602
 
35555
35603
  // EXTERNAL MODULE: ./.tmp/modal/alert/alert-modal.component.ts
35556
35604
  var alert_modal_component = __webpack_require__(20);
@@ -37860,6 +37908,7 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
37860
37908
  this.valueObj = {};
37861
37909
  this.isNeedUpdateScale = false;
37862
37910
  this.initTransform = false;
37911
+ this.needAddNumber = 0;
37863
37912
  if ((this.model.minValueType === variable_value_type["a" /* VariableValueType */].Constant && this.model.maxValueType === variable_value_type["a" /* VariableValueType */].Variable)
37864
37913
  || this.model.maxValueType === variable_value_type["a" /* VariableValueType */].Constant && this.model.minValueType === variable_value_type["a" /* VariableValueType */].Variable) {
37865
37914
  this.isNeedUpdateScale = true;
@@ -37904,6 +37953,34 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
37904
37953
  const variable = new variable_definition["a" /* VariableDefinition */](this.model.maxVariable.name, this.model.maxVariable.groupName, this.model.maxVariable.dataSourceCode, this.model.maxVariable.variableVersion);
37905
37954
  return variable_util["a" /* VariableUtil */].getConvertedVariableName(this.variableStore, variable);
37906
37955
  }
37956
+ initTransformFun(len) {
37957
+ this.$element[0].childNodes.forEach((node) => {
37958
+ if (!node.transform.baseVal[0])
37959
+ return;
37960
+ // const matrixE = node.transform.baseVal[0].matrix.e;
37961
+ // node.transform.baseVal[0].matrix.e = matrixE + len * 5;
37962
+ if (node.nodeName === 'g') {
37963
+ const nodeValue = node.attributes['clip-path'].value.replace('url(#', '').replace(')', '');
37964
+ const rootNode = node.parentNode.parentNode.parentElement;
37965
+ const clipPath = $(rootNode).find(`clipPath[id="${nodeValue}"]`);
37966
+ const demoPath = clipPath.find('path');
37967
+ const dValues = demoPath.attr('d').split(',');
37968
+ const retValues = [];
37969
+ dValues.forEach((line, index) => {
37970
+ const values = [];
37971
+ line.split(' ').forEach((item) => {
37972
+ const nItem = Number(item);
37973
+ if (!isNaN(nItem) && (index === 1 || index === 2 || nItem === -1)) {
37974
+ item = nItem > 0 ? (index === 1 || index === 2 ? nItem + (len + 2) * 8 : nItem + len * 8) : nItem - len * 8;
37975
+ }
37976
+ values.push(item);
37977
+ });
37978
+ retValues.push(values.join(' '));
37979
+ });
37980
+ demoPath.attr('d', retValues.join(','));
37981
+ }
37982
+ });
37983
+ }
37907
37984
  initFrameNode() {
37908
37985
  const arcPath = Snap(this.$element[0]);
37909
37986
  const b = arcPath.getBBox(true);
@@ -37939,7 +38016,6 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
37939
38016
  }
37940
38017
  updateScale() {
37941
38018
  // 刻度模糊问题
37942
- let isInitTransform = false;
37943
38019
  const matrix = this.$element[0].transform.baseVal[0].matrix;
37944
38020
  if (!this.$element[0].style.transform) {
37945
38021
  this.$element[0].style.transform = `translate3d(${matrix.e}px, ${matrix.f}px, 0)`;
@@ -37956,6 +38032,15 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
37956
38032
  min = ring_graph_element_RingGraphElement.DEFAULT_MIN_VALUE;
37957
38033
  max = ring_graph_element_RingGraphElement.DEFAULT_MAX_VALUE;
37958
38034
  }
38035
+ if (this.model.minValueType === variable_value_type["a" /* VariableValueType */].Variable || this.model.maxValueType === variable_value_type["a" /* VariableValueType */].Variable) {
38036
+ const len = max.toString().length > min.toString().length ? max.toString().length : min.toString().length;
38037
+ if (Math.abs(len - this.needAddNumber) > 2) {
38038
+ const width = this.$element.find('rect').attr('width');
38039
+ this.$element.find('rect').attr('width', Number(width) + (len - this.needAddNumber) * 8);
38040
+ this.initTransformFun(Math.abs(len - this.needAddNumber));
38041
+ this.needAddNumber = len;
38042
+ }
38043
+ }
37959
38044
  const avgSacle = ((max - min) / this.model.masterDivisionNumber).toFixed(5);
37960
38045
  for (let i = 0; i < textElements.length; i++) {
37961
38046
  const text = textElements[i];
@@ -37968,18 +38053,23 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
37968
38053
  sacleValue = (sacleValue / Math.pow(10, this.model.fractionDigits)).toFixed(this.model.fractionDigits);
37969
38054
  }
37970
38055
  if (!isNaN(sacleValue)) {
38056
+ const oriValue = text.innerHTML;
37971
38057
  text.innerHTML = sacleValue;
37972
38058
  if (this.model.minValueType !== variable_value_type["a" /* VariableValueType */].Constant || this.model.maxValueType !== variable_value_type["a" /* VariableValueType */].Constant) {
37973
38059
  // FLEXCLOUD-2619 刻度显示不全问题
37974
38060
  const order = (i + 1) / textElements.length;
37975
- if (!this.initTransform && order > 0.2 && order < 0.5 && sacleValue.toString().length > 2) {
37976
- text.transform.baseVal[0].matrix.e -= 5;
37977
- isInitTransform = true;
38061
+ const len = oriValue.toString().length - sacleValue.toString().length;
38062
+ if (order <= 0.7 && len > 1 && !this.initTransform) {
38063
+ text.transform.baseVal[0].matrix.e += (len - 1) * 5;
38064
+ }
38065
+ if (order > 0.7 && Math.abs(len) > 0) {
38066
+ text.transform.baseVal[0].matrix.e += len > 1 ? (len - 1) * 5 : len < -1 ? (len + 1) * 5 : len * 5;
38067
+ text.transform.baseVal[0].matrix.e += len === -2 ? -3 : 0;
37978
38068
  }
37979
38069
  }
37980
38070
  }
37981
38071
  }
37982
- this.initTransform = this.initTransform || isInitTransform;
38072
+ this.initTransform = true;
37983
38073
  }
37984
38074
  updateVariableValue(value, variableName) {
37985
38075
  this.updateValueObj(value, variableName);
@@ -61523,7 +61613,7 @@ nv.version = "1.8.6-dev";
61523
61613
  "use strict";
61524
61614
 
61525
61615
  // EXTERNAL MODULE: ./node_modules/rxjs/node_modules/tslib/tslib.es6.js
61526
- var tslib_es6 = __webpack_require__(11);
61616
+ var tslib_es6 = __webpack_require__(12);
61527
61617
 
61528
61618
  // EXTERNAL MODULE: ./node_modules/rxjs/_esm5/internal/Observable.js + 3 modules
61529
61619
  var Observable = __webpack_require__(14);
@@ -63291,7 +63381,7 @@ var Subject = __webpack_require__(39);
63291
63381
  var operators_ = __webpack_require__(16);
63292
63382
 
63293
63383
  // EXTERNAL MODULE: ./.tmp/config/index.ts + 11 modules
63294
- var _tmp_config = __webpack_require__(12);
63384
+ var _tmp_config = __webpack_require__(13);
63295
63385
 
63296
63386
  // EXTERNAL MODULE: ./.tmp/core/stringifying-map.ts
63297
63387
  var stringifying_map = __webpack_require__(29);
@@ -64021,7 +64111,7 @@ class RelationConditionResult {
64021
64111
  }
64022
64112
 
64023
64113
  // EXTERNAL MODULE: ./.tmp/model/shared/condition/variable-value-type.ts
64024
- var variable_value_type = __webpack_require__(13);
64114
+ var variable_value_type = __webpack_require__(11);
64025
64115
 
64026
64116
  // EXTERNAL MODULE: ./.tmp/model/shared/condition/relation-type.ts
64027
64117
  var relation_type = __webpack_require__(21);
@@ -65535,7 +65625,7 @@ var Observable = __webpack_require__(14);
65535
65625
  var isScheduler = __webpack_require__(50);
65536
65626
 
65537
65627
  // EXTERNAL MODULE: ./node_modules/rxjs/node_modules/tslib/tslib.es6.js
65538
- var tslib_es6 = __webpack_require__(11);
65628
+ var tslib_es6 = __webpack_require__(12);
65539
65629
 
65540
65630
  // EXTERNAL MODULE: ./node_modules/rxjs/_esm5/internal/Subscriber.js
65541
65631
  var Subscriber = __webpack_require__(28);
@@ -83971,7 +84061,7 @@ __webpack_require__.r(__webpack_exports__);
83971
84061
  /* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
83972
84062
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StringifyingMap", function() { return _core__WEBPACK_IMPORTED_MODULE_3__["a"]; });
83973
84063
 
83974
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12);
84064
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13);
83975
84065
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ConfigStore", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["b"]; });
83976
84066
 
83977
84067
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Graph", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["f"]; });