li.shaoyi 2 سال پیش
والد
کامیت
49a04a89ce

+ 1 - 1
src/hooks/echarts/candlestick/options.ts

@@ -388,7 +388,7 @@ export function useOptions(dataset: EchartsDataset) {
                 source: cci.source,
             },
         }
-    }, 500)
+    }, 100)
 
     // 监听主题变化
     watch(appTheme, () => {

+ 1 - 1
src/hooks/echarts/timeline/options.ts

@@ -243,7 +243,7 @@ export function useOptions(dataset: EchartsDataset) {
                 },
             ],
         }
-    }, 500)
+    }, 100)
 
     // 监听主题变化
     watch(appTheme, () => {

+ 1 - 1
src/packages/pc/components/modules/listing/index.vue

@@ -7,7 +7,7 @@
             <h4 class="header-title">订单挂牌</h4>
             <el-form ref="formRef" class="el-form--vertical" label-width="60px" :model="formData" :rules="formRules">
                 <el-form-item prop="GoodsID" label="商品">
-                    <el-select placeholder="请选择" v-model="goodsStore.goodsId" @change="getTradePosition">
+                    <el-select placeholder="请选择" v-model="goodsStore.goodsId">
                         <el-option :label="item.goodsname" :value="item.goodsid"
                             v-for="(item, index) in goodsStore.quoteGoodsList" :key="index" />
                     </el-select>

+ 7 - 1
src/packages/pc/views/auth/forget/index.vue

@@ -22,7 +22,7 @@
         </el-form-item>
         <el-form-item>
             <el-button type="primary" @click="formSubmit">重置密码</el-button>
-            <el-button @click="$emit('close')" style="margin-left: auto;">返回</el-button>
+            <el-button @click="onClose" style="margin-left: auto;">返回</el-button>
         </el-form-item>
     </el-form>
 </template>
@@ -37,6 +37,7 @@ import { resetPassword, sendResetVerifyCode } from '@/services/api/common'
 import cryptojs from 'crypto-js'
 import service from '@/services'
 
+const emit = defineEmits(['close'])
 const formRef = ref<FormInstance>()
 const seconds = ref(60) //倒计时剩余时间
 const isCountdown = ref(false) // 是否正在倒计时
@@ -138,6 +139,7 @@ const formSubmit = () => {
                 }).then((res) => {
                     if (res.code === '0') {
                         ElMessage.success('密码重置成功,请重新登录。')
+                        onClose()
                     } else {
                         ElMessage.error(res.message)
                     }
@@ -150,4 +152,8 @@ const formSubmit = () => {
         }
     })
 }
+
+const onClose = () => {
+    emit('close')
+}
 </script>

+ 20 - 6
src/packages/pc/views/footer/goods/position/components/transfer/index.vue

@@ -13,13 +13,13 @@
                 <span>{{ formatDecimal(selectedRow.curholderamount) }}</span>
             </el-form-item>
             <el-form-item label="持仓数量">
-                <span>{{ formatDecimal(selectedRow.curpositionqty) }}</span>
+                <span>{{ selectedRow.curpositionqty }}</span>
             </el-form-item>
             <el-form-item label="冻结数量">
-                <span>{{ formatDecimal(selectedRow.frozenqty) }}</span>
+                <span>{{ selectedRow.frozenqty }}</span>
             </el-form-item>
             <el-form-item label="可用数量">
-                <span>{{ formatDecimal(selectedRow.enableqty) }}</span>
+                <span>{{ selectedRow.enableqty }}</span>
             </el-form-item>
             <el-form-item label="持仓均价">
                 <span>{{ formatDecimal(selectedRow.averageprice) }}</span>
@@ -28,8 +28,15 @@
                 <span :class="handlePriceColor(closepl, 0)">{{ formatDecimal(closepl) }}</span>
             </el-form-item>
             <el-form-item prop="OrderQty" label="转让数量">
