|
@@ -1,83 +1,194 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <!-- 交易图表 -->
|
|
|
|
|
- <div class="chart-container">
|
|
|
|
|
- <div class="chart-content"></div>
|
|
|
|
|
- <div class="chart-tips">
|
|
|
|
|
- <div>
|
|
|
|
|
- <div class="chartRow"
|
|
|
|
|
- v-for="(item, index) in tradedList"
|
|
|
|
|
- :key="index + '11'">
|
|
|
|
|
- <div class="left">{{formatTime(item.TS, 'hm')}}</div>
|
|
|
|
|
- <div class="middle">{{item.PE}}</div>
|
|
|
|
|
- <div class="right">{{item.Vol}}</div>
|
|
|
|
|
|
|
+ <!-- 交易图表 -->
|
|
|
|
|
+ <div class="chart-container">
|
|
|
|
|
+ <div class="chart-content">
|
|
|
|
|
+ <div class="chart-content__header">
|
|
|
|
|
+ <a-radio-group class="chart-content__tabs" v-model:value="activeCycleType" @change="selectCycleType">
|
|
|
|
|
+ <template v-for="item in chartType" :key="item.type">
|
|
|
|
|
+ <a-radio-button :value="item.type">{{ item.name }}</a-radio-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-radio-group>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <echart-time class="chart-content__main" :quote-data="selectedRow" v-if="activeCycleType === -1"></echart-time>
|
|
|
|
|
+ <echart-kline class="chart-content__main" :quote-data="selectedRow" :cycle-type="activeCycleType" v-else></echart-kline>
|
|
|
|
|
+ <!-- <component :is="componentId" v-if="componentId" :series-data="chartData" :quote-data="selectedRow"></component> -->
|
|
|
|
|
+ <div class="chart-content__footer"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="chart-slider">
|
|
|
|
|
+ <div class="chart-slider__button"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="chart-tips">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div class="chart-tips__nav">
|
|
|
|
|
+ <div class="content content--left">{{ selectedRow.goodscode }}</div>
|
|
|
|
|
+ <div class="content content--right">{{ selectedRow.goodsname }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="chart-tips__last">
|
|
|
|
|
+ <div :class="['content content--left', priceColor]">{{ selectedRow.last }}</div>
|
|
|
|
|
+ <div class="content content--right">
|
|
|
|
|
+ <span :class="priceColor">{{ quoteChange(selectedRow) }}</span>
|
|
|
|
|
+ <span :class="priceColor">{{ quoteAmplitude(selectedRow) }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="chart-tips__volume">
|
|
|
|
|
+ <a-row>
|
|
|
|
|
+ <a-col :span="8">卖一</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.ask }}</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.askvolume }}</a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row>
|
|
|
|
|
+ <a-col :span="8">买一</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.bid }}</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.bidvolume }}</a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- <div>
|
|
|
|
|
+ <div class="chartRow" v-for="(item, index) in tradedList" :key="index + '11'">
|
|
|
|
|
+ <div class="left">{{ formatTime(item.TS, 'hm') }}</div>
|
|
|
|
|
+ <div class="middle">{{ item.PE }}</div>
|
|
|
|
|
+ <div class="right">{{ item.Vol }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div> -->
|
|
|
|
|
+ <div class="chart-tips__info">
|
|
|
|
|
+ <a-row>
|
|
|
|
|
+ <a-col :span="4">最新</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.last }}</a-col>
|
|
|
|
|
+ <a-col :span="4">均价</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.averageprice }}</a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row>
|
|
|
|
|
+ <a-col :span="4">涨跌</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ quoteChange(selectedRow) }}</a-col>
|
|
|
|
|
+ <a-col :span="4">今开</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.opened }}</a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row>
|
|
|
|
|
+ <a-col :span="4">涨幅</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ quoteAmplitude(selectedRow) }}</a-col>
|
|
|
|
|
+ <a-col :span="4">最高</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.highest }}</a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row>
|
|
|
|
|
+ <a-col :span="4">总量</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.totalvolume }}</a-col>
|
|
|
|
|
+ <a-col :span="4">最低</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.lowest }}</a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row>
|
|
|
|
|
+ <a-col :span="4">金额</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.totalturnover }}</a-col>
|
|
|
|
|
+ <a-col :span="4">量比</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ '--' }}</a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row>
|
|
|
|
|
+ <a-col :span="4">涨停</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.limitup }}</a-col>
|
|
|
|
|
+ <a-col :span="4">跌停</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.limitdown }}</a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row>
|
|
|
|
|
+ <a-col :span="4">外盘</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.totalbidvolume }}</a-col>
|
|
|
|
|
+ <a-col :span="4">内盘</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.totalaskvolume }}</a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row>
|
|
|
|
|
+ <a-col :span="4">持仓</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.holdvolume }}</a-col>
|
|
|
|
|
+ <a-col :span="4">结算</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ selectedRow.settle }}</a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row>
|
|
|
|
|
+ <a-col :span="4">仓差</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ '--' }}</a-col>
|
|
|
|
|
+ <a-col :span="4">前结</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ '--' }}</a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row>
|
|
|
|
|
+ <a-col :span="4">日增</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ '--' }}</a-col>
|
|
|
|
|
+ <a-col :span="4">开平</a-col>
|
|
|
|
|
+ <a-col :span="8">{{ '--' }}</a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- <div @click="watchMore" class="watchMore">查看更多</div> -->
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- <div @click="watchMore"
|
|
|
|
|
- class="watchMore">查看更多</div>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
-import { defineAsyncComponent, defineComponent } from '@/common/export/commonTable';
|
|
|
|
|
|
|
+import { defineComponent } from '@/common/export/commonTable';
|
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
-import { PropType, ref } from 'vue';
|
|
|
|
|
-
|
|
|
|
|
-import { QueryHistoryTikDatasRsp, QueryQuoteDayRsp } from '@/services/go/quote/interface';
|
|
|
|
|
-import { QueryDeliveryRelationRsp } from '@/services/go/delivery/interface';
|
|
|
|
|
|
|
+import { PropType, ref, computed } from 'vue';
|
|
|
|
|
+import { QueryQuoteDayRsp, CycleType } from '@/services/go/quote/interface';
|
|
|
import { QueryHistoryTikDatas } from '@/services/go/quote';
|
|
import { QueryHistoryTikDatas } from '@/services/go/quote';
|
|
|
-import { WrTradeOrderDetailReq } from '@/services/go/wrtrade/interface';
|
|
|
|
|
-import { useQueryData } from '@/common/setup/request';
|
|
|
|
|
-import { queryWrTradeOrderDetail } from '@/services/go/wrtrade';
|
|
|
|
|
import { formatTime } from '@/common/methods';
|
|
import { formatTime } from '@/common/methods';
|
|
|
import { ComponentType } from '../setup';
|
|
import { ComponentType } from '../setup';
|
|
|
|
|
+import { EchartKline, EchartTime } from '@/common/components/echart';
|
|
|
|
|
+import { handleQuotePriceColor, quoteChange, quoteAmplitude } from '@/common/setup/table/tableQuote';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
emits: ['cancel', 'update'],
|
|
emits: ['cancel', 'update'],
|
|
|
name: 'stock-exchange',
|
|
name: 'stock-exchange',
|
|
|
|
|
+ components: {
|
|
|
|
|
+ EchartKline,
|
|
|
|
|
+ EchartTime,
|
|
|
|
|
+ },
|
|
|
props: {
|
|
props: {
|
|
|
selectedRow: {
|
|
selectedRow: {
|
|
|
type: Object as PropType<QueryQuoteDayRsp>,
|
|
type: Object as PropType<QueryQuoteDayRsp>,
|
|
|
default: {},
|
|
default: {},
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
setup(props, context) {
|
|
setup(props, context) {
|
|
|
- const loading = ref<boolean>(false);
|
|
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
- const activeKey = ref('1');
|
|
|
|
|
|
|
+ const activeCycleType = ref<CycleType>(-1);
|
|
|
function watchMore() {
|
|
function watchMore() {
|
|
|
context.emit('update', ComponentType.tradeDetail);
|
|
context.emit('update', ComponentType.tradeDetail);
|
|
|
}
|
|
}
|
|
|
const { goodscode } = props.selectedRow;
|
|
const { goodscode } = props.selectedRow;
|
|
|
|
|
|
|
|
|
|
+ const priceColor = computed(() => {
|
|
|
|
|
+ return handleQuotePriceColor(props.selectedRow.last, props.selectedRow.presettle);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 周期类型
|
|
|
|
|
+ const chartType = [
|
|
|
|
|
+ { name: '分时', type: -1 },
|
|
|
|
|
+ { name: '1分钟', type: 1 },
|
|
|
|
|
+ { name: '5分钟', type: 2 },
|
|
|
|
|
+ { name: '30分钟', type: 3 },
|
|
|
|
|
+ { name: '60分钟', type: 4 },
|
|
|
|
|
+ { name: '4小时', type: 240 },
|
|
|
|
|
+ { name: '日 K', type: 11 },
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // 选择图表周期类型
|
|
|
|
|
+ const selectCycleType = () => {
|
|
|
|
|
+ // console.log(activeCycleType.value);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
// 成交
|
|
// 成交
|
|
|
- const { list: tradedList } = useQueryData(QueryHistoryTikDatas, { goodsCode: goodscode });
|
|
|
|
|
|
|
+ // const { list: tradedList } = useQueryData(QueryHistoryTikDatas, { goodsCode: goodscode });
|
|
|
|
|
+
|
|
|
return {
|
|
return {
|
|
|
cancel,
|
|
cancel,
|
|
|
visible,
|
|
visible,
|
|
|
-
|
|
|
|
|
- tradedList,
|
|
|
|
|
- loading,
|
|
|
|
|
- activeKey,
|
|
|
|
|
|
|
+ chartType,
|
|
|
|
|
+ tradedList: [],
|
|
|
|
|
+ activeCycleType,
|
|
|
watchMore,
|
|
watchMore,
|
|
|
formatTime,
|
|
formatTime,
|
|
|
|
|
+ selectCycleType,
|
|
|
|
|
+ quoteChange,
|
|
|
|
|
+ quoteAmplitude,
|
|
|
|
|
+ priceColor,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
+
|
|
|
<style lang="less">
|
|
<style lang="less">
|
|
|
-.chart-container {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: calc(100% - 41px);
|
|
|
|
|
- .chart-content {
|
|
|
|
|
- flex: 1;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- }
|
|
|
|
|
- .chart-tips {
|
|
|
|
|
- width: 300px;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+@import './index.less';
|
|
|
</style>
|
|
</style>
|