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.
- package/README.md +19 -19
- package/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +1 -1
- package/es/ConfigProvider.cjs +1 -1
- package/es/ConfigProvider.js +3 -3
- package/es/Contextmenu.cjs +1 -1
- package/es/Contextmenu.js +7 -7
- package/es/CustomFunction.cjs +2 -2
- package/es/CustomFunction.js +514 -308
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +37 -37
- package/es/HeatMap.cjs +1 -1
- package/es/HeatMap.js +7 -7
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +18 -18
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +93 -93
- package/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +17 -17
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +14 -14
- package/es/KlinePlus.cjs +4 -4
- package/es/KlinePlus.js +760 -656
- package/es/LinearLegend.cjs +1 -1
- package/es/LinearLegend.js +1 -1
- package/es/Map.cjs +1 -1
- package/es/Map.js +1 -1
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +18 -18
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +76 -76
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +2 -2
- package/es/Pie.cjs +2 -2
- package/es/Pie.js +14 -14
- package/es/Table.cjs +1 -1
- package/es/Table.js +22 -22
- package/es/TreeMap.cjs +1 -1
- package/es/TreeMap.js +4 -4
- package/es/User.cjs +1 -1
- package/es/User.js +73 -73
- package/es/VarSelectDialog.cjs +2 -2
- package/es/VarSelectDialog.js +21 -21
- package/es/VarietyAiHelper.cjs +4 -4
- package/es/VarietyAiHelper.js +139 -138
- package/es/VarietyAutoComplete.cjs +1 -1
- package/es/VarietyAutoComplete.js +16 -16
- package/es/VarietySearch.cjs +4 -4
- package/es/VarietySearch.js +861 -857
- package/es/{VarietySelect-6a166293.js → VarietySelect-41daac7b.js} +10 -10
- package/es/{VarietySelect-610903f0.cjs → VarietySelect-d58eee29.cjs} +1 -1
- package/es/VarietyTextCopy.cjs +2 -2
- package/es/VarietyTextCopy.js +25 -25
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +6 -6
- package/es/{_initCloneObject-152b4f4e.js → _initCloneObject-5e73c9c8.js} +2 -2
- package/es/{_initCloneObject-76e116d0.cjs → _initCloneObject-a5832933.cjs} +1 -1
- package/es/aiTools-229609fb.cjs +2 -0
- package/es/aiTools-ce2f9281.js +115 -0
- package/es/aiTools.js +179 -176
- package/es/{config-provider-4c784baf.cjs → config-provider-06ea6b42.cjs} +1 -1
- package/es/{config-provider-7a3aca55.js → config-provider-88b637a8.js} +3 -3
- package/es/{dropdown-987c47fb.cjs → dropdown-4ce4c3e2.cjs} +1 -1
- package/es/{dropdown-01e09205.js → dropdown-72fbc15d.js} +2 -2
- package/es/{el-autocomplete-342ae823.js → el-autocomplete-6cafcdf1.js} +5 -5
- package/es/{el-autocomplete-16f66b34.cjs → el-autocomplete-e0857c5b.cjs} +1 -1
- package/es/{el-button-13dc915f.cjs → el-button-613e0bb2.cjs} +1 -1
- package/es/{el-button-314171a0.js → el-button-94d3de38.js} +3 -3
- package/es/{el-checkbox-5899681f.js → el-checkbox-6d4cb393.js} +3 -3
- package/es/{el-checkbox-bdf64663.cjs → el-checkbox-e90762df.cjs} +1 -1
- package/es/{el-dialog-0ef95df6.cjs → el-dialog-02942e22.cjs} +1 -1
- package/es/{el-dialog-86a3eec2.js → el-dialog-5e30161f.js} +4 -4
- package/es/{el-form-item-77ef6784.cjs → el-form-item-44f060d8.cjs} +1 -1
- package/es/{el-form-item-cda4d93c.js → el-form-item-9e8969ea.js} +5 -5
- package/es/{el-input-fa1445ad.js → el-input-342b2def.js} +13 -13
- package/es/{el-input-89222943.cjs → el-input-9a9a7f7f.cjs} +1 -1
- package/es/{el-input-number-d3338e5e.cjs → el-input-number-65c847d6.cjs} +1 -1
- package/es/{el-input-number-8f6dbf74.js → el-input-number-c22b803a.js} +35 -35
- package/es/{el-loading-84dde1a8.cjs → el-loading-8179b497.cjs} +1 -1
- package/es/{el-loading-9b671203.js → el-loading-bcc51e3d.js} +1 -1
- package/es/{el-menu-item-535fef90.js → el-menu-item-339baf6d.js} +21 -21
- package/es/{el-menu-item-4531fd0e.cjs → el-menu-item-83186444.cjs} +1 -1
- package/es/{el-message-box-621ed2f1.js → el-message-box-035b699c.js} +9 -9
- package/es/{el-message-box-f5717070.cjs → el-message-box-c62d3217.cjs} +1 -1
- package/es/{el-overlay-23de4324.js → el-overlay-3e17604b.js} +3 -3
- package/es/{el-overlay-151708cb.cjs → el-overlay-8f1da9e8.cjs} +1 -1
- package/es/{el-popconfirm-b8aa490e.cjs → el-popconfirm-4e32ec1b.cjs} +1 -1
- package/es/{el-popconfirm-bcff0aa5.js → el-popconfirm-f8a86e2c.js} +4 -4
- package/es/{el-popper-43ec37f4.cjs → el-popper-a4f3ae4d.cjs} +1 -1
- package/es/{el-popper-03988662.js → el-popper-fbd0dcea.js} +1 -1
- package/es/{el-segmented-db3a86be.js → el-segmented-56bd58a8.js} +2 -2
- package/es/{el-segmented-79a1367c.cjs → el-segmented-833ac177.cjs} +1 -1
- package/es/{el-select-4bd0010d.js → el-select-44fa547d.js} +8 -8
- package/es/{el-select-ec04e7ce.cjs → el-select-70806166.cjs} +1 -1
- package/es/{el-table-column-35e47229.cjs → el-table-column-3e2cdfca.cjs} +1 -1
- package/es/{el-table-column-7af2bec7.js → el-table-column-b74a857d.js} +9 -9
- package/es/{el-tag-bef9e83d.js → el-tag-66c83156.js} +2 -2
- package/es/{el-tag-5d5608e0.cjs → el-tag-9c2f329f.cjs} +1 -1
- package/es/{el-text-f998902c.js → el-text-034bd3f4.js} +1 -1
- package/es/{el-text-abf10fdf.cjs → el-text-6b2374bb.cjs} +1 -1
- package/es/index-00f6ca75.cjs +1 -0
- package/es/{index-a00e0534.cjs → index-185792a7.cjs} +1 -1
- package/es/{index-d1b554ac.js → index-1e2a38ab.js} +2 -2
- package/es/{index-0986e373.cjs → index-3153c1db.cjs} +1 -1
- package/es/{index-936e7dec.js → index-44a382a5.js} +2 -2
- package/es/{index-ce21e2ce.js → index-5216d5f5.js} +5 -5
- package/es/{index-7ed0999e.js → index-53cc4e43.js} +720 -716
- package/es/{index-cfcd60ca.cjs → index-5c0dd943.cjs} +1 -1
- package/es/{index-cfd00899.cjs → index-870b6c9d.cjs} +1 -1
- package/es/{index-a83ec4b7.js → index-8c2d7e05.js} +1 -1
- package/es/{index-8901a38c.cjs → index-94131fd7.cjs} +30 -30
- package/es/{index-db846633.cjs → index-9d16cea8.cjs} +1 -1
- package/es/{index-f3f6ee27.js → index-a33b2fb8.js} +178 -178
- package/es/{index-2d7ac156.cjs → index-a9246d17.cjs} +17 -17
- package/es/{index-60c69dd1.cjs → index-ac8dc53d.cjs} +1 -1
- package/es/{index-102edf6c.js → index-c5f2d372.js} +2 -2
- package/es/{index-6290ae0f.js → index-c6584658.js} +2 -2
- package/es/{index-5c44d71a.js → index-eb96e074.js} +149 -119
- package/es/{index-5ed42e9c.js → index-f034b910.js} +2 -2
- package/es/{index-c58e90e9.cjs → index-f58b2920.cjs} +1 -1
- package/es/{python-6cc6ec1b.js → python-8a1664e6.js} +18 -18
- package/es/{python-71f59893.cjs → python-a3db9620.cjs} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-02be4928.cjs → use-form-common-props-ac666630.cjs} +1 -1
- package/es/{use-form-common-props-76a09d89.js → use-form-common-props-ed72e914.js} +11 -11
- package/es/{use-global-config-31b3ec57.cjs → use-global-config-23472471.cjs} +1 -1
- package/es/{use-global-config-0f43458b.js → use-global-config-ee406d58.js} +2 -2
- package/es/{validator-ea292506.cjs → validator-366dbf39.cjs} +1 -1
- package/es/{validator-0e037618.js → validator-c60a8956.js} +1 -1
- package/es/{zh-cn-1227eb8a.js → zh-cn-b59a0910.js} +1 -1
- package/es/{zh-cn-0edc7234.cjs → zh-cn-c21d12d8.cjs} +1 -1
- package/lib/aiTools.js +179 -176
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +230 -230
- package/lib/{index-2a269748.js → index-62fa175a.js} +30149 -29800
- package/lib/{python-41da18e5.js → python-4a48fa39.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +53 -44
- package/auto-imports.d.ts +0 -13
- package/components.d.ts +0 -59
- package/es/aiTools-a3b095f6.js +0 -113
- package/es/aiTools-f36136a4.cjs +0 -2
- package/es/index-476c4459.cjs +0 -1
- package/index.html +0 -13
- package/packages/ChartLayout/index.ts +0 -8
- package/packages/ChartLayout/index.vue +0 -63
- package/packages/ConfigProvider/index.ts +0 -8
- package/packages/ConfigProvider/index.vue +0 -66
- package/packages/Contextmenu/index.ts +0 -8
- package/packages/Contextmenu/index.vue +0 -134
- package/packages/CustomFunction/components/ManageDialog.vue +0 -706
- package/packages/CustomFunction/index.ts +0 -8
- package/packages/CustomFunction/index.vue +0 -200
- package/packages/FactorWarning/index.ts +0 -8
- package/packages/FactorWarning/index.vue +0 -754
- package/packages/FactorWarning/tools.js +0 -10
- package/packages/HeatMap/index.ts +0 -8
- package/packages/HeatMap/index.vue +0 -141
- package/packages/Kline/components/Contextmenu/index.vue +0 -110
- package/packages/Kline/components/Tips/index.vue +0 -40
- package/packages/Kline/componentsNew/KlineSlide/index.vue +0 -155
- package/packages/Kline/componentsNew/KlineSub/index.vue +0 -297
- package/packages/Kline/componentsNew/KlineTips/index.vue +0 -66
- package/packages/Kline/componentsNew/KlineUtils/index.vue +0 -84
- package/packages/Kline/componentsNew/Tips/index.vue +0 -33
- package/packages/Kline/formatKlineData.ts +0 -109
- package/packages/Kline/images/buy.svg +0 -1
- package/packages/Kline/images/pen.png +0 -0
- package/packages/Kline/images/sell.svg +0 -1
- package/packages/Kline/images/t.svg +0 -1
- package/packages/Kline/index.ts +0 -16
- package/packages/Kline/index.vue +0 -891
- package/packages/Kline/option.ts +0 -539
- package/packages/Kline/type.d.ts +0 -219
- package/packages/Kline/utils.ts +0 -682
- package/packages/KlineBasic/api.js +0 -58
- package/packages/KlineBasic/components/AverageTips/index.vue +0 -33
- package/packages/KlineBasic/components/Contextmenu/index.vue +0 -105
- package/packages/KlineBasic/components/KlineSub/index.vue +0 -332
- package/packages/KlineBasic/components/KlineTips/index.vue +0 -99
- package/packages/KlineBasic/components/Tips/index.vue +0 -56
- package/packages/KlineBasic/index.ts +0 -8
- package/packages/KlineBasic/index.vue +0 -839
- package/packages/KlineBasic/utils.js +0 -258
- package/packages/KlineConfig/config.js +0 -46
- package/packages/KlineConfig/index.ts +0 -8
- package/packages/KlineConfig/index.vue +0 -356
- package/packages/KlineNew/components/KlineSlide/index.vue +0 -156
- package/packages/KlineNew/components/KlineSub/index.vue +0 -335
- package/packages/KlineNew/components/KlineTips/index.vue +0 -96
- package/packages/KlineNew/components/KlineUtils/index.vue +0 -341
- package/packages/KlineNew/components/Tips/index.vue +0 -33
- package/packages/KlineNew/index.ts +0 -14
- package/packages/KlinePlus/components/SliderChart.vue +0 -208
- package/packages/KlinePlus/components/Tips.vue +0 -36
- package/packages/KlinePlus/images/buy.svg +0 -1
- package/packages/KlinePlus/images/sell.svg +0 -1
- package/packages/KlinePlus/images/t.svg +0 -1
- package/packages/KlinePlus/index.ts +0 -8
- package/packages/KlinePlus/index.vue +0 -1067
- package/packages/KlinePlus/utils.js +0 -771
- package/packages/LinearLegend/index.ts +0 -8
- package/packages/LinearLegend/index.vue +0 -112
- package/packages/Map/China.json +0 -1
- package/packages/Map/index.ts +0 -8
- package/packages/Map/index.vue +0 -147
- package/packages/MonacoEditor/index.ts +0 -8
- package/packages/MonacoEditor/index.vue +0 -1141
- package/packages/MonacoEditor/tools.js +0 -18
- package/packages/Pagination/index.ts +0 -8
- package/packages/Pagination/index.vue +0 -87
- package/packages/PasswordPrompt/index.ts +0 -8
- package/packages/PasswordPrompt/index.vue +0 -267
- package/packages/Pie/index.ts +0 -8
- package/packages/Pie/index.vue +0 -148
- package/packages/Table/components/Button/index.vue +0 -61
- package/packages/Table/components/Formatter/index.vue +0 -26
- package/packages/Table/index.d.ts +0 -0
- package/packages/Table/index.ts +0 -8
- package/packages/Table/index.vue +0 -133
- package/packages/TreeMap/index.ts +0 -8
- package/packages/TreeMap/index.vue +0 -186
- package/packages/User/components/EditInfoDialog/Mobile.vue +0 -214
- package/packages/User/components/EditInfoDialog/index.vue +0 -161
- package/packages/User/components/EditPasswordDialog.vue +0 -168
- package/packages/User/components/SetPasswordDialog.vue +0 -160
- package/packages/User/index.ts +0 -8
- package/packages/User/index.vue +0 -117
- package/packages/VarSelectDialog/Mock.js +0 -495
- package/packages/VarSelectDialog/VarietySelect.vue +0 -78
- package/packages/VarSelectDialog/index.ts +0 -8
- package/packages/VarSelectDialog/index.vue +0 -323
- package/packages/VarietyAiHelper/images/like.png +0 -0
- package/packages/VarietyAiHelper/images/like_no.png +0 -0
- package/packages/VarietyAiHelper/index.ts +0 -8
- package/packages/VarietyAiHelper/index.vue +0 -910
- package/packages/VarietyAutoComplete/index.ts +0 -8
- package/packages/VarietyAutoComplete/index.vue +0 -89
- package/packages/VarietySearch/components/AddTag/index.vue +0 -268
- package/packages/VarietySearch/components/CommonIndicator/IndicatorTags.vue +0 -52
- package/packages/VarietySearch/components/CommonIndicator/index.vue +0 -697
- package/packages/VarietySearch/components/CommonIndicator/tools.js +0 -260
- package/packages/VarietySearch/components/CompositeOrder/index.vue +0 -260
- package/packages/VarietySearch/components/FactorScreen/FactorDescription.vue +0 -70
- package/packages/VarietySearch/components/FactorScreen/index.vue +0 -1158
- package/packages/VarietySearch/components/FactorScreen/tools.js +0 -34
- package/packages/VarietySearch/config.js +0 -539
- package/packages/VarietySearch/index.ts +0 -8
- package/packages/VarietySearch/index.vue +0 -688
- package/packages/VarietyTextCopy/index.ts +0 -8
- package/packages/VarietyTextCopy/index.vue +0 -136
- package/packages/VirtualTable/index.ts +0 -8
- package/packages/VirtualTable/index.vue +0 -241
- package/packages/index.ts +0 -59
- package/public/aiTools.js +0 -176
- package/public/talib.wasm +0 -0
- package/public/vite.svg +0 -1
- package/src/App.vue +0 -140
- package/src/assets/vue.svg +0 -1
- package/src/components/Dialog/index.vue +0 -16
- package/src/components/Kline/index.vue +0 -21
- package/src/components/Table/index.vue +0 -27
- package/src/main.ts +0 -17
- package/src/pages/ChartLayout/index.vue +0 -22
- package/src/pages/ConfigProvider/index.vue +0 -9
- package/src/pages/Contextmenu/index.vue +0 -46
- package/src/pages/CustomFunction/index.vue +0 -13
- package/src/pages/FactorWarning/index.vue +0 -203
- package/src/pages/HeatMap/index.vue +0 -128
- package/src/pages/Kline/index.vue +0 -12
- package/src/pages/KlineBasic/api.js +0 -48
- package/src/pages/KlineBasic/index.vue +0 -366
- package/src/pages/KlineBasic/indicator.js +0 -114
- package/src/pages/KlineConfig/index.vue +0 -20
- package/src/pages/KlineNew/components/KlineAction/components/ContextMenu/index.vue +0 -91
- package/src/pages/KlineNew/components/KlineAction/components/YearChart/index.vue +0 -532
- package/src/pages/KlineNew/components/KlineAction/images/pen.png +0 -0
- package/src/pages/KlineNew/components/KlineAction/index.vue +0 -716
- package/src/pages/KlineNew/components/KlineAction/mockApi/index.js +0 -13
- package/src/pages/KlineNew/components/KlineAction/utils.js +0 -571
- package/src/pages/KlineNew/components/KlineBasic/index.vue +0 -336
- package/src/pages/KlineNew/components/KlineBasic/utils.js +0 -46
- package/src/pages/KlineNew/components/KlineNew/index.vue +0 -316
- package/src/pages/KlineNew/components/KlineNew/utils.js +0 -31
- package/src/pages/KlineNew/components/KlineSlide/index.vue +0 -448
- package/src/pages/KlineNew/components/KlineSlide/utils.js +0 -78
- package/src/pages/KlineNew/components/KlineSlideNew/index.vue +0 -430
- package/src/pages/KlineNew/components/KlineSlideNew/utils.js +0 -78
- package/src/pages/KlineNew/index.vue +0 -92
- package/src/pages/KlinePlus/KlineDialog/MultiCycle.vue +0 -312
- package/src/pages/KlinePlus/KlineDialog/api.js +0 -108
- package/src/pages/KlinePlus/KlineDialog/index.vue +0 -582
- package/src/pages/KlinePlus/KlineDialog/indicator.js +0 -109
- package/src/pages/KlinePlus/KlineDialog/tools.js +0 -86
- package/src/pages/KlinePlus/index.vue +0 -30
- package/src/pages/KlinePlus/tradeLogMock.js +0 -1927
- package/src/pages/LinearLegend/index.vue +0 -92
- package/src/pages/Map/index.vue +0 -62
- package/src/pages/MonacoEditor/index.vue +0 -63
- package/src/pages/Pagination/index.vue +0 -24
- package/src/pages/PasswordPrompt/index.vue +0 -12
- package/src/pages/Pie/index.vue +0 -36
- package/src/pages/Table/index.vue +0 -117
- package/src/pages/TreeMap/index.vue +0 -542
- package/src/pages/User/index.vue +0 -24
- package/src/pages/VarSelectDialog/index.vue +0 -16
- package/src/pages/VarietyAiHelper/index.vue +0 -20
- package/src/pages/VarietyAutoComplete/index.vue +0 -19
- package/src/pages/VarietySearch/api.js +0 -70
- package/src/pages/VarietySearch/index.vue +0 -467
- package/src/pages/VarietyTextCopy/index.vue +0 -24
- package/src/pages/VirtualTable/demo.json +0 -6377
- package/src/pages/VirtualTable/index.vue +0 -79
- package/src/router/index.ts +0 -9
- package/src/router/routes.ts +0 -132
- package/src/style.css +0 -79
- package/src/vite-env.d.ts +0 -9
- package/tsconfig.json +0 -30
- package/tsconfig.node.json +0 -10
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed, onMounted, ref, inject } from "vue";
|
|
3
|
-
import { Close, InfoFilled } from "@element-plus/icons-vue";
|
|
4
|
-
import VarietySelect from "./VarietySelect.vue";
|
|
5
|
-
|
|
6
|
-
const stConfig = inject("stConfig");
|
|
7
|
-
const props = defineProps({
|
|
8
|
-
useCase: {
|
|
9
|
-
type: String,
|
|
10
|
-
default: "1", // 1-选股, 2-回测
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const editorRef = ref(null); // 编辑器Ref
|
|
15
|
-
const visible = ref(false);
|
|
16
|
-
|
|
17
|
-
const varName = ref(null);
|
|
18
|
-
const varList = ref([]);
|
|
19
|
-
const formatList = computed(() => {
|
|
20
|
-
return varList.value.find((item) => item.varName === varName.value)?.formatList ?? [];
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// 格式化配置项的下拉框数据源
|
|
24
|
-
const handleOptionsStrToArray = (str) => {
|
|
25
|
-
const trimmedStr = str.replace(/^\[|\]$/g, "");
|
|
26
|
-
// 分割字符串为多个数组项
|
|
27
|
-
const items = trimmedStr.split("],[");
|
|
28
|
-
|
|
29
|
-
return items.map((item) => {
|
|
30
|
-
// 移除每个项两端的方括号(如果有)
|
|
31
|
-
const cleanItem = item.replace(/\[|\]/g, "");
|
|
32
|
-
// 分割标签和值
|
|
33
|
-
const [label, value] = cleanItem.split(",");
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
label: label.trim(),
|
|
37
|
-
value: value.trim(),
|
|
38
|
-
};
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// 插入变量值
|
|
43
|
-
const handleInsetVarContent = (configList) => {
|
|
44
|
-
// 1.校验是否填写完整 + 生成输出值
|
|
45
|
-
const result = [];
|
|
46
|
-
for (let index = 0; index < configList.length; index++) {
|
|
47
|
-
const item = configList[index];
|
|
48
|
-
console.log(item);
|
|
49
|
-
switch (item.vtype) {
|
|
50
|
-
case "text": {
|
|
51
|
-
result.push(item.param);
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
default: {
|
|
55
|
-
if (!item.modelValue) return ElMessage.error("请检查插入格式内是否填写完整");
|
|
56
|
-
let formatValue = item.modelValue;
|
|
57
|
-
if (item.prefix) formatValue = `${item.prefix}${formatValue}`;
|
|
58
|
-
if (item.suffix) formatValue = `${formatValue}${item.suffix}`;
|
|
59
|
-
result.push(formatValue);
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
// 2.插入内容
|
|
65
|
-
if (!editorRef.value) return ElMessage.error("未检测到编辑器实例");
|
|
66
|
-
const content = result.join("_");
|
|
67
|
-
|
|
68
|
-
const editorIns = editorRef.value.getInstance();
|
|
69
|
-
const position = editorIns.getPosition();
|
|
70
|
-
|
|
71
|
-
const currentValue = editorRef.value.getValue();
|
|
72
|
-
const lines = currentValue.split("\n");
|
|
73
|
-
|
|
74
|
-
// 如果光标位置有效
|
|
75
|
-
if (position.lineNumber <= lines.length) {
|
|
76
|
-
const lineIndex = position.lineNumber - 1;
|
|
77
|
-
const line = lines[lineIndex];
|
|
78
|
-
const columnIndex = position.column - 1;
|
|
79
|
-
|
|
80
|
-
// 获取光标前后的字符
|
|
81
|
-
const prevChar = columnIndex > 0 ? line[columnIndex - 1] : "";
|
|
82
|
-
const nextChar = columnIndex < line.length ? line[columnIndex] : "";
|
|
83
|
-
|
|
84
|
-
// 检测是否需要添加空格
|
|
85
|
-
let contentToInsert = content;
|
|
86
|
-
|
|
87
|
-
// 如果前面有内容且不是空格或行首,在前面添加空格
|
|
88
|
-
if (prevChar && prevChar !== " " && !/[\s({[ ]/.test(prevChar)) {
|
|
89
|
-
contentToInsert = " " + contentToInsert;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// 如果后面有内容且不是空格或行尾,在后面添加空格
|
|
93
|
-
if (nextChar && nextChar !== " " && !/[\s)}\]]/.test(nextChar)) {
|
|
94
|
-
contentToInsert = contentToInsert + " ";
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// 在光标位置插入内容
|
|
98
|
-
const newLine = line.substring(0, columnIndex) + contentToInsert + line.substring(columnIndex);
|
|
99
|
-
lines[lineIndex] = newLine;
|
|
100
|
-
|
|
101
|
-
// 更新编辑器内容
|
|
102
|
-
const newValue = lines.join("\n");
|
|
103
|
-
editorRef.value.setValue(newValue);
|
|
104
|
-
|
|
105
|
-
// 将光标移动到插入内容之后
|
|
106
|
-
const newColumn = position.column + contentToInsert.length;
|
|
107
|
-
editorIns.setPosition({
|
|
108
|
-
lineNumber: position.lineNumber,
|
|
109
|
-
column: newColumn,
|
|
110
|
-
});
|
|
111
|
-
editorIns.focus();
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
onMounted(async () => {
|
|
116
|
-
const { body } = await stConfig.request.post("/common/conf/queryAllBackVariables", { useCase: props.useCase });
|
|
117
|
-
varList.value = body ?? [];
|
|
118
|
-
});
|
|
119
|
-
defineExpose({
|
|
120
|
-
/**
|
|
121
|
-
* @description: 打开变量选择器窗口
|
|
122
|
-
* @editor 脚本编辑器实例
|
|
123
|
-
* @newZindex Number 窗口定位层级
|
|
124
|
-
*/
|
|
125
|
-
open: (editor) => {
|
|
126
|
-
editorRef.value = editor;
|
|
127
|
-
visible.value = true;
|
|
128
|
-
},
|
|
129
|
-
close: () => {
|
|
130
|
-
visible.value = false;
|
|
131
|
-
},
|
|
132
|
-
});
|
|
133
|
-
</script>
|
|
134
|
-
|
|
135
|
-
<template>
|
|
136
|
-
<el-dialog
|
|
137
|
-
modal-class="var-select-dialog"
|
|
138
|
-
v-model="visible"
|
|
139
|
-
align-center
|
|
140
|
-
append-to-body
|
|
141
|
-
destroy-on-close
|
|
142
|
-
draggable
|
|
143
|
-
overflow
|
|
144
|
-
:modal="false"
|
|
145
|
-
:modal-penetrable="true"
|
|
146
|
-
:show-close="false"
|
|
147
|
-
>
|
|
148
|
-
<template #header>
|
|
149
|
-
<div class="custom-header">
|
|
150
|
-
<div class="left">
|
|
151
|
-
<span> 选择变量 </span>
|
|
152
|
-
<el-select
|
|
153
|
-
v-model="varName"
|
|
154
|
-
placeholder="选择变量"
|
|
155
|
-
filterable
|
|
156
|
-
clearable
|
|
157
|
-
>
|
|
158
|
-
<el-option
|
|
159
|
-
v-for="(item, index) in varList"
|
|
160
|
-
:key="index"
|
|
161
|
-
:label="item.varName"
|
|
162
|
-
:value="item.varName"
|
|
163
|
-
/>
|
|
164
|
-
</el-select>
|
|
165
|
-
</div>
|
|
166
|
-
<div class="right">
|
|
167
|
-
<el-icon
|
|
168
|
-
class="el-icon--left"
|
|
169
|
-
@click="visible = false"
|
|
170
|
-
>
|
|
171
|
-
<Close />
|
|
172
|
-
</el-icon>
|
|
173
|
-
</div>
|
|
174
|
-
</div>
|
|
175
|
-
</template>
|
|
176
|
-
<div class="custom-body">
|
|
177
|
-
<template v-if="formatList.length">
|
|
178
|
-
<div
|
|
179
|
-
class="format-item"
|
|
180
|
-
v-for="(formatItem, formatIndex) in formatList"
|
|
181
|
-
:key="formatIndex"
|
|
182
|
-
>
|
|
183
|
-
<span>格式{{ formatIndex + 1 }}:</span>
|
|
184
|
-
|
|
185
|
-
<!-- 配置项 -->
|
|
186
|
-
<div class="config-list">
|
|
187
|
-
<template v-for="(config, configIndex) in formatItem.configList">
|
|
188
|
-
<div class="config-item">
|
|
189
|
-
<!-- 类型: 固定值 -->
|
|
190
|
-
<template v-if="config.vtype === 'text'">
|
|
191
|
-
<span>{{ config.param }}</span>
|
|
192
|
-
</template>
|
|
193
|
-
<template v-if="config.vtype === 'inputVariety'">
|
|
194
|
-
<VarietySelect
|
|
195
|
-
size="small"
|
|
196
|
-
:placeholder="config.param"
|
|
197
|
-
:selectClearEnable="false"
|
|
198
|
-
:labelShowEnable="false"
|
|
199
|
-
@select="({ name, code }) => (config.modelValue = code)"
|
|
200
|
-
@change="(value) => (config.modelValue = value)"
|
|
201
|
-
style="width: 100px"
|
|
202
|
-
/>
|
|
203
|
-
</template>
|
|
204
|
-
<template v-if="config.vtype === 'input'">
|
|
205
|
-
<span v-if="config.prefix">{{ config.prefix }}</span>
|
|
206
|
-
<el-input
|
|
207
|
-
v-model="config.modelValue"
|
|
208
|
-
:placeholder="config.param"
|
|
209
|
-
size="small"
|
|
210
|
-
/>
|
|
211
|
-
<span v-if="config.suffix">{{ config.suffix }}</span>
|
|
212
|
-
</template>
|
|
213
|
-
<template v-if="config.vtype === 'select'">
|
|
214
|
-
<el-select
|
|
215
|
-
v-model="config.modelValue"
|
|
216
|
-
:placeholder="config.param"
|
|
217
|
-
clearable
|
|
218
|
-
size="small"
|
|
219
|
-
>
|
|
220
|
-
<el-option
|
|
221
|
-
v-for="item in handleOptionsStrToArray(config.optionsStr)"
|
|
222
|
-
:key="item.value"
|
|
223
|
-
:label="item.label"
|
|
224
|
-
:value="item.value"
|
|
225
|
-
/>
|
|
226
|
-
</el-select>
|
|
227
|
-
</template>
|
|
228
|
-
</div>
|
|
229
|
-
<span v-if="configIndex !== formatItem.configList.length - 1">_</span>
|
|
230
|
-
</template>
|
|
231
|
-
</div>
|
|
232
|
-
<!-- 插入变量 -->
|
|
233
|
-
<el-button
|
|
234
|
-
type="primary"
|
|
235
|
-
plain
|
|
236
|
-
size="small"
|
|
237
|
-
@click="handleInsetVarContent(formatItem.configList)"
|
|
238
|
-
>
|
|
239
|
-
插入变量
|
|
240
|
-
</el-button>
|
|
241
|
-
<!-- Tip示例 -->
|
|
242
|
-
<el-tooltip
|
|
243
|
-
effect="dark"
|
|
244
|
-
placement="top-start"
|
|
245
|
-
>
|
|
246
|
-
<template #content>
|
|
247
|
-
<div style="max-width: 820px">
|
|
248
|
-
<span style="white-space: pre-line">{{ formatItem.tip }}</span>
|
|
249
|
-
</div>
|
|
250
|
-
</template>
|
|
251
|
-
<el-icon><InfoFilled /></el-icon>
|
|
252
|
-
</el-tooltip>
|
|
253
|
-
</div>
|
|
254
|
-
</template>
|
|
255
|
-
</div>
|
|
256
|
-
</el-dialog>
|
|
257
|
-
</template>
|
|
258
|
-
<style lang="scss">
|
|
259
|
-
.var-select-dialog {
|
|
260
|
-
.el-dialog {
|
|
261
|
-
width: auto !important;
|
|
262
|
-
min-width: 660px;
|
|
263
|
-
max-width: 1000px;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
</style>
|
|
267
|
-
<style lang="scss" scoped>
|
|
268
|
-
.var-select-dialog {
|
|
269
|
-
.custom-header {
|
|
270
|
-
display: flex;
|
|
271
|
-
align-items: center;
|
|
272
|
-
justify-content: space-between;
|
|
273
|
-
.left {
|
|
274
|
-
display: flex;
|
|
275
|
-
align-items: center;
|
|
276
|
-
flex: 1;
|
|
277
|
-
span {
|
|
278
|
-
margin-right: 10px;
|
|
279
|
-
}
|
|
280
|
-
.el-select {
|
|
281
|
-
width: 140px;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
.right {
|
|
285
|
-
display: flex;
|
|
286
|
-
align-items: center;
|
|
287
|
-
.el-button {
|
|
288
|
-
margin-right: 10px;
|
|
289
|
-
}
|
|
290
|
-
.el-icon {
|
|
291
|
-
cursor: pointer;
|
|
292
|
-
&:hover {
|
|
293
|
-
color: var(--el-color-primary);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
.custom-body {
|
|
299
|
-
min-height: 160px;
|
|
300
|
-
box-sizing: border-box;
|
|
301
|
-
border-top: var(--el-border);
|
|
302
|
-
padding: 10px 0;
|
|
303
|
-
.format-item {
|
|
304
|
-
font-size: 12px;
|
|
305
|
-
display: flex;
|
|
306
|
-
align-items: center;
|
|
307
|
-
flex-wrap: wrap;
|
|
308
|
-
gap: 10px;
|
|
309
|
-
margin-bottom: 10px;
|
|
310
|
-
.config-list {
|
|
311
|
-
display: flex;
|
|
312
|
-
align-items: center;
|
|
313
|
-
.el-input {
|
|
314
|
-
width: 100px;
|
|
315
|
-
}
|
|
316
|
-
.el-select {
|
|
317
|
-
width: 100px;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
</style>
|
|
Binary file
|
|
Binary file
|