hqchart 1.1.13492 → 1.1.13502

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.
@@ -2753,6 +2753,9 @@ var JSCHART_MENU_ID=
2753
2753
  CMD_CHANGE_LANGUAGE_ID:37, //语言切换
2754
2754
 
2755
2755
  CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID:38,
2756
+
2757
+
2758
+ CMD_REPORT_CHANGE_BLOCK_ID:60, //报价列表 切换板块ID
2756
2759
  }
2757
2760
 
2758
2761
 
@@ -9862,7 +9865,7 @@ function IsRecvOverlap(rect1, rect2)
9862
9865
  return Math.max(rect1.Left,rect2.Left) < Math.min(rect1.Right,rect2.Right) && Math.max(rect1.Top,rect2.Top) < Math.min(rect1.Bottom,rect2.Bottom);
9863
9866
  }
9864
9867
 
9865
- function CopyMerginConfig(dest,src)
9868
+ function CopyMarginConfig(dest,src)
9866
9869
  {
9867
9870
  if (!src || !dest) return;
9868
9871
 
@@ -9872,6 +9875,9 @@ function CopyMerginConfig(dest,src)
9872
9875
  if (IFrameSplitOperator.IsNumber(src.Bottom)) dest.Bottom=src.Bottom;
9873
9876
  }
9874
9877
 
9878
+ //兼容老版本
9879
+ function CopyMerginConfig(dest,src) { CopyMarginConfig(dest,src); }
9880
+
9875
9881
 
9876
9882
  function Point()
9877
9883
  {
@@ -49109,6 +49115,9 @@ function ChartCorssCursor()
49109
49115
  Icon:g_JSChartResource.CorssCursor.RightButton.Icon
49110
49116
  };
49111
49117
 
49118
+ this.RightMargin={ Left:2, Right:2, Top:4, Bottom:3 };
49119
+ CopyMarginConfig(this.RightMargin, g_JSChartResource.CorssCursor.RightMargin);
49120
+
49112
49121
  //内部使用
49113
49122
  this.Close=null; //收盘价格
49114
49123
  this.Status=0; //当前状态 0=隐藏 1=显示
@@ -49476,6 +49485,7 @@ function ChartCorssCursor()
49476
49485
  var text=this.StringFormatY.Text;
49477
49486
  this.Canvas.font=this.Font;
49478
49487
  var textWidth=this.Canvas.measureText(text).width+4; //前后各空2个像素
49488
+ var textSize={ Width:textWidth, Height:this.TextHeight, Text:[] };
49479
49489
  var buttonData={Y:y, YValue:yValue, FrameID:yValueExtend.FrameID };
49480
49490
  if (this.Frame.ChartBorder.Left>=30 && this.ShowTextMode.Left==1)
49481
49491
  {
@@ -49505,38 +49515,37 @@ function ChartCorssCursor()
49505
49515
  this.Canvas.fillText(text,left+2,y,textWidth);
49506
49516
  }
49507
49517
 
49518
+ var complexText=
49519
+ {
49520
+ ShowType:0, //0=单行(默认) 1=多行
49521
+ Font:this.Font, Color:this.TextColor,
49522
+ Text:[ { Text:text, Margin:this.RightMargin } ],
49523
+ };
49524
+
49525
+ var yTop=y-this.TextHeight/2;
49526
+
49508
49527
  if (this.StringFormatY.PercentageText)
49509
49528
  {
49510
49529
  if (this.TextFormat.Right==0)
49511
49530
  {
49512
49531
  text=this.StringFormatY.PercentageText+'%';
49513
- textWidth=this.Canvas.measureText(text).width+4; //前后各空2个像素
49532
+ complexText.Text[0].Text=text;
49514
49533
  }
49515
49534
  }
49516
49535
 
49517
49536
  if (this.StringFormatY.RText)
49518
49537
  {
49519
49538
  text=this.StringFormatY.RText;
49520
- var textWidth=this.Canvas.measureText(text).width+4; //前后各空2个像素
49539
+ complexText.Text[0].Text=text;
49521
49540
  }
49522
49541
 
49523
- var complexText=null;
49524
49542
  if (this.StringFormatY.RComplexText && IFrameSplitOperator.IsNonEmptyArray(this.StringFormatY.RComplexText.Text))
