st-comp 0.0.192 → 0.0.194

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 (78) hide show
  1. package/es/ChartLayout.js +4 -4
  2. package/es/CustomFunction.cjs +1 -1
  3. package/es/CustomFunction.js +32 -32
  4. package/es/FactorWarning.js +29 -29
  5. package/es/Kline.js +15 -15
  6. package/es/KlineBasic.cjs +1 -1
  7. package/es/KlineBasic.js +110 -104
  8. package/es/KlineConfig.js +20 -20
  9. package/es/KlineNew.js +14 -14
  10. package/es/KlinePlus.js +17 -17
  11. package/es/Map.cjs +1 -1
  12. package/es/Map.js +1 -102944
  13. package/es/MonacoEditor.cjs +1 -1
  14. package/es/MonacoEditor.js +1 -1
  15. package/es/Pagination.js +69 -69
  16. package/es/PasswordPrompt.js +3 -3
  17. package/es/Table.js +29 -29
  18. package/es/User.js +21 -21
  19. package/es/VarSelectDialog.js +22 -22
  20. package/es/VarietyAutoComplete.js +9 -9
  21. package/es/VarietySearch.cjs +6 -6
  22. package/es/VarietySearch.js +523 -507
  23. package/es/VirtualTable.js +13 -13
  24. package/es/{_initCloneObject-d37d0044.js → _initCloneObject-25087817.js} +9 -9
  25. package/es/{base-62a70f61.js → base-f5b11441.js} +40 -40
  26. package/es/{config-provider-eb54307e.js → config-provider-95d27ce2.js} +6 -6
  27. package/es/{debounce-ccdceb02.js → debounce-06f59c68.js} +9 -9
  28. package/es/{dropdown-e0119d36.js → dropdown-7a853d45.js} +9 -9
  29. package/es/{el-autocomplete-fdd72342.js → el-autocomplete-e74d589c.js} +15 -15
  30. package/es/{el-button-17a2e708.js → el-button-5a260464.js} +33 -33
  31. package/es/{el-dialog-2fbffe7d.js → el-dialog-8d8f6443.js} +15 -15
  32. package/es/{el-divider-2f300113.js → el-divider-4e1c0fb8.js} +1 -1
  33. package/es/{el-empty-34086220.js → el-empty-deee6b39.js} +5 -5
  34. package/es/{el-form-item-5f9d8170.js → el-form-item-3167d76a.js} +33 -33
  35. package/es/{el-input-c2f1f98c.js → el-input-03aad76d.js} +33 -33
  36. package/es/{el-input-number-429626d1.js → el-input-number-12c09ac3.js} +35 -35
  37. package/es/{el-loading-a45d849f.js → el-loading-86fdef94.js} +5 -5
  38. package/es/{el-menu-item-1bbf217d.js → el-menu-item-1172154b.js} +22 -22
  39. package/es/{el-message-179d8e61.js → el-message-35d4e3ac.js} +23 -23
  40. package/es/{el-message-box-869d122c.js → el-message-box-f43b6e7a.js} +20 -20
  41. package/es/{el-overlay-56098a38.js → el-overlay-04659660.js} +47 -47
  42. package/es/{el-popconfirm-6f9a189f.js → el-popconfirm-29d538b6.js} +20 -20
  43. package/es/{el-popper-d236d5d3.js → el-popper-ee1f8186.js} +125 -125
  44. package/es/{el-scrollbar-191aee47.js → el-scrollbar-09769d9e.js} +48 -48
  45. package/es/{el-segmented-d74e1fd8.js → el-segmented-916b982a.js} +8 -8
  46. package/es/{el-select-b26edf16.js → el-select-8cb88e3c.js} +307 -307
  47. package/es/{el-table-column-cc880936.js → el-table-column-0c899664.js} +12 -12
  48. package/es/{el-tag-b79bf878.js → el-tag-554c333b.js} +21 -21
  49. package/es/{index-89502796.js → index-34048a1d.js} +36 -36
  50. package/es/{index-7926ee44.js → index-384ed4b0.js} +3 -3
  51. package/es/{index-5beb56b8.js → index-5b62ea0e.js} +52 -52
  52. package/es/{index-63a17b07.js → index-69a9bd75.js} +2 -2
  53. package/es/{index-a137018b.js → index-a8ee0e8c.js} +15 -3
  54. package/es/{index-524e4e84.js → index-b07f58c9.js} +31 -31
  55. package/es/{index-97658183.js → index-b7fd560c.js} +12 -12
  56. package/es/{index-482f09b5.js → index-cfeda35a.js} +1 -1
  57. package/es/{index-08cdcff5.js → index-df06f32a.js} +15 -15
  58. package/es/{index-b2b45b6e.cjs → index-fdb71325.cjs} +2 -2
  59. package/es/{python-2b765700.cjs → python-0405c62e.cjs} +1 -1
  60. package/es/{python-2cff7134.js → python-791e6a42.js} +1 -1
  61. package/es/raf-fa761d02.js +6 -0
  62. package/es/{scroll-7d352c1f.js → scroll-9e2dd92b.js} +5 -5
  63. package/es/style.css +1 -1
  64. package/es/{use-global-config-88d2fb63.js → use-global-config-1923bb6f.js} +16 -16
  65. package/es/{validator-6d37dbfa.js → validator-fd32f925.js} +1 -1
  66. package/es/{vnode-c51c8aa3.js → vnode-f9752526.js} +1 -1
  67. package/es/{zh-cn-47b11646.js → zh-cn-d667062d.js} +2 -2
  68. package/lib/bundle.js +1 -1
  69. package/lib/bundle.umd.cjs +33 -33
  70. package/lib/{index-e33e2a73.js → index-db060de6.js} +603 -569
  71. package/lib/{python-bfee2b7e.js → python-077c8efa.js} +1 -1
  72. package/lib/style.css +1 -1
  73. package/package.json +1 -1
  74. package/packages/KlineBasic/index.vue +2 -2
  75. package/packages/MonacoEditor/index.vue +22 -0
  76. package/packages/VarietySearch/components/FactorScreen/index.vue +33 -12
  77. package/packages/VarietySearch/config.js +2 -2
  78. package/es/raf-41aed4d4.js +0 -6
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "st-comp",
3
3
  "public": true,
