Handy_Cao 2 سال پیش
والد
کامیت
9300faea36

+ 4 - 4
src/packages/mobile/views/order/position/components/swap/close/Index.vue

@@ -3,7 +3,7 @@
     <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
         <app-view class="g-form">
             <template #header>
-                <app-navbar title="掉期持仓-平仓" @back="closed" />
+                <app-navbar title="掉期持仓-明细" @back="closed" />
             </template>
             <div style="padding: 0.15rem 0.2rem; color: #333;">
                 <span>商品:{{ selectedRow.goodsname }}/{{ selectedRow.goodscode }}</span>
@@ -50,7 +50,7 @@
                             </ul>
                         </div>
                         <div class="g-order-list__btnbar">
-                            <Button size="small" @click="onCloseSubmit(item)" round>平仓</Button>
+                            <Button size="small" v-if="useStore.userType === 5" @click="onCloseSubmit(item)" round>平仓</Button>
                         </div>
                     </div>
                 </div>
@@ -69,7 +69,7 @@ import { getBuyOrSellName } from '@/constants/order'
 import { formatDate, formatDecimal, handleRequestBigNumber, handlePriceColor } from '@/filters'
 import { useHolderClose } from '@/business/trade'
 import { dialog, fullloading } from '@/utils/vant'
-import { useFuturesStore } from '@/stores'
+import { useFuturesStore, useUserStore } from '@/stores'
 import { BuyOrSell } from '@/constants/order'
 import quoteSocket from '@/services/websocket/quote'
 import AppModal from '@/components/base/modal/index.vue'
@@ -82,7 +82,7 @@ const showModal = shallowRef(true)
 const refresh = shallowRef(false)
 const error = shallowRef(false)
 const subscribe = quoteSocket.createSubscribe()
-
+const useStore = useUserStore()
 const { holderCloseSubmit, formData } = useHolderClose()
 
 const props = defineProps({

+ 3 - 3
src/packages/mobile/views/order/position/components/swap/list/Index.vue

@@ -45,7 +45,7 @@
                     </ul>
                 </div>
                 <div class="g-order-list__btnbar">
-                    <Button size="small" v-if="useStore.userType === 5" @click="showComponent('close', item)" round>平仓</Button>
+                    <Button size="small" @click="showComponent('close', item)" round>明细</Button>
                 </div>
             </div>
         </div>
@@ -62,7 +62,7 @@ import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import { getBuyOrSellName } from '@/constants/order'
 import { formatDecimal, handleNumberValue, handlePriceColor } from '@/filters'
 import { usePosition } from '@/business/position'
-import { useFuturesStore, useUserStore } from '@/stores'
+import { useFuturesStore } from '@/stores'
 import eventBus from '@/services/bus'
 
 const componentMap = new Map<string, unknown>([
@@ -70,7 +70,7 @@ const componentMap = new Map<string, unknown>([
 ])
 
 const futuresStore = useFuturesStore()
-const useStore = useUserStore()
+
 const { positionList, loading } = usePosition(46)
 const selectedRow = shallowRef<Model.TradePositionRsp>()
 const pullRefreshRef = shallowRef()

+ 4 - 4
src/packages/pc/views/footer/swap/position/close/index.vue

@@ -1,6 +1,6 @@
 <!-- 掉期市场-持仓汇总-平仓 -->
 <template>
-    <app-drawer title="平仓" v-model:show="show" :width="1200" :loading="loading" :refresh="refresh">
+    <app-drawer title="明细" v-model:show="show" :width="1200" :loading="loading" :refresh="refresh">
         <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" :row-key="rowKey"
         :expand-row-keys="expandKeys" @row-click="rowClick">
             <!-- 商品代码/名称 -->
@@ -30,7 +30,7 @@
                 <span :class="handlePriceColor(closepl(row))">{{ formatDecimal(closepl(row)) }}</span>
             </template>
             <!-- 展开行 -->
-            <template #expand="{ row }">
+            <template v-if="useStore.userType === 5"  #expand="{ row }">
                 <div class="buttonbar">
                     <el-button type="danger" size="small" @click="onCloseSubmit(row)">平仓</el-button>
                 </div>
@@ -55,7 +55,7 @@ import { ETradeMode } from '@/constants/client'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import AppTable from '@pc/components/base/table/index.vue'
 import quoteSocket from '@/services/websocket/quote'
-import { useFuturesStore } from '@/stores'
+import { useFuturesStore, useUserStore } from '@/stores'
 import { BuyOrSell } from '@/constants/order'
 
 const { rowKey, expandKeys, rowClick } = useComposeTable<Model.TradeHolderDetailRsp>({ rowKey: 'tradeid' })
@@ -75,7 +75,7 @@ const subscribe = quoteSocket.createSubscribe()
 const { holderCloseSubmit, formData } = useHolderClose()
 const futuresStore = useFuturesStore()
 const quote = futuresStore.getGoodsQuote(props.position.goodscode)
-
+const useStore = useUserStore()
 const { loading, pageIndex } = useRequest(queryTradeHolderDetail, {
     params: {
         pagesize: 20,

+ 2 - 4
src/packages/pc/views/footer/swap/position/index.vue

@@ -25,9 +25,9 @@
             <span :class="row.closeplColor">{{ formatDecimal(row.closepl, row.decimalplace) }}</span>
         </template>
         <!-- 展开行 -->
-        <template v-if="useStore.userType === 5" #expand="{ row }">
+        <template #expand="{ row }">
             <div class="buttonbar">
-                <el-button type="danger" size="small" @click="showComponent('close', row)">平仓</el-button>
+                <el-button type="danger" size="small" @click="showComponent('close', row)">明细</el-button>
             </div>
         </template>
         <template #footer>
@@ -45,7 +45,6 @@ import { useComponent } from '@/hooks/component'
 import { getBuyOrSellName } from '@/constants/order'
 import { useComposeTable } from '@pc/components/base/table'
 import AppTable from '@pc/components/base/table/index.vue'
-import { useUserStore } from '@/stores'
 
 const componentMap = new Map<string, unknown>([
     ['close', defineAsyncComponent(() => import('./close/index.vue'))],
@@ -54,7 +53,6 @@ const componentMap = new Map<string, unknown>([
 const { positionList, loading } = usePosition(46)
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent()
-const useStore = useUserStore()
 const { rowKey, expandKeys, rowClick } = useComposeTable<Model.TradePositionRsp>({ rowKey: 'pkid' })
 const selectedRow = shallowRef<Model.TradePositionRsp>()