li.shaoyi 4 vuotta sitten
vanhempi
commit
9039012f96

+ 1 - 0
src/common/components/echart/echart-kline/setup.ts

@@ -101,6 +101,7 @@ export function handleEchart() {
                 textStyle: {
                     color: '#4d535c',
                 },
+                confine: true,
                 className: 'tooltip',
                 formatter: (params: any) => {
                     let result = '';

+ 1 - 0
src/common/components/echart/echart-timeline/setup.ts

@@ -99,6 +99,7 @@ export function handleEchart() {
                 textStyle: {
                     color: '#4d535c',
                 },
+                confine: true,
                 formatter: (params: any) => {
                     let result = '';
                     params.forEach((item: any, index: number) => {

+ 2 - 2
src/common/methods/request/resultInfo.ts

@@ -99,10 +99,10 @@ export async function queryResultLoadingAndInfo(fn: Function, loading: Ref<boole
             console.log('查询数据成功:', result)
             loading.value = false;
             resolve(result as any[]);
-        }).catch((err: { message: string }) => {
+        }).catch((err: string) => {
             loading.value = false;
             console.error('查询数据失败:', err)
-            message.error(err.message)
+            message.error(err)
             reject(err)
         })
     })

+ 4 - 1
src/services/bus/goods.ts

@@ -143,11 +143,14 @@ export function getGoodsQuoteList(exchangeId?: number): GoodsQuote[] {
         // 根据交易所 id 查找对应的商品组
         const exchangeGoodsGroups = goodsGroups.filter(e => e.exexchangeid === exchangeId).map(el => el.goodsgroupid);
         // 过滤出对应的商品
-        goodsList = getGoodsList().filter(e => e.goodsstatus === 3 && exchangeGoodsGroups.includes(e.goodsgroupid));
+        goodsList = getGoodsList().filter((e) => e.goodsstatus === 3 && exchangeGoodsGroups.includes(e.goodsgroupid));
     } else {
         goodsList = getGoodsList();
     }
 
+    // 按照 goodscode 字母升序排序
+    goodsList = goodsList.filter((e) => e.goodsstatus === 3).sort((a, b) => a.goodscode.charCodeAt(0) - b.goodscode.charCodeAt(0));
+
     return goodsList.map((el) => {
         const item: GoodsQuote = {
             goodsid: el.goodsid,

+ 2 - 2
src/services/go/ermcp/goodsInfo/index.ts

@@ -251,9 +251,9 @@ export function GetErmcpGoods(lastUpdateTime?: string): Promise<string> {
     return commonSearch_go('/Ermcp/GetErmcpGoods', param).then(async res => {
 
         if (res.length) {
-            const result = res.reduce((acc: string, obj: Goods) => acc + obj.goodscode + ',', '')
+            const result = res.map((item: Goods) => item.goodscode.toUpperCase())
             // 登录的时候或者刷新的时候,需要获取一次盘面信息
-            await QueryQuoteDay(result)
+            await QueryQuoteDay(result.join(','))
         }
         // console.log('查询企业风管期货商品信息', res);
         APP.set('Goods', res)

+ 1 - 1
src/services/proto/futures/interface.ts

@@ -25,7 +25,7 @@ export interface ChannelOrderReq {
     ServiceTime?: string; // string 服务端时间
     validtime?: string; // string 有效时间
     CloseTodayQty?: number; // uint64 平今仓数量
-    SpotContractID?: number; // uint64 现货合同ID - 为4:套期保值时填写
+    SpotContractID?: string; // uint64 现货合同ID - 为4:套期保值时填写
     SaleUserID?: number; // uint64 业务员ID
     BizSubjectID?: number; // uint64 归属业务部门ID
 }

+ 1 - 1
src/views/information/custom/index.vue

@@ -59,7 +59,7 @@ export default defineComponent({
     add: defineAsyncComponent(() => import('./compoments/add/index.vue')), // 新增
     check: defineAsyncComponent(() => import('./compoments/check/index.vue')), // 审核
     delete: defineAsyncComponent(() => import('./compoments/delete/index.vue')), // 删除
-    modify: defineAsyncComponent(() => import('./compoments/add/index.vue')), // 修改
+    modify: defineAsyncComponent(() => import('./compoments/modify/index.vue')), // 修改
     recover: defineAsyncComponent(() => import('./compoments/recover/index.vue')), // 恢复
     disable: defineAsyncComponent(() => import('./compoments/disable/index.vue')), // 停用
     cancel: defineAsyncComponent(() => import('./compoments/cancel/index.vue')), // 撤销

+ 4 - 4
src/views/information/spot-contract/components/detail/index.vue

@@ -140,25 +140,25 @@ export default defineComponent({
       switch (activeKey.value) {
         case 2: // 点价记录
           registerColumn('table_pcweb_someprice_detail_dj', []);
-          queryResultLoadingAndInfo(QueryBusinessDj, loading, { relatedid: spotcontractid, applystatus: '2,3' }).then((res) => {
+          queryResultLoadingAndInfo(QueryBusinessDj, loading, { relatedid: spotcontractid }).then((res) => {
             tableList.value = res;
           });
           break;
         case 3: // 交收记录
           registerColumn('table_pcweb_someprice_detail_js', []);
-          queryResultLoadingAndInfo(QueryBusinessJs, loading, { relatedid: spotcontractid, applystatus: '2,3' }).then((res) => {
+          queryResultLoadingAndInfo(QueryBusinessJs, loading, { relatedid: spotcontractid }).then((res) => {
             tableList.value = res;
           });
           break;
         case 4: //款项记录
           registerColumn('table_pcweb_someprice_detail_kx', []);
-          queryResultLoadingAndInfo(QueryBusinessKx, loading, { relatedid: spotcontractid, applystatus: '2,3' }).then((res) => {
+          queryResultLoadingAndInfo(QueryBusinessKx, loading, { relatedid: spotcontractid }).then((res) => {
             tableList.value = res;
           });
           break;
         case 5: // 发票记录
           registerColumn('table_pcweb_someprice_detail_fp', []);
-          queryResultLoadingAndInfo(QueryBusinessFp, loading, { relatedid: spotcontractid, applystatus: '2,3' }).then((res) => {
+          queryResultLoadingAndInfo(QueryBusinessFp, loading, { relatedid: spotcontractid }).then((res) => {
             tableList.value = res;
           });
           break;

+ 9 - 9
src/views/market/futures/compoments/futures-trade/index.less

@@ -58,18 +58,18 @@
             &:not(:last-child) {
                 margin-right: 10px;
             }
+        }
 
-            &:nth-child(1) {
-                background-color: red;
-            }
+        .buy {
+            background-color: red !important;
+        }
 
-            &:nth-child(2) {
-                background-color: green;
-            }
+        .sell {
+            background-color: green !important;
+        }
 
-            &:nth-child(3) {
-                background-color: blue;
-            }
+        .close {
+            background-color: blue !important;
         }
     }
 

+ 237 - 225
src/views/market/futures/compoments/futures-trade/index.vue

@@ -42,16 +42,18 @@
           </a-form>
         </div>
         <div class="futures_trade__submit">
-          <a-button :loading="loading" @click="submit('buy')">
+          <!--如果是采购合同隐藏按钮-->
+          <a-button class="buy" :loading="loading" @click="submit('buy')" v-if="!isHedging || selectedRow.contracttype === -1">
             <span>{{buyPrice}}</span>
             <span>买入</span>
           </a-button>
-          <a-button :loading="loading" @click="submit('sell')">
+          <!--如果是销售合同隐藏按钮-->
+          <a-button class="sell" :loading="loading" @click="submit('sell')" v-if="!isHedging || selectedRow.contracttype === 1">
             <span>{{sellPrice}}</span>
             <span>卖出</span>
           </a-button>
-          <!--如果有持仓则显示按钮-->
-          <a-button :loading="loading" @click="submit('close')" :disabled="positionList.length === 0 || isHedging">
+          <!--如果是套保交易隐藏按钮-->
+          <a-button class="close" :loading="loading" @click="submit('close')" :disabled="positionList.length === 0" v-if="!isHedging">
             <!--根据持仓方向显示平仓价格-->
             <span v-if="selectedPosition">{{selectedPosition.buyorsell === BuyOrSell.buy ? sellPrice : buyPrice}}</span>
             <span>平仓</span>
@@ -86,249 +88,259 @@ import { getGoodsQuoteList } from '@/services/bus/goods';
 import { message } from 'ant-design-vue';
 
 export default defineComponent({
-    emits: ['cancel', 'update'],
-    name: 'trader',
-    components: { Des, Drawer, PlusOutlined, MinusOutlined },
-    props: {
-        selectedRow: {
-            type: Object as PropType<GoodsQuote & QueryErmcpTradePositionRsp & Ermcp3SellBuyContract>,
-            default: () => {},
-        },
+  emits: ['cancel', 'update'],
+  name: 'trader',
+  components: { Des, Drawer, PlusOutlined, MinusOutlined },
+  props: {
+    selectedRow: {
+      type: Object as PropType<GoodsQuote & QueryErmcpTradePositionRsp & Ermcp3SellBuyContract>,
+      default: () => ({}),
     },
-    setup(props, context) {
-        // 是否套保交易 (根据参数 spotcontractid 来判断)
-        const isHedging = Boolean(props.selectedRow.spotcontractid);
+  },
+  setup(props, context) {
+    // 是否套保交易 (根据参数 spotcontractid 来判断)
+    const isHedging = Boolean(props.selectedRow.spotcontractid);
 
-        const goodsList = getGoodsQuoteList();
-        const getGoods = (id: number) => goodsList.find((item) => item.goodsid === id)!;
-        // 当前选中的商品合约
-        const selectedGoods = ref<GoodsQuote>(getGoods(props.selectedRow.goodsid));
+    const goodsList = getGoodsQuoteList();
+    const getGoods = (id: number) => goodsList.find((item) => item.goodsid === id)!;
+    // 当前选中的商品合约
+    const selectedGoods = ref<GoodsQuote>(getGoods(props.selectedRow.goodsid));
 
-        const { visible, cancel } = _closeModal(context);
-        const { rules, formData, accountList, allPositionList, getPositionList } = handleForm(selectedGoods.value);
-        const formRef = ref();
-        const loading = ref<boolean>(false);
+    const { visible, cancel } = _closeModal(context);
+    const { rules, formData, accountList, allPositionList, getPositionList } = handleForm(selectedGoods.value);
+    const formRef = ref();
+    const loading = ref<boolean>(false);
 
-        // 表格选中的 rowKey 数据 :rowKey="(record,index)=>index"
-        const selectedRowKeys = ref<number[]>([]);
-        // 当前选择的持仓单据
-        const selectedPosition = ref<QueryErmcpTradePositionRsp>();
-        // 选择持仓
-        const onSelectChange = (keys: number[], record: QueryErmcpTradePositionRsp[]) => {
-            selectedRowKeys.value = keys;
-            selectedPosition.value = record[0];
-            const { enableqty, positionaverageprice } = record[0];
-            // 更新价格和数量
-            formData.OrderPrice = positionaverageprice;
-            formData.OrderQty = enableqty;
-        };
+    // 表格选中的 rowKey 数据 :rowKey="(record,index)=>index"
+    const selectedRowKeys = ref<number[]>([]);
+    // 当前选择的持仓单据
+    const selectedPosition = ref<QueryErmcpTradePositionRsp>();
+    // 选择持仓
+    const onSelectChange = (keys: number[], record: QueryErmcpTradePositionRsp[]) => {
+      selectedRowKeys.value = keys;
+      selectedPosition.value = record[0];
+      const { enableqty, positionaverageprice } = record[0];
+      // 更新价格和数量
+      formData.OrderPrice = positionaverageprice;
+      formData.OrderQty = enableqty;
+    };
 
-        // 持仓列表
-        const positionList = computed(() => allPositionList.value.filter((item) => item.goodsid === selectedGoods.value.goodsid));
-        // 选中的价格类型
-        const selectedPriceType = ref(1);
-        // 价格类型列表
-        const priceTypeList = [
-            // {
-            //     priceType: 0,
-            //     priceName: '最新价',
-            // },
-            {
-                priceType: 1,
-                priceName: '市价',
-            },
-            // {
-            //     priceType: 2,
-            //     priceName: '对手价',
-            // },
-            {
-                priceType: 3,
-                priceName: '限价',
-            },
-            // {
-            //     priceType: 4,
-            //     priceName: '超价',
-            // },
-        ];
+    // 持仓列表
+    const positionList = computed(() => {
+      const result = allPositionList.value.filter((item) => item.goodsid === selectedGoods.value.goodsid);
+      const { goodscode, goodsid, buyorsell } = props.selectedRow;
+      // 查找选中的持仓单据
+      const index = result.findIndex((item) => item.goodscode === goodscode && item.goodsid === goodsid && item.buyorsell === buyorsell);
+      if (index > -1) {
+        onSelectChange([index], [result[index]])
+      }
+      return result;
+    });
+    // 选中的价格类型
+    const selectedPriceType = ref(1);
+    // 价格类型列表
+    const priceTypeList = [
+      // {
+      //     priceType: 0,
+      //     priceName: '最新价',
+      // },
+      {
+        priceType: 1,
+        priceName: '市价',
+      },
+      // {
+      //     priceType: 2,
+      //     priceName: '对手价',
+      // },
+      {
+        priceType: 3,
+        priceName: '限价',
+      },
+      // {
+      //     priceType: 4,
+      //     priceName: '超价',
+      // },
+    ];
 
-        // 买价
-        const buyPrice = computed(() => getPrice(BuyOrSell.buy));
-        // 卖价
-        const sellPrice = computed(() => getPrice(BuyOrSell.sell));
-        // 根据买卖方向返回价格
-        function getPrice(direction: BuyOrSell): number {
-            const { last, bid, ask, decimalplace, quoteminunit } = selectedGoods.value;
-            switch (selectedPriceType.value) {
-                // 最新价
-                case 0: {
-                    return last;
-                }
-                // 市价
-                case 1: {
-                    return direction === BuyOrSell.buy ? bid : ask;
-                }
-                // 对手价
-                case 2: {
-                    return direction === BuyOrSell.buy ? ask : bid;
-                }
-                // 限价
-                case 3: {
-                    return formData.OrderPrice;
-                }
-                // 超价
-                case 4: {
-                    if (ask && bid) {
-                        // 系统参数
-                        const paramValue = APP.get('systemParams').find((el: Systemparam) => el.paramcode === '148')?.paramvalue ?? '0';
-                        // 点数
-                        const point = decimalplace > 0 ? -decimalplace * quoteminunit * Number(paramValue) : 1;
-                        const num = Math.pow(10, point);
-                        return direction === BuyOrSell.buy ? ask + num : bid - num;
-                    }
-                    return 0;
-                }
-                default: {
-                    return 0;
-                }
-            }
+    // 买价
+    const buyPrice = computed(() => getPrice(BuyOrSell.buy));
+    // 卖价
+    const sellPrice = computed(() => getPrice(BuyOrSell.sell));
+    // 根据买卖方向返回价格
+    function getPrice(direction: BuyOrSell): number {
+      const { last, bid, ask, decimalplace, quoteminunit } = selectedGoods.value;
+      switch (selectedPriceType.value) {
+        // 最新价
+        case 0: {
+          return last;
         }
-
-        // 搜索商品合约
-        function filterOption(input: string, option: any) {
-            return option.children[0].children.includes(input);
+        // 市价
+        case 1: {
+          return direction === BuyOrSell.buy ? bid : ask;
         }
-
-        // 选择商品合约
-        function goodsChange(id: number) {
-            formData.OrderPrice = 0;
-            formData.OrderQty = 1;
-            selectedRowKeys.value = [];
-            selectedGoods.value = getGoods(id);
+        // 对手价
+        case 2: {
+          return direction === BuyOrSell.buy ? ask : bid;
         }
-
-        // 选择价格类型
-        function priceTypeChange(priceType: number) {
-            // 除了市价,其它价格类型都属于限价
-            if (priceType === 1) {
-                formData.PriceMode = PriceType.market;
-            } else {
-                formData.PriceMode = PriceType.limit;
-            }
+        // 限价
+        case 3: {
+          return formData.OrderPrice;
         }
-
-        // 减少交易数量
-        function minusQty() {
-            if (formData.OrderQty > 1) {
-                formData.OrderQty--;
-            }
+        // 超价
+        case 4: {
+          if (ask && bid) {
+            // 系统参数
+            const paramValue = APP.get('systemParams').find((el: Systemparam) => el.paramcode === '148')?.paramvalue ?? '0';
+            // 点数
+            const point = decimalplace > 0 ? -decimalplace * quoteminunit * Number(paramValue) : 1;
+            const num = Math.pow(10, point);
+            return direction === BuyOrSell.buy ? ask + num : bid - num;
+          }
+          return 0;
         }
-
-        // 增加交易数量
-        function plusQty() {
-            formData.OrderQty++;
+        default: {
+          return 0;
         }
+      }
+    }
 
-        function submit(submitType: 'buy' | 'sell' | 'close') {
-            let successMsg = '成功';
-            let failMsg = '失败';
+    // 搜索商品合约
+    function filterOption(input: string, option: any) {
+      return option.children[0].children.includes(input);
+    }
 
-            const { saleuserid, spotcontractid, bizsubjectid } = props.selectedRow;
-            // 判断是否套保交易
-            if (isHedging) {
-                formData.HedgeFlag = 4;
-                formData.SaleUserID = saleuserid;
-                formData.SpotContractID = Number(spotcontractid);
-                formData.BizSubjectID = bizsubjectid;
-            }
+    // 选择商品合约
+    function goodsChange(id: number) {
+      formData.OrderPrice = 0;
+      formData.OrderQty = 1;
+      selectedRowKeys.value = [];
+      selectedPosition.value = undefined;
+      selectedGoods.value = getGoods(id);
+    }
 
-            // 按钮提交类型
-            switch (submitType) {
-                case 'buy': {
-                    successMsg = '买入成功';
-                    failMsg = '买入失败';
-                    formData.BuyOrSell = BuyOrSell.buy;
-                    formData.ChannelBuildType = BuildType.open;
-                    formData.OrderPrice = buyPrice.value;
-                    break;
-                }
-                case 'sell': {
-                    successMsg = '卖出成功';
-                    failMsg = '卖出失败';
-                    formData.BuyOrSell = BuyOrSell.sell;
-                    formData.ChannelBuildType = BuildType.open;
-                    formData.OrderPrice = sellPrice.value;
-                    break;
-                }
-                case 'close': {
-                    successMsg = '平仓成功';
-                    failMsg = '平仓失败';
+    // 选择价格类型
+    function priceTypeChange(priceType: number) {
+      // 除了市价,其它价格类型都属于限价
+      if (priceType === 1) {
+        formData.PriceMode = PriceType.market;
+      } else {
+        formData.PriceMode = PriceType.limit;
+      }
+    }
 
-                    if (!selectedPosition.value) {
-                        message.error('请选择需要平仓的单据');
-                        return;
-                    }
+    // 减少交易数量
+    function minusQty() {
+      if (formData.OrderQty > 1) {
+        formData.OrderQty--;
+      }
+    }
 
-                    // 选中的单据数据
-                    const { curpositionqty, curtdpositionenabled, buyorsell } = selectedPosition.value;
+    // 增加交易数量
+    function plusQty() {
+      formData.OrderQty++;
+    }
 
-                    // 判断平仓数量
-                    if (formData.OrderQty > curpositionqty) {
-                        message.error('交易数量不能大于持仓可用数量');
-                        return;
-                    }
+    function submit(submitType: 'buy' | 'sell' | 'close') {
+      let successMsg = '成功';
+      let failMsg = '失败';
 
-                    formData.BuyOrSell = buyorsell === BuyOrSell.buy ? BuyOrSell.sell : BuyOrSell.buy; // 根据持仓方向选择平仓方向
-                    formData.OrderPrice = buyorsell === BuyOrSell.buy ? sellPrice.value : buyPrice.value; // 根据持仓方向选择平仓价格
-                    formData.ChannelBuildType = BuildType.close;
+      const { saleuserid, spotcontractid, bizsubjectid } = props.selectedRow;
+      // 判断是否套保交易
+      if (isHedging) {
+        formData.HedgeFlag = 4;
+        formData.SaleUserID = saleuserid;
+        formData.SpotContractID = spotcontractid;
+        formData.BizSubjectID = bizsubjectid;
+      }
 
-                    const account = accountList.find((el) => el.accountid === formData.AccountID)!;
-                    // 判断是否母账号
-                    if (account.ismain) {
-                        if (selectedGoods.value.outerdealmode === 3 && curtdpositionenabled > 0) {
-                            formData.CloseTodayQty = curtdpositionenabled;
-                        }
-                    }
-                    break;
-                }
+      // 按钮提交类型
+      switch (submitType) {
+        case 'buy': {
+          successMsg = '买入成功';
+          failMsg = '买入失败';
+          formData.BuyOrSell = BuyOrSell.buy;
+          formData.ChannelBuildType = BuildType.open;
+          formData.OrderPrice = buyPrice.value;
+          break;
+        }
+        case 'sell': {
+          successMsg = '卖出成功';
+          failMsg = '卖出失败';
+          formData.BuyOrSell = BuyOrSell.sell;
+          formData.ChannelBuildType = BuildType.open;
+          formData.OrderPrice = sellPrice.value;
+          break;
+        }
+        case 'close': {
+          successMsg = '平仓成功';
+          failMsg = '平仓失败';
+
+          if (!selectedPosition.value) {
+            message.error('请选择需要平仓的单据');
+            return;
+          }
+
+          // 选中的单据数据
+          const { curpositionqty, curtdpositionenabled, buyorsell } = selectedPosition.value;
+
+          // 判断平仓数量
+          if (formData.OrderQty > curpositionqty) {
+            message.error('交易数量不能大于持仓可用数量');
+            return;
+          }
+
+          formData.BuyOrSell = buyorsell === BuyOrSell.buy ? BuyOrSell.sell : BuyOrSell.buy; // 根据持仓方向选择平仓方向
+          formData.OrderPrice = buyorsell === BuyOrSell.buy ? sellPrice.value : buyPrice.value; // 根据持仓方向选择平仓价格
+          formData.ChannelBuildType = BuildType.close;
+
+          const account = accountList.find((el) => el.accountid === formData.AccountID)!;
+          // 判断是否母账号
+          if (account.ismain) {
+            if (selectedGoods.value.outerdealmode === 3 && curtdpositionenabled > 0) {
+              formData.CloseTodayQty = curtdpositionenabled;
             }
-            // 表单验证
-            validateAction(formRef, formData).then((res) => {
-                requestResultLoadingAndInfo(channelOrderReq, res, loading, [successMsg, failMsg]).then(() => {
-                    cancel(true);
-                });
-            });
+          }
+          break;
         }
-        return {
-            submit,
-            cancel,
-            loading,
-            visible,
-            accountList,
-            positionList,
-            rules,
-            formRef,
-            formData,
-            isHedging,
-            goodsList,
-            buyPrice,
-            sellPrice,
-            selectedGoods,
-            getPositionList,
-            goodsChange,
-            selectedRowKeys,
-            selectedPosition,
-            priceTypeList,
-            PriceType,
-            selectedPriceType,
-            filterOption,
-            priceTypeChange,
-            getColumns,
-            onSelectChange,
-            minusQty,
-            plusQty,
-            BuyOrSell,
-        };
-    },
+      }
+      // 表单验证
+      validateAction(formRef, formData).then((res) => {
+        requestResultLoadingAndInfo(channelOrderReq, res, loading, [successMsg, failMsg]).then(() => {
+          cancel(true);
+        });
+      });
+    }
+    return {
+      submit,
+      cancel,
+      loading,
+      visible,
+      accountList,
+      positionList,
+      rules,
+      formRef,
+      formData,
+      isHedging,
+      goodsList,
+      buyPrice,
+      sellPrice,
+      selectedGoods,
+      getPositionList,
+      goodsChange,
+      selectedRowKeys,
+      selectedPosition,
+      priceTypeList,
+      PriceType,
+      selectedPriceType,
+      filterOption,
+      priceTypeChange,
+      getColumns,
+      onSelectChange,
+      minusQty,
+      plusQty,
+      BuyOrSell,
+    };
+  },
 });
 </script>
 

+ 51 - 51
src/views/market/futures/index.vue

@@ -28,59 +28,59 @@ import { ContextMenuTemp } from '@/common/components/contextMenu/interface';
 import { BtnListType } from '@/common/components/btnList/interface';
 
 export default defineComponent({
-    name: 'spot_trade_order_transaction_swap',
-    components: {
-        ThridMenu,
-        contextMenu,
-        chart: defineAsyncComponent(() => import('../spot_trade/components/goods-chart/index.vue')),
-        trade: defineAsyncComponent(() => import('./compoments/futures-trade/index.vue')),
-    },
-    setup() {
-        const isBottom = getShowBottomValue();
-        const buttons = getTableButton();
-        const { loading, exchangeId, tabList, tableList, changeTab } = useExternalexchange();
+  name: 'spot_trade_order_transaction_swap',
+  components: {
+    ThridMenu,
+    contextMenu,
+    chart: defineAsyncComponent(() => import('../spot_trade/components/goods-chart/index.vue')),
+    trade: defineAsyncComponent(() => import('./compoments/futures-trade/index.vue')),
+  },
+  setup() {
+    const isBottom = getShowBottomValue();
+    const buttons = getTableButton();
+    const { loading, exchangeId, tabList, tableList, changeTab } = useExternalexchange();
 
-        // 右键逻辑
-        const { contextMenu, closeContext: closeContextAction } = handleContextMenu();
-        // 右键回调函数
-        const eventsCB: TableEventCB = {
-            clickCB: (record: GoodsQuote) => {
-                componentId.value = 'chart';
-            },
-            contextmenuCB: (record: GoodsQuote, value: ContextMenuTemp) => {
-                // 控制打开右键
-                contextMenu.value = value;
-            },
-        };
-        // 表格事件
-        const { selectedRow, Rowclick } = getTableEvent<GoodsQuote>(eventsCB);
-        // 控制异步组件
-        const { componentId, closeComponent, openComponent } = handleModalComponent(() => {}, selectedRow);
-        // 关闭右键
-        function closeContext(value: BtnListType | null) {
-            // 打开对应的弹窗组件
-            if (value) openComponent(value, selectedRow.value);
-            // 关闭右键
-            closeContextAction();
-        }
+    // 右键逻辑
+    const { contextMenu, closeContext: closeContextAction } = handleContextMenu();
+    // 右键回调函数
+    const eventsCB: TableEventCB = {
+      clickCB: (record: GoodsQuote) => {
+        componentId.value = 'chart';
+      },
+      contextmenuCB: (record: GoodsQuote, value: ContextMenuTemp) => {
+        // 控制打开右键
+        contextMenu.value = value;
+      },
+    };
+    // 表格事件
+    const { selectedRow, Rowclick } = getTableEvent<GoodsQuote>(eventsCB);
+    // 控制异步组件
+    const { componentId, closeComponent, openComponent } = handleModalComponent(() => { }, selectedRow);
+    // 关闭右键
+    function closeContext(value: BtnListType | null) {
+      // 打开对应的弹窗组件
+      if (value) openComponent(value, selectedRow.value);
+      // 关闭右键
+      closeContextAction();
+    }
 
-        return {
-            loading,
-            exchangeId,
-            tabList,
-            changeTab,
-            tableList,
-            isBottom,
-            getColumnsList,
-            buttons,
-            contextMenu,
-            closeContext,
-            Rowclick,
-            componentId,
-            closeComponent,
-            selectedRow,
-        };
-    },
+    return {
+      loading,
+      exchangeId,
+      tabList,
+      changeTab,
+      tableList,
+      isBottom,
+      getColumnsList,
+      buttons,
+      contextMenu,
+      closeContext,
+      Rowclick,
+      componentId,
+      closeComponent,
+      selectedRow,
+    };
+  },
 });
 </script>
 <style lang="less">

+ 27 - 27
src/views/order/futures_information/components/futures_information_position/index.vue

@@ -24,36 +24,36 @@ import { getColumns } from './columns';
 import Bus from '@/utils/eventBus/index';
 
 export default defineComponent({
-    components: {
-        BtnList,
-        close: defineAsyncComponent(() => import('@/views/market/futures/compoments/futures-trade/index.vue')),
-    },
-    setup() {
-        // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<QueryErmcpTradePositionRsp>();
+  components: {
+    BtnList,
+    close: defineAsyncComponent(() => import('@/views/market/futures/compoments/futures-trade/index.vue')),
+  },
+  setup() {
+    // 表格列表数据
+    const { loading, tableList, queryTable } = queryTableList<QueryErmcpTradePositionRsp>();
 
-        // 获取列表数据
-        const queryTableAction = () => queryTable(queryErmcpTradePosition);
+    // 获取列表数据
+    const queryTableAction = () => queryTable(queryErmcpTradePosition);
 
-        // 表格通用逻辑
-        const param: ComposeOrderTableParam = {
-            queryFn: queryTableAction,
-            recordList: getRecordItemTab(),
-        };
+    // 表格通用逻辑
+    const param: ComposeOrderTableParam = {
+      queryFn: queryTableAction,
+      recordList: getRecordItemTab(),
+    };
 
-        // 注册资金变化事件,待通知调用
-        Bus.$on('moneyChangedNtf_UI', () => {
-            // 重新加载数据
-            queryTableAction();
-        });
+    // 注册资金变化事件,待通知调用
+    Bus.$on('moneyChangedNtf_UI', () => {
+      // 重新加载数据
+      queryTableAction();
+    });
 
-        return {
-            ...handleComposeOrderTable(param),
-            getColumns,
-            loading,
-            expandIcon,
-            tableList,
-        };
-    },
+    return {
+      ...handleComposeOrderTable(param),
+      getColumns,
+      loading,
+      expandIcon,
+      tableList,
+    };
+  },
 });
 </script>