hqchart 1.1.14898 → 1.1.14903

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.
@@ -5529,7 +5529,7 @@ IFrameSplitOperator.IsPlusNumber=function(value){if(value==null)return false;if(
5529
5529
  IFrameSplitOperator.IsInteger=function(x){return typeof x==='number'&&x%1===0;};//判断字段是否存在
5530
5530
  IFrameSplitOperator.IsObjectExist=function(obj){if(obj===undefined)return false;if(obj==null)return false;return true;};//是否时bool
5531
5531
  IFrameSplitOperator.IsBool=function(value){if(value===true||value===false)return true;return false;};IFrameSplitOperator.IsString=function(value){var type=typeof value==='undefined'?'undefined':(0,_typeof3.default)(value);if(type=='string')return true;return false;};//是否是非空的数组
5532
- IFrameSplitOperator.IsNonEmptyArray=function(ary){if(!ary)return false;if(!Array.isArray(ary))return false;return ary.length>0;};IFrameSplitOperator.IsFloat=function(value){if(value===undefined)return false;if(value==null)return false;if(isNaN(value))return false;return value!=parseInt(value);};//是否有效
5532
+ IFrameSplitOperator.IsNonEmptyArray=function(ary){if(!ary)return false;if(!Array.isArray(ary))return false;return ary.length>0;};IFrameSplitOperator.IsArray=function(ary){if(!ary)return false;if(!Array.isArray(ary))return false;return true;};IFrameSplitOperator.IsFloat=function(value){if(value===undefined)return false;if(value==null)return false;if(isNaN(value))return false;return value!=parseInt(value);};//是否有效
5533
5533
  IFrameSplitOperator.IsVaild=function(value){if(isNaN(value))return false;if(value==null)return false;if(value===undefined)return false;return true;};IFrameSplitOperator.IsUndefined=function(value){return value===undefined;};IFrameSplitOperator.IsObject=function(value){return value instanceof Object;};IFrameSplitOperator.RemoveZero=function(strValue){while(strValue.length>0){var index=strValue.length-1;var ch=strValue[index];if(ch=="0"){strValue=strValue.substr(0,index);}else if(ch=="."){strValue=strValue.substr(0,index);break;}else{break;}}return strValue;};//移除代码市场后缀
5534
5534
  IFrameSplitOperator.RemoveMarketSuffix=function(symbol){if(!symbol)return symbol;var pos=symbol.lastIndexOf(".");if(pos>0)return symbol.substring(0,pos);return symbol;};function FrameSplitKLinePriceY(){this.newMethod=IFrameSplitOperator;//派生
5535
5535
  this.newMethod();delete this.newMethod;this.CoordinateType=0;//坐标类型 0=普通坐标 1=百分比坐标 (右边坐标刻度) 2=对数对标 3=等比坐标 4=等分坐标 5=黄金分割
@@ -13326,7 +13326,8 @@ this.UIElement.ontouchstart=function(e){_this59.OnTouchStart(e);};this.UIElement
13326
13326
  this.Canvas.lineWidth=pixelTatio;//手机端需要根据分辨率比调整线段宽度
13327
13327
  this.LastMouseStatus.MouseOnStatus=null;if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash){this.Frame.Draw({IsEnableSplash:this.ChartSplashPaint.IsEnableSplash});this.ChartSplashPaint.Draw();return;}this.Frame.Draw();this.Frame.DrawLogo();//框架内图形
13328
13328
  for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(item.IsDrawFirst)item.Draw(this.LastMouseStatus);}for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(!item.IsDrawFirst)item.Draw(this.LastMouseStatus);}if(this.GlobalOption.FlashBGCount>0){this.DelayDraw(500);}};this.DelayDraw=function(frequency){var _this60=this;if(typeof this.FlashBGTimer=='number'){clearTimeout(this.FlashBGTimer);this.FlashBGTimer=null;}this.FlashBGTimer=setTimeout(function(){_this60.Draw();},frequency);};this.ResetReportStatus=function(){this.Data.XOffset=0;this.Data.YOffset=0;};this.ResetReportSelectStatus=function(){var chart=this.GetReportChart();if(chart){chart.SelectedRow=-1;chart.SelectedFixedRow=-1;chart.MultiSelectedRow=[];}};this.ClearData=function(){this.SourceData.Data=[];this.Data.Data=[];this.Data.Virtual.Count=0;this.BlockData=new _map2.default();};this.ClearMapStockData=function(){this.MapStockData=new _map2.default();};this.ResetSortStatus=function(){this.SortInfo.Field=-1;this.SortInfo.Sort=0;};this.SetSelectedRow=function(option){var reportChart=this.GetReportChart();if(!reportChart)return false;if(!reportChart.SetSelectedRow(option))return false;this.Draw();};//设置股票列表
13329
- this.SetSymbolList=function(arySymbol,option){this.ClearData();this.ResetReportStatus();this.ResetSortStatus();if(IFrameSplitOperator.IsNonEmptyArray(arySymbol)){for(var i=0;i<arySymbol.length;++i){this.Data.Data.push(arySymbol[i]);}}var chart=this.ChartPaint[0];if(chart)chart.Data=this.Data;this.Draw();};this.ChangeSymbol=function(symbol,option){var _this61=this;this.Symbol=symbol;this.ClearData();this.ResetReportStatus();this.ResetSortStatus();this.ResetReportSelectStatus();if(option){if(IFrameSplitOperator.IsNumber(option.TabSelected)){var chartTab=this.GetTabChart();if(chartTab)chartTab.SelectedTabIndex=option.TabSelected;}if(Array.isArray(option.FixedSymbol)){var chart=this.GetReportChart();if(chart){chart.FixedRowCount=0;this.FixedRowData.Type=1;this.FixedRowData.Symbol=[];var aryData=option.FixedSymbol;for(var i=0;i<aryData.length;++i){var item=aryData[i];this.FixedRowData.Symbol.push(item.Symbol);++chart.FixedRowCount;}this.SetSizeChange(true);}}if(option.SortInfo){var item=option.SortInfo;if(IFrameSplitOperator.IsNumber(item.Field))this.SortInfo.Field=item.Field;if(IFrameSplitOperator.IsNumber(item.Sort))this.SortInfo.Sort=item.Sort;}if(IFrameSplitOperator.IsBool(option.IsReloadStockList)&&option.IsReloadStockList){var requestOption={Callback:null};if(this.Symbol)requestOption.Callback=function(){_this61.RequestMemberListData();};this.MapStockData=new _map2.default();this.RequestStockListData(requestOption);return;}}this.RequestMemberListData();};//更新数据
13329
+ this.SetSymbolList=function(arySymbol,option){this.ClearData();this.ResetReportStatus();this.ResetSortStatus();if(IFrameSplitOperator.IsNonEmptyArray(arySymbol)){for(var i=0;i<arySymbol.length;++i){this.Data.Data.push(arySymbol[i]);}}var chart=this.ChartPaint[0];if(chart)chart.Data=this.Data;this.Draw();};this.ChangeSymbol=function(symbol,option){var _this61=this;this.Symbol=symbol;this.ClearData();this.ResetReportStatus();this.ResetSortStatus();this.ResetReportSelectStatus();if(option){if(IFrameSplitOperator.IsNumber(option.TabSelected)){var chartTab=this.GetTabChart();if(chartTab)chartTab.SelectedTabIndex=option.TabSelected;}if(Array.isArray(option.FixedSymbol)){var chart=this.GetReportChart();if(chart){chart.FixedRowCount=0;this.FixedRowData.Type=1;this.FixedRowData.Symbol=[];var aryData=option.FixedSymbol;for(var i=0;i<aryData.length;++i){var item=aryData[i];this.FixedRowData.Symbol.push(item.Symbol);++chart.FixedRowCount;}this.SetSizeChange(true);}}if(option.SortInfo){var item=option.SortInfo;if(IFrameSplitOperator.IsNumber(item.Field))this.SortInfo.Field=item.Field;if(IFrameSplitOperator.IsNumber(item.Sort))this.SortInfo.Sort=item.Sort;}if(IFrameSplitOperator.IsNonEmptyArray(option.Column))//字段重新设置
13330
+ {this.SetColumn(option.Column,{Draw:false});}if(IFrameSplitOperator.IsBool(option.IsReloadStockList)&&option.IsReloadStockList){var requestOption={Callback:null};if(this.Symbol)requestOption.Callback=function(){_this61.RequestMemberListData();};this.MapStockData=new _map2.default();this.RequestStockListData(requestOption);return;}}this.RequestMemberListData();};//更新数据
13330
13331
  this.UpdateFullData=function(data){var arySymbol=[];if(IFrameSplitOperator.IsNonEmptyArray(data.data)){//0=证券代码 1=股票名称
13331
13332
  for(var i=0;i<data.data.length;++i){var item=data.data[i];var symbol=item[0];var stock=null;if(this.MapStockData.has(symbol)){stock=this.MapStockData.get(symbol);}else{stock=new HQReportItem();stock.OriginalSymbol=symbol;this.MapStockData.set(symbol,stock);}stock.Symbol=this.GetSymbolNoSuffix(symbol);stock.Name=item[1];this.ReadStockJsonData(stock,item);arySymbol.push(symbol);}}//设置显示数据
13332
13333
  this.Data.Data=[];this.SourceData.Data=[];if(IFrameSplitOperator.IsNonEmptyArray(arySymbol)){for(var i=0;i<arySymbol.length;++i){this.Data.Data.push(arySymbol[i]);this.SourceData.Data.push(arySymbol[i]);}}this.Draw();};//设置全部的数据
@@ -13401,8 +13402,9 @@ Explain:'报价列表股票数据',Request:{Data:{stocks:arySymbol},symbol:this.
13401
13402
  };this.RecvStockData=function(data){var _this63=this;var setUpdateSymbol=new _set2.default();//更新的股票列表
13402
13403
  if(IFrameSplitOperator.IsNonEmptyArray(data.data)){//0=证券代码 1=股票名称 2=昨收 3=开 4=高 5=低 6=收 7=成交量 8=成交金额, 9=买价 10=买量 11=卖价 12=卖量 13=均价 14=流通股 15=总股本
13403
13404
  for(var i=0;i<data.data.length;++i){var item=data.data[i];var symbol=item[0];if(!symbol)continue;var stock=null;if(this.MapStockData.has(symbol)){stock=this.MapStockData.get(symbol);}else{stock=new HQReportItem();stock.OriginalSymbol=symbol;stock.Symbol=this.GetSymbolNoSuffix(symbol);this.MapStockData.set(symbol,stock);}this.ReadStockJsonData(stock,item);if(!setUpdateSymbol.has(symbol))setUpdateSymbol.add(symbol);}}//重新更新板块成员
13404
- if(IFrameSplitOperator.IsNonEmptyArray(data.members)){this.SourceData.Data=[];this.Data.Data=[];var aryMember=data.members;for(var i=0;i<aryMember.length;++i){var value=aryMember[i];this.Data.Data.push(value);this.SourceData.Data.push(value);}}var chart=this.ChartPaint[0];if(!chart)return;var bUpdate=false;//实时本地数据排序
13405
- var chart=this.ChartPaint[0];if(chart&&(this.SortInfo.Sort==1||this.SortInfo.Sort==2)&&IFrameSplitOperator.IsNumber(this.SortInfo.Field)&&this.SortInfo.Field>=0){var column=chart.Column[this.SortInfo.Field];var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);var bLocalSrot=true;if(event&&event.Callback){var sendData={Column:column,SortInfo:this.SortInfo,SymbolList:this.Data.Data,Result:null,PreventDefault:false};event.Callback(event,sendData,this);if(event.PreventDefault){bLocalSrot=false;if(Array.isArray(sendData.Result))this.Data.Data=sendData.Result;}}if(bLocalSrot)this.Data.Data.sort(function(left,right){return _this63.LocalSort(left,right,column,_this63.SortInfo.Sort);});bUpdate=true;//排序暂时每次都刷新
13405
+ if(IFrameSplitOperator.IsArray(data.members)){this.SourceData.Data=[];this.Data.Data=[];var aryMember=data.members;for(var i=0;i<aryMember.length;++i){var value=aryMember[i];this.Data.Data.push(value);this.SourceData.Data.push(value);}}var chart=this.ChartPaint[0];if(!chart)return;var bUpdate=false;//实时本地数据排序
13406
+ var chart=this.ChartPaint[0];if(chart&&(this.SortInfo.Sort==1||this.SortInfo.Sort==2)&&IFrameSplitOperator.IsNumber(this.SortInfo.Field)&&this.SortInfo.Field>=0){var column=chart.Column[this.SortInfo.Field];var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);//当前选中的股票
13407
+ var selectedSymbol=null;if(chart.SelectedRowData&&chart.SelectedModel==1)selectedSymbol=chart.SelectedRowData.Symbol;var bLocalSrot=true;if(event&&event.Callback){var sendData={Column:column,SortInfo:this.SortInfo,SymbolList:this.Data.Data,Result:null,PreventDefault:false};event.Callback(event,sendData,this);if(event.PreventDefault){bLocalSrot=false;if(Array.isArray(sendData.Result))this.Data.Data=sendData.Result;}}if(bLocalSrot)this.Data.Data.sort(function(left,right){return _this63.LocalSort(left,right,column,_this63.SortInfo.Sort);});if(selectedSymbol){chart.SetSelectedRow({Symbol:selectedSymbol});}bUpdate=true;//排序暂时每次都刷新
13406
13408
  }else{//更新的股票在当前页面,需要重绘
13407
13409
  var aryStock=chart.ShowSymbol;for(var i=0;i<aryStock.length;++i){if(setUpdateSymbol.has(aryStock[i].Symbol)){bUpdate=true;break;}}}if(bUpdate)this.Draw();};//读取单条股票json数据
13408
13410
  this.ReadStockJsonData=function(stock,item){//0=证券代码 1=股票名称 2=昨收 3=开 4=高 5=低 6=收 7=成交量 8=成交金额, 9=买价 10=买量 11=卖价 12=卖量 13=均价 14=流通股 15=总股本 16=涨停价 17=跌停价
@@ -13540,20 +13542,20 @@ return true;}else{return false;}}var offset=this.Data.YOffset;offset-=pageSize;i
13540
13542
  {setp=Math.abs(setp);var offset=this.Data.YOffset;if(bCycle){var pageSize=pageStatus.PageSize;for(var i=0;i<setp;++i){--offset;if(offset<0)offset=this.Data.Data.length-pageSize;}}else{if(this.Data.YOffset<=0)return false;for(var i=0;i<setp;++i){if(offset-1<0)break;--offset;}}this.Data.YOffset=offset;return true;}return false;};// option={ EnablePageCycle: true/false(是否循环翻页) }
