hqchart 1.1.14064 → 1.1.14072

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.
@@ -55,7 +55,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
55
55
 
56
56
  //改参数div
57
57
  this.ModifyIndexDialog=new ModifyIndexDialog(divElement);
58
- this.ChangeIndexDialog=new ChangeIndexDialog(divElement);
59
58
 
60
59
  //额外的画布
61
60
  this.MapExtraCanvasElement=new Map(); //key=画布名字, value={ Element:, Canvas:}
@@ -291,7 +290,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
291
290
 
292
291
  //创建改参数div
293
292
  chart.ModifyIndexDialog=this.ModifyIndexDialog;
294
- chart.ChangeIndexDialog=this.ChangeIndexDialog;
295
293
 
296
294
  var pixelRatio=GetDevicePixelRatio();
297
295
 
@@ -744,7 +742,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
744
742
 
745
743
  //创建改参数div
746
744
  chart.ModifyIndexDialog=this.ModifyIndexDialog;
747
- chart.ChangeIndexDialog=this.ChangeIndexDialog;
748
745
 
749
746
  //右键菜单
750
747
  if (IFrameSplitOperator.IsBool(option.IsShowRightMenu)) chart.IsShowRightMenu=option.IsShowRightMenu;
@@ -847,7 +844,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
847
844
  if (option.NetworkFilter) chart.NetworkFilter=option.NetworkFilter;
848
845
 
849
846
  chart.ModifyIndexDialog=this.ModifyIndexDialog;
850
- chart.ChangeIndexDialog=this.ChangeIndexDialog;
851
847
 
852
848
  var pixelRatio=GetDevicePixelRatio();
853
849
 
@@ -1429,7 +1425,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
1429
1425
 
1430
1426
  //创建改参数div
1431
1427
  chart.ModifyIndexDialog=this.ModifyIndexDialog;
1432
- chart.ChangeIndexDialog=this.ChangeIndexDialog;
1433
1428
 
1434
1429
  if (option.ScriptError) chart.ScriptErrorCallback=option.ScriptError;
1435
1430
 
@@ -1726,9 +1721,10 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
1726
1721
  chart.InitalFloatTooltip(option.FloatTooltip);
1727
1722
 
1728
1723
  if (option.SelectRectDialog && option.SelectRectDialog.Enable)
1729
- {
1730
1724
  chart.InitalSelectRectDialog(option.SelectRectDialog);
1731
- }
1725
+
1726
+ if (option.SearchIndexDialog && option.SearchIndexDialog.Enable)
1727
+ chart.InitalSearchIndexDialog(option.SearchIndexDialog);
1732
1728
 
1733
1729
  //注册事件
1734
1730
  if (option.EventCallback)
@@ -2443,6 +2439,12 @@ JSChart.GetScrollPosition=function()
2443
2439
  return GetScrollPosition();
2444
2440
  }
2445
2441
 
2442
+ //品种小数位数
2443
+ JSChart.GetfloatPrecision=function(symbol)
2444
+ {
2445
+ return GetfloatPrecision(symbol);
2446
+ }
2447
+
2446
2448
 
2447
2449
 
2448
2450
 
@@ -3046,6 +3048,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3046
3048
  this.DialogTooltip; //tooltip信息
3047
3049
  this.DialogSelectRect; //区间统计
3048
3050
  this.FloatTooltip; //浮动tooltip信息
3051
+ this.DialogSearchIndex; //指标搜索
3049
3052
 
3050
3053
 
3051
3054
  this.ClearStockCache=function()
@@ -3106,6 +3109,34 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3106
3109
  this.DialogSelectRect.Create();
3107
3110
  }
3108
3111
 
3112
+ this.InitalSearchIndexDialog=function(option)
3113
+ {
3114
+ if (this.DialogSearchIndex) return;
3115
+
3116
+ this.DialogSearchIndex=new JSDialogSearchIndex();
3117
+ this.DialogSearchIndex.Inital(this, option);
3118
+ this.DialogSearchIndex.Create();
3119
+ }
3120
+
3121
+ this.ShowChangeIndexDialog=function(data)
3122
+ {
3123
+ if (!data) return;
3124
+ if (!this.DialogSearchIndex) return;
3125
+
3126
+ data.Title=`切换指标 [窗口${data.WindowIndex+1}]`;
3127
+ this.DialogSearchIndex.SetOpData(data);
3128
+ this.DialogSearchIndex.Show();
3129
+ }
3130
+
3131
+ this.ShowAddOverlayIndexDialog=function(data)
3132
+ {
3133
+ if (!data) return;
3134
+ if (!this.DialogSearchIndex) return;
3135
+
3136
+ data.Title=`添加叠加指标 [窗口${data.WindowIndex+1}]`;
3137
+ this.DialogSearchIndex.SetOpData(data);
3138
+ this.DialogSearchIndex.Show();
3139
+ }
3109
3140
 