49525
49543
  {
49526
- var textWidth=0;
49527
49544
  complexText=this.StringFormatY.RComplexText;
49528
- for(var i=0; i<complexText.Text.length; ++i)
49529
- {
49530
- var item=complexText.Text[i];
49531
- var itemWidth=this.Canvas.measureText(item.Text).width+4; //前后各空2个像素
49532
-
49533
- if (i>0 && IFrameSplitOperator.IsNumber(complexText.Space))
49534
- textWidth+=complexText.Space;
49535
-
49536
- textWidth+=itemWidth;
49537
- }
49538
49545
  }
49539
49546
 
49547
+ this.CalculateComplexTextSize(complexText, textSize);
49548
+
49540
49549
  if (this.Frame.ChartBorder.Right>=30 && this.ShowTextMode.Right==1)
49541
49550
  {
49542
49551
  var isOverlayIndex=false; //是否有叠加子坐标
@@ -49545,66 +49554,52 @@ function ChartCorssCursor()
49545
49554
  {
49546
49555
  var frame=this.Frame.SubFrame[yValueExtend.FrameID];
49547
49556
  isOverlayIndex=frame.OverlayIndex.length>0;
49548
- overlayIndexInterval=frame.Interval;
49557
+ overlayIndexInterval=null
49558
+ if (isOverlayIndex)
49559
+ {
49560
+ for(var i=0;i<=frame.OverlayIndex.length;++i)
49561
+ {
49562
+ var item=frame.OverlayIndex[i];
49563
+ if (item.Frame.IsShow===false) continue;
49564
+ if (!item.Frame.GetXHorizontal) continue;
49565
+
49566
+ var overlayLeft=item.Frame.GetXHorizontal();
49567
+ overlayIndexInterval=overlayLeft-right;
49568
+ break;
49569
+ }
49570
+ }
49549
49571
  }
49550
49572
 
49551
- if (isOverlayIndex && textWidth>overlayIndexInterval) //大于子坐标宽度
49573
+ //叠加坐标
49574
+ if (isOverlayIndex && textSize.Width>overlayIndexInterval && overlayIndexInterval>0) //大于子坐标宽度
49552
49575
  {
49553
49576
  var drawRight=right+overlayIndexInterval;
49554
49577
  if (drawRight>chartRight) drawRight=chartRight;
49555
49578
 
49556
- var itemLeft=drawRight-2-textWidth;
49557
- this.DrawTextBGRect(itemLeft,y-this.TextHeight/2,textWidth,this.TextHeight);
49558
- if (complexText)
49559
- {
49560
- this.DrawComplexText(itemLeft,y,complexText);
49561
- }
49562
- else
49563
- {
49564
- this.Canvas.textAlign="right";
49565
- this.Canvas.textBaseline="middle";
49566
- this.Canvas.fillStyle=this.TextColor;
49567
- this.Canvas.fillText(text,drawRight-4,y,textWidth);
49568
- }
49579
+ var itemLeft=drawRight-2-textSize.Width;
49580
+ this.DrawTextBGRect(itemLeft,yTop,textSize.Width,textSize.Height);
49581
+ this.DrawComplexTextV2(itemLeft, yTop, complexText, textSize);
49582
+
49583
+ if (this.RightButton.Enable) this.DrawRightButton(yTop, itemLeft,this.TextHeight,this.TextHeight,buttonData);
49569
49584
  }
49570
- else if (rightWidth<textWidth) //右边空白显示不下,
49585
+ else if (rightWidth<textSize.Width) //右边空白显示不下,
49571
49586
  {
49572
- var itemLeft=chartRight-2-textWidth;
49573
- this.DrawTextBGRect(itemLeft,y-this.TextHeight/2,textWidth,this.TextHeight);
49574
- if (complexText)
49575
- {
49576
- this.DrawComplexText(itemLeft,y,complexText);
49577
- }
49578
- else
49579
- {
49580
- this.Canvas.textAlign="right";
49581
- this.Canvas.textBaseline="middle";
49582
- this.Canvas.fillStyle=this.TextColor;
49583
- this.Canvas.fillText(text,chartRight-4,y,textWidth);
49584
- }
49585
-
49586
- if (this.RightButton.Enable) this.DrawRightButton(y-this.TextHeight/2, chartRight-2-textWidth,this.TextHeight,this.TextHeight,buttonData);
49587
+ var itemLeft=chartRight-2-textSize.Width;
49588
+ this.DrawTextBGRect(itemLeft,yTop,textSize.Width,textSize.Height);
49589
+ this.DrawComplexTextV2(itemLeft, yTop ,complexText, textSize);
49590
+
49591
+ if (this.RightButton.Enable) this.DrawRightButton(yTop, chartRight-2-textSize.Width,this.TextHeight,this.TextHeight,buttonData);
49587
49592
  }
49588
49593
  else
49589
49594
  {
49590
49595
  var itemLeft=right+2;
49591
- this.DrawTextBGRect(itemLeft,y-this.TextHeight/2,textWidth,this.TextHeight);
49596
+ this.DrawTextBGRect(itemLeft,yTop,textSize.Width,textSize.Height);
49597
+ this.DrawComplexTextV2(itemLeft,yTop,complexText,textSize);
49592
49598
 
49593
- if (complexText)
49594
- {
49595
- this.DrawComplexText(itemLeft,y,complexText);
49596
- }
49597
- else
49598
- {
49599
- this.Canvas.textAlign="left";
49600
- this.Canvas.textBaseline="middle";
49601
- this.Canvas.fillStyle=this.TextColor;
49602
- this.Canvas.fillText(text,right+4,y,textWidth);
49603
- }
49604
-
49605
- if (this.RightButton.Enable) this.DrawRightButton(y-this.TextHeight/2, right+2,this.TextHeight,this.TextHeight,buttonData);
49599
+ if (this.RightButton.Enable) this.DrawRightButton(yTop, right+2,this.TextHeight,this.TextHeight,buttonData);
49606
49600
  }
49607
49601
 
49602
+ /*
49608
49603
  if (this.StringFormatY.RExtendText && this.StringFormatY.RExtendText.length>0)
49609
49604
  {
49610
49605
  var yOffset=0;
@@ -49636,26 +49631,16 @@ function ChartCorssCursor()
49636
49631
  yOffset+=this.TextHeight;
49637
49632
  }
49638
49633
  }
49634
+ */
49639
49635
  }
