st-comp 0.0.277 → 0.0.279

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 (319) hide show
  1. package/README.md +19 -19
  2. package/es/ChartLayout.cjs +1 -1
  3. package/es/ChartLayout.js +1 -1
  4. package/es/ConfigProvider.cjs +1 -1
  5. package/es/ConfigProvider.js +3 -3
  6. package/es/Contextmenu.cjs +1 -1
  7. package/es/Contextmenu.js +7 -7
  8. package/es/CustomFunction.cjs +2 -2
  9. package/es/CustomFunction.js +514 -308
  10. package/es/FactorWarning.cjs +1 -1
  11. package/es/FactorWarning.js +37 -37
  12. package/es/HeatMap.cjs +1 -1
  13. package/es/HeatMap.js +7 -7
  14. package/es/Kline.cjs +1 -1
  15. package/es/Kline.js +18 -18
  16. package/es/KlineBasic.cjs +1 -1
  17. package/es/KlineBasic.js +93 -93
  18. package/es/KlineConfig.cjs +1 -1
  19. package/es/KlineConfig.js +17 -17
  20. package/es/KlineNew.cjs +1 -1
  21. package/es/KlineNew.js +14 -14
  22. package/es/KlinePlus.cjs +4 -4
  23. package/es/KlinePlus.js +760 -656
  24. package/es/LinearLegend.cjs +1 -1
  25. package/es/LinearLegend.js +1 -1
  26. package/es/Map.cjs +1 -1
  27. package/es/Map.js +1 -1
  28. package/es/MonacoEditor.cjs +1 -1
  29. package/es/MonacoEditor.js +18 -18
  30. package/es/Pagination.cjs +1 -1
  31. package/es/Pagination.js +76 -76
  32. package/es/PasswordPrompt.cjs +1 -1
  33. package/es/PasswordPrompt.js +2 -2
  34. package/es/Pie.cjs +2 -2
  35. package/es/Pie.js +14 -14
  36. package/es/Table.cjs +1 -1
  37. package/es/Table.js +22 -22
  38. package/es/TreeMap.cjs +1 -1
  39. package/es/TreeMap.js +4 -4
  40. package/es/User.cjs +1 -1
  41. package/es/User.js +73 -73
  42. package/es/VarSelectDialog.cjs +2 -2
  43. package/es/VarSelectDialog.js +21 -21
  44. package/es/VarietyAiHelper.cjs +4 -4
  45. package/es/VarietyAiHelper.js +139 -138
  46. package/es/VarietyAutoComplete.cjs +1 -1
  47. package/es/VarietyAutoComplete.js +16 -16
  48. package/es/VarietySearch.cjs +4 -4
  49. package/es/VarietySearch.js +861 -857
  50. package/es/{VarietySelect-6a166293.js → VarietySelect-41daac7b.js} +10 -10
  51. package/es/{VarietySelect-610903f0.cjs → VarietySelect-d58eee29.cjs} +1 -1
  52. package/es/VarietyTextCopy.cjs +2 -2
  53. package/es/VarietyTextCopy.js +25 -25
  54. package/es/VirtualTable.cjs +1 -1
  55. package/es/VirtualTable.js +6 -6
  56. package/es/{_initCloneObject-152b4f4e.js → _initCloneObject-5e73c9c8.js} +2 -2
  57. package/es/{_initCloneObject-76e116d0.cjs → _initCloneObject-a5832933.cjs} +1 -1
  58. package/es/aiTools-229609fb.cjs +2 -0
  59. package/es/aiTools-ce2f9281.js +115 -0
  60. package/es/aiTools.js +179 -176
  61. package/es/{config-provider-4c784baf.cjs → config-provider-06ea6b42.cjs} +1 -1
  62. package/es/{config-provider-7a3aca55.js → config-provider-88b637a8.js} +3 -3
  63. package/es/{dropdown-987c47fb.cjs → dropdown-4ce4c3e2.cjs} +1 -1
  64. package/es/{dropdown-01e09205.js → dropdown-72fbc15d.js} +2 -2
  65. package/es/{el-autocomplete-342ae823.js → el-autocomplete-6cafcdf1.js} +5 -5
  66. package/es/{el-autocomplete-16f66b34.cjs → el-autocomplete-e0857c5b.cjs} +1 -1
  67. package/es/{el-button-13dc915f.cjs → el-button-613e0bb2.cjs} +1 -1
  68. package/es/{el-button-314171a0.js → el-button-94d3de38.js} +3 -3
  69. package/es/{el-checkbox-5899681f.js → el-checkbox-6d4cb393.js} +3 -3
  70. package/es/{el-checkbox-bdf64663.cjs → el-checkbox-e90762df.cjs} +1 -1
  71. package/es/{el-dialog-0ef95df6.cjs → el-dialog-02942e22.cjs} +1 -1
  72. package/es/{el-dialog-86a3eec2.js → el-dialog-5e30161f.js} +4 -4
  73. package/es/{el-form-item-77ef6784.cjs → el-form-item-44f060d8.cjs} +1 -1
  74. package/es/{el-form-item-cda4d93c.js → el-form-item-9e8969ea.js} +5 -5
  75. package/es/{el-input-fa1445ad.js → el-input-342b2def.js} +13 -13
  76. package/es/{el-input-89222943.cjs → el-input-9a9a7f7f.cjs} +1 -1
  77. package/es/{el-input-number-d3338e5e.cjs → el-input-number-65c847d6.cjs} +1 -1
  78. package/es/{el-input-number-8f6dbf74.js → el-input-number-c22b803a.js} +35 -35
  79. package/es/{el-loading-84dde1a8.cjs → el-loading-8179b497.cjs} +1 -1
  80. package/es/{el-loading-9b671203.js → el-loading-bcc51e3d.js} +1 -1
  81. package/es/{el-menu-item-535fef90.js → el-menu-item-339baf6d.js} +21 -21
  82. package/es/{el-menu-item-4531fd0e.cjs → el-menu-item-83186444.cjs} +1 -1
  83. package/es/{el-message-box-621ed2f1.js → el-message-box-035b699c.js} +9 -9
  84. package/es/{el-message-box-f5717070.cjs → el-message-box-c62d3217.cjs} +1 -1
  85. package/es/{el-overlay-23de4324.js → el-overlay-3e17604b.js} +3 -3
  86. package/es/{el-overlay-151708cb.cjs → el-overlay-8f1da9e8.cjs} +1 -1
  87. package/es/{el-popconfirm-b8aa490e.cjs → el-popconfirm-4e32ec1b.cjs} +1 -1
  88. package/es/{el-popconfirm-bcff0aa5.js → el-popconfirm-f8a86e2c.js} +4 -4
  89. package/es/{el-popper-43ec37f4.cjs → el-popper-a4f3ae4d.cjs} +1 -1
  90. package/es/{el-popper-03988662.js → el-popper-fbd0dcea.js} +1 -1
  91. package/es/{el-segmented-db3a86be.js → el-segmented-56bd58a8.js} +2 -2
  92. package/es/{el-segmented-79a1367c.cjs → el-segmented-833ac177.cjs} +1 -1
  93. package/es/{el-select-4bd0010d.js → el-select-44fa547d.js} +8 -8
  94. package/es/{el-select-ec04e7ce.cjs → el-select-70806166.cjs} +1 -1
  95. package/es/{el-table-column-35e47229.cjs → el-table-column-3e2cdfca.cjs} +1 -1
  96. package/es/{el-table-column-7af2bec7.js → el-table-column-b74a857d.js} +9 -9
  97. package/es/{el-tag-bef9e83d.js → el-tag-66c83156.js} +2 -2
  98. package/es/{el-tag-5d5608e0.cjs → el-tag-9c2f329f.cjs} +1 -1
  99. package/es/{el-text-f998902c.js → el-text-034bd3f4.js} +1 -1
  100. package/es/{el-text-abf10fdf.cjs → el-text-6b2374bb.cjs} +1 -1
  101. package/es/index-00f6ca75.cjs +1 -0
  102. package/es/{index-a00e0534.cjs → index-185792a7.cjs} +1 -1
  103. package/es/{index-d1b554ac.js → index-1e2a38ab.js} +2 -2
  104. package/es/{index-0986e373.cjs → index-3153c1db.cjs} +1 -1
  105. package/es/{index-936e7dec.js → index-44a382a5.js} +2 -2
  106. package/es/{index-ce21e2ce.js → index-5216d5f5.js} +5 -5
  107. package/es/{index-7ed0999e.js → index-53cc4e43.js} +720 -716
  108. package/es/{index-cfcd60ca.cjs → index-5c0dd943.cjs} +1 -1
  109. package/es/{index-cfd00899.cjs → index-870b6c9d.cjs} +1 -1
  110. package/es/{index-a83ec4b7.js → index-8c2d7e05.js} +1 -1
  111. package/es/{index-8901a38c.cjs → index-94131fd7.cjs} +30 -30
  112. package/es/{index-db846633.cjs → index-9d16cea8.cjs} +1 -1
  113. package/es/{index-f3f6ee27.js → index-a33b2fb8.js} +178 -178
  114. package/es/{index-2d7ac156.cjs → index-a9246d17.cjs} +17 -17
  115. package/es/{index-60c69dd1.cjs → index-ac8dc53d.cjs} +1 -1
  116. package/es/{index-102edf6c.js → index-c5f2d372.js} +2 -2
  117. package/es/{index-6290ae0f.js → index-c6584658.js} +2 -2
  118. package/es/{index-5c44d71a.js → index-eb96e074.js} +149 -119
  119. package/es/{index-5ed42e9c.js → index-f034b910.js} +2 -2
  120. package/es/{index-c58e90e9.cjs → index-f58b2920.cjs} +1 -1
  121. package/es/{python-6cc6ec1b.js → python-8a1664e6.js} +18 -18
  122. package/es/{python-71f59893.cjs → python-a3db9620.cjs} +1 -1
  123. package/es/style.css +1 -1
  124. package/es/{use-form-common-props-02be4928.cjs → use-form-common-props-ac666630.cjs} +1 -1
  125. package/es/{use-form-common-props-76a09d89.js → use-form-common-props-ed72e914.js} +11 -11
  126. package/es/{use-global-config-31b3ec57.cjs → use-global-config-23472471.cjs} +1 -1
  127. package/es/{use-global-config-0f43458b.js → use-global-config-ee406d58.js} +2 -2
  128. package/es/{validator-ea292506.cjs → validator-366dbf39.cjs} +1 -1
  129. package/es/{validator-0e037618.js → validator-c60a8956.js} +1 -1
  130. package/es/{zh-cn-1227eb8a.js → zh-cn-b59a0910.js} +1 -1
  131. package/es/{zh-cn-0edc7234.cjs → zh-cn-c21d12d8.cjs} +1 -1
  132. package/lib/aiTools.js +179 -176
  133. package/lib/bundle.js +1 -1
  134. package/lib/bundle.umd.cjs +230 -230
  135. package/lib/{index-2a269748.js → index-62fa175a.js} +30149 -29800
  136. package/lib/{python-41da18e5.js → python-4a48fa39.js} +1 -1
  137. package/lib/style.css +1 -1
  138. package/package.json +53 -44
  139. package/auto-imports.d.ts +0 -13
  140. package/components.d.ts +0 -59
  141. package/es/aiTools-a3b095f6.js +0 -113
  142. package/es/aiTools-f36136a4.cjs +0 -2
  143. package/es/index-476c4459.cjs +0 -1
  144. package/index.html +0 -13
  145. package/packages/ChartLayout/index.ts +0 -8
  146. package/packages/ChartLayout/index.vue +0 -63
  147. package/packages/ConfigProvider/index.ts +0 -8
  148. package/packages/ConfigProvider/index.vue +0 -66
  149. package/packages/Contextmenu/index.ts +0 -8
  150. package/packages/Contextmenu/index.vue +0 -134
  151. package/packages/CustomFunction/components/ManageDialog.vue +0 -706
  152. package/packages/CustomFunction/index.ts +0 -8
  153. package/packages/CustomFunction/index.vue +0 -200
  154. package/packages/FactorWarning/index.ts +0 -8
  155. package/packages/FactorWarning/index.vue +0 -754
  156. package/packages/FactorWarning/tools.js +0 -10
  157. package/packages/HeatMap/index.ts +0 -8
  158. package/packages/HeatMap/index.vue +0 -141
  159. package/packages/Kline/components/Contextmenu/index.vue +0 -110
  160. package/packages/Kline/components/Tips/index.vue +0 -40
  161. package/packages/Kline/componentsNew/KlineSlide/index.vue +0 -155
  162. package/packages/Kline/componentsNew/KlineSub/index.vue +0 -297
  163. package/packages/Kline/componentsNew/KlineTips/index.vue +0 -66
  164. package/packages/Kline/componentsNew/KlineUtils/index.vue +0 -84
  165. package/packages/Kline/componentsNew/Tips/index.vue +0 -33
  166. package/packages/Kline/formatKlineData.ts +0 -109
  167. package/packages/Kline/images/buy.svg +0 -1
  168. package/packages/Kline/images/pen.png +0 -0
  169. package/packages/Kline/images/sell.svg +0 -1
  170. package/packages/Kline/images/t.svg +0 -1
  171. package/packages/Kline/index.ts +0 -16
  172. package/packages/Kline/index.vue +0 -891
  173. package/packages/Kline/option.ts +0 -539
  174. package/packages/Kline/type.d.ts +0 -219
  175. package/packages/Kline/utils.ts +0 -682
  176. package/packages/KlineBasic/api.js +0 -58
  177. package/packages/KlineBasic/components/AverageTips/index.vue +0 -33
  178. package/packages/KlineBasic/components/Contextmenu/index.vue +0 -105
  179. package/packages/KlineBasic/components/KlineSub/index.vue +0 -332
  180. package/packages/KlineBasic/components/KlineTips/index.vue +0 -99
  181. package/packages/KlineBasic/components/Tips/index.vue +0 -56
  182. package/packages/KlineBasic/index.ts +0 -8
  183. package/packages/KlineBasic/index.vue +0 -839
  184. package/packages/KlineBasic/utils.js +0 -258
  185. package/packages/KlineConfig/config.js +0 -46
  186. package/packages/KlineConfig/index.ts +0 -8
  187. package/packages/KlineConfig/index.vue +0 -356
  188. package/packages/KlineNew/components/KlineSlide/index.vue +0 -156
  189. package/packages/KlineNew/components/KlineSub/index.vue +0 -335
  190. package/packages/KlineNew/components/KlineTips/index.vue +0 -96
  191. package/packages/KlineNew/components/KlineUtils/index.vue +0 -341
  192. package/packages/KlineNew/components/Tips/index.vue +0 -33
  193. package/packages/KlineNew/index.ts +0 -14
  194. package/packages/KlinePlus/components/SliderChart.vue +0 -208
  195. package/packages/KlinePlus/components/Tips.vue +0 -36
  196. package/packages/KlinePlus/images/buy.svg +0 -1
  197. package/packages/KlinePlus/images/sell.svg +0 -1
  198. package/packages/KlinePlus/images/t.svg +0 -1
  199. package/packages/KlinePlus/index.ts +0 -8
  200. package/packages/KlinePlus/index.vue +0 -1067
  201. package/packages/KlinePlus/utils.js +0 -771
  202. package/packages/LinearLegend/index.ts +0 -8
  203. package/packages/LinearLegend/index.vue +0 -112
  204. package/packages/Map/China.json +0 -1
  205. package/packages/Map/index.ts +0 -8
  206. package/packages/Map/index.vue +0 -147
  207. package/packages/MonacoEditor/index.ts +0 -8
  208. package/packages/MonacoEditor/index.vue +0 -1141
  209. package/packages/MonacoEditor/tools.js +0 -18
  210. package/packages/Pagination/index.ts +0 -8
  211. package/packages/Pagination/index.vue +0 -87
  212. package/packages/PasswordPrompt/index.ts +0 -8
  213. package/packages/PasswordPrompt/index.vue +0 -267
  214. package/packages/Pie/index.ts +0 -8
  215. package/packages/Pie/index.vue +0 -148
  216. package/packages/Table/components/Button/index.vue +0 -61
  217. package/packages/Table/components/Formatter/index.vue +0 -26
  218. package/packages/Table/index.d.ts +0 -0
  219. package/packages/Table/index.ts +0 -8
  220. package/packages/Table/index.vue +0 -133
  221. package/packages/TreeMap/index.ts +0 -8
  222. package/packages/TreeMap/index.vue +0 -186
  223. package/packages/User/components/EditInfoDialog/Mobile.vue +0 -214
  224. package/packages/User/components/EditInfoDialog/index.vue +0 -161
  225. package/packages/User/components/EditPasswordDialog.vue +0 -168
  226. package/packages/User/components/SetPasswordDialog.vue +0 -160
  227. package/packages/User/index.ts +0 -8
  228. package/packages/User/index.vue +0 -117
  229. package/packages/VarSelectDialog/Mock.js +0 -495
  230. package/packages/VarSelectDialog/VarietySelect.vue +0 -78
  231. package/packages/VarSelectDialog/index.ts +0 -8
  232. package/packages/VarSelectDialog/index.vue +0 -323
  233. package/packages/VarietyAiHelper/images/like.png +0 -0
  234. package/packages/VarietyAiHelper/images/like_no.png +0 -0
  235. package/packages/VarietyAiHelper/index.ts +0 -8
  236. package/packages/VarietyAiHelper/index.vue +0 -910
  237. package/packages/VarietyAutoComplete/index.ts +0 -8
  238. package/packages/VarietyAutoComplete/index.vue +0 -89
  239. package/packages/VarietySearch/components/AddTag/index.vue +0 -268
  240. package/packages/VarietySearch/components/CommonIndicator/IndicatorTags.vue +0 -52
  241. package/packages/VarietySearch/components/CommonIndicator/index.vue +0 -697
  242. package/packages/VarietySearch/components/CommonIndicator/tools.js +0 -260
  243. package/packages/VarietySearch/components/CompositeOrder/index.vue +0 -260
  244. package/packages/VarietySearch/components/FactorScreen/FactorDescription.vue +0 -70
  245. package/packages/VarietySearch/components/FactorScreen/index.vue +0 -1158
  246. package/packages/VarietySearch/components/FactorScreen/tools.js +0 -34
  247. package/packages/VarietySearch/config.js +0 -539
  248. package/packages/VarietySearch/index.ts +0 -8
  249. package/packages/VarietySearch/index.vue +0 -688
  250. package/packages/VarietyTextCopy/index.ts +0 -8
  251. package/packages/VarietyTextCopy/index.vue +0 -136
  252. package/packages/VirtualTable/index.ts +0 -8
  253. package/packages/VirtualTable/index.vue +0 -241
  254. package/packages/index.ts +0 -59
  255. package/public/aiTools.js +0 -176
  256. package/public/talib.wasm +0 -0
  257. package/public/vite.svg +0 -1
  258. package/src/App.vue +0 -140
  259. package/src/assets/vue.svg +0 -1
  260. package/src/components/Dialog/index.vue +0 -16
  261. package/src/components/Kline/index.vue +0 -21
  262. package/src/components/Table/index.vue +0 -27
  263. package/src/main.ts +0 -17
  264. package/src/pages/ChartLayout/index.vue +0 -22
  265. package/src/pages/ConfigProvider/index.vue +0 -9
  266. package/src/pages/Contextmenu/index.vue +0 -46
  267. package/src/pages/CustomFunction/index.vue +0 -13
  268. package/src/pages/FactorWarning/index.vue +0 -203
  269. package/src/pages/HeatMap/index.vue +0 -128
  270. package/src/pages/Kline/index.vue +0 -12
  271. package/src/pages/KlineBasic/api.js +0 -48
  272. package/src/pages/KlineBasic/index.vue +0 -366
  273. package/src/pages/KlineBasic/indicator.js +0 -114
  274. package/src/pages/KlineConfig/index.vue +0 -20
  275. package/src/pages/KlineNew/components/KlineAction/components/ContextMenu/index.vue +0 -91
  276. package/src/pages/KlineNew/components/KlineAction/components/YearChart/index.vue +0 -532
  277. package/src/pages/KlineNew/components/KlineAction/images/pen.png +0 -0
  278. package/src/pages/KlineNew/components/KlineAction/index.vue +0 -716
  279. package/src/pages/KlineNew/components/KlineAction/mockApi/index.js +0 -13
  280. package/src/pages/KlineNew/components/KlineAction/utils.js +0 -571
  281. package/src/pages/KlineNew/components/KlineBasic/index.vue +0 -336
  282. package/src/pages/KlineNew/components/KlineBasic/utils.js +0 -46
  283. package/src/pages/KlineNew/components/KlineNew/index.vue +0 -316
  284. package/src/pages/KlineNew/components/KlineNew/utils.js +0 -31
  285. package/src/pages/KlineNew/components/KlineSlide/index.vue +0 -448
  286. package/src/pages/KlineNew/components/KlineSlide/utils.js +0 -78
  287. package/src/pages/KlineNew/components/KlineSlideNew/index.vue +0 -430
  288. package/src/pages/KlineNew/components/KlineSlideNew/utils.js +0 -78
  289. package/src/pages/KlineNew/index.vue +0 -92
  290. package/src/pages/KlinePlus/KlineDialog/MultiCycle.vue +0 -312
  291. package/src/pages/KlinePlus/KlineDialog/api.js +0 -108
  292. package/src/pages/KlinePlus/KlineDialog/index.vue +0 -582
  293. package/src/pages/KlinePlus/KlineDialog/indicator.js +0 -109
  294. package/src/pages/KlinePlus/KlineDialog/tools.js +0 -86
  295. package/src/pages/KlinePlus/index.vue +0 -30
  296. package/src/pages/KlinePlus/tradeLogMock.js +0 -1927
  297. package/src/pages/LinearLegend/index.vue +0 -92
  298. package/src/pages/Map/index.vue +0 -62
  299. package/src/pages/MonacoEditor/index.vue +0 -63
  300. package/src/pages/Pagination/index.vue +0 -24
  301. package/src/pages/PasswordPrompt/index.vue +0 -12
  302. package/src/pages/Pie/index.vue +0 -36
  303. package/src/pages/Table/index.vue +0 -117
  304. package/src/pages/TreeMap/index.vue +0 -542
  305. package/src/pages/User/index.vue +0 -24
  306. package/src/pages/VarSelectDialog/index.vue +0 -16
  307. package/src/pages/VarietyAiHelper/index.vue +0 -20
  308. package/src/pages/VarietyAutoComplete/index.vue +0 -19
  309. package/src/pages/VarietySearch/api.js +0 -70
  310. package/src/pages/VarietySearch/index.vue +0 -467
  311. package/src/pages/VarietyTextCopy/index.vue +0 -24
  312. package/src/pages/VirtualTable/demo.json +0 -6377
  313. package/src/pages/VirtualTable/index.vue +0 -79
  314. package/src/router/index.ts +0 -9
  315. package/src/router/routes.ts +0 -132
  316. package/src/style.css +0 -79
  317. package/src/vite-env.d.ts +0 -9
  318. package/tsconfig.json +0 -30
  319. package/tsconfig.node.json +0 -10
