|
@@ -27,7 +27,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, defineAsyncComponent, watch, PropType } from 'vue'
|
|
|
|
|
|
|
+import { shallowRef, defineAsyncComponent, watch, PropType, onUnmounted } from 'vue'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
import { useComponent } from '@/hooks/component'
|
|
@@ -35,6 +35,8 @@ import { useComposeTable } from '@pc/components/base/table'
|
|
|
import { queryTjmdTradeOrderDetail } from '@/services/api/swap'
|
|
import { queryTjmdTradeOrderDetail } from '@/services/api/swap'
|
|
|
import { useLoginStore, useFuturesStore } from '@/stores'
|
|
import { useLoginStore, useFuturesStore } from '@/stores'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
|
|
+import eventBus from '@/services/bus'
|
|
|
|
|
+import { onMounted } from 'vue'
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
goodsId: {
|
|
goodsId: {
|
|
@@ -56,7 +58,12 @@ const futuresStore = useFuturesStore()
|
|
|
const quote = futuresStore.getGoodsQuote(props.goodsId)
|
|
const quote = futuresStore.getGoodsQuote(props.goodsId)
|
|
|
|
|
|
|
|
const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.TjmdTradeOrderDetailRsp>({ rowKey: 'orderid' })
|
|
const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.TjmdTradeOrderDetailRsp>({ rowKey: 'orderid' })
|
|
|
-const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
|
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(()=> {
|
|
|
|
|
+ // 获取买大厅数据
|
|
|
|
|
+ getBuyList()
|
|
|
|
|
+ // 获取卖大厅数据
|
|
|
|
|
+ getSellList()
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
const { dataList: buyList, run: getBuyList } = useRequest(queryTjmdTradeOrderDetail, {
|
|
const { dataList: buyList, run: getBuyList } = useRequest(queryTjmdTradeOrderDetail, {
|
|
|
params: {
|
|
params: {
|
|
@@ -104,6 +111,19 @@ watch(() => quote.value, () => {
|
|
|
getBuyList()
|
|
getBuyList()
|
|
|
getSellList()
|
|
getSellList()
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+onUnmounted(() => {
|
|
|
|
|
+ notify.cancel()
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+// 推送委托回应通知
|
|
|
|
|
+const notify = eventBus.$on('OrderRsp', () => {
|
|
|
|
|
+ // 获取买大厅数据
|
|
|
|
|
+ getBuyList()
|
|
|
|
|
+ // 获取卖大厅数据
|
|
|
|
|
+ getSellList()
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|