13541
13543
  this.MoveSelectedRow=function(step,option){var chart=this.ChartPaint[0];if(!chart)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;var bPageCycle=false;if(option){if(IFrameSplitOperator.IsBool(option.EnablePageCycle))bPageCycle=option.EnablePageCycle;}var result={Redraw:false,Update:false,OldIndex:-1,NewIndex:-1};//Redraw=重绘, Update=更新数据
13542
13544
  if(chart.MultiSelectModel==1){var pageStatus=chart.GetCurrentPageStatus();if(IFrameSplitOperator.IsNonEmptyArray(pageStatus.MultiSelectedRow)){var selected=pageStatus.MultiSelectedRow[0];if(step>0){if(selected==this.Data.Data.length-1)return result;if(selected<0||selected<pageStatus.Start||selected>pageStatus.End){chart.MultiSelectedRow=[pageStatus.Start];result.Redraw=true;return result;}var offset=this.Data.YOffset;for(var i=0;i<step;++i){++selected;if(selected>pageStatus.End)++offset;if(selected>=this.Data.Data.length){selected=0;offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.MultiSelectedRow=[selected];this.Data.YOffset=offset;return result;}else if(step<0){if(selected==0)return result;if(selected<0||selected<pageStatus.Start||selected>pageStatus.End){chart.MultiSelectedRow=[pageStatus.End];result.Redraw=true;return result;}step=Math.abs(step);var offset=this.Data.YOffset;for(var i=0;i<step;++i){--selected;if(selected<pageStatus.Start)--offset;if(selected<0){selected=this.Data.Data.length-1;offset=this.Data.Data.length-pageSize;if(offset<0)offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.MultiSelectedRow=[selected];this.Data.YOffset=offset;return result;}else{return null;}return result;}else{var selected=-1;if(step>0)selected=pageStatus.Start;else if(step<0)selected=pageStatus.End;else return null;chart.MultiSelectedRow=[selected];result.Redraw=true;}return result;}if(chart.SelectedModel==0)//不可翻页模式, 只能在当前页移动
13543
- {var pageStatus=chart.GetCurrentPageStatus();var pageSize=pageStatus.End-pageStatus.Start+1;var selected=pageStatus.SelectedRow;result.OldIndex=this.Data.YOffset+selected;if(step>0){selected+=step;selected=selected%pageSize;chart.SelectedRow=selected;chart.SelectedFixedRow=-1;result.Redraw=true;result.NewIndex=this.Data.YOffset+selected;return result;}else if(step<0){selected+=step;if(selected<0){selected=selected%pageSize;selected=pageSize+selected;}chart.SelectedRow=selected;chart.SelectedFixedRow=-1;result.NewIndex=this.Data.YOffset+selected;result.Redraw=true;return result;}}else if(chart.SelectedModel==1)//可翻页模式
13544
- {var pageStatus=chart.GetCurrentPageStatus();var pageSize=pageStatus.PageSize;var selected=pageStatus.SelectedRow;result.OldIndex=pageStatus.SelectedRow;if(step>0){if(selected<0||selected<pageStatus.Start||selected>pageStatus.End){chart.SelectedRow=pageStatus.Start;result.Redraw=true;result.NewIndex=pageStatus.Start;return result;}var offset=this.Data.YOffset;for(var i=0;i<step;++i){if(selected+1>=this.Data.Data.length&&!bPageCycle)break;++selected;if(selected>pageStatus.End)++offset;if(selected>=this.Data.Data.length){selected=0;offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.SelectedRow=selected;this.Data.YOffset=offset;result.NewIndex=selected;return result;}else if(step<0){if(selected<0||selected<pageStatus.Start||selected>pageStatus.End){chart.SelectedRow=pageStatus.End;result.Redraw=true;result.NewIndex=pageStatus.End;return result;}step=Math.abs(step);var offset=this.Data.YOffset;for(var i=0;i<step;++i){if(selected<=0&&!bPageCycle)//不能循环翻页
13545
- break;--selected;if(selected<pageStatus.Start)--offset;if(selected<0){selected=this.Data.Data.length-1;offset=this.Data.Data.length-pageSize;if(offset<0)offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.SelectedRow=selected;this.Data.YOffset=offset;result.NewIndex=selected;return result;}}return null;};this.MoveSelectedRowEvent=function(oldIndex,newIndex){var chart=this.ChartPaint[0];if(!chart)return null;if(oldIndex==newIndex)return;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOVE_SELECTED_REPORT_ROW);if(!event||!event.Callback)return;if(!IFrameSplitOperator.IsNonEmptyArray(chart.Data.Data))return;var arySymbol=chart.Data.Data;var oldData=null,newData=null;if(oldIndex>=0&&oldIndex<arySymbol.length){var symbol=arySymbol[oldIndex];oldData={Symbol:symbol,Index:oldIndex};}if(newIndex>=0&&newIndex<arySymbol.length){var symbol=arySymbol[newIndex];newData={Symbol:symbol,Index:newIndex};}var endData={Old:oldData,Now:newData};event.Callback(event,endData,this);};//左右移动
13545
+ {var pageStatus=chart.GetCurrentPageStatus();var pageSize=pageStatus.End-pageStatus.Start+1;var selected=pageStatus.SelectedRow;result.OldIndex=this.Data.YOffset+selected;if(step>0){selected+=step;selected=selected%pageSize;var dataIndex=this.Data.YOffset+selected;chart.SelectedRowData={Index:selected,Symbol:this.Data.Data[dataIndex]};chart.SelectedFixedRow=-1;result.Redraw=true;result.NewIndex=dataIndex;return result;}else if(step<0){selected+=step;if(selected<0){selected=selected%pageSize;selected=pageSize+selected;}var dataIndex=this.Data.YOffset+selected;chart.SelectedRowData={Index:selected,Symbol:this.Data.Data[dataIndex]};chart.SelectedFixedRow=-1;result.NewIndex=dataIndex;result.Redraw=true;return result;}}else if(chart.SelectedModel==1)//可翻页模式
13546
+ {var pageStatus=chart.GetCurrentPageStatus();var pageSize=pageStatus.PageSize;var selected=pageStatus.SelectedRow;result.OldIndex=pageStatus.SelectedRow;if(step>0){if(selected<0||selected<pageStatus.Start||selected>pageStatus.End){chart.SelectedRow=pageStatus.Start;result.Redraw=true;result.NewIndex=pageStatus.Start;return result;}var offset=this.Data.YOffset;for(var i=0;i<step;++i){if(selected+1>=this.Data.Data.length&&!bPageCycle)break;++selected;if(selected>pageStatus.End)++offset;if(selected>=this.Data.Data.length){selected=0;offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.SelectedRowData={DataIndex:selected,Symbol:this.Data.Data[selected]};this.Data.YOffset=offset;result.NewIndex=selected;return result;}else if(step<0){if(selected<0||selected<pageStatus.Start||selected>pageStatus.End){chart.SelectedRow=pageStatus.End;result.Redraw=true;result.NewIndex=pageStatus.End;return result;}step=Math.abs(step);var offset=this.Data.YOffset;for(var i=0;i<step;++i){if(selected<=0&&!bPageCycle)//不能循环翻页
13547
+ break;--selected;if(selected<pageStatus.Start)--offset;if(selected<0){selected=this.Data.Data.length-1;offset=this.Data.Data.length-pageSize;if(offset<0)offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.SelectedRowData={DataIndex:selected,Symbol:this.Data.Data[selected]};this.Data.YOffset=offset;result.NewIndex=selected;return result;}}return null;};this.MoveSelectedRowEvent=function(oldIndex,newIndex){var chart=this.ChartPaint[0];if(!chart)return null;if(oldIndex==newIndex)return;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOVE_SELECTED_REPORT_ROW);if(!event||!event.Callback)return;if(!IFrameSplitOperator.IsNonEmptyArray(chart.Data.Data))return;var arySymbol=chart.Data.Data;var oldData=null,newData=null;if(oldIndex>=0&&oldIndex<arySymbol.length){var symbol=arySymbol[oldIndex];oldData={Symbol:symbol,Index:oldIndex};}if(newIndex>=0&&newIndex<arySymbol.length){var symbol=arySymbol[newIndex];newData={Symbol:symbol,Index:newIndex};}var endData={Old:oldData,Now:newData};event.Callback(event,endData,this);};//左右移动
13546
13548
  this.MoveXOffset=function(step){var chart=this.ChartPaint[0];if(!chart)return false;var maxOffset=chart.GetXScrollRange();if(maxOffset<=0)return false;if(step>0){if(this.Data.XOffset>=maxOffset)return false;for(var i=0;i<step;++i){if(this.Data.XOffset>=maxOffset)break;++this.Data.XOffset;}return true;}else if(step<0){if(this.Data.XOffset<=0)return false;step=Math.abs(step);for(var i=0;i<step;++i){if(this.Data.XOffset-1<0)break;--this.Data.XOffset;}return true;}return false;};this.SetXOffset=function(pos){if(!IFrameSplitOperator.IsNumber(pos))return false;var chart=this.ChartPaint[0];if(!chart)return false;var maxOffset=chart.GetXScrollRange();if(pos<0)pos=0;if(pos>maxOffset)pos=maxOffset;this.Data.XOffset=pos;return true;};this.SetYOffset=function(pos){if(!IFrameSplitOperator.IsNumber(pos))return false;var chart=this.ChartPaint[0];if(!chart)return false;var maxOffset=chart.GetYScrollRange();if(pos<0)pos=0;if(pos>maxOffset)pos=maxOffset;this.Data.YOffset=pos;return true;};this.GotoLastPage=function(){var chart=this.ChartPaint[0];if(!chart)return;//显示最后一屏
13547
13549
  var pageSize=chart.GetPageSize(true);var offset=this.Data.Data.length-pageSize;if(offset<0)offset=0;this.Data.DataOffset=offset;};this.SetColumn=function(aryColunm,option){var chart=this.ChartPaint[0];if(!chart)return;chart.SetColumn(aryColunm);chart.SizeChange=true;if(option&&option.Redraw)this.Draw();};this.SetTab=function(aryTab,option){var chart=this.ChartPaint[0];;if(!chart)return;var chartTab=chart.Tab;if(!chartTab)return;chartTab.SetTabList(aryTab);if(option&&option.Redraw)this.Draw();};this.SetVScrollbar=function(option){var chart=this.GetReportChart();if(!chart)return;var scrollbar=chart.VScrollbar;if(!scrollbar)return;scrollbar.SetOption(option);};this.SetSelectedTab=function(index,opiton){var chart=this.ChartPaint[0];;if(!chart)return;var chartTab=chart.Tab;if(!chartTab)return;chartTab.SelectedTabIndex=index;};this.ReloadResource=function(option){this.Frame.ReloadResource(option);for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(item.ReloadResource)item.ReloadResource(option);}if(option&&(option.Redraw||option.Draw)){this.SetSizeChange(true);this.Draw();}if(this.TooltipMinuteChart)this.TooltipMinuteChart.ReloadResource(option);//分时图
13548
13550
  if(this.TooltipKLineChart)this.TooltipKLineChart.ReloadResource(option);};//列排序
13549
13551
  this.SortColumn=function(index,sortType){var _this66=this;if(index<0)return false;var reportChart=this.GetReportChart();if(!reportChart)return false;var column=reportChart.Column[index];if(!column)return false;if(column.Sort!=1&&column.Sort!=2)return false;var sortInfo={Field:index,Sort:sortType};if(this.Data.Virtual&&this.Data.Virtual.Enable){this.SortInfo.Field=sortInfo.Field;this.SortInfo.Sort=sortInfo.Sort;this.Data.YOffset=0;this.ResetReportSelectStatus();this.RequestVirtualStockData();//虚拟表格
13550
13552
  return true;}else if(sortInfo.Sort==0)//不排序还原
13551
13553
  {this.Data.Data=[];if(IFrameSplitOperator.IsNonEmptyArray(this.SourceData.Data))this.Data.Data=this.SourceData.Data.slice();}else if(sortInfo.Sort==1||sortInfo.Sort==2){if(column.Sort==1)//本地排序
13552
- {var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);if(event&&event.Callback){var sendData={Column:column,SortInfo:sortInfo,SymbolList:this.Data.Data,Result:null};event.Callback(event,sendData,this);if(Array.isArray(sendData.Result))this.Data.Data=sendData.Result;}else{this.Data.Data.sort(function(left,right){return _this66.LocalSort(left,right,column,sortInfo.Sort);});}}else if(column.Sort==2)//远程排序
13554
+ {var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);var bLocalSort=true;if(event&&event.Callback){var sendData={Column:column,SortInfo:sortInfo,SymbolList:this.Data.Data,Result:null,PreventDefault:false};event.Callback(event,sendData,this);if(sendData.PreventDefault){if(Array.isArray(sendData.Result))this.Data.Data=sendData.Result;bLocalSort=false;}}if(bLocalSort)this.Data.Data.sort(function(left,right){return _this66.LocalSort(left,right,column,sortInfo.Sort);});}else if(column.Sort==2)//远程排序
13553
13555
  {if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;this.SortInfo.Field=sortInfo.Field;this.SortInfo.Sort=sortInfo.Sort;this.Data.YOffset=0;this.ResetReportSelectStatus();this.RequestStockSortData(column,sortInfo.Field,sortInfo.Sort);//远程排序
13554
13556
  return true;}}this.Data.YOffset=0;this.ResetReportSelectStatus();this.SortInfo.Field=sortInfo.Field;this.SortInfo.Sort=sortInfo.Sort;this.Draw();this.DelayUpdateStockData();return true;};//点表头
13555
13557
  this.OnClickHeader=function(clickData,e){var _this67=this;var header=clickData.Header;if(header.Column&&header.Column.EnablePopupHeaderMenu){this.PopupHeaderMenu(clickData,e);return;}if(header.Column&&(header.Column.Sort==1||header.Column.Sort==2)){var index=header.Index;var sortInfo={Field:this.SortInfo.Field,Sort:this.SortInfo.Sort};var arySortType=header.Column.SortType;if(sortInfo.Field!=index){sortInfo.Field=index;sortInfo.Sort=arySortType[0];}else{if(arySortType.length==1){sortInfo.Sort=arySortType[0];}else{for(var i=0;i<arySortType.length;++i){if(sortInfo.Sort==arySortType[i]){sortInfo.Sort=arySortType[(i+1)%arySortType.length];break;}}}}if(header.Column.Sort==1||header.Column.Sort==2){if(sortInfo.Sort==0){this.Data.Data=[];for(var i=0;i<this.SourceData.Data.length;++i){this.Data.Data.push(this.SourceData.Data[i]);}}else{if(header.Column.Sort==1)//本地排序
13556
- {var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);if(event&&event.Callback){var sendData={Column:header.Column,SortInfo:sortInfo,SymbolList:this.Data.Data,Result:null};event.Callback(event,sendData,this);if(Array.isArray(sendData.Result))this.Data.Data=sendData.Result;}else{this.Data.Data.sort(function(left,right){return _this67.LocalSort(left,right,header.Column,sortInfo.Sort);});}}else if(header.Column.Sort==2)//远程排序
13558
+ {var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);var bLocalSort=true;if(event&&event.Callback){var sendData={Column:header.Column,SortInfo:sortInfo,SymbolList:this.Data.Data,Result:null,PreventDefault:false};event.Callback(event,sendData,this);if(sendData.PreventDefault){if(Array.isArray(sendData.Result))this.Data.Data=sendData.Result;bLocalSort=false;}}if(bLocalSort)this.Data.Data.sort(function(left,right){return _this67.LocalSort(left,right,header.Column,sortInfo.Sort);});}else if(header.Column.Sort==2)//远程排序
13557
13559
  {if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;this.SortInfo.Field=sortInfo.Field;this.SortInfo.Sort=sortInfo.Sort;this.Data.YOffset=0;this.ResetReportSelectStatus();this.RequestStockSortData(header.Column,sortInfo.Field,sortInfo.Sort);//远程排序
13558
13560
  return;}}this.Data.YOffset=0;this.ResetReportSelectStatus();this.SortInfo.Field=sortInfo.Field;this.SortInfo.Sort=sortInfo.Sort;this.Draw();this.DelayUpdateStockData();}}};this.PopupHeaderMenu=function(clickData,e){var _this68=this;if(!this.JSPopMenu)return;if(!this.GetEventCallback)return;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_REPORT_HEADER_MENU);if(!event||!event.Callback)return;var header=clickData.Header;var column=header.Column;var menuData={Menu:null,Position:JSPopMenu.POSITION_ID.DROPDOWN_MENU_ID};menuData.ClickCallback=function(data){_this68.OnClickHeaderMenu(column,data);};var sendData={MenuData:menuData,Column:column,Index:header.Index,PreventDefault:false,e:e};event.Callback(event,sendData,this);if(sendData.PreventDefault==true)return;if(!menuData.Menu)return;this.PopupMenuByDrapdown(menuData,header.Rect);};//下拉菜单
13559
13561
  this.PopupMenuByDrapdown=function(menuData,rtButton){if(!this.JSPopMenu)return;var pixelRatio=GetDevicePixelRatio();var rtCell={Left:rtButton.Left/pixelRatio,Right:rtButton.Right/pixelRatio,Bottom:rtButton.Bottom/pixelRatio,Top:rtButton.Top/pixelRatio};rtCell.Width=rtCell.Right-rtCell.Left;rtCell.Height=rtCell.Bottom-rtCell.Top;var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();var offsetLeft=rtClient.left+rtScroll.Left;var offsetTop=rtClient.top+rtScroll.Top;rtCell.Left+=offsetLeft;rtCell.Right+=offsetLeft;rtCell.Top+=offsetTop;rtCell.Bottom+=offsetTop;this.JSPopMenu.CreatePopMenu(menuData);this.JSPopMenu.PopupMenuByDrapdown(rtCell);};this.GetTabPopMenu=function(tabItem){var aryMenu=[];if(IFrameSplitOperator.IsNonEmptyArray(tabItem.ArySubMenu)){for(var i=0;i<tabItem.ArySubMenu.length;++i){var item=tabItem.ArySubMenu[i];var menuItem={Name:item.Title,Data:{ID:item.CommandID,Args:[item.ID]}};if(item.Text)menuItem.Text=item.Text;aryMenu.push(menuItem);}}return aryMenu;};this.PopupTabMenu=function(menuData,tab,e){if(!this.JSPopMenu)return;var rtTab=tab.Rect;var pixelRatio=GetDevicePixelRatio();var rtCell={Left:rtTab.Left/pixelRatio,Right:rtTab.Right/pixelRatio,Bottom:rtTab.Bottom/pixelRatio,Top:rtTab.Top/pixelRatio};rtCell.Width=rtCell.Right-rtCell.Left;rtCell.Height=rtCell.Bottom-rtCell.Top;var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();var offsetLeft=rtClient.left+rtScroll.Left;var offsetTop=rtClient.top+rtScroll.Top;rtCell.Left+=offsetLeft;rtCell.Right+=offsetLeft;rtCell.Top+=offsetTop;rtCell.Bottom+=offsetTop;this.JSPopMenu.CreatePopMenu(menuData);this.JSPopMenu.PopupMenuByTab(rtCell);if(e.preventDefault)e.preventDefault();if(e.stopPropagation)e.stopPropagation();};//点击标签
@@ -13668,7 +13670,7 @@ this.FixedColumn=2;//固定列
13668
13670
  this.FixedRowCount=0;//固定行
13669
13671
  this.IsShowHeader=true;//是否显示表头
13670
13672
  this.SizeChange=true;this.SelectedModel=0;//选中模式 0=SelectedRow表示当前屏索引
13671
- this.SelectedRow=-1;//选中行ID
13673
+ this.SelectedRowData;//{ DataIndex:, Index:, Symbol: }
13672
13674
  this.SelectedFixedRow=-1;//选中固定行ID
13673
13675
  this.SelectedStyle=1;//选中行样式 1=整行填充 2=底部绘制直线
13674
13676
  this.IsDrawBorder=1;//是否绘制单元格边框
@@ -13753,7 +13755,7 @@ this.Canvas.clip();};this.Draw=function(lastMouseStatus){this.ShowSymbol=[];this
13753
13755
  var columnLeft=left;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];columnLeft+=item.Width;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];if(this.DragHeader){if(this.DragHeader.ClickData){var clickData=this.DragHeader.ClickData;if(clickData.Header.Index==i){var rtBG={Left:columnLeft,Top:top,Bottom:bottom,Right:columnLeft+item.Width};rtBG.Width=rtBG.Right-rtBG.Left;rtBG.Height=rtBG.Bottom-rtBG.Top;this.Canvas.fillStyle=this.DragSrcRowColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}}if(this.DragHeader.MoveToData){var moveToData=this.DragHeader.MoveToData;if(moveToData.Header.Index==i){var rtBG={Left:columnLeft,Top:top,Bottom:bottom,Right:columnLeft+item.Width};rtBG.Width=rtBG.Right-rtBG.Left;rtBG.Height=rtBG.Bottom-rtBG.Top;this.Canvas.fillStyle=this.DragMoveRowColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}}}columnLeft+=item.Width;}};//更新缓存变量