49640
49636
  else if (this.ShowTextMode.Right==2)
49641
49637
  {
49642
49638
  this.Canvas.fillStyle=this.TextBGColor;
49643
- var showLeft=right-textWidth;
49644
- this.DrawTextBGRect(showLeft,y-this.TextHeight/2,textWidth,this.TextHeight);
49645
-
49646
- if (complexText)
49647
- {
49648
- this.DrawComplexText(showLeft,y,complexText);
49649
- }
49650
- else
49651
- {
49652
- this.Canvas.textAlign="left";
49653
- this.Canvas.textBaseline="middle";
49654
- this.Canvas.fillStyle=this.TextColor;
49655
- this.Canvas.fillText(text,showLeft+2,y,textWidth);
49656
- }
49639
+ var showLeft=right-textSize.Width;
49640
+ this.DrawTextBGRect(showLeft,yTop,textSize.Width,textSize.Height);
49641
+ this.DrawComplexTextV2(showLeft,yTop,complexText,textSize);
49657
49642
 
49658
- if (this.RightButton.Enable) this.DrawRightButton(y-this.TextHeight/2, showLeft,this.TextHeight,this.TextHeight,buttonData);
49643
+ if (this.RightButton.Enable) this.DrawRightButton(yTop, showLeft,this.TextHeight,this.TextHeight,buttonData);
49659
49644
  }
49660
49645
  }
49661
49646
 
@@ -49775,6 +49760,137 @@ function ChartCorssCursor()
49775
49760
  }
49776
49761
  }
49777
49762
 
