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.
@@ -6568,6 +6568,7 @@ var JSCHART_EVENT_ID=
6568
6568
  ON_CLICK_TREPORT_ROW:127, //左键点击点击T型报价列表
6569
6569
 
6570
6570
  ON_DRAW_REPORT_ROW_BG:140, //报价列表整行背景
6571
+ ON_CLICK_REPORT_CHECKBOX:141, //报价列表checkbox
6571
6572
 
6572
6573
 
6573
6574
  ON_CHANGE_INDEX:150, //切换指标
@@ -54857,8 +54858,9 @@ function HQPriceStringFormat()
54857
54858
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_CORSSCURSOR_Y_TEXT);
54858
54859
  if (event)
54859
54860
  {
54860
- var data={ Value:this.Value, FrameID:this.FrameID };
54861
+ var data={ Value:this.Value, FrameID:this.FrameID, PreventDefault:false };
54861
54862
  event.Callback(event,data,this);
54863
+ if (data.PreventDefault==true) return false;
54862
54864
  }
54863
54865
  }
54864
54866
 
@@ -54933,8 +54935,10 @@ function HQDateStringFormat()
54933
54935
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_CORSSCURSOR_X_TEXT);
54934
54936
  if (event)
54935
54937
  {
54936
- var data={ Item:currentData, Period:this.Data.Period, Date:currentData.Date, Time:currentData.Time,Index:this.Data.DataOffset+index };
54938
+ var data={ Item:currentData, Period:this.Data.Period, Date:currentData.Date, Time:currentData.Time,Index:this.Data.DataOffset+index, PreventDefault:false };
54937
54939
  event.Callback(event,data,this);
54940
+
54941
+ if (data.PreventDefault==true) return false;
54938
54942
  }
54939
54943
  }
54940
54944
 
@@ -55073,8 +55077,10 @@ function HQMinuteTimeStringFormat()
55073
55077
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_CORSSCURSOR_X_TEXT);
55074
55078
  if (event)
55075
55079
  {
55076
- var data={ Time:time, Index:showIndex };
55080
+ var data={ Time:time, Index:showIndex, PreventDefault:false };
55077
55081
  event.Callback(event,data,this);
55082
+
55083
+ if (data.PreventDefault==true) return false;
55078
55084
  }
55079
55085
  }
55080
55086
 
@@ -71208,6 +71214,15 @@ function JSChartResource()
71208
71214
  BorderColor:'rgba(180,180,180,0.9)',
71209
71215
  BGColor:"rgba(234,239,248,0.9)",
71210
71216
  BarWidth:{ Size:12 }
71217
+ },
71218
+
71219
+ CheckBox:
71220
+ {
71221
+ Family:"iconfont", Size:15,
71222
+ Checked:{ Color:"rgb(33,148,240)", Symbol:"\ue6b3", DisableColor:"rgb(112,128,144)" },
71223
+ Unchecked:{ Color:"rgb(33,148,240)", Symbol:"\ue6b4", DisableColor:"rgb(112,128,144)" },
71224
+
71225
+ Margin:{ Left:5, Right:5, Bottom:2, Top:4 },
71211
71226
  }
71212
71227
  },
71213
71228
 
@@ -72223,6 +72238,33 @@ function JSChartResource()
72223
72238
  if (subItem.BorderColor) dest.VScrollbar.BorderColor=subItem.BorderColor;
72224
72239
  if (subItem.BGColor) dest.VScrollbar.BGColor=subItem.BGColor;
72225
72240
  }
72241
+
72242
+ if (item.CheckBox)
72243
+ {
72244
+ var subItem=item.CheckBox;
72245
+ if (subItem.Family) dest.CheckBox.Family=subItem.Family;
72246
+ if (IFrameSplitOperator.IsNumber(subItem.Size)) dest.CheckBox.Size=subItem.Size;
72247
+
72248
+ if (subItem.Checked)
72249
+ {
72250
+ var child=subItem.Checked;
72251
+ if (child.Color) dest.CheckBox.Checked.Color=child.Color;
72252
+ if (child.Symbol) dest.CheckBox.Checked.Symbol=child.Symbol;
72253
+ if (child.DisableColor) dest.CheckBox.Checked.DisableColor=child.DisableColor;
72254
+ }
72255
+
72256
+ if (subItem.Unchecked)
72257
+ {
72258
+ var child=subItem.Unchecked;
72259
+ if (child.Color) dest.CheckBox.Unchecked.Color=child.Color;
72260
+ if (child.Symbol) dest.CheckBox.Unchecked.Symbol=child.Symbol;
72261
+ if (child.DisableColor) dest.CheckBox.Unchecked.DisableColor=child.DisableColor;
72262
+
72263
+
72264
+ }
72265
+
72266
+ CopyMarginConfig(dest.CheckBox.Margin, subItem.Margin);
72267
+ }
72226
72268
 