13754
13756
  this.UpdateCacheData=function(){this.RectClient.Left=this.ChartBorder.GetLeft();this.RectClient.Right=this.ChartBorder.GetRight();this.RectClient.Top=this.ChartBorder.GetTop();this.RectClient.Bottom=this.ChartBorder.GetBottom()-this.BottomToolbarHeight;};this.GetPageSize=function(recalculate)//recalculate 是否重新计算
13755
13757
  {if(recalculate)this.CalculateSize();var size=this.RowCount;return size;};this.GetCurrentPageStatus=function()//{ Start:起始索引, End:结束索引(数据), PageSize:页面可以显示几条记录, IsEnd:是否是最后一页, IsSinglePage:是否只有一页数据}
13756
- {var result={Start:this.Data.YOffset,PageSize:this.RowCount,IsEnd:false,SelectedRow:this.SelectedRow,IsSinglePage:false,DataCount:0,MultiSelectModel:this.MultiSelectModel};if(this.MultiSelectModel==1){result.SelectedRow=-1;result.MultiSelectedRow=this.MultiSelectedRow.slice();result.MultiSelectedRow.sort(function(left,right){return left>right;});}if(IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)){result.End=this.Data.YOffset+this.RowCount-1;result.IsSinglePage=this.Data.Data.length<=this.RowCount;result.DataCount=this.Data.Data.length;if(result.End>=this.Data.Data.length-1)result.IsEnd=true;if(result.End>=this.Data.Data.length)result.End=this.Data.Data.length-1;}else{result.Start=0;result.End=0;result.IsEnd=true;result.IsSinglePage=true;}return result;};this.CalculateSize=function()//计算大小
13758
+ {var result={Start:this.Data.YOffset,PageSize:this.RowCount,IsEnd:false,SelectedRowData:null,SelectedRow:-1,IsSinglePage:false,DataCount:0,MultiSelectModel:this.MultiSelectModel};if(this.MultiSelectModel==1){result.SelectedRow=-1;result.MultiSelectedRow=this.MultiSelectedRow.slice();result.MultiSelectedRow.sort(function(left,right){return left>right;});}else{result.SelectedRowData=this.SelectedRowData;if(this.SelectedRowData){if(this.SelectedModel==1)result.SelectedRow=this.SelectedRowData.DataIndex;else result.SelectedRow=this.SelectedRowData.Index;}}if(IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)){result.End=this.Data.YOffset+this.RowCount-1;result.IsSinglePage=this.Data.Data.length<=this.RowCount;result.DataCount=this.Data.Data.length;if(result.End>=this.Data.Data.length-1)result.IsEnd=true;if(result.End>=this.Data.Data.length)result.End=this.Data.Data.length-1;}else{result.Start=0;result.End=0;result.IsEnd=true;result.IsSinglePage=true;}return result;};this.CalculateSize=function()//计算大小
13757
13759
  {if(this.Tab&&this.Tab.IsShow){this.Tab.CalculateSize();this.BottomToolbarHeight=this.Tab.Height;}else{this.BottomToolbarHeight=0;}if(this.VScrollbar&&this.VScrollbar.Enable)this.VScrollbar.CalculateSize();this.UpdateCacheData();var pixelRatio=GetDevicePixelRatio();this.HeaderFont=this.HeaderFontConfig.Size*pixelRatio+'px '+this.HeaderFontConfig.Name;this.ItemFont=this.ItemFontConfig.Size*pixelRatio+'px '+this.ItemFontConfig.Name;this.ItemFixedFont=this.ItemFixedFontConfg.Size*pixelRatio+'px '+this.ItemFixedFontConfg.Name;this.ItemSymbolFont=this.ItemSymbolFontConfig.Size*pixelRatio+'px '+this.ItemSymbolFontConfig.Name;this.ItemNameFont=this.ItemNameFontConfg.Size*pixelRatio+'px '+this.ItemNameFontConfg.Name;this.NameSymbolFont.Symbol=this.NameSymbolV2Config.Symbol.Size*pixelRatio+'px '+this.NameSymbolV2Config.Symbol.Name;this.NameSymbolFont.Name=this.ItemSymbolFontConfig.Name.Size*pixelRatio+'px '+this.NameSymbolV2Config.Name.Name;this.ItemFontHeight=this.GetFontHeight(this.ItemFont,"擎");this.RowHeight=this.ItemFontHeight+this.ItemMergin.Top+this.ItemMergin.Bottom;this.ItemTextLines=1;this.FixedRowHeight=this.GetFontHeight(this.ItemFixedFont,"擎")+this.ItemMergin.Top+this.ItemMergin.Bottom;this.SortFont=this.SortConfig.Size*pixelRatio+'px '+this.SortConfig.Family;this.Canvas.font=this.ItemFont;var itemWidth=0;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];this.Canvas.font=this.ItemFont;if(item.Type==REPORT_COLUMN_ID.SYMBOL_NAME_ID){this.Canvas.font=this.ItemNameFont;var nameWidth=this.Canvas.measureText(item.MaxText).width;var nameHeight=this.GetFontHeight(this.ItemNameFont,"擎");this.ItemNameHeight=nameHeight;this.Canvas.font=this.ItemSymbolFont;var symbolWidth=this.Canvas.measureText(item.MaxText).width;var symboHeight=this.GetFontHeight(this.ItemSymbolFont,"擎");this.ItemSymbolHeight=symboHeight;this.Canvas.font=this.ItemFont;itemWidth=Math.max(nameWidth,symbolWidth);item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;var rowHeight=nameHeight+symboHeight+this.ItemMergin.Top+this.ItemMergin.Bottom;this.ItemTextLines=2;if(rowHeight>this.RowHeight)this.RowHeight=rowHeight;if(rowHeight>this.FixedRowHeight)this.FixedRowHeight=rowHeight;}else if(item.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER){if(IFrameSplitOperator.IsNumber(item.FixedWidth))itemWidth=item.FixedWidth;else itemWidth=this.Canvas.measureText(item.MaxText).width;item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;this.ItemTextLines=item.AryField.length;var rowHeight=this.ItemFontHeight*item.AryField.length+this.ItemMergin.Top+this.ItemMergin.Bottom;if(rowHeight>this.RowHeight)this.RowHeight=rowHeight;if(rowHeight>this.FixedRowHeight)this.FixedRowHeight=rowHeight;}else if(item.Type==REPORT_COLUMN_ID.SYMBOL_NAME_V2_ID)//单行显示
13758
13760
  {this.Canvas.font==this.NameSymbolFont.Name;var nameWidth=this.Canvas.measureText(item.MaxText).width;var nameHeight=this.GetFontHeight(this.ItemNameFont,"擎");this.Canvas.font==this.NameSymbolFont.Symbol;var symbolWidth=this.Canvas.measureText(item.MaxText2).width;var symboHeight=this.GetFontHeight(this.ItemSymbolFont,"擎");this.ItemNameHeight=Math.abs(nameHeight,symboHeight);var space=2;if(IFrameSplitOperator.IsNumber(item.Space))space=item.Space;itemWidth=nameWidth+symbolWidth+space;item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;}else{if(IFrameSplitOperator.IsNumber(item.FixedWidth))itemWidth=item.FixedWidth;else itemWidth=this.Canvas.measureText(item.MaxText).width;item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;}if(item.Icon&&item.Icon.Symbol){item.Width+=item.Icon.Size;if(item.Icon.Margin){var margin=item.Icon.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))item.Width+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))item.Width+=margin.Right;}}}this.Canvas.font=this.HeaderFont;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];if(!item.Title||item.Title.length<=0)continue;var text=item.Title;itemWidth=this.Canvas.measureText(text).width;if(item.Sort>0)itemWidth+=this.SortConfig.Size*pixelRatio;itemWidth+=4+this.HeaderMergin.Left+this.HeaderMergin.Right;if(item.Width<itemWidth)item.Width=itemWidth;}this.HeaderFontHeight=this.GetFontHeight(this.HeaderFont,"擎");if(this.HeaderRowCount<=1)//单行
13759
13761
  {this.HeaderHeight=this.HeaderFontHeight+(this.HeaderMergin.Top+this.HeaderMergin.Bottom);}else{this.HeaderHeight=this.HeaderFontHeight*this.HeaderRowCount+(this.HeaderMergin.Top+this.HeaderMergin.Bottom);}if(!this.IsShowHeader)this.HeaderHeight=0;if(this.FixedRowCount<=0)this.FixedRowHeight=0;this.RowCount=parseInt((this.RectClient.Bottom-this.RectClient.Top-this.HeaderHeight-this.FixedRowHeight*this.FixedRowCount)/this.RowHeight);var subWidth=0;var reportWidth=this.RectClient.Right-this.RectClient.Left;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];subWidth+=item.Width;}this.IsShowAllColumn=subWidth<reportWidth;};this.DrawHeaderItem=function(column,rtCell,index,option){if(column.HeaderBGColor)//背景色
@@ -13776,15 +13778,14 @@ this.IsDrawSortBGIcon=function(){if(!IFrameSplitOperator.IsNonEmptyArray(this.So
13776
13778
  for(var i=0;i<this.RowCount;++i){var drawTop=ToFixedPoint(rowTop);this.Canvas.moveTo(left,drawTop);this.Canvas.lineTo(right,drawTop);rotBottom=rowTop;rowTop+=this.RowHeight;}//竖线
13777
13779
  var columnLeft=left;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];var drawLeft=ToFixedPoint(columnLeft+item.Width);this.Canvas.moveTo(drawLeft,top);this.Canvas.lineTo(drawLeft,rotBottom);columnLeft+=item.Width;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];var drawLeft=ToFixedPoint(columnLeft+item.Width);this.Canvas.moveTo(drawLeft,top);this.Canvas.lineTo(drawLeft,rotBottom);columnLeft+=item.Width;}this.Canvas.stroke();};//获取一共多少行
13778
13780
  this.GetAllRowCount=function(){var count=this.Data.Data.length;if(this.Data.Virtual&&this.Data.Virtual.Enable)count=this.Data.Virtual.Count;return count;};this.DrawBody=function(){if(!this.Data)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)&&!this.Data.Virtual.Enable)return;this.Canvas.font=this.ItemFont;var top=this.RectClient.Top+this.HeaderHeight;var left=this.RectClient.Left;var rowWidth=this.RectClient.Right-this.RectClient.Left;var arySelectedRow=[];//固定行
