|
@@ -1,58 +1,61 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="app-echats-kline">
|
|
<div class="app-echats-kline">
|
|
|
- <div class="app-echats-kline__container main">
|
|
|
|
|
- <ul class="legend">
|
|
|
|
|
- <li class="legend-item">开: {{ selectedItem.open }}</li>
|
|
|
|
|
- <li class="legend-item">收: {{ selectedItem.close }}</li>
|
|
|
|
|
- <li class="legend-item">高: {{ selectedItem.highest }}</li>
|
|
|
|
|
- <li class="legend-item">低: {{ selectedItem.lowest }}</li>
|
|
|
|
|
- <li class="legend-item">MA5: {{ selectedItem.ma5 }}</li>
|
|
|
|
|
- <li class="legend-item">MA10: {{ selectedItem.ma10 }}</li>
|
|
|
|
|
- <li class="legend-item">MA15: {{ selectedItem.ma15 }}</li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- <app-echarts :option="options.candlestick" :empty="isEmpty" v-model:index="dataIndex" v-model:loading="loading"
|
|
|
|
|
- @ready="mainReady" />
|
|
|
|
|
- </div>
|
|
|
|
|
- <template v-if="showIndicator">
|
|
|
|
|
- <div class="app-echats-kline__container indicator">
|
|
|
|
|
- <!-- MACD -->
|
|
|
|
|
- <section class="section" v-if="activeSeriesType === EChartsSeriesType.MACD">
|
|
|
|
|
- <ul class="legend">
|
|
|
|
|
- <li class="legend-item">MACD: {{ selectedItem.macd }}</li>
|
|
|
|
|
- <li class="legend-item">DIF: {{ selectedItem.dif }}</li>
|
|
|
|
|
- <li class="legend-item">DEA: {{ selectedItem.dea }}</li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- <app-echarts :option="options.macd" :empty="isEmpty" v-model:index="dataIndex" v-model:loading="loading"
|
|
|
|
|
- @ready="indicatorReady" />
|
|
|
|
|
- </section>
|
|
|
|
|
- <!-- VOL -->
|
|
|
|
|
- <section class="section" v-if="activeSeriesType === EChartsSeriesType.VOL">
|
|
|
|
|
- <ul class="legend">
|
|
|
|
|
- <li class="legend-item">VOL: {{ selectedItem.vol }}</li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- <app-echarts :option="options.vol" :empty="isEmpty" v-model:index="dataIndex" v-model:loading="loading"
|
|
|
|
|
- @ready="indicatorReady" />
|
|
|
|
|
- </section>
|
|
|
|
|
- <!-- KDJ -->
|
|
|
|
|
- <section class="section" v-if="activeSeriesType === EChartsSeriesType.KDJ">
|
|
|
|
|
- <ul class="legend">
|
|
|
|
|
- <li class="legend-item">K: {{ selectedItem.k }}</li>
|
|
|
|
|
- <li class="legend-item">D: {{ selectedItem.d }}</li>
|
|
|
|
|
- <li class="legend-item">J: {{ selectedItem.j }}</li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- <app-echarts :option="options.kdj" :empty="isEmpty" v-model:index="dataIndex" v-model:loading="loading"
|
|
|
|
|
- @ready="indicatorReady" />
|
|
|
|
|
- </section>
|
|
|
|
|
- <!-- CCI -->
|
|
|
|
|
- <section class="section" v-if="activeSeriesType === EChartsSeriesType.CCI">
|
|
|
|
|
- <ul class="legend">
|
|
|
|
|
- <li class="legend-item">CCI: {{ selectedItem.cci }}</li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- <app-echarts :option="options.cci" :empty="isEmpty" v-model:index="dataIndex" v-model:loading="loading"
|
|
|
|
|
- @ready="indicatorReady" />
|
|
|
|
|
- </section>
|
|
|
|
|
|
|
+ <template v-if="loading">
|
|
|
|
|
+ <div class="app-echats-kline__tip">正在加载...</div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-else-if="isEmpty">
|
|
|
|
|
+ <div class="app-echats-kline__tip">暂无数据</div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <div class="app-echats-kline__container main">
|
|
|
|
|
+ <ul class="legend">
|
|
|
|
|
+ <li class="legend-item">开: {{ selectedItem.open }}</li>
|
|
|
|
|
+ <li class="legend-item">收: {{ selectedItem.close }}</li>
|
|
|
|
|
+ <li class="legend-item">高: {{ selectedItem.highest }}</li>
|
|
|
|
|
+ <li class="legend-item">低: {{ selectedItem.lowest }}</li>
|
|
|
|
|
+ <li class="legend-item">MA5: {{ selectedItem.ma5 }}</li>
|
|
|
|
|
+ <li class="legend-item">MA10: {{ selectedItem.ma10 }}</li>
|
|
|
|
|
+ <li class="legend-item">MA15: {{ selectedItem.ma15 }}</li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ <app-echarts :option="options.candlestick" v-model:index="dataIndex" @ready="mainReady" />
|
|
|
</div>
|
|
</div>
|
|
|
- <app-tab theme="menu" :data-source="tabs" @change="tabChange" />
|
|
|
|
|
|
|
+ <template v-if="showIndicator">
|
|
|
|
|
+ <div class="app-echats-kline__container indicator">
|
|
|
|
|
+ <!-- MACD -->
|
|
|
|
|
+ <section class="section" v-if="activeSeriesType === EChartsSeriesType.MACD">
|
|
|
|
|
+ <ul class="legend">
|
|
|
|
|
+ <li class="legend-item">MACD: {{ selectedItem.macd }}</li>
|
|
|
|
|
+ <li class="legend-item">DIF: {{ selectedItem.dif }}</li>
|
|
|
|
|
+ <li class="legend-item">DEA: {{ selectedItem.dea }}</li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ <app-echarts :option="options.macd" v-model:index="dataIndex" @ready="indicatorReady" />
|
|
|
|
|
+ </section>
|
|
|
|
|
+ <!-- VOL -->
|
|
|
|
|
+ <section class="section" v-if="activeSeriesType === EChartsSeriesType.VOL">
|
|
|
|
|
+ <ul class="legend">
|
|
|
|
|
+ <li class="legend-item">VOL: {{ selectedItem.vol }}</li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ <app-echarts :option="options.vol" v-model:index="dataIndex" @ready="indicatorReady" />
|
|
|
|
|
+ </section>
|
|
|
|
|
+ <!-- KDJ -->
|
|
|
|
|
+ <section class="section" v-if="activeSeriesType === EChartsSeriesType.KDJ">
|
|
|
|
|
+ <ul class="legend">
|
|
|
|
|
+ <li class="legend-item">K: {{ selectedItem.k }}</li>
|
|
|
|
|
+ <li class="legend-item">D: {{ selectedItem.d }}</li>
|
|
|
|
|
+ <li class="legend-item">J: {{ selectedItem.j }}</li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ <app-echarts :option="options.kdj" v-model:index="dataIndex" @ready="indicatorReady" />
|
|
|
|
|
+ </section>
|
|
|
|
|
+ <!-- CCI -->
|
|
|
|
|
+ <section class="section" v-if="activeSeriesType === EChartsSeriesType.CCI">
|
|
|
|
|
+ <ul class="legend">
|
|
|
|
|
+ <li class="legend-item">CCI: {{ selectedItem.cci }}</li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ <app-echarts :option="options.cci" v-model:index="dataIndex" @ready="indicatorReady" />
|
|
|
|
|
+ </section>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <app-tab theme="menu" :data-source="tabs" @change="tabChange" />
|
|
|
|
|
+ </template>
|
|
|
</template>
|
|
</template>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -103,7 +106,7 @@ const tabChange = (index: number) => {
|
|
|
|
|
|
|
|
const mainReady = (chart: echarts.ECharts) => {
|
|
const mainReady = (chart: echarts.ECharts) => {
|
|
|
chartGroup.set('main', chart);
|
|
chartGroup.set('main', chart);
|
|
|
- initData(props.cycleType);
|
|
|
|
|
|
|
+ initOptions();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const indicatorReady = (chart: echarts.ECharts) => {
|
|
const indicatorReady = (chart: echarts.ECharts) => {
|
|
@@ -112,7 +115,11 @@ const indicatorReady = (chart: echarts.ECharts) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 监听周期选择变化
|
|
// 监听周期选择变化
|
|
|
-watch(() => props.cycleType, (val) => initData(val));
|
|
|
|
|
|
|
+watch(() => props.cycleType, (val) => {
|
|
|
|
|
+ initData(val);
|
|
|
|
|
+}, {
|
|
|
|
|
+ immediate: true
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|