49763
+ this.DrawComplexTextV2=function(left, yTop, complexText, size)
49764
+ {
49765
+ this.Canvas.textAlign="left";
49766
+ this.Canvas.textBaseline="bottom";
49767
+ var showType=0;
49768
+ if (complexText.ShowType==1) showType=complexText.ShowType;
49769
+ if (showType==1) //多行
49770
+ {
49771
+ var xLeft=left;
49772
+ var yText=yTop; //顶
49773
+ for(var i=0; i<complexText.Text.length; ++i)
49774
+ {
49775
+ var item=complexText.Text[i];
49776
+ var itemSize=size.Text[i];
49777
+
49778
+ if (item.Font) this.Canvas.font=item.Font;
49779
+ else this.Canvas.font=complexText.Font;
49780
+
49781
+ if (item.Color) this.Canvas.fillStyle=item.Color;
49782
+ else this.Canvas.fillStyle=complexText.Color;
49783
+
49784
+ var y=yText+itemSize.Height;
49785
+ var x=xLeft;
49786
+ if (item.Margin)
49787
+ {
49788
+ var margin=item.Margin;
49789
+ if (IFrameSplitOperator.IsNumber(margin.Bottom)) y-=margin.Bottom;
49790
+ if (IFrameSplitOperator.IsNumber(margin.Left)) x+=margin.Left;
49791
+ }
49792
+
49793
+ this.Canvas.fillText(item.Text,x,y,itemSize.Width);
49794
+
49795
+ yText+=itemSize.Height;
49796
+ }
49797
+ }
49798
+ else //水平 单行
49799
+ {
49800
+ var xText=left;
49801
+ var yBottom=yTop+size.Height;
49802
+ for(var i=0; i<complexText.Text.length; ++i)
49803
+ {
49804
+ var item=complexText.Text[i];
49805
+ var itemSize=size.Text[i];
49806
+
49807
+ if (item.Font) this.Canvas.font=item.Font;
49808
+ else this.Canvas.font=complexText.Font;
49809
+
49810
+ if (item.Color) this.Canvas.fillStyle=item.Color;
49811
+ else this.Canvas.fillStyle=complexText.Color;
49812
+
49813
+ var y=yBottom;
49814
+ var x=xText;
49815
+ if (item.Margin)
49816
+ {
49817
+ var margin=item.Margin;
49818
+ if (IFrameSplitOperator.IsNumber(margin.Bottom)) y-=margin.Bottom;
49819
+ if (IFrameSplitOperator.IsNumber(margin.Left)) x+=margin.Left;
49820
+ }
49821
+
49822
+ this.Canvas.fillText(item.Text,x,y,itemSize.Width);
49823
+
49824
+ xText+=itemSize.Width;
49825
+ }
49826
+ }
49827
+ }
49828
+
49829
+ this.CalculateComplexTextSize=function(complexText, size)
49830
+ {
49831
+ if (!complexText || !IFrameSplitOperator.IsNonEmptyArray(complexText.Text)) return;
49832
+
49833
+ var showType=0;
49834
+ if (complexText.ShowType==1) showType=complexText.ShowType;
49835
+ if (showType==1) //多行
49836
+ {
49837
+ var textWidth=0, textHeight=0;
49838
+ for(var i=0; i<complexText.Text.length; ++i)
49839
+ {
49840
+ var item=complexText.Text[i];
49841
+ if (item.Font) this.Canvas.font=item.Font;
49842
+ else this.Canvas.font=complexText.Font;
49843
+ var itemWidth=this.Canvas.measureText(item.Text).width; //前后各空2个像素
49844
+ var itemHeight=this.Canvas.measureText("擎").width;
49845
+ if (item.Margin)
49846
+ {
49847
+ var margin=item.Margin;
49848
+ if (IFrameSplitOperator.IsNumber(margin.Left)) itemWidth+=margin.Left;
49849
+ if (IFrameSplitOperator.IsNumber(margin.Right)) itemWidth+=margin.Right;
49850
+ if (IFrameSplitOperator.IsNumber(margin.Top)) itemHeight+=margin.Top;
49851
+ if (IFrameSplitOperator.IsNumber(margin.Bottom)) itemHeight+=margin.Bottom;
49852
+ }
49853
+
49854
+ size.Text[i]={ Width:itemWidth, Height:itemHeight }; //保存所有文字的大小信息
49855
+
49856
+ if (textWidth<itemWidth) textWidth=itemWidth;
49857
+ textHeight+=itemHeight;
49858
+ }
49859
+
49860
+ size.Width=textWidth;
49861
+ size.Height=textHeight;
49862
+ }
49863
+ else //水平 单行
49864
+ {
49865
+ var textWidth=0, textHeight=0;
49866
+ for(var i=0; i<complexText.Text.length; ++i)
49867
+ {
49868
+ var item=complexText.Text[i];
49869
+ if (item.Font) this.Canvas.font=item.Font;
49870
+ else this.Canvas.font=complexText.Font;
49871
+
49872
+ var itemWidth=this.Canvas.measureText(item.Text).width; //前后各空2个像素
49873
+ var itemHeight=this.Canvas.measureText("擎").width;
49874
+ if (item.Margin)
49875
+ {
49876
+ var margin=item.Margin;
49877
+ if (IFrameSplitOperator.IsNumber(margin.Left)) itemWidth+=margin.Left;
49878
+ if (IFrameSplitOperator.IsNumber(margin.Right)) itemWidth+=margin.Right;
49879
+ if (IFrameSplitOperator.IsNumber(margin.Top)) itemHeight+=margin.Top;
49880
+ if (IFrameSplitOperator.IsNumber(margin.Bottom)) itemHeight+=margin.Bottom;
49881
+ }
49882
+
49883
+ size.Text[i]={ Width:itemWidth, Height:itemHeight }; //保存所有文字的大小信息
49884
+
49885
+ textWidth+=itemWidth;
49886
+ if (textHeight<itemHeight) textHeight=itemHeight;
49887
+ }
49888
+
49889
+ size.Width=textWidth;
49890
+ size.Height=textHeight;
49891
+ }
49892
+ }
49893
+
49778
49894
  this.DrawRightButton=function(drawTop, drawRight, drawWidth, drawHeight, data)
