hqchart 1.1.13678 → 1.1.13682

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.
@@ -257,6 +257,7 @@ function JSKeyboardChartContainer(uielement)
257
257
 
258
258
  //拖拽滚动条
259
259
  this.DragYScroll=null; //{Start:{x,y}, End:{x, y}}
260
+
260
261
  this.IsDestroy=false; //是否已经销毁了
261
262
 
262
263
  this.ChartDestory=function() //销毁
@@ -297,6 +298,7 @@ function JSKeyboardChartContainer(uielement)
297
298
  this.Data.Data=aryExactQuery.concat(aryFuzzyQuery);
298
299
 
299
300
  this.ChartPaint[0].SelectedRow=0;
301
+ this.ChartPaint[0].SizeChange=true;
300
302
 
301
303
  JSConsole.Chart.Log(`[JSKeyboardChart:Search] search=${strSearch}, source=${this.SourceData.Data.length} match=${this.Data.Data.length}`);
302
304
 
@@ -373,6 +375,12 @@ function JSKeyboardChartContainer(uielement)
373
375
  chart.Data=this.Data;
374
376
  this.ChartPaint[0]=chart;
375
377
 
378
+ chart.VScrollbar=new ChartKeyboardVScrollbar();
379
+ chart.VScrollbar.Frame=this.Frame;
380
+ chart.VScrollbar.Canvas=this.Canvas;
381
+ chart.VScrollbar.ChartBorder=this.Frame.ChartBorder;
382
+ chart.VScrollbar.Report=chart;
383
+
376
384
  if (option)
377
385
  {
378
386
 
@@ -624,7 +632,7 @@ function JSKeyboardChartContainer(uielement)
624
632
 
625
633
  this.UIOnMouseDown=function(e)
626
634
  {
627
- this.DragXScroll=null;
635
+ this.DragYScroll=null;
628
636
  this.DragMove={ Click:{ X:e.clientX, Y:e.clientY }, Move:{X:e.clientX, Y:e.clientY}, PreMove:{X:e.clientX, Y:e.clientY } };
629
637
 
630
638
  var pixelTatio = GetDevicePixelRatio();
@@ -643,6 +651,29 @@ function JSKeyboardChartContainer(uielement)
643
651
  if (clickData.Redraw==true)
644
652
  this.Draw();
645
653
  }
654
+ else if (clickData.Type==5 && e.button==0) //右侧滚动条
655
+ {
656
+ var scroll=clickData.VScrollbar;
657
+ if (scroll.Type==1) //顶部按钮
658
+ {
659
+ if (this.MoveYOffset(-1))
660
+ this.Draw();
661
+ }
662
+ else if (scroll.Type==2) //底部按钮
663
+ {
664
+ if (this.MoveYOffset(1))
665
+ this.Draw();
666
+ }
667
+ else if (scroll.Type==3) //滚动条
668
+ {
669
+ this.DragYScroll={ Click:{X:x, Y:y}, LastMove:{X:x, Y:y} };
670
+ }
671
+ else if (scroll.Type==4) //滚动条内部
672
+ {
673
+ if (this.SetYOffset(scroll.Pos))
674
+ this.Draw();
675
+ }
676
+ }
646
677
  }
647
678
 
648
679
  document.onmousemove=(e)=>{ this.DocOnMouseMove(e); }
@@ -688,68 +719,17 @@ function JSKeyboardChartContainer(uielement)
688
719
  var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
689
720
  var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
690
721
 
