|
|
@@ -1,30 +1,18 @@
|
|
|
<!-- 掉期市场 - 商品详情 - 买卖大厅 -->
|
|
|
<template>
|
|
|
<div class="app-goods-detail-order">
|
|
|
- <app-table class="sell" :data="sellList" v-model:columns="sellColumns" :row-key="rowKey"
|
|
|
- :expand-row-keys="expandKeys" @row-click="rowClick" showIndex>
|
|
|
- <template #username="{ row }">
|
|
|
- <span>{{ row.userid }}/{{ row.username }}</span>
|
|
|
- </template>
|
|
|
- <!-- 展开行 -->
|
|
|
- <template #expand="{ row }">
|
|
|
- <div class="buttonbar">
|
|
|
- <el-button type="primary" size="small" :disabled="row.userid === loginStore.userId"
|
|
|
- @click="onDelisting(row)">{{ getDelistingButtonTitles(0, row) }}</el-button>
|
|
|
- </div>
|
|
|
+ <app-table class="sell" :data="sellList" v-model:columns="sellColumns" >
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template #operate="{ row }">
|
|
|
+ <el-button type="primary" size="small" :disabled="isDisable(row)"
|
|
|
+ @click="onDelisting(row)">{{ getDelistingButtonTitles( 0, row ) }}</el-button>
|
|
|
</template>
|
|
|
</app-table>
|
|
|
- <app-table class="buy" :data="buyList" v-model:columns="buyColumns" :row-key="rowKey" :expand-row-keys="expandKeys"
|
|
|
- @row-click="rowClick" showIndex>
|
|
|
- <template #username="{ row }">
|
|
|
- <span>{{ row.userid }}/{{ row.username }}</span>
|
|
|
- </template>
|
|
|
- <!-- 展开行 -->
|
|
|
- <template #expand="{ row }">
|
|
|
- <div class="buttonbar">
|
|
|
- <el-button type="primary" size="small" :disabled="isDisable(row)" @click="onDelisting(row)">{{
|
|
|
+ <app-table class="buy" :data="buyList" v-model:columns="buyColumns">
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template #operate="{ row }">
|
|
|
+ <el-button type="primary" size="small" :disabled="isDisable(row)" @click="onDelisting(row)">{{
|
|
|
getDelistingButtonTitles(1, row) }}</el-button>
|
|
|
- </div>
|
|
|
</template>
|
|
|
</app-table>
|
|
|
<component ref="componentRef" v-bind="{ selectedRow, quoteGoods }" :is="componentMap.get(componentId)"
|
|
|
@@ -37,13 +25,14 @@ import { shallowRef, defineAsyncComponent, watch, PropType, onUnmounted } from '
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
-import { useComposeTable } from '@pc/components/base/table'
|
|
|
import { queryTjmdTradeOrderDetail, queryMdUserSwapProtocol } from '@/services/api/swap'
|
|
|
-import { useLoginStore, useFuturesStore } from '@/stores'
|
|
|
+import {useFuturesStore } from '@/stores'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
import eventBus from '@/services/bus'
|
|
|
import { getUserId } from '@/services/methods/user'
|
|
|
|
|
|
+const selectedRow = shallowRef<Model.TjmdTradeOrderDetailRsp>()
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
goodsId: {
|
|
|
type: Number,
|
|
|
@@ -60,7 +49,6 @@ const componentMap = new Map<string, unknown>([
|
|
|
['protocol', defineAsyncComponent(() => import('./protocol/index.vue'))], // 摘牌
|
|
|
])
|
|
|
|
|
|
-const loginStore = useLoginStore()
|
|
|
const futuresStore = useFuturesStore()
|
|
|
const quote = futuresStore.getGoodsQuote(props.goodsId)
|
|
|
|
|
|
@@ -79,8 +67,7 @@ const status = (row: Model.TjmdTradeOrderDetailRsp) => {
|
|
|
return protocolList.value.find((e) => e.areauserid === row.userid)?.protocolstatus ?? 1
|
|
|
}
|
|
|
|
|
|
-const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.TjmdTradeOrderDetailRsp>({ rowKey: 'orderid' })
|
|
|
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(()=> {
|
|
|
// 获取买大厅数据
|
|
|
getBuyList()
|
|
|
// 获取卖大厅数据
|
|
|
@@ -143,12 +130,14 @@ const buyColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ prop: 'orderprice', label: '买价' },
|
|
|
{ prop: 'orderqty', label: '买量' },
|
|
|
{ prop: 'username', label: '购买方' },
|
|
|
+ { prop: 'operate', label: '操作' },
|
|
|
])
|
|
|
|
|
|
const sellColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ prop: 'orderprice', label: '卖价' },
|
|
|
{ prop: 'orderqty', label: '卖量' },
|
|
|
{ prop: 'username', label: '销售方' },
|
|
|
+ { prop: 'operate', label: '操作' },
|
|
|
])
|
|
|
|
|
|
const showComponent = (componentName: string, row: Model.TjmdTradeOrderDetailRsp) => {
|