|
|
@@ -1,6 +1,6 @@
|
|
|
<!-- 商品订单-持仓汇总 -->
|
|
|
<template>
|
|
|
- <app-table :data="positionList" v-model:columns="tableColumns" @row-click="showComponent">
|
|
|
+ <app-table :data="positionList" v-model:columns="tableColumns">
|
|
|
<!-- 挂牌类型 -->
|
|
|
<template #buyorsell="{ value }">
|
|
|
{{ getBuyOrSellName(value) }}
|
|
|
@@ -23,18 +23,13 @@
|
|
|
<template #operate="{ row }">
|
|
|
<app-auth-operation :code="code" :menus="handleOperateButtons(row)" :options="{ selectedRow: row }" />
|
|
|
</template>
|
|
|
- <template #footer>
|
|
|
- <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
|
|
|
- @closed="closeComponent" v-if="componentId" />
|
|
|
- </template>
|
|
|
</app-table>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
+import { shallowRef } from 'vue'
|
|
|
import { handleNumberValue, formatDecimal } from '@/filters'
|
|
|
import { getBuyOrSellName } from '@/constants/order'
|
|
|
-import { useComponent } from '@/hooks/component'
|
|
|
import { usePosition } from '@/business/position'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
|
|
|
@@ -43,13 +38,7 @@ defineProps({
|
|
|
code: String
|
|
|
})
|
|
|
|
|
|
-const componentMap = new Map<string, unknown>([
|
|
|
- ['transfer', defineAsyncComponent(() => import('./components/transfer/index.vue'))],
|
|
|
-])
|
|
|
-
|
|
|
const { positionList } = usePosition(50, 16)
|
|
|
-const selectedRow = shallowRef<Model.TradePositionRsp>()
|
|
|
-const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
|
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ prop: 'goodsname', label: '订单合约' },
|
|
|
@@ -77,9 +66,4 @@ const handleOperateButtons = (row: Model.TradePositionRsp) => {
|
|
|
}
|
|
|
return buttons
|
|
|
}
|
|
|
-
|
|
|
-const showComponent = (row: Model.TradePositionRsp) => {
|
|
|
- selectedRow.value = row
|
|
|
- openComponent('transfer')
|
|
|
-}
|
|
|
</script>
|