|
|
@@ -28,10 +28,10 @@ import { defineComponent, watchEffect } from 'vue';
|
|
|
import filterCustomTable from '../../components/filterTable/index.vue';
|
|
|
import { QueryActualExposure, QueryActualExposureDetail, QueryAutualExposurePosition } from '@/services/go/ermcp/exposure/index';
|
|
|
import { ErmcpRealExposureModel } from '@/services/go/ermcp/exposure/interface';
|
|
|
-import BtnList from '@/common/components/buttonList/index.vue';
|
|
|
import Description from '@/common/components/description/index.vue';
|
|
|
import { queryTableList } from '@/common/setup/table';
|
|
|
import { ComposeTableDetailParam } from '@/common/setup/table/interface';
|
|
|
+import { TabList } from '@/common/components/description/interface';
|
|
|
import { handleComposeTable_detail } from '@/common/setup/table/compose';
|
|
|
import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
|
|
|
@@ -50,6 +50,7 @@ export default defineComponent({
|
|
|
queryFn: queryTableAction, // 查询表格数据
|
|
|
tableName: 'table_pcweb_exposure', // 表头key
|
|
|
tableFilterKey: ['MiddleGoodsName'], // 表格过滤字段
|
|
|
+ menuType: 'exposure_realtime', // 当前tab页对应的code
|
|
|
};
|
|
|
const {
|
|
|
visible,
|
|
|
@@ -62,38 +63,39 @@ export default defineComponent({
|
|
|
expandedRowKeys,
|
|
|
selectedRow,
|
|
|
Rowclick, // 表格事件
|
|
|
+ tabList,
|
|
|
} = handleComposeTable_detail<ErmcpRealExposureModel>(param);
|
|
|
- const tabList = [{ lable: '现货明细' }, { lable: '期货明细' }];
|
|
|
|
|
|
- // 现货明细信息
|
|
|
- function AEDetail() {
|
|
|
- // 注册表头
|
|
|
- registerColumnDetail('table_pcweb_exposure_detail', []);
|
|
|
- const middlegoodsid = selectedRow.value?.MiddleGoodsID;
|
|
|
- if (middlegoodsid) {
|
|
|
- queryResultLoadingAndInfo(QueryActualExposureDetail, loading, { middlegoodsid }).then((res) => {
|
|
|
- detailTableList.value = res;
|
|
|
- });
|
|
|
+ // 切换明细
|
|
|
+ function changeTab(index: number, current: TabList) {
|
|
|
+ const { code, lable } = current;
|
|
|
+ let fn = null;
|
|
|
+ if (code === 'exposure_realtime_spot_details') {
|
|
|
+ // 现货明细信息
|
|
|
+ // 注册表头
|
|
|
+ registerColumnDetail('table_pcweb_exposure_detail', []);
|
|
|
+ fn = QueryActualExposureDetail;
|
|
|
+ } else if (code === 'exposure_realtime_futures_details') {
|
|
|
+ // 期货明细
|
|
|
+ // 注册表头
|
|
|
+ registerColumnDetail('table_pcweb_exposure_futures_detail', []);
|
|
|
+ fn = QueryAutualExposurePosition;
|
|
|
+ } else {
|
|
|
+ console.error(`${lable}没有配置对应的code: ${code},`);
|
|
|
+ return;
|
|
|
}
|
|
|
- }
|
|
|
- // 期货头寸明细
|
|
|
- function AEPostion() {
|
|
|
- // 注册表头
|
|
|
- registerColumnDetail('table_pcweb_exposure_futures_detail', []);
|
|
|
const middlegoodsid = selectedRow.value?.MiddleGoodsID;
|
|
|
if (middlegoodsid) {
|
|
|
- queryResultLoadingAndInfo(QueryAutualExposurePosition, loading, { middlegoodsid }).then((res) => {
|
|
|
+ queryResultLoadingAndInfo(fn, loading, { middlegoodsid }).then((res) => {
|
|
|
detailTableList.value = res;
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- // 切换明细
|
|
|
- function changeTab(index: number) {
|
|
|
- index ? AEPostion() : AEDetail();
|
|
|
- }
|
|
|
watchEffect(() => {
|
|
|
if (visible.value) {
|
|
|
- AEDetail();
|
|
|
+ if (tabList.value.length) {
|
|
|
+ changeTab(0, tabList.value[0]);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|