huangbin 4 سال پیش
والد
کامیت
65fe743610

+ 1 - 1
src/services/go/quote/index.ts

@@ -15,7 +15,7 @@ export function QueryHistoryDatas(param: type.QueryHistoryDatas): Promise<type.Q
  * @param param QueryHistoryTikDatas
  * @returns QueryHistoryTikDatasRsp
  */
-export function QueryHistoryTikDatas(param: type.QueryHistoryTikDatas): Promise<type.QueryHistoryTikDatasRsp> {
+export function QueryHistoryTikDatas(param: type.QueryHistoryTikDatas): Promise<type.QueryHistoryTikDatasRsp[]> {
     return commonSearch_go('/Quote/QueryHistoryTikDatas', param)
 }
 

+ 5 - 3
src/views/market/spot_trade/spot_trade_order_transaction/components/buy-market/index.vue

@@ -29,6 +29,7 @@
   <component :is="componentId"
              v-if="componentId"
              :selectedRow="selectedRow"
+             :parantSelectedRow="parantSelectedRow"
              :buyOrSell="BuyOrSell.buy"
              @cancel="closeComponent"></component>
 </template>
@@ -47,13 +48,14 @@ import { ColumnType } from '@/common/methods/table/interface';
 import { getShowBottomValue } from '@/common/config/constrolBottom';
 import { TableParam } from '@/common/setup/table/interface';
 import { handleTableEventAndData } from '@/common/setup/table/compose';
+import { QueryDeliveryRelationRsp } from '@/services/go/delivery/interface';
 
 export default defineComponent({
     emits: ['cancel', 'openComponent'],
     name: 'warehouse_receipt_trade_price_delisting_buy',
     props: {
-        selectedRow: {
-            type: Object as PropType<WrOrderQuote>,
+        parantSelectedRow: {
+            type: Object as PropType<QueryDeliveryRelationRsp>,
             default: {},
         },
     },
@@ -77,7 +79,7 @@ export default defineComponent({
         const queryTableAction = () => {
             const param: WrTradeOrderDetailReq = {
                 buyorsell: 0,
-                goodsid: props.selectedRow.goodsid,
+                goodsid: props.parantSelectedRow.goodsid,
             };
             queryTable(queryWrTradeOrderDetail, param);
         };

+ 0 - 141
src/views/market/spot_trade/spot_trade_order_transaction/components/buy-sell-market/components/buy/index.vue

@@ -1,141 +0,0 @@
-<template>
-    <!--  现货贸易 - 买卖大厅 - 卖报价牌 -->
-    <a-table
-        :columns="handleColumn(columns)"
-        :class="['buyHallTable', isBottom ? '' : 'buyHallTableHigh', tableList.length ? '' : 'noDataTable']"
-        :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 470px)' : 'calc(100vh - 145px)' }"
-        :pagination="false"
-        :loading="loading"
-        :expandedRowKeys="expandedRowKeys"
-        :customRow="Rowclick"
-        :expandIcon="expandIcon"
-        :expandIconAsCell="false"
-        rowKey="key"
-        :data-source="tableList"
-    >
-        <!-- ,  -->
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{ record }">
-            <BtnList
-                :btnList="btnList"
-                :record="record"
-                class="btn-list-sticky"
-                @click="openComponent"
-            />
-        </template>
-        <template #username="{text, record }">
-            <span>{{record.userid + " "}}{{text}}</span>
-        </template>
-    </a-table>
-    <component
-        :is="componentId"
-        v-if="componentId"
-        :selectedRow="selectedRow"
-        :buyOrSell="BuyOrSell.buy"
-        :enumName="enumName"
-        :parantSelectedRow="parantSelectedRow"
-        @cancel="closeComponent"
-    ></component>
-</template>
-
-<script lang="ts">
-import { EnumRouterName } from '@/common/constants/enumRouterName';
-import { ComposeTableParam, BtnList, defineComponent, handleComposeTable, queryTableList, ModalEnum } from '@/common/export/commonTable';
-import { _closeModal } from '@/common/setup/modal/modal';
-import { queryOrderQuoteDetail } from '@/services/go/wrtrade';
-import { QueryOrderQuoteDetailReq, WrOrderQuote, WrOrderQuoteDetail } from '@/services/go/wrtrade/interface';
-import { defineAsyncComponent, PropType } from 'vue';
-import { BtnList as btnListType } from '@/common/components/btnList/interface';
-import { getBuyMarketParam } from '../../setup';
-import { BuyOrSell } from '@/common/constants/enumCommon';
-import { expandIcon } from '@/common/setup/table/clolumn';
-import { ColumnType } from '@/common/methods/table/interface';
-import { Moment } from 'moment';
-import moment from 'moment';
-import { getShowBottomValue } from '@/common/config/constrolBottom';
-
-export default defineComponent({
-    emits: ['cancel', 'openComponent'],
-    name: 'warehouse_receipt_trade_price_delisting_buy',
-    props: {
-        enumName: {
-            default: '',
-            type: String as PropType<EnumRouterName>,
-        },
-        btnList: {
-            default: [],
-            type: Array as PropType<btnListType[]>,
-        },
-        parantSelectedRow: {
-            type: Object as PropType<WrOrderQuote>,
-            default: {},
-        },
-        time: {
-            type: Object as PropType<Moment>,
-            default: moment(),
-        },
-    },
-    components: {
-        BtnList,
-        [ModalEnum.spot_trade_warehouse_delisting]: defineAsyncComponent(() => import('../delisting/index.vue')),
-    },
-    setup(props, context) {
-        const isBottom = getShowBottomValue();
-        console.log(isBottom.value, 'isBottom');
-        // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<WrOrderQuoteDetail>();
-        const { wrpricetype, haswr, tableKey } = getBuyMarketParam(props.enumName);
-        // 获取列表数据
-        const queryTableAction = () => {
-            const param: QueryOrderQuoteDetailReq = {
-                buyorsell: 0,
-                wrpricetype,
-                haswr,
-                wrfactortypeid: props.parantSelectedRow.wrfactortypeid,
-                goodsid: props.parantSelectedRow.goodsid,
-            };
-            if (!haswr) {
-                // 无仓单 需要交收月过滤数据
-                param.deliverymonth = moment(props.time).format('YYYY-MM');
-            }
-            queryTable(queryOrderQuoteDetail, param);
-        };
-        // 表格通用逻辑
-        const param: ComposeTableParam = {
-            queryFn: queryTableAction,
-            menuType: props.enumName,
-            tableName: tableKey,
-            tableFilterKey: [],
-            isDetail: false,
-        };
-        function handleColumn(columns: ColumnType[]) {
-            columns.forEach((item) => {
-                if (item.dataIndex == 'username') {
-                    delete item.width;
-                }
-            });
-            return columns;
-        }
-        function handleBtnList() {}
-        return {
-            isBottom,
-            ...handleComposeTable<WrOrderQuoteDetail>(param),
-            queryTableAction,
-            BuyOrSell,
-            loading,
-            tableList,
-            enumName: props.enumName,
-            expandIcon,
-            handleColumn,
-        };
-    },
-});
-</script>
-<style lang="less">
-.buy-sell-market {
-    .btnDeafault.ant-btn {
-        height: 28px;
-        line-height: 28px;
-    }
-}
-</style>

+ 3 - 3
src/views/market/spot_trade/spot_trade_order_transaction/components/buy-sell-market/index.vue

@@ -37,16 +37,16 @@
     <a-row class="buySellHall">
       <a-col :span="12">
         <Sell ref="sellRef"
-              :selectedRow="deliverGoods" />
+              :parantSelectedRow="deliverGoods" />
       </a-col>
       <a-col :span="12">
         <Buy ref="buyRef"
-             :selectedRow="deliverGoods" />
+             :parantSelectedRow="deliverGoods" />
       </a-col>
     </a-row>
     <component :is="componentId"
                v-if="componentId"
-               :selectedRow="selectedRow"
+               :selectedRow="deliverGoods"
                :parantSelectedRow="deliverGoods"
                @cancel="closeComponent"></component>
   </div>

+ 5 - 3
src/views/market/spot_trade/spot_trade_order_transaction/components/sell-market/index.vue

@@ -27,6 +27,7 @@
   <component :is="componentId"
              v-if="componentId"
              :selectedRow="selectedRow"
+             :parantSelectedRow="parantSelectedRow"
              :buyOrSell="BuyOrSell.sell"
              @cancel="closeComponent"></component>
 </template>
@@ -44,13 +45,14 @@ import { ColumnType } from '@/common/methods/table/interface';
 import { getShowBottomValue } from '@/common/config/constrolBottom';
 import { TableParam } from '@/common/setup/table/interface';
 import { handleTableEventAndData } from '@/common/setup/table/compose';
+import { QueryDeliveryRelationRsp } from '@/services/go/delivery/interface';
 
 export default defineComponent({
     emits: ['cancel', 'openComponent'],
     name: 'warehouse_receipt_trade_price_delisting_sell',
     props: {
-        selectedRow: {
-            type: Object as PropType<WrOrderQuote>,
+        parantSelectedRow: {
+            type: Object as PropType<QueryDeliveryRelationRsp>,
             default: {},
         },
     },
@@ -75,7 +77,7 @@ export default defineComponent({
         const queryTableAction = () => {
             const param: WrTradeOrderDetailReq = {
                 buyorsell: 1,
-                goodsid: props.selectedRow.goodsid,
+                goodsid: props.parantSelectedRow.goodsid,
             };
             queryTable(queryWrTradeOrderDetail, param);
         };

+ 114 - 0
src/views/market/spot_trade/spot_trade_order_transaction/components/stock-exchange/index.vue

@@ -0,0 +1,114 @@
+<template>
+  <!-- 成交明细  -->
+  <a-row class="buySellHall">
+    <a-col :span="8">
+      <a-table :columns="columnsList"
+               class="srcollYTable"
+               :pagination="false"
+               :loading="loading"
+               rowKey="key"
+               ref="tableRef"
+               :data-source="tableList[0]">
+      </a-table>
+    </a-col>
+    <a-col :span="12">
+      <a-table :columns="columnsList"
+               class="srcollYTable"
+               :pagination="false"
+               :loading="loading"
+               rowKey="key"
+               ref="tableRef"
+               :data-source="tableList[1]">
+      </a-table>
+    </a-col>
+    <a-col :span="12">
+      <a-table :columns="columnsList"
+               class="srcollYTable"
+               :pagination="false"
+               :loading="loading"
+               rowKey="key"
+               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';
+
+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: {},
+        },
+        deliverGoods: {
+            type: Object as PropType<QueryDeliveryRelationRsp>,
+            default: {},
+        },
+    },
+
+    setup(props, context) {
+        const loading = ref<boolean>(false);
+        const { visible, cancel } = _closeModal(context);
+        const param = {
+            goodsCode: props.deliverGoods.goodscode,
+        };
+        const tableList = ref<QueryHistoryTikDatasRsp[][]>([]);
+        QueryHistoryTikDatas(param).then((res) => {
+            tableList.value = getHisList(res);
+        });
+        function getHisList(list: QueryHistoryTikDatasRsp[]) {
+            const len = list.length;
+            const result: QueryHistoryTikDatasRsp[][] = [[], [], []];
+            if (len) {
+                if (len === 1) {
+                    result[1] = list;
+                } else if (len === 2) {
+                    result[1].push(list[0]);
+                    result[2].push(list[1]);
+                } else {
+                    const temp = Math.floor(len / 3);
+                    result[1] = list.slice(0, temp);
+                    result[2] = list.slice(temp, 2 * temp);
+                    result[3] = 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>