소스 검색

Merge branch 'v20' of http://192.168.31.240:3000/MTP2.0_New/MTP20_WEB_GLOBAL into v20

li.shaoyi 3 주 전
부모
커밋
cc3170129e

+ 2 - 1
public/locales/en-US.json

@@ -1852,6 +1852,7 @@
         "sell": "Sell",
         "buy": "Buy",
         "marketclose": "Market-Close",
-        "history": "History"
+        "history": "History",
+        "tips": "Market closing will liquidate the position by market order."
     }
 }

+ 2 - 1
public/locales/th-TH.json

@@ -1855,6 +1855,7 @@
         "sell": "Sell",
         "buy": "Buy",
         "marketclose": "MarketClose",
-        "history": "历史"
+        "history": "历史",
+        "tips": "市價平倉會以市價委託方式平掉此倉位。"
     }
 }

+ 2 - 1
public/locales/vi-VN.json

@@ -1852,6 +1852,7 @@
         "sell": "Sell",
         "buy": "Buy",
         "marketclose": "MarketClose",
-        "history": "历史"
+        "history": "历史",
+        "tips": "市價平倉會以市價委託方式平掉此倉位。"
     }
 }

+ 2 - 1
public/locales/zh-CN.json

@@ -1855,6 +1855,7 @@
         "sell": "开空",
         "buy": "开多",
         "marketclose": "市价平仓",
-        "history": "历史"
+        "history": "历史",
+        "tips": "市价平仓会以市价委托方式平掉此仓位。"
     }
 }

+ 2 - 1
public/locales/zh-TW.json

@@ -1855,6 +1855,7 @@
         "sell": "開空",
         "buy": "開多",
         "marketclose": "市價平倉",
-        "history": "歷史"
+        "history": "歷史",
+        "tips": "市價平倉會以市價委託方式平掉此倉位。"
     }
 }

+ 10 - 10
src/packages/digital/views/contract/components/position/detail/close/index.vue

@@ -8,12 +8,12 @@
             <Form ref="formRef" class="g-form__container" @submit="onCloseSumit">
                 <CellGroup title="持仓信息" inset>
                     <Cell title="持仓单号" :value="selectedItem.tradeid" />
-                    <Cell title="代码/名称" :value="`${selectedItem.goodscode}/${selectedItem.goodsname}`" />
-                    <Cell title="持仓方向" :value="getBuyOrSellName(selectedItem.buyorsell, 1)" />
-                    <Cell :title="`持仓价格(${selectedItem.currencyname})`"
+                    <Cell :title="t('digital.goodscode')" :value="`${selectedItem.goodscode}/${selectedItem.goodsname}`" />
+                    <Cell :title="t('position.transfer.buyorsell')" :value="getBuyOrSellName(selectedItem.buyorsell, 1)" />
+                    <Cell :title="`${t('position.goods.holddetail.holderprice')}(${selectedItem.currencyname})`"
                         :value="selectedItem.holderprice.toFixed(selectedItem.decimalplace)" />
-                    <Cell :title="`持仓量(${selectedItem.goodscode})`" :value="selectedItem.holderqty" />
-                    <Cell :title="`冻结量(${selectedItem.goodscode})`" :value="selectedItem.freezeqty" />
+                    <Cell :title="`${t('quote.holdvolume')}(${selectedItem.goodscode})`" :value="selectedItem.holderqty" />
+                    <Cell :title="`${t('position.goods.frozenqty')}(${selectedItem.goodscode})`" :value="selectedItem.freezeqty" />
                     <Cell :title="`行情价格(${selectedItem.currencyname})`" :value="floatingPL.lastPrice">
                         <template #value>
                             <span :class="floatingPL.lastPriceClass">
@@ -21,7 +21,7 @@
                             </span>
                         </template>
                     </Cell>
-                    <Cell :title="`浮动盈亏(${selectedItem.currencyname})`">
+                    <Cell :title="`${t('position.goods.holddetail.profitLoss')}(${selectedItem.currencyname})`">
                         <template #value>
                             <span :class="floatingPL.profitLossClass">
                                 {{ floatingPL.profitLoss.toFixed(selectedItem.decimalplace) }}
@@ -34,15 +34,15 @@
                         </template>
                     </Field>
                     <Field v-if="formData.PriceMode === EPriceMode.PRICEMODE_LIMIT" name="OrderPrice"
-                        :rules="formRules.OrderPrice" label="价格">
+                        :rules="formRules.OrderPrice" :label="t('quote.goods.orderprice')">
                         <template #input>
                             <app-stepper v-model="formData.OrderPrice" min="0.0"
                                 :decimal-length="selectedItem.decimalplace" :step="quote?.decimalvalue"
                                 :auto-fixed="false" />
                         </template>
                     </Field>
