Ver código fonte

Merge branch 'mtp_v6' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB into mtp_v6

li.shaoyi 4 anos atrás
pai
commit
5382ea9841

+ 1 - 0
src/services/go/quote/interface.ts

@@ -177,6 +177,7 @@ export interface QueryQuoteDayRsp {
     exchangecode: number;
     exchangedate: number;
     goodscode: string;
+    refgoodscode?: string;
     grepmarketprice: number;
     highest: number;
     holdincrement: number;

+ 187 - 58
src/services/socket/quota/adapter/index.ts

@@ -4,12 +4,11 @@ import { geLoginID_number, isLogin } from '@/services/bus/login';
 import { getToken } from '@/services/bus/token';
 import { funCode } from '@/services/funcode/index';
 import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
-import { mergeObj } from '@/utils/objHandle';
 import { Package40 } from '@/utils/websocket/package';
 import Long from 'long';
+import moment from 'moment';
 import { SubscribeInfoType } from '../interface';
 import { byteArrayToUInt, subscribeInfosToByteArrary } from './byteUtils';
-import moment from 'moment';
 
 /**
  * 构建行情订阅请求包
@@ -123,82 +122,212 @@ export function parseReceivePush(quotationData: any) {
             setQuoteTikFieldByByte(goodsQuoteTik, key, value);
         }
         const quoteDayInfo = APP.getRef('quoteDayInfo');
-        const itemQuote = quoteDayInfo.value.find((el: QueryQuoteDayRsp) => el.goodscode === goodsQuoteTik.goodscode);
+        const itemQuote = quoteDayInfo.value.find((el: QueryQuoteDayRsp) => {
+            const goodcode = el.refgoodscode || el.goodscode
+            // console.log(el.goodscode, el.refgoodscode, goodsQuoteTik.goodscode)
+            return goodcode === goodsQuoteTik.goodscode
+        });
         if (itemQuote) {
             const goods = getGoodsByCode(itemQuote.goodscode);
             if (goods) {
+                // console.log('goodsQuoteTik', goodsQuoteTik)
                 // 处理报价小数为
                 const decimalplace = goods.decimalplace
                 const num = Math.pow(10, decimalplace)
                 const fn = (value: number) => +(value / num).toFixed(decimalplace)
-                goodsQuoteTik.decimalplace = decimalplace
-                goodsQuoteTik.last = goodsQuoteTik.last ? fn(goodsQuoteTik.last) : '--'
-                // goodsQuoteTik.presettle = goodsQuoteTik.presettle ? (fn(goodsQuoteTik.presettle)) : '--'
-                goodsQuoteTik.ask = goodsQuoteTik.ask ? (fn(goodsQuoteTik.ask)) : '--'
-                goodsQuoteTik.ask2 = goodsQuoteTik.ask2 ? (fn(goodsQuoteTik.ask2)) : '--'
-                goodsQuoteTik.ask3 = goodsQuoteTik.ask3 ? (fn(goodsQuoteTik.ask3)) : '--'
-                goodsQuoteTik.ask4 = goodsQuoteTik.ask4 ? (fn(goodsQuoteTik.ask4)) : '--'
-                goodsQuoteTik.ask5 = goodsQuoteTik.ask5 ? (fn(goodsQuoteTik.ask5)) : '--'
-                goodsQuoteTik.ask6 = goodsQuoteTik.ask6 ? (fn(goodsQuoteTik.ask6)) : '--'
-                goodsQuoteTik.ask7 = goodsQuoteTik.ask7 ? (fn(goodsQuoteTik.ask7)) : '--'
-                goodsQuoteTik.ask8 = goodsQuoteTik.ask8 ? (fn(goodsQuoteTik.ask8)) : '--'
-                goodsQuoteTik.ask9 = goodsQuoteTik.ask9 ? (fn(goodsQuoteTik.ask9)) : '--'
-                goodsQuoteTik.ask10 = goodsQuoteTik.ask10 ? (fn(goodsQuoteTik.ask10)) : '--'
-                goodsQuoteTik.bid = goodsQuoteTik.bid ? (fn(goodsQuoteTik.bid)) : '--'
-                goodsQuoteTik.bid2 = goodsQuoteTik.bid2 ? (fn(goodsQuoteTik.bid2)) : '--'
-                goodsQuoteTik.bid3 = goodsQuoteTik.bid3 ? (fn(goodsQuoteTik.bid3)) : '--'
-                goodsQuoteTik.bid4 = goodsQuoteTik.bid4 ? (fn(goodsQuoteTik.bid4)) : '--'
-                goodsQuoteTik.bid5 = goodsQuoteTik.bid5 ? (fn(goodsQuoteTik.bid5)) : '--'
-                goodsQuoteTik.bid6 = goodsQuoteTik.bid6 ? (fn(goodsQuoteTik.bid6)) : '--'
-                goodsQuoteTik.bid7 = goodsQuoteTik.bid7 ? (fn(goodsQuoteTik.bid7)) : '--'
-                goodsQuoteTik.bid8 = goodsQuoteTik.bid8 ? (fn(goodsQuoteTik.bid8)) : '--'
-                goodsQuoteTik.bid9 = goodsQuoteTik.bid9 ? (fn(goodsQuoteTik.bid9)) : '--'
-                goodsQuoteTik.bid10 = goodsQuoteTik.bid10 ? (fn(goodsQuoteTik.bid10)) : '--'
-                goodsQuoteTik.averageprice = goodsQuoteTik.averageprice ? (fn(goodsQuoteTik.averageprice)) : '--'
-                goodsQuoteTik.grepmarketprice = goodsQuoteTik.grepmarketprice ? (fn(goodsQuoteTik.grepmarketprice)) : '--'
-                goodsQuoteTik.highest = goodsQuoteTik.highest ? (fn(goodsQuoteTik.highest)) : '--'
-                goodsQuoteTik.iep = goodsQuoteTik.iep ? (fn(goodsQuoteTik.iep)) : '--'
-                goodsQuoteTik.limitdown = goodsQuoteTik.limitdown ? (fn(goodsQuoteTik.limitdown)) : '--'
-                goodsQuoteTik.limitup = goodsQuoteTik.limitup ? (fn(goodsQuoteTik.limitup)) : '--'
-                goodsQuoteTik.lowest = goodsQuoteTik.lowest ? (fn(goodsQuoteTik.lowest)) : '--'
-                goodsQuoteTik.opened = goodsQuoteTik.opened ? (fn(goodsQuoteTik.opened)) : '--'
-                goodsQuoteTik.preclose = goodsQuoteTik.preclose ? (fn(goodsQuoteTik.preclose)) : '--'
-                goodsQuoteTik.settle = goodsQuoteTik.settle ? (fn(goodsQuoteTik.settle)) : '--'
-                goodsQuoteTik.strikeprice = goodsQuoteTik.strikeprice ? (fn(goodsQuoteTik.strikeprice)) : '--'
-                
-                goodsQuoteTik.lasttime = moment(goodsQuoteTik.date + goodsQuoteTik.time, 'YYYYMMDDHHmmss').format('YYYY-MM-DD HH:mm:ss')
+                //
+                // 处理 报价小数位
+                const handleDeimalplace = (key: string) => {
+                    return Reflect.has(goodsQuoteTik, key) ? fn(goodsQuoteTik[key]) : itemQuote[key]
+                }
+                // 处理 如果有值则更新值,没有的话,则取上次的值
+                // 注意: 0 也是有效数字
+                const handleNoneValue = (key: string) => {
+                    return Reflect.has(goodsQuoteTik, key) ? goodsQuoteTik[key] : itemQuote[key]
+                }
 
-                // !goodsQuoteTik.bidvolume && (goodsQuoteTik.bidvolume = '--')
-                // !goodsQuoteTik.askvolume && (goodsQuoteTik.askvolume = '--')
-                // !goodsQuoteTik.lastvolume && (goodsQuoteTik.lastvolume = '--')
-                // 实时行情由于行情源的问题可能不会下发现量,这时用盘面的总量来计算
-                if (!goodsQuoteTik.lastvolume) {
-                    if (itemQuote.totalvolume) {
-                        goodsQuoteTik.lastvolume = goodsQuoteTik.totalvolume - itemQuote.totalvolume;
-                    } else {
-                        goodsQuoteTik.lastvolume = "--";
+                const changeValue = () => {
+                    // 实时行情由于行情源的问题可能不会下发现量,这时用盘面的总量来计算
+                    if (!goodsQuoteTik.lastvolume) {
+                        if (itemQuote.totalvolume) {
+                            itemQuote.lastvolume = goodsQuoteTik.totalvolume - itemQuote.totalvolume;
+                        }
+                    }
+                    // 处理 最高最低价
+                    if (Reflect.has(goodsQuoteTik, 'last')) {
+                        const last = itemQuote.last = handleDeimalplace('last')
+                        if (last < itemQuote.lowest) {
+                            itemQuote.lowest = handleDeimalplace('last')
+                        } else if (itemQuote.lowest === 0) {
+                            // 处理成交的时候,最低价为的情况,需要把最新价赋值给最低价
+                            itemQuote.lowest = handleDeimalplace('last')
+                        } else if (last > itemQuote.highest) {
+                            itemQuote.highest = handleDeimalplace('last')
+                        }
                     }
+
+                    // 处理价格
+                    itemQuote.decimalplace = decimalplace
+
+                    itemQuote.ask = handleDeimalplace('ask')
+                    itemQuote.ask2 = handleDeimalplace('ask2')
+                    itemQuote.ask3 = handleDeimalplace('ask3')
+                    itemQuote.ask4 = handleDeimalplace('ask4')
+                    itemQuote.ask5 = handleDeimalplace('ask5')
+                    itemQuote.ask6 = handleDeimalplace('ask6')
+                    itemQuote.ask7 = handleDeimalplace('ask7')
+                    itemQuote.ask8 = handleDeimalplace('ask8')
+                    itemQuote.ask9 = handleDeimalplace('ask9')
+                    itemQuote.ask10 = handleDeimalplace('ask10')
+                    itemQuote.bid = handleDeimalplace('bid')
+                    itemQuote.bid2 = handleDeimalplace('bid2')
+                    itemQuote.bid3 = handleDeimalplace('bid3')
+                    itemQuote.bid4 = handleDeimalplace('bid4')
+                    itemQuote.bid5 = handleDeimalplace('bid5')
+                    itemQuote.bid6 = handleDeimalplace('bid6')
+                    itemQuote.bid7 = handleDeimalplace('bid7')
+                    itemQuote.bid8 = handleDeimalplace('bid8')
+                    itemQuote.bid9 = handleDeimalplace('bid9')
+                    itemQuote.averageprice = handleDeimalplace('averageprice')
+                    itemQuote.grepmarketprice = handleDeimalplace('grepmarketprice')
+
+                    itemQuote.iep = handleDeimalplace('iep')
+                    itemQuote.limitdown = handleDeimalplace('limitdown')
+                    itemQuote.limitup = handleDeimalplace('limitup')
+
+
+                    itemQuote.opened = handleDeimalplace('opened')
+                    itemQuote.lastturnover = handleDeimalplace('lastturnover')
+                    itemQuote.nontotalturnover = handleDeimalplace('nontotalturnover')
+                    itemQuote.lastturnover = handleDeimalplace('lastturnover')
+                    itemQuote.preclose = handleDeimalplace('preclose')
+                    itemQuote.settle = handleDeimalplace('settle')
+                    itemQuote.totalturnover = handleDeimalplace('totalturnover')
+
+                    itemQuote.askorderid = handleNoneValue('askorderid')
+                    itemQuote.askorderid2 = handleNoneValue('askorderid2')
+                    itemQuote.askorderid3 = handleNoneValue('askorderid3')
+                    itemQuote.askorderid4 = handleNoneValue('askorderid4')
+                    itemQuote.askorderid5 = handleNoneValue('askorderid5')
+                    itemQuote.askordervolume = handleNoneValue('askordervolume')
+                    itemQuote.askordervolume2 = handleNoneValue('askordervolume2')
+                    itemQuote.askordervolume3 = handleNoneValue('askordervolume3')
+                    itemQuote.askordervolume4 = handleNoneValue('askordervolume4')
+                    itemQuote.askordervolume5 = handleNoneValue('askordervolume5')
+                    itemQuote.askordervolume6 = handleNoneValue('askordervolume6')
+                    itemQuote.askordervolume7 = handleNoneValue('askordervolume7')
+                    itemQuote.askordervolume8 = handleNoneValue('askordervolume8')
+                    itemQuote.askordervolume9 = handleNoneValue('askordervolume9')
+                    itemQuote.askqueueinfo = handleNoneValue('askqueueinfo')
+                    itemQuote.askvolume = handleNoneValue('askvolume')
+                    itemQuote.askvolume2 = handleNoneValue('askvolume2')
+                    itemQuote.askvolume3 = handleNoneValue('askvolume3')
+                    itemQuote.askvolume4 = handleNoneValue('askvolume4')
+                    itemQuote.askvolume5 = handleNoneValue('askvolume5')
+                    itemQuote.askvolume6 = handleNoneValue('askvolume6')
+                    itemQuote.askvolume7 = handleNoneValue('askvolume7')
+                    itemQuote.askvolume8 = handleNoneValue('askvolume8')
+                    itemQuote.askvolume9 = handleNoneValue('askvolume9')
+
+                    itemQuote.bidorderid = handleNoneValue('bidorderid')
+                    itemQuote.bidorderid2 = handleNoneValue('bidorderid2')
+                    itemQuote.bidorderid3 = handleNoneValue('bidorderid3')
+                    itemQuote.bidorderid4 = handleNoneValue('bidorderid4')
+                    itemQuote.bidorderid5 = handleNoneValue('bidorderid5')
+                    itemQuote.bidordervolume = handleNoneValue('bidordervolume')
+                    itemQuote.bidordervolume2 = handleNoneValue('bidordervolume2')
+                    itemQuote.bidordervolume3 = handleNoneValue('bidordervolume3')
+                    itemQuote.bidordervolume4 = handleNoneValue('bidordervolume4')
+                    itemQuote.bidordervolume5 = handleNoneValue('bidordervolume5')
+                    itemQuote.bidordervolume6 = handleNoneValue('bidordervolume6')
+                    itemQuote.bidordervolume7 = handleNoneValue('bidordervolume7')
+                    itemQuote.bidordervolume8 = handleNoneValue('bidordervolume8')
+                    itemQuote.bidordervolume9 = handleNoneValue('bidordervolume9')
+                    itemQuote.bidqueueinfo = handleNoneValue('bidqueueinfo')
+                    itemQuote.bidvolume = handleNoneValue('bidvolume')
+                    itemQuote.bidvolume2 = handleNoneValue('bidvolume2')
+                    itemQuote.bidvolume3 = handleNoneValue('bidvolume3')
+                    itemQuote.bidvolume4 = handleNoneValue('bidvolume4')
+                    itemQuote.bidvolume5 = handleNoneValue('bidvolume5')
+                    itemQuote.bidvolume6 = handleNoneValue('bidvolume6')
+                    itemQuote.bidvolume7 = handleNoneValue('bidvolume7')
+                    itemQuote.bidvolume8 = handleNoneValue('bidvolume8')
+                    itemQuote.bidvolume9 = handleNoneValue('bidvolume9')
+                    itemQuote.calloptionpremiums = handleNoneValue('calloptionpremiums')
+                    itemQuote.calloptionpremiums2 = handleNoneValue('calloptionpremiums2')
+                    itemQuote.calloptionpremiums3 = handleNoneValue('calloptionpremiums3')
+                    itemQuote.calloptionpremiums4 = handleNoneValue('calloptionpremiums4')
+                    itemQuote.calloptionpremiums5 = handleNoneValue('calloptionpremiums5')
+                    itemQuote.holdincrement = handleNoneValue('holdincrement')
+                    itemQuote.holdvolume = handleNoneValue('holdvolume')
+                    itemQuote.inventory = handleNoneValue('inventory')
+                    itemQuote.lastlot = handleNoneValue('lastlot')
+                    itemQuote.nontotalholdervolume = handleNoneValue('nontotalholdervolume')
+                    itemQuote.nontotallot = handleNoneValue('nontotallot')
+                    itemQuote.nontotalvolume = handleNoneValue('nontotalvolume')
+                    itemQuote.totallot = handleNoneValue('totallot')
+                    itemQuote.totalvolume = handleNoneValue('totalvolume')
                 }
-                !goodsQuoteTik.holdvolume && (goodsQuoteTik.holdvolume = '--')
-                !goodsQuoteTik.holdincrement && (goodsQuoteTik.holdincrement = '--')
-                // !goodsQuoteTik.totalturnover && (goodsQuoteTik.totalturnover = '--')
 
+                // 判断是一下行情时间是否比现在的要早
+                if (goodsQuoteTik.lasttime) {
+                    const quoteTime = moment(goodsQuoteTik.lasttime, 'YYYY-MM-DD HH:mm:ss')
+                    const localTime = moment(itemQuote.lasttime, 'YYYY-MM-DD HH:mm:ss')
+                    if (quoteTime >= localTime) {
+                        changeValue()
+                        itemQuote.lasttime = handleNoneValue('lasttime')
+                    }
+                } else {
+                    // 委托单 没有 行情变更时间
+                    changeValue()
+                }
+
+
+
+                // goodsQuoteTik.averageprice = goodsQuoteTik.averageprice ? (fn(goodsQuoteTik.averageprice)) : '--'
+                // goodsQuoteTik.grepmarketprice = goodsQuoteTik.grepmarketprice ? (fn(goodsQuoteTik.grepmarketprice)) : '--'
+                // goodsQuoteTik.highest = goodsQuoteTik.highest ? (fn(goodsQuoteTik.highest)) : '--'
+                // goodsQuoteTik.iep = goodsQuoteTik.iep ? (fn(goodsQuoteTik.iep)) : '--'
+                // goodsQuoteTik.limitdown = goodsQuoteTik.limitdown ? (fn(goodsQuoteTik.limitdown)) : '--'
+                // goodsQuoteTik.limitup = goodsQuoteTik.limitup ? (fn(goodsQuoteTik.limitup)) : '--'
+                // goodsQuoteTik.lowest = goodsQuoteTik.lowest ? (fn(goodsQuoteTik.lowest)) : '--'
+                // goodsQuoteTik.opened = goodsQuoteTik.opened ? (fn(goodsQuoteTik.opened)) : '--'
+                // goodsQuoteTik.preclose = goodsQuoteTik.preclose ? (fn(goodsQuoteTik.preclose)) : '--'
+                // goodsQuoteTik.settle = goodsQuoteTik.settle ? (fn(goodsQuoteTik.settle)) : '--'
+                // goodsQuoteTik.strikeprice = goodsQuoteTik.strikeprice ? (fn(goodsQuoteTik.strikeprice)) : '--'
+
+                // goodsQuoteTik.lasttime = moment(goodsQuoteTik.date + goodsQuoteTik.time, 'YYYYMMDDHHmmss').format('YYYY-MM-DD HH:mm:ss')
+
+                // // 实时行情由于行情源的问题可能不会下发现量,这时用盘面的总量来计算
+                // if (!goodsQuoteTik.lastvolume) {
+                //     if (itemQuote.totalvolume) {
+                //         goodsQuoteTik.lastvolume = goodsQuoteTik.totalvolume - itemQuote.totalvolume;
+                //     } else {
+                //         goodsQuoteTik.lastvolume = "--";
+                //     }
+                // }
+                // !goodsQuoteTik.holdvolume && (goodsQuoteTik.holdvolume = '--')
+                // !goodsQuoteTik.holdincrement && (goodsQuoteTik.holdincrement = '--')
+                // !goodsQuoteTik.totalturnover && (goodsQuoteTik.totalturnover = '--')
+                // console.log('goodsQuoteTik', goodsQuoteTik)
+                // mergeObj(itemQuote, goodsQuoteTik);
             } else {
                 console.warn(`行情推送的商品goods:${itemQuote.goodscode}在商品列表里不存在`)
             }
 
             // 注意:此处已 go 服务查询出来的盘面数据为基准,查询盘面 先修改成go 服务,第一次进入项目时候回查询一次所有盘面
             // 之前是 通过 websocket 查询的,故 可能存在字段发生变化问题,如遇到,则进行优化处理
-            
+
             // 判断是一下行情时间是否比现在的要早
-            const quoteTime = moment(goodsQuoteTik.lasttime, 'YYYY-MM-DD HH:mm:ss')
-            const localTime = moment(itemQuote.lasttime, 'YYYY-MM-DD HH:mm:ss')
-            if (quoteTime >= localTime) {
-                mergeObj(itemQuote, goodsQuoteTik);
-            }
+            // const quoteTime = moment(goodsQuoteTik.lasttime, 'YYYY-MM-DD HH:mm:ss')
+            // const localTime = moment(itemQuote.lasttime, 'YYYY-MM-DD HH:mm:ss')
+            // if (quoteTime >= localTime) {
+            //     mergeObj(itemQuote, goodsQuoteTik);
+            // }
         } else {
             // 此处 待优化(存在字段变化问题)
-            quoteDayInfo.push(itemQuote);
+            // console.log('itemQuote', itemQuote)
+            // quoteDayInfo.value.push(itemQuote);
         }
     }
 }

+ 0 - 69
src/views/market/forward/components/forwarTrade/index.vue

@@ -1,69 +0,0 @@
-<template>
-    <div class="forward-trade"></div>
-</template>
-
-<script lang="ts">
-import { defineComponent, computed, reactive, ref, toRefs, unref, onMounted, onUpdated, onUnmounted, provide, inject } from 'vue';
-import { initData } from '@/common/methods';
-// 1.头部菜单栏
-const useMenu = () => {
-    interface headerMenu {
-        name: string;
-        path: string;
-        icon?: string;
-    }
-    const selectedKeys = ref<string[]>(['/login']);
-    const menu: headerMenu[] = reactive([
-        { path: '/login', name: '您好请登录' },
-        { path: '/logon', name: '免费注册' },
-        { path: '/', name: '商城' },
-        { path: '/order', name: '我的订单' },
-        { path: '/pack', name: '我的包裹' },
-        { path: '/myGoods', name: '我的商品' },
-        { path: '/news', name: '消息中心' },
-    ]);
-    return {
-        selectedKeys,
-        menu,
-    };
-};
-export default defineComponent({
-    name: 'forward-trade',
-    components: {},
-    setup() {
-        // beforeCreate -> 使用 setup()
-        // created -> 使用 setup()
-        // beforeMount -> onBeforeMount
-        // mounted -> onMounted
-        // beforeUpdate -> onBeforeUpdate
-        // updated -> onUpdated
-        // beforeDestroy -> onBeforeUnmount
-        // destroyed -> onUnmounted
-        // errorCaptured -> onErrorCaptured
-        initData(() => {
-            // 加载数据在这里
-        });
-        onMounted((): void => {});
-        onUpdated((): void => {});
-        onUnmounted((): void => {});
-        return {
-            ...useMenu(),
-        };
-    },
-});
-</script>
-
-<style lang="less">
-.forward-trade {
-    position: absolute;
-    top: 35px;
-    right: -2px;
-    width: 441px;
-    height: 310px;
-    background: @m-blue14;
-    border: 2px solid @m-blue0;
-    border-radius: 5px;
-    z-index: 9;
-}
-</style
->;

+ 0 - 139
src/views/market/forward/index.vue

@@ -1,139 +0,0 @@
-<template>
-  <!-- 期货市场 -->
-  <section class="forward-section">
-    <forwardTrade />
-    <firstMenu :list="list"
-               :value="'value'"
-               @selectMenu="selectMenu" />
-    <quoteTable :columns="columns"
-                :dataSource="data"
-                :contextMenuList="contextMenuList" />
-    <!-- <firstMenu :list="list"
-               :value="'value'"
-               @selectMenu="selectMenu" />
-    <orderTable :columns="orderCulums"
-                :dataSource="data" /> -->
-  </section>
-</template>
-
-<script lang="ts">
-import { defineComponent, computed, reactive, ref, toRefs, unref, onMounted, onUpdated, onUnmounted, provide, inject } from 'vue';
-import { initData } from '@/common/methods';
-import forwardOrder from './order/index.vue';
-import firstMenu from '@/common/components/firstMenu/index.vue';
-import quoteTable from '@/common/components/quoteTable/index.vue';
-import { MenuItem } from '@/common/components/contextMenu/interface';
-import orderTable from '@/common/components/orderTable/index.vue';
-import forwardTrade from './components/forwarTrade/index.vue';
-
-const columns = [
-    { title: 'Full Name', width: 100, dataIndex: 'name', key: 'name', fixed: 'left', align: 'center' },
-    { title: 'Age', width: 100, dataIndex: 'age', key: 'age', fixed: 'left', align: 'center' },
-    { title: 'Column 1', dataIndex: 'address', key: '1', width: 156, align: 'center' },
-    { title: 'Column 2', dataIndex: 'address', key: '2', width: 156, align: 'center' },
-    { title: 'Column 3', dataIndex: 'address', key: '3', width: 156, align: 'center' },
-    { title: 'Column 4', dataIndex: 'address', key: '4', width: 200, align: 'center' },
-    { title: 'Column 5', dataIndex: 'address', key: '5', width: 200, align: 'center' },
-    { title: 'Column 6', dataIndex: 'address', key: '6', width: 200, align: 'center' },
-    { title: 'Column 7', dataIndex: 'address', key: '7', width: 200, align: 'center' },
-    { title: 'Column 8', dataIndex: 'address', key: '8', width: 200, align: 'center' },
-    { title: 'Column 8', dataIndex: 'address', key: '9', width: 200, align: 'center' },
-    { title: 'Column 8', dataIndex: 'address', key: '10', width: 200, align: 'center' },
-    //   { title: 'Column 8', dataIndex: 'address', key: '11', width: 200 , align: 'center' },
-    //   { title: 'Column 8', dataIndex: 'address', key: '12', width: 200 , align: 'center' },
-    //   { title: 'Column 8', dataIndex: 'address', key: '13', width: 200 , align: 'center' },
-    {
-        title: 'Action',
-        key: '12',
-        fixed: 'right',
-        align: 'center',
-        width: 100,
-        slots: { customRender: 'action' },
-    },
-];
-
-interface DataItem {
-    key: number;
-    name: string;
-    age: number;
-    address: string;
-}
-
-const data: DataItem[] = [];
-for (let i = 0; i < 100; i++) {
-    data.push({
-        key: i,
-        name: `Edrward ${i}`,
-        age: 32,
-        address: `London Park no. ${i}`,
-    });
-}
-
-function handleMenu() {
-    const list = [
-        { key: '1', value: 'one' },
-        { key: '2', value: 'two' },
-        { key: '3', value: 'three' },
-    ];
-    function selectMenu(item: any) {}
-    return { list, selectMenu };
-}
-
-const orderCulums = [
-    { title: 'Column 1', dataIndex: 'address', key: '1', width: 156, align: 'center' },
-    { title: 'Column 2', dataIndex: 'address', key: '2', width: 156, align: 'center' },
-    { title: 'Column 3', dataIndex: 'address', key: '3', width: 156, align: 'center' },
-    { title: 'Column 4', dataIndex: 'address', key: '4', width: 200, align: 'center' },
-    { title: 'Column 5', dataIndex: 'address', key: '5', width: 200, align: 'center' },
-    { title: 'Column 6', dataIndex: 'address', key: '6', width: 200, align: 'center' },
-    { title: 'Column 7', dataIndex: 'address', key: '7', width: 200, align: 'center' },
-    { title: 'Column 8', dataIndex: 'address', key: '8', width: 200, align: 'center' },
-    { title: 'Column 8', dataIndex: 'address', key: '9', width: 200, align: 'center' },
-    { title: 'Column 8', dataIndex: 'address', key: '10', width: 200, align: 'center' },
-    { title: 'Column 8', dataIndex: 'address', key: '11', width: 200, align: 'center' },
-    { title: 'Column 8', dataIndex: 'address', key: '12', width: 200, align: 'center' },
-    { title: 'Column 8', dataIndex: 'address', key: '13', width: 200, align: 'center' },
-    { title: 'Column 9', dataIndex: 'address', key: '14', width: 200, align: 'center' },
-    { title: 'Column 9', dataIndex: 'address', key: '15', width: 200, align: 'center' },
-    { title: 'Column 10', dataIndex: 'address', key: '16', width: 200, align: 'center' },
-];
-
-export default defineComponent({
-    name: 'forward',
-    components: {
-        forwardOrder,
-        firstMenu,
-        quoteTable,
-        orderTable,
-        forwardTrade,
-    },
-    setup() {
-        initData(() => {
-            // 加载数据在这里
-        });
-        const { list, selectMenu } = handleMenu();
-        const contextMenuList = ref<MenuItem[]>([
-            {
-                lable: '下单',
-                callback: () => {},
-            },
-        ]);
-        return {
-            data,
-            columns,
-            list,
-            selectMenu,
-            contextMenuList,
-            orderCulums,
-        };
-    },
-});
-</script>
-
-<style lang="less">
-.forward-section {
-    // height: 100%;
-    position: relative;
-}
-</style
->;

+ 0 - 47
src/views/market/forward/order/index.vue

@@ -1,47 +0,0 @@
-<template>
-  <div class="forward-order">
-    <firstMenu :list="list"
-               :value="'value'"
-               @selectMenu="selectMenu" />
-  </div>
-</template>
-
-<script lang="ts">
-import { defineComponent, computed, reactive, ref, toRefs, unref, onMounted, onUpdated, onUnmounted, provide, inject } from 'vue';
-import { initData } from '@/common/methods';
-import firstMenu from '@/common/components/firstMenu/index.vue';
-
-function handleMenu() {
-    const list = [
-        { key: '1', value: 'one' },
-        { key: '2', value: 'two' },
-        { key: '3', value: 'three' },
-    ];
-    function selectMenu(item: any) {}
-    return { list, selectMenu };
-}
-
-export default defineComponent({
-    name: 'forward-order',
-    components: {
-        firstMenu,
-    },
-    setup() {
-        initData(() => {
-            // 加载数据在这里
-        });
-        const { list, selectMenu } = handleMenu();
-        return {
-            list,
-            selectMenu,
-        };
-    },
-});
-</script>
-
-<style lang="less">
-.forward-order {
-    height: 440px;
-}
-</style
->;

+ 269 - 0
src/views/market/futures/compoments/futures-trade/index.vue

@@ -0,0 +1,269 @@
+<template>
+  <!-- 挂牌求购 -->
+  <Drawer :title="'挂牌求购'"
+          :placement="'right'"
+          :visible="visible"
+          @cancel="cancel"
+          class="top">
+    <div class="post_buying">
+      <a-form class="inlineForm dialogForm"
+              ref="formRef"
+              :model="formState"
+              :rules="rules">
+        <div class="formBar">
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="交易账户"
+                           name="accountid">
+                <a-select class="inlineFormSelect"
+                          style="width: 260px"
+                          v-model:value="formState.accountid"
+                          placeholder="请选择">
+                  <a-select-option v-for="item in accountList"
+                                   :value="item.accountid"
+                                   :key="item.accountid">{{ item.accountid }}</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌价格"
+                           name="FixedPrice">
+                <a-input-number class="commonInput"
+                                style="width: 260px"
+                                :min="0"
+                                v-model:value="formState.FixedPrice" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌数量"
+                           name="OrderQty">
+                <a-input-number class="commonInput"
+                                style="width: 260px"
+                                :min="0"
+                                :max="getMaxNum()"
+                                v-model:value="formState.OrderQty" />
+                <span class="input-enumdicname">{{ selectedRow.enumdicname }}</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
+        </div>
+        <a-row :gutter="24">
+          <a-col :span="24"
+                 class="fixedBtns">
+            <a-form-item class="btnCenter">
+              <a-button class="listedBtn"
+                        @click="submit"
+                        :loading="loading">买入</a-button>
+              <a-button class="ml10 cancelBtn"
+                        @click="cancel"
+                        :disabled="loading">取消</a-button>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+  </Drawer>
+</template>
+
+<script lang="ts">
+import { Des } from '@/common/components/commonDes';
+import Drawer from '@/common/components/drawer/index.vue';
+import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { ModalEnum } from '@/common/constants/modalNameEnum';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { getAccountTypeList } from '@/services/bus/account';
+import { MinusOutlined, PlusOutlined } from '@ant-design/icons-vue';
+import moment, { Moment } from 'moment';
+import { defineComponent, PropType, ref } from 'vue';
+import { TempWrOrderQuoteDetail } from './interface';
+import { handleForm } from './setup';
+
+export default defineComponent({
+    emits: ['cancel', 'update'],
+    name: 'trader',
+    components: { Des, Drawer, PlusOutlined, MinusOutlined },
+    props: {
+        selectedRow: {
+            type: Object as PropType<TempWrOrderQuoteDetail>,
+            default: {},
+        },
+        enumName: {
+            default: '',
+            type: String as PropType<EnumRouterName>,
+        },
+        time: {
+            type: Object as PropType<Moment>,
+            default: moment(),
+        },
+    },
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context);
+        const { rules, formState, formRef } = handleForm(props.selectedRow);
+        const loading = ref<boolean>(false);
+        const accountList = getAccountTypeList([2]);
+        if (accountList.length) {
+            formState.accountid = accountList[0].accountid;
+        }
+
+        function submit() {
+            // const marketInfo = getMarketRunByTradeMode(17);
+            // if (marketInfo) {
+            //     validateAction<FormParam>(formRef, formState).then((res) => {
+            //         requestResultLoadingAndInfo(hdWROrder, param, loading, ['求购成功', '求购失败:']).then(() => {
+            //             cancel(true);
+            //         });
+            //     });
+            // }
+        }
+        return {
+            submit,
+            cancel,
+            loading,
+            visible,
+            accountList,
+            rules,
+            formState,
+            formRef,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.post_buying {
+    width: 100%;
+    height: 100%;
+    .flex;
+    flex-direction: column;
+    position: relative;
+    overflow: hidden;
+    .ant-form {
+        height: 100%;
+    }
+    .condition {
+        width: 100%;
+        height: 48px;
+        margin: 0 16px;
+        padding: 10px 0;
+        border-bottom: 1px solid @m-black6;
+        .inlineflex;
+        .conditionBtn {
+            align-self: center;
+            align-items: center;
+            border: 0;
+            min-width: 80px;
+            height: 28px;
+            line-height: 28px;
+            background: @m-black7;
+            .rounded-corners(3px);
+            font-size: 14px;
+            color: @m-blue0;
+            &:hover {
+                background: @m-black7-hover;
+                color: @m-blue0-hover;
+            }
+        }
+        .conditionBtn + .conditionBtn {
+            margin-left: 10px;
+        }
+    }
+}
+
+.unit {
+    margin-left: 70px;
+    width: 260px;
+    .flex;
+    justify-content: space-between;
+    font-size: 14px;
+    color: @m-grey41;
+    height: 14px;
+    line-height: 14px;
+}
+.listedBtn {
+    width: 120px;
+    height: 30px;
+    line-height: 30px;
+    background: linear-gradient(0deg, @m-blue2 0%, @m-blue0 100%);
+    border-radius: 3px;
+    color: @m-white0;
+    font-size: 14px;
+    text-align: center;
+    border: 0;
+    &:hover {
+        background: linear-gradient(0deg, @m-blue0-hover 0%, @m-blue2-hover 100%);
+        color: @m-white0-hover;
+    }
+}
+.cancelBtn:extend(.listedBtn) {
+    background: linear-gradient(0deg, @m-grey12 0%, @m-grey13 100%) !important;
+    &:hover {
+        background: linear-gradient(0deg, @m-grey12-hover 0%, @m-grey13-hover 100%) !important;
+        color: @m-white0-hover;
+    }
+}
+.ml10 {
+    margin-left: 10px;
+}
+.ant-form.dialogForm .ant-row.ant-form-item {
+    margin-bottom: 14px;
+}
+.mt20 {
+    margin-top: 20px;
+}
+.mt-10 {
+    margin-top: -10px;
+}
+.ant-input-suffix {
+    position: absolute;
+    right: -25px;
+}
+.minusBtn,
+.plusBtn {
+    width: 15px;
+    height: 32px;
+    line-height: 32px;
+    font-size: 15px;
+    color: @m-blue15;
+    cursor: pointer;
+}
+.minusBtn {
+    position: absolute;
+    top: -6px;
+    left: 14px;
+    z-index: 1;
+}
+.plusBtn {
+    position: absolute;
+    top: -6px;
+    right: 14px;
+    z-index: 1;
+}
+.stepper {
+    padding-left: 30px;
+    padding-right: 30px;
+    text-align: center;
+    color: @m-yellow1;
+    font-size: 16px;
+}
+.ant-slider.formSlider {
+    width: 260px !important;
+    margin-left: 70px;
+    .ant-slider-rail {
+        margin-right: 0;
+        padding-right: 0;
+        height: 3px !important;
+        border-radius: 2px !important;
+        background-color: @m-blue14;
+    }
+    .ant-slider-track {
+        height: 3px;
+        background-color: @m-blue0;
+    }
+    .ant-slider-step {
+        height: 3px;
+    }
+    .ant-progress-text {
+        display: none;
+    }
+}
+</style>

+ 16 - 0
src/views/market/futures/compoments/futures-trade/interface.ts

@@ -0,0 +1,16 @@
+import { WrOrderQuote } from "@/services/go/wrtrade/interface";
+import { Moment } from "moment";
+
+export interface FormParam {
+    accountid: undefined | number,
+    FixedPrice: number,
+    OrderQty: number,
+    PriceMove: number,
+    DeliveryMonth: Moment,
+    DelistMinQty: number,
+}
+
+
+export interface TempWrOrderQuoteDetail extends WrOrderQuote {
+    wrResult: { dgfactoryitemtypeid: number; dgfactoryitemid: number }[]
+}

+ 36 - 0
src/views/market/futures/compoments/futures-trade/setup.ts

@@ -0,0 +1,36 @@
+import { useVerifyListingBasis, useVerifyListingNum } from '@/hooks/form/verify';
+import moment from "moment";
+import { onBeforeUnmount, reactive, ref, UnwrapRef } from "vue";
+import { FormParam, TempWrOrderQuoteDetail } from "./interface";
+
+function initFormData(): FormParam {
+    return {
+        accountid: undefined,
+        FixedPrice: 0,
+        OrderQty: 0,
+        PriceMove: 0,
+        DelistMinQty: 0,
+        DeliveryMonth: moment()
+    }
+}
+const formState: UnwrapRef<FormParam> = reactive(initFormData())
+export function handleForm(selectedRow: TempWrOrderQuoteDetail) {
+    const formRef = ref();
+    formState.OrderQty = selectedRow.minivalue
+
+    const { v_num } = useVerifyListingNum<FormParam, 'DelistMinQty'>(formState, 'DelistMinQty', selectedRow.minivalue);
+    const { v_basis } = useVerifyListingBasis(selectedRow, 'goodsid');
+
+    const rules = {
+        FixedPrice: [{ required: true, message: '请输入挂牌价格', trigger: 'blur', type: 'number', }],
+        OrderQty: [{ required: true, validator: v_num, trigger: 'change', type: 'number' }],
+        PriceMove: [{ required: true, validator: v_basis, trigger: 'blur', type: 'number', }],
+        accountid: [{ required: true, message: '请输入交易账号' }],
+    }
+    onBeforeUnmount(() => {
+        Object.assign(formState, initFormData(), { OrderQty: selectedRow.minivalue })
+    })
+    return { rules, formState, formRef }
+}
+
+

+ 179 - 0
src/views/market/futures/index.vue

@@ -0,0 +1,179 @@
+<template>
+  <!--期货-->
+  <div class="topTableHeight">
+    <a-table :columns="getColumnsList()"
+             :class="['srcollYTable', isBottom ? 'condSecondTabTable' : 'condSecondTabTableNoBottom', tableList.length ? 'noPlaceHolder' : 'hasPlaceHolder']"
+             :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 443px)' : 'calc(100vh - 196px)' }"
+             :pagination="false"
+             :loading="loading"
+             rowKey="key"
+             :data-source="tableList">
+      <template #totalturnover="{ text }">
+        <span>{{changeUnit(text)}}</span>
+      </template>
+      <!-- 涨跌 -->
+      <template #change="{ record }">
+        <span>{{quoteChange(record, record.decimalplace)}}</span>
+      </template>
+      <!-- 幅度 -->
+      <template #amplitude="{ record }">
+        <span>{{quoteAmplitude(record, record.decimalplace)}}</span>
+      </template>
+      <!-- 振幅 -->
+      <template #vibration="{ record }">
+        <span>{{quoteAmplituOfVibration(record, record.decimalplace)}}</span>
+      </template>
+      <template #index="{ index }">
+        <span>{{index + 1}}</span>
+      </template>
+      <!-- 买价 -->
+      <template #bid="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+      <!-- 卖价 -->
+      <template #ask="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+      <!-- 最新价 -->
+      <template #last="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+      <!-- 最低价 -->
+      <template #lowest="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+      <!-- 最高价 -->
+      <template #highest="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+    </a-table>
+    <ThridMenu :list="tabList"
+               :selectedKey="index"
+               @selectMenu="changeTab" />
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="buttons"></contextMenu>
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
+  </div>
+</template>
+
+<script lang="ts">
+import { TabList } from '@/common/components/description/interface';
+import ThridMenu from '@/common/components/thirdMenu/index.vue';
+import { getShowBottomValue } from '@/common/config/constrolBottom';
+import { handleModalComponent } from '@/common/setup/asyncComponent';
+import { handleQuotePriceColor, handleSubcriteOnDemandQuote, quoteAmplitude, quoteAmplituOfVibration, quoteChange } from '@/common/setup/table/tableQuote';
+import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
+import { ref } from 'vue';
+import { getColumnsList, useExternalexchange } from './setup';
+import { getTableButton } from '@/common/setup/table/button';
+import { contextMenu, defineAsyncComponent, defineComponent } from '@/common/export/commonTable';
+import { handleContextMenu } from '@/common/components/contextMenu/setup';
+
+export default defineComponent({
+    name: 'spot_trade_order_transaction_swap',
+    components: {
+        ThridMenu,
+        contextMenu,
+        trade: defineAsyncComponent(() => import('./compoments/futures-trade/index.vue')),
+    },
+    setup() {
+        const isBottom = getShowBottomValue();
+        const selectedRow = ref<QueryQuoteDayRsp>();
+        const buttons = getTableButton();
+        console.log('buttons', buttons);
+        const { index, loading, tabList, tableList, hanldeQuoteData } = useExternalexchange();
+        // 行情按需订阅
+        let stopSubcribe = handleSubcriteOnDemandQuote<QueryQuoteDayRsp>(tableList);
+        function changeTab(index: number, current: TabList) {
+            hanldeQuoteData(index);
+            console.log(index, current);
+            // 停止上次订阅
+            stopSubcribe();
+            // 重新发起订阅
+            stopSubcribe = handleSubcriteOnDemandQuote<QueryQuoteDayRsp>(tableList);
+        }
+        return {
+            index,
+            loading,
+            tabList,
+            changeTab,
+            tableList,
+            isBottom,
+            handleQuotePriceColor,
+            quoteChange,
+            quoteAmplitude,
+            quoteAmplituOfVibration,
+            getColumnsList,
+            buttons,
+            ...handleModalComponent(() => {}, selectedRow),
+            ...handleContextMenu(),
+        };
+    },
+});
+</script>
+<style lang="less">
+.noData {
+    .position(absolute, 28px, 0, 0, 0);
+}
+.filter-custom-table {
+    display: inline-flex;
+    padding-top: 4px;
+    height: 34px;
+    .conditionSelect:first-child {
+        margin-right: 10px;
+    }
+    .btnDeafault.ant-btn,
+    .operBtn.ant-btn {
+        height: 26px !important;
+        line-height: 26px !important;
+    }
+
+    .ant-select-single:not(.ant-select-customize-input) + .ant-select-single:not(.ant-select-customize-input),
+    .ant-select + .ant-space.ant-space-vertical {
+        margin-left: 10px;
+    }
+    .ant-select-single:not(.ant-select-customize-input) {
+        height: 26px;
+        line-height: 26px !important;
+        .ant-select-selector {
+            height: 26px;
+            border-color: @m-grey46 !important;
+            background: @m-grey47;
+            .rounded-corners(3px);
+            .ant-select-selection-item {
+                line-height: 26px;
+            }
+            .ant-select-selection-search {
+                height: 26px;
+                .ant-select-selection-search-input {
+                    height: 26px;
+                    line-height: 27px !important;
+                }
+            }
+            .ant-select-selection-placeholder {
+                line-height: 26px;
+            }
+        }
+    }
+
+    .allDatePicker.ant-calendar-picker {
+        height: 26px !important;
+        border: 1px solid @m-grey46 !important;
+        .ant-calendar-picker-input.ant-input {
+            height: 26px;
+            line-height: 26px;
+            &::placeholder {
+                color: @m-grey10 !important;
+            }
+        }
+    }
+    .conditionSelect + .conditionSelect {
+        margin-left: 10px;
+    }
+}
+</style>

+ 101 - 0
src/views/market/futures/setup.ts

@@ -0,0 +1,101 @@
+import { TabList } from '@/common/components/description/interface';
+import { initData } from '@/common/methods';
+import APP from '@/services';
+import { getQuoteDayInfoByCode } from '@/services/bus/goods';
+import { Ermcp3GoodsGroup, Goods } from '@/services/go/ermcp/goodsInfo/interface';
+import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
+import { Externalexchange } from '@/services/go/useInfo/interface';
+import { ref } from 'vue';
+
+
+export function getColumnsList() {
+    const columns = [
+        { title: '序号', key: 'index', width: 80 },
+        { title: '代码', key: 'goodscode' },
+        { title: '名称', key: 'goodsname' },
+
+        { title: '买价', key: 'bid' },
+        { title: '买量', key: 'bidvolume' },
+        { title: '卖价', key: 'ask' },
+        { title: '卖量', key: 'askvolume' },
+
+        { title: '当前价', key: 'last' },
+        { title: '涨跌', key: 'change' }, // 最新价 - 昨结价
+        { title: '幅度', key: 'amplitude' }, // (最新价 - 昨结价) / 100 %
+        { title: '开盘', key: 'opened' },
+        { title: '最高', key: 'highest' },
+        { title: '最低', key: 'lowest' },
+
+        { title: '结算', key: 'settle' },
+
+        { title: '昨结算', key: 'presettle' },
+
+        // { title: '振幅', key: 'vibration' }, // (最高价 - 最低价 ) / 最新价  * 100 %
+        // { title: '总量', key: 'totalvolume' },
+        // { title: '现量', key: 'lastvolume' },
+        // { title: '持仓量', key: 'holdvolume' },
+        // { title: '日增', key: 'holdincrement' },
+        // { title: '金额', key: 'totalturnover' },
+    ];
+
+    return columns.map(el => {
+        return { dataIndex: el.key, width: 100, align: 'center', slots: { customRender: el.key, }, ...el }
+    })
+}
+
+// 外部交易所
+export const useExternalexchange = () => {
+    const loading = ref<boolean>(false)
+    const index = ref<string>('0');
+    // 外部交易所 数据
+    const externalexchangeList = ref<Externalexchange[]>([])
+    const tabList = ref<TabList[]>([])
+    // 盘面数据
+    const tableList = ref<QueryQuoteDayRsp[]>([
+    ])
+    // 获取 商品数据
+    const useGoodsList = (exchareaid: number) => {
+        const goodsList = APP.get('Goods') as Goods[];
+        const goodsGroups = APP.get('goodsgroups') as Ermcp3GoodsGroup[]
+        // 商品组
+        const selectedGoodsGroups = goodsGroups.filter(e => e.exexchangeid === exchareaid).map(el => el.goodsgroupid)
+        return goodsList.filter(e => {
+            return e.goodsstatus === 3 && selectedGoodsGroups.includes(e.goodsgroupid)
+        })
+
+    }
+
+    initData(() => {
+        externalexchangeList.value = APP.get('externalexchange')
+        const list = externalexchangeList.value.map((e: Externalexchange) => {
+            return { lable: e.exexchangename, code: e.exexchangecode };
+        }) as TabList[]
+
+        tabList.value = list
+        if (list.length) {
+            hanldeQuoteData(0)
+        }
+    })
+    function hanldeQuoteData(index: number) {
+        const id = getExternalId(index)
+        // 找到 交易所 下的商品列表
+        const goodsList = useGoodsList(id)
+        // 找到 盘面数据
+        getQuoteData(goodsList)
+    }
+    function getQuoteData(goodsList: Goods[]) {
+        tableList.value.length = 0
+        // 找到盘面数据
+        goodsList.forEach(el => {
+            const quote = getQuoteDayInfoByCode(el.goodscode);
+            if (quote) {
+                tableList.value.push(quote)
+            }
+        })
+    }
+    function getExternalId(index: number) {
+        return externalexchangeList.value[index].autoid
+    }
+
+    return { index, loading, tabList, tableList, hanldeQuoteData }
+}