49779
49895
  {
49780
49896
  this.Canvas.fillStyle=this.RightButton.BGColor;
@@ -61578,7 +61694,7 @@ function ChartDrawMonitorLine()
61578
61694
  if (item.LineDash) dest.LineDash=item.LineDash;
61579
61695
  if (IFrameSplitOperator.IsNumber(item.LineSpace)) dest.LineSpace=item.LineSpace;
61580
61696
  if (IFrameSplitOperator.IsNumber(item.TextAlign)) dest.TextAlign=item.TextAlign;
61581
- if (item.Mergin) CopyMerginConfig(dest.Mergin, item.Mergin);
61697
+ if (item.Mergin) CopyMarginConfig(dest.Mergin, item.Mergin);
61582
61698
  }
61583
61699
 
61584
61700
  if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
@@ -65579,7 +65695,7 @@ function ChartInfoLine()
65579
65695
  if (item.BGColor) dest.BGColor=item.BGColor;
65580
65696
  if (IFrameSplitOperator.IsNumber(item.LineSpace)) dest.LineSpace=item.LineSpace;
65581
65697
  if (IFrameSplitOperator.IsNumber(item.TextAlign)) dest.TextAlign=item.TextAlign;
65582
- if (item.Mergin) CopyMerginConfig(dest.Mergin, item.Mergin);
65698
+ if (item.Mergin) CopyMarginConfig(dest.Mergin, item.Mergin);
65583
65699
  }
65584
65700
 
65585
65701
  if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
@@ -66239,7 +66355,9 @@ function JSChartResource()
66239
66355
  BGColor:'rgb(43,54,69)',
66240
66356
  PenColor:'rgb(255,255,255)',
66241
66357
  Icon: { Text:'\ue6a3', Color:'rgb(255,255,255)', Family:"iconfont", Size:18 }
66242
- }
66358
+ },
66359
+
66360
+ RightMargin: { Left:2, Right:2, Top:5, Bottom:3 }
66243
66361
  };
66244
66362
 
66245
66363
  this.LockBGColor = "rgb(220, 220, 220)"; //指标锁区域颜色
@@ -61,6 +61,8 @@ function JSReportChart(divElement)
61
61
  this.JSChartContainer=chart;
62
62
  this.DivElement.JSChart=this; //div中保存一份
63
63
 
64
+ if (option.EnablePopMenuV2===true) chart.InitalPopMenu();
65
+
64
66
  if (option.Symbol) chart.Symbol=option.Symbol;
65
67
  if (option.Name) chart.Name=option.Name;
66
68
 
@@ -343,6 +345,9 @@ function JSReportChartContainer(uielement)
343
345
 
344
346
  this.IsDestroy=false; //是否已经销毁了
