@flexem/fc-gui 3.0.0-alpha.93 → 3.0.0-alpha.96

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
@@ -388,34 +388,7 @@
388
388
  #### Bug Fix
389
389
  1. FLEXCLOUD-2612 组态元件写值超时
390
390
 
391
- ## 3.0.0-alpha.87(2023-05-31)
391
+ ## 3.0.0-alpha.96(2023-09-26)
392
392
  ### Web端
393
393
  #### Bug Fix
394
- 1. FLEXCLOUD-2698 【app-ios】视频元件放大后缩小不应占满整个组态
395
-
396
- ## 3.0.0-alpha.88(2023-06-01)
397
- ### Web端
398
- #### Bug Fix
399
- 1. FLEXCLOUD-2699、FLEXCLOUD-2700 将视频元件还原为在组态外渲染,并且在弹窗时隐藏视频
400
-
401
- ## 3.0.0-alpha.89(2023-06-01)
402
- ### Web端
403
- #### Bug Fix
404
- 1. FLEXCLOUD-2699、FLEXCLOUD-2700 修改视频元件,优化视频显示逻辑
405
-
406
- ## 3.0.0-alpha.90(2023-06-06)
407
- ### Web端
408
- #### Bug Fix
409
- 1. 安卓和鸿蒙系统上,组态横屏时不再显示状态栏
410
- 2. 修复在鸿蒙系统的手机上,视频元件的控制按钮显示异常的问题
411
- 3. 修复ios系统中视频放大缩小后,画面会变形的问题
412
-
413
- ## 3.0.0-alpha.92(2023-07-18)
414
- ### Web端
415
- #### Features
416
- 1. FLEXCLOUD-2710 【氚云20230621000600】组态历史曲线表:历史曲线增加点位标记,便于直观看到曲线采样点的变化
417
-
418
- ## 3.0.0-alpha.93(2023-07-21)
419
- ### Web端
420
- #### Features
421
- 1. FLEXCLOUD-2741 【氚云20230714001409】模板的模拟功能,无法进行写值,一直提示提交中
394
+ 1. FLEXCLOUD-2864 2018年创建的模板组态写值失败(在补丁包v2.22.0-Hotfix5中使用,其它分支不要用)
@@ -33767,7 +33767,7 @@ function styleFunction(name, value, priority) {
33767
33767
  };
33768
33768
  }
33769
33769
 