@@ -1,258 +0,0 @@
1
- import dayjs from "dayjs";
2
- import { stMath } from "st-func";
3
- import { updateWarningLine } from "./api";
4
-
5
- const { round } = stMath;
6
-
7
- // 获取主图配置
8
- export const getMainOptions = (chartData, config, startValue, endValue, cycle) => {
9
- const { data, time } = chartData;
10
- const { gridTop, gridRight, gridLeft, maxShowCounts, showSubChart } = config;
11
- return {
12
- animation: false,
13
- grid: {
14
- top: `${gridTop}px`,
15
- right: `${gridRight}px`,
16
- bottom: showSubChart ? "6px" : "24px",
17
- left: `${gridLeft}px`,
18
- },
19
- dataZoom: [
20
- {
21
- type: "inside",
22
- startValue,
23
- endValue,
24
- maxValueSpan: maxShowCounts,
25
- },
26
- ],
27
- tooltip: {
28
- trigger: "axis",
29
- appendToBody: true,
30
- confine: true,
31
- axisPointer: {
32
- type: "cross",
33
- label: {
34
- rich: {},
35
- formatter: (data) => {
36
- const { axisDimension, value } = data;
37
- if (axisDimension === "x") {
38
- if (showSubChart) {
39
- return "";
40
- } else {
41
- if (["6", "7", "8"].includes(cycle)) {
42
- return dayjs(value).format("YYYY-MM-DD");
43
- } else {
44
- return value;
45
- }
46
- }
47
- } else {
48
- return String(round(value));
49
- }
50
- },
51
- },
52
- },
53
- formatter: () => "",
54
- },
55
- xAxis: {
56
- show: showSubChart ? false : true,
57
- type: "category",
58
- data: time,
59
- splitLine: {
60
- show: false,
61
- },
62
- axisLabel: {
63
- formatter: (value) => {
64
- if (["6", "7", "8"].includes(cycle)) {
65
- return dayjs(value).format("YYYY-MM-DD");
66
- } else {
67
- return value;
68
- }
69
- },
70
- },
71
- },
72
- yAxis: {
73
- type: "value",
74
- axisLine: {
75
- show: true,
76
- },
77
- splitLine: {
78
- show: true,
79
- lineStyle: {
80
- type: "dotted",
81
- color: "#333",
82
- },
83
- },
84
- min: (value) => round(value.min),
85
- max: (value) => round(value.max),
86
- },
87
- series: [
88
- {
89
- type: "candlestick",
90
- data,
91
- itemStyle: {
92
- color: "transparent",
93
- color0: "#00FFFF",
94
- borderColor: "#FF0000",
95
- borderColor0: "#00FFFF",
96
- borderWidth: 1,
97
- },
98
- },
99
- ...chartData.mainIndicator.map((item) => {
100
- return {
101
- name: item.key,
102
- type: "line",
103
- silent: true,
104
- symbol: "none",
105
- data: item.data,
106
- lineStyle: {
107
- width: item.width || 1,
108
- },
109
- itemStyle: {
110
- color: item.color,
111
- },
112
- };
113
- }),
114
- ],
115
- toolbox: {
116
- show: false,
117
- },
118
- brush: {
119
- xAxisIndex: "all",
120
- brushLink: "all",
121
- transformable: false,
122
- outOfBrush: {
123
- colorAlpha: 2,
124
- },
125
- brushStyle: {
126
- color: "rgba(255,255,255,0.1)",
127
- borderColor: "rgba(255,255,255,0.4)",
128
- },
129
- },
130
- };
131
- };
132
-
133
- // 获取画线预警配置
134
- export const getWarningLineOptions = (mainChartIns, warningLineData, props, config, callback) => {
135
- const { variety, featureId, featureType } = props;
136
- const { gridTop, gridLeft, gridRight } = config;
137
- return warningLineData.reduce((res, item) => {
138
- const { warnPrice } = item;
139
- const y = mainChartIns?.convertToPixel({ yAxisIndex: 0 }, warnPrice);
140
- // 位于顶部的预警线不绘制
141
- if (y <= gridTop) return res;
142
- // 超出图表的预警线不绘制
143
- if (y >= mainChartIns?.getHeight()) return res;
144
- let dragStart = 0; // 记录拖拽开始的位置
145
- return [
146
- ...res,
147
- {
148
- type: "group",
149
- name: "warningLine",
150
- info: item,
151
- draggable: "vertical",
152
- children: [
153
- {
154
- type: "line",
155
- info: item,
156
- shape: {
157
- x1: gridLeft, // 开始X坐标
158
- y1: y, // 开始Y坐标
159
- x2: mainChartIns?.getWidth() - gridRight, // 结束X坐标
160
- y2: y, // 结束Y坐标
161
- },
162
- style: {
163
- stroke: "#FFF",
164
- lineWidth: 1,
165
- lineDash: [8, 4],
166
- },
167
- z: 10,
168
- },
169
- {
170
- type: "text",
171
- info: item,
172
- x: mainChartIns?.getWidth() - gridRight,
173
- y: y - 5,
174
- style: {
175
- fill: "#FFF",
176
- text: warnPrice,
177
- stroke: "#000",
178
- lineWidth: 1,
179
- opacity: 1,
180
- },
181
- z: 10,
182
- },
183
- ],
184
- // 事件:开始拖拽
185
- ondragstart: (params) => {
186
- dragStart = params.offsetY; // 记录拖拽开始坐标
187
- },
188
- ondrag: (params) => {
189
- if (params.target && params.target.childAt(1)) {
190
- const newValue = mainChartIns.convertFromPixel({ yAxisIndex: 0 }, y + (params.offsetY - dragStart));
191
- params.target
192
- .childAt(1)
193
- ?.animate("style", false)
194
- .when(1, { text: round(newValue, 3) })
195
- .start();
196
- }
197
- },
198
- // 事件:结束拖拽
199
- ondragend: async (params) => {
200
- /**
201
- * 之所以不直接使用dragEnd,是因为echarts拖拽会有偏差问题
202
- * 需要使用偏移量才会更加准备,不然会出现画完线渲染位置和拖拽位置不一致
203
- */
204
- const dragEnd = params.offsetY; // 记录结束拖拽坐标
205
- const dragInterval = dragEnd - dragStart; // 拖拽偏移量
206
- if (dragInterval !== 0) {
207
- // 计算偏移后对应的Y轴数据
208
- const yAxisValue = mainChartIns?.convertFromPixel({ yAxisIndex: 0 }, dragInterval + y);
209
- const params = {
210
- id: item.id,
211
- warnPrice: round(yAxisValue, 3),
212
- featureId, //品种id
213
- featureCode: variety, //品种代码
214
- featureType, //品种类型
215
- };
216
- await updateWarningLine(params);
217
- ElMessage.success("画线预警修改成功");
218
- callback && callback();
219
- }
220
- },
221
- },
222
- ];
223
- }, []);
224
- };
225
-
226
- // 格式化指标数据,整数保留两位小数,小数保留两位有效数字 AI生成
227
- export function formatIndicatorNumber(value) {
228
- // ----- 辅助函数:转换为有效的有限数字 -----
229
- function toValidNumber(v) {
230
- if (typeof v === 'number') {
231
- return Number.isFinite(v) ? v : null; // 排除 NaN / Infinity
232
- }
233
- if (typeof v === 'string') {
234
- const trimmed = v.trim();
235
- if (trimmed === '') return null; // 空字符串视为异常
236
- const num = Number(trimmed);
237
- return Number.isFinite(num) ? num : null; // 转换后必须为有限数字
238
- }
239
- return null; // 其他类型一律异常
240
- }
241
- const validNum = toValidNumber(value);
242
- if (validNum === null) return "-";
243
-
244
- try {
245
- if (validNum >= 1 || validNum <= -1) {
246
- // 整数:保留两位小数
247
- return round(validNum);
248
- } else {
249
- // 非整数:先获得两位有效数字的科学计数法形式
250
- const precisionStr = validNum.toPrecision(3);
251
- // 最后一位小数进行四舍五入
252
- return round(precisionStr, precisionStr.split('.')[1].length - 1)
253
- }
254
- } catch (e) {
255
- // 防御性捕获(理论上不会发生)
256
- return "-";
257
- }
258
- }
@@ -1,46 +0,0 @@
1
- export const sellBuyOptions = [
2
- { label: "买卖", value: 0 },
3
- { label: "开平", value: 1 },
4
- ];
5
-
6
- // 默认K线用户自定义配置
7
- export const getDefaultUserKlineConfig = () => {
8
- return {
9
- /**
10
- * @description: 偏好设置
11
- */
12
- // 主图指标默认展示
13
- mainIndicator: "MA",
14
- // 成交点默认展示
15
- sellBuy: 1,
16
- // 成交点默认按照实际价格标记
17
- sellBuyByPrice: 1,
18
- // 单周期默认展示
19
- singelCycle: "6",
20
- // 多周期布局 2 4 6
21
- multiCycleNum: 6,
22
- // 多周期N宫格周期
23
- multiCycleList: ["1", "2", "3", "4", "5", "6"],
24
- // 默认展示模块
25
- pageType: 1, // 展示模块 1-单周期, 2-多周期
26
-
27
- /**
28
- * @description: 功能配置
29
- */
30
- enable_tradeLogBrush: true, // 高亮交易范围
31
- enable_showScreenTimeRange: true, // 展示当屏时间范围
32
- enable_showScreenMaxPrice: true, // 展示当屏最高价
33
- enable_dbClickOpenSingel: true, // 多周期双击图表切换至单周期
34
-
35
- /**
36
- * @description: 组件开关
37
- */
38
- enable_subChart: true, // 是否启用副图
39
- enable_sliderChart: true, // 是否启用拖拽轴
40
- };
41
- };
42
-
43
- // 字典文案映射
44
- export const formatLabel = (value, options) => {
45
- return options.find((item) => item.value === value)?.label ?? "-";
46
- };
@@ -1,8 +0,0 @@
1
- import { App } from "vue";
2
- import StKlineConfig from "./index.vue";
3
-
4
- export default {
5
- install(app: App) {
6
- app.component("st-klineConfig", StKlineConfig);
7
- },
8
- }
@@ -1,356 +0,0 @@
1
- <!-- 用户K线自定义配置 -->
2
- <script setup>
3
- import { ref, reactive, onMounted, inject, watch } from "vue";
4
- import { getDefaultUserKlineConfig, sellBuyOptions, formatLabel } from "./config";
5
-
6
- const { request } = inject("stConfig"); // 组件库全局配置
7
-
8
- const emit = defineEmits("callBack");
9
- const props = defineProps({
10
- indicatorStore: { type: Object, default: () => ({}) }, // 指标配置Store
11
- origin: { type: String, default: "server" }, // 数据来源: server服务器, local本地
12
- // 如果server此项不用管, 如果local则使用此项
13
- cycleOptions: { type: Array, default: () => [] },
14
- });
15
-
16
- const visible = ref(false);
17
- const form = reactive({});
18
-
19
- const cycleOptions = ref([]);
20
- const mainIndicatorOptions = ref([]);
21
-
22
- // 配置: 恢复默认
23
- const handleReset = () => {
24
- Object.assign(form, getDefaultUserKlineConfig());
25
- };
26
- // 配置: 保存配置
27
- const handleSubmit = async () => {
28
- const json = JSON.stringify(form);
29
- if (props.origin === "server") {
30
- await request.post("/common/qt/updateUserConfig", { appId: 1, json });
31
- } else {
32
- localStorage.setItem("userKlineConfig", json);
33
- }
34
- emit("callBack", json);
35
- visible.value = false;
36
- };
37
- // 获取配置数据
38
- const getKlineConfig = async () => {
39
- if (props.origin === "server") {
40
- const { body } = await request.post("/common/qt/getUserConfig", { appId: 1 });
41
- Object.assign(form, getDefaultUserKlineConfig(), body ? JSON.parse(body) : {});
42
- } else {
43
- const body = localStorage.getItem("userKlineConfig");
44
- Object.assign(form, getDefaultUserKlineConfig(), body ? JSON.parse(body) : {});
45
- }
46
- };
47
- // 获取周期选项
48
- const getCycleOptions = async () => {
49
- if (props.origin === "server") {
50
- const { body } = await request.post("/common/qt/getDict", { dictIds: [1002] });
51
- cycleOptions.value = body[1002].map((item) => {
52
- return {
53
- label: item.dictName,
54
- value: item.dictCode,
55
- };
56
- });
57
- } else {
58
- cycleOptions.value = props.cycleOptions;
59
- }
60
- };
61
-
62
- onMounted(() => {
63
- getCycleOptions();
64
- mainIndicatorOptions.value = props.indicatorStore.mainIndicatorList ?? [];
65
- });
66
- watch(
67
- () => props.indicatorStore.mainIndicatorList,
68
- () => {
69
- mainIndicatorOptions.value = props.indicatorStore.mainIndicatorList ?? [];
70
- },
71
- );
72
- defineExpose({
73
- // 打开
74
- open: async () => {
75
- await getKlineConfig();
76
- visible.value = true;
77
- },
78
- // 获取默认配置
79
- getDefaultUserKlineConfig,
80
- });
81
- </script>
82
-
83
- <template>
84
- <div class="kline-config element-dark">
85
- <!-- 自定义配置 -->
86
- <el-drawer
87
- v-model="visible"
88
- title="K线自定义配置"
89
- :size="320"
90
- >
91
- <el-scrollbar class="setting-main">
92
- <!-- 偏好设置 -->
93
- <el-divider style="margin-top: 8px">偏好设置</el-divider>
94
- <div class="setting-item">
95
- <span class="label">主图指标: </span>
96
- <el-select
97
- v-model="form.mainIndicator"
98
- popper-class="element-dark"
99
- >
100
- <el-option
101
- v-for="(item, index) in mainIndicatorOptions"
102
- :key="index"
103
- :label="item.label"
104
- :value="item.value"
105
- />
106
- </el-select>
107
- </div>
108
- <div class="setting-item">
109
- <span class="label">交易点位: </span>
110
- <el-select
111
- v-model="form.sellBuy"
112
- popper-class="element-dark"
113
- >
114
- <el-option
115
- v-for="(item, index) in sellBuyOptions"
116
- :key="index"
117
- :label="item.label"
118
- :value="item.value"
119
- />
120
- </el-select>
121
- </div>
122
- <div class="setting-item">
123
- <span class="label">开平点按价格标: </span>
124
- <el-checkbox
125
- v-model="form.sellBuyByPrice"
126
- :true-value="1"
127
- :false-value="0"
128
- />
129
- </div>
130
- <div class="setting-item">
131
- <span class="label">单周期: </span>
132
- <el-select
133
- v-model="form.singelCycle"
134
- popper-class="element-dark"
135
- >
136
- <el-option
137
- v-for="(item, index) in cycleOptions"
138
- :key="index"
139
- :label="item.label"
140
- :value="item.value"
141
- />
142
- </el-select>
143
- </div>
144
- <div class="setting-item">
145
- <span class="label">多周期: </span>
146
- <el-segmented
147
- size="small"
148
- v-model="form.multiCycleNum"
149
- :options="[
150
- { label: '二图', value: 2 },
151
- { label: '四图', value: 4 },
152
- { label: '六图', value: 6 },
153
- ]"
154
- style="height: 26px"
155
- />
156
- </div>
157
- <div :class="`setting-multi-box grid-${form.multiCycleNum}`">
158
- <template v-for="(item, index) in form.multiCycleList.slice(0, form.multiCycleNum)">
159
- <div class="mode">
160
- <div class="cycleName">
161
- <span>{{ formatLabel(form.multiCycleList[index], cycleOptions) }}</span>
162
- <el-select
163
- v-model="form.multiCycleList[index]"
164
- popper-class="element-dark"
165
- >
166
- <el-option
167
- v-for="(item, index) in cycleOptions"
168
- :key="index"
169
- :label="item.label"
170
- :value="item.value"
171
- />
172
- </el-select>
173
- </div>
174
- <span class="content">{{ index + 1 }}号位K线</span>
175
- </div>
176
- </template>
177
- </div>
178
- <div class="setting-item">
179
- <span class="label">默认展示: </span>
180
- <el-segmented
181
- size="small"
182
- v-model="form.pageType"
183
- :options="[
184
- { label: '单周期', value: 1 },
185
- { label: '多周期', value: 2 },
186
- ]"
187
- style="height: 26px"
188
- />
189
- </div>
190
- <!-- 功能配置 -->
191
- <el-divider style="margin-top: 44px">功能配置</el-divider>
192
- <div class="setting-item">
193
- <span class="label">高亮交易范围: </span>
194
- <el-switch v-model="form.enable_tradeLogBrush" />
195
- </div>
196
- <div class="setting-item">
197
- <span class="label">展示当屏时间: </span>
198
- <el-switch v-model="form.enable_showScreenTimeRange" />
199
- </div>
200
- <div class="setting-item">
201
- <span class="label">展示当屏最高价: </span>
202
- <el-switch v-model="form.enable_showScreenMaxPrice" />
203
- </div>
204
- <div class="setting-item">
205
- <span class="label">多周期双击图表切换至单周期: </span>
206
- <el-switch v-model="form.enable_dbClickOpenSingel" />
207
- </div>
208
- <!-- 组件开关 -->
209
- <el-divider style="margin-top: 44px">组件开关</el-divider>
210
- <div class="setting-item">
211
- <span class="label">开启副图: </span>
212
- <el-switch v-model="form.enable_subChart" />
213
- </div>
214
- <div class="setting-item">
215
- <span class="label">开启拖拽轴: </span>
216
- <el-switch v-model="form.enable_sliderChart" />
217
- </div>
218
- </el-scrollbar>
219
- <div class="setting-footer">
220
- <!-- 恢复默认 -->
221
- <el-button @click="handleReset"> 恢复默认 </el-button>
222
- <el-button
223
- type="primary"
224
- @click="handleSubmit"
225
- >
226
- 保存配置
227
- </el-button>
228
- </div>
229
- </el-drawer>
230
- </div>
231
- </template>
232
-
233
- <style lang="scss" scoped>
234
- .kline-config {
235
- cursor: default;
236
- height: 20px;
237
- :deep(.el-drawer__header) {
238
- margin-bottom: 0;
239
- background-color: #141414;
240
- }
241
- :deep(.el-drawer__body) {
242
- background-color: #141414;
243
- }
244
- // 配置入口
245
- .setting-icon {
246
- cursor: pointer;
247
- &:hover {
248
- color: var(--el-color-primary);
249
- }
250
- }
251
- // 配置内容
252
- .setting-main {
253
- font-size: 14px;
254
- color: var(--el-text-color-primary);
255
- height: calc(100% - 80px);
256
- box-sizing: border-box;
257
- padding-right: 10px;
258
- // 单行控制项
259
- .setting-item {
260
- width: 100%;
261
- display: flex;
262
- align-items: center;
263
- justify-content: space-between;
264
- margin-bottom: 8px;
265
- .label {
266
- display: flex;
267
- align-items: center;
268
- gap: 4px;
269
- }
270
- .el-select {
271
- width: 130px;
272
- }
273
- }
274
- // 多周期布局
275
- .setting-multi-box {
276
- margin-top: 13px;
277
- margin-bottom: 18px;
278
- .cycleName {
279
- color: white;
280
- font-size: 10px;
281
- padding: 1px 2px;
282
- padding-left: 4px;
283
- background-color: var(--el-color-primary);
284
- display: flex;
285
- align-items: center;
286
- border-bottom-left-radius: 4px;
287
- position: absolute;
288
- z-index: 999;
289
- right: 0px;
290
- top: 0px;
291
- :deep(.el-select) {
292
- margin-left: 4px;
293
- width: 12px;
294
- .el-select__icon {
295
- margin-left: 0;
296
- color: black;
297
- width: 12px;
298
- height: 12px;
299
- }
300
- .el-select__wrapper {
301
- border-radius: 50%;
302
- background: #ccc;
303
- padding: 0;
304
- gap: 0;
305
- min-height: 12px;
306
- line-height: 12px;
307
- box-shadow: none;
308
- }
309
- .el-select__input {
310
- min-width: 0 !important;
311
- width: 0 !important;
312
- }
313
- }
314
- }
315
- .mode {
316
- width: 100%;
317
- height: 100%;
318
- box-sizing: border-box;
319
- border: 1px solid var(--el-border-color);
320
- position: relative;
321
- display: flex;
322
- align-items: center;
323
- justify-content: center;
324
- }
325
- }
326
- .grid-2 {
327
- display: grid;
328
- grid-template-columns: repeat(2, 1fr);
329
- grid-template-rows: repeat(1, minmax(80px, 1fr));
330
- grid-gap: 2px;
331
- }
332
- .grid-4 {
333
- display: grid;
334
- grid-template-columns: repeat(2, 1fr);
335
- grid-template-rows: repeat(2, minmax(80px, 1fr));
336
- grid-gap: 2px;
337
- }
338
- .grid-6 {
339
- display: grid;
340
- grid-template-columns: repeat(3, 1fr);
341
- grid-template-rows: repeat(2, minmax(80px, 1fr));
342
- grid-gap: 2px;
343
- }
344
- }
345
- // 底部按钮
346
- .setting-footer {
347
- height: 80px;
348
- display: flex;
349
- flex-direction: column;
350
- justify-content: space-between;
351
- .el-button {
352
- margin-left: 0;
353
- }
354
- }
355
- }
356
- </style>