-                <el-input-number placeholder="请输入数量" v-model="formData.OrderQty" :precision="0" :max="selectedRow.enableqty"
-                    :min="0" />
+                <div class="g-qty-group">
+                    <el-input-number placeholder="请输入数量" v-model="formData.OrderQty" :precision="0"
+                        :max="selectedRow.enableqty" :min="0" />
+                    <el-radio-group size="small" v-model="qtyStep" @change="onRadioChange">
+                        <el-radio v-for="(value, index) in qtyStepList" :key="index" :label="value" border>
+                            {{ parsePercent(value, 0) }}
+                        </el-radio>
+                    </el-radio-group>
+                </div>
             </el-form-item>
             <el-form-item prop="OrderPrice" label="转让价格">
                 <el-input-number placeholder="请输入价格" v-model="formData.OrderPrice"
@@ -47,7 +54,7 @@
 import { ref, PropType, computed, onMounted } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
 import { useOrder } from '@/business/trade'
-import { formatDecimal, handlePriceColor } from '@/filters'
+import { formatDecimal, handlePriceColor, parsePercent } from '@/filters'
 import { getBuyOrSellName, BuyOrSell } from '@/constants/order'
 import { useFuturesStore } from '@/stores'
 import { EBuildType, EDelistingType, EListingSelectType, EOrderOperateType, EPriceMode, EValidType } from '@/constants/client'
@@ -73,6 +80,8 @@ const { formSubmit, formData, loading } = useOrder()
 const show = ref(true)
 const refresh = ref(false)
 const formRef = ref<FormInstance>()
+const qtyStepList = [0.25, 0.75, 1] // 数量步长列表
+const qtyStep = ref<number>() // 数量步长
 
 const formRules: FormRules = {
     OrderPrice: [{
@@ -116,6 +125,10 @@ const onCloseSumit = () => {
     })
 }
 
+const onRadioChange = (value: number) => {
+    formData.OrderQty = Math.trunc(props.selectedRow.enableqty * value)
+}
+
 onMounted(() => {
     const { bid, ask, presettle = 0 } = quote.value ?? {}
     switch (props.selectedRow.buyorsell) {
@@ -128,5 +141,6 @@ onMounted(() => {
         default:
             formData.OrderPrice = presettle
     }
+    formData.OrderQty = props.selectedRow.enableqty
 })
 </script>

+ 9 - 4
src/packages/pc/views/footer/goods/position/index.vue

@@ -17,10 +17,10 @@
             <span :class="handlePriceColor(closepl(row), 0.0)">{{ closepl(row).toFixed(2) }}</span>
         </template>
         <!-- 展开行 -->
-        <template #expand>
+        <template #expand="{ row }">
             <div class="buttonbar">
-                <el-button type="primary" size="small" @click="openComponent('delivery')">交收</el-button>
-                <el-button type="danger" size="small" @click="openComponent('transfer')">转让</el-button>
+                <el-button type="primary" size="small" @click="showComponent('delivery', row)">交收</el-button>
+                <el-button type="danger" size="small" @click="showComponent('transfer', row)">转让</el-button>
             </div>
         </template>
     </app-table>
@@ -77,7 +77,7 @@ const { loading, dataList, run } = useRequest(queryTradePosition, {
     },
 })
 
-const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.TradePositionRsp>({ rowKey: 'goodsid' })
+const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.TradePositionRsp>({ rowKey: 'pkid' })
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'goodsname', label: '订单合约' },
@@ -92,6 +92,11 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'closepl', label: '浮动盈亏' },
 ])
 
+const showComponent = (componentName: string, row: Model.TradePositionRsp) => {
+    selectedRow.value = row
+    openComponent(componentName)
+}
+
 // 接收持仓变化通知
 const posChangedNtf = eventBus.$on('PosChangedNtf', () => {
     run()

+ 1 - 0
src/types/model/order.d.ts

@@ -925,6 +925,7 @@ declare namespace Model {
 
     /*  查询我的持仓/掉期持仓 响应*/
     interface TradePositionRsp {
+        pkid: string; // 自定义主键
         /// 资金账户
         accountid: number
         /// 合约单位