13779
- var textTop=top;this.Canvas.font=this.ItemFixedFont;for(var i=0;i<this.FixedRowCount;++i){if(this.SelectedFixedRow==i){this.Canvas.fillStyle=this.SelectedColor;;this.Canvas.fillRect(left,textTop,rowWidth,this.FixedRowHeight);}if(this.FixedRowData.Type==1)this.DrawFixedSymbolRow(textTop,i);else this.DrawFixedRow(textTop,i);textTop+=this.FixedRowHeight;}textTop=top+this.FixedRowHeight*this.FixedRowCount;this.Canvas.font=this.ItemFont;var eventDrawBG=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_REPORT_ROW_BG);var selectedSymbol=this.GetSelectedSymbol();var setSelected;if(this.MultiSelectModel==1)setSelected=new _set2.default(this.MultiSelectedRow);var dataCount=this.GetAllRowCount();for(var i=this.Data.YOffset,j=0;i<dataCount&&j<this.RowCount;++i,++j){var symbol=this.Data.Data[i];var rtRowBG={Left:left,Top:textTop,Width:rowWidth,Height:this.RowHeight};rtRowBG.Right=rtRowBG.Left+rtRowBG.Width;rtRowBG.Bottom=rtRowBG.Top+rtRowBG.Height;var bFillRow=false;if(this.MultiSelectModel==1){if(setSelected.has(i))bFillRow=true;}else{if(this.SelectedModel==0){if(j==this.SelectedRow)bFillRow=true;//选中行
13780
- }else{if(i==this.SelectedRow)bFillRow=true;//选中行
13781
+ var textTop=top;this.Canvas.font=this.ItemFixedFont;for(var i=0;i<this.FixedRowCount;++i){if(this.SelectedFixedRow==i){this.Canvas.fillStyle=this.SelectedColor;;this.Canvas.fillRect(left,textTop,rowWidth,this.FixedRowHeight);}if(this.FixedRowData.Type==1)this.DrawFixedSymbolRow(textTop,i);else this.DrawFixedRow(textTop,i);textTop+=this.FixedRowHeight;}textTop=top+this.FixedRowHeight*this.FixedRowCount;this.Canvas.font=this.ItemFont;var eventDrawBG=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_REPORT_ROW_BG);var selectedSymbol=this.GetSelectedSymbol();var setSelected;if(this.MultiSelectModel==1)setSelected=new _set2.default(this.MultiSelectedRow);var dataCount=this.GetAllRowCount();for(var i=this.Data.YOffset,j=0;i<dataCount&&j<this.RowCount;++i,++j){var symbol=this.Data.Data[i];var rtRowBG={Left:left,Top:textTop,Width:rowWidth,Height:this.RowHeight};rtRowBG.Right=rtRowBG.Left+rtRowBG.Width;rtRowBG.Bottom=rtRowBG.Top+rtRowBG.Height;var bFillRow=false;if(this.MultiSelectModel==1){if(setSelected.has(i))bFillRow=true;}else{if(this.SelectedModel==0){if(this.SelectedRowData&&this.SelectedRowData.Index==j&&this.SelectedRowData.Symbol==symbol)bFillRow=true;//选中行
13782
+ }else{if(this.SelectedRowData&&this.SelectedRowData.DataIndex==i&&this.SelectedRowData.Symbol==symbol)bFillRow=true;//选中行
13781
13783
  }}if(this.DragRow){if(this.DragRow.Data){var dataIndex=this.DragRow.Data.Row.DataIndex;if(dataIndex==i){this.Canvas.fillStyle=this.DragSrcRowColor;this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);}}if(this.DragRow.MoveRow){var dataIndex=this.DragRow.MoveRow.Data.DataIndex;if(dataIndex==i){this.Canvas.fillStyle=this.DragMoveRowColor;this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);}}bFillRow=false;}this.DrawFullRowBGColor(symbol,eventDrawBG,i,rtRowBG,{Selected:selectedSymbol});this.DrawFlashFullRowBGColor(symbol,rtRowBG);if(bFillRow){this.AryFullSelectedRow.push(rtRowBG);if(this.SelectedStyle===1){this.Canvas.fillStyle=this.SelectedColor;this.Canvas.fillRect(rtRowBG.Left,rtRowBG.Top,rtRowBG.Width,rtRowBG.Height);}}this.DrawRow(symbol,textTop,i);this.ShowSymbol.push({Index:i,Symbol:symbol});textTop+=this.RowHeight;}};//绘制整行背景色