33770
- /* harmony default export */ var selection_style = (function(name, value, priority) {
33770
+ /* harmony default export */ var style = (function(name, value, priority) {
33771
33771
  return arguments.length > 1
33772
33772
  ? this.each((value == null
33773
33773
  ? styleRemove : typeof value === "function"
@@ -34222,7 +34222,7 @@ Selection.prototype = selection_selection.prototype = {
34222
34222
  empty: selection_empty,
34223
34223
  each: each,
34224
34224
  attr: attr,
34225
- style: selection_style,
34225
+ style: style,
34226
34226
  property: property,
34227
34227
  classed: classed,
34228
34228
  text: selection_text,
@@ -36357,7 +36357,6 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
36357
36357
  operationButtonMargin: 4
36358
36358
  };
36359
36359
  this.elementStatus = HistoricalCurveElementStatus.Loading;
36360
- this.data = [];
36361
36360
  this.logger = injector.get(logger["b" /* LOGGER_SERVICE_TOKEN */]);
36362
36361
  this.localization = injector.get(_tmp_localization["b" /* LOCALIZATION */]);
36363
36362
  this.timePeriods = this.getValidTimePeriods();
@@ -36469,7 +36468,6 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
36469
36468
  Object(lodash["each"])(result, v => values.push({ x: moment(v.time).local().toDate().valueOf(), y: v.values[key] }));
36470
36469
  data.push({ key: channel.name, area: channel.projectEnabled, values: values });
36471
36470
  });
36472
- this.data = data;
36473
36471
  nv_d3["addGraph"](() => {
36474
36472
  if (this.model.displaySetting.curveType === CurveType.BarGroup || this.model.displaySetting.curveType === CurveType.BarStack) {
36475
36473
  return this.getMultiBarWithFocusChart(chartWidth, chartHeight, data);
@@ -36479,44 +36477,6 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
36479
36477
  }
36480
36478
  });
36481
36479
  }
36482
- initPoint() {
36483
- try {
36484
- this.rootElement
36485
- .selectAll('.nv-scatterWrap')
36486
- .selectAll('.nv-point')
36487
- .style('stroke-opacity', 0)
36488
- .style('stroke-width', 0);
36489
- const legendList = this.rootElement
36490
- .selectAll('.nv-legend')
36491
- .selectAll('.nv-series');
36492
- let hiddenCount = 0;
36493
- for (let i = 0; i < this.data.length; i++) {
36494
- const channel = this.model.dataSetting.channels[i];
36495
- const pointStyle = `stroke-opacity: 1;stroke-width: 8px;stroke :${channel.pointColor}`;
36496
- if (legendList._groups[0][i].firstChild.style.fillOpacity === '1') {
36497
- const pointList = this.rootElement
36498
- .selectAll('.nv-scatterWrap')
36499
- .selectAll('.nv-series-' + (i - hiddenCount)).selectAll('.nv-point')._groups[0];
36500
- if (pointList && pointList.length) {
36501
- for (let j = 0; j < pointList.length; j++) {
36502
- if (j && $(pointList[j]).attr('transform').split(',')[1] !== $(pointList[j - 1]).attr('transform').split(',')[1]) {
36503
- if (channel.enablePoint && channel.pointColor) {
36504
- pointList[j].setAttribute('style', pointStyle);
36505
- pointList[j - 1].setAttribute('style', pointStyle);
36506
- }
36507
- }
36508
- }
36509
- }
36510
- }
36511
- else {
36512
- hiddenCount++;
36513
- }
36514
- }
36515
- }
36516
- catch (e) {
36517
- console.log(e);
36518
- }
36519
- }
36520
36480
  getLineChart(chartWidth, chartHeight, data) {
36521
36481
  const chart = nv_d3["models"].lineChart().showLegend(true)
36522
36482
  .margin({ top: 0, bottom: 0, left: this.displayOption.marginLeft, right: this.displayOption.marginRight })
@@ -36532,12 +36492,6 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
36532
36492
  }
36533
36493
  this.renderCommonProperty(chart, chartWidth, chartHeight, data);
36534
36494
  this.renderOperationArea(chartWidth, chartHeight);
36535
- this.initPoint();
36536
- chart.legend.dispatch.on('legendClick', () => {
36537
- setTimeout(() => {
36538
- this.initPoint();
36539
- }, 1);
36540
- });
36541
36495
  return chart;
36542
36496
  }
36543
36497
  getMultiBarWithFocusChart(chartWidth, chartHeight, data) {
@@ -36581,11 +36535,6 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
36581
36535
  chart.tooltip.headerFormatter(d => this.timeFormat(d, '%x %X'));
36582
36536
  if (this.model.displaySetting.showAxis) {
36583
36537
  chart.xAxis.showMaxMin(true).tickFormat(d => {
36584
- clearTimeout(this.timer);
36585
- this.timer = undefined;
36586
- this.timer = setTimeout(() => {
36587
- this.initPoint();
36588
- }, 1);
36589
36538
  if (this.currentTimePeriod === 3 || this.currentTimePeriod === 4 || this.currentTimePeriod === 5) {
36590
36539
  return this.timeFormat(d, '%y-%m-%d');
36591
36540
  }
@@ -39364,9 +39313,6 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
39364
39313
  const viewIndex = this.model.viewIndex;
39365
39314
  if (null != viewIndex) {
39366
39315
  this.popupViewService.popView(viewIndex, this.hostContainerId, this.el).subscribe(() => this.recordViewOperation(), error => this.logger.error(`ToggleView(${viewIndex}) failed. ${error}`));
39367
- $(`#${this.hostContainerId} video`)
39368
- .addClass('video-hidden')
39369
- .css('visibility', 'hidden');
39370
39316
  }
39371
39317
  else {
39372
39318
  this.logger.error('[GUI]Toggle View:invalid view index');
@@ -39374,11 +39320,6 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
39374
39320
  }
39375
39321
  closeView() {
39376
39322
  this.popupViewService.closeView();
39377
- if ($(`#${this.hostContainerId} > svg > svg`).length === 0) {
39378
- $(`#${this.hostContainerId} .video-hidden`)
39379
- .removeClass('video-hidden')
39380
- .css('visibility', 'visible');
39381
- }
39382
39323
  this.recordViewOperation();
39383
39324
  }
39384
39325
  moveView(movementX, movementY) {
@@ -39525,7 +39466,6 @@ class video_element_VideoElement extends conditional_display_element_Conditional
39525
39466
  this.guiSize = guiSize;
39526
39467
  this.svgRootClass = svgRootClass;
39527
39468
  this.videoId = '';
39528
- this.isFullscreen = false;
39529
39469
  this.isMobileMode = _tmp_settings["a" /* DisplayMode */].Mobile === injector.get(_tmp_settings["b" /* GlobalSettings */]).displayMode;
39530
39470
  this.localization = injector.get(_tmp_localization["b" /* LOCALIZATION */]);
39531
39471
  this.init();
@@ -39561,79 +39501,60 @@ class video_element_VideoElement extends conditional_display_element_Conditional
39561
39501
  return;
39562
39502
  }
39563
39503
  this.videoId = guid["a" /* Guid */].newGuid().toString('n');
39564
- this.rootElement.append('rect').attr('id', 'rect' + this.videoId).attr('fill', 'transparent')
39565
- .attr('width', this.model.size.width)
39566
- .attr('height', this.model.size.height);
39567
39504
  this.videoService.getVideoUrl(this.model.videoTag).then(result => {
39568
- this.videoUrl = result.url;
39569
- this.initVideo(result.url, this.videoId);
39570
- }).catch(() => {
39571
- throw new Error('Failure of the videoService');
39572
- });
39573
- }
39574
- initVideo(videoUrl, videoId) {
39575
- const patt = /https:.+.m3u8/;
39576
- if (videoUrl.indexOf('http:') !== -1) {
39577
- videoUrl = videoUrl.replace('http:', 'https:');
39578
- }
39579
- if (!patt.test(videoUrl)) {
39580
- let videoToolTip = this.localization.invalidVideoAddress;
39581
- if (Object(lodash["isNil"])(videoUrl) || videoUrl === '') {
39582
- videoToolTip = this.localization.unconfiguredVideoAddress;
39505
+ this.isMobileType = result.isMobileType;
39506
+ const isAndroid = !!navigator.userAgent.match(/(Android)/i);
39507
+ let videoUrl = result.url;
39508
+ const patt = /https:.+.m3u8/;
39509
+ if (videoUrl.indexOf('http:') !== -1) {
39510
+ videoUrl = videoUrl.replace('http:', 'https:');
39511
+ }
39512
+ if (!patt.test(videoUrl)) {
39513
+ let videoToolTip = this.localization.invalidVideoAddress;
39514
+ if (Object(lodash["isNil"])(videoUrl) || videoUrl === '') {
39515
+ videoToolTip = this.localization.unconfiguredVideoAddress;
39516
+ }
39517
+ this.addVideoAddressToolTip(videoToolTip);
39518
+ return;
39583
39519
  }
39584
- this.addVideoAddressToolTip(videoToolTip);
39585
- return;
39586
- }
39587
- const isAndroid = !!navigator.userAgent.match(/(Android)/i);
39588
- const isIos = !!navigator.userAgent.match(/(Mac)/i);
39589
- const currentRect = this.$element.find('rect#rect' + videoId).first();
39590
- if (!currentRect.length) {
39591
- return;
39592
- }
39593
- const clientRect = currentRect[0].getBoundingClientRect();
39594
- const chartWidth = clientRect.width;
39595
- const chartHeight = clientRect.height;
39596
- const left = this.model.location.x / this.guiSize.width * $('.' + this.svgRootClass).find('.svg-content').width();
39597
- const top = this.model.location.y / this.guiSize.height * $('.' + this.svgRootClass).find('.svg-content').height();
39598
- const scareX = this.model.location.x / this.guiSize.width;
39599
- const scareY = this.model.location.y / this.guiSize.height;
39600
- if (isIos) {
39601
- videoUrl = videoUrl + '#t=1';
39602
- }
39603
- const preload = isIos ? ' preload=\'metadata\'' : '';
39604
- let videoHtml = `<video scareX="${scareX}"
39605
- scareY="${scareY}" id="${videoId}" ${preload} src="${videoUrl}" width="${chartWidth}" height="${chartHeight}"
39606
- style="position: absolute;top:${top}px;left:${left}px;object-fit:fill;z-index:0;"
39607
- playsInline webkit-playsinline `;
39608
- if (this.isMobileMode) {
39609
- if (isAndroid) {
39610
- videoHtml += ' autoplay muted></video>';
39520
+ const video = this.rootElement.append('foreignObject')
39521
+ .attr('x', 0)
39522
+ .attr('y', 0)
39523
+ .attr('width', this.model.size.width)
39524
+ .attr('height', this.model.size.height)
39525
+ .append('xhtml:video')
39526
+ .attr('id', this.videoId)
39527
+ .attr('class', 'element-video')
39528
+ .attr('scareX', this.model.location.x / this.guiSize.width)
39529
+ .attr('scareY', this.model.location.y / this.guiSize.height)
39530
+ .attr('src', videoUrl)
39531
+ .style('width', '100%')
39532
+ .style('height', '100%')
39533
+ .style('object-fit', 'fill')
39534
+ .attr('playsInline', true)
39535
+ .attr('webkit-playsinline', true)
39536
+ .attr('controls', true)
39537
+ .attr('muted', true);
39538
+ if (this.isMobileMode) {
39539
+ if (isAndroid) {
39540
+ video.attr('autoplay', true);
39541
+ }
39611
39542
  }
39612
39543
  else {
39613
- videoHtml += ' controls muted></video>';
39544
+ video.attr('autoplay', true);
39614
39545
  }
39615
- }
39616
- else {
39617
- videoHtml += ' controls autoplay muted></video>';
39618
- }
39619
- $('.' + this.svgRootClass).find('.svg-content').append(videoHtml);
39620
- if (this.isShow === false) {
39621
- $('#' + this.videoId).hide();
39622
- }
39623
- setTimeout(() => {
39624
- if (isAndroid) {
39625
- this.setAndroidVideo(videoId);
39546
+ if (this.isShow === false) {
39547
+ $('#' + this.videoId).hide();
39626
39548
  }
39627
- else if (isIos) {
39628
- this.setIosVideo(this.videoUrl, videoId);
39549
+ this.videoPlayer = new EZUIPlayer(this.videoId);
39550
+ if (isAndroid) {
39551
+ setTimeout(() => {
39552
+ this.setAndroidVideo();
39553
+ }, 500);
39629
39554
  }
39630
- this.videoPlayer = new EZUIPlayer(videoId);
39631
- }, 1000);
39632
- const style = document.createElement('style');
39633
- style.innerHTML = `#${videoId}::-webkit-media-controls-enclosure {
39634
- display: none;
39635
- }`;
39636
- document.head.append();
39555
+ }).catch(() => {
39556
+ throw new Error('Failure of the videoService');
39557
+ });
39637
39558
  }
39638
39559
  addVideoAddressToolTip(videoToolTip) {
39639
39560
  const size = this.model.size;
@@ -39655,71 +39576,53 @@ class video_element_VideoElement extends conditional_display_element_Conditional
39655
39576
  const textElement = new text_element_TextElementModal(videoToolTip, font, size.width, size.height);
39656
39577
  this.$element.append(textElement.Element);
39657
39578
  }
39658
- setAndroidVideo(videoId) {
39659
- const videoElement = $('#' + videoId);
39660
- let preHeight = videoElement.height();
39661
- let preWidth = videoElement.width();
39662
- let preTop = videoElement.css('top');
39663
- let preLeft = videoElement.css('left');
39579
+ setAndroidVideo() {
39664
39580
  const { StatusBar } = window;
39665
- videoElement.on('click', () => {
39666
- if (!this.isFullscreen) {
39667
- if (StatusBar) {
39668
- StatusBar.hide();
39669
- }
39670
- preHeight = videoElement.height();
39671
- preWidth = videoElement.width();
39672
- preTop = videoElement.css('top');
39673
- preLeft = videoElement.css('left');
39674
- const width = document.documentElement.clientWidth;
39675
- const height = document.documentElement.clientHeight;
39676
- videoElement.css('object-fit', 'contain');
39677
- videoElement.css('background', '#000000');
39678
- videoElement.css('width', width + 'px');
39679
- videoElement.css('height', height + 'px');
39680
- videoElement.css('left', '0px');
39681
- videoElement.css('top', '0px');
39682
- videoElement.css('z-index', '99');
39683
- videoElement.css('position', 'fixed');
39684
- this.isFullscreen = true;
39685
- try {
39686
- screen.orientation.lock(screen.orientation.type);
39687
- }
39688
- catch (error) {
39689
- console.error(error);
39690
- }
39581
+ this.bindFullscreenEvent();
39582
+ window.addEventListener('orientationchange', () => {
39583
+ StatusBar.show();
39584
+ this.hide();
39585
+ clearTimeout(this.refreshTimer);
39586
+ this.refreshTimer = null;
39587
+ this.refreshTimer = setTimeout(() => {
39588
+ this.init();
39589
+ this.show();
39590
+ }, 1000);
39591
+ });
39592
+ }
39593
+ bindFullscreenEvent() {
39594
+ const that = this;
39595
+ const { StatusBar } = window;
39596
+ $('#' + this.videoId).bind('webkitfullscreenchange', () => {
39597
+ if (document.webkitIsFullScreen) {
39598
+ $('#' + that.videoId).css({
39599
+ 'object-fit': 'contain',
39600
+ 'z-index': 99
39601
+ });
39602
+ StatusBar.hide();
39691
39603
  }
39692
39604
  else {
39693
- videoElement.css('object-fit', 'fill');
39694
- videoElement.css('width', preWidth + 'px');
39695
- videoElement.css('height', preHeight + 'px');
39696
- videoElement.css('left', preLeft);
39697
- videoElement.css('top', preTop);
39698
- videoElement.css('z-index', '0');
39699
- videoElement.css('position', 'absolute');
39700
- this.isFullscreen = false;
39701
- try {
39702
- if (screen.orientation.type.includes('portrait')) {
39703
- StatusBar.show();
39704
- }
39605
+ StatusBar.show();
39606
+ if (that.isMobileType) {
39607
+ $('#' + this.videoId).css('object-fit', document.webkitIsFullScreen ? 'contain' : 'fill');
39705
39608
  }
39706
- catch (error) {
39707
- console.error(error);
39609
+ else {
39610
+ clearTimeout(this.resetTimer);
39611
+ this.resetTimer = null;
39612
+ $('#' + this.videoId).css('display', 'none');
39613
+ this.resetTimer = setTimeout(() => {
39614
+ $('#' + this.videoId).css({
39615
+ 'width': '100%',
39616
+ 'height': '100%',
39617
+ 'display': 'block',
39618
+ 'z-index': 0,
39619
+ 'object-fit': document.webkitIsFullScreen ? 'contain' : 'fill'
39620
+ });
39621
+ }, 1000);
39708
39622
  }
39709
39623
  }
39710
39624
  });
39711
39625
  }
39712
- setIosVideo(videoUrl, videoId) {
39713
- const video = $('#' + this.videoId);
39714
- video.on('webkitendfullscreen', () => {
39715
- video.remove();
39716
- clearTimeout(this.refreshTimer);
39717
- this.refreshTimer = null;
39718
- this.refreshTimer = setTimeout(() => {
39719
- this.initVideo(videoUrl, videoId);
39720
- }, 500);
39721
- });
39722
- }
39723
39626
  }
39724
39627
 
39725
39628
  // CONCATENATED MODULE: ./.tmp/elements/weather/weater-element.ts
@@ -41766,24 +41669,13 @@ let WriteValueModalComponent = class WriteValueModalComponent {
41766
41669
  value = this.formatWriteValue();
41767
41670
  }
41768
41671
  }
41769
- if (!this.args.releasedVariableService) {
41770
- this.onClosed({
41771
- value: value,
41772
- showValue: showValue,
41773
- enableNumericalOperation: false,
41774
- isNumericalOperation: this.isNumericalOperation,
41775
- variableRwType: 6
41776
- });
41777
- return;
41778
- }
41779
41672
  this.args.releasedVariableService.getVariableWithValueTransform(this.variableName).subscribe(result => {
41780
41673
  const valueTransform = JSON.parse(result.valueTransform);
41781
- if (valueTransform.Type !== 0) {
41674
+ if ((valueTransform === null || valueTransform === void 0 ? void 0 : valueTransform.Type) !== 0) {
41782
41675
  this.isNumericalOperation = true;
41783
41676
  }
41784
41677
  this.onClosed({
41785
- value: value,
41786
- showValue: showValue,
41678
+ value, showValue,
41787
41679
  enableNumericalOperation: this.enableNumericalOperation,
41788
41680
  isNumericalOperation: this.isNumericalOperation,
41789
41681
  variableRwType: result.variableRwType