|
@@ -1,89 +1,66 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <!-- 买卖大厅 -->
|
|
|
|
|
- <div class="buy-sell-market">
|
|
|
|
|
- <div class="buy-sell-market-title">
|
|
|
|
|
- <a class="backIcon" @click="cancelAction">
|
|
|
|
|
- <LeftOutlined />
|
|
|
|
|
- </a>
|
|
|
|
|
- <div class="titleBtn">
|
|
|
|
|
- <div class="name">{{ selectedRow.goodscode }} {{ selectedRow.goodsname }}</div>
|
|
|
|
|
- <div class="arrowRightIcon"></div>
|
|
|
|
|
|
|
+ <!-- 买卖大厅 -->
|
|
|
|
|
+ <div class="buy-sell-market">
|
|
|
|
|
+ <div class="buy-sell-market-title">
|
|
|
|
|
+ <a class="backIcon" @click="cancelAction">
|
|
|
|
|
+ <LeftOutlined />
|
|
|
|
|
+ </a>
|
|
|
|
|
+ <div class="titleBtn">
|
|
|
|
|
+ <div class="name">{{ selectedRow.goodscode }} {{ selectedRow.goodsname }}</div>
|
|
|
|
|
+ <div class="arrowRightIcon"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="inlineBar">
|
|
|
|
|
+ <div class="valNums bdf1 ml10">
|
|
|
|
|
+ <!-- 最新价 -->
|
|
|
|
|
+ <div class="firstNum start" :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">{{ selectedRow.last }}</div>
|
|
|
|
|
+ <div class="lastNum start">
|
|
|
|
|
+ <!-- 涨跌值 -->
|
|
|
|
|
+ <div :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">{{ quoteChange(selectedRow, selectedRow.decimalplace) }}</div>
|
|
|
|
|
+ <!-- 涨跌幅 -->
|
|
|
|
|
+ <div class="ml20" :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">{{ quoteAmplitude(selectedRow, selectedRow.decimalplace) }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="priceBar ml20">
|
|
|
|
|
+ <div class="inlineBar start">
|
|
|
|
|
+ <div class="greenBar">
|
|
|
|
|
+ <div class="numBlock ml15">
|
|
|
|
|
+ <div class="first grey">卖价</div>
|
|
|
|
|
+ <div class="last" :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)">{{ selectedRow.ask }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="numBlock">
|
|
|
|
|
+ <div class="first grey">卖量</div>
|
|
|
|
|
+ <div class="last" :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)">{{ selectedRow.askvolume }}</div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="inlineBar">
|
|
|
|
|
- <div class="valNums bdf1 ml10">
|
|
|
|
|
- <!-- 最新价 -->
|
|
|
|
|
- <div
|
|
|
|
|
- class="firstNum start"
|
|
|
|
|
- :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)"
|
|
|
|
|
- >{{ selectedRow.last }}</div>
|
|
|
|
|
- <div class="lastNum start">
|
|
|
|
|
- <!-- 涨跌值 -->
|
|
|
|
|
- <div
|
|
|
|
|
- :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)"
|
|
|
|
|
- >{{ quoteChange(selectedRow, selectedRow.decimalplace) }}</div>
|
|
|
|
|
- <!-- 涨跌幅 -->
|
|
|
|
|
- <div
|
|
|
|
|
- class="ml20"
|
|
|
|
|
- :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)"
|
|
|
|
|
- >{{ quoteAmplitude(selectedRow, selectedRow.decimalplace) }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="priceBar ml20">
|
|
|
|
|
- <div class="inlineBar start">
|
|
|
|
|
- <div class="greenBar">
|
|
|
|
|
- <div class="numBlock ml15">
|
|
|
|
|
- <div class="first grey">卖价</div>
|
|
|
|
|
- <div
|
|
|
|
|
- class="last"
|
|
|
|
|
- :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)"
|
|
|
|
|
- >{{ selectedRow.ask }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="numBlock">
|
|
|
|
|
- <div class="first grey">卖量</div>
|
|
|
|
|
- <div
|
|
|
|
|
- class="last"
|
|
|
|
|
- :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)"
|
|
|
|
|
- >{{ selectedRow.askvolume }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="inlineBar start">
|
|
|
|
|
- <div class="redBar">
|
|
|
|
|
- <div class="numBlock">
|
|
|
|
|
- <div class="first grey">买价</div>
|
|
|
|
|
- <div
|
|
|
|
|
- class="last"
|
|
|
|
|
- :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)"
|
|
|
|
|
- >{{ selectedRow.bid }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="numBlock">
|
|
|
|
|
- <div class="first grey">买量</div>
|
|
|
|
|
- <div
|
|
|
|
|
- class="last"
|
|
|
|
|
- :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)"
|
|
|
|
|
- >{{ selectedRow.bidvolume }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="inlineBar start">
|
|
|
|
|
+ <div class="redBar">
|
|
|
|
|
+ <div class="numBlock">
|
|
|
|
|
+ <div class="first grey">买价</div>
|
|
|
|
|
+ <div class="last" :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)">{{ selectedRow.bid }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="numBlock">
|
|
|
|
|
+ <div class="first grey">买量</div>
|
|
|
|
|
+ <div class="last" :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)">{{ selectedRow.bidvolume }}</div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- <!-- 交易图表 -->
|
|
|
|
|
- <Chart
|
|
|
|
|
- v-if="showComponentsId === ComponentType.chart"
|
|
|
|
|
- @update="changeComponent"
|
|
|
|
|
- :selectedRow="selectedRow"
|
|
|
|
|
- />
|
|
|
|
|
- <!-- 成交明细 -->
|
|
|
|
|
- <StockExchange
|
|
|
|
|
- :selectedRow="selectedRow"
|
|
|
|
|
- v-if="showComponentsId === ComponentType.tradeDetail"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="btn-list">
|
|
|
|
|
+ <a-button class="operBtn" @click="openComponent({ code: 'trade' })">交易</a-button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- 交易图表 -->
|
|
|
|
|
+ <Chart v-if="showComponentsId === ComponentType.chart" @update="changeComponent" :selectedRow="selectedRow" />
|
|
|
|
|
+ <!-- 成交明细 -->
|
|
|
|
|
+ <StockExchange :selectedRow="selectedRow" v-if="showComponentsId === ComponentType.tradeDetail" />
|
|
|
|
|
+ <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
-import { defineComponent } from '@/common/export/commonTable';
|
|
|
|
|
|
|
+import { defineComponent, defineAsyncComponent } from '@/common/export/commonTable';
|
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
import { handleQuotePriceColor, handleSubcriteOnDemandQuote, quoteAmplitude, quoteAmplituOfVibration, quoteChange } from '@/common/setup/table/tableQuote';
|
|
import { handleQuotePriceColor, handleSubcriteOnDemandQuote, quoteAmplitude, quoteAmplituOfVibration, quoteChange } from '@/common/setup/table/tableQuote';
|
|
|
import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
|
|
import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
|
|
@@ -92,54 +69,60 @@ import { PropType, ref } from 'vue';
|
|
|
import Chart from './chart/index.vue';
|
|
import Chart from './chart/index.vue';
|
|
|
import { ComponentType } from './setup';
|
|
import { ComponentType } from './setup';
|
|
|
import StockExchange from './stock-exchange/index.vue';
|
|
import StockExchange from './stock-exchange/index.vue';
|
|
|
-
|
|
|
|
|
|
|
+import { handleModalComponent } from '@/common/setup/asyncComponent';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
- emits: ['cancel', 'update'],
|
|
|
|
|
- name: 'buy-sell-market',
|
|
|
|
|
- props: {
|
|
|
|
|
- selectedRow: {
|
|
|
|
|
- type: Object as PropType<QueryQuoteDayRsp>,
|
|
|
|
|
- default: {},
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ emits: ['cancel', 'update'],
|
|
|
|
|
+ name: 'buy-sell-market',
|
|
|
|
|
+ props: {
|
|
|
|
|
+ selectedRow: {
|
|
|
|
|
+ type: Object as PropType<QueryQuoteDayRsp>,
|
|
|
|
|
+ default: () => ({}),
|
|
|
},
|
|
},
|
|
|
- components: {
|
|
|
|
|
- Chart,
|
|
|
|
|
- LeftOutlined,
|
|
|
|
|
- StockExchange,
|
|
|
|
|
- },
|
|
|
|
|
- setup(props, context) {
|
|
|
|
|
- const loading = ref<boolean>(false);
|
|
|
|
|
- const { visible, cancel } = _closeModal(context);
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ components: {
|
|
|
|
|
+ Chart,
|
|
|
|
|
+ LeftOutlined,
|
|
|
|
|
+ StockExchange,
|
|
|
|
|
+ trade: defineAsyncComponent(() => import('@/views/market/futures/compoments/futures-trade/index.vue')), // 期货交易
|
|
|
|
|
+ },
|
|
|
|
|
+ setup(props, context) {
|
|
|
|
|
+ const loading = ref<boolean>(false);
|
|
|
|
|
+ const { visible, cancel } = _closeModal(context);
|
|
|
|
|
|
|
|
- const showComponentsId = ref<ComponentType>(ComponentType.chart);
|
|
|
|
|
|
|
+ const showComponentsId = ref<ComponentType>(ComponentType.chart);
|
|
|
|
|
|
|
|
- // 切换组件
|
|
|
|
|
- function changeComponent(type: ComponentType) {
|
|
|
|
|
- showComponentsId.value = type;
|
|
|
|
|
- }
|
|
|
|
|
- // 返回上层组件
|
|
|
|
|
- function cancelAction() {
|
|
|
|
|
- if (showComponentsId.value === ComponentType.chart) {
|
|
|
|
|
- cancel();
|
|
|
|
|
- } else {
|
|
|
|
|
- showComponentsId.value = ComponentType.chart;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return {
|
|
|
|
|
- cancel,
|
|
|
|
|
- visible,
|
|
|
|
|
- changeComponent,
|
|
|
|
|
- ComponentType,
|
|
|
|
|
- showComponentsId,
|
|
|
|
|
- cancelAction,
|
|
|
|
|
- handleSubcriteOnDemandQuote,
|
|
|
|
|
- handleQuotePriceColor,
|
|
|
|
|
- quoteChange,
|
|
|
|
|
- quoteAmplitude,
|
|
|
|
|
- quoteAmplituOfVibration,
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ const { componentId, closeComponent, openComponent } = handleModalComponent(() => { }, ref({}));
|
|
|
|
|
+
|
|
|
|
|
+ // 切换组件
|
|
|
|
|
+ function changeComponent(type: ComponentType) {
|
|
|
|
|
+ showComponentsId.value = type;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 返回上层组件
|
|
|
|
|
+ function cancelAction() {
|
|
|
|
|
+ if (showComponentsId.value === ComponentType.chart) {
|
|
|
|
|
+ cancel();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ showComponentsId.value = ComponentType.chart;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return {
|
|
|
|
|
+ cancel,
|
|
|
|
|
+ visible,
|
|
|
|
|
+ changeComponent,
|
|
|
|
|
+ ComponentType,
|
|
|
|
|
+ showComponentsId,
|
|
|
|
|
+ cancelAction,
|
|
|
|
|
+ handleSubcriteOnDemandQuote,
|
|
|
|
|
+ handleQuotePriceColor,
|
|
|
|
|
+ quoteChange,
|
|
|
|
|
+ quoteAmplitude,
|
|
|
|
|
+ quoteAmplituOfVibration,
|
|
|
|
|
+ componentId,
|
|
|
|
|
+ closeComponent,
|
|
|
|
|
+ openComponent,
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="less">
|
|
<style lang="less">
|