|
@@ -26,56 +26,53 @@
|
|
|
</template>
|
|
</template>
|
|
|
</mtp-table-scroll>
|
|
</mtp-table-scroll>
|
|
|
<!-- 明细 -->
|
|
<!-- 明细 -->
|
|
|
- <Description v-if="visible" @close="closeDrawer" @changeTab="changeTab" :tabList="tabList">
|
|
|
|
|
- <a-table :columns="columnsDetail" class="topTable" :pagination="false" :rowKey="(record,index)=>index" :data-source="detailTableList" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
|
|
|
|
|
- <!-- 套保品种/代码 -->
|
|
|
|
|
- <template #middlegoodsname="{ record }" v-if="!isPingAnOem()">
|
|
|
|
|
- <span>{{ record.middlegoodsname + '/' + record.middlegoodscode }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template #convertfactor="{record}">
|
|
|
|
|
- <span>{{record.convertratio}}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template #goodsname="{ record }" v-if="!isPingAnOem()">
|
|
|
|
|
- <span>{{ record.goodsname + '/' + record.goodscode }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-if="isPingAnOem()" #index="{ index }">
|
|
|
|
|
- <span>{{ index + 1 }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- <!-- 类型 -->
|
|
|
|
|
- <template #contracttype="{ record }">
|
|
|
|
|
- <span>{{ getPlanContractType(record.contracttype) }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </a-table>
|
|
|
|
|
- </Description>
|
|
|
|
|
|
|
+ <mtp-table-detail :columns="columnsDetail" :data-source="detailTableList" :tabs="tabList" v-model:visible="visible" @change="changeTab">
|
|
|
|
|
+ <!-- 套保品种/代码 -->
|
|
|
|
|
+ <template #middlegoodsname="{ record }" v-if="!isPingAnOem()">
|
|
|
|
|
+ <span>{{ record.middlegoodsname + '/' + record.middlegoodscode }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #convertfactor="{record}">
|
|
|
|
|
+ <span>{{record.convertratio}}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #goodsname="{ record }" v-if="!isPingAnOem()">
|
|
|
|
|
+ <span>{{ record.goodsname + '/' + record.goodscode }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="isPingAnOem()" #index="{ index }">
|
|
|
|
|
+ <span>{{ index + 1 }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <!-- 类型 -->
|
|
|
|
|
+ <template #contracttype="{ record }">
|
|
|
|
|
+ <span>{{ getPlanContractType(record.contracttype) }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </mtp-table-detail>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
import MtpTableScroll from '@/common/components/tableScroll/index.vue';
|
|
import MtpTableScroll from '@/common/components/tableScroll/index.vue';
|
|
|
-import { defineComponent, onUnmounted, ref, watchEffect } from 'vue';
|
|
|
|
|
|
|
+import { defineComponent, onUnmounted, ref, watch } from 'vue';
|
|
|
import filterCustomTable from '../../components/filterTable/index.vue';
|
|
import filterCustomTable from '../../components/filterTable/index.vue';
|
|
|
import { QueryActualExposure, QueryActualExposureDetail, QueryAutualExposurePosition } from '@/services/go/ermcp/exposure/index';
|
|
import { QueryActualExposure, QueryActualExposureDetail, QueryAutualExposurePosition } from '@/services/go/ermcp/exposure/index';
|
|
|
import { ErmcpRealExposureModel } from '@/services/go/ermcp/exposure/interface';
|
|
import { ErmcpRealExposureModel } from '@/services/go/ermcp/exposure/interface';
|
|
|
-import Description from '@/common/components/description/index.vue';
|
|
|
|
|
import { queryTableList } from '@/common/setup/table';
|
|
import { queryTableList } from '@/common/setup/table';
|
|
|
import { ComposeTableDetailParam } from '@/common/setup/table/interface';
|
|
import { ComposeTableDetailParam } from '@/common/setup/table/interface';
|
|
|
-import { TabList } from '@/common/components/description/interface';
|
|
|
|
|
import { handleComposeTable_detail } from '@/common/setup/table/compose';
|
|
import { handleComposeTable_detail } from '@/common/setup/table/compose';
|
|
|
import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
|
-import { formatValue, initData } from '@/common/methods';
|
|
|
|
|
|
|
+import { initData } from '@/common/methods';
|
|
|
import { formatNumber } from '@/common/methods/format';
|
|
import { formatNumber } from '@/common/methods/format';
|
|
|
-import { getBizTypeName, getContractTypeName, getLogType } from '@/common/constants/enumsName';
|
|
|
|
|
|
|
+import { getBizTypeName, getLogType } from '@/common/constants/enumsName';
|
|
|
import { getPlanContractType } from '@/views/business/plan/setup';
|
|
import { getPlanContractType } from '@/views/business/plan/setup';
|
|
|
import timerUtil from '@/utils/timer/timerUtil';
|
|
import timerUtil from '@/utils/timer/timerUtil';
|
|
|
import { isPingAnOem } from '@/common/config/projectName';
|
|
import { isPingAnOem } from '@/common/config/projectName';
|
|
|
import { pingan_realTime_columns } from './setup';
|
|
import { pingan_realTime_columns } from './setup';
|
|
|
import { getTableButton } from '@/common/setup/table/button';
|
|
import { getTableButton } from '@/common/setup/table/button';
|
|
|
|
|
+import MtpTableDetail from '@/common/components/tableDetail/index.vue';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: EnumRouterName.exposure_realtime,
|
|
name: EnumRouterName.exposure_realtime,
|
|
|
components: {
|
|
components: {
|
|
|
MtpTableScroll,
|
|
MtpTableScroll,
|
|
|
- Description,
|
|
|
|
|
|
|
+ MtpTableDetail,
|
|
|
filterCustomTable,
|
|
filterCustomTable,
|
|
|
},
|
|
},
|
|
|
setup() {
|
|
setup() {
|
|
@@ -89,8 +86,14 @@ export default defineComponent({
|
|
|
const isStart = ref<boolean>(false);
|
|
const isStart = ref<boolean>(false);
|
|
|
// 表格列表数据
|
|
// 表格列表数据
|
|
|
const { loading, tableList, queryTable } = queryTableList<ErmcpRealExposureModel>(true, 2);
|
|
const { loading, tableList, queryTable } = queryTableList<ErmcpRealExposureModel>(true, 2);
|
|
|
|
|
+ // 控制明细显示/隐藏
|
|
|
|
|
+ const visible = ref(true);
|
|
|
// 获取列表数据
|
|
// 获取列表数据
|
|
|
- const queryTableAction = () => queryTable(QueryActualExposure);
|
|
|
|
|
|
|
+ const queryTableAction = () => queryTable(QueryActualExposure).then((res) => {
|
|
|
|
|
+ if (res.length) {
|
|
|
|
|
+ selectedRow.value = res[0];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
const param: ComposeTableDetailParam = {
|
|
const param: ComposeTableDetailParam = {
|
|
|
queryFn: queryTableAction, // 查询表格数据
|
|
queryFn: queryTableAction, // 查询表格数据
|
|
|
// tableName: 'table_pcweb_exposure', // 表头key
|
|
// tableName: 'table_pcweb_exposure', // 表头key
|
|
@@ -119,7 +122,7 @@ export default defineComponent({
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- watchEffect(() => {
|
|
|
|
|
|
|
+ watch(num, () => {
|
|
|
if (num.value === 0) {
|
|
if (num.value === 0) {
|
|
|
timerUtil.clearInterval('countdown');
|
|
timerUtil.clearInterval('countdown');
|
|
|
num.value = 0;
|
|
num.value = 0;
|
|
@@ -149,8 +152,6 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
const {
|
|
const {
|
|
|
- visible,
|
|
|
|
|
- closeDrawer, // 控制 drawer 组件是否显示
|
|
|
|
|
columns,
|
|
columns,
|
|
|
updateColumn, // 表头数据
|
|
updateColumn, // 表头数据
|
|
|
columnsDetail,
|
|
columnsDetail,
|
|
@@ -163,6 +164,8 @@ export default defineComponent({
|
|
|
|
|
|
|
|
// 底部明细标签
|
|
// 底部明细标签
|
|
|
const tabList = getTableButton(['exposure_realtime_spot_details', 'exposure_realtime_futures_details', 'exposure_realtime_params_details']);
|
|
const tabList = getTableButton(['exposure_realtime_spot_details', 'exposure_realtime_futures_details', 'exposure_realtime_params_details']);
|
|
|
|
|
+ // 当前选中的标签
|
|
|
|
|
+ const tabIndex = ref(0);
|
|
|
|
|
|
|
|
const { listColumns, spotColumns } = pingan_realTime_columns();
|
|
const { listColumns, spotColumns } = pingan_realTime_columns();
|
|
|
initData(() => {
|
|
initData(() => {
|
|
@@ -172,9 +175,10 @@ export default defineComponent({
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// 切换明细
|
|
// 切换明细
|
|
|
- function changeTab(index: number, current: TabList) {
|
|
|
|
|
|
|
+ function changeTab(index: number) {
|
|
|
|
|
+ tabIndex.value = index;
|
|
|
detailTableList.value = [];
|
|
detailTableList.value = [];
|
|
|
- const { code, lable } = current;
|
|
|
|
|
|
|
+ const { code, lable } = tabList[index];
|
|
|
let fn = null;
|
|
let fn = null;
|
|
|
if (code === 'exposure_realtime_spot_details') {
|
|
if (code === 'exposure_realtime_spot_details') {
|
|
|
// 现货明细信息
|
|
// 现货明细信息
|
|
@@ -204,15 +208,15 @@ export default defineComponent({
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- watchEffect(() => {
|
|
|
|
|
- if (visible.value) {
|
|
|
|
|
- if (tabList.length) {
|
|
|
|
|
- changeTab(0, tabList[0]);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ watch(selectedRow, () => {
|
|
|
|
|
+ detailTableList.value = [];
|
|
|
|
|
+ if (tabList.length) {
|
|
|
|
|
+ visible.value = true;
|
|
|
|
|
+ changeTab(tabIndex.value);
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- return { loading, tableList, visible, closeDrawer, columns, updateColumn, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, changeTab, formatNumber, getBizTypeName, getPlanContractType, getLogType, diffTimes, timer, timerChange, isStart, setTimerAction, isPingAnOem, num };
|
|
|
|
|
|
|
+ return { loading, tableList, visible, columns, updateColumn, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, changeTab, formatNumber, getBizTypeName, getPlanContractType, getLogType, diffTimes, timer, timerChange, isStart, setTimerAction, isPingAnOem, num };
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|