345
347
 
348
+ this.JSPopMenu; //内置菜单
349
+ this.IsShowRightMenu=true;
350
+
346
351
  this.ChartDestory=function() //销毁
347
352
  {
348
353
  this.IsDestroy=true;
@@ -360,6 +365,14 @@ function JSReportChartContainer(uielement)
360
365
  }
361
366
  }
362
367
 
368
+ this.InitalPopMenu=function() //初始化弹出窗口
369
+ {
370
+ if (this.JSPopMenu) return;
371
+
372
+ this.JSPopMenu=new JSPopMenu(); //内置菜单
373
+ this.JSPopMenu.Inital();
374
+ }
375
+
363
376
  this.AutoScrollPage=function(step)
364
377
  {
365
378
  this.AutoDragScrollTimer=setTimeout(() =>
@@ -1557,6 +1570,18 @@ function JSReportChartContainer(uielement)
1557
1570
 
1558
1571
  //去掉右键菜单
1559
1572
  this.UIOnContextMenu=function(e)
1573
+ {
1574
+ if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
1575
+
1576
+ if (!this.IsShowRightMenu) return;
1577
+
1578
+ var x = e.clientX-this.UIElement.getBoundingClientRect().left;
1579
+ var y = e.clientY-this.UIElement.getBoundingClientRect().top;
1580
+
1581
+ if(typeof(this.OnRightMenu)=='function') this.OnRightMenu(x,y,e); //右键菜单事件
1582
+ }
1583
+
1584
+ this.OnRightMenu=function(x,y,e)
1560
1585
  {
1561
1586
  e.preventDefault();
1562
1587
  }
@@ -2682,6 +2707,52 @@ function JSReportChartContainer(uielement)
2682
2707
  }
2683
2708
  }
2684
2709
 
2710
+ this.GetTabPopMenu=function(tabItem)
2711
+ {
2712
+ var aryMenu=[ ];
2713
+
2714
+ if (IFrameSplitOperator.IsNonEmptyArray(tabItem.ArySubMenu))
2715
+ {
2716
+ for(var i=0;i<tabItem.ArySubMenu.length;++i)
2717
+ {
2718
+ var item=tabItem.ArySubMenu[i];
2719
+ var menuItem={ Name:item.Title, Data:{ ID:item.CommandID, Args:[item.ID]} };
2720
+
2721
+ aryMenu.push(menuItem);
2722
+ }
2723
+ }
2724
+
2725
+
2726
+ return aryMenu;
2727
+ }
2728
+
2729
+ this.PopupTabMenu=function(menuData, tab, e)
2730
+ {
2731
+ if (!this.JSPopMenu) return;
2732
+
2733
+ var rtTab=tab.Rect;
2734
+ var pixelRatio=GetDevicePixelRatio();
2735
+ var rtCell={ Left:rtTab.Left/pixelRatio, Right:rtTab.Right/pixelRatio, Bottom:rtTab.Bottom/pixelRatio, Top:rtTab.Top/pixelRatio };
2736
+ rtCell.Width=rtCell.Right-rtCell.Left;
2737
+ rtCell.Height=rtCell.Bottom-rtCell.Top;
2738
+
2739
+ var rtClient=this.UIElement.getBoundingClientRect();
2740
+ var rtScroll=GetScrollPosition();
2741
+
2742
+ var offsetLeft=rtClient.left+rtScroll.Left;
2743
+ var offsetTop=rtClient.top+rtScroll.Top;
2744
+ rtCell.Left+=offsetLeft;
2745
+ rtCell.Right+=offsetLeft;
2746
+ rtCell.Top+=offsetTop;
2747
+ rtCell.Bottom+=offsetTop;
2748
+
2749
+ this.JSPopMenu.CreatePopMenu(menuData);
2750
+ this.JSPopMenu.PopupMenuByTab(rtCell);
2751
+
2752
+ if(e.preventDefault) e.preventDefault();
2753
+ if(e.stopPropagation) e.stopPropagation();
2754
+ }
2755
+
2685
2756
  //点击标签
2686
2757
  this.OnClickTab=function(tabData, e)