72227
72269
  }
72228
72270
 
@@ -123626,6 +123668,13 @@ function GetBlackStyle()
123626
123668
  BarColor:"rgba(48,48,48,0.9)",
123627
123669
  BorderColor:'rgba(48,48,48,0.9)',
123628
123670
  BGColor:"rgba(211,211,211,0.5)",
123671
+ },
123672
+
123673
+ CheckBox:
123674
+ {
123675
+ Family:"iconfont", Size:15,
123676
+ Checked:{ Color:"rgb(237,60,31)", Symbol:"\ue6b3", DisableColor:"rgb(112,128,144)" },
123677
+ Unchecked:{ Color:"rgb(237,60,31)", Symbol:"\ue6b4", DisableColor:"rgb(112,128,144)" },
123629
123678
  }
123630
123679
  },
123631
123680
 
@@ -124758,6 +124807,10 @@ function ChartDealList()
124758
124807
  if (!IFrameSplitOperator.IsNumber(item.DataIndex)) continue;
124759
124808
  colItem.DataIndex=item.DataIndex; //柱子数据所在原始数据索引列
124760
124809
  }
124810
+ else if (item.Type==DEAL_COLUMN_ID.TIME_ID)
124811
+ {
124812
+ if (IFrameSplitOperator.IsString(item.Foramt)) colItem.Foramt=item.Foramt; //设置时间格式
124813
+ }
124761
124814
 
124762
124815
  this.Column.push(colItem);
124763
124816
  }
@@ -125384,6 +125437,7 @@ function JSReportChart(divElement)
125384
125437
  if (IFrameSplitOperator.IsBool(option.EnableDragHeader)) chart.EnableDragHeader=option.EnableDragHeader;
125385
125438
  if (IFrameSplitOperator.IsNumber(option.WheelPageType)) chart.WheelPageType=option.WheelPageType;
125386
125439
  if (IFrameSplitOperator.IsBool(option.PageUpDownCycle)) chart.PageUpDownCycle=option.PageUpDownCycle;
125440
+
125387
125441
 
125388
125442
  if (option.VScrollbar) chart.SetVScrollbar(option.VScrollbar);
125389
125443
  if (option.SortInfo)
@@ -125397,6 +125451,7 @@ function JSReportChart(divElement)
125397
125451
  if (reportChart)
125398
125452
  {
125399
125453
  if (IFrameSplitOperator.IsNumber(option.TextOverflowStyle)) reportChart.TextOverflowStyle=option.TextOverflowStyle;
125454
+ if (IFrameSplitOperator.IsNumber(option.MultiSelectModel)) reportChart.MultiSelectModel=option.MultiSelectModel;
125400
125455
  }
125401
125456
 
125402
125457
  this.SetChartBorder(chart, option);
@@ -125960,6 +126015,7 @@ function JSReportChartContainer(uielement)
125960
126015
  {
125961
126016
  chart.SelectedRow=-1;
125962
126017
  chart.SelectedFixedRow=-1;
126018
+ chart.MultiSelectedRow=[];
125963
126019
  }
125964
126020
  }
125965
126021
 
@@ -126563,6 +126619,8 @@ function JSReportChartContainer(uielement)
126563
126619
 
126564
126620
  if (IFrameSplitOperator.IsNumber(item[35])) stock.Time=item[35]; //时间 hhmm / hhmmss / hhmmss.fff
126565
126621
  if (IFrameSplitOperator.IsNumber(item[36])) stock.Date=item[36]; //日期
126622
+
126623
+ if (IFrameSplitOperator.IsBool(item[37])) stock.Checked=item[37];
126566
126624
  }
126567
126625
 
126568
126626
 
@@ -126990,6 +127048,12 @@ function JSReportChartContainer(uielement)
126990
127048
  }
126991
127049
  else