13782
13784
  this.DrawFullRowBGColor=function(symbol,event,index,rtBG,option){var data={Symbol:symbol,Stock:null};if(this.GetStockDataCallback)data.Stock=this.GetStockDataCallback(symbol);if(data.Stock&&data.Stock.BGColor){this.Canvas.fillStyle=data.Stock.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}if(event&&event.Callback){//Out:{ BGColor: }
13783
- var sendData={RowIndex:index,Symbol:symbol,Out:null,MultiSelectModel:this.MultiSelectModel};if(option){if(option.Selected)sendData.Selected=option.Selected;}event.Callback(event,sendData,this);if(sendData.Out&&sendData.Out.BGColor){this.Canvas.fillStyle=sendData.Out.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}}};this.DrawFlashFullRowBGColor=function(symbol,rtBG){var data={Symbol:symbol,FlashBG:null};if(this.GetFlashBGDataCallback)data.FlashBG=this.GetFlashBGDataCallback(symbol,Date.now());if(!data.FlashBG)return;var id=-1;if(!data.FlashBG.Data.has(id))return;var flashItem=data.FlashBG.Data.get(id);if(flashItem&&flashItem.Count){this.Canvas.fillStyle=flashItem.Color;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}--flashItem.Count;if(this.GlobalOption)++this.GlobalOption.FlashBGCount;};this.DrawSelectedRow=function(){if(this.SelectedStyle===2&&IFrameSplitOperator.IsNonEmptyArray(this.AryFullSelectedRow)){this.Canvas.fillStyle=this.SelectedLineConfig.Color;var lineWidth=this.SelectedLineConfig.Width;for(var i=0;i<this.AryFullSelectedRow.length;++i){var rtBG=this.AryFullSelectedRow[i];this.Canvas.fillRect(rtBG.Left,rtBG.Bottom-lineWidth,rtBG.Width,lineWidth);}}};this.GetSelectedSymbol=function(){if(this.MultiSelectModel==1){if(!IFrameSplitOperator.IsNonEmptyArray(this.MultiSelectedRow))return null;var aryData=[];for(var i=0;i<this.MultiSelectedRow.length;++i){var item=this.Data.Data[this.MultiSelectedRow[i]];if(!item)continue;aryData.push(item);}return aryData;}else{if(this.SelectedRow<0)return null;var index=this.SelectedRow;if(this.SelectedModel==0)//当前屏选中
13784
- index=this.Data.YOffset+this.SelectedRow;var symbol=this.Data.Data[index];return[symbol];}};//单行选中模式选中股票
13785
+ var sendData={RowIndex:index,Symbol:symbol,Out:null,MultiSelectModel:this.MultiSelectModel};if(option){if(option.Selected)sendData.Selected=option.Selected;}event.Callback(event,sendData,this);if(sendData.Out&&sendData.Out.BGColor){this.Canvas.fillStyle=sendData.Out.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}}};this.DrawFlashFullRowBGColor=function(symbol,rtBG){var data={Symbol:symbol,FlashBG:null};if(this.GetFlashBGDataCallback)data.FlashBG=this.GetFlashBGDataCallback(symbol,Date.now());if(!data.FlashBG)return;var id=-1;if(!data.FlashBG.Data.has(id))return;var flashItem=data.FlashBG.Data.get(id);if(flashItem&&flashItem.Count){this.Canvas.fillStyle=flashItem.Color;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}--flashItem.Count;if(this.GlobalOption)++this.GlobalOption.FlashBGCount;};this.DrawSelectedRow=function(){if(this.SelectedStyle===2&&IFrameSplitOperator.IsNonEmptyArray(this.AryFullSelectedRow)){this.Canvas.fillStyle=this.SelectedLineConfig.Color;var lineWidth=this.SelectedLineConfig.Width;for(var i=0;i<this.AryFullSelectedRow.length;++i){var rtBG=this.AryFullSelectedRow[i];this.Canvas.fillRect(rtBG.Left,rtBG.Bottom-lineWidth,rtBG.Width,lineWidth);}}};this.GetSelectedSymbol=function(){if(this.MultiSelectModel==1){if(!IFrameSplitOperator.IsNonEmptyArray(this.MultiSelectedRow))return null;var aryData=[];for(var i=0;i<this.MultiSelectedRow.length;++i){var item=this.Data.Data[this.MultiSelectedRow[i]];if(!item)continue;aryData.push(item);}return aryData;}else{if(!this.SelectedRowData)return null;if(!this.SelectedRowData.Symbol)return null;return[this.SelectedRowData.Symbol];}};//单行选中模式选中股票
13785
13786
  this.GetSelectedSingleSymbol=function(){if(this.MultiSelectModel==1)return null;//多选
13786
13787
  if(this.SelectedModel==0)return null;//当前屏选中
13787
- if(this.SelectedRow<0)return null;var symbol=this.Data.Data[this.SelectedRow];return symbol;};this.DrawFixedSymbolRow=function(top,dataIndex){var left=this.RectClient.Left;var chartRight=this.RectClient.Right;if(!this.FixedRowData||!IFrameSplitOperator.IsNonEmptyArray(this.FixedRowData.Symbol))return;var symbol=this.FixedRowData.Symbol[dataIndex];if(!symbol)return;this.DrawRow(symbol,top,dataIndex,1);this.ShowSymbol.push({Index:dataIndex,Symbol:symbol,RowType:1});};this.DrawFixedRow=function(top,dataIndex){var left=this.RectClient.Left;var chartRight=this.RectClient.Right;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];this.DrawFixedItem(dataIndex,i,item,left,top);left+=item.Width;if(left>=chartRight)break;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];this.DrawFixedItem(dataIndex,i,item,left,top);left+=item.Width;if(left>=chartRight)break;}};this.DrawFixedItem=function(dataIndex,colIndex,column,left,top){var x=left+this.ItemMergin.Left;var textWidth=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;var drawInfo={Text:null,TextColor:column.TextColor,TextAlign:column.TextAlign};if(this.GetFixedRowTextDrawInfo(dataIndex,colIndex,column,drawInfo)){this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth);return;}if(!this.FixedRowData||!IFrameSplitOperator.IsNonEmptyArray(this.FixedRowData.Data))return;var data=this.FixedRowData.Data;var rowData=data[dataIndex];if(!IFrameSplitOperator.IsNonEmptyArray(rowData))return;var itemData=rowData[colIndex];if(!itemData||!itemData.Text)return;drawInfo.Text=itemData.Text;if(itemData.Color)drawInfo.TextColor=itemData.Color;if(itemData.TextAlign)drawInfo.TextAlign=itemData.TextAlign;this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth);};this.DrawRow=function(symbol,top,dataIndex,rowType)//rowType 0=表格行 1=顶部固定行 2=拖拽行
13788
+ if(!this.SelectedRowData)return null;return this.SelectedRowData.Symbol;};this.DrawFixedSymbolRow=function(top,dataIndex){var left=this.RectClient.Left;var chartRight=this.RectClient.Right;if(!this.FixedRowData||!IFrameSplitOperator.IsNonEmptyArray(this.FixedRowData.Symbol))return;var symbol=this.FixedRowData.Symbol[dataIndex];if(!symbol)return;this.DrawRow(symbol,top,dataIndex,1);this.ShowSymbol.push({Index:dataIndex,Symbol:symbol,RowType:1});};this.DrawFixedRow=function(top,dataIndex){var left=this.RectClient.Left;var chartRight=this.RectClient.Right;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];this.DrawFixedItem(dataIndex,i,item,left,top);left+=item.Width;if(left>=chartRight)break;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];this.DrawFixedItem(dataIndex,i,item,left,top);left+=item.Width;if(left>=chartRight)break;}};this.DrawFixedItem=function(dataIndex,colIndex,column,left,top){var x=left+this.ItemMergin.Left;var textWidth=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;var drawInfo={Text:null,TextColor:column.TextColor,TextAlign:column.TextAlign};if(this.GetFixedRowTextDrawInfo(dataIndex,colIndex,column,drawInfo)){this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth);return;}if(!this.FixedRowData||!IFrameSplitOperator.IsNonEmptyArray(this.FixedRowData.Data))return;var data=this.FixedRowData.Data;var rowData=data[dataIndex];if(!IFrameSplitOperator.IsNonEmptyArray(rowData))return;var itemData=rowData[colIndex];if(!itemData||!itemData.Text)return;drawInfo.Text=itemData.Text;if(itemData.Color)drawInfo.TextColor=itemData.Color;if(itemData.TextAlign)drawInfo.TextAlign=itemData.TextAlign;this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth);};this.DrawRow=function(symbol,top,dataIndex,rowType)//rowType 0=表格行 1=顶部固定行 2=拖拽行
13788
13789
  {var left=this.RectClient.Left;var chartRight=this.RectClient.Right;var data={Symbol:symbol,Stock:null,Block:null};if(this.GetStockDataCallback)data.Stock=this.GetStockDataCallback(symbol);if(this.GetBlockDataCallback)data.Block=this.GetBlockDataCallback(symbol);if(this.GetFlashBGDataCallback)data.FlashBG=this.GetFlashBGDataCallback(symbol,Date.now());data.Decimal=GetfloatPrecision(symbol);//小数位数
13789
13790
  for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];this.DrawItem(dataIndex,data,item,left,top,rowType,i);left+=item.Width;if(left>=chartRight)break;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];this.DrawItem(dataIndex,data,item,left,top,rowType,i);left+=item.Width;if(left>=chartRight)break;}};this.BuildSubCellTextData=function(subItem,column,stock,drawInfo,data,option){switch(subItem.Type){case REPORT_COLUMN_ID.NAME_ID:if(stock&&stock.Name)drawInfo.Text=stock.Name;else drawInfo.Text=data.Name;break;case REPORT_COLUMN_ID.SYMBOL_ID:if(stock&&stock.Symbol)drawInfo.Text=stock.Symbol;else drawInfo.Text=data.Symbol;break;case REPORT_COLUMN_ID.PRICE_ID:case REPORT_COLUMN_ID.OPEN_ID:case REPORT_COLUMN_ID.HIGH_ID:case REPORT_COLUMN_ID.LOW_ID:case REPORT_COLUMN_ID.YCLOSE_ID:case REPORT_COLUMN_ID.BUY_PRICE_ID:case REPORT_COLUMN_ID.SELL_PRICE_ID:case REPORT_COLUMN_ID.AVERAGE_PRICE_ID:case REPORT_COLUMN_ID.FUTURES_CLOSE_ID:case REPORT_COLUMN_ID.FUTURES_YCLOSE_ID:var fieldName=MAP_COLUMN_FIELD.get(subItem.Type);if(stock&&IFrameSplitOperator.IsNumber(stock[fieldName]))this.GetPriceDrawInfo(stock[fieldName],stock,data,drawInfo,option);break;case REPORT_COLUMN_ID.INCREASE_ID:case REPORT_COLUMN_ID.AMPLITUDE_ID:case REPORT_COLUMN_ID.UPDOWN_ID:case REPORT_COLUMN_ID.RISING_SPEED_1M_ID:case REPORT_COLUMN_ID.RISING_SPEED_3M_ID:case REPORT_COLUMN_ID.RISING_SPEED_5M_ID:case REPORT_COLUMN_ID.RISING_SPEED_10M_ID:case REPORT_COLUMN_ID.RISING_SPEED_15M_ID:var fieldName=MAP_COLUMN_FIELD.get(subItem.Type);if(stock&&IFrameSplitOperator.IsNumber(stock[fieldName])){var value=stock[fieldName];var text=value.toFixed(2);if(subItem.DynamicFormat)text=subItem.DynamicFormat.replace('{Value}',text);drawInfo.Text=text;drawInfo.TextColor=this.GetUpDownColor(value,0);}break;}};this.DrawSubCellText=function(drawInfo,column,rtText){if(!drawInfo.Text)return;var text=drawInfo.Text;var x=rtText.Left;if(drawInfo.TextAlign=='center'){x=rtText.Left+rtText.Width/2;this.Canvas.textAlign="center";}else if(drawInfo.TextAlign=='right'){x=rtText.Left+rtText.Width-2;this.Canvas.textAlign="right";}else{x+=2;this.Canvas.textAlign="left";}var bClip=false;this.Canvas.textBaseline="bottom";this.Canvas.fillStyle=drawInfo.TextColor;this.Canvas.fillText(text,x,rtText.Bottom);if(bClip)this.Canvas.restore();};this.DrawItem=function(index,data,column,left,top,rowType,columnIndex){var itemWidth=column.Width;var x=left+this.ItemMergin.Left;var textWidth=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;var stock=data.Stock;var drawInfo={Text:null,TextColor:column.TextColor,TextAlign:column.TextAlign,Tooltip:null,Index:index,ColumnIndex:columnIndex};var rtItem={Left:left,Top:top,Width:column.Width,Height:this.RowHeight};rtItem.Right=rtItem.Left+rtItem.Width;rtItem.Bottom=rtItem.Top+rtItem.Height;drawInfo.Rect=rtItem;if(column.FullColBGColor){this.DrawItemBG({Rect:rtItem,BGColor:column.FullColBGColor});}if(column.Type==REPORT_COLUMN_ID.INDEX_ID){if(rowType==1)return;//固定行序号空
13790
13791
  drawInfo.Text=(index+1).toString();}else if(column.Type==REPORT_COLUMN_ID.SYMBOL_ID){if(stock&&stock.Symbol)drawInfo.Text=stock.Symbol;else drawInfo.Text=data.Symbol;this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.SYMBOL_NAME_ID){this.DrawSymbolName(data,column,left,top,rowType);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.SYMBOL_NAME_V2_ID){this.DrawSymbolNameV2(data,column,left,top,rowType);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.NAME_ID){if(stock&&stock.Name){if(IFrameSplitOperator.IsString(stock.Name)){drawInfo.Text=this.TextEllipsis(stock.Name,textWidth,column.MaxText);drawInfo.TextColor=this.GetNameColor(column,data.Symbol,rowType);}}this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.NAME_EX_ID){//复杂格式 { Text:, Symbol:{ Family:'iconfont', Size:, Data:[ { Text:'\ue631', Color:'#1c65db'}, ...] } ]}
@@ -13844,10 +13845,10 @@ this.DrawKLine=function(klineData,column,rtItem,data){if(column.IsDrawCallback)/
13844
13845
  this.GetNameColor=function(colunmInfo,symbol,rowType){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_REPORT_NAME_COLOR);if(event&&event.Callback){var sendData={Symbol:symbol,TextColor:null,RowType:rowType};event.Callback(event,sendData,this);if(sendData.TextColor)return sendData.TextColor;}return colunmInfo.TextColor;};this.GetFontHeight=function(font,word){return GetFontHeight(this.Canvas,font,word);};this.OnMouseDown=function(x,y,e)//Type: 1=tab 4=固定行 2=行 3=表头 5=右侧滚动条
13845
13846
  {if(!this.Data)return null;if(this.Tab){var tab=this.Tab.OnMouseDown(x,y,e);if(tab)return{Type:1,Tab:tab};//底部工具栏
13846
13847
  }if(this.VScrollbar){var item=this.VScrollbar.OnMouseDown(x,y,e);if(item)return{Type:5,VScrollbar:item};//右侧滚动条
13847
- }var pixelTatio=GetDevicePixelRatio();var insidePoint={X:x/pixelTatio,Y:y/pixelTatio};if(this.UIElement)var uiElement={Left:this.UIElement.getBoundingClientRect().left,Top:this.UIElement.getBoundingClientRect().top};else var uiElement={Left:null,Top:null};var row=this.PtInFixedBody(x,y);if(row){var bRedraw=true;var eventID=JSCHART_EVENT_ID.ON_CLICK_REPORT_FIXEDROW;if(e.button==2)eventID=JSCHART_EVENT_ID.ON_RCLICK_REPORT_FIXEDROW;this.SendClickEvent(eventID,{Data:row,X:x,Y:y,e:e,Inside:insidePoint,UIElement:uiElement});this.SelectedFixedRow=row.Index;this.SelectedRow=-1;this.MultiSelectedRow=[];return{Type:4,Redraw:bRedraw,Row:row};//行
13848
+ }var pixelTatio=GetDevicePixelRatio();var insidePoint={X:x/pixelTatio,Y:y/pixelTatio};if(this.UIElement)var uiElement={Left:this.UIElement.getBoundingClientRect().left,Top:this.UIElement.getBoundingClientRect().top};else var uiElement={Left:null,Top:null};var row=this.PtInFixedBody(x,y);if(row){var bRedraw=true;var eventID=JSCHART_EVENT_ID.ON_CLICK_REPORT_FIXEDROW;if(e.button==2)eventID=JSCHART_EVENT_ID.ON_RCLICK_REPORT_FIXEDROW;this.SendClickEvent(eventID,{Data:row,X:x,Y:y,e:e,Inside:insidePoint,UIElement:uiElement});this.SelectedFixedRow=row.Index;this.SelectedRowData=null;this.MultiSelectedRow=[];return{Type:4,Redraw:bRedraw,Row:row};//行
13848
13849
  }var row=this.PtInBody(x,y);if(row){var btnStatus={Redraw:false};this.OnClickButton(x,y,e,btnStatus);var bRedraw=true;if(this.MultiSelectModel==1){if(e&&e.ctrlKey)//多选
13849
13850
  {var pos=this.MultiSelectedRow.indexOf(row.DataIndex);if(pos>=0)this.MultiSelectedRow.splice(pos,1);else this.MultiSelectedRow.push(row.DataIndex);}else if(e&&e.shiftKey)//批量多选
13850
- {this.OnShiftClickRow(row);}else{if(this.MultiSelectedRow.length==1&&this.MultiSelectedRow[0]==row.DataIndex)bRedraw=false;else this.MultiSelectedRow=[row.DataIndex];}this.SelectedFixedRow=-1;}else{if(this.SelectedModel==0){if(this.SelectedRow==row.Index)bRedraw=false;this.SelectedRow=row.Index;this.SelectedFixedRow=-1;}else{if(this.SelectedRow==row.DataIndex)bRedraw=false;this.SelectedRow=row.DataIndex;this.SelectedFixedRow=-1;}}var eventID=JSCHART_EVENT_ID.ON_CLICK_REPORT_ROW;if(e.button==2)eventID=JSCHART_EVENT_ID.ON_RCLICK_REPORT_ROW;this.SendClickEvent(eventID,{Data:row,X:x,Y:y,e:e,Inside:insidePoint,UIElement:uiElement});return{Type:2,Redraw:bRedraw||btnStatus.Redraw,Row:row};//行
13851
+ {this.OnShiftClickRow(row);}else{if(this.MultiSelectedRow.length==1&&this.MultiSelectedRow[0]==row.DataIndex)bRedraw=false;else this.MultiSelectedRow=[row.DataIndex];}this.SelectedFixedRow=-1;}else{if(this.SelectedModel==0){if(this.SelectedRowData&&this.SelectedRowData.Index==row.Index&&this.SelectedRowData.Symbol==row.Symbol)bRedraw=false;this.SelectedRowData={Index:row.Index,Symbol:row.Symbol};this.SelectedFixedRow=-1;}else{if(this.SelectedRowData&&this.SelectedRowData.DataIndex==row.DataIndex&&this.SelectedRowData.Symbol==row.Symbol)bRedraw=false;this.SelectedRowData={DataIndex:row.DataIndex,Symbol:row.Symbol};this.SelectedFixedRow=-1;}}var eventID=JSCHART_EVENT_ID.ON_CLICK_REPORT_ROW;if(e.button==2)eventID=JSCHART_EVENT_ID.ON_RCLICK_REPORT_ROW;this.SendClickEvent(eventID,{Data:row,X:x,Y:y,e:e,Inside:insidePoint,UIElement:uiElement});return{Type:2,Redraw:bRedraw||btnStatus.Redraw,Row:row};//行
13851
13852
  }var header=this.PtInHeader(x,y);if(header){var eventID=JSCHART_EVENT_ID.ON_CLICK_REPORT_HEADER;if(e.button==2){eventID=JSCHART_EVENT_ID.ON_RCLICK_REPORT_HEADER;}else if(e.button==0){eventID=JSCHART_EVENT_ID.ON_CLICK_REPORT_HEADER;}this.SendClickEvent(eventID,{Data:row,X:x,Y:y,e:e,Inside:insidePoint,UIElement:uiElement});return{Type:3,Redraw:bRedraw,Header:header};//表头
13852
13853
  }return null;};this.OnShiftClickRow=function(row){if(this.MultiSelectedRow.length<=0){this.MultiSelectedRow.push(row.DataIndex);return;}var max=null,min=null;for(var i=0;i<this.MultiSelectedRow.length;++i){var value=this.MultiSelectedRow[i];if(max==null||max<value)max=value;if(min==null||min>value)min=value;if(value==row.DataIndex)//移除
13853
13854
  {this.MultiSelectedRow.splice(i,1);return;}}if(max==min){var start=row.DataIndex,end=max;if(start>end){start=max;end=row.DataIndex;}this.MultiSelectedRow=[];for(var i=start;i<=end;++i){this.MultiSelectedRow.push(i);}}else{if(row.DataIndex<=max&&row.DataIndex>=min){this.MultiSelectedRow.push(row.DataIndex);}else{var start=Math.min(row.DataIndex,min);var end=Math.max(row.DataIndex,max);this.MultiSelectedRow=[];for(var i=start;i<=end;++i){this.MultiSelectedRow.push(i);}}}};this.OnDragRow=function(x,y,e)//Type: 5=顶部 6=空白行 2=行 7=底部
@@ -13863,7 +13864,7 @@ this.Canvas.fillStyle=this.DragRowColor;this.Canvas.fillRect(rtRow.Left,rtRow.To
13863
13864
  var cellHeader={Left:rtRow.Left,Top:rtRow.Top,Right:rtRow.Right,Width:rtRow.Width,Height:this.HeaderHeight};cellHeader.Bottom=cellHeader.Top+cellHeader.Height;this.DrawHeaderItem(clickData.Header.Column,cellHeader,clickData.Header.Index,{HeaderColor:this.DragRowTextColor});var textTop=cellHeader.Bottom+this.FixedRowHeight*this.FixedRowCount;this.Canvas.font=this.ItemFont;var dataCount=this.GetAllRowCount();for(var i=this.Data.YOffset,j=0;i<dataCount&&j<this.RowCount;++i,++j){var symbol=this.Data.Data[i];var data={Symbol:symbol,Stock:null,Block:null};if(this.GetStockDataCallback)data.Stock=this.GetStockDataCallback(symbol);if(this.GetBlockDataCallback)data.Block=this.GetBlockDataCallback(symbol);if(this.GetFlashBGDataCallback)data.FlashBG=this.GetFlashBGDataCallback(symbol,Date.now());data.Decimal=GetfloatPrecision(symbol);//小数位数
13864
13865
  var item=this.Column[clickData.Header.Index];this.DrawItem(i,data,item,cellHeader.Left,textTop,3);textTop+=this.RowHeight;}};this.GetTooltipData=function(x,y){if(!IFrameSplitOperator.IsNonEmptyArray(this.TooltipRect))return null;for(var i=0;i<this.TooltipRect.length;++i){var item=this.TooltipRect[i];var rt=item.Rect;if(!rt)continue;if(x>=rt.Left&&x<=rt.Right&&y>=rt.Top&&y<=rt.Bottom){return{Rect:item.Rect,Stock:item.Stock,Column:item.Column,Index:item.Index,Type:item.Type,Data:item.Data};}}return null;};this.GetButtonData=function(x,y){if(!IFrameSplitOperator.IsNonEmptyArray(this.ButtonRect))return null;for(var i=0;i<this.ButtonRect.length;++i){var item=this.ButtonRect[i];var rt=item.Rect;if(!rt)continue;if(x>=rt.Left&&x<=rt.Right&&y>=rt.Top&&y<=rt.Bottom){return{Rect:item.Rect,Stock:item.Stock,Column:item.Column,Index:item.Index,Type:item.Type,Data:item.Data,ColumnIndex:item.ColumnIndex};}}};this.PtInHeaderDragBorder=function(x,y){if(!this.IsShowHeader)return null;var left=this.RectClient.Left;var right=this.RectClient.Right;var top=this.RectClient.Top;var bottom=top+this.HeaderHeight;if(!(x>=left&&x<=right&&y>=top&&y<=bottom))return null;var textLeft=left;var dragBarWidth=5*GetDevicePixelRatio();//固定列
13865
13866
  for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];if(item.EnableDragWidth===true){var header={Right:textLeft+item.Width,Top:top,Bottom:bottom};header.Left=header.Right-dragBarWidth;if(x>=header.Left&&x<=header.Right&&y>=header.Top&&y<=header.Bottom){return{Rect:header,Column:item,Index:i,IsFixed:true};}}textLeft+=item.Width;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];if(textLeft>=right)break;if(item.EnableDragWidth===true){var header={Right:textLeft+item.Width,Top:top,Bottom:bottom};header.Left=header.Right-dragBarWidth;if(x>=header.Left&&x<=header.Right&&y>=header.Top&&y<=header.Bottom){return{Rect:header,Column:item,Index:i,IsFixed:false};}}textLeft+=item.Width;}return null;};//设置选中行 option={ Symbol:, AutoYScroll:true/false Y滚动条自定定位 }
13866
- this.SetSelectedRow=function(option){if(!option)return false;if(this.SelectedModel===0)return false;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return false;if(option.Symbol){var symbol=option.Symbol;var bFinder=false;if(this.SelectedRow>=0){var item=this.Data.Data[this.SelectedRow];if(symbol==item)bFinder=true;}if(!bFinder){for(var i=0;i<this.Data.Data.length;++i){var item=this.Data.Data[i];if(symbol==item){this.SelectedRow=i;bFinder=true;break;}}}if(!bFinder)return false;if(option.AutoYScroll===true){this.UpdatePageYOffset({SelectedRow:this.SelectedRow});}return bFinder;}return false;};this.UpdatePageYOffset=function(option){if(!option)return;var selectedRow=option.SelectedRow;if(selectedRow<0)return;var pageStatus=this.GetCurrentPageStatus();if(pageStatus.IsSinglePage)return;if(selectedRow>=pageStatus.Start&&selectedRow<=pageStatus.End)return;this.Data.YOffset=selectedRow;//选中行不在当前屏 设置为第1行
13867
+ this.SetSelectedRow=function(option){if(!option)return false;if(this.SelectedModel===0)return false;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return false;if(option.Symbol){var symbol=option.Symbol;var bFinder=false;if(this.SelectedRowData){var item=this.Data.Data[this.SelectedRowData.DataIndex];if(symbol==item&&symbol==this.SelectedRowData.Symbol)bFinder=true;}if(!bFinder){for(var i=0;i<this.Data.Data.length;++i){var item=this.Data.Data[i];if(symbol==item){this.SelectedRowData={DataIndex:i,Symbol:item};bFinder=true;break;}}}if(!bFinder)return false;if(option.AutoYScroll===true){this.UpdatePageYOffset({SelectedRow:this.SelectedRowData.DataIndex});}return bFinder;}return false;};this.UpdatePageYOffset=function(option){if(!option)return;var selectedRow=option.SelectedRow;if(selectedRow<0)return;var pageStatus=this.GetCurrentPageStatus();if(pageStatus.IsSinglePage)return;if(selectedRow>=pageStatus.Start&&selectedRow<=pageStatus.End)return;this.Data.YOffset=selectedRow;//选中行不在当前屏 设置为第1行
13867
13868
  };}//报价列表底部tab和横向滚动条