3110
3141
 
3111
3142
  this.DrawSelectRectDialog=function()
@@ -3204,6 +3235,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3204
3235
  this.FloatTooltip=null;
3205
3236
  }
3206
3237
 
3238
+ this.DestroySearchIndexDialog=function()
3239
+ {
3240
+ if (!this.DialogSearchIndex) return;
3241
+
3242
+ this.DialogSearchIndex.Destroy();
3243
+ this.DialogSearchIndex=null;
3244
+ }
3245
+
3207
3246
 
3208
3247
 
3209
3248
  //obj={ Element:, Canvas: }
@@ -3257,6 +3296,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3257
3296
  this.StopAutoUpdate();
3258
3297
  this.DestroyTooltipDialog();
3259
3298
  this.DestroyFloatTooltip();
3299
+ this.DestroySearchIndexDialog();
3260
3300
  }
3261
3301
 
3262
3302
  this.ChartDestory=this.ChartDestroy; //老版本写错了,需要兼容下
@@ -8239,6 +8279,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
8239
8279
  if (this.DialogTooltip) this.DialogTooltip.ReloadResource(option);
8240
8280
  if (this.FloatTooltip) this.FloatTooltip.ReloadResource(option);
8241
8281
  if (this.DialogSelectRect) this.DialogSelectRect.ReloadResource(option);
8282
+ if (this.DialogSearchIndex) this.DialogSearchIndex.ReloadResource(option);
8242
8283
  }
8243
8284
 
8244
8285
  this.ReloadBorder=function(option) //根据页面缩放调整对应边框的尺长
@@ -13872,7 +13913,6 @@ function MinuteFrame()
13872
13913
  this.OverlayIndex=g_JSChartResource.MinuteToolbar.OverlayIndex; //是否显示叠加指标
13873
13914
 
13874
13915
  this.ModifyIndexEvent; //改参数 点击事件
13875
- this.ChangeIndexEvent; //换指标 点击事件
13876
13916
  this.ToolbarRect=null; //保存工具条的位置
13877
13917
  this.IsShowPositionTitle=false; //是否显示持仓标题
13878
13918
 
@@ -16302,7 +16342,6 @@ function KLineFrame()
16302
16342
  this.SelBorderColor=g_JSChartResource.SelFrameBorderColor;
16303
16343
 
16304
16344
  this.ModifyIndexEvent; //改参数 点击事件
16305
- this.ChangeIndexEvent; //换指标 点击事件
16306
16345
  this.ToolbarRect=null; //保存工具条的位置
16307
16346
  this.ReDrawToolbar=false;
16308
16347
 
@@ -69263,6 +69302,19 @@ function JSChartResource()
69263
69302
  }
69264
69303
  };
69265
69304
 
69305
+ //指标搜索
69306
+ this.DialogSearchIndex=
69307
+ {
69308
+ BGColor:'rgb(250,250,250)', //背景色
69309
+ BorderColor:'rgb(20,20,20)', //边框颜色
69310
+ TitleColor:'rgb(250,250,250)', //标题颜色
69311
+ TitleBGColor:"rgb(200, 66, 69)", //标题背景颜色
69312
+
69313
+ IndexNameColor:"rgb(0,0,0)", //数值名称
69314
+ GroupNameColor:"rgb(0,0,0)",
69315
+ InputTextColor:"rgb(0,0,0)"
69316
+ };
69317
+
69266
69318
  //弹幕
69267
69319
  this.Barrage= {
69268
69320
  Font:16*GetDevicePixelRatio() +'px 微软雅黑', //字体
@@ -70328,6 +70380,20 @@ function JSChartResource()
70328
70380
  }
70329
70381
  }
70330
70382
 