126992
127050
  {
127051
+ var bottonData=report.GetButtonData(x,y)
127052
+ if (bottonData)
127053
+ {
127054
+ mouseStatus={ Cursor:"pointer", Name:"Botton"};
127055
+ }
127056
+
126993
127057
  var tooltipData=report.GetTooltipData(x,y); //单元格提示信息
126994
127058
  if (tooltipData)
126995
127059
  {
@@ -127795,6 +127859,100 @@ function JSReportChartContainer(uielement)
127795
127859
 
127796
127860
  var result={ Redraw:false, Update:false }; //Redraw=重绘, Update=更新数据
127797
127861
 
127862
+ if (chart.MultiSelectModel==1)
127863
+ {
127864
+ var pageStatus=chart.GetCurrentPageStatus();
127865
+ if (IFrameSplitOperator.IsNonEmptyArray(pageStatus.MultiSelectedRow))
127866
+ {
127867
+ var selected=pageStatus.MultiSelectedRow[0];
127868
+ if (step>0)
127869
+ {
127870
+ if (selected==this.Data.Data.length-1) return result;
127871
+
127872
+ if (selected<0 || selected<pageStatus.Start || selected>pageStatus.End)
127873
+ {
127874
+ chart.MultiSelectedRow=[pageStatus.Start];
127875
+ result.Redraw=true;
127876
+ return result;
127877
+ }
127878
+
127879
+ var offset=this.Data.YOffset;
127880
+ for(var i=0;i<step;++i)
127881
+ {
127882
+ ++selected;
127883
+ if (selected>pageStatus.End) ++offset;
127884
+
127885
+ if (selected>=this.Data.Data.length)
127886
+ {
127887
+ selected=0;
127888
+ offset=0;
127889
+ }
127890
+ }
127891
+
127892
+ result.Redraw=true;
127893
+ result.Update=(offset!=this.Data.YOffset);
127894
+
127895
+ chart.MultiSelectedRow=[selected];
127896
+ this.Data.YOffset=offset;
127897
+
127898
+ return result;
127899
+
127900
+ }
127901
+ else if (step<0)
127902
+ {
127903
+ if (selected==0) return result;
127904
+
127905
+ if (selected<0 || selected<pageStatus.Start || selected>pageStatus.End)
127906
+ {
127907
+ chart.MultiSelectedRow=[pageStatus.End];
127908
+ result.Redraw=true;
127909
+ return result;
127910
+ }
127911
+
127912
+ step=Math.abs(step);
127913
+ var offset=this.Data.YOffset;
127914
+ for(var i=0;i<step;++i)
127915
+ {
127916
+ --selected;
127917
+ if (selected<pageStatus.Start) --offset;
127918
+
127919
+ if (selected<0)
127920
+ {
127921
+ selected=this.Data.Data.length-1;
127922
+ offset=this.Data.Data.length-pageSize;
127923
+ if (offset<0) offset=0;
127924
+ }
127925
+ }
127926
+
127927
+ result.Redraw=true;
127928
+ result.Update=(offset!=this.Data.YOffset);
127929
+
127930
+ chart.MultiSelectedRow=[selected];
127931
+ this.Data.YOffset=offset;
127932
+
127933
+ return result;
127934
+ }
127935
+ else
127936
+ {
127937
+ return null;
127938
+ }
127939
+
127940
+ return result;
127941
+ }
127942
+ else
127943
+ {
127944
+ var selected=-1;
127945
+ if (step>0) selected=pageStatus.Start;
127946
+ else if (step<0) selected=pageStatus.End;
127947
+ else return null;
127948
+
127949
+ chart.MultiSelectedRow=[selected];
127950
+ result.Redraw=true;
127951
+ }
127952
+
127953
+ return result;
127954
+ }
127955
+
127798
127956
 
127799
127957
  if (chart.SelectedModel==0) //不可翻页模式, 只能在当前页移动
127800
127958
  {
@@ -128767,7 +128925,8 @@ var REPORT_COLUMN_ID=
128767
128925
 
128768
128926
  TIME_ID:31, //时间 hhmmss / hhmm / hhmmss.fff
128769
128927
  DATE_ID:32, //日期
128770
-
128928
+
128929
+ CHECKBOX_ID:33, //单选框
128771
128930
 
128772
128931
  SYMBOL_NAME_ID:99,
128773
128932
 
@@ -128775,6 +128934,7 @@ var REPORT_COLUMN_ID=
128775
128934
  CUSTOM_NUMBER_TEXT_ID:101, //自定义数值型
128776
128935
  CUSTOM_DATETIME_TEXT_ID:102, //自定义日期类型
128777
128936
  CUSTOM_ICON_ID:103, //自定义图标
128937
+ CUSTOM_CHECKBOX_ID:104, //自定义checkbox
128778
128938
  }
128779
128939
 
128780
128940
  var MAP_COLUMN_FIELD=new Map([
@@ -128841,6 +129001,10 @@ function ChartReport()
128841
129001
  this.SelectedFixedRow=-1; //选中固定行ID
128842
129002
  this.IsDrawBorder=1; //是否绘制单元格边框
128843
129003
 
129004
+ //多选模式
129005
+ this.MultiSelectModel=0; //0=禁用 1=开启
129006
+ this.MultiSelectedRow=[]; //选中行
129007
+
128844
129008
  this.ShowSymbol=[]; //显示的股票列表 { Index:序号(排序用), Symbol:股票代码 }
128845
129009
  this.DragRow; //拖拽行
128846
129010
 
@@ -128940,6 +129104,8 @@ function ChartReport()
128940
129104
  DistanceWidth:g_JSChartResource.Report.KLine.DistanceWidth
128941
129105
  }
128942
129106
 
129107
+ this.CheckBoxConfig=CloneData(g_JSChartResource.Report.CheckBox);
129108
+
128943
129109
  //股票代码+股票名称
128944
129110
  this.ItemSymbolFontConfig={Size:g_JSChartResource.Report.Item.SymbolFont.Size, Name:g_JSChartResource.Report.Item.SymbolFont.Name};
128945
129111
  this.ItemNameFontConfg={Size:g_JSChartResource.Report.Item.NameFont.Size, Name:g_JSChartResource.Report.Item.NameFont.Name};
@@ -128958,6 +129124,7 @@ function ChartReport()
128958
129124
  this.RowHeight=0; //行高度
128959
129125
  this.BottomToolbarHeight=0; //底部工具条高度
128960
129126
  this.IsShowAllColumn=false; //是否已显示所有列
129127
+ this.DevicePixelRatio=GetDevicePixelRatio(); //分辨率
128961
129128
 
128962
129129
  //{
128963
129130
  // Type:列id, Title:标题, TextAlign:文字对齐方式, MaxText:文字最大宽度 , TextColor:文字颜色, Sort:0=不支持排序 1=本地排序 0=远程排序,
@@ -128978,8 +129145,13 @@ function ChartReport()
128978
129145
  // { Text, Color, Title:, TitleColor, Space, Margin:{ Left, Top, Right, Bottom }}
128979
129146
  this.TooltipRect=[];
128980
129147
 
129148
+ //{ Rect:rtItem, Type: 0=checkedbox, 1=button, 2=link , Stock, Index:index, Column:column }
129149
+ this.ButtonRect=[];
129150
+
128981
129151
  this.ReloadResource=function(resource)
128982
129152
  {
129153
+ this.DevicePixelRatio=GetDevicePixelRatio()
129154
+
128983
129155
  this.UpColor=g_JSChartResource.Report.UpTextColor;
128984
129156
  this.DownColor=g_JSChartResource.Report.DownTextColor;
128985
129157
  this.UnchagneColor=g_JSChartResource.Report.UnchagneTextColor;
@@ -129131,6 +129303,14 @@ function ChartReport()
129131
129303
  if (IFrameSplitOperator.IsNumber(item.ValueType)) colItem.FormatType=item.ValueType; //输出样式
129132
129304
 
129133
129305
  }
129306
+ else if (item.Type==REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID)
129307
+ {
129308
+ if (!IFrameSplitOperator.IsNumber(item.DataIndex) && !IFrameSplitOperator.IsNumber(item.BlockIndex)) continue;
129309
+ if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
129310
+ if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
129311
+ if (item.CheckBox) colItem.CheckBox=CloneData(item.CheckBox);
129312
+ else colItem.CheckBox=CloneData(g_JSChartResource.Report.CheckBox);
129313
+ }
129134
129314
  else if (item.Type==REPORT_COLUMN_ID.CUSTOM_ICON_ID)
129135
129315
  {
129136
129316
 
@@ -129147,6 +129327,7 @@ function ChartReport()
129147
129327
  {
129148
129328
  if (IFrameSplitOperator.IsNumber(item.FormatType)) colItem.FormatType=item.FormatType;
129149
129329
  }
129330
+
129150
129331
 
129151
129332
  this.Column.push(colItem);
129152
129333
  }
@@ -129243,6 +129424,10 @@ function ChartReport()
129243
129424
  { Type:REPORT_COLUMN_ID.TIME_ID, Title:"时间", TextAlign:"left", ValueType:0, TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"99:99:99.999" },
129244
129425
  { Type:REPORT_COLUMN_ID.DATE_ID, Title:"日期", TextAlign:"left", FormatType:0, TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999-99-99" },
129245
129426
 
129427
+ { Type:REPORT_COLUMN_ID.CHECKBOX_ID, Title:"", TextAlign:"center", FixedWidth:20*GetDevicePixelRatio() },
129428
+
129429
+ { Type:REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID, Title:"", TextAlign:"center", FixedWidth:20*GetDevicePixelRatio() },
129430
+
129246
129431
 
129247
129432
  ];
129248
129433
 
@@ -129268,7 +129453,9 @@ function ChartReport()
129268
129453
  {
129269
129454
  this.ShowSymbol=[];
129270
129455
  this.TooltipRect=[];
129271
-
129456
+ this.ButtonRect=[];
129457
+ this.DevicePixelRatio=GetDevicePixelRatio()
129458
+
129272
129459
  if (this.GlobalOption) this.GlobalOption.FlashBGCount=0;
129273
129460
 
129274
129461
  if (this.SizeChange) this.CalculateSize();
@@ -129320,7 +129507,14 @@ function ChartReport()
129320
129507
 
129321
129508
  this.GetCurrentPageStatus=function() //{ Start:起始索引, End:结束索引(数据), PageSize:页面可以显示几条记录, IsEnd:是否是最后一页, IsSinglePage:是否只有一页数据}
129322
129509
  {
129323
- var result={ Start:this.Data.YOffset, PageSize:this.RowCount, IsEnd:false, SelectedRow:this.SelectedRow, IsSinglePage:false, DataCount:0 };
129510
+ var result={ Start:this.Data.YOffset, PageSize:this.RowCount, IsEnd:false, SelectedRow:this.SelectedRow, IsSinglePage:false, DataCount:0, MultiSelectModel:this.MultiSelectModel };
129511
+ if (this.MultiSelectModel==1)
129512
+ {
129513
+ result.SelectedRow=-1;
129514
+ result.MultiSelectedRow=this.MultiSelectedRow.slice();
129515
+ result.MultiSelectedRow.sort((left, right)=>{ return left>right; });
129516
+ }
129517
+
129324
129518
  if (IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))
129325
129519
  {
129326
129520
  result.End=this.Data.YOffset+this.RowCount-1;
@@ -129744,19 +129938,31 @@ function ChartReport()
129744
129938
 
129745
129939
  var eventDrawBG=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_REPORT_ROW_BG);
129746
129940
  var selectedSymbol=this.GetSelectedSymbol();
129941
+
129942
+ var setSelected;
129943
+ if (this.MultiSelectModel==1) setSelected=new Set(this.MultiSelectedRow);
129944
+
129747
129945
  for(var i=this.Data.YOffset, j=0; i<this.Data.Data.length && j<this.RowCount ;++i, ++j)
129748
129946
  {
129749
129947
  var symbol=this.Data.Data[i];
129750
129948
 
129751
129949
  var bFillRow=false;
129752
- if (this.SelectedModel==0)
129950
+ if (this.MultiSelectModel==1)
129753
129951
  {
129754
- if (j==this.SelectedRow) bFillRow=true; //选中行
129952
+ if (setSelected.has(i)) bFillRow=true;
129755
129953
  }
129756
129954
  else
129757
129955
  {
129758
- if (i==this.SelectedRow) bFillRow=true; //选中行
129956
+ if (this.SelectedModel==0)
129957
+ {
129958
+ if (j==this.SelectedRow) bFillRow=true; //选中行
129959
+ }
129960
+ else
129961
+ {
129962
+ if (i==this.SelectedRow) bFillRow=true; //选中行
129963
+ }
129759
129964
  }
129965
+
129760
129966
 
129761
129967
  if (this.DragRow)
129762
129968
  {
@@ -129786,7 +129992,7 @@ function ChartReport()
129786
129992
  if (eventDrawBG && eventDrawBG.Callback)
129787
129993
  {
129788
129994
  //Out:{ BGColor: }
129789
- var sendData={ RowIndex:i, Symbol:symbol, Out:null, Selected:selectedSymbol };
129995
+ var sendData={ RowIndex:i, Symbol:symbol, Out:null, Selected:selectedSymbol, MultiSelectModel:this.MultiSelectModel };
129790
129996
  eventDrawBG.Callback(eventDrawBG,sendData,this);
129791
129997
  if (sendData.Out && sendData.Out.BGColor)
129792
129998
  {
@@ -129811,14 +130017,32 @@ function ChartReport()
129811
130017
 
129812
130018
  this.GetSelectedSymbol=function()
129813
130019
  {
129814
- if (this.SelectedRow<0) return null;
130020
+ if (this.MultiSelectModel==1)
130021
+ {
130022
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.MultiSelectedRow)) return null;
130023
+
130024
+ var aryData=[];
130025
+ for(var i=0;i<this.MultiSelectedRow.length;++i)
130026
+ {
130027
+ var item=this.Data.Data[this.MultiSelectedRow[i]];
130028
+ if (!item) continue;
129815
130029
 
129816
- var index=this.SelectedRow;
129817
- if (this.SelectedModel==0) //当前屏选中
129818
- index=this.Data.YOffset+this.SelectedRow;
130030
+ aryData.push(item);
130031
+ }
129819
130032
 
129820
- var symbol=this.Data.Data[index];
129821
- return symbol;
130033
+ return aryData;
130034
+ }
130035
+ else
130036
+ {
130037
+ if (this.SelectedRow<0) return null;
130038
+
130039
+ var index=this.SelectedRow;
130040
+ if (this.SelectedModel==0) //当前屏选中
130041
+ index=this.Data.YOffset+this.SelectedRow;
130042
+
130043
+ var symbol=this.Data.Data[index];
130044
+ return [symbol];
130045
+ }
129822
130046
  }
129823
130047
 
129824
130048
 
@@ -130146,6 +130370,29 @@ function ChartReport()
130146
130370
  {
130147
130371
  this.FormaDateDrawInfo(column, stock, drawInfo, data);
130148
130372
  }
130373
+ else if (column.Type==REPORT_COLUMN_ID.CHECKBOX_ID)
130374
+ {
130375
+ rtItem={ Left:left, Top:top, Width:column.Width, Height:this.RowHeight };
130376
+ rtItem.Right=rtItem.Left+rtItem.Width;
130377
+ rtItem.Bottom=rtItem.Top+rtItem.Height;
130378
+ drawInfo.Rect=rtItem;
130379
+ drawInfo.Checked=false;
130380
+ drawInfo.Enable=true;
130381
+ drawInfo.CheckBox=this.CheckBoxConfig;
130382
+ drawInfo.Data=stock;
130383
+ if (stock && IFrameSplitOperator.IsBool(stock.Checked))
130384
+ drawInfo.Checked=stock.Checked;
130385
+ }
130386
+ else if (column.Type==REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID)
130387
+ {
130388
+ rtItem={ Left:left, Top:top, Width:column.Width, Height:this.RowHeight };
130389
+ rtItem.Right=rtItem.Left+rtItem.Width;
130390
+ rtItem.Bottom=rtItem.Top+rtItem.Height;
130391
+ drawInfo.Rect=rtItem;
130392
+
130393
+ this.GetCustomCheckBoxDrawInfo(data, column, drawInfo);
130394
+ }
130395
+
130149
130396
 
130150
130397
  //拖拽行颜色
130151
130398
  if (rowType==3)
@@ -130159,6 +130406,10 @@ function ChartReport()
130159
130406
  {
130160
130407
  this.DrawIconItem(drawInfo, x, top, textWidth);
130161
130408
  }
130409
+ else if (column.Type==REPORT_COLUMN_ID.CHECKBOX_ID || column.Type==REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID)
130410
+ {
130411
+ this.DrawCheckbox(drawInfo, left, top, itemWidth);
130412
+ }
130162
130413
  else
130163
130414
  {
130164
130415
  if (data.FlashBG && data.FlashBG.Data && column.ID!=undefined)
@@ -130189,6 +130440,12 @@ function ChartReport()
130189
130440
  var tooltipData={ Rect:rtItem, Stock:stock, Index:index, Column:column, RowType:rowType, Type:drawInfo.Tooltip.Type, Data:drawInfo.Tooltip.Data };
130190
130441
  this.TooltipRect.push(tooltipData);
130191
130442
  }
130443
+
130444
+ if (drawInfo.Botton)
130445
+ {
130446
+ var buttonData={ Stock:stock, Index:index, Column:column, Rect:drawInfo.Botton.Rect, Type:drawInfo.Botton.Type, Data:drawInfo.Data };
130447
+ this.ButtonRect.push(buttonData);
130448
+ }
130192
130449
  }
130193
130450
 
130194
130451
  this.DrawCustomText=function(drawInfo, column, left, top, cellWidth)
@@ -130442,6 +130699,19 @@ function ChartReport()
130442
130699
  }
130443
130700
  }
130444
130701
 
130702
+ this.GetCustomCheckBoxDrawInfo=function(data, column, drawInfo)
130703
+ {
130704
+ var checkData=this.GetExtendData(data, column);
130705
+ if (!checkData) return;
130706
+ if (!IFrameSplitOperator.IsBool(checkData.Checked)) return;
130707
+
130708
+ drawInfo.Checked=checkData.Checked;
130709
+ drawInfo.Enable=true;
130710
+ drawInfo.Data=checkData;
130711
+ if (IFrameSplitOperator.IsBool(checkData.DisableCheckBox)) drawInfo.Enable=!checkData.DisableCheckBox;
130712
+ drawInfo.CheckBox=column.CheckBox;
130713
+ }
130714
+
130445
130715
  this.FormaTimeDrawInfo=function(column, stock, drawInfo, data)
130446
130716
  {
130447
130717
  if (!IFrameSplitOperator.IsNumber(stock.Time)) return;
@@ -130706,6 +130976,44 @@ function ChartReport()
130706
130976
  this.Canvas.font=this.ItemFont;
130707
130977
  }
130708
130978
 
130979
+ this.DrawCheckbox=function(drawInfo, left, top, width)
130980
+ {
130981
+ if (!IFrameSplitOperator.IsBool(drawInfo.Checked)) return;
130982
+ if (!drawInfo.CheckBox) return;
130983
+
130984
+ drawInfo.Font=`${drawInfo.CheckBox.Size*this.DevicePixelRatio}px ${drawInfo.CheckBox.Family}`;
130985
+ var textAlign=drawInfo.TextAlign;
130986
+ var size=drawInfo.CheckBox.Size*this.DevicePixelRatio;
130987
+ var x=left+drawInfo.CheckBox.Margin.Left;
130988
+ var y=top+this.RowHeight-drawInfo.CheckBox.Margin.Bottom;
130989
+ if (textAlign=='center') x=left+width/2-size/2;
130990
+ else if (textAlign=='right') x=left+width-drawInfo.CheckBox.Margin.Right;
130991
+
130992
+ this.Canvas.font=drawInfo.Font;
130993
+ this.Canvas.textBaseline="bottom";
130994
+ this.Canvas.textAlign="left";
130995
+ if (drawInfo.Checked===true)
130996
+ {
130997
+ if (drawInfo.Enable===false) this.Canvas.fillStyle=drawInfo.CheckBox.Checked.DisableColor;
130998
+ else this.Canvas.fillStyle=drawInfo.CheckBox.Checked.Color;
130999
+ this.Canvas.fillText(drawInfo.CheckBox.Checked.Symbol,x,y);
131000
+ }
131001
+ else if (drawInfo.Checked===false)
131002
+ {
131003
+ if (drawInfo.Enable===false) this.Canvas.fillStyle=drawInfo.CheckBox.Unchecked.DisableColor;
131004
+ else this.Canvas.fillStyle=drawInfo.CheckBox.Unchecked.Color;
131005
+ this.Canvas.fillText(drawInfo.CheckBox.Unchecked.Symbol,x,y);
131006
+ }
131007
+
131008
+ if (drawInfo.Enable)
131009
+ {
131010
+ var rtBox={ Left:x, Bottom:y, Width:size, Height:size };
131011
+ rtBox.Right=rtBox.Left+rtBox.Width;
131012
+ rtBox.Top=rtBox.Bottom-rtBox.Height;
131013
+ drawInfo.Botton={ Rect:rtBox, Type:0 };
131014
+ }
131015
+ }
131016
+
130709
131017
  //字体由外面设置
130710
131018
  this.TextEllipsis=function(text, maxWidth, maxText)
130711
131019
  {
@@ -131218,6 +131526,7 @@ function ChartReport()
131218
131526
 
131219
131527
  this.SelectedFixedRow=row.Index;
131220
131528
  this.SelectedRow=-1;
131529
+ this.MultiSelectedRow=[];
131221
131530
 
131222
131531
  return { Type:4, Redraw:bRedraw, Row:row }; //行
131223
131532
  }
@@ -131225,18 +131534,45 @@ function ChartReport()
131225
131534
  var row=this.PtInBody(x,y);
131226
131535
  if (row)
131227
131536
  {
131537
+ var btnStatus={ Redraw:false };
131538
+ this.OnClickButton(x, y, e, btnStatus);
131539
+
131228
131540
  var bRedraw=true;
131229
- if (this.SelectedModel==0)
131541
+ if (this.MultiSelectModel==1)
131230
131542
  {
131231
- if (this.SelectedRow==row.Index) bRedraw=false;
131232
- this.SelectedRow=row.Index;
131543
+ if (e && e.ctrlKey) //多选
131544
+ {
131545
+ var pos=this.MultiSelectedRow.indexOf(row.DataIndex);
131546
+ if (pos>=0) this.MultiSelectedRow.splice(pos,1);
131547
+ else this.MultiSelectedRow.push(row.DataIndex);
131548
+
131549
+ }
131550
+ else if (e && e.shiftKey) //批量多选
131551
+ {
131552
+ this.OnShiftClickRow(row);
131553
+ }
131554
+ else
131555
+ {
131556
+ if (this.MultiSelectedRow.length==1 && this.MultiSelectedRow[0]==row.DataIndex) bRedraw=false;
131557
+ else this.MultiSelectedRow=[row.DataIndex];
131558
+ }
131559
+
131233
131560
  this.SelectedFixedRow=-1;
131234
131561
  }
131235
- else
131562
+ else
131236
131563
  {
131237
- if (this.SelectedRow==row.DataIndex) bRedraw=false;
131238
- this.SelectedRow=row.DataIndex;
131239
- this.SelectedFixedRow=-1;
131564
+ if (this.SelectedModel==0)
131565
+ {
131566
+ if (this.SelectedRow==row.Index) bRedraw=false;
131567
+ this.SelectedRow=row.Index;
131568
+ this.SelectedFixedRow=-1;
131569
+ }
131570
+ else
131571
+ {
131572
+ if (this.SelectedRow==row.DataIndex) bRedraw=false;
131573
+ this.SelectedRow=row.DataIndex;
131574
+ this.SelectedFixedRow=-1;
131575
+ }
131240
131576
  }
131241
131577
 
131242
131578
  var eventID=JSCHART_EVENT_ID.ON_CLICK_REPORT_ROW;
@@ -131244,7 +131580,7 @@ function ChartReport()
131244
131580
 
131245
131581
  this.SendClickEvent(eventID, { Data:row, X:x, Y:y, e:e, Inside:insidePoint, UIElement:uiElement });
131246
131582
 
131247
- return { Type:2, Redraw:bRedraw, Row:row }; //行
131583
+ return { Type:2, Redraw:bRedraw || btnStatus.Redraw, Row:row }; //行
131248
131584
  }
131249
131585
 
131250
131586
  var header=this.PtInHeader(x,y);
@@ -131267,6 +131603,62 @@ function ChartReport()
131267
131603
  return null;
131268
131604
  }
131269
131605
 
131606
+ this.OnShiftClickRow=function(row)
131607
+ {
131608
+ if (this.MultiSelectedRow.length<=0)
131609
+ {
131610
+ this.MultiSelectedRow.push(row.DataIndex);
131611
+ return;
131612
+ }
131613
+
131614
+ var max=null, min=null;
131615
+ for(var i=0;i<this.MultiSelectedRow.length;++i)
131616
+ {
131617
+ var value=this.MultiSelectedRow[i];
131618
+ if (max==null || max<value) max=value;
131619
+ if (min==null || min>value) min=value;
131620
+ if (value==row.DataIndex) //移除
131621
+ {
131622
+ this.MultiSelectedRow.splice(i,1);
131623
+ return;
131624
+ }
131625
+ }
131626
+
131627
+ if (max==min)
131628
+ {
131629
+ var start=row.DataIndex, end=max;
131630
+ if (start>end)
131631
+ {
131632
+ start=max;
131633
+ end=row.DataIndex;
131634
+ }
131635
+
131636
+ this.MultiSelectedRow=[];
131637
+ for(var i=start;i<=end;++i)
131638
+ {
131639
+ this.MultiSelectedRow.push(i);
131640
+ }
131641
+ }
131642
+ else
131643
+ {
131644
+ if (row.DataIndex<=max && row.DataIndex>=min)
131645
+ {
131646
+ this.MultiSelectedRow.push(row.DataIndex);
131647
+ }
131648
+ else
131649
+ {
131650
+ var start=Math.min(row.DataIndex, min);
131651
+ var end=Math.max(row.DataIndex, max);
131652
+ this.MultiSelectedRow=[];
131653
+ for(var i=start;i<=end;++i)
131654
+ {
131655
+ this.MultiSelectedRow.push(i);
131656
+ }
131657
+ }
131658
+ }
131659
+
131660
+ }
131661
+
131270
131662
  this.OnDrawgRow=function(x, y, e) //Type: 5=顶部 6=空白行 2=行 7=底部
131271
131663
  {
131272
131664
  if (!this.Data) return null;
@@ -131303,6 +131695,33 @@ function ChartReport()
131303
131695
  return { Type:7 };
131304
131696
  }
131305
131697
 
131698
+ this.OnClickButton=function(x, y, e, status)
131699
+ {
131700
+ if (e.button!=0) return false;
131701
+
131702
+ var buttonData=this.GetButtonData(x,y);
131703
+ if (!buttonData) return true;
131704
+
131705
+ if (buttonData.Type===0)
131706
+ {
131707
+ var sendData={ Column:buttonData.Column, Index:buttonData.Index, Stock:buttonData.Stock, Data:buttonData.Data, PreventDefault: false };
131708
+ this.SendClickEvent(JSCHART_EVENT_ID.ON_CLICK_REPORT_CHECKBOX, sendData)
131709
+
131710
+ if (!sendData.PreventDefault)
131711
+ {
131712
+ if (IFrameSplitOperator.IsBool(buttonData.Data.Checked))
131713
+ buttonData.Data.Checked=!buttonData.Data.Checked;
131714
+ else
131715
+ buttonData.Data.Checked=true;
131716
+ }
131717
+
131718
+ status.Redraw=true;
131719
+ return true;
131720
+ }
131721
+
131722
+ return false;
131723
+ }
131724
+
131306
131725
  this.OnDblClick=function(x,y,e)
131307
131726
  {
131308
131727
  if (!this.Data) return false;
@@ -131540,6 +131959,24 @@ function ChartReport()
131540
131959
  return null;
131541
131960
  }
131542
131961
 
131962
+ this.GetButtonData=function(x,y)
131963
+ {
131964
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.ButtonRect)) return null;
131965
+
131966
+ for(var i=0;i<this.ButtonRect.length;++i)
131967
+ {
131968
+ var item=this.ButtonRect[i];
131969
+
131970
+ var rt=item.Rect;
131971
+ if (!rt) continue;
131972
+
131973
+ if (x>=rt.Left && x<=rt.Right && y>=rt.Top && y<=rt.Bottom)
131974
+ {
131975
+ return { Rect:item.Rect, Stock:item.Stock, Column:item.Column, Index:item.Index, Type:item.Type, Data:item.Data };
131976
+ }
131977
+ }
131978
+ }
131979
+
131543
131980
  this.PtInHeaderDragBorder=function(x, y)
131544
131981
  {
131545
131982
  if (!this.IsShowHeader) return null;
@@ -139280,7 +139717,7 @@ function HQChartScriptWorker()
139280
139717
 
139281
139718
 
139282
139719
 
139283
- var HQCHART_VERSION="1.1.13549";
139720
+ var HQCHART_VERSION="1.1.13557";
139284
139721
 
139285
139722
  function PrintHQChartVersion()
139286
139723
  {