691
- //JSConsole.Chart.Log(`[JSReportChartContainer::DocOnMouseMove] x=${x}, y=${y}`);
692
-
693
- if (this.DragRow)
694
- {
695
- var drag=this.DragRow;
696
- var moveSetpY=drag.LastMove.Y-e.clientY;
697
- if (Math.abs(moveSetpY)<2) return;
698
- var reportChart=this.GetReportChart();
699
- drag.LastMove.X=e.clientX;
700
- drag.LastMove.Y=e.clientY;
701
- drag.Inside={X:x, Y:y};
702
-
703
- if (reportChart)
704
- {
705
- var moveRow=reportChart.OnDrawgRow(x,y,e);
706
- if (moveRow )
707
- {
708
- if (moveRow.Type==2)
709
- {
710
- if (moveRow.Data.DataIndex!=drag.Data.Row.DataIndex)
711
- {
712
- drag.MoveRow=moveRow;
713
- }
714
- }
715
- else if (moveRow.Type==7)
716
- {
717
- var pageStatus=reportChart.GetCurrentPageStatus();
718
- if (!pageStatus.IsEnd)
719
- {
720
- this.MoveYOffset(1, false);
721
- drag.MoveRow=null;
722
-
723
- this.EnablePageScroll=true;
724
- this.AutoScrollPage(2);
725
- }
726
- }
727
- else if (moveRow.Type==5)
728
- {
729
- if (this.Data.YOffset>0)
730
- {
731
- this.MoveYOffset(-1, false);
732
- drag.MoveRow=null;
733
-
734
- this.EnablePageScroll=true;
735
- this.AutoScrollPage(-2);
736
- }
737
- }
738
- }
739
- reportChart.DragRow=drag;
740
- }
741
-
742
- this.Draw();
743
- }
744
- else if (this.DragXScroll)
722
+ if (this.DragYScroll)
745
723
  {
746
724
  var chart=this.ChartPaint[0];
747
- if (!chart || !chart.Tab) return;
725
+ if (!chart || !chart.VScrollbar) return;
726
+
727
+ this.DragYScroll.LastMove.X=x;
728
+ this.DragYScroll.LastMove.Y=y;
748
729
 
749
- this.DragXScroll.LastMove.X=x;
750
- this.DragXScroll.LastMove.Y=y;
751
- var pos=chart.Tab.GetScrollPostionByPoint(x,y);
752
- if (this.SetXOffset(pos)) this.Draw();
730
+ var pos=chart.VScrollbar.GetScrollPostionByPoint(x,y);
731
+ if (this.SetYOffset(pos))
732
+ this.Draw();
753
733
  }
754
734
  }
755
735
 
@@ -759,6 +739,8 @@ function JSKeyboardChartContainer(uielement)
759
739
  document.onmousemove=null;
760
740
  document.onmouseup=null;
761
741
 
742
+ this.DragYScroll=null;
743
+
762
744
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_KEYBOARD_MOUSEUP)
763
745
  if (event && event.Callback)
764
746
  {
@@ -1065,6 +1047,21 @@ function JSKeyboardChartContainer(uielement)
1065
1047
  return result;
1066
1048
  }
1067
1049
  }
1050
+
1051
+ this.SetYOffset=function(pos)
1052
+ {
1053
+ if (!IFrameSplitOperator.IsNumber(pos)) return false;
1054
+ var chart=this.ChartPaint[0];
1055
+ if (!chart) return false;
1056
+
1057
+ var maxOffset=chart.GetYScrollRange();
1058
+ if (pos<0) pos=0;
1059
+ if (pos>maxOffset) pos=maxOffset;
1060
+
1061
+ this.Data.YOffset=pos;
1062
+
1063
+ return true;
1064
+ }
1068
1065
  }
1069
1066
 
1070
1067
  function JSKeyboardFrame()
@@ -1074,14 +1071,14 @@ function JSKeyboardFrame()
1074
1071
 
1075
1072
  this.BorderLine=null; //1=上 2=下 4=左 8=右
1076
1073
 
1077
- this.BorderColor=g_JSChartResource.Report.BorderColor; //边框线
1074
+ this.BorderColor=g_JSChartResource.Keyboard.BorderColor; //边框线
1078
1075
 
1079
1076
  this.LogoTextColor=g_JSChartResource.FrameLogo.TextColor;
1080
1077
  this.LogoTextFont=g_JSChartResource.FrameLogo.Font;
1081
1078
 
1082
- this.ReloadResource=function(resource)
1079
+ this.ReloadResource=function(option)
1083
1080
  {
1084
- this.BorderColor=g_JSChartResource.Report.BorderColor; //边框线
1081
+ this.BorderColor=g_JSChartResource.Keyboard.BorderColor; //边框线
1085
1082
  this.LogoTextColor=g_JSChartResource.FrameLogo.TextColor;
1086
1083
  this.LogoTextFont=g_JSChartResource.FrameLogo.Font;
1087
1084
  }
