st-comp 0.0.247 → 0.0.249
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/components.d.ts +1 -0
- package/es/ChartLayout.js +4 -4
- package/es/CustomFunction.cjs +2 -2
- package/es/CustomFunction.js +72 -70
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +36 -35
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +20 -19
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +30 -28
- package/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +50 -49
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +19 -18
- package/es/KlinePlus.cjs +4 -4
- package/es/KlinePlus.js +590 -575
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +28 -26
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +77 -76
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +3 -3
- package/es/Table.cjs +1 -1
- package/es/Table.js +38 -37
- package/es/User.cjs +1 -1
- package/es/User.js +143 -141
- package/es/VarSelectDialog.cjs +2 -2
- package/es/VarSelectDialog.js +29 -27
- package/es/VarietyAiHelper.cjs +4 -0
- package/es/VarietyAiHelper.js +270 -0
- package/es/VarietyAutoComplete.cjs +1 -1
- package/es/VarietyAutoComplete.js +13 -12
- package/es/VarietySearch.cjs +10 -10
- package/es/VarietySearch.js +70 -68
- package/es/{VarietySelect-2fd501da.cjs → VarietySelect-5c845562.cjs} +1 -1
- package/es/{VarietySelect-5a9dd50b.js → VarietySelect-9f267958.js} +4 -4
- package/es/VarietyTextCopy.cjs +1 -1
- package/es/VarietyTextCopy.js +24 -22
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +70 -70
- package/es/{_initCloneObject-3823a101.cjs → _initCloneObject-2b82e9f7.cjs} +1 -1
- package/es/{_initCloneObject-c34c65bc.js → _initCloneObject-69c8ae23.js} +3 -3
- package/es/aiTools.js +36 -0
- package/es/{base-a5af3db3.js → base-29f73b05.js} +2 -2
- package/es/{castArray-7741a212.js → castArray-609a313e.js} +1 -1
- package/es/{config-provider-2182708a.cjs → config-provider-2ae47cc8.cjs} +1 -1
- package/es/{config-provider-06a63185.js → config-provider-7860903c.js} +4 -4
- package/es/{debounce-8d53f4dd.js → debounce-a09ce9a3.js} +1 -1
- package/es/{dropdown-302f71e7.js → dropdown-497442b7.js} +20 -19
- package/es/dropdown-eba9eaf5.cjs +1 -0
- package/es/{el-autocomplete-ed75a659.js → el-autocomplete-27c60cc8.js} +18 -17
- package/es/el-autocomplete-b59eb529.cjs +1 -0
- package/es/{el-button-68baab7b.cjs → el-button-974ff9e9.cjs} +1 -1
- package/es/{el-button-d09ff85f.js → el-button-e2c63c08.js} +4 -4
- package/es/el-checkbox-08185353.cjs +1 -0
- package/es/{el-checkbox-64648e02.js → el-checkbox-71ebd862.js} +4 -4
- package/es/el-dialog-1b185570.cjs +1 -0
- package/es/{el-dialog-6a80e3d8.js → el-dialog-eedcfd3e.js} +6 -6
- package/es/{el-divider-4e059794.js → el-divider-523e5874.js} +1 -1
- package/es/{el-empty-33cb66f1.js → el-empty-f5a1607a.js} +3 -3
- package/es/{el-form-item-4eca95be.js → el-form-item-bdcfd297.js} +8 -8
- package/es/{el-form-item-4076e55f.cjs → el-form-item-c997b4fa.cjs} +1 -1
- package/es/{el-input-cae60510.js → el-input-d47281da.js} +68 -68
- package/es/el-input-fa18ef84.cjs +1 -0
- package/es/el-input-number-3d94fa58.cjs +1 -0
- package/es/{el-input-number-c2499410.js → el-input-number-c8018cb1.js} +15 -15
- package/es/{el-loading-c738468d.js → el-loading-0cd81d05.js} +2 -2
- package/es/{el-loading-05826e64.cjs → el-loading-969a79ca.cjs} +1 -1
- package/es/el-menu-item-26071fd6.cjs +1 -0
- package/es/{el-menu-item-f904f685.js → el-menu-item-dac65bb3.js} +18 -17
- package/es/el-message-0ea8fbf8.cjs +1 -0
- package/es/el-message-4ed993c7.js +1 -0
- package/es/el-message-box-31e0aa98.cjs +1 -0
- package/es/{el-message-box-05d8cf39.js → el-message-box-fea4fca8.js} +11 -11
- package/es/{el-overlay-cc9bc792.js → el-overlay-1ee0338d.js} +19 -19
- package/es/el-overlay-ea65cb05.cjs +1 -0
- package/es/{el-popconfirm-a6f66a0e.js → el-popconfirm-089b8bec.js} +21 -20
- package/es/el-popconfirm-9e232436.cjs +1 -0
- package/es/el-popper-2d3914e4.cjs +1 -0
- package/es/el-popper-c9b3d3cf.js +1662 -0
- package/es/el-segmented-140ac042.cjs +1 -0
- package/es/{el-segmented-51b1c797.js → el-segmented-9d3a9e11.js} +4 -4
- package/es/el-select-a11f33e8.cjs +1 -0
- package/es/{el-select-1b149fab.js → el-select-e51e11c1.js} +44 -43
- package/es/{el-table-column-3e30ebae.js → el-table-column-05d292a8.js} +25 -24
- package/es/el-table-column-98570a4d.cjs +14 -0
- package/es/{el-tag-0a25efdf.js → el-tag-17cd04a1.js} +13 -13
- package/es/el-tag-6d8e653e.cjs +1 -0
- package/es/{el-text-73d899ff.js → el-text-2710fff3.js} +2 -2
- package/es/{el-text-1470de46.cjs → el-text-a18106cb.cjs} +1 -1
- package/es/{index-42e59bf5.js → index-0ee486ad.js} +3 -3
- package/es/index-0f79095c.js +440 -0
- package/es/{index-6806997d.js → index-1d9b50de.js} +3 -3
- package/es/index-28e03bad.cjs +1 -0
- package/es/{index-269b22da.cjs → index-299ee017.cjs} +1 -1
- package/es/{index-cebc7160.cjs → index-33f80550.cjs} +1 -1
- package/es/{index-4f48940d.cjs → index-37b8d3c6.cjs} +1 -1
- package/es/{index-2375023e.cjs → index-5befc414.cjs} +4 -4
- package/es/{index-696b6a94.cjs → index-6b99def3.cjs} +1 -1
- package/es/index-6ca95c8a.cjs +1 -0
- package/es/index-7dce9f59.cjs +1 -0
- package/es/{index-960806da.js → index-8391a3df.js} +3 -3
- package/es/{index-ac98a4d8.js → index-8f9d0d17.js} +16 -15
- package/es/{index-94e43e0d.js → index-95e5d454.js} +3 -3
- package/es/{index-4194c942.js → index-b0117ba2.js} +2 -2
- package/es/{index-6e967429.js → index-bcd895a0.js} +3 -3
- package/es/{index-87b4bf61.js → index-c2b9bbfd.js} +95 -65
- package/es/{index-54d289d1.js → index-c71e37dc.js} +11 -11
- package/es/{index-d77a7336.js → index-de24705f.js} +1 -1
- package/es/index-e8eeea22.cjs +1 -0
- package/es/{index-ee977f79.cjs → index-eb99b188.cjs} +1 -1
- package/es/{el-message-0df23ae7.js → index-f30561d3.js} +17 -17
- package/es/{python-c67c8901.cjs → python-27ece6fa.cjs} +2 -2
- package/es/{python-a914569a.js → python-656db04f.js} +30 -28
- package/es/{raf-80ef0c0a.js → raf-744cf95a.js} +1 -1
- package/es/{scroll-679bd6bf.js → scroll-6799bafc.js} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-47e50c10.js → use-form-common-props-cb0ca65c.js} +41 -41
- package/es/{use-form-common-props-344056f9.cjs → use-form-common-props-d3ed62c6.cjs} +1 -1
- package/es/{use-global-config-cf78ebac.cjs → use-global-config-c80f33a4.cjs} +1 -1
- package/es/{use-global-config-f52caea0.js → use-global-config-cdaeca54.js} +4 -4
- package/es/{validator-3cad04b2.cjs → validator-07160325.cjs} +1 -1
- package/es/{validator-94c04152.js → validator-4ab9774f.js} +1 -1
- package/es/{vnode-5ddb7ed1.js → vnode-a83e6de8.js} +1 -1
- package/es/{zh-cn-aabfaa94.cjs → zh-cn-6a0f844c.cjs} +1 -1
- package/es/{zh-cn-4921961d.js → zh-cn-8a6390a4.js} +2 -2
- package/lib/aiTools.js +36 -0
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +188 -185
- package/lib/{index-750ede1b.js → index-6ac0579e.js} +20224 -19939
- package/lib/{python-e34a2958.js → python-0432340a.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlinePlus/index.vue +88 -62
- package/packages/VarietyAiHelper/index.ts +8 -0
- package/packages/VarietyAiHelper/index.vue +430 -0
- package/packages/index.ts +2 -0
- package/public/aiTools.js +36 -0
- package/src/App.vue +21 -0
- package/src/pages/KlineNew/components/KlineAction/mockApi/index.js +1 -1
- package/src/pages/KlineNew/components/KlineBasic/utils.js +1 -1
- package/src/pages/KlineNew/components/KlineSlide/utils.js +1 -1
- package/src/pages/KlinePlus/KlineDialog/MultiCycle.vue +312 -0
- package/src/pages/KlinePlus/KlineDialog/api.js +108 -0
- package/src/pages/KlinePlus/KlineDialog/index.vue +582 -0
- package/src/pages/KlinePlus/KlineDialog/indicator.js +109 -0
- package/src/pages/KlinePlus/KlineDialog/tools.js +86 -0
- package/src/pages/KlinePlus/index.vue +23 -209
- package/src/pages/VarietyAiHelper/index.vue +20 -0
- package/src/pages/VarietySearch/index.vue +75 -51
- package/src/router/routes.ts +5 -0
- package/es/dropdown-89b74bc9.cjs +0 -1
- package/es/el-autocomplete-b9a3054a.cjs +0 -1
- package/es/el-checkbox-b982e2ef.cjs +0 -1
- package/es/el-dialog-ad7309e9.cjs +0 -1
- package/es/el-input-172c49f8.cjs +0 -1
- package/es/el-input-number-c2e71528.cjs +0 -1
- package/es/el-menu-item-7f986598.cjs +0 -1
- package/es/el-message-a86c0efa.cjs +0 -1
- package/es/el-message-box-40ff2af5.cjs +0 -1
- package/es/el-overlay-d7a6e4a9.cjs +0 -1
- package/es/el-popconfirm-737a015b.cjs +0 -1
- package/es/el-popper-7ba87e05.cjs +0 -1
- package/es/el-popper-a38874f4.js +0 -2094
- package/es/el-segmented-3fd66a0e.cjs +0 -1
- package/es/el-select-12f6deb7.cjs +0 -1
- package/es/el-table-column-516a0ed9.cjs +0 -14
- package/es/el-tag-789f05d3.cjs +0 -1
- package/es/index-8de94a49.cjs +0 -1
- package/es/index-c04f444f.cjs +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 发送非流式请求到百炼 AI 应用
|
|
3
|
+
* @param {Object} options
|
|
4
|
+
* @param {string} options.appId - 应用ID
|
|
5
|
+
* @param {string} options.apiKey - API Key
|
|
6
|
+
* @param {string} options.value - 用户输入
|
|
7
|
+
* @returns {Promise<string>} 返回 AI 输出的完整文本(JSON 字符串)
|
|
8
|
+
*/
|
|
9
|
+
export const sendToBaiLianAppNonStreaming = async ({ appId, apiKey, value }) => {
|
|
10
|
+
try {
|
|
11
|
+
const response = await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${appId}/completion`, {
|
|
12
|
+
method: "POST",
|
|
13
|
+
headers: {
|
|
14
|
+
Authorization: `Bearer ${apiKey}`,
|
|
15
|
+
"Content-Type": "application/json",
|
|
16
|
+
},
|
|
17
|
+
body: JSON.stringify({
|
|
18
|
+
input: { prompt: value },
|
|
19
|
+
parameters: {
|
|
20
|
+
incremental_output: false, // 非流式
|
|
21
|
+
},
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
if (!response.ok) {
|
|
25
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
26
|
+
}
|
|
27
|
+
const data = await response.json();
|
|
28
|
+
const outputText = data?.output?.text;
|
|
29
|
+
return outputText;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
if (error.name === "AbortError") {
|
|
32
|
+
throw new Error("请求超时");
|
|
33
|
+
}
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
};
|
package/src/App.vue
CHANGED
|
@@ -38,7 +38,14 @@ import routes from "./router/routes.ts";
|
|
|
38
38
|
|
|
39
39
|
const route = useRoute();
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* @description: 项目使用实例
|
|
43
|
+
*/
|
|
41
44
|
// const VITE_RUN_ENV = import.meta.env; // 正常使用
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @description: 组件库Demo测试
|
|
48
|
+
*/
|
|
42
49
|
const VITE_RUN_ENV = {
|
|
43
50
|
VITE_PROJECT_NAME: "动量回测",
|
|
44
51
|
VITE_PROJECT_CLIENTID: "7",
|
|
@@ -49,6 +56,20 @@ const VITE_RUN_ENV = {
|
|
|
49
56
|
PROD: false,
|
|
50
57
|
SSR: false,
|
|
51
58
|
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @description: 组件库Demo线上
|
|
62
|
+
*/
|
|
63
|
+
// const VITE_RUN_ENV = {
|
|
64
|
+
// VITE_PROJECT_NAME: "动量回测",
|
|
65
|
+
// VITE_PROJECT_CLIENTID: "7",
|
|
66
|
+
// VITE_BASE_URL: "//investapi.hzyotoy.com",
|
|
67
|
+
// BASE_URL: "/",
|
|
68
|
+
// MODE: "production",
|
|
69
|
+
// DEV: false,
|
|
70
|
+
// PROD: true,
|
|
71
|
+
// SSR: false,
|
|
72
|
+
// };
|
|
52
73
|
</script>
|
|
53
74
|
|
|
54
75
|
<style>
|
|
@@ -6,7 +6,7 @@ export const getKlineDataApi = async(params) => {
|
|
|
6
6
|
headers: {
|
|
7
7
|
token: '041fd377d5d5efc7e08e2ed5b61b0c8d',
|
|
8
8
|
},
|
|
9
|
-
url: 'http://invest.hzyotoy.com/common/qt/getSingleCycleSingleVariety',
|
|
9
|
+
url: 'http://invest.hzyotoy.com/common/webjars/qt/getSingleCycleSingleVariety',
|
|
10
10
|
data: params,
|
|
11
11
|
})
|
|
12
12
|
return res.data.body
|
|
@@ -38,7 +38,7 @@ export const getKlineDataApi = async(params) => {
|
|
|
38
38
|
headers: {
|
|
39
39
|
token: '36cbbea2e76aff9d99f88d50669c009c',
|
|
40
40
|
},
|
|
41
|
-
url: 'http://invest.hzyotoy.com/common/qt/getSingleCycleSingleVariety',
|
|
41
|
+
url: 'http://invest.hzyotoy.com/common/webjars/qt/getSingleCycleSingleVariety',
|
|
42
42
|
data: params,
|
|
43
43
|
})
|
|
44
44
|
getKlineNew(params)
|
|
@@ -71,7 +71,7 @@ export const getKlineDataApi = async(params) => {
|
|
|
71
71
|
headers: {
|
|
72
72
|
token: 'ee08db9f1b8085e3c84fa22b60835951',
|
|
73
73
|
},
|
|
74
|
-
url: 'http://invest.hzyotoy.com/common/qt/getSingleCycleSingleVariety',
|
|
74
|
+
url: 'http://invest.hzyotoy.com/common/webjars/qt/getSingleCycleSingleVariety',
|
|
75
75
|
data: params,
|
|
76
76
|
})
|
|
77
77
|
return res.data.body
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import dayjs from "dayjs";
|
|
3
|
+
import { ref, onMounted, nextTick } from "vue";
|
|
4
|
+
import { formatLabel, estimateKlineTime, getTimeRange } from "./tools";
|
|
5
|
+
import { getCycleList } from "./api.js";
|
|
6
|
+
|
|
7
|
+
const emit = defineEmits(["goToSingleCycle"]);
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
varietyCode: { type: String, required: true },
|
|
10
|
+
varietyStock: { type: Number, required: true }, // 品种市场类型 0-期货, 1-股票, 2-期权
|
|
11
|
+
indicatorStore: { type: Object, required: true }, // 指标配置Store
|
|
12
|
+
userKlineConfig: { type: Object, required: true }, // 用户自定义的K线配置
|
|
13
|
+
|
|
14
|
+
// 交互选项
|
|
15
|
+
sellBuy: { type: Number, default: 1 },
|
|
16
|
+
rightType: { type: Number, default: null },
|
|
17
|
+
klineType: { type: Number, default: null },
|
|
18
|
+
initTimeRange: { type: Array, required: true },
|
|
19
|
+
mainIndicator: { type: String, required: true },
|
|
20
|
+
|
|
21
|
+
// 绘制数据: 成交
|
|
22
|
+
tradeLog: { type: Array, default: () => [] }, // 成交数据
|
|
23
|
+
// 绘制数据: 净值
|
|
24
|
+
netPositionData: { type: Array, default: () => [] }, // 净值数据
|
|
25
|
+
|
|
26
|
+
// 功能: 强制定位高亮(非必填)
|
|
27
|
+
positionTime: { type: [String, null], default: null },
|
|
28
|
+
});
|
|
29
|
+
const chartList = ref([]); // 图表列表
|
|
30
|
+
const chartDomRefList = ref([]); // 图表Dom列表
|
|
31
|
+
const cycleOptions = ref([]);
|
|
32
|
+
const menuList = [{ key: "syncBrushRangeOtherKline", label: "同步其它K线范围" }]; // 菜单列表
|
|
33
|
+
|
|
34
|
+
// 同步刷选范围
|
|
35
|
+
const syncBrushRange = ref({
|
|
36
|
+
cycleList: [], // 需要进行刷选的周期
|
|
37
|
+
startTime: null,
|
|
38
|
+
endTime: null,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// 清除单个图表的同步刷选
|
|
42
|
+
const handleClearSyncBrush = (cycle) => {
|
|
43
|
+
if (syncBrushRange.value.cycleList.includes(cycle)) {
|
|
44
|
+
const index = syncBrushRange.value.cycleList.findIndex((i) => i === cycle);
|
|
45
|
+
syncBrushRange.value.cycleList.splice(index, 1);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// 绑定图表Ref
|
|
50
|
+
const handleSetChartDomRef = (el, index) => {
|
|
51
|
+
if (el) chartDomRefList.value[index] = el;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// 点击菜单项
|
|
55
|
+
const handleClickMenuItem = (menu, item, index) => {
|
|
56
|
+
switch (menu.key) {
|
|
57
|
+
// 同步刷选范围
|
|
58
|
+
case "syncBrushRangeOtherKline": {
|
|
59
|
+
const { screenTimeRange, contextmenuKlineTime } = chartDomRefList.value[index];
|
|
60
|
+
// 生成同步刷选的时间范围
|
|
61
|
+
switch (item.cycle) {
|
|
62
|
+
// 大周期将contextmenuKlineTime按周期拆成范围, 再使用
|
|
63
|
+
case "6": {
|
|
64
|
+
syncBrushRange.value = {
|
|
65
|
+
cycleList: [],
|
|
66
|
+
startTime: dayjs(contextmenuKlineTime).format("YYYY-MM-DD 00:00:00"),
|
|
67
|
+
endTime: dayjs(contextmenuKlineTime).format("YYYY-MM-DD 23:59:59"),
|
|
68
|
+
};
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
case "7": {
|
|
72
|
+
syncBrushRange.value = {
|
|
73
|
+
cycleList: [],
|
|
74
|
+
startTime: dayjs(contextmenuKlineTime).startOf("week").add(1, "day").format("YYYY-MM-DD 00:00:00"),
|
|
75
|
+
endTime: dayjs(contextmenuKlineTime).endOf("week").add(1, "day").format("YYYY-MM-DD 23:59:59"),
|
|
76
|
+
};
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
case "8": {
|
|
80
|
+
syncBrushRange.value = {
|
|
81
|
+
cycleList: [],
|
|
82
|
+
startTime: dayjs(contextmenuKlineTime).startOf("month").format("YYYY-MM-DD 00:00:00"),
|
|
83
|
+
endTime: dayjs(contextmenuKlineTime).endOf("month").format("YYYY-MM-DD 23:59:59"),
|
|
84
|
+
};
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
// 小周期直接用screenTimeRange
|
|
88
|
+
default: {
|
|
89
|
+
syncBrushRange.value = {
|
|
90
|
+
cycleList: [],
|
|
91
|
+
startTime: screenTimeRange[0],
|
|
92
|
+
endTime: screenTimeRange[1],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// 图表重绘
|
|
97
|
+
chartList.value.forEach((citem, cindex) => {
|
|
98
|
+
if (cindex !== index) {
|
|
99
|
+
syncBrushRange.value.cycleList.push(citem.cycle);
|
|
100
|
+
const startTime = estimateKlineTime(syncBrushRange.value.startTime, "before", 200, citem.cycle);
|
|
101
|
+
const endTime = estimateKlineTime(syncBrushRange.value.endTime, "after", 200, citem.cycle);
|
|
102
|
+
citem.initTimeRange = [startTime, endTime];
|
|
103
|
+
}
|
|
104
|
+
nextTick(() => chartDomRefList.value[index].reDraw());
|
|
105
|
+
});
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
onMounted(async () => {
|
|
112
|
+
cycleOptions.value = (await getCycleList()).body[1002].map((item) => ({ label: item.dictName, value: item.dictCode }));
|
|
113
|
+
const { multiCycleNum, multiCycleList } = props.userKlineConfig;
|
|
114
|
+
chartList.value = multiCycleList.slice(0, multiCycleNum).map((cycle) => {
|
|
115
|
+
const params = {
|
|
116
|
+
type: "reset",
|
|
117
|
+
cycle,
|
|
118
|
+
startTime: props.tradeLog[0].openTime,
|
|
119
|
+
endTime: props.positionTime ? props.positionTime : props.tradeLog.at(-1).closeTime,
|
|
120
|
+
};
|
|
121
|
+
const initTimeRange = getTimeRange(params);
|
|
122
|
+
return { cycle, initTimeRange };
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
defineExpose({
|
|
126
|
+
changeTimeRange: (type) => {
|
|
127
|
+
chartList.value = chartList.value.map((item) => {
|
|
128
|
+
const params = {
|
|
129
|
+
type,
|
|
130
|
+
cycle: item.cycle,
|
|
131
|
+
startTime: props.tradeLog[0].openTime,
|
|
132
|
+
endTime: props.positionTime ? props.positionTime : props.tradeLog.at(-1).closeTime,
|
|
133
|
+
};
|
|
134
|
+
return {
|
|
135
|
+
...item,
|
|
136
|
+
initTimeRange: getTimeRange(params),
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
// 同步刷选范围
|
|
140
|
+
switch (type) {
|
|
141
|
+
case "week": {
|
|
142
|
+
const startDate = dayjs().startOf("week").add(1, "day").format("YYYY-MM-DD 00:00:00");
|
|
143
|
+
const endDate = dayjs().endOf("week").add(1, "day").format("YYYY-MM-DD 23:59:59");
|
|
144
|
+
syncBrushRange.value = {
|
|
145
|
+
cycleList: ["6", "7", "8"],
|
|
146
|
+
startTime: startDate,
|
|
147
|
+
endTime: endDate,
|
|
148
|
+
};
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
case "month": {
|
|
152
|
+
const startDate = dayjs().startOf("month").format("YYYY-MM-DD 00:00:00");
|
|
153
|
+
const endDate = dayjs().endOf("month").format("YYYY-MM-DD 23:59:59");
|
|
154
|
+
syncBrushRange.value = {
|
|
155
|
+
cycleList: ["6", "7", "8"],
|
|
156
|
+
startTime: startDate,
|
|
157
|
+
endTime: endDate,
|
|
158
|
+
};
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
case "reset": {
|
|
162
|
+
syncBrushRange.value = {
|
|
163
|
+
cycleList: [],
|
|
164
|
+
startTime: null,
|
|
165
|
+
endTime: null,
|
|
166
|
+
};
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
});
|
|
172
|
+
</script>
|
|
173
|
+
|
|
174
|
+
<template>
|
|
175
|
+
<div :class="`kline-multi grid-${userKlineConfig.multiCycleNum}`">
|
|
176
|
+
<div
|
|
177
|
+
class="box"
|
|
178
|
+
v-for="(item, index) in chartList"
|
|
179
|
+
@dblclick="emit('goToSingleCycle', item)"
|
|
180
|
+
>
|
|
181
|
+
<div class="cycleName">
|
|
182
|
+
<span>{{ formatLabel(item.cycle, cycleOptions) }}</span>
|
|
183
|
+
<el-select
|
|
184
|
+
v-model="item.cycle"
|
|
185
|
+
popper-class="element-dark"
|
|
186
|
+
:popper-append-to-body="false"
|
|
187
|
+
@change="handleClearSyncBrush(item.cycle)"
|
|
188
|
+
>
|
|
189
|
+
<el-option
|
|
190
|
+
v-for="(item, index) in cycleOptions"
|
|
191
|
+
:key="index"
|
|
192
|
+
:label="item.label"
|
|
193
|
+
:value="item.value"
|
|
194
|
+
/>
|
|
195
|
+
</el-select>
|
|
196
|
+
</div>
|
|
197
|
+
<st-contextmenu>
|
|
198
|
+
<st-klinePlus
|
|
199
|
+
:ref="(el) => handleSetChartDomRef(el, index)"
|
|
200
|
+
:varietyCode="varietyCode"
|
|
201
|
+
:varietyStock="varietyStock"
|
|
202
|
+
:indicatorStore="indicatorStore"
|
|
203
|
+
:userKlineConfig="userKlineConfig"
|
|
204
|
+
:cycle="item.cycle"
|
|
205
|
+
:sellBuy="sellBuy"
|
|
206
|
+
:rightType="rightType"
|
|
207
|
+
:klineType="klineType"
|
|
208
|
+
:initTimeRange="item.initTimeRange"
|
|
209
|
+
:mainIndicator="mainIndicator"
|
|
210
|
+
:tradeLog="tradeLog"
|
|
211
|
+
:netPositionData="netPositionData"
|
|
212
|
+
:positionTime="positionTime"
|
|
213
|
+
:syncBrushRange="syncBrushRange"
|
|
214
|
+
/>
|
|
215
|
+
<template #popover>
|
|
216
|
+
<el-menu
|
|
217
|
+
:style="{
|
|
218
|
+
borderRadius: '4px',
|
|
219
|
+
overflow: 'hidden',
|
|
220
|
+
background: '#fff',
|
|
221
|
+
borderRight: 0,
|
|
222
|
+
}"
|
|
223
|
+
>
|
|
224
|
+
<el-menu-item
|
|
225
|
+
v-for="menuItem in menuList"
|
|
226
|
+
style="height: 36px"
|
|
227
|
+
:key="menuItem.key"
|
|
228
|
+
:index="menuItem.key"
|
|
229
|
+
@click="handleClickMenuItem(menuItem, item, index)"
|
|
230
|
+
>
|
|
231
|
+
{{ menuItem.label }}
|
|
232
|
+
</el-menu-item>
|
|
233
|
+
</el-menu>
|
|
234
|
+
</template>
|
|
235
|
+
</st-contextmenu>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
</template>
|
|
239
|
+
|
|
240
|
+
<style lang="scss" scoped>
|
|
241
|
+
.kline-multi {
|
|
242
|
+
width: 100%;
|
|
243
|
+
height: 100%;
|
|
244
|
+
box-sizing: border-box;
|
|
245
|
+
padding: 2px;
|
|
246
|
+
display: grid;
|
|
247
|
+
grid-template-columns: repeat(3, minmax(150px, 1fr));
|
|
248
|
+
grid-template-rows: repeat(2, minmax(100px, 1fr));
|
|
249
|
+
grid-gap: 2px;
|
|
250
|
+
.box {
|
|
251
|
+
position: relative;
|
|
252
|
+
border: 1px solid var(--el-border-color);
|
|
253
|
+
transition: 0.2s;
|
|
254
|
+
&:hover {
|
|
255
|
+
border: 1px solid var(--el-color-primary);
|
|
256
|
+
}
|
|
257
|
+
.cycleName {
|
|
258
|
+
color: white;
|
|
259
|
+
font-size: 12px;
|
|
260
|
+
padding: 1px 4px;
|
|
261
|
+
background-color: var(--el-color-primary);
|
|
262
|
+
display: flex;
|
|
263
|
+
align-items: center;
|
|
264
|
+
border-bottom-left-radius: 4px;
|
|
265
|
+
position: absolute;
|
|
266
|
+
z-index: 999;
|
|
267
|
+
right: 0px;
|
|
268
|
+
top: 0px;
|
|
269
|
+
:deep(.el-select) {
|
|
270
|
+
margin-left: 4px;
|
|
271
|
+
width: 14px;
|
|
272
|
+
.el-select__icon {
|
|
273
|
+
margin-left: 0;
|
|
274
|
+
color: black;
|
|
275
|
+
width: 14px;
|
|
276
|
+
height: 14px;
|
|
277
|
+
}
|
|
278
|
+
.el-select__wrapper {
|
|
279
|
+
border-radius: 50%;
|
|
280
|
+
background: #ccc;
|
|
281
|
+
padding: 0;
|
|
282
|
+
gap: 0;
|
|
283
|
+
min-height: 14px;
|
|
284
|
+
line-height: 14px;
|
|
285
|
+
}
|
|
286
|
+
.el-select__input {
|
|
287
|
+
min-width: 0 !important;
|
|
288
|
+
width: 0 !important;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
.grid-2 {
|
|
295
|
+
display: grid;
|
|
296
|
+
grid-template-columns: repeat(2, 1fr);
|
|
297
|
+
grid-template-rows: repeat(1, minmax(80px, 1fr));
|
|
298
|
+
grid-gap: 2px;
|
|
299
|
+
}
|
|
300
|
+
.grid-4 {
|
|
301
|
+
display: grid;
|
|
302
|
+
grid-template-columns: repeat(2, 1fr);
|
|
303
|
+
grid-template-rows: repeat(2, minmax(80px, 1fr));
|
|
304
|
+
grid-gap: 2px;
|
|
305
|
+
}
|
|
306
|
+
.grid-6 {
|
|
307
|
+
display: grid;
|
|
308
|
+
grid-template-columns: repeat(3, 1fr);
|
|
309
|
+
grid-template-rows: repeat(2, minmax(80px, 1fr));
|
|
310
|
+
grid-gap: 2px;
|
|
311
|
+
}
|
|
312
|
+
</style>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
|
|
3
|
+
// 测试环境
|
|
4
|
+
// const userid = 103;
|
|
5
|
+
// const token = "490cebe77872589fc6f670d30983b268";
|
|
6
|
+
// export const host = "http://192.168.12.38:5173";
|
|
7
|
+
|
|
8
|
+
// 线上环境
|
|
9
|
+
const userid = 200;
|
|
10
|
+
const token = "02e233681c5cecaf788525e70c380ed5";
|
|
11
|
+
export const host = "//investapi.hzyotoy.com";
|
|
12
|
+
|
|
13
|
+
// 获取数据: 指标列表
|
|
14
|
+
export const getIndicator = async (data) => {
|
|
15
|
+
const res = await axios({
|
|
16
|
+
method: "post",
|
|
17
|
+
headers: { token, userid },
|
|
18
|
+
url: `${host}/middleLayer/kline/getIndicator`,
|
|
19
|
+
data,
|
|
20
|
+
});
|
|
21
|
+
return res.data;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// 获取周期列表
|
|
25
|
+
export const getCycleList = async () => {
|
|
26
|
+
const res = await axios({
|
|
27
|
+
method: "post",
|
|
28
|
+
headers: { token, userid },
|
|
29
|
+
url: `${host}/middleLayer/post/common/qt/getDict`,
|
|
30
|
+
data: { dictIds: [1002] },
|
|
31
|
+
});
|
|
32
|
+
return res.data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// 查询品种是否股票
|
|
36
|
+
export const queryContractType = async (data) => {
|
|
37
|
+
const res = await axios({
|
|
38
|
+
method: "post",
|
|
39
|
+
headers: { token, userid },
|
|
40
|
+
url: `${host}/middleLayer/bjpost/invest/analysis/queryContractType`,
|
|
41
|
+
data,
|
|
42
|
+
});
|
|
43
|
+
return res.data;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// 获取净值曲线数据
|
|
47
|
+
export const queryVarietyNetPositionValue = async (data) => {
|
|
48
|
+
const res = await axios({
|
|
49
|
+
method: "post",
|
|
50
|
+
headers: { token, userid },
|
|
51
|
+
url: `${host}/middleLayer/bjpost/invest/analysis/queryVarietyNetPositionValue`,
|
|
52
|
+
data,
|
|
53
|
+
});
|
|
54
|
+
return res.data;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// 获取交易订单数据
|
|
58
|
+
export const queryPairedRecordByVariety = async (data) => {
|
|
59
|
+
const res = await axios({
|
|
60
|
+
method: "post",
|
|
61
|
+
headers: { token, userid },
|
|
62
|
+
url: `${host}/middleLayer/bjpost/invest/analysis/queryPairedRecordByVariety`,
|
|
63
|
+
data,
|
|
64
|
+
});
|
|
65
|
+
return res.data;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// 获取篮子品种对应的价差指数
|
|
69
|
+
export const queryJCVariety = async (data) => {
|
|
70
|
+
const res = await axios({
|
|
71
|
+
method: "post",
|
|
72
|
+
headers: { token, userid },
|
|
73
|
+
url: `${host}/middleLayer/bjpost/invest/analysis/queryJCVariety`,
|
|
74
|
+
data,
|
|
75
|
+
});
|
|
76
|
+
return res.data;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const getUserConfig = async (data) => {
|
|
80
|
+
const res = await axios({
|
|
81
|
+
method: "post",
|
|
82
|
+
headers: { token, userid },
|
|
83
|
+
url: `${host}/middleLayer/bjpost/common/qt/getUserConfig`,
|
|
84
|
+
data,
|
|
85
|
+
});
|
|
86
|
+
return res.data;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// 获取配置
|
|
90
|
+
export const getConfig = async () => {
|
|
91
|
+
const res = await axios({
|
|
92
|
+
method: "get",
|
|
93
|
+
headers: { token, userid },
|
|
94
|
+
url: `${host}/middleLayer/get/invest/sys/frontconfig/info`,
|
|
95
|
+
});
|
|
96
|
+
return res.data;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// 设置配置
|
|
100
|
+
export const setConfig = async (data) => {
|
|
101
|
+
const res = await axios({
|
|
102
|
+
method: "post",
|
|
103
|
+
headers: { token, userid },
|
|
104
|
+
url: `${host}/middleLayer/post/invest/sys/frontconfig/save`,
|
|
105
|
+
data,
|
|
106
|
+
});
|
|
107
|
+
return res.data;
|
|
108
|
+
};
|