Bladeren bron

修改商品掉期 合约汇总 表头

huangbin 4 jaren geleden
bovenliggende
commit
4a4ebdd731

+ 3 - 3
src/views/order/swap_the_order/components/swap_commodity_contract_summary/index.vue

@@ -2,7 +2,7 @@
   <!-- 商品订单 - 合约汇总 -->
   <section>
     <a-table
-      :columns="tabColumns"
+      :columns="getTableColums()"
       class="srcollYTableExpendBgColor srcollYTable expandLeftTable"
       :scroll="{ x: '100%', y: '190px' }"
       :pagination="false"
@@ -102,7 +102,7 @@ import { QueryQuoteGoodsListRsp } from '@/services/go/Tjmd/interface';
 import Bus from '@/utils/eventBus/index';
 import { isInvestment } from '@/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/setup';
 import { ref } from 'vue';
-import { findGoodsCode, getSwapList, tabColumns, useDetail } from './setup';
+import { findGoodsCode, getSwapList, getTableColums, useDetail } from './setup';
 
 export default defineComponent({
   name: enumOrderComponents.commodity_contract_summary,
@@ -173,7 +173,7 @@ export default defineComponent({
       useProfitloss,
       useHolderprice,
       handleBtnList,
-      tabColumns,
+      getTableColums,
       getBuyOrSellName,
       swapList,
       handleNoneValue,

+ 16 - 103
src/views/order/swap_the_order/components/swap_commodity_contract_summary/setup.ts

@@ -39,108 +39,21 @@ export function getSwapList() {
     return queryTable(queryQuoteGoodsList, param)
 }
 
-export const tabColumns = [
-    {
-        key: '10th',
-        dataIndex: 'goodsname',
-        title: '订单合约',
-        align: 'center',
-        slots: {
-            customRender: 'goodsname',
-        },
-        width: 120,
-    },
-    {
-        key: '7th',
-        dataIndex: 'buyorsell',
-        title: '方向',
-        align: 'center',
-        slots: {
-            customRender: 'buyorsell',
-        },
-        width: 120,
-    },
-    {
-        key: '8th',
-        dataIndex: 'curpositionqty',
-        title: '持有数量',
-        align: 'center',
-        slots: {
-            customRender: 'curpositionqty',
-        },
-        width: 120,
-    },
-    {
-        key: '9th',
-        dataIndex: 'enableqty',
-        title: '可用数量',
-        align: 'center',
-        slots: {
-            customRender: 'enableqty',
-        },
-        width: 120,
-    },
-    {
-        key: '0th',
-        dataIndex: 'frozenqty',
-        title: '冻结数量',
-        align: 'center',
-        slots: {
-            customRender: 'frozenqty',
-        },
-        width: 120,
-    },
-    {
-        key: '1th',
-        dataIndex: 'averageprice',
-        title: '均价',
-        align: 'center',
-        slots: {
-            customRender: 'averageprice',
-        },
-        width: 120,
-    },
-    {
-        key: '2th',
-        dataIndex: 'lastprice',
-        title: '现价',
-        align: 'center',
-        slots: {
-            customRender: 'lastprice',
-        },
-        width: 120,
-    },
-    {
-        key: '3th',
-        dataIndex: 'curholderamount',
-        title: '持仓金额',
-        align: 'center',
-        slots: {
-            customRender: 'curholderamount',
-        },
-        width: 120,
-    },
-    {
-        key: '5th',
-        dataIndex: 'marketamount',
-        title: '市值',
-        align: 'center',
-        slots: {
-            customRender: 'marketamount',
-        },
-        width: 120,
-    },
-    {
-        key: '6th',
-        dataIndex: 'profitloss',
-        title: '浮动盈亏',
-        align: 'center',
-        slots: {
-            customRender: 'profitloss',
-        },
-        width: 120,
-    },
-];
+export function getTableColums() {
+    const list: ItemColumns[] = [
+        { key: 'goodsname', title: '订单合约' },
+        { key: 'buyorsell', title: '方向' },
+        { key: 'curpositionqty', title: '持有数量' },
+        { key: 'enableqty', title: '可用数量' },
+        { key: 'frozenqty', title: '冻结数量' },
+        { key: 'averageprice', title: '均价' },
+        { key: 'lastprice', title: '现价' },
+        { key: 'curholderamount', title: '持仓金额' },
+        { key: 'marketamount', title: '市值' },
+        { key: 'profitloss', title: '浮动盈亏' },
+    ]
+    return useSetColumns(list)
+}
 
 // 明细
 export const useDetail = () => {
@@ -166,7 +79,7 @@ export const useDetail = () => {
     // 表头
     function getDetailColums() {
         const list: ItemColumns[] = [
-            { key: 'tradetime', title: '建仓时间', width: 160 },
+            { key: 'tradetime', title: '建仓时间', width: 140 },
             { key: 'expiredate', title: '到期日' },
             { key: 'openqty', title: '建仓数量' },
             { key: 'holderqty', title: '可用数量' },