13868
13869
  function ChartReportTab(){this.Canvas;//画布
13869
13870
  this.ChartBorder;//边框信息
@@ -15173,7 +15174,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
15173
15174
  this.ExecuteScript(item,data);}this.Status=0;}};this.OnExecuteFinish=function(data,indexInfo,jsExectute,jobInfo){var message={Data:data,IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.FINISH_EXECUTE_SCRIPT,JobInfo:jobInfo};postMessage(message);};this.OnExecuteError=function(error,indexInfo,jobData){var message={IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.ERROR_EXECUTE_SCRIPT,Error:error};postMessage(message);};}/********************************************************************************
15174
15175
  * 版本信息输出
15175
15176
  *
15176
- */var HQCHART_VERSION="1.1.14897";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
15177
+ */var HQCHART_VERSION="1.1.14902";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
15177
15178
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
15178
15179
  // BaseIndex:BaseIndex,
15179
15180
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14898",
3
+ "version": "1.1.14903",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -54211,6 +54211,14 @@ IFrameSplitOperator.IsNonEmptyArray=function(ary)
54211
54211
  return ary.length>0;
54212
54212
  }
54213
54213
 
54214
+ IFrameSplitOperator.IsArray=function(ary)
54215
+ {
54216
+ if (!ary) return false;
54217
+ if (!Array.isArray(ary)) return false;
54218
+
54219
+ return true;
54220
+ }
54221
+
54214
54222
  IFrameSplitOperator.IsFloat=function(value)
54215
54223
  {
54216
54224
  if (value===undefined) return false;
@@ -1022,6 +1022,11 @@ function JSReportChartContainer(uielement)
1022
1022
  if (IFrameSplitOperator.IsNumber(item.Sort)) this.SortInfo.Sort=item.Sort;
1023
1023
  }
1024
1024
 
1025
+ if (IFrameSplitOperator.IsNonEmptyArray(option.Column)) //字段重新设置
1026
+ {
1027
+ this.SetColumn(option.Column, { Draw:false })
1028
+ }
1029
+
1025
1030
  if (IFrameSplitOperator.IsBool(option.IsReloadStockList) && option.IsReloadStockList)
1026
1031
  {
1027
1032
  var requestOption={ Callback:null };
@@ -1030,7 +1035,6 @@ function JSReportChartContainer(uielement)
1030
1035
  this.RequestStockListData(requestOption);
1031
1036
  return;
1032
1037
  }
1033
-
1034
1038
  }
1035
1039
 
1036
1040
  this.RequestMemberListData();
@@ -1585,7 +1589,7 @@ function JSReportChartContainer(uielement)
1585
1589
  }
1586
1590
 
1587
1591
  //重新更新板块成员
1588
- if (IFrameSplitOperator.IsNonEmptyArray(data.members))
1592
+ if (IFrameSplitOperator.IsArray(data.members))
1589
1593
  {
1590
1594
  this.SourceData.Data=[];
1591
1595
  this.Data.Data=[];
@@ -1608,6 +1612,11 @@ function JSReportChartContainer(uielement)
1608
1612
  {
1609
1613
  var column=chart.Column[this.SortInfo.Field];
1610
1614
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);
1615
+
1616
+ //当前选中的股票
1617
+ var selectedSymbol=null;
1618
+ if (chart.SelectedRowData && chart.SelectedModel==1) selectedSymbol=chart.SelectedRowData.Symbol;
1619
+
1611
1620
  var bLocalSrot=true;
1612
1621
  if (event && event.Callback)
1613
1622
  {
@@ -1621,7 +1630,12 @@ function JSReportChartContainer(uielement)
1621
1630
  }
1622
1631
 
1623
1632
  if (bLocalSrot) this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, column, this.SortInfo.Sort); });
1624
-
1633
+
1634
+ if (selectedSymbol)
1635
+ {
1636
+ chart.SetSelectedRow({ Symbol:selectedSymbol });
1637
+ }
1638
+
1625
1639
  bUpdate=true; //排序暂时每次都刷新
1626
1640
  }
1627
1641
  else
@@ -3290,10 +3304,11 @@ function JSReportChartContainer(uielement)
3290
3304
  {
3291
3305
  selected+=step;
3292
3306
  selected=selected%pageSize;
3293
- chart.SelectedRow=selected;
3307
+ var dataIndex=this.Data.YOffset+selected;
3308
+ chart.SelectedRowData={ Index:selected, Symbol:this.Data.Data[dataIndex] };
3294
3309
  chart.SelectedFixedRow=-1;
3295
3310
  result.Redraw=true;
3296
- result.NewIndex=this.Data.YOffset+selected;
3311
+ result.NewIndex=dataIndex
3297
3312
  return result;
3298
3313
  }
3299
3314
  else if (step<0)
@@ -3304,10 +3319,10 @@ function JSReportChartContainer(uielement)
3304
3319
  selected=selected%pageSize;
3305
3320
  selected=pageSize+selected;
3306
3321
  }
3307
-
3308
- chart.SelectedRow=selected;
3322
+ var dataIndex=this.Data.YOffset+selected;
3323
+ chart.SelectedRowData={ Index:selected, Symbol:this.Data.Data[dataIndex] };
3309
3324
  chart.SelectedFixedRow=-1;
3310
- result.NewIndex=this.Data.YOffset+selected;
3325
+ result.NewIndex=dataIndex;
3311
3326
  result.Redraw=true;
3312
3327
  return result;
3313
3328
  }
@@ -3347,7 +3362,7 @@ function JSReportChartContainer(uielement)
3347
3362
  result.Redraw=true;
3348
3363
  result.Update=(offset!=this.Data.YOffset);
3349
3364
 
3350
- chart.SelectedRow=selected;
3365
+ chart.SelectedRowData={ DataIndex:selected, Symbol:this.Data.Data[selected] };
3351
3366
  this.Data.YOffset=offset;
3352
3367
  result.NewIndex=selected;
3353
3368
  return result;
@@ -3383,7 +3398,7 @@ function JSReportChartContainer(uielement)
3383
3398
  result.Redraw=true;
3384
3399
  result.Update=(offset!=this.Data.YOffset);
3385
3400
 
3386
- chart.SelectedRow=selected;
3401
+ chart.SelectedRowData={ DataIndex:selected, Symbol:this.Data.Data[selected] };
3387
3402
  this.Data.YOffset=offset;
3388
3403
  result.NewIndex=selected;
3389
3404
 
@@ -3599,16 +3614,20 @@ function JSReportChartContainer(uielement)
3599
3614
  if (column.Sort==1) //本地排序
3600
3615
  {
3601
3616
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);
3617
+ var bLocalSort=true;
3602
3618
  if (event && event.Callback)
3603
3619
  {
3604
- var sendData={ Column:column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null };
3620
+ var sendData={ Column:column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null, PreventDefault:false };
3605
3621
  event.Callback (event, sendData, this);
3606
- if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
3607
- }
3608
- else
3609
- {
3610
- this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, column, sortInfo.Sort); });
3622
+ if (sendData.PreventDefault)
3623
+ {
3624
+ if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
3625
+ bLocalSort=false;
3626
+ }
3611
3627
  }
3628
+
3629
+
3630
+ if (bLocalSort) this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, column, sortInfo.Sort); });
3612
3631
  }
3613
3632
  else if (column.Sort==2) //远程排序
3614
3633
  {
@@ -3686,16 +3705,22 @@ function JSReportChartContainer(uielement)
3686
3705
  if (header.Column.Sort==1) //本地排序
3687
3706
  {
3688
3707
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);
3708
+ var bLocalSort=true;
3689
3709
  if (event && event.Callback)
3690
3710
  {
3691
- var sendData={ Column:header.Column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null };
3711
+ var sendData={ Column:header.Column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null, PreventDefault:false};
3692
3712
  event.Callback (event, sendData, this);
3693
- if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
3694
- }
3695
- else
3696
- {
3697
- this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, header.Column, sortInfo.Sort); });
3713
+ if (sendData.PreventDefault)
3714
+ {
3715
+ if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
3716
+ bLocalSort=false;
3717
+ }
3718
+
3698
3719
  }
3720
+
3721
+
3722
+ if (bLocalSort) this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, header.Column, sortInfo.Sort); });
3723
+
3699
3724
  }
3700
3725
  else if (header.Column.Sort==2) //远程排序
3701
3726
  {
@@ -4900,7 +4925,7 @@ function ChartReport()
4900
4925
  this.SizeChange=true;
4901
4926
 
4902
4927
  this.SelectedModel=0; //选中模式 0=SelectedRow表示当前屏索引
4903
- this.SelectedRow=-1; //选中行ID
4928
+ this.SelectedRowData; //{ DataIndex:, Index:, Symbol: }
4904
4929
  this.SelectedFixedRow=-1; //选中固定行ID
4905
4930
  this.SelectedStyle=1; //选中行样式 1=整行填充 2=底部绘制直线
4906
4931
  this.IsDrawBorder=1; //是否绘制单元格边框
@@ -5672,13 +5697,23 @@ function ChartReport()
5672
5697
 
5673
5698
  this.GetCurrentPageStatus=function() //{ Start:起始索引, End:结束索引(数据), PageSize:页面可以显示几条记录, IsEnd:是否是最后一页, IsSinglePage:是否只有一页数据}
5674
5699
  {
5675
- var result={ Start:this.Data.YOffset, PageSize:this.RowCount, IsEnd:false, SelectedRow:this.SelectedRow, IsSinglePage:false, DataCount:0, MultiSelectModel:this.MultiSelectModel };
5700
+ var result={ Start:this.Data.YOffset, PageSize:this.RowCount, IsEnd:false, SelectedRowData:null, SelectedRow:-1, IsSinglePage:false, DataCount:0, MultiSelectModel:this.MultiSelectModel };
5701
+
5676
5702
  if (this.MultiSelectModel==1)
5677
5703
  {
5678
5704
  result.SelectedRow=-1;
5679
5705
  result.MultiSelectedRow=this.MultiSelectedRow.slice();
5680
5706
  result.MultiSelectedRow.sort((left, right)=>{ return left>right; });
5681
5707
  }
5708
+ else
5709
+ {
5710
+ result.SelectedRowData=this.SelectedRowData;
5711
+ if (this.SelectedRowData)
5712
+ {
5713
+ if (this.SelectedModel==1) result.SelectedRow=this.SelectedRowData.DataIndex;
5714
+ else result.SelectedRow=this.SelectedRowData.Index;
5715
+ }
5716
+ }
5682
5717
 
5683
5718
  if (IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))
5684
5719
  {
@@ -6190,11 +6225,13 @@ function ChartReport()
6190
6225
  {
6191
6226
  if (this.SelectedModel==0)
6192
6227
  {
6193
- if (j==this.SelectedRow) bFillRow=true; //选中行
6228
+ if (this.SelectedRowData && this.SelectedRowData.Index==j && this.SelectedRowData.Symbol==symbol)
6229
+ bFillRow=true; //选中行
6194
6230
  }
6195
6231
  else
6196
6232
  {
6197
- if (i==this.SelectedRow) bFillRow=true; //选中行
6233
+ if (this.SelectedRowData && this.SelectedRowData.DataIndex==i && this.SelectedRowData.Symbol==symbol)
6234
+ bFillRow=true; //选中行
6198
6235
  }
6199
6236
  }
6200
6237
 
@@ -6329,14 +6366,10 @@ function ChartReport()
6329
6366
  }
6330
6367
  else
6331
6368
  {
6332
- if (this.SelectedRow<0) return null;
6369
+ if (!this.SelectedRowData) return null;
6370
+ if (!this.SelectedRowData.Symbol) return null;
6333
6371
 
6334
- var index=this.SelectedRow;
6335
- if (this.SelectedModel==0) //当前屏选中
6336
- index=this.Data.YOffset+this.SelectedRow;
6337
-
6338
- var symbol=this.Data.Data[index];
6339
- return [symbol];
6372
+ return [this.SelectedRowData.Symbol];
6340
6373
  }
6341
6374
  }
6342
6375
 
@@ -6345,10 +6378,9 @@ function ChartReport()
6345
6378
  {
6346
6379
  if (this.MultiSelectModel==1) return null; //多选
6347
6380
  if (this.SelectedModel==0) return null; //当前屏选中
6348
- if (this.SelectedRow<0) return null;
6381
+ if (!this.SelectedRowData) return null;
6349
6382
 
6350
- var symbol=this.Data.Data[this.SelectedRow];
6351
- return symbol;
6383
+ return this.SelectedRowData.Symbol;
6352
6384
  }
6353
6385
 
6354
6386
 
@@ -8570,7 +8602,7 @@ function ChartReport()
8570
8602
  this.SendClickEvent(eventID, { Data:row, X:x, Y:y, e:e, Inside:insidePoint, UIElement:uiElement });
8571
8603
 
8572
8604
  this.SelectedFixedRow=row.Index;
8573
- this.SelectedRow=-1;
8605
+ this.SelectedRowData=null;
8574
8606
  this.MultiSelectedRow=[];
8575
8607
 
8576
8608
  return { Type:4, Redraw:bRedraw, Row:row }; //行
@@ -8608,14 +8640,18 @@ function ChartReport()
8608
8640
  {
8609
8641
  if (this.SelectedModel==0)
8610
8642
  {
8611
- if (this.SelectedRow==row.Index) bRedraw=false;
8612
- this.SelectedRow=row.Index;
8643
+ if (this.SelectedRowData && this.SelectedRowData.Index==row.Index && this.SelectedRowData.Symbol==row.Symbol)
8644
+ bRedraw=false;
8645
+ this.SelectedRowData={ Index:row.Index, Symbol:row.Symbol };
8613
8646
  this.SelectedFixedRow=-1;
8614
8647
  }
8615
8648
  else
8616
8649
  {
8617
- if (this.SelectedRow==row.DataIndex) bRedraw=false;
8618
- this.SelectedRow=row.DataIndex;
8650
+
8651
+ if (this.SelectedRowData && this.SelectedRowData.DataIndex==row.DataIndex && this.SelectedRowData.Symbol==row.Symbol)
8652
+ bRedraw=false;
8653
+
8654
+ this.SelectedRowData={ DataIndex:row.DataIndex, Symbol:row.Symbol };
8619
8655
  this.SelectedFixedRow=-1;
8620
8656
  }
8621
8657
  }
@@ -9170,10 +9206,10 @@ function ChartReport()
9170
9206
  var symbol=option.Symbol;
9171
9207
  var bFinder=false;
9172
9208
 
9173
- if (this.SelectedRow>=0)
9209
+ if (this.SelectedRowData)
9174
9210
  {
9175
- var item=this.Data.Data[this.SelectedRow];
9176
- if (symbol==item) bFinder=true;
9211
+ var item=this.Data.Data[this.SelectedRowData.DataIndex];
9212
+ if (symbol==item && symbol==this.SelectedRowData.Symbol) bFinder=true;
9177
9213
  }
9178
9214
 
9179
9215
  if (!bFinder)
@@ -9183,7 +9219,7 @@ function ChartReport()
9183
9219
  var item=this.Data.Data[i];
