hqchart 1.1.13550 → 1.1.13558

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.
@@ -6524,6 +6524,7 @@ var JSCHART_EVENT_ID=
6524
6524
  ON_CLICK_TREPORT_ROW:127, //左键点击点击T型报价列表
6525
6525
 
6526
6526
  ON_DRAW_REPORT_ROW_BG:140, //报价列表整行背景
6527
+ ON_CLICK_REPORT_CHECKBOX:141, //报价列表checkbox
6527
6528
 
6528
6529
 
6529
6530
  ON_CHANGE_INDEX:150, //切换指标
@@ -54813,8 +54814,9 @@ function HQPriceStringFormat()
54813
54814
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_CORSSCURSOR_Y_TEXT);
54814
54815
  if (event)
54815
54816
  {
54816
- var data={ Value:this.Value, FrameID:this.FrameID };
54817
+ var data={ Value:this.Value, FrameID:this.FrameID, PreventDefault:false };
54817
54818
  event.Callback(event,data,this);
54819
+ if (data.PreventDefault==true) return false;
54818
54820
  }
54819
54821
  }
54820
54822
 
@@ -54889,8 +54891,10 @@ function HQDateStringFormat()
54889
54891
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_CORSSCURSOR_X_TEXT);
54890
54892
  if (event)
54891
54893
  {
54892
- var data={ Item:currentData, Period:this.Data.Period, Date:currentData.Date, Time:currentData.Time,Index:this.Data.DataOffset+index };
54894
+ var data={ Item:currentData, Period:this.Data.Period, Date:currentData.Date, Time:currentData.Time,Index:this.Data.DataOffset+index, PreventDefault:false };
54893
54895
  event.Callback(event,data,this);
54896
+
54897
+ if (data.PreventDefault==true) return false;
54894
54898
  }
54895
54899
  }
54896
54900
 
@@ -55029,8 +55033,10 @@ function HQMinuteTimeStringFormat()
55029
55033
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_CORSSCURSOR_X_TEXT);
55030
55034
  if (event)
55031
55035
  {
55032
- var data={ Time:time, Index:showIndex };
55036
+ var data={ Time:time, Index:showIndex, PreventDefault:false };
55033
55037
  event.Callback(event,data,this);
55038
+
55039
+ if (data.PreventDefault==true) return false;
55034
55040
  }
55035
55041
  }
55036
55042
 
@@ -71164,6 +71170,15 @@ function JSChartResource()
71164
71170
  BorderColor:'rgba(180,180,180,0.9)',
71165
71171
  BGColor:"rgba(234,239,248,0.9)",
71166
71172
  BarWidth:{ Size:12 }
71173
+ },
71174
+
71175
+ CheckBox:
71176
+ {
71177
+ Family:"iconfont", Size:15,
71178
+ Checked:{ Color:"rgb(33,148,240)", Symbol:"\ue6b3", DisableColor:"rgb(112,128,144)" },
71179
+ Unchecked:{ Color:"rgb(33,148,240)", Symbol:"\ue6b4", DisableColor:"rgb(112,128,144)" },
71180
+
71181
+ Margin:{ Left:5, Right:5, Bottom:2, Top:4 },
71167
71182
  }
71168
71183
  },
71169
71184
 
@@ -72179,6 +72194,33 @@ function JSChartResource()
72179
72194
  if (subItem.BorderColor) dest.VScrollbar.BorderColor=subItem.BorderColor;
72180
72195
  if (subItem.BGColor) dest.VScrollbar.BGColor=subItem.BGColor;
72181
72196
  }
72197
+
72198
+ if (item.CheckBox)
72199
+ {
72200
+ var subItem=item.CheckBox;
72201
+ if (subItem.Family) dest.CheckBox.Family=subItem.Family;
72202
+ if (IFrameSplitOperator.IsNumber(subItem.Size)) dest.CheckBox.Size=subItem.Size;
72203
+
72204
+ if (subItem.Checked)
72205
+ {
72206
+ var child=subItem.Checked;
72207
+ if (child.Color) dest.CheckBox.Checked.Color=child.Color;
72208
+ if (child.Symbol) dest.CheckBox.Checked.Symbol=child.Symbol;
72209
+ if (child.DisableColor) dest.CheckBox.Checked.DisableColor=child.DisableColor;
72210
+ }
72211
+
72212
+ if (subItem.Unchecked)
72213
+ {
72214
+ var child=subItem.Unchecked;
72215
+ if (child.Color) dest.CheckBox.Unchecked.Color=child.Color;
72216
+ if (child.Symbol) dest.CheckBox.Unchecked.Symbol=child.Symbol;
72217
+ if (child.DisableColor) dest.CheckBox.Unchecked.DisableColor=child.DisableColor;
72218
+
72219
+
72220
+ }
72221
+
72222
+ CopyMarginConfig(dest.CheckBox.Margin, subItem.Margin);
72223
+ }
72182
72224
 
