huangbin пре 4 година
родитељ
комит
1eff199736
2 измењених фајлова са 43 додато и 17 уклоњено
  1. 2 2
      src/common/setup/table/list.ts
  2. 41 15
      src/views/business/exposure/list/realTime/index.vue

+ 2 - 2
src/common/setup/table/list.ts

@@ -7,7 +7,7 @@ import { ref } from 'vue';
  * @param ishandleFloatErr 是否处理浮点失真问题
  * @returns
  */
-export function queryTableList<T>(ishandleFloatErr = false) {
+export function queryTableList<T>(ishandleFloatErr = false, num?: number) {
     // 加载状态
     const loading = ref<boolean>(false);
     // 表格数据
@@ -35,7 +35,7 @@ export function queryTableList<T>(ishandleFloatErr = false) {
                     result?.forEach((e: T, i: number) => {
                         for (const item in e) {
                             const decimal = (e as any).decimalplace
-                            const count = decimal ? decimal : 4
+                            const count = decimal ? decimal : num
                             e[item] = getDecimalsNum(e[item], count, decimal)
                         }
                     });

+ 41 - 15
src/views/business/exposure/list/realTime/index.vue

@@ -12,8 +12,35 @@
              rowKey="key"
              :data-source="tableList"
              :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
-      <template #DiffSpotQty="{ record }">
+      <!-- <template #DiffSpotQty="{ record }">
         <span>{{ record.DiffSpotQty.toFixed(2) + " " + record.ENUMDICNAME }}</span>
+      </template> -->
+      <!-- <template #DiffHedgeQty="{ record }">
+        <span>{{ record.DiffHedgeQty.toFixed(2) + " " + record.ENUMDICNAME }}</span>
+      </template>
+      <template #TotalFutureQty="{ record }">
+        <span>{{ record.TotalFutureQty.toFixed(2) + " " + record.ENUMDICNAME }}</span>
+      </template>
+      <template #DiffFutuQty="{ record }">
+        <span>{{ record.DiffFutuQty.toFixed(2) + " " + record.ENUMDICNAME }}</span>
+      </template>
+      <template #DiffExposoureQty="{ record }">
+        <span>{{ record.DiffExposoureQty.toFixed(2) + " " + record.ENUMDICNAME }}</span>
+      </template>
+      <template #DiffQty="{ record }">
+        <span>{{ record.DiffQty.toFixed(2) + " " + record.ENUMDICNAME }}</span>
+      </template>
+      <template #hedgeqty="{ record }">
+        <span>{{ record.hedgeqty.toFixed(2) + " " + record.ENUMDICNAME }}</span>
+      </template>
+      <template #arbitrageqty="{ record }">
+        <span>{{ record.arbitrageqty.toFixed(2) + " " + record.ENUMDICNAME }}</span>
+      </template>
+      <template #DiffArbitrageQty="{ record }">
+        <span>{{ record.DiffArbitrageQty.toFixed(2) + " " + record.ENUMDICNAME }}</span>
+      </template>
+      <template #needarbitrageqty="{ record }">
+        <span>{{ record.needarbitrageqty.toFixed(2) + " " + record.ENUMDICNAME }}</span>
       </template>
       <template #TotalNeedHedgeQty="{ record }">
         <span>{{ record.TotalNeedHedgeQty.toFixed(2) + " " + record.ENUMDICNAME }}</span>
@@ -23,7 +50,7 @@
       </template>
       <template #OriTotalSpotQty="{ record }">
         <span>{{ record.oriTotalSpotQty.toFixed(2) + " " + record.ENUMDICNAME }}</span>
-      </template>
+      </template> -->
     </a-table>
     <!-- 明细 -->
     <Description v-if="visible"
@@ -36,15 +63,15 @@
                rowKey="key"
                :data-source="detailTableList"
                :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
-          <!-- 套保品种/代码 -->
-          <template #middlegoodsname="{ record }">
-              <span>{{ record.middlegoodsname + "/" +  record.middlegoodscode}}</span>
-          </template>
+        <!-- 套保品种/代码 -->
+        <template #middlegoodsname="{ record }">
+          <span>{{ record.middlegoodsname + "/" +  record.middlegoodscode}}</span>
+        </template>
 
-          <!-- 类型 -->
-          <template #contracttype="{ record }">
-              <span>{{ getPlanContractType(record.contracttype) }}</span>
-          </template>
+        <!-- 类型 -->
+        <template #contracttype="{ record }">
+          <span>{{ getPlanContractType(record.contracttype) }}</span>
+        </template>
       </a-table>
     </Description>
   </div>
@@ -64,8 +91,8 @@ import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { formatValue } from '@/common/methods';
 import { formatNumber } from '@/common/methods/format';
-import {getBizTypeName, getContractTypeName, getLogType} from "@/common/constants/enumsName";
-import {getPlanContractType} from "@/views/business/plan/setup";
+import { getBizTypeName, getContractTypeName, getLogType } from '@/common/constants/enumsName';
+import { getPlanContractType } from '@/views/business/plan/setup';
 
 export default defineComponent({
     name: EnumRouterName.exposure_realtime,
@@ -75,7 +102,7 @@ export default defineComponent({
     },
     setup() {
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<ErmcpRealExposureModel>();
+        const { loading, tableList, queryTable } = queryTableList<ErmcpRealExposureModel>(true, 2);
         // 获取列表数据
         const queryTableAction = () => queryTable(QueryActualExposure);
         const param: ComposeTableDetailParam = {
@@ -132,8 +159,7 @@ export default defineComponent({
             }
         });
 
-        return { loading, tableList, visible, closeDrawer, columns, updateColumn, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, changeTab, formatNumber, getBizTypeName, getPlanContractType
-            ,getLogType  };
+        return { loading, tableList, visible, closeDrawer, columns, updateColumn, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, changeTab, formatNumber, getBizTypeName, getPlanContractType, getLogType };
     },
 });
 </script>