|
|
@@ -7,7 +7,7 @@
|
|
|
<template #expand="{ row }">
|
|
|
<div class="buttonbar">
|
|
|
<el-button type="primary" size="small" :disabled="row.userid === loginStore.userId"
|
|
|
- @click="openComponent('delisting')">摘牌</el-button>
|
|
|
+ @click="showComponent('delisting', row)">摘牌</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</app-table>
|
|
|
@@ -17,7 +17,7 @@
|
|
|
<template #expand="{ row }">
|
|
|
<div class="buttonbar">
|
|
|
<el-button type="primary" size="small" :disabled="row.userid === loginStore.userId"
|
|
|
- @click="openComponent('delisting')">摘牌</el-button>
|
|
|
+ @click="showComponent('delisting', row)">摘牌</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</app-table>
|
|
|
@@ -27,14 +27,13 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, defineAsyncComponent, onUnmounted } from 'vue'
|
|
|
+import { shallowRef, defineAsyncComponent, watch } from 'vue'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { useComposeTable } from '@pc/components/base/table'
|
|
|
import { queryWrTradeOrderDetail } from '@/services/api/transfer'
|
|
|
-import { useLoginStore } from '@/stores'
|
|
|
-import eventBus from '@/services/bus'
|
|
|
+import { useLoginStore, useFuturesStore } from '@/stores'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
|
|
|
const props = defineProps({
|
|
|
@@ -49,6 +48,9 @@ const componentMap = new Map<string, unknown>([
|
|
|
])
|
|
|
|
|
|
const loginStore = useLoginStore()
|
|
|
+const futuresStore = useFuturesStore()
|
|
|
+const quote = futuresStore.getQuoteInfo(props.goodsId)
|
|
|
+
|
|
|
const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.WrTradeOrderDetailRsp>({ rowKey: 'orderid' })
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
|
|
|
@@ -78,14 +80,18 @@ const sellColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ prop: 'username', label: '购买方' },
|
|
|
])
|
|
|
|
|
|
-// 接收资金变动通知
|
|
|
-const moneyChangedNotify = eventBus.$on('MoneyChangedNotify', () => {
|
|
|
+const showComponent = (componentName: string, row: Model.WrTradeOrderDetailRsp) => {
|
|
|
+ selectedRow.value = row
|
|
|
+ openComponent(componentName)
|
|
|
+}
|
|
|
+
|
|
|
+// 监听行情变动
|
|
|
+watch(() => quote.value, () => {
|
|
|
getBuyList()
|
|
|
getSellList()
|
|
|
})
|
|
|
-
|
|
|
-onUnmounted(() => moneyChangedNotify.cancel())
|
|
|
</script>
|
|
|
+
|
|
|
<style lang="less">
|
|
|
@import './index.less';
|
|
|
</style>
|