@flexem/fc-gui 3.0.0-alpha.104 → 3.0.0-alpha.106
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 +45 -27
- 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/datetime-display/datetime-display-element.js +1 -1
- package/elements/historical-curve/historical-curve.element.d.ts +4 -0
- package/elements/historical-curve/historical-curve.element.js +30 -10
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/model/historical-curve/historical-curve-axis-settings.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -464,4 +464,14 @@
|
|
|
464
464
|
## 3.0.0-alpha.104(2024-03-13)
|
|
465
465
|
### Web端
|
|
466
466
|
#### Features
|
|
467
|
-
1. FLEXCLOUD-2619 环形图配置常数后再配置变量导致刻度值间隔较大
|
|
467
|
+
1. FLEXCLOUD-2619 环形图配置常数后再配置变量导致刻度值间隔较大
|
|
468
|
+
|
|
469
|
+
## 3.0.0-alpha.105(2024-03-15)
|
|
470
|
+
### Web端
|
|
471
|
+
#### Features
|
|
472
|
+
1. FLEXCLOUD-3086 历史曲线可以设置筛选的背景颜色
|
|
473
|
+
|
|
474
|
+
## 3.0.0-alpha.106(2024-04-10)
|
|
475
|
+
### Web端
|
|
476
|
+
#### Features
|
|
477
|
+
1. FLEXCLOUD-3269 由于历史曲线使用d3绘制,数据量过多或者通道较多时导致安卓端操作较卡顿
|
|
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
|
}
|
|
@@ -36228,7 +36226,7 @@ class datetime_display_element_DatetimeDisplayElement extends conditional_displa
|
|
|
36228
36226
|
this.getAndSetCurrentTime(format);
|
|
36229
36227
|
setInterval(() => {
|
|
36230
36228
|
this.getAndSetCurrentTime(format);
|
|
36231
|
-
},
|
|
36229
|
+
}, 100);
|
|
36232
36230
|
}
|
|
36233
36231
|
}
|
|
36234
36232
|
getAndSetCurrentTime(format) {
|
|
@@ -36424,6 +36422,11 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
36424
36422
|
};
|
|
36425
36423
|
this.elementStatus = HistoricalCurveElementStatus.Loading;
|
|
36426
36424
|
this.data = [];
|
|
36425
|
+
this.needResize = true;
|
|
36426
|
+
this.setNeedResize = () => {
|
|
36427
|
+
this.needResize = false;
|
|
36428
|
+
setTimeout(() => this.needResize = true, 500);
|
|
36429
|
+
};
|
|
36427
36430
|
this.logger = injector.get(logger["b" /* LOGGER_SERVICE_TOKEN */]);
|
|
36428
36431
|
this.localization = injector.get(_tmp_localization["b" /* LOCALIZATION */]);
|
|
36429
36432
|
this.timePeriods = this.getValidTimePeriods();
|
|
@@ -36444,6 +36447,7 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
36444
36447
|
}
|
|
36445
36448
|
}
|
|
36446
36449
|
this.loadFirstPage();
|
|
36450
|
+
this.initKeyboardListener();
|
|
36447
36451
|
}
|
|
36448
36452
|
dispose() {
|
|
36449
36453
|
clearInterval(this.refreshIntervalId);
|
|
@@ -36453,8 +36457,19 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
36453
36457
|
if (this.resizeEventListener) {
|
|
36454
36458
|
this.resizeEventListener.clear();
|
|
36455
36459
|
}
|
|
36460
|
+
if (this.isAndroid) {
|
|
36461
|
+
window.removeEventListener('native.keyboardshow', this.setNeedResize);
|
|
36462
|
+
window.removeEventListener('native.keyboardhide', this.setNeedResize);
|
|
36463
|
+
}
|
|
36456
36464
|
this.logger.debug(`[GUI]Dispose Histoical Curve Refresh Interval:${d3["time"].format('%x %X')(new Date())}`);
|
|
36457
36465
|
}
|
|
36466
|
+
initKeyboardListener() {
|
|
36467
|
+
this.isAndroid = !!navigator.userAgent.match(/(Android)/i);
|
|
36468
|
+
if (this.isAndroid) {
|
|
36469
|
+
window.addEventListener('native.keyboardshow', this.setNeedResize);
|
|
36470
|
+
window.addEventListener('native.keyboardhide', this.setNeedResize);
|
|
36471
|
+
}
|
|
36472
|
+
}
|
|
36458
36473
|
getValidTimePeriods() {
|
|
36459
36474
|
const timePeriods = new Array();
|
|
36460
36475
|
timePeriods.push({ key: 6, name: this.localization.lastThirtyMinutes });
|
|
@@ -36701,6 +36716,8 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
36701
36716
|
this.rootElement.append('g').datum(data).call(chart);
|
|
36702
36717
|
this.rootElement.selectAll('.nv-noData').attr('x', chartWidth / 2).attr('y', chartHeight / 2 + this.displayOption.operationAreaHeight);
|
|
36703
36718
|
this.resizeEventListener = nv_d3["utils"].windowResize(() => {
|
|
36719
|
+
if (!this.needResize)
|
|
36720
|
+
return;
|
|
36704
36721
|
chart.update();
|
|
36705
36722
|
this.rootElement.selectAll('.nv-noData').attr('x', chartWidth / 2).attr('y', chartHeight / 2 + this.displayOption.operationAreaHeight);
|
|
36706
36723
|
});
|
|
@@ -36805,11 +36822,12 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
36805
36822
|
}
|
|
36806
36823
|
}
|
|
36807
36824
|
renderOperationArea(chartWidth, chartHeight) {
|
|
36825
|
+
const backgroundColor = this.model.displaySetting.axisSetting.filterBackgroudColor || 'inherit';
|
|
36808
36826
|
const operationArea = this.rootElement.append('g').attr('transform', `translate(0,${chartHeight + this.displayOption.operationAreaMarginTop})`)
|
|
36809
36827
|
.append('foreignObject').attr('width', chartWidth).attr('height', this.displayOption.operationAreaHeight).attr('fill', 'none')
|
|
36810
36828
|
.append('xhtml:div').style('height', (this.displayOption.operationAreaHeight - 4) + 'px').style('overflow', 'hidden').style('margin-top', '4px');
|
|
36811
36829
|
const selectElement = operationArea.append('select').style('margin-left', this.displayOption.marginLeft + 'px')
|
|
36812
|
-
.style('background-color',
|
|
36830
|
+
.style('background-color', backgroundColor)
|
|
36813
36831
|
.style('font-size', this.displayOption.operationSelectFontSize).on('change', () => {
|
|
36814
36832
|
const displayTimePeriod = this.rootElement.select('select').property('value');
|
|
36815
36833
|
this.updateTimeRange(displayTimePeriod);
|
|
@@ -36819,26 +36837,26 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
36819
36837
|
const fillColor = rect.attr('fill');
|
|
36820
36838
|
const options = selectElement.selectAll('option').data(this.timePeriods).enter().append('option');
|
|
36821
36839
|
options.text(d => d.name).attr('value', d => d.key).property('selected', d => d.key === Number(this.currentTimePeriod))
|
|
36822
|
-
.style('background-color', fillColor);
|
|
36840
|
+
.style('background-color', this.model.displaySetting.axisSetting.filterBackgroudColor || fillColor);
|
|
36823
36841
|
const buttonWidth = this.displayOption.operationButtonWidth + 'px', buttonHeight = this.displayOption.operationButtonHeight + 'px';
|
|
36824
36842
|
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', '
|
|
36843
|
+
.style('float', 'right').style('background-image', 'url(assets/img/black_last_page.png)')
|
|
36844
|
+
.style('background-color', backgroundColor).style('background-size', 'cover')
|
|
36827
36845
|
.on('click', () => { this.loadLastPage(); });
|
|
36828
36846
|
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
36829
|
-
.style('float', 'right').style('background-image', 'url(assets/img/
|
|
36847
|
+
.style('float', 'right').style('background-image', 'url(assets/img/black_next_page.png)')
|
|
36830
36848
|
.style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
|
|
36831
|
-
.style('background-color', '
|
|
36849
|
+
.style('background-color', backgroundColor).style('background-size', 'cover')
|
|
36832
36850
|
.on('click', () => { this.loadNextPage(); });
|
|
36833
36851
|
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
36834
|
-
.style('float', 'right').style('background-image', 'url(assets/img/
|
|
36852
|
+
.style('float', 'right').style('background-image', 'url(assets/img/black_previous_page.png)')
|
|
36835
36853
|
.style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
|
|
36836
|
-
.style('background-color', '
|
|
36854
|
+
.style('background-color', backgroundColor).style('background-size', 'cover')
|
|
36837
36855
|
.on('click', () => { this.loadPreviousPage(); });
|
|
36838
36856
|
operationArea.append('button').style('width', buttonWidth).style('height', buttonHeight).style('border', 'none')
|
|
36839
|
-
.style('float', 'right').style('background-image', 'url(assets/img/
|
|
36857
|
+
.style('float', 'right').style('background-image', 'url(assets/img/black_first_page.png)')
|
|
36840
36858
|
.style('margin', `0 ${this.displayOption.operationButtonMargin}px 0 0`)
|
|
36841
|
-
.style('background-color', '
|
|
36859
|
+
.style('background-color', backgroundColor).style('background-size', 'cover')
|
|
36842
36860
|
.on('click', () => { this.loadFirstPage(); });
|
|
36843
36861
|
}
|
|
36844
36862
|
timeFormat(datetime, specifier) {
|