@@ -1178,10 +1175,12 @@ function ChartSymbolList()
1178
1175
  this.IsDrawBorder=false; //是否绘制单元格边框
1179
1176
 
1180
1177
  this.ShowSymbol=[]; //显示的股票列表 { Index:序号(排序用), Symbol:股票代码 }
1178
+
1179
+ this.VScrollbar; //竖向滚动条
1181
1180
 
1182
1181
  this.BorderColor=g_JSChartResource.Keyboard.BorderColor; //边框线
1183
1182
  this.SelectedColor=g_JSChartResource.Keyboard.SelectedColor; //选中行
1184
- this.TextColor=g_JSChartResource.Keyboard.TextColor; //文字颜色
1183
+ this.TextColor=g_JSChartResource.Keyboard.TextColor; //文字颜色
1185
1184
 
1186
1185
  //表格内容配置
1187
1186
  this.ItemFontConfig={ Size:g_JSChartResource.Keyboard.Item.Font.Size, Name:g_JSChartResource.Keyboard.Item.Font.Name };
@@ -1214,7 +1213,11 @@ function ChartSymbolList()
1214
1213
 
1215
1214
  this.ReloadResource=function(resource)
1216
1215
  {
1217
-
1216
+ this.BorderColor=g_JSChartResource.Keyboard.BorderColor; //边框线
1217
+ this.SelectedColor=g_JSChartResource.Keyboard.SelectedColor; //选中行
1218
+ this.TextColor=g_JSChartResource.Keyboard.TextColor; //文字颜色
1219
+
1220
+ if (this.VScrollbar) this.VScrollbar.ReloadResource(resource);
1218
1221
  }
1219
1222
 
1220
1223
  this.SetColumn=function(aryColumn)
@@ -1229,6 +1232,7 @@ function ChartSymbolList()
1229
1232
  if (this.SizeChange) this.CalculateSize();
1230
1233
  else this.UpdateCacheData();
1231
1234
 
1235
+ var bShowVScrollbar=this.IsShowVScrollbar();
1232
1236
  this.Canvas.save();
1233
1237
 
1234
1238
  this.Canvas.beginPath();
@@ -1241,6 +1245,12 @@ function ChartSymbolList()
1241
1245
 
1242
1246
  this.DrawBorder();
1243
1247
 
1248
+ if (this.VScrollbar && bShowVScrollbar)
1249
+ {
1250
+ var bottom=this.ChartBorder.GetBottom();
1251
+ this.VScrollbar.DrawScrollbar(this.RectClient.Left,this.RectClient.Top+2, this.RectClient.Right+this.VScrollbar.ButtonSize+2, bottom-2);
1252
+ }
1253
+
1244
1254
  this.SizeChange=false;
1245
1255
  }
1246
1256
 
@@ -1251,6 +1261,12 @@ function ChartSymbolList()
1251
1261
  this.RectClient.Right=this.ChartBorder.GetRight();
1252
1262
  this.RectClient.Top=this.ChartBorder.GetTop();
1253
1263
  this.RectClient.Bottom=this.ChartBorder.GetBottom();
1264
+
1265
+ var bShowVScrollbar=this.IsShowVScrollbar();
1266
+ if (bShowVScrollbar && this.VScrollbar && this.VScrollbar.Enable)
1267
+ {
1268
+ this.RectClient.Right-=(this.VScrollbar.ButtonSize+2);
1269
+ }
1254
1270
  }
1255
1271
 
1256
1272
  this.GetPageSize=function(recalculate) //recalculate 是否重新计算
@@ -1284,6 +1300,8 @@ function ChartSymbolList()
1284
1300
 
1285
1301
  this.CalculateSize=function() //计算大小