9184
9220
  if (symbol==item)
9185
9221
  {
9186
- this.SelectedRow=i;
9222
+ this.SelectedRowData={ DataIndex:i, Symbol:item };
9187
9223
  bFinder=true;
9188
9224
  break;
9189
9225
  }
@@ -9194,7 +9230,7 @@ function ChartReport()
9194
9230
 
9195
9231
  if (option.AutoYScroll===true)
9196
9232
  {
9197
- this.UpdatePageYOffset({ SelectedRow:this.SelectedRow });
9233
+ this.UpdatePageYOffset({ SelectedRow:this.SelectedRowData.DataIndex });
9198
9234
  }
9199
9235
 
9200
9236
  return bFinder;
@@ -58307,6 +58307,14 @@ IFrameSplitOperator.IsNonEmptyArray=function(ary)
58307
58307
  return ary.length>0;
58308
58308
  }
58309
58309
 
58310
+ IFrameSplitOperator.IsArray=function(ary)
58311
+ {
58312
+ if (!ary) return false;
58313
+ if (!Array.isArray(ary)) return false;
58314
+
58315
+ return true;
58316
+ }
58317
+
58310
58318
  IFrameSplitOperator.IsFloat=function(value)
58311
58319
  {
58312
58320
  if (value===undefined) return false;
@@ -138547,6 +138555,11 @@ function JSReportChartContainer(uielement)
138547
138555
  if (IFrameSplitOperator.IsNumber(item.Sort)) this.SortInfo.Sort=item.Sort;
138548
138556
  }
138549
138557
 
138558
+ if (IFrameSplitOperator.IsNonEmptyArray(option.Column)) //字段重新设置
138559
+ {
138560
+ this.SetColumn(option.Column, { Draw:false })
138561
+ }
138562
+
138550
138563
  if (IFrameSplitOperator.IsBool(option.IsReloadStockList) && option.IsReloadStockList)
138551
138564
  {
138552
138565
  var requestOption={ Callback:null };
@@ -138555,7 +138568,6 @@ function JSReportChartContainer(uielement)
138555
138568
  this.RequestStockListData(requestOption);
138556
138569
  return;
138557
138570
  }
138558
-
138559
138571
  }
138560
138572
 
138561
138573
  this.RequestMemberListData();
@@ -139110,7 +139122,7 @@ function JSReportChartContainer(uielement)
139110
139122
  }
139111
139123
 
139112
139124
  //重新更新板块成员
139113
- if (IFrameSplitOperator.IsNonEmptyArray(data.members))
139125
+ if (IFrameSplitOperator.IsArray(data.members))
139114
139126
  {
139115
139127
  this.SourceData.Data=[];
139116
139128
  this.Data.Data=[];
@@ -139133,6 +139145,11 @@ function JSReportChartContainer(uielement)
139133
139145
  {
139134
139146
  var column=chart.Column[this.SortInfo.Field];
139135
139147
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);
139148
+
139149
+ //当前选中的股票
139150
+ var selectedSymbol=null;
139151
+ if (chart.SelectedRowData && chart.SelectedModel==1) selectedSymbol=chart.SelectedRowData.Symbol;
139152
+
139136
139153
  var bLocalSrot=true;
139137
139154
  if (event && event.Callback)
139138
139155
  {
@@ -139146,7 +139163,12 @@ function JSReportChartContainer(uielement)
139146
139163
  }
139147
139164
 
139148
139165
  if (bLocalSrot) this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, column, this.SortInfo.Sort); });
139149
-
139166
+
139167
+ if (selectedSymbol)
139168
+ {
139169
+ chart.SetSelectedRow({ Symbol:selectedSymbol });
139170
+ }
139171
+
139150
139172
  bUpdate=true; //排序暂时每次都刷新
139151
139173
  }
139152
139174
  else
@@ -140815,10 +140837,11 @@ function JSReportChartContainer(uielement)
140815
140837
  {
140816
140838
  selected+=step;
140817
140839
  selected=selected%pageSize;
140818
- chart.SelectedRow=selected;
140840
+ var dataIndex=this.Data.YOffset+selected;
140841
+ chart.SelectedRowData={ Index:selected, Symbol:this.Data.Data[dataIndex] };
140819
140842
  chart.SelectedFixedRow=-1;
140820
140843
  result.Redraw=true;
140821
- result.NewIndex=this.Data.YOffset+selected;
140844
+ result.NewIndex=dataIndex
140822
140845
  return result;
140823
140846
  }
140824
140847
  else if (step<0)
@@ -140829,10 +140852,10 @@ function JSReportChartContainer(uielement)
140829
140852
  selected=selected%pageSize;
140830
140853
  selected=pageSize+selected;
140831
140854
  }
140832
-
140833
- chart.SelectedRow=selected;
140855
+ var dataIndex=this.Data.YOffset+selected;
140856
+ chart.SelectedRowData={ Index:selected, Symbol:this.Data.Data[dataIndex] };
140834
140857
  chart.SelectedFixedRow=-1;
140835
- result.NewIndex=this.Data.YOffset+selected;
140858
+ result.NewIndex=dataIndex;
140836
140859
  result.Redraw=true;
140837
140860
  return result;
140838
140861
  }
@@ -140872,7 +140895,7 @@ function JSReportChartContainer(uielement)
140872
140895
  result.Redraw=true;
140873
140896
  result.Update=(offset!=this.Data.YOffset);
140874
140897
 
140875
- chart.SelectedRow=selected;
140898
+ chart.SelectedRowData={ DataIndex:selected, Symbol:this.Data.Data[selected] };
140876
140899
  this.Data.YOffset=offset;
140877
140900
  result.NewIndex=selected;
140878
140901
  return result;
@@ -140908,7 +140931,7 @@ function JSReportChartContainer(uielement)
140908
140931
  result.Redraw=true;
140909
140932
  result.Update=(offset!=this.Data.YOffset);
140910
140933
 
140911
- chart.SelectedRow=selected;
140934
+ chart.SelectedRowData={ DataIndex:selected, Symbol:this.Data.Data[selected] };
140912
140935
  this.Data.YOffset=offset;
140913
140936
  result.NewIndex=selected;
140914
140937
 
@@ -141124,16 +141147,20 @@ function JSReportChartContainer(uielement)
141124
141147
  if (column.Sort==1) //本地排序
141125
141148
  {
141126
141149
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);
141150
+ var bLocalSort=true;
141127
141151
  if (event && event.Callback)
141128
141152
  {
141129
- var sendData={ Column:column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null };
141153
+ var sendData={ Column:column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null, PreventDefault:false };
141130
141154
  event.Callback (event, sendData, this);
141131
- if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
141132
- }
141133
- else
141134
- {
141135
- this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, column, sortInfo.Sort); });
141155
+ if (sendData.PreventDefault)
141156
+ {
141157
+ if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
141158
+ bLocalSort=false;
141159
+ }
141136
141160
  }
141161
+
141162
+
141163
+ if (bLocalSort) this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, column, sortInfo.Sort); });
141137
141164
  }
141138
141165
  else if (column.Sort==2) //远程排序
141139
141166
  {
@@ -141211,16 +141238,22 @@ function JSReportChartContainer(uielement)
141211
141238
  if (header.Column.Sort==1) //本地排序
141212
141239
  {
141213
141240
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);
141241
+ var bLocalSort=true;
141214
141242
  if (event && event.Callback)
141215
141243
  {
141216
- var sendData={ Column:header.Column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null };
141244
+ var sendData={ Column:header.Column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null, PreventDefault:false};
141217
141245
  event.Callback (event, sendData, this);
141218
- if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
141219
- }
141220
- else
141221
- {
141222
- this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, header.Column, sortInfo.Sort); });
141246
+ if (sendData.PreventDefault)
141247
+ {
141248
+ if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
141249
+ bLocalSort=false;
141250
+ }
141251
+
141223
141252
  }
141253
+
141254
+
141255
+ if (bLocalSort) this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, header.Column, sortInfo.Sort); });
141256
+
141224
141257
  }
141225
141258
  else if (header.Column.Sort==2) //远程排序
141226
141259
  {
@@ -142425,7 +142458,7 @@ function ChartReport()
142425
142458
  this.SizeChange=true;
142426
142459
 
142427
142460
  this.SelectedModel=0; //选中模式 0=SelectedRow表示当前屏索引
142428
- this.SelectedRow=-1; //选中行ID
142461
+ this.SelectedRowData; //{ DataIndex:, Index:, Symbol: }
142429
142462
  this.SelectedFixedRow=-1; //选中固定行ID
142430
142463
  this.SelectedStyle=1; //选中行样式 1=整行填充 2=底部绘制直线
142431
142464
  this.IsDrawBorder=1; //是否绘制单元格边框
@@ -143197,13 +143230,23 @@ function ChartReport()
143197
143230
 
143198
143231
  this.GetCurrentPageStatus=function() //{ Start:起始索引, End:结束索引(数据), PageSize:页面可以显示几条记录, IsEnd:是否是最后一页, IsSinglePage:是否只有一页数据}
143199
143232
  {
143200
- var result={ Start:this.Data.YOffset, PageSize:this.RowCount, IsEnd:false, SelectedRow:this.SelectedRow, IsSinglePage:false, DataCount:0, MultiSelectModel:this.MultiSelectModel };
143233
+ var result={ Start:this.Data.YOffset, PageSize:this.RowCount, IsEnd:false, SelectedRowData:null, SelectedRow:-1, IsSinglePage:false, DataCount:0, MultiSelectModel:this.MultiSelectModel };
143234
+
143201
143235
  if (this.MultiSelectModel==1)
143202
143236
  {
143203
143237
  result.SelectedRow=-1;
143204
143238
  result.MultiSelectedRow=this.MultiSelectedRow.slice();
143205
143239
  result.MultiSelectedRow.sort((left, right)=>{ return left>right; });
143206
143240
  }
143241
+ else
143242
+ {
143243
+ result.SelectedRowData=this.SelectedRowData;
143244
+ if (this.SelectedRowData)
143245
+ {
143246
+ if (this.SelectedModel==1) result.SelectedRow=this.SelectedRowData.DataIndex;
143247
+ else result.SelectedRow=this.SelectedRowData.Index;
143248
+ }
143249
+ }
143207
143250
 
143208
143251
  if (IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))
143209
143252
  {
@@ -143715,11 +143758,13 @@ function ChartReport()
143715
143758
  {
143716
143759
  if (this.SelectedModel==0)
143717
143760
  {
143718
- if (j==this.SelectedRow) bFillRow=true; //选中行
143761
+ if (this.SelectedRowData && this.SelectedRowData.Index==j && this.SelectedRowData.Symbol==symbol)
143762
+ bFillRow=true; //选中行
143719
143763
  }
143720
143764
  else
143721
143765
  {
143722
- if (i==this.SelectedRow) bFillRow=true; //选中行
143766
+ if (this.SelectedRowData && this.SelectedRowData.DataIndex==i && this.SelectedRowData.Symbol==symbol)
143767
+ bFillRow=true; //选中行
143723
143768
  }
143724
143769
  }
143725
143770
 
@@ -143854,14 +143899,10 @@ function ChartReport()
143854
143899
  }
143855
143900
  else
143856
143901
  {
143857
- if (this.SelectedRow<0) return null;
143902
+ if (!this.SelectedRowData) return null;
143903
+ if (!this.SelectedRowData.Symbol) return null;
143858
143904
 
143859
- var index=this.SelectedRow;
143860
- if (this.SelectedModel==0) //当前屏选中
143861
- index=this.Data.YOffset+this.SelectedRow;
143862
-
143863
- var symbol=this.Data.Data[index];
143864
- return [symbol];
143905
+ return [this.SelectedRowData.Symbol];
143865
143906
  }
143866
143907
  }
143867
143908
 
@@ -143870,10 +143911,9 @@ function ChartReport()
143870
143911
  {
143871
143912
  if (this.MultiSelectModel==1) return null; //多选
143872
143913
  if (this.SelectedModel==0) return null; //当前屏选中
143873
- if (this.SelectedRow<0) return null;
143914
+ if (!this.SelectedRowData) return null;
143874
143915
 
143875
- var symbol=this.Data.Data[this.SelectedRow];
143876
- return symbol;
143916
+ return this.SelectedRowData.Symbol;
143877
143917
  }
143878
143918
 
143879
143919
 
@@ -146095,7 +146135,7 @@ function ChartReport()
146095
146135
  this.SendClickEvent(eventID, { Data:row, X:x, Y:y, e:e, Inside:insidePoint, UIElement:uiElement });
146096
146136
 
146097
146137
  this.SelectedFixedRow=row.Index;
146098
- this.SelectedRow=-1;
146138
+ this.SelectedRowData=null;
146099
146139
  this.MultiSelectedRow=[];
146100
146140
 
146101
146141
  return { Type:4, Redraw:bRedraw, Row:row }; //行
@@ -146133,14 +146173,18 @@ function ChartReport()
146133
146173
  {
146134
146174
  if (this.SelectedModel==0)
146135
146175
  {
146136
- if (this.SelectedRow==row.Index) bRedraw=false;
146137
- this.SelectedRow=row.Index;
146176
+ if (this.SelectedRowData && this.SelectedRowData.Index==row.Index && this.SelectedRowData.Symbol==row.Symbol)
146177
+ bRedraw=false;
146178
+ this.SelectedRowData={ Index:row.Index, Symbol:row.Symbol };
146138
146179
  this.SelectedFixedRow=-1;
146139
146180
  }
146140
146181
  else
146141
146182
  {
146142
- if (this.SelectedRow==row.DataIndex) bRedraw=false;
146143
- this.SelectedRow=row.DataIndex;
146183
+
146184
+ if (this.SelectedRowData && this.SelectedRowData.DataIndex==row.DataIndex && this.SelectedRowData.Symbol==row.Symbol)
146185
+ bRedraw=false;
146186
+
146187
+ this.SelectedRowData={ DataIndex:row.DataIndex, Symbol:row.Symbol };
146144
146188
  this.SelectedFixedRow=-1;
146145
146189
  }
146146
146190
  }
@@ -146695,10 +146739,10 @@ function ChartReport()
146695
146739
  var symbol=option.Symbol;
146696
146740
  var bFinder=false;
146697
146741
 
146698
- if (this.SelectedRow>=0)
146742
+ if (this.SelectedRowData)
146699
146743
  {
146700
- var item=this.Data.Data[this.SelectedRow];
146701
- if (symbol==item) bFinder=true;
146744
+ var item=this.Data.Data[this.SelectedRowData.DataIndex];
146745
+ if (symbol==item && symbol==this.SelectedRowData.Symbol) bFinder=true;
146702
146746
  }
146703
146747
 
146704
146748
  if (!bFinder)
@@ -146708,7 +146752,7 @@ function ChartReport()
146708
146752
  var item=this.Data.Data[i];
146709
146753
  if (symbol==item)
146710
146754
  {
146711
- this.SelectedRow=i;
146755
+ this.SelectedRowData={ DataIndex:i, Symbol:item };
146712
146756
  bFinder=true;
146713
146757
  break;
146714
146758
  }
@@ -146719,7 +146763,7 @@ function ChartReport()
146719
146763
 
146720
146764
  if (option.AutoYScroll===true)
146721
146765
  {
146722
- this.UpdatePageYOffset({ SelectedRow:this.SelectedRow });
146766
+ this.UpdatePageYOffset({ SelectedRow:this.SelectedRowData.DataIndex });
146723
146767
  }
146724
146768
 
146725
146769
  return bFinder;