70383
+ if (style.DialogSearchIndex)
70384
+ {
70385
+ var item=style.DialogSearchIndex;
70386
+
70387
+ if (item.BGColor) this.DialogSearchIndex.BGColor=item.BGColor;
70388
+ if (item.BorderColor) this.DialogSearchIndex.BorderColor=item.BorderColor;
70389
+ if (item.TitleColor) this.DialogSearchIndex.TitleColor=item.TitleColor;
70390
+ if (item.TitleBGColor) this.DialogSearchIndex.TitleBGColor=item.TitleBGColor;
70391
+
70392
+ if (item.IndexNameColor) this.DialogSearchIndex.IndexNameColor=item.IndexNameColor;
70393
+ if (item.GroupNameColor) this.DialogSearchIndex.GroupNameColor=item.GroupNameColor;
70394
+ if (item.InputTextColor) this.DialogSearchIndex.InputTextColor=item.InputTextColor;
70395
+ }
70396
+
70331
70397
  if (style.MinuteInfo)
70332
70398
  {
70333
70399
  var item=style.MinuteInfo;
@@ -73412,7 +73478,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
73412
73478
  frame.GlobalOption=this.GlobalOption;
73413
73479
 
73414
73480
  if (this.ModifyIndexDialog) frame.ModifyIndexEvent=this.ModifyIndexDialog.DoModal; //绑定菜单事件
73415
- if (this.ChangeIndexDialog) frame.ChangeIndexEvent=this.ChangeIndexDialog.DoModal;
73416
73481
 
73417
73482
  frame.HorizontalMax=20;
73418
73483
  frame.HorizontalMin=10;
@@ -73497,7 +73562,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
73497
73562
  frame.GlobalOption=this.GlobalOption;
73498
73563
 
73499
73564
  if (this.ModifyIndexDialog) frame.ModifyIndexEvent=this.ModifyIndexDialog.DoModal; //绑定菜单事件
73500
- if (this.ChangeIndexDialog) frame.ChangeIndexEvent=this.ChangeIndexDialog.DoModal;
73501
73565
 
73502
73566
  frame.HorizontalMax=20;
73503
73567
  frame.HorizontalMin=10;
@@ -79495,9 +79559,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
79495
79559
  else if (button.ID==JSCHART_BUTTON_ID.CHANGE_INDEX)
79496
79560
  {
79497
79561
  var frame=button.Frame;
79562
+ var sendData={ e:e, WindowIndex:frame.Identify, OpType:1 };
79563
+ this.ShowChangeIndexDialog(sendData);
79564
+ /*
79498
79565
  e.data={ Chart:this, Identify:frame.Identify, IsOverlay:false };
79499
79566
  if (frame.ChangeIndexEvent)
79500
79567
  frame.ChangeIndexEvent(e);
79568
+ */
79501
79569
  }
79502
79570
  else if (button.ID==JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM)
79503
79571
  {
@@ -79509,9 +79577,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
79509
79577
  else if (button.ID==JSCHART_BUTTON_ID.OVERLAY_INDEX)
79510
79578
  {
79511
79579
  var frame=button.Frame;
79580
+ var sendData={ e:e, WindowIndex:frame.Identify, OpType:2 };
79581
+ this.ShowAddOverlayIndexDialog(sendData);
79582
+ /*
79512
79583
  e.data={ Chart:this, Identify:frame.Identify, IsOverlay:true };
79513
79584
  if (frame.ChangeIndexEvent)
79514
79585
  frame.ChangeIndexEvent(e);
79586
+ */
79515
79587
  }
79516
79588
  else if (button.ID==JSCHART_BUTTON_ID.MAX_MIN_WINDOW)
79517
79589
  {
@@ -80324,9 +80396,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
80324
80396
  else if (button.ID==JSCHART_BUTTON_ID.CHANGE_INDEX)
80325
80397
  {
80326
80398
  var frame=button.Frame;
80327
- e.data={ Chart:this, Identify:frame.Identify, IsOverlay:false };
80328
- if (frame.ChangeIndexEvent)
80329
- frame.ChangeIndexEvent(e);
80399
+ var sendData={ e:e, WindowIndex:frame.Identify, OpType:1 };
80400
+ this.ShowChangeIndexDialog(sendData);
80330
80401
  }
80331
80402
  else if (button.ID==JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM)
80332
80403
  {
@@ -80338,9 +80409,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
80338
80409
  else if (button.ID==JSCHART_BUTTON_ID.OVERLAY_INDEX)
80339
80410
  {
80340
80411
  var frame=button.Frame;
80341
- e.data={ Chart:this, Identify:frame.Identify, IsOverlay:true };
80342
- if (frame.ChangeIndexEvent)
80343
- frame.ChangeIndexEvent(e);
80412
+ var sendData={ e:e, WindowIndex:frame.Identify, OpType:2 };
80413
+ this.ShowAddOverlayIndexDialog(sendData);
80344
80414
  }
80345
80415
  else if (button.ID==JSCHART_BUTTON_ID.MAX_MIN_WINDOW)
80346
80416
  {
@@ -82102,7 +82172,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
82102
82172
  if (i>=2)
82103
82173
  {
82104
82174
  if (this.ModifyIndexDialog) frame.ModifyIndexEvent=this.ModifyIndexDialog.DoModal; //绑定菜单事件
82105
- if (this.ChangeIndexDialog) frame.ChangeIndexEvent=this.ChangeIndexDialog.DoModal;
82106
82175
  }
82107
82176
 
82108
82177
  var DEFAULT_HORIZONTAL=[9,8,7,6,5,4,3,2,1];
@@ -82194,7 +82263,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
82194
82263
  if (id>=2)
82195
82264
  {
82196
82265
  if (this.ModifyIndexDialog) frame.ModifyIndexEvent=this.ModifyIndexDialog.DoModal; //绑定菜单事件
82197
- if (this.ChangeIndexDialog) frame.ChangeIndexEvent=this.ChangeIndexDialog.DoModal;
82198
82266
  }
82199
82267
 
82200
82268
  var DEFAULT_HORIZONTAL=[9,8,7,6,5,4,3,2,1];
@@ -87769,7 +87837,6 @@ function KLineChartHScreenContainer(uielement)
87769
87837
  frame.RightSpaceCount=this.RightSpaceCount; //右边
87770
87838
 
87771
87839
  if (this.ModifyIndexDialog) frame.ModifyIndexEvent=this.ModifyIndexDialog.DoModal; //绑定菜单事件
87772
- if (this.ChangeIndexDialog) frame.ChangeIndexEvent=this.ChangeIndexDialog.DoModal;
87773
87840
 
87774
87841
  frame.HorizontalMax=20;
87775
87842
  frame.HorizontalMin=10;
@@ -90599,266 +90666,6 @@ function ModifyIndexDialog(divElement)
90599
90666
  }
90600
90667
  }
90601
90668
 
90602
- //换指标
90603
- function ChangeIndexDialog(divElement)
90604
- {
90605
- this.newMethod=IDivDialog; //派生
90606
- this.newMethod(divElement);
90607
- delete this.newMethod;
90608
-
90609
- this.DivElement=divElement; //父节点
90610
- //this.IndexTreeApiUrl="../commonindextree.json"; //数据下载地址
90611
- //this.OverlayIndexTreeApiUrl="../commonindextree.json"; //叠加指标列表数据下载地址
90612
- this.IsOverlayIndex=false;
90613
-
90614
- this.Create=function()
90615
- {
90616
- var div=document.createElement('div');
90617
- div.className='jchart-changeindex-box';
90618
- div.id=this.ID=Guid();
90619
- div.innerHTML=
90620
- '<div class="target-panel">\n' +
90621
- ' <div class="target-header">\n' +
90622
- ' <span>换指标</span>\n' +
90623
- ' <strong class="close-tar icon iconfont icon-close"></strong>\n' +
90624
- ' </div>\n' +
90625
- ' <div class="target-content">\n' +
90626
- ' <div class="target-left">\n' +
90627
- ' <input type="text">\n' +
90628
- ' <ul></ul>\n' +
90629
- ' </div>\n' +
90630
- ' <div class="target-right">\n' +
90631
- ' <ul></ul>\n' +
90632
- ' </div>\n' +
90633
- ' </div>\n' +
90634
- ' </div>';
90635
-
90636
- this.DivElement.appendChild(div);
90637
- }
90638
-
90639
- //指标菜单内容
90640
- this.GetMenuData=function()
90641
- {
90642
- var data={
90643
- "name":"页面通用版指标树",
90644
- "list":
90645
- [
90646
- {
90647
- "node":"超买超卖型",
90648
- "list":
90649
- [
90650
- {"name":"ADTM 动态买卖气指标", "id":"ADTM"},
90651
- {"name":"BIAS 乖离率", "id":"BIAS"},
90652
- {"name":"BIAS36 三六乖离", "id":"BIAS36"},
90653
- {"name":"BIAS_QL 乖离率-传统版", "id":"BIAS_QL"},
90654
- {"name":"CCI 商品路径指标", "id":"CCI"},
90655
- {"name":"FSL 分水岭", "id":"FSL"},
90656
- {"name":"KDJ 随机指标", "id":"KDJ"},
90657
- {"name":"MTM 动量线", "id":"MTM"},
90658
- {"name":"OSC 变动速率线", "id":"OSC"},
90659
- {"name":"RSI 相对强弱指标", "id":"RSI"},
90660
- {"name":"ROC 变动率指标", "id":"ROC"},
90661
- {"name":"WR 威廉指标", "id":"WR"}
90662
- ]
90663
- },
90664
- {
90665
- "node":"趋势型",
90666
- "list":
90667
- [
90668
- {"name":"CHO 济坚指数", "id":"CHO"},
90669
- {"name":"DMA 平均差", "id":"DMA"},
90670
- {"name":"DMI 趋向指标", "id":"DMI"},
90671
- {"name":"EMV 简易波动指标", "id":"EMV"},
90672
- {"name":"MACD 平滑异同平均", "id":"MACD"},
90673
- {"name":"TRIX 三重指数平均线", "id":"TRIX"},
90674
- {"name":"UOS 终极指标", "id":"UOS"},
90675
- {"name":"TRIX 三重指数平均线", "id":"TRIX"}
90676
- ]
90677
- },
90678
- {
90679
- "node":"成交量型",
90680
- "list":
90681
- [
90682
- {"name":"HSL 换手率", "id":"HSL"},
90683
- {"name":"OBV 累积能量线", "id":"OBV"},
90684
- {"name":"NVI 负成交量", "id":"NVI"},
90685
- {"name":"PVI 正成交量", "id":"PVI"},
90686
- {"name":"VOL 成交量", "id":"VOL"}
90687
- ]
90688
- },
90689
- {
90690
- "node":"均线型",
90691
- "list":
90692
- [
90693
- {"name":"MA 均线", "id":"均线"},
90694
- {"name":"BBI 多空线", "id":"BBI"}
90695
- ]
90696
- },
90697
- {
90698
- "node":"路径型",
90699
- "list":
90700
- [
90701
- {"name":"BOLL 布林线", "id":"BOLL"},
90702
- {"name":"BOLL副图 布林线", "id":"BOLL副图"},
90703
- {"name":"MIKE 麦克支撑压力", "id":"MIKE"},
90704
- {"name":"ENE 轨道线", "id":"ENE"}
90705
- ]
90706
- },
90707
- {
90708
- "node":"能量型",
90709
- "list":
90710
- [
90711
- {"name":"BRAR 情绪指标", "id":"BRAR"},
90712
- {"name":"CYR 市场强弱", "id":"CYR"},
90713
- {"name":"MASS 梅斯线", "id":"MASS"},
90714
- {"name":"PSY 心理线", "id":"PSY"},
90715
- {"name":"CR 带状能量线", "id":"CR"},
90716
- {"name":"VR 成交量变异率", "id":"VR"},
90717
- {"name":"WAD 威廉多空力度线", "id":"WAD"}
90718
- ]
90719
- }
90720
-
90721
- ]
90722
- };
90723
-
90724
- return data;
90725
- }
90726
-
90727
- //下载数据 如果上次下载过可以 可以不用下载
90728
- this.ReqeustData=function()
90729
- {
90730
- if($("#" + this.ID + " .target-left ul li").length>0){
90731
- return false;
90732
- }
90733
-
90734
- var res=this.GetMenuData();
90735
- var item = res.list;
90736
- changeIndexLeftList(item); //处理左侧list列表
90737
- changeIndexRightList(item); //处理右侧内容列表
90738
-
90739
- /*
90740
- var url = this.IndexTreeApiUrl;
90741
- if (this.IsOverlayIndex==true) url=this.OverlayIndexTreeApiUrl;
90742
- JSNetwork.HttpRequest({
90743
- url: url,
90744
- type: 'get',
90745
- success: function (res) {
90746
- var item = res.list;
90747
- changeIndexLeftList(item); //处理左侧list列表
90748
- changeIndexRightList(item); //处理右侧内容列表
90749
- }
90750
- });
90751
- */
90752
-
90753
- //处理左侧list列表
90754
- function changeIndexLeftList(item) {
90755
- $(".target-left ul").html('');
90756
- $.each(item,function(i,result){
90757
- var htmlList;
90758
- htmlList = '<li>' + result.node + '</li>';
90759
- $(".target-left ul").append(htmlList);
90760
- });
90761
- //默认选中第一项
90762
- $(".target-left ul li:first-child").addClass("active-list");
90763
- }
90764
- //处理右侧内容列表
90765
- function changeIndexRightList(listNum) {
90766
- var contentHtml;
90767
- var conData = [];
90768
- $.each(listNum,function(index,result){
90769
- conData.push(result.list);
90770
- })
90771
- //页面初始化时显示第一个列表分类下的内容
90772
- $.each(conData[0],function (i, res) {
90773
- contentHtml = '<li id='+res.id+'>'+ res.name +'</li>';
90774
- $(".target-right ul").append(contentHtml);
90775
- })
90776
- //切换list
90777
- $(".target-left ul").delegate("li","click",function () {
90778
- $(this).addClass("active-list").siblings().removeClass("active-list");
90779
- var item = $(this).index();
90780
- $(".target-right ul").html("");
90781
- $.each(conData[item],function (i, res) {
90782
- contentHtml = '<li id='+res.id+'>'+ res.name +'</li>';
90783
- $(".target-right ul").append(contentHtml);
90784
- })
90785
- })
90786
- }
90787
- }
90788
-
90789
- this.BindClose=function(chart)
90790
- {
90791
- //关闭按钮
90792
- $("#"+this.ID+" .close-tar").click(
90793
- {
90794
- Chart:chart,
90795
- },
90796
- function(event)
90797
- {
90798
- var chart=event.data.Chart;
90799
- chart.ChangeIndexDialog.Hide();
90800
- }
90801
- );
90802
- }
90803
-
90804
- //搜索事件
90805
- this.BindSearch=function(chart)
90806
- {
90807
- $(".target-left input").on('input',
90808
- {
90809
- Chart:chart
90810
- },
90811
- function(event)
90812
- {
90813
- let scriptData = new JSIndexScript();
90814
- let result=scriptData.Search(event.target.value);
90815
-
90816
- $(".target-right ul").html("");
90817
- for(var i in result)
90818
- {
90819
- var name=result[i];
90820
- var contentHtml = '<li id='+name+'>'+ name +'</li>';
90821
- $(".target-right ul").append(contentHtml);
90822
- }
90823
-
90824
- }
90825
- );
90826
- }
90827
-
90828
- this.DoModal=function(event)
90829
- {
90830
- var chart=event.data.Chart;
90831
- var identify=event.data.Identify;
90832
- var dialog=chart.ChangeIndexDialog;
90833
- var isOverlay=event.data.IsOverlay; //是否叠加
90834
-
90835
- if(!dialog) return;
90836
-
90837
- if (dialog.ID==null) dialog.Create(); //第1次 需要创建div
90838
- dialog.IsOverlayIndex=isOverlay;
90839
- dialog.ReqeustData(); //下载数据
90840
-
90841
- //切换窗口指标类型 每次委托事件执行之前,先用undelegate()解除之前的所有绑定
90842
- changeIndeWindow();
90843
- function changeIndeWindow()
90844
- {
90845
- $(".target-right ul").undelegate().delegate("li","click",function () {
90846
- var idv = $(this).attr("id");
90847
- if (isOverlay)
90848
- chart.AddOverlayIndex({WindowIndex:identify,IndexName:idv});
90849
- else
90850
- chart.ChangeIndex(identify,idv);
90851
- $(this).addClass("active-list").siblings().removeClass("active-list");
90852
- });
90853
- }
90854
-
90855
- dialog.BindSearch(chart);
90856
- //关闭弹窗
90857
- dialog.BindClose(chart);
90858
- dialog.Show();
90859
- }
90860
- }
90861
-
90862
90669
  //等待动画窗口
90863
90670
  function WaitDialog(divElement)
90864
90671
  {
@@ -1922,6 +1922,133 @@ input[type="color"] {
1922
1922
  }
1923
1923
 
1924
1924
 
1925
+ /*
1926
+ Copyright (c) 2018 jones
1927
+
1928
+ http://www.apache.org/licenses/LICENSE-2.0
1929
+
1930
+ 开源项目 https://github.com/jones2000/HQChart
1931
+
1932
+ jones_2000@163.com
1933
+
1934
+ 内置搜索指标对话框
1935
+ */
1936
+
1937
+
1938
+ .UMyChart_SearchIndex_Dialog_Div
1939
+ {
1940
+ font-family: "微软雅黑";
1941
+ /*display: flex;*/
1942
+ border: 1px solid;
1943
+ width:fit-content;
1944
+ border-color: rgb(204,204,204);
1945
+ visibility:hidden;
1946
+ position: absolute;
1947
+ background-color: rgba(20,20,20,1);
1948
+ left:1px;
1949
+ top:1px;
1950
+ }
1951
+
1952
+ .UMyChart_SearchIndex_Title_Div
1953
+ {
1954
+ padding-left: 2px;
1955
+ height:20px;
1956
+ border-bottom: 1px solid;
1957
+
1958
+ display: flex;
1959
+ cursor: default;
1960
+ user-select: none;
1961
+ background-color:rgb(200, 66, 69)
1962
+ }
1963
+
1964
+ .UMyChart_SearchIndex_Name_Div
1965
+ {
1966
+ margin-left: 5px;
1967
+ color:rgb(250,250,250)
1968
+ }
1969
+
1970
+ .UMyChart_SearchIndex_Close_Div
1971
+ {
1972
+ margin-left: auto;
1973
+ padding-right: 4px;
1974
+ cursor:pointer;
1975
+ color:rgb(180,180,180)
1976
+ }
1977
+
1978
+ .UMyChart_SearchIndex_Table_Div
1979
+ {
1980
+ height:300px;
1981
+ width:500px;
1982
+ overflow-y:scroll;
1983
+ }
1984
+
1985
+ .UMyChart_SearchIndex_Table
1986
+ {
1987
+ border-spacing: 4px;
1988
+ user-select: none;
1989
+ font-size:13px;
1990
+ max-height: 300px;
1991
+ }
1992
+
1993
+ .UMyChart_SearchIndex_Group_Tr
1994
+ {
1995
+ height: 25px;
1996
+ }
1997
+
1998
+ .UMyChart_SearchIndex_Text_Td
1999
+ {
2000
+ width: 200px;
2001
+ }
2002
+
2003
+
2004
+ .UMyChart_SearchIndex_Text_Span
2005
+ {
2006
+ margin-left: 2px;
2007
+ margin-right: 10px;
2008
+ cursor: pointer;
2009
+ }
2010
+
2011
+ .UMyChart_SearchIndex_Input
2012
+ {
2013
+ border: none;
2014
+ line-height: 28px;
2015
+ background-color: transparent;
2016
+ width: 99%;
2017
+ margin-left: 10px;
2018
+ }
2019
+
2020
+ .UMyChart_SearchIndex_Container_Div
2021
+ {
2022
+ display: flex;
2023
+ border-top: 1px solid #ccc;
2024
+ }
2025
+
2026
+ .UMyChart_SearchIndex_GroupList_Div
2027
+ {
2028
+ height: 300px;
2029
+ width: 120px;
2030
+ border-right: 1px solid #ccc;
2031
+ font-size: 14px;
2032
+ }
2033
+
2034
+ .UMyChart_SearchIndex_Group_Div
2035
+ {
2036
+ margin: 5px;
2037
+ }
2038
+
2039
+ .UMyChart_SearchIndex_Group_Span
2040
+ {
2041
+
2042
+ margin-left: 5px;
2043
+ cursor: pointer;
2044
+ }
2045
+
2046
+
2047
+
2048
+
2049
+
2050
+
2051
+
1925
2052
 
1926
2053
 
1927
2054
 
@@ -439,6 +439,17 @@ function GetBlackStyle()
439
439
  PositionColor:"rgb(255,0,255)" //持仓
440
440
  },
441
441
 
442
+ DialogSearchIndex:
443
+ {
444
+ BGColor:'rgb(20,20,20)', //背景色
445
+ BorderColor:'rgb(170,170,170)', //边框颜色
446
+ TitleColor:'rgb(230,230,230)', //标题颜色
447
+
448
+ IndexNameColor:"rgb(210,210,210)",
449
+ GroupNameColor:"rgb(210,210,210)",
450
+ InputTextColor:"rgb(210,210,210)",
451
+ },
452
+
442
453
  DialogPopKeyboard:
443
454
  {
444
455
  BGColor:'rgb(20,20,20)', //背景色