72183
72225
  }
72184
72226
 
@@ -123582,6 +123624,13 @@ function GetBlackStyle()
123582
123624
  BarColor:"rgba(48,48,48,0.9)",
123583
123625
  BorderColor:'rgba(48,48,48,0.9)',
123584
123626
  BGColor:"rgba(211,211,211,0.5)",
123627
+ },
123628
+
123629
+ CheckBox:
123630
+ {
123631
+ Family:"iconfont", Size:15,
123632
+ Checked:{ Color:"rgb(237,60,31)", Symbol:"\ue6b3", DisableColor:"rgb(112,128,144)" },
123633
+ Unchecked:{ Color:"rgb(237,60,31)", Symbol:"\ue6b4", DisableColor:"rgb(112,128,144)" },
123585
123634
  }
123586
123635
  },
123587
123636
 
@@ -124714,6 +124763,10 @@ function ChartDealList()
124714
124763
  if (!IFrameSplitOperator.IsNumber(item.DataIndex)) continue;
124715
124764
  colItem.DataIndex=item.DataIndex; //柱子数据所在原始数据索引列
124716
124765
  }
124766
+ else if (item.Type==DEAL_COLUMN_ID.TIME_ID)
124767
+ {
124768
+ if (IFrameSplitOperator.IsString(item.Foramt)) colItem.Foramt=item.Foramt; //设置时间格式
124769
+ }
124717
124770
 
124718
124771
  this.Column.push(colItem);
124719
124772
  }
@@ -125340,6 +125393,7 @@ function JSReportChart(divElement)
125340
125393
  if (IFrameSplitOperator.IsBool(option.EnableDragHeader)) chart.EnableDragHeader=option.EnableDragHeader;
125341
125394
  if (IFrameSplitOperator.IsNumber(option.WheelPageType)) chart.WheelPageType=option.WheelPageType;
125342
125395
  if (IFrameSplitOperator.IsBool(option.PageUpDownCycle)) chart.PageUpDownCycle=option.PageUpDownCycle;
125396
+
125343
125397
 
125344
125398
  if (option.VScrollbar) chart.SetVScrollbar(option.VScrollbar);
125345
125399
  if (option.SortInfo)
@@ -125353,6 +125407,7 @@ function JSReportChart(divElement)
125353
125407
  if (reportChart)
125354
125408
  {
125355
125409
  if (IFrameSplitOperator.IsNumber(option.TextOverflowStyle)) reportChart.TextOverflowStyle=option.TextOverflowStyle;
125410
+ if (IFrameSplitOperator.IsNumber(option.MultiSelectModel)) reportChart.MultiSelectModel=option.MultiSelectModel;
125356
125411
  }
125357
125412
 
125358
125413
  this.SetChartBorder(chart, option);
@@ -125916,6 +125971,7 @@ function JSReportChartContainer(uielement)
125916
125971
  {
125917
125972
  chart.SelectedRow=-1;
125918
125973
  chart.SelectedFixedRow=-1;
125974
+ chart.MultiSelectedRow=[];
125919
125975
  }
125920
125976
  }
125921
125977
 
@@ -126519,6 +126575,8 @@ function JSReportChartContainer(uielement)
126519
126575
 
126520
126576
  if (IFrameSplitOperator.IsNumber(item[35])) stock.Time=item[35]; //时间 hhmm / hhmmss / hhmmss.fff
126521
126577
  if (IFrameSplitOperator.IsNumber(item[36])) stock.Date=item[36]; //日期
126578
+
126579
+ if (IFrameSplitOperator.IsBool(item[37])) stock.Checked=item[37];
126522
126580
  }
126523
126581
 
126524
126582
 
@@ -126946,6 +127004,12 @@ function JSReportChartContainer(uielement)
126946
127004
  }
126947
127005
  else
