@flexem/fc-gui 3.0.0-alpha.103 → 3.0.0-alpha.105
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 +11 -1
- package/assets/img/black_first_page.png +0 -0
- package/assets/img/black_last_page.png +0 -0
- package/assets/img/black_next_page.png +0 -0
- package/assets/img/black_previous_page.png +0 -0
- package/bundles/@flexem/fc-gui.umd.js +50 -48
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/bar-graph-element.d.ts +0 -1
- package/elements/bar-graph-element.js +14 -16
- package/elements/bar-graph-element.metadata.json +1 -1
- package/elements/historical-curve/historical-curve.element.js +11 -10
- package/elements/ring-graph/ring-graph-element.js +25 -22
- package/model/historical-curve/historical-curve-axis-settings.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -459,4 +459,14 @@
|
|
|
459
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 环形图配置常数后再配置变量导致刻度值间隔较大
|
|
468
|
+
|
|
469
|
+
## 3.0.0-alpha.105(2024-03-15)
|
|
470
|
+
### Web端
|
|
471
|
+
#### Features
|
|
472
|
+
1. FLEXCLOUD-3086 历史曲线可以设置筛选的背景颜色
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -35360,7 +35360,6 @@ class bar_graph_element_BarGraphElement extends readable_element_ReadableElement
|
|
|
35360
35360
|
this.valueObj = {};
|
|
35361
35361
|
this.isNeedUpdateScale = false;
|
|
35362
35362
|
this.needAddNumber = 0;
|
|
35363
|
-
this.needInitTransform = true;
|
|
35364
35363
|
if ((this.model.minValueType === variable_value_type["a" /* VariableValueType */].Constant && this.model.maxValueType === variable_value_type["a" /* VariableValueType */].Variable)
|
|
35365
35364
|
|| this.model.maxValueType === variable_value_type["a" /* VariableValueType */].Constant && this.model.minValueType === variable_value_type["a" /* VariableValueType */].Variable) {
|
|
35366
35365
|
this.isNeedUpdateScale = true;
|
|
@@ -35376,9 +35375,7 @@ class bar_graph_element_BarGraphElement extends readable_element_ReadableElement
|
|
|
35376
35375
|
this.$barRect.attr('transform', this.defaultTransform);
|
|
35377
35376
|
}
|
|
35378
35377
|
setTimeout(() => {
|
|
35379
|
-
|
|
35380
|
-
this.initFrameNode();
|
|
35381
|
-
}
|
|
35378
|
+
this.initFrameNode();
|
|
35382
35379
|
});
|
|
35383
35380
|
}
|
|
35384
35381
|
get readVariableName() {
|
|
@@ -35400,8 +35397,10 @@ class bar_graph_element_BarGraphElement extends readable_element_ReadableElement
|
|
|
35400
35397
|
if (this.needAddNumber <= 3)
|
|
35401
35398
|
return;
|
|
35402
35399
|
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;
|
|
35400
|
+
// const matrixE = node.transform.baseVal[0].matrix.e;
|
|
35401
|
+
// node.transform.baseVal[0].matrix.e = matrixE + (this.needAddNumber - 3) * 7;
|
|
35402
|
+
if (!node.transform.baseVal[0])
|
|
35403
|
+
return;
|
|
35405
35404
|
if (node.nodeName === 'g') {
|
|
35406
35405
|
const nodeValue = node.attributes['clip-path'].value.replace('url(#', '').replace(')', '');
|
|
35407
35406
|
const rootNode = node.parentNode.parentNode.parentElement;
|
|
@@ -35413,8 +35412,8 @@ class bar_graph_element_BarGraphElement extends readable_element_ReadableElement
|
|
|
35413
35412
|
const values = [];
|
|
35414
35413
|
line.split(' ').forEach((item) => {
|
|
35415
35414
|
const nItem = Number(item);
|
|
35416
|
-
if (
|
|
35417
|
-
item = nItem
|
|
35415
|
+
if (nItem === -1) {
|
|
35416
|
+
item = nItem - (this.needAddNumber - 3) * 7;
|
|
35418
35417
|
}
|
|
35419
35418
|
values.push(item);
|
|
35420
35419
|
});
|
|
@@ -35430,8 +35429,7 @@ class bar_graph_element_BarGraphElement extends readable_element_ReadableElement
|
|
|
35430
35429
|
initFrameNode() {
|
|
35431
35430
|
const arcPath = Snap(this.$element[0]);
|
|
35432
35431
|
const b = arcPath.getBBox(true);
|
|
35433
|
-
|
|
35434
|
-
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', width).attr('height', b.height).attr('fill', 'transparent');
|
|
35432
|
+
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', b.width).attr('height', b.height).attr('fill', 'transparent');
|
|
35435
35433
|
}
|
|
35436
35434
|
updateValueObj(value, variableName) {
|
|
35437
35435
|
var _a, _b, _c;
|
|
@@ -35461,13 +35459,9 @@ class bar_graph_element_BarGraphElement extends readable_element_ReadableElement
|
|
|
35461
35459
|
min = bar_graph_element_BarGraphElement.DEFAULT_MIN_VALUE;
|
|
35462
35460
|
max = bar_graph_element_BarGraphElement.DEFAULT_MAX_VALUE;
|
|
35463
35461
|
}
|
|
35464
|
-
if (this.model.maxValueType === variable_value_type["a" /* VariableValueType */].Variable
|
|
35462
|
+
if (this.model.maxValueType === variable_value_type["a" /* VariableValueType */].Variable || this.model.minValueType === variable_value_type["a" /* VariableValueType */].Variable) {
|
|
35465
35463
|
this.needAddNumber = max.toString().length > min.toString().length ? max.toString().length : min.toString().length;
|
|
35466
|
-
|
|
35467
|
-
this.initTransform();
|
|
35468
|
-
this.initFrameNode();
|
|
35469
|
-
this.needInitTransform = false;
|
|
35470
|
-
}
|
|
35464
|
+
this.initTransform();
|
|
35471
35465
|
}
|
|
35472
35466
|
const avgSacle = ((max - min) / this.model.masterDivisionNumber).toFixed(5);
|
|
35473
35467
|
for (let i = 0; i < textElements.length; i++) {
|
|
@@ -35502,6 +35496,10 @@ class bar_graph_element_BarGraphElement extends readable_element_ReadableElement
|
|
|
35502
35496
|
}
|
|
35503
35497
|
break;
|
|
35504
35498
|
}
|
|
35499
|
+
if (this.model.minValueType !== variable_value_type["a" /* VariableValueType */].Constant && this.model.maxValueType === variable_value_type["a" /* VariableValueType */].Constant) {
|
|
35500
|
+
const maxLen = this.model.max && this.model.max.toString().length;
|
|
35501
|
+
translateX += maxLen > 2 ? (maxLen - 3) * 7 : 0;
|
|
35502
|
+
}
|
|
35505
35503
|
text.transform.baseVal[0].matrix.e = translateX;
|
|
35506
35504
|
}
|
|
35507
35505
|
}
|
|
@@ -36805,11 +36803,12 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
36805
36803
|
}
|
|
36806
36804
|
}
|
|
36807
36805
|
renderOperationArea(chartWidth, chartHeight) {
|
|
36806
|
+
const backgroundColor = this.model.displaySetting.axisSetting.filterBackgroudColor || 'inherit';
|
|
36808
36807
|
const operationArea = this.rootElement.append('g').attr('transform', `translate(0,${chartHeight + this.displayOption.operationAreaMarginTop})`)
|
|
36809
36808
|
.append('foreignObject').attr('width', chartWidth).attr('height', this.displayOption.operationAreaHeight).attr('fill', 'none')
|
|
36810
36809
|
.append('xhtml:div').style('height', (this.displayOption.operationAreaHeight - 4) + 'px').style('overflow', 'hidden').style('margin-top', '4px');
|
|
36811
36810
|
const selectElement = operationArea.append('select').style('margin-left', this.displayOption.marginLeft + 'px')
|
|
36812
|
-
.style('background-color',
|
|
36811
|
+
.style('background-color', backgroundColor)
|
|
36813
36812
|
.style('font-size', this.displayOption.operationSelectFontSize).on('change', () => {
|
|
36814
36813
|
const displayTimePeriod = this.rootElement.select('select').property('value');
|
|
36815
36814
|
this.updateTimeRange(displayTimePeriod);
|
|
@@ -36819,26 +36818,26 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
36819
36818
|
const fillColor = rect.attr('fill');
|
|
36820
36819
|
const options = selectElement.selectAll('option').data(this.timePeriods).enter().append('option');
|
|
36821
36820
|
options.text(d => d.name).attr('value', d => d.key).property('selected', d => d.key === Number(this.currentTimePeriod))
|
|
36822
|
-
.style('background-color', fillColor);
|
|
36821
|
+
.style('background-color', this.model.displaySetting.axisSetting.filterBackgroudColor || fillColor);
|
|
36823
36822
|
const buttonWidth = this.displayOption.operationButtonWidth + 'px', buttonHeight = this.displayOption.operationButtonHeight + 'px';
|
|
36824
36823
|
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
36825
|
-
.style('float', 'right').style('background-image', 'url(assets/img/
|
|
36826
|
-
.style('background-color', '
|
|
36824
|
+
.style('float', 'right').style('background-image', 'url(assets/img/black_last_page.png)')
|
|
36825
|
+
.style('background-color', backgroundColor).style('background-size', 'cover')
|
|
36827
36826
|
.on('click', () => { this.loadLastPage(); });
|
|
36828
36827
|
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
36829
|
-
.style('float', 'right').style('background-image', 'url(assets/img/
|
|
36828
|
+
.style('float', 'right').style('background-image', 'url(assets/img/black_next_page.png)')
|
|
36830
36829
|
.style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
|
|
36831
|
-
.style('background-color', '
|
|
36830
|
+
.style('background-color', backgroundColor).style('background-size', 'cover')
|
|
36832
36831
|
.on('click', () => { this.loadNextPage(); });
|
|
36833
36832
|
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
36834
|
-
.style('float', 'right').style('background-image', 'url(assets/img/
|
|
36833
|
+
.style('float', 'right').style('background-image', 'url(assets/img/black_previous_page.png)')
|
|
36835
36834
|
.style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
|
|
36836
|
-
.style('background-color', '
|
|
36835
|
+
.style('background-color', backgroundColor).style('background-size', 'cover')
|
|
36837
36836
|
.on('click', () => { this.loadPreviousPage(); });
|
|
36838
36837
|
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
36839
|
-
.style('float', 'right').style('background-image', 'url(assets/img/
|
|
36838
|
+
.style('float', 'right').style('background-image', 'url(assets/img/black_first_page.png)')
|
|
36840
36839
|
.style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
|
|
36841
|
-
.style('background-color', '
|
|
36840
|
+
.style('background-color', backgroundColor).style('background-size', 'cover')
|
|
36842
36841
|
.on('click', () => { this.loadFirstPage(); });
|
|
36843
36842
|
}
|
|
36844
36843
|
timeFormat(datetime, specifier) {
|
|
@@ -37919,9 +37918,7 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
37919
37918
|
this._barElement$ = el$.find('path[data-id="barArc"]');
|
|
37920
37919
|
this._textElement$ = el$.find('text[data-id="pText"]');
|
|
37921
37920
|
setTimeout(() => {
|
|
37922
|
-
|
|
37923
|
-
this.initFrameNode();
|
|
37924
|
-
}
|
|
37921
|
+
this.initFrameNode();
|
|
37925
37922
|
this.changeStates();
|
|
37926
37923
|
});
|
|
37927
37924
|
}
|
|
@@ -37955,12 +37952,12 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
37955
37952
|
const variable = new variable_definition["a" /* VariableDefinition */](this.model.maxVariable.name, this.model.maxVariable.groupName, this.model.maxVariable.dataSourceCode, this.model.maxVariable.variableVersion);
|
|
37956
37953
|
return variable_util["a" /* VariableUtil */].getConvertedVariableName(this.variableStore, variable);
|
|
37957
37954
|
}
|
|
37958
|
-
initTransformFun() {
|
|
37959
|
-
if (this.needAddNumber <= 3)
|
|
37960
|
-
return;
|
|
37955
|
+
initTransformFun(len) {
|
|
37961
37956
|
this.$element[0].childNodes.forEach((node) => {
|
|
37962
|
-
|
|
37963
|
-
|
|
37957
|
+
if (!node.transform.baseVal[0])
|
|
37958
|
+
return;
|
|
37959
|
+
// const matrixE = node.transform.baseVal[0].matrix.e;
|
|
37960
|
+
// node.transform.baseVal[0].matrix.e = matrixE + len * 5;
|
|
37964
37961
|
if (node.nodeName === 'g') {
|
|
37965
37962
|
const nodeValue = node.attributes['clip-path'].value.replace('url(#', '').replace(')', '');
|
|
37966
37963
|
const rootNode = node.parentNode.parentNode.parentElement;
|
|
@@ -37972,8 +37969,8 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
37972
37969
|
const values = [];
|
|
37973
37970
|
line.split(' ').forEach((item) => {
|
|
37974
37971
|
const nItem = Number(item);
|
|
37975
|
-
if (!isNaN(nItem) && (index === 1 || nItem === -1)) {
|
|
37976
|
-
item = nItem > 0 ? nItem + (
|
|
37972
|
+
if (!isNaN(nItem) && (index === 1 || index === 2 || nItem === -1)) {
|
|
37973
|
+
item = nItem > 0 ? (index === 1 || index === 2 ? nItem + (len + 2) * 8 : nItem + len * 8) : nItem - len * 8;
|
|
37977
37974
|
}
|
|
37978
37975
|
values.push(item);
|
|
37979
37976
|
});
|
|
@@ -37986,8 +37983,7 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
37986
37983
|
initFrameNode() {
|
|
37987
37984
|
const arcPath = Snap(this.$element[0]);
|
|
37988
37985
|
const b = arcPath.getBBox(true);
|
|
37989
|
-
|
|
37990
|
-
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', width).attr('height', b.height).attr('fill', 'transparent');
|
|
37986
|
+
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', b.width).attr('height', b.height).attr('fill', 'transparent');
|
|
37991
37987
|
}
|
|
37992
37988
|
init(variableName) {
|
|
37993
37989
|
if (variableName) {
|
|
@@ -38019,7 +38015,6 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
38019
38015
|
}
|
|
38020
38016
|
updateScale() {
|
|
38021
38017
|
// 刻度模糊问题
|
|
38022
|
-
let isInitTransform = false;
|
|
38023
38018
|
const matrix = this.$element[0].transform.baseVal[0].matrix;
|
|
38024
38019
|
if (!this.$element[0].style.transform) {
|
|
38025
38020
|
this.$element[0].style.transform = `translate3d(${matrix.e}px, ${matrix.f}px, 0)`;
|
|
@@ -38036,11 +38031,13 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
38036
38031
|
min = ring_graph_element_RingGraphElement.DEFAULT_MIN_VALUE;
|
|
38037
38032
|
max = ring_graph_element_RingGraphElement.DEFAULT_MAX_VALUE;
|
|
38038
38033
|
}
|
|
38039
|
-
if (this.model.minValueType === variable_value_type["a" /* VariableValueType */].Variable) {
|
|
38040
|
-
|
|
38041
|
-
if (
|
|
38042
|
-
this.
|
|
38043
|
-
this.
|
|
38034
|
+
if (this.model.minValueType === variable_value_type["a" /* VariableValueType */].Variable || this.model.maxValueType === variable_value_type["a" /* VariableValueType */].Variable) {
|
|
38035
|
+
const len = max.toString().length > min.toString().length ? max.toString().length : min.toString().length;
|
|
38036
|
+
if (Math.abs(len - this.needAddNumber) > 2) {
|
|
38037
|
+
const width = this.$element.find('rect').attr('width');
|
|
38038
|
+
this.$element.find('rect').attr('width', Number(width) + (len - this.needAddNumber) * 8);
|
|
38039
|
+
this.initTransformFun(Math.abs(len - this.needAddNumber));
|
|
38040
|
+
this.needAddNumber = len;
|
|
38044
38041
|
}
|
|
38045
38042
|
}
|
|
38046
38043
|
const avgSacle = ((max - min) / this.model.masterDivisionNumber).toFixed(5);
|
|
@@ -38055,18 +38052,23 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
38055
38052
|
sacleValue = (sacleValue / Math.pow(10, this.model.fractionDigits)).toFixed(this.model.fractionDigits);
|
|
38056
38053
|
}
|
|
38057
38054
|
if (!isNaN(sacleValue)) {
|
|
38055
|
+
const oriValue = text.innerHTML;
|
|
38058
38056
|
text.innerHTML = sacleValue;
|
|
38059
|
-
isInitTransform = true;
|
|
38060
38057
|
if (this.model.minValueType !== variable_value_type["a" /* VariableValueType */].Constant || this.model.maxValueType !== variable_value_type["a" /* VariableValueType */].Constant) {
|
|
38061
38058
|
// FLEXCLOUD-2619 刻度显示不全问题
|
|
38062
38059
|
const order = (i + 1) / textElements.length;
|
|
38063
|
-
|
|
38064
|
-
|
|
38060
|
+
const len = oriValue.toString().length - sacleValue.toString().length;
|
|
38061
|
+
if (order <= 0.7 && len > 1 && !this.initTransform) {
|
|
38062
|
+
text.transform.baseVal[0].matrix.e += (len - 1) * 5;
|
|
38063
|
+
}
|
|
38064
|
+
if (order > 0.7 && Math.abs(len) > 0) {
|
|
38065
|
+
text.transform.baseVal[0].matrix.e += len > 1 ? (len - 1) * 5 : len < -1 ? (len + 1) * 5 : len * 5;
|
|
38066
|
+
text.transform.baseVal[0].matrix.e += len === -2 ? -3 : 0;
|
|
38065
38067
|
}
|
|
38066
38068
|
}
|
|
38067
38069
|
}
|
|
38068
38070
|
}
|
|
38069
|
-
this.initTransform =
|
|
38071
|
+
this.initTransform = true;
|
|
38070
38072
|
}
|
|
38071
38073
|
updateVariableValue(value, variableName) {
|
|
38072
38074
|
this.updateValueObj(value, variableName);
|