hqchart 1.1.12693 → 1.1.12708

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.
Files changed (229) hide show
  1. package/package.json +15 -47
  2. package/src/jscommon/readmo.txt +2 -2
  3. package/src/jscommon/umychart.resource/js/codemirror/javascript.js +1 -1
  4. package/.babelrc +0 -6
  5. package/.vscode/settings.json +0 -4
  6. package/Makefile +0 -9
  7. package/README.md +0 -452
  8. package/index.js +0 -17
  9. package/postcss.config.js +0 -5
  10. package/src/index.html +0 -18
  11. package/src/jscommon/backup/announcement.png +0 -0
  12. package/src/jscommon/backup/announcement2.png +0 -0
  13. package/src/jscommon/backup/blocktrading.png +0 -0
  14. package/src/jscommon/backup/investor.png +0 -0
  15. package/src/jscommon/backup/pforecast.png +0 -0
  16. package/src/jscommon/backup/research.png +0 -0
  17. package/src/jscommon/backup/tradedetail.png +0 -0
  18. package/src/jscommon/backup/umychart - backup.js +0 -17631
  19. package/src/jscommon/backup/umychart.macro.js +0 -4
  20. package/src/jscommon/backup/umychart.macro.vue.js +0 -3
  21. package/src/jscommon/commonindextree.json +0 -92
  22. package/src/jscommon/index.html +0 -13
  23. package/src/jscommon/jschinamapdata.js +0 -3
  24. package/src/jscommon/phoneHorizontal/hengping.css +0 -283
  25. package/src/jscommon/phoneHorizontal/phone.html +0 -448
  26. package/src/jscommon/phoneHorizontal/rem.js +0 -28
  27. package/src/jscommon/umychart.NetworkFilterTest.js +0 -48803
  28. package/src/jscommon/umychart.aliYunnetwork.js +0 -47
  29. package/src/jscommon/umychart.cninfo.components/readme.txt +0 -1
  30. package/src/jscommon/umychart.complier.js +0 -25293
  31. package/src/jscommon/umychart.complier.node/umychart.complier.controller.js +0 -559
  32. package/src/jscommon/umychart.complier.node/umychart.complier.node.js +0 -7043
  33. package/src/jscommon/umychart.complier.node/umychart.data.node.js +0 -816
  34. package/src/jscommon/umychart.console.js +0 -12
  35. package/src/jscommon/umychart.deal.js +0 -1452
  36. package/src/jscommon/umychart.dragdiv.js +0 -48
  37. package/src/jscommon/umychart.index.data.js +0 -4132
  38. package/src/jscommon/umychart.js +0 -90542
  39. package/src/jscommon/umychart.keyboard.js +0 -1659
  40. package/src/jscommon/umychart.listctrl.js +0 -690
  41. package/src/jscommon/umychart.mind.js +0 -2203
  42. package/src/jscommon/umychart.network.js +0 -44
  43. package/src/jscommon/umychart.news.js +0 -823
  44. package/src/jscommon/umychart.node.build/buildall.bat +0 -1
  45. package/src/jscommon/umychart.node.build/umychart.node.bat +0 -1
  46. package/src/jscommon/umychart.node.build/umychart.node.export.js +0 -40
  47. package/src/jscommon/umychart.regressiontest.js +0 -400
  48. package/src/jscommon/umychart.report.js +0 -5803
  49. package/src/jscommon/umychart.scrollbar.js +0 -1345
  50. package/src/jscommon/umychart.stock.js +0 -4218
  51. package/src/jscommon/umychart.style.js +0 -625
  52. package/src/jscommon/umychart.testdata.js +0 -150
  53. package/src/jscommon/umychart.uniapp.build/buildall.bat +0 -1
  54. package/src/jscommon/umychart.uniapp.build/umychart.bat +0 -1
  55. package/src/jscommon/umychart.uniapp.build/umychart.export.js +0 -70
  56. package/src/jscommon/umychart.user.js +0 -137
  57. package/src/jscommon/umychart.version.js +0 -30
  58. package/src/jscommon/umychart.vue/umychart.aliYunnetwork.vue.js +0 -56
  59. package/src/jscommon/umychart.vue.build/buildall.bat +0 -4
  60. package/src/jscommon/umychart.vue.build/copy_codemirror.bat +0 -2
  61. package/src/jscommon/umychart.vue.build/umychart.aliYunnetwork.vue.export.js +0 -9
  62. package/src/jscommon/umychart.vue.build/umychart.dragdiv.bat +0 -1
  63. package/src/jscommon/umychart.vue.build/umychart.dragdiv.export.js +0 -6
  64. package/src/jscommon/umychart.vue.build/umychart.index.data.bat +0 -1
  65. package/src/jscommon/umychart.vue.build/umychart.index.data.export.js +0 -4
  66. package/src/jscommon/umychart.vue.build/umychart.listctrl.vue.export.js +0 -15
  67. package/src/jscommon/umychart.vue.build/umychart.regressiontest.vue.export.js +0 -7
  68. package/src/jscommon/umychart.vue.build/umychart.regressiontest.wechat.export.js +0 -12
  69. package/src/jscommon/umychart.vue.build/umychart.stock.bat +0 -1
  70. package/src/jscommon/umychart.vue.build/umychart.stock.vue.export.js +0 -16
  71. package/src/jscommon/umychart.vue.build/umychart.testdata.bat +0 -3
  72. package/src/jscommon/umychart.vue.build/umychart.testdata.vue.export.js +0 -7
  73. package/src/jscommon/umychart.vue.build/umychart.vue.bat +0 -8
  74. package/src/jscommon/umychart.vue.build/umychart.vue.export.js +0 -112
  75. package/src/jscommon/umychart.vue.components/empyt.vue +0 -51
  76. package/src/jscommon/umychart.vue.components/historydayline.vue +0 -240
  77. package/src/jscommon/umychart.vue.components/jsloader.adddialog.vue +0 -315
  78. package/src/jscommon/umychart.vue.components/jsloader.vue +0 -93
  79. package/src/jscommon/umychart.vue.components/jsvuecontainer.vue +0 -160
  80. package/src/jscommon/umychart.vue.components/jsvuecontainer2.0.vue +0 -391
  81. package/src/jscommon/umychart.vue.components/login.vue +0 -178
  82. package/src/jscommon/umychart.vue.components/queryContent.vue +0 -750
  83. package/src/jscommon/umychart.vue.components/readme.txt +0 -8
  84. package/src/jscommon/umychart.vue.components/searchsymbol.vue +0 -299
  85. package/src/jscommon/umychart.vue.components/simulatetrade.vue +0 -1471
  86. package/src/jscommon/umychart.vue.components/stockchart.vue +0 -343
  87. package/src/jscommon/umychart.vue.components/stockchartV2.vue +0 -195
  88. package/src/jscommon/umychart.vue.components/stockdeal.vue +0 -358
  89. package/src/jscommon/umychart.vue.components/stockdealcount.vue +0 -262
  90. package/src/jscommon/umychart.vue.components/stockdeallastest.vue +0 -316
  91. package/src/jscommon/umychart.vue.components/stockdrawtool.vue +0 -343
  92. package/src/jscommon/umychart.vue.components/stockfull.vue +0 -355
  93. package/src/jscommon/umychart.vue.components/stockinfo.demo.vue +0 -153
  94. package/src/jscommon/umychart.vue.components/stockinfo.vue +0 -685
  95. package/src/jscommon/umychart.vue.components/stockkline.demo.vue +0 -1904
  96. package/src/jscommon/umychart.vue.components/stockmultiorder.vue +0 -174
  97. package/src/jscommon/umychart.vue.components/stockmultiperiod.vue +0 -222
  98. package/src/jscommon/umychart.vue.components/stockorder.vue +0 -320
  99. package/src/jscommon/umychart.vue.components/stocktradeinfo.demo.vue +0 -250
  100. package/src/jscommon/umychart.vue.components/stocktradeinfo.vue +0 -1907
  101. package/src/jscommon/umychart.vue.components/test.vue +0 -0
  102. package/src/jscommon/umychart.wechat/getDate.wechat.js +0 -91
  103. package/src/jscommon/umychart.wechat/lighter.news.wechat.js +0 -262
  104. package/src/jscommon/umychart.wechat/readme.txt +0 -3
  105. package/src/jscommon/umychart.wechat/umychart.analyze.wechat.js +0 -551
  106. package/src/jscommon/umychart.wechat/umychart.apidraw.wechat.js +0 -126
  107. package/src/jscommon/umychart.wechat/umychart.bigV.wechat.js +0 -2510
  108. package/src/jscommon/umychart.wechat/umychart.chartframe.wechat.js +0 -2942
  109. package/src/jscommon/umychart.wechat/umychart.chartpaint.wechat.js +0 -9752
  110. package/src/jscommon/umychart.wechat/umychart.charttitle.wechat.js +0 -2023
  111. package/src/jscommon/umychart.wechat/umychart.complier.wechat.js +0 -14726
  112. package/src/jscommon/umychart.wechat/umychart.console.wechat.js +0 -8
  113. package/src/jscommon/umychart.wechat/umychart.coordinatedata.wechat.js +0 -3654
  114. package/src/jscommon/umychart.wechat/umychart.data.wechat.js +0 -2243
  115. package/src/jscommon/umychart.wechat/umychart.element.wechart.js +0 -132
  116. package/src/jscommon/umychart.wechat/umychart.explainer.wechat.js +0 -1077
  117. package/src/jscommon/umychart.wechat/umychart.extendchart.wechat.js +0 -1140
  118. package/src/jscommon/umychart.wechat/umychart.framesplit.wechat.js +0 -2247
  119. package/src/jscommon/umychart.wechat/umychart.hqIndexformula.wechat.js +0 -941
  120. package/src/jscommon/umychart.wechat/umychart.index.data.wechat.js +0 -3628
  121. package/src/jscommon/umychart.wechat/umychart.index.wechat.js +0 -4074
  122. package/src/jscommon/umychart.wechat/umychart.klineinfo.wechat.js +0 -836
  123. package/src/jscommon/umychart.wechat/umychart.markethot.js +0 -50
  124. package/src/jscommon/umychart.wechat/umychart.network.wechart.js +0 -62
  125. package/src/jscommon/umychart.wechat/umychart.news.wechat.js +0 -3568
  126. package/src/jscommon/umychart.wechat/umychart.regressiontest.wechat.js +0 -412
  127. package/src/jscommon/umychart.wechat/umychart.report.wechat.js +0 -3983
  128. package/src/jscommon/umychart.wechat/umychart.resource.wechat.js +0 -919
  129. package/src/jscommon/umychart.wechat/umychart.shareimage.wechat.js +0 -681
  130. package/src/jscommon/umychart.wechat/umychart.simulatetrade.wechat.js +0 -238
  131. package/src/jscommon/umychart.wechat/umychart.stock.wechat.js +0 -4035
  132. package/src/jscommon/umychart.wechat/umychart.style.wechat.js +0 -419
  133. package/src/jscommon/umychart.wechat/umychart.uniapp.canvas.helper.js +0 -99
  134. package/src/jscommon/umychart.wechat/umychart.user.wechat.js +0 -588
  135. package/src/jscommon/umychart.wechat/umychart.userlog.wechat.js +0 -240
  136. package/src/jscommon/umychart.wechat/umychart.vedio.wechat.js +0 -112
  137. package/src/jscommon/umychart.wechat/umychart.version.wechat.js +0 -36
  138. package/src/jscommon/umychart.wechat/umychart.wechat.3.0.js +0 -12055
  139. package/src/jscommon/umychart.wechat/umychart.wechat.js +0 -15460
  140. package/src/jscommon/umychart.worker.js +0 -114
  141. package/src/jscommon/umychart.ws.stock.js +0 -110
  142. package/src/jscommon/umychart_python/.vscode/launch.json +0 -15
  143. package/src/jscommon/umychart_python/__init__.py +0 -4
  144. package/src/jscommon/umychart_python/build.cmd +0 -2
  145. package/src/jscommon/umychart_python/setup.py +0 -25
  146. package/src/jscommon/umychart_python/umychart_cache_testcase.py +0 -165
  147. package/src/jscommon/umychart_python/umychart_complier_data.py +0 -781
  148. package/src/jscommon/umychart_python/umychart_complier_help.py +0 -175
  149. package/src/jscommon/umychart_python/umychart_complier_job.py +0 -193
  150. package/src/jscommon/umychart_python/umychart_complier_jsalgorithm.py +0 -4144
  151. package/src/jscommon/umychart_python/umychart_complier_jscomplier.py +0 -177
  152. package/src/jscommon/umychart_python/umychart_complier_jsexecute.py +0 -517
  153. package/src/jscommon/umychart_python/umychart_complier_jsparser.py +0 -864
  154. package/src/jscommon/umychart_python/umychart_complier_jssymboldata.py +0 -1238
  155. package/src/jscommon/umychart_python/umychart_complier_jssymboldata_cache.py +0 -146
  156. package/src/jscommon/umychart_python/umychart_complier_jssymboldata_json.py +0 -106
  157. package/src/jscommon/umychart_python/umychart_complier_pandas_help.py +0 -80
  158. package/src/jscommon/umychart_python/umychart_complier_scanner.py +0 -554
  159. package/src/jscommon/umychart_python/umychart_complier_testcase.py +0 -362
  160. package/src/jscommon/umychart_python/umychart_complier_util.py +0 -30
  161. package/src/jscommon/umychart_python/umychart_webtemplate.py +0 -131
  162. package/src/jscommon/umychart_python/updatehqchartweb.bat +0 -5
  163. package/src/jscommon/vendor.js +0 -2
  164. package/src/pages/block.list.demo.page/App.vue +0 -117
  165. package/src/pages/block.list.demo.page/index.js +0 -12
  166. package/src/pages/brushTool.demo.page/App.vue +0 -19
  167. package/src/pages/brushTool.demo.page/index.js +0 -12
  168. package/src/pages/container.demo.page/App.vue +0 -118
  169. package/src/pages/container.demo.page/index.js +0 -18
  170. package/src/pages/dataZoom.demo.page/App.vue +0 -265
  171. package/src/pages/dataZoom.demo.page/components/dataZoom.vue +0 -303
  172. package/src/pages/dataZoom.demo.page/index.js +0 -12
  173. package/src/pages/historydayline.demo.page/App.vue +0 -57
  174. package/src/pages/historydayline.demo.page/index.js +0 -12
  175. package/src/pages/hq.demo.page/App.vue +0 -163
  176. package/src/pages/hq.demo.page/index.js +0 -12
  177. package/src/pages/hqchart.black/App.vue +0 -90
  178. package/src/pages/hqchart.black/components/searchsymbol.vue +0 -299
  179. package/src/pages/hqchart.black/components/stockdrawtool.vue +0 -300
  180. package/src/pages/hqchart.black/components/stockfull.vue +0 -313
  181. package/src/pages/hqchart.black/components/stockinfo.vue +0 -428
  182. package/src/pages/hqchart.black/components/stockkline.demo.vue +0 -1652
  183. package/src/pages/hqchart.black/components/stocktradeinfo.vue +0 -1337
  184. package/src/pages/hqchart.black/index.js +0 -30
  185. package/src/pages/hqchart.black/router/candlestickChart.vue +0 -108
  186. package/src/pages/hqchart.black/router/pricePointsTable.vue +0 -294
  187. package/src/pages/hqchart.black/router/stockDeallas.vue +0 -417
  188. package/src/pages/hqchart.black/router/timeShareChart.vue +0 -108
  189. package/src/pages/hqchart.page/App.vue +0 -101
  190. package/src/pages/hqchart.page/index.js +0 -18
  191. package/src/pages/index/App.vue +0 -1408
  192. package/src/pages/index/index.js +0 -7
  193. package/src/pages/indexHq/App.vue +0 -110
  194. package/src/pages/indexHq/index.js +0 -18
  195. package/src/pages/login.demo.page/App.vue +0 -22
  196. package/src/pages/login.demo.page/index.js +0 -12
  197. package/src/pages/queryContent.demo.page/App.vue +0 -29
  198. package/src/pages/queryContent.demo.page/index.js +0 -18
  199. package/src/pages/ranking.black/App.vue +0 -199
  200. package/src/pages/ranking.black/index.js +0 -18
  201. package/src/pages/search.demo.page/App.vue +0 -28
  202. package/src/pages/search.demo.page/index.js +0 -12
  203. package/src/pages/simulatetrade.demo.page/app.vue +0 -121
  204. package/src/pages/simulatetrade.demo.page/index.js +0 -17
  205. package/src/pages/stockdeal.demo.page/App.vue +0 -63
  206. package/src/pages/stockdeal.demo.page/index.js +0 -19
  207. package/src/pages/stockdealcount.demo.page/App.vue +0 -37
  208. package/src/pages/stockdealcount.demo.page/index.js +0 -12
  209. package/src/pages/stockdeallastest.demo.page/App.vue +0 -74
  210. package/src/pages/stockdeallastest.demo.page/index.js +0 -18
  211. package/src/pages/stockinfo.demo.page/App.vue +0 -92
  212. package/src/pages/stockinfo.demo.page/index.html +0 -13
  213. package/src/pages/stockinfo.demo.page/index.js +0 -19
  214. package/src/pages/stockkline.demo.page/App.vue +0 -55
  215. package/src/pages/stockkline.demo.page/index.js +0 -18
  216. package/src/pages/stockmultiorder.demo.page/App.vue +0 -149
  217. package/src/pages/stockmultiorder.demo.page/index.js +0 -18
  218. package/src/pages/stockmultiperiod.demo.page/App.vue +0 -87
  219. package/src/pages/stockmultiperiod.demo.page/index.js +0 -18
  220. package/src/pages/stockorder.demo.page/App.vue +0 -69
  221. package/src/pages/stockorder.demo.page/index.js +0 -18
  222. package/src/pages/test/App.vue +0 -22
  223. package/src/pages/test/index.js +0 -7
  224. package/src/pages/tradeinfopage/app.vue +0 -40
  225. package/src/pages/tradeinfopage/index.js +0 -7
  226. package/src/pages/tradeinfopage/tradeinfo.html +0 -12
  227. package/src/utils/urlObj.js +0 -81
  228. package/src/vendor.js +0 -2
  229. package/webpack.config.js +0 -104