@@ -150866,7 +150910,7 @@ function ScrollBarBGChart()
150866
150910
 
150867
150911
 
150868
150912
 
150869
- var HQCHART_VERSION="1.1.14897";
150913
+ var HQCHART_VERSION="1.1.14902";
150870
150914
 
150871
150915
  function PrintHQChartVersion()
150872
150916
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14897";
8
+ var HQCHART_VERSION="1.1.14902";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -58351,6 +58351,14 @@ IFrameSplitOperator.IsNonEmptyArray=function(ary)
58351
58351
  return ary.length>0;
58352
58352
  }
58353
58353
 
58354
+ IFrameSplitOperator.IsArray=function(ary)
58355
+ {
58356
+ if (!ary) return false;
58357
+ if (!Array.isArray(ary)) return false;
58358
+
58359
+ return true;
58360
+ }
58361
+
58354
58362
  IFrameSplitOperator.IsFloat=function(value)
58355
58363
  {
58356
58364
  if (value===undefined) return false;
@@ -138591,6 +138599,11 @@ function JSReportChartContainer(uielement)
138591
138599
  if (IFrameSplitOperator.IsNumber(item.Sort)) this.SortInfo.Sort=item.Sort;
138592
138600
  }
138593
138601
 
138602
+ if (IFrameSplitOperator.IsNonEmptyArray(option.Column)) //字段重新设置
138603
+ {
138604
+ this.SetColumn(option.Column, { Draw:false })
138605
+ }
138606
+
138594
138607
  if (IFrameSplitOperator.IsBool(option.IsReloadStockList) && option.IsReloadStockList)
138595
138608
  {
138596
138609
  var requestOption={ Callback:null };
@@ -138599,7 +138612,6 @@ function JSReportChartContainer(uielement)
138599
138612
  this.RequestStockListData(requestOption);
138600
138613
  return;
138601
138614
  }
138602
-
138603
138615
  }
138604
138616
 
138605
138617
  this.RequestMemberListData();
@@ -139154,7 +139166,7 @@ function JSReportChartContainer(uielement)
139154
139166
  }
139155
139167
 
139156
139168
  //重新更新板块成员
139157
- if (IFrameSplitOperator.IsNonEmptyArray(data.members))
139169
+ if (IFrameSplitOperator.IsArray(data.members))
139158
139170
  {
139159
139171
  this.SourceData.Data=[];
139160
139172
  this.Data.Data=[];
@@ -139177,6 +139189,11 @@ function JSReportChartContainer(uielement)
139177
139189
  {
139178
139190
  var column=chart.Column[this.SortInfo.Field];
139179
139191
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);
139192
+
139193
+ //当前选中的股票
139194
+ var selectedSymbol=null;
139195
+ if (chart.SelectedRowData && chart.SelectedModel==1) selectedSymbol=chart.SelectedRowData.Symbol;
139196
+
139180
139197
  var bLocalSrot=true;
139181
139198
  if (event && event.Callback)
139182
139199
  {
@@ -139190,7 +139207,12 @@ function JSReportChartContainer(uielement)
139190
139207
  }
139191
139208
 
139192
139209
  if (bLocalSrot) this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, column, this.SortInfo.Sort); });
139193
-
139210
+
139211
+ if (selectedSymbol)
139212
+ {
139213
+ chart.SetSelectedRow({ Symbol:selectedSymbol });
139214
+ }
139215
+
139194
139216
  bUpdate=true; //排序暂时每次都刷新
139195
139217
  }
139196
139218
  else
@@ -140859,10 +140881,11 @@ function JSReportChartContainer(uielement)
140859
140881
  {
140860
140882
  selected+=step;
140861
140883
  selected=selected%pageSize;
140862
- chart.SelectedRow=selected;
140884
+ var dataIndex=this.Data.YOffset+selected;
140885
+ chart.SelectedRowData={ Index:selected, Symbol:this.Data.Data[dataIndex] };
140863
140886
  chart.SelectedFixedRow=-1;
140864
140887
  result.Redraw=true;
140865
- result.NewIndex=this.Data.YOffset+selected;
140888
+ result.NewIndex=dataIndex
140866
140889
  return result;
140867
140890
  }
140868
140891
  else if (step<0)
@@ -140873,10 +140896,10 @@ function JSReportChartContainer(uielement)
140873
140896
  selected=selected%pageSize;
140874
140897
  selected=pageSize+selected;
140875
140898
  }
140876
-
140877
- chart.SelectedRow=selected;
140899
+ var dataIndex=this.Data.YOffset+selected;
140900
+ chart.SelectedRowData={ Index:selected, Symbol:this.Data.Data[dataIndex] };
140878
140901
  chart.SelectedFixedRow=-1;
140879
- result.NewIndex=this.Data.YOffset+selected;
140902
+ result.NewIndex=dataIndex;
140880
140903
  result.Redraw=true;
140881
140904
  return result;
140882
140905
  }
@@ -140916,7 +140939,7 @@ function JSReportChartContainer(uielement)
140916
140939
  result.Redraw=true;
140917
140940
  result.Update=(offset!=this.Data.YOffset);
140918
140941
 
140919
- chart.SelectedRow=selected;
140942
+ chart.SelectedRowData={ DataIndex:selected, Symbol:this.Data.Data[selected] };
140920
140943
  this.Data.YOffset=offset;
140921
140944
  result.NewIndex=selected;
140922
140945
  return result;
@@ -140952,7 +140975,7 @@ function JSReportChartContainer(uielement)
140952
140975
  result.Redraw=true;
140953
140976
  result.Update=(offset!=this.Data.YOffset);
140954
140977
 
140955
- chart.SelectedRow=selected;
140978
+ chart.SelectedRowData={ DataIndex:selected, Symbol:this.Data.Data[selected] };
140956
140979
  this.Data.YOffset=offset;
140957
140980
  result.NewIndex=selected;
140958
140981
 
@@ -141168,16 +141191,20 @@ function JSReportChartContainer(uielement)
141168
141191
  if (column.Sort==1) //本地排序
141169
141192
  {
141170
141193
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);
141194
+ var bLocalSort=true;
141171
141195
  if (event && event.Callback)
141172
141196
  {
141173
- var sendData={ Column:column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null };
141197
+ var sendData={ Column:column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null, PreventDefault:false };
141174
141198
  event.Callback (event, sendData, this);
141175
- if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
141176
- }
141177
- else
141178
- {
141179
- this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, column, sortInfo.Sort); });
141199
+ if (sendData.PreventDefault)
141200
+ {
141201
+ if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
141202
+ bLocalSort=false;
141203
+ }
141180
141204
  }
141205
+
141206
+
141207
+ if (bLocalSort) this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, column, sortInfo.Sort); });
141181
141208
  }
141182
141209
  else if (column.Sort==2) //远程排序
141183
141210
  {
@@ -141255,16 +141282,22 @@ function JSReportChartContainer(uielement)
141255
141282
  if (header.Column.Sort==1) //本地排序
141256
141283
  {
141257
141284
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);
141285
+ var bLocalSort=true;
141258
141286
  if (event && event.Callback)
141259
141287
  {
141260
- var sendData={ Column:header.Column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null };
141288
+ var sendData={ Column:header.Column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null, PreventDefault:false};
141261
141289
  event.Callback (event, sendData, this);
141262
- if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
141263
- }
141264
- else
141265
- {
141266
- this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, header.Column, sortInfo.Sort); });
141290
+ if (sendData.PreventDefault)
141291
+ {
141292
+ if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
141293
+ bLocalSort=false;
141294
+ }
141295
+
141267
141296
  }
141297
+
141298
+
141299
+ if (bLocalSort) this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, header.Column, sortInfo.Sort); });
141300
+
141268
141301
  }
141269
141302
  else if (header.Column.Sort==2) //远程排序
141270
141303
  {
@@ -142469,7 +142502,7 @@ function ChartReport()
142469
142502
  this.SizeChange=true;
142470
142503
 
142471
142504
  this.SelectedModel=0; //选中模式 0=SelectedRow表示当前屏索引
142472
- this.SelectedRow=-1; //选中行ID
142505
+ this.SelectedRowData; //{ DataIndex:, Index:, Symbol: }
142473
142506
  this.SelectedFixedRow=-1; //选中固定行ID
142474
142507
  this.SelectedStyle=1; //选中行样式 1=整行填充 2=底部绘制直线
142475
142508
  this.IsDrawBorder=1; //是否绘制单元格边框
@@ -143241,13 +143274,23 @@ function ChartReport()
143241
143274
 
143242
143275
  this.GetCurrentPageStatus=function() //{ Start:起始索引, End:结束索引(数据), PageSize:页面可以显示几条记录, IsEnd:是否是最后一页, IsSinglePage:是否只有一页数据}
143243
143276
  {
143244
- var result={ Start:this.Data.YOffset, PageSize:this.RowCount, IsEnd:false, SelectedRow:this.SelectedRow, IsSinglePage:false, DataCount:0, MultiSelectModel:this.MultiSelectModel };
143277
+ var result={ Start:this.Data.YOffset, PageSize:this.RowCount, IsEnd:false, SelectedRowData:null, SelectedRow:-1, IsSinglePage:false, DataCount:0, MultiSelectModel:this.MultiSelectModel };
143278
+
143245
143279
  if (this.MultiSelectModel==1)
143246
143280
  {
143247
143281
  result.SelectedRow=-1;
143248
143282
  result.MultiSelectedRow=this.MultiSelectedRow.slice();
143249
143283
  result.MultiSelectedRow.sort((left, right)=>{ return left>right; });
143250
143284
  }
143285
+ else
143286
+ {
143287
+ result.SelectedRowData=this.SelectedRowData;
143288
+ if (this.SelectedRowData)
143289
+ {
143290
+ if (this.SelectedModel==1) result.SelectedRow=this.SelectedRowData.DataIndex;
143291
+ else result.SelectedRow=this.SelectedRowData.Index;
143292
+ }
143293
+ }
143251
143294
 
143252
143295
  if (IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))
143253
143296
  {
@@ -143759,11 +143802,13 @@ function ChartReport()
143759
143802
  {
143760
143803
  if (this.SelectedModel==0)
143761
143804
  {
143762
- if (j==this.SelectedRow) bFillRow=true; //选中行
143805
+ if (this.SelectedRowData && this.SelectedRowData.Index==j && this.SelectedRowData.Symbol==symbol)
143806
+ bFillRow=true; //选中行
143763
143807
  }
143764
143808
  else
143765
143809
  {
143766
- if (i==this.SelectedRow) bFillRow=true; //选中行
143810
+ if (this.SelectedRowData && this.SelectedRowData.DataIndex==i && this.SelectedRowData.Symbol==symbol)
143811
+ bFillRow=true; //选中行
143767
143812
  }
143768
143813
  }
143769
143814
 
@@ -143898,14 +143943,10 @@ function ChartReport()
143898
143943
  }
143899
143944
  else
143900
143945
  {
143901
- if (this.SelectedRow<0) return null;
143946
+ if (!this.SelectedRowData) return null;
143947
+ if (!this.SelectedRowData.Symbol) return null;
143902
143948
 
143903
- var index=this.SelectedRow;
143904
- if (this.SelectedModel==0) //当前屏选中
143905
- index=this.Data.YOffset+this.SelectedRow;
143906
-
143907
- var symbol=this.Data.Data[index];
143908
- return [symbol];
143949
+ return [this.SelectedRowData.Symbol];
143909
143950
  }
143910
143951
  }
143911
143952
 
@@ -143914,10 +143955,9 @@ function ChartReport()
143914
143955
  {
143915
143956
  if (this.MultiSelectModel==1) return null; //多选
143916
143957
  if (this.SelectedModel==0) return null; //当前屏选中
143917
- if (this.SelectedRow<0) return null;
143958
+ if (!this.SelectedRowData) return null;
143918
143959
 
143919
- var symbol=this.Data.Data[this.SelectedRow];
143920
- return symbol;
143960
+ return this.SelectedRowData.Symbol;
143921
143961
  }
143922
143962
 
143923
143963
 
@@ -146139,7 +146179,7 @@ function ChartReport()
146139
146179
  this.SendClickEvent(eventID, { Data:row, X:x, Y:y, e:e, Inside:insidePoint, UIElement:uiElement });
146140
146180
 
146141
146181
  this.SelectedFixedRow=row.Index;
146142
- this.SelectedRow=-1;
146182
+ this.SelectedRowData=null;
146143
146183
  this.MultiSelectedRow=[];
146144
146184
 
146145
146185
  return { Type:4, Redraw:bRedraw, Row:row }; //行
@@ -146177,14 +146217,18 @@ function ChartReport()
146177
146217
  {
146178
146218
  if (this.SelectedModel==0)
146179
146219
  {
146180
- if (this.SelectedRow==row.Index) bRedraw=false;
146181
- this.SelectedRow=row.Index;
146220
+ if (this.SelectedRowData && this.SelectedRowData.Index==row.Index && this.SelectedRowData.Symbol==row.Symbol)
146221
+ bRedraw=false;
146222
+ this.SelectedRowData={ Index:row.Index, Symbol:row.Symbol };
146182
146223
  this.SelectedFixedRow=-1;
146183
146224
  }
146184
146225
  else
146185
146226
  {
146186
- if (this.SelectedRow==row.DataIndex) bRedraw=false;
146187
- this.SelectedRow=row.DataIndex;
146227
+
146228
+ if (this.SelectedRowData && this.SelectedRowData.DataIndex==row.DataIndex && this.SelectedRowData.Symbol==row.Symbol)
146229
+ bRedraw=false;
146230
+
146231
+ this.SelectedRowData={ DataIndex:row.DataIndex, Symbol:row.Symbol };
146188
146232
  this.SelectedFixedRow=-1;
146189
146233
  }
146190
146234
  }
@@ -146739,10 +146783,10 @@ function ChartReport()
146739
146783
  var symbol=option.Symbol;
146740
146784
  var bFinder=false;
146741
146785
 
146742
- if (this.SelectedRow>=0)
146786
+ if (this.SelectedRowData)
146743
146787
  {
146744
- var item=this.Data.Data[this.SelectedRow];
146745
- if (symbol==item) bFinder=true;
146788
+ var item=this.Data.Data[this.SelectedRowData.DataIndex];
146789
+ if (symbol==item && symbol==this.SelectedRowData.Symbol) bFinder=true;
146746
146790
  }
146747
146791
 
146748
146792
  if (!bFinder)
@@ -146752,7 +146796,7 @@ function ChartReport()
146752
146796
  var item=this.Data.Data[i];
146753
146797
  if (symbol==item)
146754
146798
  {
146755
- this.SelectedRow=i;
146799
+ this.SelectedRowData={ DataIndex:i, Symbol:item };
146756
146800
  bFinder=true;
146757
146801
  break;
146758
146802
  }
@@ -146763,7 +146807,7 @@ function ChartReport()
146763
146807
 
146764
146808
  if (option.AutoYScroll===true)
146765
146809
  {
146766
- this.UpdatePageYOffset({ SelectedRow:this.SelectedRow });
146810
+ this.UpdatePageYOffset({ SelectedRow:this.SelectedRowData.DataIndex });
146767
146811
  }
146768
146812
 
146769
146813
  return bFinder;
@@ -162086,7 +162130,7 @@ function HQChartScriptWorker()
162086
162130
 
162087
162131
 
162088
162132
 
162089
- var HQCHART_VERSION="1.1.14897";
162133
+ var HQCHART_VERSION="1.1.14902";
162090
162134
 
162091
162135
  function PrintHQChartVersion()
162092
162136
  {