2687
2758
  {
@@ -2695,36 +2766,80 @@ function JSReportChartContainer(uielement)
2695
2766
 
2696
2767
  if (tabData.Tab.IsMenu)
2697
2768
  {
2769
+ var menuData={ Menu:this.GetTabPopMenu(tabData.Tab), Position:JSPopMenu.POSITION_ID.TAB_MENU_ID };
2770
+ menuData.ClickCallback=(data)=>{ this.OnClickTabPopMenu(tabData, data); }
2771
+
2698
2772
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_REPORT_TABMENU);
2699
2773
  if (event && event.Callback)
2700
2774
  {
2701
- redraw=true;
2702
- var rtItem=tabData.Rect;
2703
- var rtDOM={ Left: rtItem.Left/pixelTatio, Right:rtItem.Right/pixelTatio, Top:rtItem.Top/pixelTatio, Bottom:rtItem.Bottom/pixelTatio };
2704
-
2705
- var sendData={ Data:tabData, IsSide:{X:x, Y:x}, UIElement:uiElement, Rect:rtDOM, e:e , Redraw:redraw };
2775
+ var sendData={ MenuData:menuData, Tab:tabData, PreventDefault:false, e:e };
2706
2776
  event.Callback(event, sendData, this);
2707
- if (IFrameSplitOperator.IsBool(sendData.Redraw)) redraw=sendData.Redraw;
2777
+ if (sendData.PreventDefault==true) return;
2708
2778
  }
2709
2779
 
2710
- this.SetSelectedTab(tabData.Index); //选中tab
2780
+ this.PopupTabMenu(menuData, tabData.Tab, e);
2711
2781
  }
2712
2782
  else
2713
2783
  {
2714
2784
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_REPORT_TAB);
2715
2785
  if (event && event.Callback)
2716
2786
  {
2717
- var sendData={ Data:tabData, IsSide:{X:x, Y:x}, UIElement:uiElement, e:e , Redraw:redraw };
2787
+ var sendData={ Data:tabData, IsSide:{X:x, Y:x}, UIElement:uiElement, e:e , Redraw:redraw, PreventDefault:false };
2718
2788
  event.Callback(event, sendData, this);
2719
2789
  if (IFrameSplitOperator.IsBool(sendData.Redraw)) redraw=sendData.Redraw;
2790
+ if (sendData.PreventDefault==true) return;
2720
2791
  }
2721
2792
 
2722
- this.SetSelectedTab(tabData.Index);
2793
+ if (tabData.Tab.CommandID==JSCHART_MENU_ID.CMD_REPORT_CHANGE_BLOCK_ID)
2794
+ {
2795
+ this.ExecuteMenuCommand(tabData.Tab.CommandID, [tabData.Tab.ID]);
2796
+ this.SetSelectedTab(tabData.Index);
2797
+ }
2723
2798
  }
2724
2799
 
2725
2800
  if (redraw) this.Draw();
2726
2801
  }
2727
2802
 
2803
+ this.OnClickTabPopMenu=function(tabData, data)
2804
+ {
2805
+ JSConsole.Chart.Log('[JSReportChartContainer::OnClickTabPopMenu] ',tabData, data);
2806
+
2807
+ var cmdID=data.Data.ID; //命令ID
2808
+ var aryArgs=data.Data.Args; //参数
2809
+
2810
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MENU_COMMAND); //回调通知外部
2811
+ if (event && event.Callback)
2812
+ {
2813
+ var data={ PreventDefault:false, CommandID:cmdID, Args:aryArgs, SrcData:data, TabData:tabData };
2814
+ event.Callback(event,data,this);
2815
+ if (data.PreventDefault) return;
2816
+ }
2817
+
2818
+ this.ExecuteMenuCommand(cmdID,aryArgs);
2819
+
2820
+ this.SetSelectedTab(tabData.Index);
2821
+ this.Draw();
2822
+ }
2823
+
2824
+ this.ExecuteMenuCommand=function(cmdID, aryArgs)
2825
+ {
2826
+ JSConsole.Chart.Log('[JSReportChartContainer::ExecuteMenuCommand] cmdID=, aryArgs=', cmdID,aryArgs);
2827
+
2828
+ var param=null, srcParam=null; //原始值
2829
+ if (IFrameSplitOperator.IsNonEmptyArray(aryArgs))
2830
+ {
2831
+ srcParam=aryArgs[0];
2832
+ if (IFrameSplitOperator.IsNumber(aryArgs[0])) param=aryArgs[0];
2833
+ }
2834
+
2835
+ switch(cmdID)
2836
+ {
2837
+ case JSCHART_MENU_ID.CMD_REPORT_CHANGE_BLOCK_ID:
2838
+ if (srcParam) this.ChangeSymbol(param);
2839
+ break;
2840
+ }
2841
+ }
2842
+
2728
2843
  this.SwapColumn=function(leftIndex, rightIndex, option)