-                    <Cell title="价格" value="最优市价" v-else />
-                    <Field name="OrderQty" :rules="formRules.OrderQty" label="数量">
+                    <Cell :title="t('quote.goods.orderprice')" :value="t('digital.optimal')" v-else />
+                    <Field name="OrderQty" :rules="formRules.OrderQty" :label="t('quote.goods.orderqty')">
                         <template #input>
                             <app-stepper v-model="formData.OrderQty" min="0.0" :max="maxQty" :auto-fixed="false"
                                 integer />
@@ -122,7 +122,7 @@ const formRules: { [key: string]: FieldRule[] } = {
 
 const onCloseSumit = () => {
     dialog({
-        message: '确认要平仓吗?',
+        message: t('position.swap.tips1'),
         showCancelButton: true,
     }).then(() => {
 

+ 5 - 5
src/packages/digital/views/contract/components/position/detail/market-close/index.vue

@@ -1,6 +1,6 @@
 <template>
     <Dialog v-model:show="showDialog" show-cancel-button :before-close="onBeforeClose" @closed="onClosed"
-        message="市价平仓会以市价委托方式平掉此仓位。">
+        :message="t('digital.tips')">
     </Dialog>
 </template>
 
@@ -12,7 +12,7 @@ import { handleRequestBigNumber } from '@/filters'
 import { fullloading } from '@/utils/vant'
 import { EPriceMode, EValidType, EBuildType, EOrderOperateType } from '@/constants/client'
 import { BuyOrSell } from '@/constants/order'
-import { useUserStore } from '@/stores'
+import { i18n, useUserStore } from '@/stores'
 
 const props = defineProps({
     selectedItem: {
@@ -22,7 +22,7 @@ const props = defineProps({
 })
 
 const emit = defineEmits(['closed'])
-
+const { global: { t } } = i18n
 const { formData, formSubmit } = useOrder()
 const showDialog = shallowRef(false)
 const refresh = shallowRef(false) // 是否刷新父组件数据
@@ -31,7 +31,7 @@ const userStore = useUserStore()
 const onBeforeClose = (action: string) => {
     if (action === 'confirm') {
         fullloading((hideLoading) => {
-            const { marketid, goodsid, holderqty, freezeqty, tradeid, agreeunit, buyorsell } = props.selectedItem ?? {}
+            const { marketid, goodsid, holderqty, freezeqty, tradeid, buyorsell } = props.selectedItem ?? {}
 
             /// 获取对应的市场ID
             formData.Header = { GoodsID: goodsid, MarketID: marketid }
@@ -48,7 +48,7 @@ const onBeforeClose = (action: string) => {
             formData.MarketMaxSub = Number(param112) || 100
 
             formSubmit().then(() => {
-                hideLoading('提交成功', 'success')
+                hideLoading(t('common.submitsuccess'), 'success')
                 refresh.value = true
             }).catch((err) => {
                 hideLoading(err, 'fail')

+ 20 - 15
src/packages/digital/views/contract/components/position/list/close/index.vue

@@ -7,40 +7,41 @@
             </template>
             <Form ref="formRef" class="g-form__container" @submit="onCloseSumit">
                 <CellGroup title="持仓信息" inset>
-                    <Cell title="代码/名称" :value="`${selectedRow.goodscode}/${selectedRow.goodsname}`" />
-                    <Cell title="持仓方向" :value="getBuyOrSellName(selectedRow.buyorsell, 1)" />
-                    <Cell :title="`持仓价格(${getGoodsCurrencyItemName(selectedRow.currencyid)})`"
+                    <Cell :title="t('digital.goodscode')" :value="`${selectedRow.goodscode}/${selectedRow.goodsname}`" />
+                    <Cell :title="t('position.transfer.buyorsell')" :value="getBuyOrSellName(selectedRow.buyorsell, 1)" />
+                    <Cell :title="`${t('position.goods.holddetail.holderprice')}(${currency(selectedRow.currencyid)})`"
                         :value="selectedRow.averageprice" />
-                    <Cell :title="`持仓量(${selectedRow.goodscode})`" :value="selectedRow.curpositionqty" />
-                    <Cell :title="`冻结量(${selectedRow.goodscode})`" :value="selectedRow.frozenqty" />
-                    <Cell :title="`行情价格(${getGoodsCurrencyItemName(selectedRow.currencyid)})`">
+                    <Cell :title="`${t('quote.holdvolume')}(${selectedRow.goodscode})`" :value="selectedRow.curpositionqty" />
+                    <Cell :title="`${t('position.goods.frozenqty')}(${selectedRow.goodscode})`" :value="selectedRow.frozenqty" />
+                    <Cell :title="`行情价格(${currency(selectedRow.currencyid)})`">
                         <template #value>
                             <span :class="selectedRow.lastPriceClass">
                                 {{ selectedRow.lastPrice.toFixed(selectedRow.decimalplace) }}
                             </span>
                         </template>
                     </Cell>
-                    <Cell :title="`浮动盈亏(${getGoodsCurrencyItemName(selectedRow.currencyid)})`">
+                    <Cell :title="`${t('position.goods.holddetail.profitLoss')}(${currency(selectedRow.currencyid)})`">
                         <template #value>
                             <span :class="selectedRow.profitLossClass">
                                 {{ selectedRow.profitLoss.toFixed(selectedRow.decimalplace) }}
                             </span>
                         </template>
                     </Cell>
-                    <Field label="价格方式" is-link>
+                    <Field :label="t('digital.pricemode')" is-link>
                         <template #input>
                             <app-select v-model="formData.PriceMode" :options="getPricemode2List()" />
                         </template>
                     </Field>
-                    <Field label="价格" :rules="formRules.OrderPrice"
+                    <Field :label="t('quote.swap.orderprice')" :rules="formRules.OrderPrice"
                         v-if="formData.PriceMode === EPriceMode.PRICEMODE_LIMIT">
                         <template #input>
                             <app-stepper v-model="formData.OrderPrice" :min="0" :decimal-length="quote?.decimalplace"
                                 :step="quote?.decimalvalue" />
                         </template>
                     </Field>
-                    <Cell title="价格" value="最优市价" v-if="formData.PriceMode === EPriceMode.PRICEMODE_MARKET" />
-                    <Field name="OrderQty" :rules="formRules.OrderQty" label="数量">
+                    <Cell :title="t('quote.swap.orderprice')" :value="t('digital.optimal')" 
+                        v-if="formData.PriceMode === EPriceMode.PRICEMODE_MARKET" />
+                    <Field name="OrderQty" :rules="formRules.OrderQty" :label="t('quote.goods.orderqty')">
                         <template #input>
                             <app-stepper v-model="formData.OrderQty" min="0.0" :max="selectedRow.enableqty"
                                 :auto-fixed="false" integer />
@@ -88,16 +89,20 @@ const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const { formSubmit, formData } = useOrder()
 
+const currency = (id: number) => {
+    return getGoodsCurrencyItemName(id)
+}
+
 // 表单验证规则
 const formRules: { [key: string]: FieldRule[] } = {
     OrderPrice: [{
-        message: '请输入价格',
+        message: t('quote.goods.pleaseenterorderprice'),
         validator: () => {
             return !!formData.OrderPrice
         }
     }],
     OrderQty: [{
-        message: '请输入数量',
+        message: t('quote.goods.pleaseenterorderqty'),
         validator: () => {
             return !!formData.OrderQty
         }
@@ -106,7 +111,7 @@ const formRules: { [key: string]: FieldRule[] } = {
 
 const onCloseSumit = () => {
     dialog({
-        message: '确认要平仓吗?',
+        message: t('position.swap.tips1'),
         showCancelButton: true,
     }).then(() => {
 
@@ -127,7 +132,7 @@ const onCloseSumit = () => {
         /// loding....
         fullloading((hideLoading) => {
             formSubmit().then(() => {
-                hideLoading('提交成功', 'success')
+                hideLoading(t('common.submitsuccess'), 'success')
                 closed()
             }).catch((err) => {
                 hideLoading(err, 'fail')

+ 4 - 4
src/packages/digital/views/contract/components/position/list/market-close/index.vue

@@ -1,6 +1,6 @@
 <template>
     <Dialog v-model:show="showDialog" show-cancel-button :before-close="onBeforeClose" @closed="onClosed"
-        message="市价平仓会以市价委托方式平掉此仓位。">
+        :message="t('digital.tips')">
     </Dialog>
 </template>
 
@@ -11,7 +11,7 @@ import { useOrder } from '@/business/trade'
 import { fullloading } from '@/utils/vant'
 import { EPriceMode, EValidType, EBuildType, EOrderOperateType } from '@/constants/client'
 import { BuyOrSell } from '@/constants/order'
-import { useUserStore } from '@/stores'
+import { i18n, useUserStore } from '@/stores'
 
 const props = defineProps({
     selectedRow: {
@@ -21,7 +21,7 @@ const props = defineProps({
 })
 
 const emit = defineEmits(['closed'])
-
+const { global: { t } } = i18n
 const { formData, formSubmit } = useOrder()
 const showDialog = shallowRef(false)
 const refresh = shallowRef(false) // 是否刷新父组件数据
@@ -46,7 +46,7 @@ const onBeforeClose = (action: string) => {
             formData.MarketMaxSub = Number(param112) || 100
 
             formSubmit().then(() => {
-                hideLoading('提交成功', 'success')
+                hideLoading(t('common.submitsuccess'), 'success')
                 refresh.value = true
             }).catch((err) => {
                 hideLoading(err, 'fail')