1286
1302
  {
1303
+ if (this.VScrollbar && this.VScrollbar.Enable) this.VScrollbar.CalculateSize();
1304
+
1287
1305
  this.UpdateCacheData();
1288
1306
 
1289
1307
  var pixelRatio=GetDevicePixelRatio();
@@ -1478,6 +1496,7 @@ function ChartSymbolList()
1478
1496
  else if (textAlign=='right')
1479
1497
  {
1480
1498
  x=left+width-2;
1499
+ if (left+width-2>this.RectClient.Right) x=this.RectClient.Right-2;
1481
1500
  this.Canvas.textAlign="right";
1482
1501
  }
1483
1502
  else
@@ -1532,6 +1551,12 @@ function ChartSymbolList()
1532
1551
  else
1533
1552
  var uiElement={Left:null, Top:null};
1534
1553
 
1554
+ if (this.VScrollbar)
1555
+ {
1556
+ var item=this.VScrollbar.OnMouseDown(x,y,e);
1557
+ if (item) return { Type:5, VScrollbar:item }; //右侧滚动条
1558
+ }
1559
+
1535
1560
  var row=this.PtInBody(x,y);
1536
1561
  if (row)
1537
1562
  {
@@ -1692,5 +1717,56 @@ function ChartSymbolList()
1692
1717
  event.Callback(event,data,this);
1693
1718
  }
1694
1719
  }
1720
+
1721
+ this.GetYScrollRange=function()
1722
+ {
1723
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return 0;
1724
+
1725
+ var maxOffset=this.Data.Data.length-this.RowCount;
1726
+
1727
+ return maxOffset;
1728
+ }
1729
+
1730
+ //大于1屏数据 显示滚动条
1731
+ this.IsShowVScrollbar=function()
1732
+ {
1733
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return false;
1734
+
1735
+ return this.Data.Data.length>this.RowCount;
1736
+ }
1737
+ }
1738
+
1739
+ //纵向滚动条
1740
+ function ChartKeyboardVScrollbar()
1741
+ {
1742
+ this.newMethod=ChartVScrollbar; //派生
1743
+ this.newMethod();
1744
+ delete this.newMethod;
1745
+
1746
+ this.ClassName='ChartKeyboardVScrollbar';
1747
+ this.Enable=true;
1748
+
1749
+ this.ScrollBarHeight=g_JSChartResource.Keyboard.VScrollbar.ScrollBarHeight;
1750
+ this.ButtonColor=g_JSChartResource.Keyboard.VScrollbar.ButtonColor;
1751
+ this.BarColor=g_JSChartResource.Keyboard.VScrollbar.BarColor;
1752
+ this.BorderColor=g_JSChartResource.Keyboard.VScrollbar.BorderColor;
1753
+ this.BGColor=g_JSChartResource.Keyboard.VScrollbar.BGColor;
1754
+ this.Mergin={ Left:2, Right:2, Top:2, Bottom:2 };
1755
+ this.BarWithConfig={ Size:g_JSChartResource.Keyboard.VScrollbar.BarWidth.Size };
1756
+
1757
+ this.ReloadResource=function(resource)
1758
+ {
1759
+ this.ScrollBarHeight=g_JSChartResource.Keyboard.VScrollbar.ScrollBarHeight;
1760
+ this.ButtonColor=g_JSChartResource.Keyboard.VScrollbar.ButtonColor;
1761
+ this.BarColor=g_JSChartResource.Keyboard.VScrollbar.BarColor;
1762
+ this.BorderColor=g_JSChartResource.Keyboard.VScrollbar.BorderColor;
1763
+ this.BGColor=g_JSChartResource.Keyboard.VScrollbar.BGColor;
1764
+ this.BarWithConfig={ Size:g_JSChartResource.Keyboard.VScrollbar.BarWidth.Size };
1765
+ }
1766
+
1767
+ this.IsShowCallback=function()
1768
+ {
1769
+ return true;
1770
+ }
1695
1771
  }
1696
1772
 
@@ -7773,7 +7773,7 @@ function ChartVScrollbar()
7773
7773
  this.ChartBorder; //边框信息
7774
7774
  this.ChartFrame; //框架画法
7775
7775
  this.Name; //名称
7776
- this.ClassName='ChartReportTab'; //类名
7776
+ this.ClassName='ChartVScrollbar'; //类名
7777
7777
  this.IsDrawFirst=false;
7778
7778
  this.GetEventCallback; //获取事件
7779
7779
  this.Report;
@@ -1554,7 +1554,7 @@ input[type="color"] {
1554
1554
  {
1555
1555
  position: absolute;
1556
1556
  width: 230px;
1557
- height:380px;
1557
+ height:360px;
1558
1558
  left: 1px;
1559
1559
  top: 1px;
1560
1560
  z-index: 999;