2729
2844
  {
2730
2845
  var reportChart=this.GetReportChart();
@@ -3640,6 +3755,14 @@ function ChartReport()
3640
3755
  return null;
3641
3756
  }
3642
3757
 
3758
+ this.ClipClient=function()
3759
+ {
3760
+ this.Canvas.save();
3761
+ this.Canvas.beginPath();
3762
+ this.Canvas.rect(this.RectClient.Left,this.RectClient.Top,(this.RectClient.Right-this.RectClient.Left),(this.RectClient.Bottom-this.RectClient.Top));
3763
+ //this.Canvas.stroke(); //调试用
3764
+ this.Canvas.clip();
3765
+ }
3643
3766
 
3644
3767
  this.Draw=function()
3645
3768
  {
@@ -3651,12 +3774,7 @@ function ChartReport()
3651
3774
  if (this.SizeChange) this.CalculateSize();
3652
3775
  else this.UpdateCacheData();
3653
3776
 
3654
- this.Canvas.save();
3655
-
3656
- this.Canvas.beginPath();
3657
- this.Canvas.rect(this.RectClient.Left,this.RectClient.Top,(this.RectClient.Right-this.RectClient.Left),(this.RectClient.Bottom-this.RectClient.Top));
3658
- //this.Canvas.stroke(); //调试用
3659
- this.Canvas.clip();
3777
+ this.ClipClient();
3660
3778
 
3661
3779
  this.DrawHeader();
3662
3780
  this.DrawBody();
@@ -3669,7 +3787,9 @@ function ChartReport()
3669
3787
  this.Tab.DrawScrollbar(this.RectClient.Left,bottom-this.BottomToolbarHeight, this.RectClient.Right, bottom);
3670
3788
  }
3671
3789
 
3790
+ this.ClipClient();
3672
3791
  this.DrawBorder();
3792
+ this.Canvas.restore();
3673
3793
 
3674
3794
  this.DrawDragRow();
3675
3795
 
@@ -5800,7 +5920,7 @@ function ChartReportTab()
5800
5920
  this.IsShow=true; //是否显示
5801
5921
 
5802
5922
  //Tab
5803
- this.TabList=[]; //{ Title:标题, ID:, IsMenu: 是否菜单 }
5923
+ this.TabList=[]; //{ Title:标题, ID:, IsMenu: 是否菜单, ArySubMenu:[ { Title:, ID: }] }
5804
5924
  this.SelectedTabIndex=-1;
5805
5925
  this.MoveOnTabIndex=-1;
5806
5926
 
@@ -5869,7 +5989,7 @@ function ChartReportTab()
5869
5989
 
5870
5990
  var tabItem={ Title:item.Title, IsMenu:false, FixedSymbol:[], FixedRowCount:0 };
5871
5991
  if (item.ID) tabItem.ID=item.ID;
5872
- if (item.MenuID) tabItem.MenuID=item.MenuID;
5992
+ if (item.CommandID) tabItem.CommandID=item.CommandID;
5873
5993
  if (IFrameSplitOperator.IsBool(item.IsMenu)) tabItem.IsMenu=item.IsMenu;
5874
5994
  if (IFrameSplitOperator.IsNonEmptyArray(item.FixedSymbol))
5875
5995
  {
@@ -5881,6 +6001,10 @@ function ChartReportTab()
5881
6001
  ++tabItem.FixedRowCount;
5882
6002
  }
5883
6003
  }
6004
+
6005
+ if (IFrameSplitOperator.IsNonEmptyArray(item.ArySubMenu))
6006
+ tabItem.ArySubMenu=item.ArySubMenu.slice();
6007
+
5884
6008
  this.TabList.push(tabItem);
5885
6009
  }
5886
6010
  }