@@ -1,690 +0,0 @@
1
- /*
2
- Copyright (c) 2018 jones
3
-
4
- http://www.apache.org/licenses/LICENSE-2.0
5
-
6
- 开源项目 https://github.com/jones2000/HQChart
7
-
8
- jones_2000@163.com
9
-
10
- 股票列表 (H5版本)
11
- */
12
-
13
- //单元个类型
14
- var CELL_TYPE_ID=
15
- {
16
- CELL_NONE_ID:0,
17
- CELL_INTEGER_ID:1, //整型
18
- CELL_STRING_ID:2,
19
- CELL_STOCK_NAME_ID:3, //股票名称
20
- CELL_STOCK_CODE_ID:4, //股票代码
21
- CELL_STOCK_PRICE_ID:5, //价格字段
22
- CELL_PERCENTAGE_ID:6, //百分比
23
- CELL_BIG_NUMBER_ID:7, //大数值数据
24
- CELL_DOUBLE_ID:8, //浮点型
25
- }
26
-
27
- //表头单元类型
28
- var HEAD_CELL_TYPE_ID=
29
- {
30
- CELL_STRING_ID:2, //字符串
31
- CELL_SELECT_ID:5 //下拉选择框
32
- };
33
-
34
-
35
- //行数据
36
- function JsCellItem()
37
- {
38
- this.Type=CELL_TYPE_ID.CELL_STRING_ID; //0=数值 1=字符串
39
- this.Value=null; //原始数值
40
- this.Text=''; //显示文本
41
- this.CSS; //对应css样式的名字
42
- this.Element; //td
43
- this.UpdateStatus={ Value:false, CSS:false }; //是否需要更新
44
- this.Index;
45
-
46
- this.Build=function(index, trElement)
47
- {
48
- this.Index=index;
49
- if (index<trElement.cells.length)
50
- {
51
- if (this.Element!=trElement.cells[index])
52
- {
53
- this.Element=trElement.cells[index];
54
- this.UpdateStatus={ Value:true, CSS:true };
55
- }
56
- }
57
- else
58
- {
59
- this.Element=trElement.insertCell(index);
60
- this.UpdateStatus={ Value:true, CSS:true };
61
- }
62
-
63
- this.Update();
64
- }
65
-
66
- this.Update=function()
67
- {
68
- if (!this.Element) return;
69
-
70
- if (this.UpdateStatus.Value==true) this.Element.innerHTML=this.Text;
71
- if (this.UpdateStatus.CSS==true) this.Element.className=this.CSS;
72
-
73
- this.UpdateStatus.Value=false;
74
- this.UpdateStatus.CSS=false;
75
- }
76
-
77
-
78
- this.SetValue=function(value, option) //option: { Type:单元个类型}
79
- {
80
- if (!option || !option.Type) this.SetStringValue(value.toString());
81
-
82
- switch(option.Type)
83
- {
84
- case CELL_TYPE_ID.CELL_STOCK_NAME_ID:
85
- case CELL_TYPE_ID.CELL_STOCK_CODE_ID:
86
- this.SetStringValue(value,option);
87
- break;
88
- case CELL_TYPE_ID.CELL_STOCK_PRICE_ID:
89
- this.SetPriceValue(value,option);
90
- break;
91
- case CELL_TYPE_ID.CELL_PERCENTAGE_ID:
92
- this.SetPercentageValue(value,option);
93
- break;
94
- case CELL_TYPE_ID.CELL_BIG_NUMBER_ID:
95
- this.SetBigNumberValue(value,option);
96
- break;
97
- case CELL_TYPE_ID.CELL_NONE_ID:
98
- this.SetNoneValue(value,option);
99
- break;
100
- case CELL_TYPE_ID.CELL_DOUBLE_ID:
101
- this.SetDoubleValue(value,option)
102
- break;
103
- case CELL_TYPE_ID.CELL_INTEGER_ID:
104
- this.SetIntegerValue(value,option);
105
- break;
106
- }
107
- }
108
-
109
- this.ChangeType=function(option)
110
- {
111
- if (!opton) return;
112
-
113
- var value=this.Value; //先读取值
114
- this.SetValue(value,option);
115
- }
116
-
117
- this.SetPercentageValue=function(value, option)
118
- {
119
- this.Value=value;
120
- if (JSTableHelper.IsNumber(value)) this.SetText(value.toFixed(option.Dec)+'%');
121
- else this.SetText(option.NullText);
122
-
123
- if (value>option.CompareValue) this.SetCSS(option.CSS[0]);
124
- else if (value<option.CompareValue) this.SetCSS(option.CSS[1]);
125
- else this.SetCSS(option.CSS[2]);
126
- }
127
-
128
- this.SetPriceValue=function(value, option)
129
- {
130
- if (value==this.Value) return;
131
-
132
- this.Value=value;
133
- if (!JSTableHelper.IsNumber(value)) this.SetText(option.NullText);
134
- else this.SetText(value.toFixed(option.Dec));
135
-
136
- if (value>option.CompareValue) this.SetCSS(option.CSS[0]);
137
- else if (value<option.CompareValue) this.SetCSS(option.CSS[1]);
138
- else this.SetCSS(option.CSS[2]);
139
- }
140
-
141
- this.SetBigNumberValue=function(value, option)
142
- {
143
- this.Value=value;
144
- this.SetText(JSTableHelper.FormatValueString(value,option.Dec[0],option.Dec[1]));
145
- this.UpdateStatus.Value=true;
146
-
147
- this.SetOption(option);
148
- }
149
-
150
- this.SetDoubleValue=function(value, option)
151
- {
152
- this.Type=CELL_TYPE_ID.CELL_DOUBLE_ID;
153
- this.Value=value;
154
- if (JSTableHelper.IsNumber(value)) this.SetText(value.toFixed(opton.Dec)); //TO:格式化类
155
- else this.SetText(option.NullText);
156
- this.UpdateStatus.Value=true;
157
-
158
- this.SetOption(option);
159
- }
160
-
161
- this.SetIntegerValue=function(value,option)
162
- {
163
- this.Type=CELL_TYPE_ID.CELL_INTEGER_ID;
164
- this.Value=value;
165
- if (JSTableHelper.IsNumber(value)) this.SetText(parseInt(value).toString()); //TO:格式化类
166
- else this.SetText(option.NullText);
167
-
168
- this.SetOption(option);
169
- }
170
-
171
- this.SetNoneValue=function(value,option)
172
- {
173
- this.Type=CELL_TYPE_ID.CELL_NONE_ID;
174
- this.Value=value;
175
- this.SetText(opton.NullText);
176
-
177
- this.SetOption(option);
178
- }
179
-
180
- this.SetStringValue=function(value, option)
181
- {
182
- this.Type=CELL_TYPE_ID.CELL_STRING_ID;
183
- this.Value=value;
184
- this.SetText(value);
185
-
186
- this.SetOption(option);
187
- }
188
-
189
-
190
- this.SetCSS=function(css)
191
- {
192
- if (!css) return;
193
-
194
- if (css!=this.CSS)
195
- {
196
- this.CSS=css;
197
- this.UpdateStatus.CSS=true;
198
- }
199
- }
200
-
201
- this.SetType=function(type)
202
- {
203
- if (JSTableHelper.IsNumber(type)) this.Type=type;
204
- }
205
-
206
- this.SetText=function(text)
207
- {
208
- if (this.Text!=text)
209
- {
210
- this.Text=text;
211
- this.UpdateStatus.Value=true;
212
- }
213
- }
214
-
215
- this.SetOption=function(option)
216
- {
217
- if (!option) return;
218
-
219
- this.SetCSS(option.CSS);
220
- this.SetType(option.Type);
221
- }
222
- }
223
-
224
- JsCellItem.GetCellRule=function(type)
225
- {
226
- const CELL_RULE_MAP=new Map
227
- ([
228
- [CELL_TYPE_ID.CELL_STOCK_NAME_ID, {Type:CELL_TYPE_ID.CELL_STOCK_NAME_ID, CSS:'jscell-stock-name'} ],
229
- [CELL_TYPE_ID.CELL_STOCK_CODE_ID, {Type:CELL_TYPE_ID.CELL_STOCK_CODE_ID, CSS:'jscell-stock-code'} ],
230
- [CELL_TYPE_ID.CELL_NONE_ID, {Type:CELL_TYPE_ID.CELL_NONE_ID, CSS:'jscell-none', NullText:''}],
231
-
232
- [CELL_TYPE_ID.CELL_PERCENTAGE_ID,
233
- {
234
- Type:CELL_TYPE_ID.CELL_PERCENTAGE_ID,
235
- CSS:["jscell-value-up","jscell-value-down","jscell-value-unchanged"],
236
- CompareValue:0, //对比值
237
- Dec:2, //小数位数
238
- NullText:'--'
239
- }
240
- ],
241
-
242
- [CELL_TYPE_ID.CELL_STOCK_PRICE_ID,
243
- {
244
- Type:CELL_TYPE_ID.CELL_PERCENTAGE_ID,
245
- CSS:["jscell-value-up","jscell-value-down","jscell-value-unchanged"],
246
- CompareValue:0, //填前收盘价
247
- Dec:2, //小数位数,
248
- NullText:'--'
249
- }
250
- ],
251
-
252
- [CELL_TYPE_ID.CELL_BIG_NUMBER_ID, { Type:CELL_TYPE_ID.CELL_BIG_NUMBER_ID, CSS:'jscell-big-number', Dec:[2,2] }],
253
- [CELL_TYPE_ID.CELL_INTEGER_ID, { Type:CELL_TYPE_ID.CELL_INTEGER_ID, CSS:'jscell-number', NullText:'--' }],
254
- [CELL_TYPE_ID.CELL_DOUBLE_ID, { Type:CELL_TYPE_ID.CELL_DOUBLE_ID, CSS:'jscell-number', NullText:'--' }]
255
- ]);
256
-
257
- if (CELL_RULE_MAP.has(type)) return CELL_RULE_MAP.get(type);
258
-
259
- return null;
260
- }
261
-
262
- function JsRowItem()
263
- {
264
- this.Cells=[];
265
- this.Index;
266
- this.Element; //tr
267
- this.Key; //主键 修改使用
268
-
269
- this.SetCell=function(index, value, option)
270
- {
271
- var cell=new JsCellItem();
272
- cell.SetValue(value, option);
273
- this.Cells[index]=cell;
274
- return cell;
275
- }
276
-
277
- this.InsertCell=function(index, value, option)
278
- {
279
- var cell=new JsCellItem();
280
- cell.SetValue(value, option);
281
- this.Cells.splice(index,0,cell);
282
- return cell;
283
- }
284
-
285
- this.RemoveCell=function(index)
286
- {
287
- var cell=this.Cells.splice(index,1);
288
- return cell;
289
- }
290
-
291
- this.Build=function(index, bodyElement)
292
- {
293
- this.Index=index;
294
- if (index<bodyElement.rows.length)
295
- this.Element=bodyElement.rows[index];
296
- else
297
- this.Element=bodyElement.insertRow(index);
298
-
299
- for(var i in this.Cells)
300
- {
301
- var cellItem=this.Cells[i];
302
- cellItem.Build(i, this.Element);
303
- }
304
-
305
- var cellCount=this.Cells.length;
306
- while(cellCount<this.Element.cells.length)
307
- {
308
- this.Element.deleteCell(-1);
309
- }
310
- }
311
-
312
- this.Update=function()
313
- {
314
- if (!this.Element) return;
315
-
316
- for(var i in this.Cells)
317
- {
318
- var cellItem=this.Cells[i];
319
- cellItem.Update();
320
- }
321
- }
322
- }
323
-
324
- function JsHeadCellItem()
325
- {
326
- this.CSS; //对应css样式的名字
327
- this.Element;
328
- this.Text;
329
- this.Index;
330
- this.Text;
331
- this.RowSpan;
332
- this.ColSpan;
333
- this.UpdateStatus={ Value:false, CSS:false, RowSpan:false, ColSpan:false }; //是否需要更新
334
- this.CreateElement; //自定义创建元素
335
- this.Identfiy=JSTableHelper.CreateGuid();
336
-
337
- this.Children=[];
338
-
339
- this.Build=function(index, trElement)
340
- {
341
- this.Index=index;
342
- if (index<trElement.cells.length)
343
- this.Element=trElement.cells[index];
344
- else
345
- this.Element=trElement.insertCell(index);
346
-
347
- this.Update();
348
- }
349
-
350
- this.Update=function()
351
- {
352
- if (!this.Element) return;
353
-
354
- if (this.CreateElement)
355
- {
356
- this.CreateElement(this, this.ID);
357
- return;
358
- }
359
-
360
- if (this.UpdateStatus.Value==true) this.Element.innerHTML=this.Text;
361
- if (this.UpdateStatus.CSS==true) this.Element.className=this.CSS;
362
- if (this.UpdateStatus.RowSpan==true) this.Element.rowSpan=this.RowSpan;
363
- if (this.UpdateStatus.ColSpan==true) this.Element.colSpan=this.ColSpan;
364
-
365
- this.UpdateStatus.Value=false;
366
- this.UpdateStatus.CSS=false;
367
- this.UpdateStatus.RowSpan=false;
368
- this.UpdateStatus.ColSpan=false;
369
- }
370
-
371
- this.SetText=function(text,option)
372
- {
373
- if (text!=this.Text)
374
- {
375
- this.Text=text;
376
- this.UpdateStatus.Value=true;
377
- }
378
-
379
- if (option)
380
- {
381
- if (option.CSS)
382
- {
383
- if (this.CSS!=option.CSS)
384
- {
385
- this.CSS=option.CSS;
386
- this.UpdateStatus.CSS=true;
387
- }
388
- }
389
-
390
- if (option.RowSpan && option.RowSpan!=this.RowSpan)
391
- {
392
- this.RowSpan=option.RowSpan;
393
- this.UpdateStatus.RowSpan=true;
394
- }
395
-
396
- if (option.ColSpan && option.ColSpan!=this.ColSpan)
397
- {
398
- this.ColSpan=option.ColSpan;
399
- this.UpdateStatus.ColSpan=true;
400
- }
401
-
402
- if (option.ID) this.Identfiy=option.ID;
403
- if (option.CreateElement) this.CreateElement=option.CreateElement;
404
- }
405
- }
406
- }
407
-
408
- JsHeadCellItem.GetCellRule=function(type)
409
- {
410
- const CELL_RULE_MAP=new Map
411
- ([
412
- [HEAD_CELL_TYPE_ID.CELL_STRING_ID, {Type:HEAD_CELL_TYPE_ID.CELL_STRING_ID, CSS:'jshcell-string'} ]
413
- ]);
414
-
415
- if (CELL_RULE_MAP.has(type)) return CELL_RULE_MAP.get(type);
416
-
417
- return null;
418
- }
419
-
420
- function JsHeadRowItem()
421
- {
422
- this.CSS; //对应css样式的名字
423
- this.Element; //<tr>
424
- this.Index;
425
- this.Cells=[];
426
-
427
- this.Build=function(index,headElement)
428
- {
429
- this.Index=index;
430
- if (index<headElement.rows.length)
431
- this.Element=headElement.rows[index];
432
- else
433
- this.Element=headElement.insertRow(index);
434
-
435
- for(var i in this.Cells)
436
- {
437
- var item=this.Cells[i];
438
- item.Build(i, this.Element);
439
- }
440
- }
441
-
442
- this.InsertCell=function(index, text, option)
443
- {
444
- var cell=new JsHeadCellItem();
445
- cell.SetText(text, option);
446
- this.Cells.splice(index,0,cell);
447
- return cell;
448
- }
449
- }
450
-
451
- function JsTableHead()
452
- {
453
- this.Element; //<thead>
454
- this.Rows=[]; // JsHeadRowItem
455
-
456
- this.Build=function()
457
- {
458
- for(var i in this.Rows)
459
- {
460
- var rowItem=this.Rows[i];
461
- rowItem.Build(i,this.Element);
462
- }
463
- }
464
-
465
- this.InsertRow=function(index)
466
- {
467
- var row=new JsHeadRowItem();
468
- this.Rows[index]=row;
469
-
470
- return row;
471
- }
472
-
473
- this.RowCount=function()
474
- {
475
- return this.Rows.length;
476
- }
477
-
478
- this.GetRow=function(rowIndex, rowColunm) //获取表头单元格数据
479
- {
480
- return this.Rows[rowIndex].Cells[rowColunm];
481
- }
482
- }
483
-
484
- function JSTable(divElement,option)
485
- {
486
- this.DivElement=divElement;
487
- this.Rows=[]; //行
488
- this.Head=new JsTableHead();
489
-
490
- this.TableElement=document.createElement("table");
491
- if (option && option.CSS) this.TableElement.className=option.CSS;
492
- else this.TableElement.className='jstable jstable-metrics jstable-bordered ';
493
- this.TableElement.id=JSTableHelper.CreateGuid();
494
- divElement.appendChild(this.TableElement);
495
-
496
- //表头
497
- this.Head.Element=document.createElement("thead");
498
- this.TableElement.appendChild(this.Head.Element);
499
-
500
- //标题
501
- this.BodyElement=document.createElement("tbody");
502
- this.TableElement.appendChild(this.BodyElement);
503
-
504
- //更新数据及行列
505
- this.Build=function()
506
- {
507
- this.Head.Build();
508
-
509
- for(var i in this.Rows)
510
- {
511
- var rowItem=this.Rows[i];
512
- rowItem.Build(i,this.BodyElement);
513
- }
514
-
515
- //删除多余的行
516
- var rowCount=this.Rows.length;
517
- while(rowCount<this.BodyElement.rows.length)
518
- {
519
- this.BodyElement.deleteRow(-1);
520
- }
521
- }
522
-
523
- //更新数据 行列不发生变化调用
524
- this.Update=function()
525
- {
526
- for(var i in this.Rows)
527
- {
528
- var rowItem=this.Rows[i];
529
- rowItem.Update();
530
- }
531
- }
532
-
533
- this.InsertRow=function(index, row)
534
- {
535
- this.Rows.splice(index, 0, row);
536
- return row;
537
- }
538
-
539
- this.RemoveRow=function(index) //删除行
540
- {
541
- var row=this.Rows.splice(index, 1);
542
- return row;
543
- }
544
-
545
- this.RemoveColumn=function(index) //删除列
546
- {
547
- for(var i in this.Rows)
548
- {
549
- var item=this.Rows[i];
550
- item.RemoveCell(index);
551
- }
552
- }
553
-
554
- this.ClearRows=function()
555
- {
556
- this.Rows=[];
557
- }
558
-
559
- this.InsertColumn=function(index, data) //添加列 data:{ Value:, Option }
560
- {
561
- if (Array.isArray(data))
562
- {
563
- for(var i in this.Rows)
564
- {
565
- var item=this.Rows[i];
566
- if (i<data.length)
567
- {
568
- const dataItem=data[i];
569
- item.InsertCell(index,dataItem.Value, dataItem.Option);
570
- }
571
- else
572
- {
573
- item.InsertCell(index,null,JsCellItem.GetCellRule(CELL_TYPE_ID.CELL_NONE_ID));
574
- }
575
- }
576
- }
577
- else
578
- {
579
- for(var i in this.Rows)
580
- {
581
- var item=this.Rows[i];
582
- item.InsertCell(index,data.Value, data.Option);
583
- }
584
- }
585
- }
586
-
587
- //设置单元格数据
588
- this.SetCellValue=function(rowIndex, colIndex, value, option)
589
- {
590
- if (rowIndex>=this.Rows.length) return;
591
- var row=this.Rows[rowIndex];
592
- if (colIndex>=row.Cells.length) return;
593
-
594
- row.Cells[colIndex].SetValue(value,option);
595
- }
596
-
597
- this.GetRowCount=function()
598
- {
599
- return this.Rows.length;
600
- }
601
-
602
- //排序
603
- this.Sort=function(orderID, colIndex) //0=不排序 1=升序 2=降序
604
- {
605
- if (orderID==1)
606
- {
607
- this.Rows.sort((a,b)=>
608
- {
609
- return a.Cells[colIndex].Value-b.Cells[colIndex].Value;
610
- })
611
- }
612
- else if (orderID==2)
613
- {
614
- this.Rows.sort((a,b)=>
615
- {
616
- return b.Cells[colIndex].Value-a.Cells[colIndex].Value;
617
- })
618
- }
619
- }
620
-
621
- }
622
-
623
-
624
- //////////////////////////////////////////////////////////////////////////////////////////////////
625
- // 公共方法
626
- //
627
- //
628
- //
629
-
630
- function JSTableHelper()
631
- {
632
-
633
- }
634
-
635
- JSTableHelper.CreateGuid=function()
636
- {
637
- function S4()
638
- {
639
- return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
640
- }
641
- return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
642
- }
643
-
644
- //是否是数值
645
- JSTableHelper.IsNumber=function(value)
646
- {
647
- if (value==null) return false;
648
- if (isNaN(value)) return false;
649
-
650
- return true;
651
- }
652
-
653
- //是否是整形
654
- JSTableHelper.IsInteger=function(x)
655
- {
656
- return (typeof x === 'number') && (x % 1 === 0);
657
- }
658
-
659
- //数据输出格式化 floatPrecision=原始小数位数 changedfloatPrecision=转换以后的小数位数
660
- JSTableHelper.FormatValueString=function(value, floatPrecision, changedfloatPrecision, languageID)
661
- {
662
- if (!JSTableHelper.IsNumber(value))
663
- {
664
- if (floatPrecision>0)
665
- {
666
- var nullText='-.';
667
- for(var i=0;i<floatPrecision;++i)
668
- nullText+='-';
669
- return nullText;
670
- }
671
-
672
- return '--';
673
- }
674
-
675
- if (value<0.00000000001 && value>-0.00000000001)
676
- {
677
- return "0";
678
- }
679
-
680
- var absValue = Math.abs(value);
681
- if (absValue < 10000)
682
- return value.toFixed(floatPrecision);
683
- else if (absValue < 100000000)
684
- return (value/10000).toFixed(changedfloatPrecision)+"万";
685
- else if (absValue < 1000000000000)
686
- return (value/100000000).toFixed(changedfloatPrecision)+"亿";
687
- else
688
- return (value/1000000000000).toFixed(changedfloatPrecision)+"万亿";
689
- }
690
-