初步完成4大模块开发

This commit is contained in:
simple321vip
2022-09-14 15:58:51 +08:00
parent 3baa441fbb
commit 736f026069
8 changed files with 236 additions and 42 deletions
+29 -4
View File
@@ -8,10 +8,8 @@
<script setup lang="ts">
import * as echarts from 'echarts'
import { onMounted, ref } from 'vue';
import {
get_strategy_load_files,
get_vt_symbols
} from '../../api/cta_strategy'
import { get_vt_symbols, get_exchanges, get_subscribe_vt_symbols } from '../../api/capital';
import { get_strategy_load_files } from '../../api/cta_strategy'
import { h } from 'vue'
import { ElMessage } from 'element-plus'
import { strategyStore } from '../../store/strategy';
@@ -34,6 +32,22 @@ const init = () => {
})
get_vt_symbols().then(res => {
console.log(res)
let map = new Map()
let keys = Object.keys(res.data.vt_symbols)
keys.forEach(key => {
map.set(key, res.data.vt_symbols[key])
})
store.$patch({ vt_symbols: map })
}).catch(error => {
ElMessage({
message: h('p', null, [
h('i', { style: 'color: teal' }, "读取vt_symbols失败"),
]),
})
})
get_subscribe_vt_symbols().then(res => {
store.$patch({ vt_symbols: res.data.vt_symbols })
}).catch(error => {
ElMessage({
@@ -42,6 +56,17 @@ const init = () => {
]),
})
})
get_exchanges().then(res => {
store.$patch({ exchanges: res.data.exchanges })
}).catch(error => {
ElMessage({
message: h('p', null, [
h('i', { style: 'color: teal' }, "读取exchanges失败"),
]),
})
})
}
// init process
init()