4
- "version": "0.0.192",
4
+ "version": "0.0.194",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -445,13 +445,13 @@ const getMoreData = async (type) => {
445
445
  mainIndicator: chartData.value.mainIndicator.map((item, index) => {
446
446
  return {
447
447
  ...item,
448
- data: [...res.body.mainIndicator[index].data, ...item.data.slice(1)],
448
+ data: [...(res.body.mainIndicator[index]?.data ?? []), ...item.data.slice(1)],
449
449
  };
450
450
  }),
451
451
  subIndicator: chartData.value.subIndicator.map((item, index) => {
452
452
  return {
453
453
  ...item,
454
- data: [...res.body.subIndicator[index].data, ...item.data.slice(1)],
454
+ data: [...(res.body.subIndicator[index]?.data ?? []), ...item.data.slice(1)],
455
455
  };
456
456
  }),
457
457
  };
@@ -276,6 +276,28 @@ defineExpose({
276
276
  setReadOnly: (readOnly = true) => {
277
277
  editorInstance.updateOptions({ readOnly });
278
278
  },
279
+ focusToEnd: () => {
280
+ if (!editorInstance) return;
281
+
282
+ const model = editorInstance.getModel();
283
+ if (!model) return;
284
+
285
+ // 获取最后一行
286
+ const lineCount = model.getLineCount();
287
+ const lastLine = model.getLineContent(lineCount);
288
+
289
+ // 设置光标位置到最后一行末尾
290
+ const position = {
291
+ lineNumber: lineCount,
292
+ column: lastLine.length + 1,
293
+ };
294
+
295
+ editorInstance.setPosition(position);
296
+ editorInstance.focus();
297
+
298
+ // 滚动到光标位置
299
+ editorInstance.revealPositionInCenter(position);
300
+ },
279
301
  });
280
302
  </script>
281
303
 
@@ -64,14 +64,6 @@ const handleOpenDialog = () => {
64
64
  // 保证因子筛选最少一条
65
65
  if (!dialogForm.value.list.length) handleAppendFactor();
66
66
  visible.value = true;
67
- // 解决刚打开时, 如果是脚本的样式错乱问题
68
- nextTick(() => {
69
- if (factorSelectExpr) {
70
- factorType.value = "脚本";
71
- monacoEditorRef.value.setValue(factorSelectExpr);
72
- }
73
- monacoEditorRef.value.resize();
74
- });
75
67
  };
76
68
  // 确定
77
69
  const handleSubmit = () => {
@@ -286,11 +278,40 @@ const handleInsertCustomFunction = (value) => {
286
278
  }
287
279
  };
288
280
 
281
+ // 监控: 窗口开关
282
+ watch(
283
+ () => visible.value,
284
+ (newValue) => {
285
+ switch (newValue) {
286
+ case true: {
287
+ nextTick(() => {
288
+ monacoEditorRef.value.resize();
289
+ // 如果有脚本内容, 直接切换到脚本模式, 并将值回显
290
+ if (data.value.factorSelectExpr) {
291
+ factorType.value = "脚本";
292
+ monacoEditorRef.value.setValue(data.value.factorSelectExpr);
293
+ monacoEditorRef.value.focusToEnd();
294
+ }
295
+ });
296
+ break;
297
+ }
298
+ case false: {
299
+ stVarSelectDialogRef.value.close();
300
+ break;
301
+ }
302
+ }
303
+ }
304
+ );
305
+
306
+ // 监控: 因子类型
289
307
  watch(
290
- () => [factorType.value, visible.value],
291
- () => {
292
- if (factorType.value === "模版" || visible.value === false) {
293
- stVarSelectDialogRef.value.close();
308
+ () => factorType.value,
309
+ (newValue) => {
310
+ if (newValue === "模版") stVarSelectDialogRef.value.close();
311
+ if (newValue === "脚本") {
312
+ nextTick(() => {
313
+ monacoEditorRef.value.focusToEnd();
314
+ });
294
315
  }
295
316
  },
296
317
  { deep: true }
@@ -57,11 +57,11 @@ export default {
57
57
  show: true,
58
58
  jcOptions: [
59
59
  { label: "恒指", value: "HZCFJC" },
60
- { label: "恒生科技", value: "HSKJJC" },
60
+ { label: "恒生科技", value: "HSKJCFJC" },
61
61
  { label: "上证50", value: "SZ50CFJC" },
62
62
  { label: "沪深300", value: "HS300CFJC" },
63
63
  { label: "中证500", value: "ZZ500CFJC" },
64
- { label: "中证1000", value: "ZZ1000JC" },
64
+ { label: "中证1000", value: "ZZ1000CFJC" },
65
65
  ],
66
66
  },
67
67
  // 因子筛选 [选项: 接口获取]
@@ -1,6 +0,0 @@
1
- import { s as o } from "./base-62a70f61.js";
2
- const e = (i) => o ? window.requestAnimationFrame(i) : setTimeout(i, 16), r = (i) => o ? window.cancelAnimationFrame(i) : clearTimeout(i);
3
- export {
4
- r as c,
5
- e as r
6
- };