126948
127006
  {
127007
+ var bottonData=report.GetButtonData(x,y)
127008
+ if (bottonData)
127009
+ {
127010
+ mouseStatus={ Cursor:"pointer", Name:"Botton"};
127011
+ }
127012
+
126949
127013
  var tooltipData=report.GetTooltipData(x,y); //单元格提示信息
126950
127014
  if (tooltipData)
126951
127015
  {
@@ -127751,6 +127815,100 @@ function JSReportChartContainer(uielement)
127751
127815
 
127752
127816
  var result={ Redraw:false, Update:false }; //Redraw=重绘, Update=更新数据
127753
127817
 
127818
+ if (chart.MultiSelectModel==1)
127819
+ {
127820
+ var pageStatus=chart.GetCurrentPageStatus();
127821
+ if (IFrameSplitOperator.IsNonEmptyArray(pageStatus.MultiSelectedRow))
127822
+ {
127823
+ var selected=pageStatus.MultiSelectedRow[0];
127824
+ if (step>0)
127825
+ {
127826
+ if (selected==this.Data.Data.length-1) return result;
127827
+
127828
+ if (selected<0 || selected<pageStatus.Start || selected>pageStatus.End)
127829
+ {
127830
+ chart.MultiSelectedRow=[pageStatus.Start];
127831
+ result.Redraw=true;
127832
+ return result;
127833
+ }
127834
+
127835
+ var offset=this.Data.YOffset;
127836
+ for(var i=0;i<step;++i)
127837
+ {
127838
+ ++selected;
127839
+ if (selected>pageStatus.End) ++offset;
127840
+
127841
+ if (selected>=this.Data.Data.length)
127842
+ {
127843
+ selected=0;
127844
+ offset=0;
127845
+ }
127846
+ }
127847
+
127848
+ result.Redraw=true;
127849
+ result.Update=(offset!=this.Data.YOffset);
127850
+
127851
+ chart.MultiSelectedRow=[selected];
127852
+ this.Data.YOffset=offset;
127853
+
127854
+ return result;
127855
+
127856
+ }
127857
+ else if (step<0)
127858
+ {
127859
+ if (selected==0) return result;
127860
+
127861
+ if (selected<0 || selected<pageStatus.Start || selected>pageStatus.End)
127862
+ {
127863
+ chart.MultiSelectedRow=[pageStatus.End];
127864
+ result.Redraw=true;
127865
+ return result;
127866
+ }
127867
+
127868
+ step=Math.abs(step);
127869
+ var offset=this.Data.YOffset;
127870
+ for(var i=0;i<step;++i)
127871
+ {
127872
+ --selected;
127873
+ if (selected<pageStatus.Start) --offset;
127874
+
127875
+ if (selected<0)
127876
+ {
127877
+ selected=this.Data.Data.length-1;
127878
+ offset=this.Data.Data.length-pageSize;
127879
+ if (offset<0) offset=0;
127880
+ }
127881
+ }
127882
+
127883
+ result.Redraw=true;
127884
+ result.Update=(offset!=this.Data.YOffset);
127885
+
127886
+ chart.MultiSelectedRow=[selected];
127887
+ this.Data.YOffset=offset;
127888
+
127889
+ return result;
127890
+ }
127891
+ else
127892
+ {
127893
+ return null;
127894
+ }
127895
+
127896
+ return result;
127897
+ }
127898
+ else
127899
+ {
127900
+ var selected=-1;
127901
+ if (step>0) selected=pageStatus.Start;
127902
+ else if (step<0) selected=pageStatus.End;
127903
+ else return null;
127904
+
127905
+ chart.MultiSelectedRow=[selected];
127906
+ result.Redraw=true;
127907
+ }
127908
+
127909
+ return result;
127910
+ }
127911
+
127754
127912
 
127755
127913
  if (chart.SelectedModel==0) //不可翻页模式, 只能在当前页移动
127756
127914
  {
@@ -128723,7 +128881,8 @@ var REPORT_COLUMN_ID=
128723
128881
 
128724
128882
  TIME_ID:31, //时间 hhmmss / hhmm / hhmmss.fff
128725
128883
  DATE_ID:32, //日期
128726
-
128884
+
128885
+ CHECKBOX_ID:33, //单选框
128727
128886
 
128728
128887
  SYMBOL_NAME_ID:99,
128729
128888
 
@@ -128731,6 +128890,7 @@ var REPORT_COLUMN_ID=
128731
128890
  CUSTOM_NUMBER_TEXT_ID:101, //自定义数值型
128732
128891
  CUSTOM_DATETIME_TEXT_ID:102, //自定义日期类型
128733
128892
  CUSTOM_ICON_ID:103, //自定义图标
128893
+ CUSTOM_CHECKBOX_ID:104, //自定义checkbox
128734
128894
  }
128735
128895
 
128736
128896
  var MAP_COLUMN_FIELD=new Map([
@@ -128797,6 +128957,10 @@ function ChartReport()
128797
128957
  this.SelectedFixedRow=-1; //选中固定行ID
128798
128958
  this.IsDrawBorder=1; //是否绘制单元格边框
128799
128959
 
128960
+ //多选模式
128961
+ this.MultiSelectModel=0; //0=禁用 1=开启
128962
+ this.MultiSelectedRow=[]; //选中行
128963
+
128800
128964
  this.ShowSymbol=[]; //显示的股票列表 { Index:序号(排序用), Symbol:股票代码 }
128801
128965
  this.DragRow; //拖拽行
128802
128966
 
@@ -128896,6 +129060,8 @@ function ChartReport()
128896
129060
  DistanceWidth:g_JSChartResource.Report.KLine.DistanceWidth
128897
129061
  }
128898
129062
 
129063
+ this.CheckBoxConfig=CloneData(g_JSChartResource.Report.CheckBox);
129064
+
128899
129065
  //股票代码+股票名称
128900
129066
  this.ItemSymbolFontConfig={Size:g_JSChartResource.Report.Item.SymbolFont.Size, Name:g_JSChartResource.Report.Item.SymbolFont.Name};
128901
129067
  this.ItemNameFontConfg={Size:g_JSChartResource.Report.Item.NameFont.Size, Name:g_JSChartResource.Report.Item.NameFont.Name};
@@ -128914,6 +129080,7 @@ function ChartReport()
128914
129080
  this.RowHeight=0; //行高度
128915
129081
  this.BottomToolbarHeight=0; //底部工具条高度
128916
129082
  this.IsShowAllColumn=false; //是否已显示所有列
129083
+ this.DevicePixelRatio=GetDevicePixelRatio(); //分辨率
128917
129084
 
128918
129085
  //{
128919
129086
  // Type:列id, Title:标题, TextAlign:文字对齐方式, MaxText:文字最大宽度 , TextColor:文字颜色, Sort:0=不支持排序 1=本地排序 0=远程排序,
@@ -128934,8 +129101,13 @@ function ChartReport()
128934
129101
  // { Text, Color, Title:, TitleColor, Space, Margin:{ Left, Top, Right, Bottom }}
128935
129102
  this.TooltipRect=[];
128936
129103
 
129104
+ //{ Rect:rtItem, Type: 0=checkedbox, 1=button, 2=link , Stock, Index:index, Column:column }
129105
+ this.ButtonRect=[];
129106
+
128937
129107
  this.ReloadResource=function(resource)
128938
129108
  {
129109
+ this.DevicePixelRatio=GetDevicePixelRatio()
129110
+
128939
129111
  this.UpColor=g_JSChartResource.Report.UpTextColor;
128940
129112
  this.DownColor=g_JSChartResource.Report.DownTextColor;
128941
129113
  this.UnchagneColor=g_JSChartResource.Report.UnchagneTextColor;
@@ -129087,6 +129259,14 @@ function ChartReport()
129087
129259
  if (IFrameSplitOperator.IsNumber(item.ValueType)) colItem.FormatType=item.ValueType; //输出样式
129088
129260
 
129089
129261
  }
129262
+ else if (item.Type==REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID)
129263
+ {
129264
+ if (!IFrameSplitOperator.IsNumber(item.DataIndex) && !IFrameSplitOperator.IsNumber(item.BlockIndex)) continue;
129265
+ if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
129266
+ if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
129267
+ if (item.CheckBox) colItem.CheckBox=CloneData(item.CheckBox);
129268
+ else colItem.CheckBox=CloneData(g_JSChartResource.Report.CheckBox);
129269
+ }
129090
129270
  else if (item.Type==REPORT_COLUMN_ID.CUSTOM_ICON_ID)
129091
129271
  {
129092
129272
 
@@ -129103,6 +129283,7 @@ function ChartReport()
129103
129283
  {
129104
129284
  if (IFrameSplitOperator.IsNumber(item.FormatType)) colItem.FormatType=item.FormatType;
129105
129285
  }
129286
+
129106
129287
 
129107
129288
  this.Column.push(colItem);
129108
129289
  }
@@ -129199,6 +129380,10 @@ function ChartReport()
129199
129380
  { Type:REPORT_COLUMN_ID.TIME_ID, Title:"时间", TextAlign:"left", ValueType:0, TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"99:99:99.999" },
129200
129381
  { Type:REPORT_COLUMN_ID.DATE_ID, Title:"日期", TextAlign:"left", FormatType:0, TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999-99-99" },
129201
129382
 
129383
+ { Type:REPORT_COLUMN_ID.CHECKBOX_ID, Title:"", TextAlign:"center", FixedWidth:20*GetDevicePixelRatio() },
129384
+
129385
+ { Type:REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID, Title:"", TextAlign:"center", FixedWidth:20*GetDevicePixelRatio() },
129386
+
129202
129387
 
129203
129388
  ];
129204
129389
 
@@ -129224,7 +129409,9 @@ function ChartReport()
129224
129409
  {
129225
129410
  this.ShowSymbol=[];
129226
129411
  this.TooltipRect=[];
129227
-
129412
+ this.ButtonRect=[];
129413
+ this.DevicePixelRatio=GetDevicePixelRatio()
129414
+
129228
129415
  if (this.GlobalOption) this.GlobalOption.FlashBGCount=0;
129229
129416
 
129230
129417
  if (this.SizeChange) this.CalculateSize();
@@ -129276,7 +129463,14 @@ function ChartReport()
129276
129463
 
129277
129464
  this.GetCurrentPageStatus=function() //{ Start:起始索引, End:结束索引(数据), PageSize:页面可以显示几条记录, IsEnd:是否是最后一页, IsSinglePage:是否只有一页数据}
129278
129465
  {
129279
- var result={ Start:this.Data.YOffset, PageSize:this.RowCount, IsEnd:false, SelectedRow:this.SelectedRow, IsSinglePage:false, DataCount:0 };
129466
+ var result={ Start:this.Data.YOffset, PageSize:this.RowCount, IsEnd:false, SelectedRow:this.SelectedRow, IsSinglePage:false, DataCount:0, MultiSelectModel:this.MultiSelectModel };
129467
+ if (this.MultiSelectModel==1)
129468
+ {
129469
+ result.SelectedRow=-1;
129470
+ result.MultiSelectedRow=this.MultiSelectedRow.slice();
129471
+ result.MultiSelectedRow.sort((left, right)=>{ return left>right; });
129472
+ }
129473
+
129280
129474
  if (IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))
129281
129475
  {
129282
129476
  result.End=this.Data.YOffset+this.RowCount-1;
@@ -129700,19 +129894,31 @@ function ChartReport()
129700
129894
 
129701
129895
  var eventDrawBG=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_REPORT_ROW_BG);
129702
129896
  var selectedSymbol=this.GetSelectedSymbol();
129897
+
129898
+ var setSelected;
129899
+ if (this.MultiSelectModel==1) setSelected=new Set(this.MultiSelectedRow);
129900
+
129703
129901
  for(var i=this.Data.YOffset, j=0; i<this.Data.Data.length && j<this.RowCount ;++i, ++j)
129704
129902
  {
129705
129903
  var symbol=this.Data.Data[i];
129706
129904
 
129707
129905
  var bFillRow=false;
129708
- if (this.SelectedModel==0)
129906
+ if (this.MultiSelectModel==1)
129709
129907
  {
129710
- if (j==this.SelectedRow) bFillRow=true; //选中行
129908
+ if (setSelected.has(i)) bFillRow=true;
129711
129909
  }
129712
129910
  else
129713
129911
  {
129714
- if (i==this.SelectedRow) bFillRow=true; //选中行
129912
+ if (this.SelectedModel==0)
129913
+ {
129914
+ if (j==this.SelectedRow) bFillRow=true; //选中行
129915
+ }
129916
+ else
129917
+ {
129918
+ if (i==this.SelectedRow) bFillRow=true; //选中行
129919
+ }
129715
129920
  }
129921
+
129716
129922
 
129717
129923
  if (this.DragRow)
129718
129924
  {
@@ -129742,7 +129948,7 @@ function ChartReport()
129742
129948
  if (eventDrawBG && eventDrawBG.Callback)
129743
129949
  {
129744
129950
  //Out:{ BGColor: }
129745
- var sendData={ RowIndex:i, Symbol:symbol, Out:null, Selected:selectedSymbol };
129951
+ var sendData={ RowIndex:i, Symbol:symbol, Out:null, Selected:selectedSymbol, MultiSelectModel:this.MultiSelectModel };
129746
129952
  eventDrawBG.Callback(eventDrawBG,sendData,this);
129747
129953
  if (sendData.Out && sendData.Out.BGColor)
129748
129954
  {
@@ -129767,14 +129973,32 @@ function ChartReport()
129767
129973
 
129768
129974
  this.GetSelectedSymbol=function()
129769
129975
  {
129770
- if (this.SelectedRow<0) return null;
129976
+ if (this.MultiSelectModel==1)
129977
+ {
129978
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.MultiSelectedRow)) return null;
129979
+
129980
+ var aryData=[];
129981
+ for(var i=0;i<this.MultiSelectedRow.length;++i)
129982
+ {
129983
+ var item=this.Data.Data[this.MultiSelectedRow[i]];
129984
+ if (!item) continue;
129771
129985
 
129772
- var index=this.SelectedRow;
129773
- if (this.SelectedModel==0) //当前屏选中
129774
- index=this.Data.YOffset+this.SelectedRow;
129986
+ aryData.push(item);
129987
+ }
129775
129988
 
129776
- var symbol=this.Data.Data[index];
129777
- return symbol;
129989
+ return aryData;
129990
+ }
129991
+ else
129992
+ {
129993
+ if (this.SelectedRow<0) return null;
129994
+
129995
+ var index=this.SelectedRow;
129996
+ if (this.SelectedModel==0) //当前屏选中
129997
+ index=this.Data.YOffset+this.SelectedRow;
129998
+
129999
+ var symbol=this.Data.Data[index];
130000
+ return [symbol];
130001
+ }
129778
130002
  }
129779
130003
 
129780
130004
 
@@ -130102,6 +130326,29 @@ function ChartReport()
130102
130326
  {
130103
130327
  this.FormaDateDrawInfo(column, stock, drawInfo, data);
130104
130328
  }
130329
+ else if (column.Type==REPORT_COLUMN_ID.CHECKBOX_ID)
130330
+ {
130331
+ rtItem={ Left:left, Top:top, Width:column.Width, Height:this.RowHeight };
130332
+ rtItem.Right=rtItem.Left+rtItem.Width;
130333
+ rtItem.Bottom=rtItem.Top+rtItem.Height;
130334
+ drawInfo.Rect=rtItem;
130335
+ drawInfo.Checked=false;
130336
+ drawInfo.Enable=true;
130337
+ drawInfo.CheckBox=this.CheckBoxConfig;
130338
+ drawInfo.Data=stock;
130339
+ if (stock && IFrameSplitOperator.IsBool(stock.Checked))
130340
+ drawInfo.Checked=stock.Checked;
130341
+ }
130342
+ else if (column.Type==REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID)
130343
+ {
130344
+ rtItem={ Left:left, Top:top, Width:column.Width, Height:this.RowHeight };
130345
+ rtItem.Right=rtItem.Left+rtItem.Width;
130346
+ rtItem.Bottom=rtItem.Top+rtItem.Height;
130347
+ drawInfo.Rect=rtItem;
130348
+
130349
+ this.GetCustomCheckBoxDrawInfo(data, column, drawInfo);
130350
+ }
130351
+
130105
130352
 
130106
130353
  //拖拽行颜色
130107
130354
  if (rowType==3)
@@ -130115,6 +130362,10 @@ function ChartReport()
130115
130362
  {
130116
130363
  this.DrawIconItem(drawInfo, x, top, textWidth);
130117
130364
  }
130365
+ else if (column.Type==REPORT_COLUMN_ID.CHECKBOX_ID || column.Type==REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID)
130366
+ {
130367
+ this.DrawCheckbox(drawInfo, left, top, itemWidth);
130368
+ }
130118
130369
  else
130119
130370
  {
130120
130371
  if (data.FlashBG && data.FlashBG.Data && column.ID!=undefined)
@@ -130145,6 +130396,12 @@ function ChartReport()
130145
130396
  var tooltipData={ Rect:rtItem, Stock:stock, Index:index, Column:column, RowType:rowType, Type:drawInfo.Tooltip.Type, Data:drawInfo.Tooltip.Data };
130146
130397
  this.TooltipRect.push(tooltipData);
130147
130398
  }
130399
+
130400
+ if (drawInfo.Botton)
130401
+ {
130402
+ var buttonData={ Stock:stock, Index:index, Column:column, Rect:drawInfo.Botton.Rect, Type:drawInfo.Botton.Type, Data:drawInfo.Data };
130403
+ this.ButtonRect.push(buttonData);
130404
+ }
130148
130405
  }
130149
130406
 
130150
130407
  this.DrawCustomText=function(drawInfo, column, left, top, cellWidth)
@@ -130398,6 +130655,19 @@ function ChartReport()
130398
130655
  }
130399
130656
  }
130400
130657
 
130658
+ this.GetCustomCheckBoxDrawInfo=function(data, column, drawInfo)
130659
+ {
130660
+ var checkData=this.GetExtendData(data, column);
130661
+ if (!checkData) return;
130662
+ if (!IFrameSplitOperator.IsBool(checkData.Checked)) return;
130663
+
130664
+ drawInfo.Checked=checkData.Checked;
130665
+ drawInfo.Enable=true;
130666
+ drawInfo.Data=checkData;
130667
+ if (IFrameSplitOperator.IsBool(checkData.DisableCheckBox)) drawInfo.Enable=!checkData.DisableCheckBox;
130668
+ drawInfo.CheckBox=column.CheckBox;
130669
+ }
130670
+
130401
130671
  this.FormaTimeDrawInfo=function(column, stock, drawInfo, data)
130402
130672
  {
130403
130673
  if (!IFrameSplitOperator.IsNumber(stock.Time)) return;
@@ -130662,6 +130932,44 @@ function ChartReport()
130662
130932
  this.Canvas.font=this.ItemFont;
130663
130933
  }
130664
130934
 
130935
+ this.DrawCheckbox=function(drawInfo, left, top, width)
130936
+ {
130937
+ if (!IFrameSplitOperator.IsBool(drawInfo.Checked)) return;
130938
+ if (!drawInfo.CheckBox) return;
130939
+
130940
+ drawInfo.Font=`${drawInfo.CheckBox.Size*this.DevicePixelRatio}px ${drawInfo.CheckBox.Family}`;
130941
+ var textAlign=drawInfo.TextAlign;
130942
+ var size=drawInfo.CheckBox.Size*this.DevicePixelRatio;
130943
+ var x=left+drawInfo.CheckBox.Margin.Left;
130944
+ var y=top+this.RowHeight-drawInfo.CheckBox.Margin.Bottom;
130945
+ if (textAlign=='center') x=left+width/2-size/2;
130946
+ else if (textAlign=='right') x=left+width-drawInfo.CheckBox.Margin.Right;
130947
+
130948
+ this.Canvas.font=drawInfo.Font;
130949
+ this.Canvas.textBaseline="bottom";
130950
+ this.Canvas.textAlign="left";
130951
+ if (drawInfo.Checked===true)
130952
+ {
130953
+ if (drawInfo.Enable===false) this.Canvas.fillStyle=drawInfo.CheckBox.Checked.DisableColor;
130954
+ else this.Canvas.fillStyle=drawInfo.CheckBox.Checked.Color;
130955
+ this.Canvas.fillText(drawInfo.CheckBox.Checked.Symbol,x,y);
130956
+ }
130957
+ else if (drawInfo.Checked===false)
130958
+ {
130959
+ if (drawInfo.Enable===false) this.Canvas.fillStyle=drawInfo.CheckBox.Unchecked.DisableColor;
130960
+ else this.Canvas.fillStyle=drawInfo.CheckBox.Unchecked.Color;
130961
+ this.Canvas.fillText(drawInfo.CheckBox.Unchecked.Symbol,x,y);
130962
+ }
130963
+
130964
+ if (drawInfo.Enable)
130965
+ {
130966
+ var rtBox={ Left:x, Bottom:y, Width:size, Height:size };
130967
+ rtBox.Right=rtBox.Left+rtBox.Width;
130968
+ rtBox.Top=rtBox.Bottom-rtBox.Height;
130969
+ drawInfo.Botton={ Rect:rtBox, Type:0 };
130970
+ }
130971
+ }
130972
+
130665
130973
  //字体由外面设置
130666
130974
  this.TextEllipsis=function(text, maxWidth, maxText)
130667
130975
  {
@@ -131174,6 +131482,7 @@ function ChartReport()
131174
131482
 
131175
131483
  this.SelectedFixedRow=row.Index;
131176
131484
  this.SelectedRow=-1;
131485
+ this.MultiSelectedRow=[];
131177
131486
 
131178
131487
  return { Type:4, Redraw:bRedraw, Row:row }; //行
131179
131488
  }
@@ -131181,18 +131490,45 @@ function ChartReport()
131181
131490
  var row=this.PtInBody(x,y);
131182
131491
  if (row)
131183
131492
  {
131493
+ var btnStatus={ Redraw:false };
131494
+ this.OnClickButton(x, y, e, btnStatus);
131495
+
131184
131496
  var bRedraw=true;
131185
- if (this.SelectedModel==0)
131497
+ if (this.MultiSelectModel==1)
131186
131498
  {
131187
- if (this.SelectedRow==row.Index) bRedraw=false;
131188
- this.SelectedRow=row.Index;
131499
+ if (e && e.ctrlKey) //多选
131500
+ {
131501
+ var pos=this.MultiSelectedRow.indexOf(row.DataIndex);
131502
+ if (pos>=0) this.MultiSelectedRow.splice(pos,1);
131503
+ else this.MultiSelectedRow.push(row.DataIndex);
131504
+
131505
+ }
131506
+ else if (e && e.shiftKey) //批量多选
131507
+ {
131508
+ this.OnShiftClickRow(row);
131509
+ }
131510
+ else
131511
+ {
131512
+ if (this.MultiSelectedRow.length==1 && this.MultiSelectedRow[0]==row.DataIndex) bRedraw=false;
131513
+ else this.MultiSelectedRow=[row.DataIndex];
131514
+ }
131515
+
131189
131516
  this.SelectedFixedRow=-1;
131190
131517
  }
131191
- else
131518
+ else
131192
131519
  {
131193
- if (this.SelectedRow==row.DataIndex) bRedraw=false;
131194
- this.SelectedRow=row.DataIndex;
131195
- this.SelectedFixedRow=-1;
131520
+ if (this.SelectedModel==0)
131521
+ {
131522
+ if (this.SelectedRow==row.Index) bRedraw=false;
131523
+ this.SelectedRow=row.Index;
131524
+ this.SelectedFixedRow=-1;
131525
+ }
131526
+ else
131527
+ {
131528
+ if (this.SelectedRow==row.DataIndex) bRedraw=false;
131529
+ this.SelectedRow=row.DataIndex;
131530
+ this.SelectedFixedRow=-1;
131531
+ }
131196
131532
  }
131197
131533
 
131198
131534
  var eventID=JSCHART_EVENT_ID.ON_CLICK_REPORT_ROW;
@@ -131200,7 +131536,7 @@ function ChartReport()
131200
131536
 
131201
131537
  this.SendClickEvent(eventID, { Data:row, X:x, Y:y, e:e, Inside:insidePoint, UIElement:uiElement });
131202
131538
 
131203
- return { Type:2, Redraw:bRedraw, Row:row }; //行
131539
+ return { Type:2, Redraw:bRedraw || btnStatus.Redraw, Row:row }; //行
131204
131540
  }
131205
131541
 
131206
131542
  var header=this.PtInHeader(x,y);
@@ -131223,6 +131559,62 @@ function ChartReport()
131223
131559
  return null;
131224
131560
  }
131225
131561
 
131562
+ this.OnShiftClickRow=function(row)
131563
+ {
131564
+ if (this.MultiSelectedRow.length<=0)
131565
+ {
131566
+ this.MultiSelectedRow.push(row.DataIndex);
131567
+ return;
131568
+ }
131569
+
131570
+ var max=null, min=null;
131571
+ for(var i=0;i<this.MultiSelectedRow.length;++i)
131572
+ {
131573
+ var value=this.MultiSelectedRow[i];
131574
+ if (max==null || max<value) max=value;
131575
+ if (min==null || min>value) min=value;
131576
+ if (value==row.DataIndex) //移除
131577
+ {
131578
+ this.MultiSelectedRow.splice(i,1);
131579
+ return;
131580
+ }
131581
+ }
131582
+
131583
+ if (max==min)
131584
+ {
131585
+ var start=row.DataIndex, end=max;
131586
+ if (start>end)
131587
+ {
131588
+ start=max;
131589
+ end=row.DataIndex;
131590
+ }
131591
+
131592
+ this.MultiSelectedRow=[];
131593
+ for(var i=start;i<=end;++i)
131594
+ {
131595
+ this.MultiSelectedRow.push(i);
131596
+ }
131597
+ }
131598
+ else
131599
+ {
131600
+ if (row.DataIndex<=max && row.DataIndex>=min)
131601
+ {
131602
+ this.MultiSelectedRow.push(row.DataIndex);
131603
+ }
131604
+ else
131605
+ {
131606
+ var start=Math.min(row.DataIndex, min);
131607
+ var end=Math.max(row.DataIndex, max);
131608
+ this.MultiSelectedRow=[];
131609
+ for(var i=start;i<=end;++i)
131610
+ {
131611
+ this.MultiSelectedRow.push(i);
131612
+ }
131613
+ }
131614
+ }
131615
+
131616
+ }
131617
+
131226
131618
  this.OnDrawgRow=function(x, y, e) //Type: 5=顶部 6=空白行 2=行 7=底部
131227
131619
  {
131228
131620
  if (!this.Data) return null;
@@ -131259,6 +131651,33 @@ function ChartReport()
131259
131651
  return { Type:7 };
131260
131652
  }
131261
131653
 
131654
+ this.OnClickButton=function(x, y, e, status)
131655
+ {
131656
+ if (e.button!=0) return false;
131657
+
131658
+ var buttonData=this.GetButtonData(x,y);
131659
+ if (!buttonData) return true;
131660
+
131661
+ if (buttonData.Type===0)
131662
+ {
131663
+ var sendData={ Column:buttonData.Column, Index:buttonData.Index, Stock:buttonData.Stock, Data:buttonData.Data, PreventDefault: false };
131664
+ this.SendClickEvent(JSCHART_EVENT_ID.ON_CLICK_REPORT_CHECKBOX, sendData)
131665
+
131666
+ if (!sendData.PreventDefault)
131667
+ {
131668
+ if (IFrameSplitOperator.IsBool(buttonData.Data.Checked))
131669
+ buttonData.Data.Checked=!buttonData.Data.Checked;
131670
+ else
131671
+ buttonData.Data.Checked=true;
131672
+ }
131673
+
131674
+ status.Redraw=true;
131675
+ return true;
131676
+ }
131677
+
131678
+ return false;
131679
+ }
131680
+
131262
131681
  this.OnDblClick=function(x,y,e)
131263
131682
  {
131264
131683
  if (!this.Data) return false;
@@ -131496,6 +131915,24 @@ function ChartReport()
131496
131915
  return null;
131497
131916
  }
131498
131917
 
131918
+ this.GetButtonData=function(x,y)
131919
+ {
131920
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.ButtonRect)) return null;
131921
+
131922
+ for(var i=0;i<this.ButtonRect.length;++i)
131923
+ {
131924
+ var item=this.ButtonRect[i];
131925
+
131926
+ var rt=item.Rect;
131927
+ if (!rt) continue;
131928
+
131929
+ if (x>=rt.Left && x<=rt.Right && y>=rt.Top && y<=rt.Bottom)
131930
+ {
131931
+ return { Rect:item.Rect, Stock:item.Stock, Column:item.Column, Index:item.Index, Type:item.Type, Data:item.Data };
131932
+ }
131933
+ }
131934
+ }
131935
+
131499
131936
  this.PtInHeaderDragBorder=function(x, y)
131500
131937
  {
131501
131938
  if (!this.IsShowHeader) return null;
@@ -135326,7 +135763,7 @@ function ScrollBarBGChart()
135326
135763
 
135327
135764
 
135328
135765
 
135329
- var HQCHART_VERSION="1.1.13549";
135766
+ var HQCHART_VERSION="1.1.13557";
135330
135767
 
135331
135768
  function PrintHQChartVersion()
135332
135769
  {