Jelajahi Sumber

现货市场 添加参考行情

huangbin 4 tahun lalu
induk
melakukan
b2a65af088

+ 231 - 0
src/views/market/market-spot/compoments/goods-chart/chart/index.less

@@ -0,0 +1,231 @@
+.chart-container {
+    [theme='light'] & {
+        --bgcolor            : #fff;
+        --tab-border-color   : #dae5ec;
+        --tab-checked-color  : #0866b8;
+        --tab-checked-bgcolor: #d4e0ff;
+        --slider-border-color: #b2c4dd;
+        --slider-bgcolor     : #edf2f7;
+        --slider-button-color: #b2c4dd;
+        --row-border-color   : #dae5ec;
+        --row-title-color    : #acb8c0;
+        --row-content-color  : #3c454b;
+        --tik-title-bgcolor  : #ECF2F5;
+        --tik-title-color    : #7A8A94;
+    }
+
+    display         : flex;
+    width           : 100%;
+    height          : calc(100% - 41px);
+    background-color: var(--bgcolor, #0e0e0f);
+
+    .chart-content {
+        display       : flex;
+        flex-direction: column;
+        flex          : 1;
+        height        : 100%;
+
+        &__main {
+            flex: 1;
+        }
+
+        &__header {
+            padding: 4px 0;
+        }
+
+        &__tabs {
+            &:last-child:not(:first-child) {
+                margin-left: 20px;
+            }
+
+            display         : inline-block;
+            background-color: transparent;
+            line-height     : normal;
+            border-bottom   : 0;
+            border          : 1px solid var(--tab-border-color, #22292c);
+            border-radius   : 1.02px;
+            border-right    : 0;
+            overflow        : hidden;
+            margin-top      : 0;
+
+            .ant-menu-item {
+                height       : 22px;
+                line-height  : 22px;
+                color        : #7a8a94;
+                border-bottom: 0;
+                border-right : 1px solid var(--tab-border-color, #22292c);
+                margin-top   : 0;
+                top          : 0;
+                padding      : 0 16px;
+
+                &::after {
+                    border: 0 !important;
+                }
+
+                &-active,
+                &-selected {
+                    color           : var(--tab-checked-color, #0866b8);
+                    background-color: var(--tab-checked-bgcolor, #0e2f4c);
+                }
+            }
+        }
+    }
+
+    .chart-slider {
+        display         : flex;
+        justify-content : center;
+        align-items     : center;
+        width           : 6px;
+        border-left     : 1px solid var(--slider-border-color, #33393d);
+        border-right    : 1px solid var(--slider-border-color, #33393d);
+        background-color: var(--slider-bgcolor, #0e0e0f);
+
+        &__button {
+            width           : 2px;
+            height          : 30px;
+            font-size       : 0;
+            background-color: var(--slider-button-color, #3c454b);
+            border-radius   : 1px;
+        }
+    }
+
+    .chart-tips {
+        display       : flex;
+        flex-direction: column;
+        width         : 300px;
+        height        : 100%;
+
+        &__nav {
+            display        : flex;
+            justify-content: center;
+            align-items    : center;
+
+            .content {
+                &:first-child:not(:last-child) {
+                    margin-right: 16px;
+                }
+
+                &--left {
+                    font-size: 16px;
+                    color    : var(--row-content-color, #ACB8C0);
+                }
+
+                &--right {
+                    font-size: 24px;
+                    color    : #fc9618;
+                }
+            }
+        }
+
+        &__last {
+            display        : flex;
+            justify-content: center;
+            align-items    : center;
+            padding        : 16px 0;
+
+            .content {
+                &--left {
+                    font-size   : 24px;
+                    margin-right: 16px;
+                }
+
+                &--right {
+                    display       : flex;
+                    flex-direction: column;
+                    align-items   : flex-start;
+                }
+            }
+        }
+
+        &__volume {
+            .ant-row {
+                border-top: 1px solid var(--row-border-color, #171B1D);
+                padding   : 8px;
+
+                .ant-col {
+                    text-align: left;
+
+                    &:first-child {
+                        color: var(--row-title-color, #3c454b);
+                    }
+
+                    &:last-child {
+                        color     : var(--row-title-color, #acb8c0);
+                        text-align: right;
+                    }
+                }
+            }
+        }
+
+        &__tik {
+            flex          : 1;
+            display       : flex;
+            flex-direction: column;
+            overflow-y    : auto;
+
+            .ant-row {
+                padding: 0 8px;
+
+                .ant-col {
+                    text-align: right;
+
+                    &:first-child {
+                        text-align: left;
+                    }
+                }
+            }
+
+            .row-header {
+                h4 {
+                    text-align      : left;
+                    line-height     : 30px;
+                    color           : var(--tik-title-color, #7A8A94);
+                    background-color: var(--tik-title-bgcolor, #171B1D);
+                    padding         : 0 8px;
+                }
+
+                .ant-row {
+                    .ant-col {
+                        color: var(--row-title-color, #3c454b);
+                    }
+                }
+            }
+
+            .row-content {
+                flex      : 1;
+                overflow-y: auto;
+
+                .ant-row {
+                    margin-top: 4px;
+
+                    .ant-col {
+                        color: var(--row-content-color, #ACB8C0);
+                    }
+                }
+            }
+        }
+
+        &__info {
+            border-top: 1px solid var(--row-border-color, #171B1D);
+            padding   : 8px 8px 8px 0;
+
+            .ant-row {
+                margin-top: 4px;
+
+                .ant-col {
+                    text-align: left;
+
+                    &:nth-child(odd) {
+                        color       : var(--row-title-color, #3c454b);
+                        padding-left: 8px;
+                    }
+
+                    &:nth-child(even) {
+                        color     : var(--row-content-color, #ACB8C0);
+                        text-align: right;
+                    }
+                }
+            }
+        }
+    }
+}

+ 256 - 0
src/views/market/market-spot/compoments/goods-chart/chart/index.vue

@@ -0,0 +1,256 @@
+<template>
+  <!-- 交易图表  -->
+  <div class="chart-container">
+    <div class="chart-content">
+      <div class="chart-content__header">
+        <a-menu class="chart-content__tabs" v-model:selectedKeys="activeCycleName" mode="horizontal" @click="changeCycleType">
+          <a-menu-item v-for="item in chartType" :key="item.name">{{ item.label }}</a-menu-item>
+        </a-menu>
+        <a-menu class="chart-content__tabs" v-model:selectedKeys="activeSeriesType" mode="horizontal" v-if="activeCycleType !== CycleType.time">
+          <a-menu-item key="MACD">MACD</a-menu-item>
+          <a-menu-item key="VOL">VOL</a-menu-item>
+          <a-menu-item key="KDJ">KDJ</a-menu-item>
+          <a-menu-item key="CCI">CCI</a-menu-item>
+        </a-menu>
+      </div>
+      <echart-time class="chart-content__main" :quote-data="selectedRow" @change="getHistoryTikDatas" v-if="activeCycleType === CycleType.time"></echart-time>
+      <echart-kline class="chart-content__main" :quote-data="selectedRow" :cycle-type="activeCycleType" :series-type="activeSeriesType[0]" v-else></echart-kline>
+      <div class="chart-content__footer"></div>
+    </div>
+    <div class="chart-slider">
+      <div class="chart-slider__button"></div>
+    </div>
+    <div class="chart-tips" v-if="showExchange">
+      <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', handleQuotePriceColor(selectedRow.last, selectedRow.presettle)]">{{ handleNoneValue(selectedRow.last) }}</div>
+          <div class="content content--right">
+            <span :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">{{ quoteChange(selectedRow) }}</span>
+            <span :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">{{ quoteAmplitude(selectedRow) }}</span>
+          </div>
+        </div>
+        <div class="chart-tips__volume">
+          <a-row>
+            <a-col :span="8">卖一</a-col>
+            <a-col :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)" :span="8">{{ handleNoneValue(selectedRow.ask) }}</a-col>
+            <a-col :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)" :span="8">{{ handleNoneValue(selectedRow.askvolume) }}</a-col>
+          </a-row>
+          <a-row>
+            <a-col :span="8">买一</a-col>
+            <a-col :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)" :span="8">{{ handleNoneValue(selectedRow.bid) }}</a-col>
+            <a-col :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)" :span="8">{{ handleNoneValue(selectedRow.bidvolume) }}</a-col>
+          </a-row>
+        </div>
+      </div>
+      <div class="chart-tips__tik">
+        <div class="row-header">
+          <h4>分时成交</h4>
+          <a-row>
+            <a-col :span="8">时间</a-col>
+            <a-col :span="8">价格</a-col>
+            <a-col :span="8">现量</a-col>
+          </a-row>
+        </div>
+        <div class="row-content">
+          <a-row v-for="(item, index) in tradedList" :key="index + '11'">
+            <a-col :span="8">{{ formatTime(item.TS, 'hm') }}</a-col>
+            <a-col :class="handleQuotePriceColor(item.PE, selectedRow.presettle)" :span="8">{{ item.PE }}</a-col>
+            <a-col :class="handleQuotePriceColor(item.Vol, selectedRow.presettle)" :span="8">{{ item.Vol }}</a-col>
+          </a-row>
+        </div>
+      </div>
+      <div class="chart-tips__info">
+        <a-row>
+          <a-col :span="4">最新</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)" :span="8">{{ handleNoneValue(selectedRow.last) }}</a-col>
+          <a-col :span="4">均价</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.averageprice, selectedRow.presettle)" :span="8">{{ handleNoneValue(selectedRow.averageprice) }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">涨跌</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)" :span="8">{{ quoteChange(selectedRow) }}</a-col>
+          <a-col :span="4">今开</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.opened, selectedRow.presettle)" :span="8">{{ handleNoneValue(selectedRow.opened) }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">涨幅</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)" :span="8">{{ quoteAmplitude(selectedRow) }}</a-col>
+          <a-col :span="4">最高</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.highest, selectedRow.presettle)" :span="8">{{ handleNoneValue(selectedRow.highest) }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">总量</a-col>
+          <a-col :span="8">{{ handleNoneValue(selectedRow.totalvolume) }}</a-col>
+          <a-col :span="4">最低</a-col>
+          <a-col :class="handleQuotePriceColor(selectedRow.lowest, selectedRow.presettle)" :span="8">{{ handleNoneValue(selectedRow.lowest) }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">金额</a-col>
+          <a-col :span="8" style="color: #0d96ff">{{ changeUnit(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 class="red1" :span="8">{{ handleNoneValue(selectedRow.limitup) }}</a-col>
+          <a-col :span="4">跌停</a-col>
+          <a-col class="green" :span="8">{{ handleNoneValue(selectedRow.limitdown) }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">外盘</a-col>
+          <a-col :span="8">{{ handleNoneValue(selectedRow.totalbidvolume) }}</a-col>
+          <a-col :span="4">内盘</a-col>
+          <a-col :span="8">{{ handleNoneValue(selectedRow.totalaskvolume) }}</a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="4">持仓</a-col>
+          <a-col :span="8">{{ handleNoneValue(selectedRow.holdvolume) }}</a-col>
+          <a-col :span="4">结算</a-col>
+          <a-col :span="8">{{ handleNoneValue(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">{{ handleNoneValue(selectedRow.presettle) }}</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">
+        <strong>查看更多</strong>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent } from '@/common/export/commonTable';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { PropType, ref, watch } from 'vue';
+import { QueryQuoteDayRsp, QueryHistoryTikDatasRsp, CycleType } from '@/services/go/quote/interface';
+import { QueryHistoryTikDatas } from '@/services/go/quote';
+import { formatTime } from '@/common/methods';
+import { changeUnit } from '@/utils/qt/common';
+import { ComponentType } from '@/views/market/spot_trade/spot_trade_order_transaction/setup';
+import { EchartKline, EchartTime } from '@/common/components/echart';
+import { handleQuotePriceColor, quoteChange, handleNoneValue, quoteAmplitude } from '@/common/setup/table/tableQuote';
+import moment from 'moment';
+
+export default defineComponent({
+    emits: ['cancel', 'update'],
+    name: 'stock-exchange',
+    components: {
+        EchartKline,
+        EchartTime,
+    },
+    props: {
+        selectedRow: {
+            type: Object as PropType<QueryQuoteDayRsp>,
+            default: {},
+        },
+        showExchange: {
+            type: Boolean,
+            default: true,
+        },
+    },
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context),
+            activeCycleName = ref<string[]>(['time']),
+            activeCycleType = ref<CycleType>(CycleType.time),
+            activeSeriesType = ref<string[]>(['MACD']),
+            tradedList = ref<QueryHistoryTikDatasRsp[]>([]);
+
+        function watchMore() {
+            context.emit('update', ComponentType.marketContent);
+        }
+
+        // 周期类型
+        const chartType = [
+            { label: '分时', name: 'time', value: CycleType.time },
+            { label: '1分钟', name: 'minutes', value: CycleType.minutes },
+            { label: '5分钟', name: 'minutes5', value: CycleType.minutes5 },
+            { label: '30分钟', name: 'minutes30', value: CycleType.minutes30 },
+            { label: '60分钟', name: 'minutes60', value: CycleType.minutes60 },
+            { label: '4小时', name: 'Hours4', value: CycleType.Hours4 },
+            { label: '日 K', name: 'days', value: CycleType.days },
+        ];
+
+        // 切换图表周期类型
+        const changeCycleType = (e: { key: string }) => {
+            activeCycleType.value = chartType.find((item) => item.name === e.key)!.value;
+        };
+
+        // Tik列表
+        const getHistoryTikDatas = (startTime: string, endTime: string) => {
+            const param = {
+                goodsCode: props.selectedRow.goodscode.toUpperCase(),
+                count: 20,
+                startTime: moment(startTime).format('YYYY-MM-DD HH:mm:ss'),
+                endTime: moment(endTime).format('YYYY-MM-DD HH:mm:ss'),
+            };
+            QueryHistoryTikDatas(param).then((res) => {
+                tradedList.value = res;
+            });
+        };
+
+        // 监听行情变化刷Tik列表
+        watch(
+            () => props.selectedRow.last,
+            () => {
+                if (tradedList.value.length > 19) {
+                    // 移除列表最后一条记录
+                    tradedList.value.pop();
+                }
+                // 向列表开头添加新纪录
+                tradedList.value.unshift({
+                    AV: 0,
+                    Ask: 0,
+                    BV: 0,
+                    Bid: 0,
+                    HI: 0,
+                    HV: 0,
+                    PE: props.selectedRow.last,
+                    TDR: 0,
+                    TK: 0,
+                    TS: props.selectedRow.lasttime,
+                    TT: 0,
+                    Vol: props.selectedRow.lastvolume,
+                });
+            }
+        );
+
+        return {
+            cancel,
+            visible,
+            chartType,
+            tradedList,
+            CycleType,
+            activeCycleName,
+            activeCycleType,
+            activeSeriesType,
+            changeUnit,
+            watchMore,
+            formatTime,
+            quoteChange,
+            handleNoneValue,
+            quoteAmplitude,
+            handleQuotePriceColor,
+            changeCycleType,
+            getHistoryTikDatas,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 163 - 0
src/views/market/market-spot/compoments/goods-chart/index.vue

@@ -0,0 +1,163 @@
+<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>
+      <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="btn-list">
+        <a-button class="operBtn" @click="openComponent({ code: 'trade' })">交易</a-button>
+      </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>
+
+<script lang="ts">
+import { defineComponent, defineAsyncComponent } from '@/common/export/commonTable';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { handleQuotePriceColor, handleSubcriteOnDemandQuote, quoteAmplitude, quoteAmplituOfVibration, quoteChange } from '@/common/setup/table/tableQuote';
+import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
+import { LeftOutlined } from '@ant-design/icons-vue';
+import { PropType, ref } from 'vue';
+import Chart from './chart/index.vue';
+import { ComponentType } from './setup';
+import StockExchange from './stock-exchange/index.vue';
+import { handleModalComponent } from '@/common/setup/asyncComponent';
+
+export default defineComponent({
+  emits: ['cancel', 'update'],
+  name: 'buy-sell-market',
+  props: {
+    selectedRow: {
+      type: Object as PropType<QueryQuoteDayRsp>,
+      default: () => ({}),
+    },
+  },
+  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 { 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>
+<style lang="less">
+.valNums {
+    .flex;
+    flex-direction: column;
+    padding-left: 20px;
+    .firstNum {
+        font-size: 18px;
+        line-height: 18px;
+        font-weight: 400;
+    }
+    .lastNum {
+        margin-top: 2px;
+        display: inline-flex;
+        font-size: 12px;
+        line-height: 12px;
+        font-weight: 300;
+    }
+}
+.inlineBar {
+    display: inline-flex;
+}
+.priceBar {
+    .flex;
+    flex-direction: column;
+    height: 32px;
+    .greenBar,
+    .redBar {
+        height: 16px;
+        line-height: 16px;
+    }
+}
+.start {
+    align-self: flex-start !important;
+    align-items: flex-start !important;
+}
+</style>

+ 4 - 0
src/views/market/market-spot/compoments/goods-chart/setup.ts

@@ -0,0 +1,4 @@
+export enum ComponentType {
+    chart,
+    tradeDetail,
+}

+ 94 - 0
src/views/market/market-spot/compoments/goods-chart/stock-exchange/index.vue

@@ -0,0 +1,94 @@
+<template>
+  <!-- 成交明细  -->
+  <a-row>
+    <a-col :span="8">
+      <a-table :columns="columnsList" class="srcollYTable" :pagination="false" :loading="loading" :rowKey="(record,index)=>index" ref="tableRef" :data-source="tableList[0]">
+      </a-table>
+    </a-col>
+    <a-col :span="8">
+      <a-table :columns="columnsList" class="srcollYTable" :pagination="false" :loading="loading" :rowKey="(record,index)=>index" ref="tableRef" :data-source="tableList[1]">
+      </a-table>
+    </a-col>
+    <a-col :span="8">
+      <a-table :columns="columnsList" class="srcollYTable" :pagination="false" :loading="loading" :rowKey="(record,index)=>index" ref="tableRef" :data-source="tableList[2]">
+      </a-table>
+    </a-col>
+  </a-row>
+</template>
+
+<script lang="ts">
+import { defineAsyncComponent, defineComponent } from '@/common/export/commonTable';
+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 { QueryHistoryTikDatas } from '@/services/go/quote';
+import { formatTime } from '@/common/methods';
+
+const columnsList = [
+  { title: '时间', key: 'TS', dataIndex: 'TS', align: 'center' },
+  { title: '成交价', key: 'Vol', dataIndex: 'Vol', align: 'center' },
+  { title: '成交量', key: 'PE', dataIndex: 'PE', align: 'center' },
+];
+
+export default defineComponent({
+  emits: ['cancel', 'update'],
+  name: 'stock-exchange',
+  props: {
+    selectedRow: {
+      type: Object as PropType<QueryQuoteDayRsp>,
+      default: {},
+    },
+  },
+
+  setup(props, context) {
+    const loading = ref<boolean>(false);
+    const { visible, cancel } = _closeModal(context);
+    const param = {
+      goodsCode: props.selectedRow.goodscode,
+    };
+    const tableList = ref<QueryHistoryTikDatasRsp[][]>([]);
+    QueryHistoryTikDatas(param).then((res) => {
+      res.forEach((el) => (el.TS = formatTime(el.TS)));
+      tableList.value = getHisList(res);
+    });
+    function getHisList(list: QueryHistoryTikDatasRsp[]) {
+      const len = list.length;
+      const result: QueryHistoryTikDatasRsp[][] = [[], [], []];
+      if (len) {
+        if (len === 1) {
+          result[0] = list;
+        } else if (len === 2) {
+          result[0].push(list[0]);
+          result[1].push(list[1]);
+        } else {
+          const temp = Math.floor(len / 3);
+          result[0] = list.slice(0, temp);
+          result[1] = list.slice(temp, 2 * temp);
+          result[2] = list.slice(temp * 2, temp * 3);
+          const last = len - temp;
+          if (last) {
+            if (last === 1) {
+              result[0].push(list[len - 1]);
+            } else {
+              result[0].push(list[len - 2]);
+              result[1].push(list[len - 1]);
+            }
+          }
+        }
+      }
+      return result;
+    }
+    return {
+      cancel,
+      visible,
+      tableList,
+      columnsList,
+      loading,
+    };
+  },
+});
+</script>
+<style lang="less">
+</style>

+ 9 - 16
src/views/market/market-spot/compoments/spot_trade_reference_market/index.vue

@@ -88,8 +88,6 @@
                 >{{ handleNoneValue(text) }}</span>
             </template>
         </a-table>
-        <!-- 右键 -->
-        <!-- <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="firstBtn"></contextMenu> -->
         <component
             :is="componentId"
             v-if="componentId"
@@ -104,8 +102,10 @@
 import { getShowBottomValue } from '@/common/config/constrolBottom';
 import { TradeMode } from '@/common/constants/enumCommon';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
-import { ComposeTableParam, contextMenu, defineComponent, queryTableList } from '@/common/export/commonTable';
+import { contextMenu, defineComponent, queryTableList } from '@/common/export/commonTable';
 import { handleTableColums } from '@/common/setup/table/clolumn';
+import { handleTableEventAndData } from '@/common/setup/table/compose';
+import { TableParam } from '@/common/setup/table/interface';
 import { handleNoneValue, handleQuotePriceColor, handleSubcriteOnDemandQuote, quoteAmplitude, quoteAmplituOfVibration, quoteChange } from '@/common/setup/table/tableQuote';
 import { getQutoGoodsByTradeMode } from '@/services/bus/goods';
 import { QueryDeliveryRelationRsp } from '@/services/go/delivery/interface';
@@ -113,8 +113,7 @@ import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
 import { queryOrderQuote } from '@/services/go/wrtrade';
 import { QueryOrderQuoteReq } from '@/services/go/wrtrade/interface';
 import { changeUnit } from '@/utils/qt/common';
-import { handleComposeTable } from '@/views/market/spot_trade/setup';
-import { ref } from 'vue';
+import { defineAsyncComponent, ref } from 'vue';
 
 const columnsList = [
     { title: '序号', key: 'index', width: 80 },
@@ -144,10 +143,7 @@ export default defineComponent({
     name: EnumRouterName.spot_trade_reference_market,
     components: {
         contextMenu,
-        // [ModalEnum.spot_trade_warehouse_detail]: defineAsyncComponent(() => import('../../components/detail/index.vue')),
-        // [ModalEnum.spot_trade_warehouse_post_buying]: defineAsyncComponent(() => import('../../components/post_buying/index.vue')),
-        // buyAndSell: defineAsyncComponent(() => import('../components/goods-chart/index.vue')),
-        // postBuying: defineAsyncComponent(() => import('../../components/post_buying/index.vue')),
+        chart: defineAsyncComponent(() => import('../goods-chart/index.vue')),
     },
     setup() {
         const isBottom = getShowBottomValue();
@@ -168,17 +164,14 @@ export default defineComponent({
             };
             queryTable(queryOrderQuote, param);
         };
-        // 表格通用逻辑
-        const param: ComposeTableParam = {
+        const param: TableParam = {
+            columnsList,
             queryFn: queryTableAction,
-            menuType: EnumRouterName.warehouse_receipt_trade_price,
-            tableName: 'table_pcweb_spot_trade_warehouse_price',
-            tableFilterKey: [],
-            isDetail: false,
+            clickName: 'chart'
         };
         return {
             isBottom,
-            ...handleComposeTable<QueryDeliveryRelationRsp>(param),
+            ...handleTableEventAndData(param),
             loading,
             tableList,
             goodsList,

+ 1 - 1
src/views/market/market-spot/compoments/warehouse_receipt_trade/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <!-- 仓单贸 -->
+    <!-- 仓单贸 -->
     <div class="topTableHeight">
         <!-- <Filter :enumName="name" @search="search" @buy="buyOpen" /> -->
         <a-table