Handy_Cao hace 1 año
padre
commit
21dd5658e8

+ 0 - 4
public/config/columns.json

@@ -40,10 +40,6 @@
         "tableKey": "order-detail2",
         "columns": [
             {
-                "field": "marketname",
-                "label": "position.goods.holddetail.marketname"
-            },
-            {
                 "field": "goodsname",
                 "label": "position.goods.goodsname"
             },

+ 8 - 0
public/locales/en-US.json

@@ -52,6 +52,14 @@
         "tips14": "The contract is successfully submitted, wait patiently for review.",
         "tips15": "Confirm success",
         "tips16": "Confirmation failure:",
+        "tips17": "Service timeout",
+        "tips18": "Login failed, please login again",
+        "tips19": "The request timed out. Please try again later",
+        "tips20": "An error occurred. Please try again later",
+        "tips21": "Network or server error",
+        "tips22": "The request failed. Please try again later",
+        "tips23": "Request failed:",
+        "tips24": "Login failure:",
         "all": "All",
         "calendar": "Date Choice"
     },

+ 8 - 0
public/locales/th-TH.json

@@ -53,6 +53,14 @@
         "tips14": "การเซ็นสัญญาประสบความสำเร็จโปรดรอการตรวจสอบ",
         "tips15": "ยืนยันการทำงาน",
         "tips16": "ยืนยันความล้มเหลว:",
+        "tips17": "หมดเวลาทำงาน",
+        "tips18": "การล็อกอินล้มเหลวโปรดเข้าสู่ระบบอีกครั้ง",
+        "tips19": "หมดเวลาของการร้องขอโปรดลองอีกครั้งในภายหลัง",
+        "tips20": "เกิดข้อผิดพลาดขึ้นโปรดลองใหม่อีกครั้ง",
+        "tips21": "เกิดข้อผิดพลาดระบบเครือข่าย หรือเซิร์ฟเวอร์",
+        "tips22": "การร้องขอล้มเหลวโปรดลองใหม่อีกครั้ง",
+        "tips23": "การร้องขอล้มเหลว:",
+        "tips24": "การล็อกอินล้มเหลว:",
         "all": "ทั้งหมด",
         "calendar": "การเลือก"
     },

+ 8 - 0
public/locales/zh-CN.json

@@ -53,6 +53,14 @@
         "tips14": "签约提交成功,请耐心等待审核。",
         "tips15": "确认成功",
         "tips16": "确认失败:",
+        "tips17": "业务超时",
+        "tips18": "登录失效,请重新登录",
+        "tips19": "请求超时,请稍后再试",
+        "tips20": "发生错误,请稍后再试",
+        "tips21": "网络或服务器错误",
+        "tips22": "请求失败,请稍后重试",
+        "tips23": "请求失败:",
+        "tips24": "登录失效:",
         "all": "全部",
         "calendar": "日期选择"
     },

+ 8 - 0
public/locales/zh-TW.json

@@ -53,6 +53,14 @@
         "tips14": "簽約提交成功,請耐心等待審覈。",
         "tips15": "確認成功",
         "tips16": "確認失敗:",
+        "tips17": "業務超時",
+        "tips18": "登錄失效,請重新登錄",
+        "tips19": "請求超時,請稍後再試",
+        "tips20": "發生錯誤,請稍後再試",
+        "tips21": "網絡或服務器錯誤",
+        "tips22": "請求失敗,請稍後重試",
+        "tips23": "請求失敗:",
+        "tips24": "登錄失效:",
         "all": "全部",
         "calendar": "日期選擇"
     },

+ 3 - 2
src/business/common/index.ts

@@ -1,6 +1,7 @@
 import { timerTask } from '@/utils/timer'
 import { tokenCheck } from '@/services/api/account'
 import eventBus from '@/services/bus'
+import { i18n } from '@/stores'
 
 /**
  * 令牌校验
@@ -10,8 +11,8 @@ export async function checkToken() {
         return await tokenCheck()
     } catch (err) {
         // 临时解决方案,有可能出现网络问题导致超时后账号被登出
-        if (err !== '业务超时') {
-            eventBus.$emit('LogoutNotify', '登录失效,请重新登录')
+        if (err !== i18n.global.t('common.tips17')) {
+            eventBus.$emit('LogoutNotify', i18n.global.t('common.tips18'))
         }
         return Promise.reject(err)
     }

+ 1 - 1
src/packages/mobile/views/order/list/components/pricingorder/detail/Index.vue

@@ -3,7 +3,7 @@
     <app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal" :refresh="refresh">
         <app-view class="g-form">
             <template #header>
-                <app-navbar :title="详细" @back="closed" />
+                <app-navbar :title="$t('order.pricingorder.subtitle1')" @back="closed" />
             </template>
             <div class="order-detail__container g-form__container">
                 <CellGroup :title="$t('order.pricingorder.subtitle')">

+ 5 - 1
src/packages/pc/views/footer/goods/order/index.vue

@@ -1,6 +1,7 @@
 <!-- 商品订单- 委托 -->
 <template>
-    <app-table ref="tableRef" :data="tableList" selection-type="multiple" v-model:columns="tableColumns" :loading="loading"
+    <app-table ref="tableRef" :data="tableList" selection-type="multiple" v-model:columns="tableColumns" :loading="loading" :row-key="rowKey"
+    :expand-row-keys="expandKeys" 
         @selection-change="onTableSelect" @row-dblclick="onDBClickCancel">
         <template #headerRight>
             <div class="buttonbar">
@@ -43,6 +44,7 @@ import { getBuildTypeName, getBuyOrSellName, getOrderStatusName } from '@/consta
 import { queryTradeOrderDetail } from '@/services/api/order'
 import { formatDate } from '@/filters'
 import { useComponent } from '@/hooks/component'
+import { useComposeTable } from '@pc/components/base/table'
 import eventBus from '@/services/bus'
 import { i18n } from '@/stores'
 import AppTable from '@pc/components/base/table/index.vue'
@@ -53,6 +55,8 @@ const componentMap = new Map<string, unknown>([
 ])
 
 const { tableList, showLoadMore, initTableData, loadMore } = useLocalPagination<Model.TradeOrderDetailRsp>()
+const { rowKey, expandKeys } = useComposeTable<Model.TradeOrderDetailRsp>({ rowKey: 'orderid' })
+
 const tableRef = ref()
 const selectedRows = ref<Model.TradeOrderDetailRsp[]>([])
 const { global: { t } } = i18n

+ 1 - 1
src/packages/pc/views/footer/pricing/detail2/components/transfer/index.vue

@@ -3,7 +3,7 @@
     <app-drawer :title="t('operation.close')" :width="800" v-model:show="show" :loading="loading" :refresh="refresh">
         <el-form ref="formRef" class="el-form--horizontal" label-width="120px" :model="formData" :rules="formRules">
             <el-form-item :label="t('position.transfer.goodsname')">
-                <span>{{ selectedRow.goodsCode }}/{{ selectedRow.goodsName }}</span>
+                <span>{{ selectedRow.goodsCode }}</span>
             </el-form-item>
             <el-form-item :label="t('position.transfer.buyorsell')">
                 <span>{{ getBuyOrSellName(selectedRow.tHDetailEx.buyOrSell) }}</span>

+ 2 - 7
src/packages/pc/views/footer/pricing/detail2/index.vue

@@ -1,13 +1,9 @@
 <!-- 挂牌点价-持仓明细 按账户风控 -->
 <template>
     <app-table :data="orderComputedList" v-model:columns="tableColumns" :loading="loading" v-model:error="error">
-         <!-- 市场名称 -->
-         <template #marketname="{ row }">
-            {{  getMarketName(row.tHDetailEx.marketID) }}
-        </template>
         <!-- 商品代码/名称 -->
         <template #goodsname="{ row }">
-            {{ row.goodsCode }}/{{ row.goodsName }}
+            {{ row.goodsCode }}
         </template>
         <!-- 方向 -->
         <template #buyorsell="{ row }">
@@ -77,7 +73,7 @@ import { getGoodsUnitName } from '@/constants/unit'
 import { useComponent } from '@/hooks/component'
 import { useLocalPagination } from '@/hooks/pagination'
 import { useTableColumnsStore, i18n } from '@/stores'
-import { useSBYJOrderStore, useUserStore } from '@/stores'
+import { useSBYJOrderStore } from '@/stores'
 import AppTable from '@pc/components/base/table/index.vue'
 import eventBus from '@/services/bus'
 
@@ -91,7 +87,6 @@ const selectedRow = shallowRef<Model.SBYJMyOrderRsp>()
 const tableColumns = shallowRef<Model.TableColumn[]>([])
 const { t } = i18n.global
 
-const { getMarketName } = useUserStore()
 const { getSBYJMyOrders, $toRefs } = useSBYJOrderStore()
 const { orderComputedList, loading, error } = $toRefs()
 

+ 4 - 1
src/packages/pc/views/footer/pricing/order/index.vue

@@ -11,7 +11,7 @@
         </template>
         <!-- 商品代码/名称 -->
         <template #goodsname="{ row }">
-            {{ row.goodscode }}/{{ row.goodsname }}
+            {{ row.goodscode }}
         </template>
          <!-- 方向 -->
          <template #buyorsell="{ value }">
@@ -46,6 +46,7 @@ import { useRequest } from '@/hooks/request'
 import { useLocalPagination } from '@/hooks/pagination'
 import { queryTradeOrderDetail } from '@/services/api/order'
 import { useComponent } from '@/hooks/component'
+import { useComposeTable } from '@pc/components/base/table'
 import { getWRTradeOrderStatusName, getBuyOrSellName } from '@/constants/order'
 import { useTableColumnsStore, i18n } from '@/stores'
 import AppTable from '@pc/components/base/table/index.vue'
@@ -57,6 +58,8 @@ const componentMap = new Map<string, unknown>([
 ])
 
 const { tableList, showLoadMore, initTableData, loadMore } = useLocalPagination<Model.TradeOrderDetailRsp>()
+const { rowKey, expandKeys } = useComposeTable<Model.TradeOrderDetailRsp>({ rowKey: 'orderid' })
+
 const tableRef = ref()
 const selectedRows = ref<Model.TradeOrderDetailRsp[]>([])
 const { t } = i18n.global

+ 1 - 1
src/packages/pc/views/footer/pricing/position/index.vue

@@ -4,7 +4,7 @@
         :expand-row-keys="expandKeys" @row-click="rowClick">
         <!-- 商品代码/名称 -->
         <template #goodsname="{ row }">
-            {{ row.goodscode }}/{{ row.goodsname }}
+            {{ row.goodscode }}
         </template>
         <!-- 方向 -->
         <template #buyorsell="{ value }">

+ 1 - 1
src/packages/pc/views/footer/pricing/trade/index.vue

@@ -11,7 +11,7 @@
         </template>
         <!-- 商品合约 -->
         <template #goodsname="{ row }">
-            {{ row.goodscode }}/{{ row.goodsname }}
+            {{ row.goodscode }}
         </template>
         <!-- 时间 -->
         <template #tradetime="{ value }">

+ 2 - 1
src/packages/pc/views/query/order/pricing/history/index.vue

@@ -19,7 +19,8 @@
         </template>
         <!-- 商品代码/名称 -->
         <template #goodsname="{ row }">
-            {{ row.goodscode }}/{{ row.goodsname }}
+            <span v-if="row.trademode != 10">{{ row.goodscode }}/{{ row.goodsname }}</span>
+            <span v-else>{{ row.goodscode }}</span>
         </template>
         <!-- 委托状态 -->
         <template #orderstatus="{ value }">

+ 2 - 1
src/packages/pc/views/query/order/pricing/list/index.vue

@@ -11,7 +11,8 @@
         </template>
         <!-- 商品代码/名称 -->
         <template #goodsname="{ row }">
-            {{ row.goodscode }}/{{ row.goodsname }}
+            <span v-if="row.trademode != 10">{{ row.goodscode }}/{{ row.goodsname }}</span>
+            <span v-else>{{ row.goodscode }}</span>
         </template>
         <!-- 委托状态 -->
         <template #orderstatus="{ value }">

+ 2 - 1
src/packages/pc/views/query/trade/pricing/history/index.vue

@@ -23,7 +23,8 @@
         </template>
         <!-- 商品合约 -->
         <template #goodsname="{ row }">
-            {{ row.goodscode }}/{{ row.goodsname }}
+            <span v-if="row.trademode != 10">{{ row.goodscode }}/{{ row.goodsname }}</span>
+            <span v-else>{{ row.goodscode }}</span>
         </template>
         <!-- 时间 -->
         <template #tradetime="{ value }">

+ 2 - 1
src/packages/pc/views/query/trade/pricing/list/index.vue

@@ -15,7 +15,8 @@
         </template>
         <!-- 商品合约 -->
         <template #goodsname="{ row }">
-            {{ row.goodscode }}/{{ row.goodsname }}
+            <span v-if="row.trademode != 10">{{ row.goodscode }}/{{ row.goodsname }}</span>
+            <span v-else>{{ row.goodscode }}</span>
         </template>
         <!-- 成交时间 -->
         <template #tradetime="{ value }">

+ 9 - 9
src/services/http/index.ts

@@ -5,7 +5,7 @@ import cryptojs from 'crypto-js'
 //import { addPending, removePending } from './pending'
 import { encryptBody, decryptBody } from '@/services/websocket/package/crypto'
 import { IMessageHead } from '@/types/proto/proto'
-import { useGlobalStore, useLoginStore, useAccountStore, useErrorInfoStore } from '@/stores'
+import { useGlobalStore, useLoginStore, useAccountStore, useErrorInfoStore, i18n } from '@/stores'
 import { CommonResult, ResultCode, SendMsgToMQ } from './types'
 import { FunCode } from '@/constants/funcode'
 import service from '@/services'
@@ -47,7 +47,7 @@ export default new (class {
             },
             (err) => {
                 console.error(err)
-                return Promise.reject('发生错误,请稍后再试')
+                return Promise.reject(i18n.global.t('common.tips20'))
             }
         )
 
@@ -59,24 +59,24 @@ export default new (class {
             },
             (err) => {
                 if (err.message === 'Network Error') {
-                    return Promise.reject('网络或服务器错误')
+                    return Promise.reject(i18n.global.t('common.tips21'))
                 }
                 if (err.response) {
                     const { code, msg, message } = err.response.data ?? {}
                     switch (err.response.status) {
                         case 408: {
-                            return Promise.reject('请求超时,请稍后再试')
+                            return Promise.reject(i18n.global.t('common.tips19'))
                         }
                         default: {
                             const loginStore = useLoginStore()
                             if (loginStore.token && code === ResultCode.InvalidToken) {
-                                eventBus.$emit('LogoutNotify', '登录失效,请重新登录')
+                                eventBus.$emit('LogoutNotify', i18n.global.t('common.tips18'))
                             }
                             return Promise.reject(msg || message)
                         }
                     }
                 }
-                return Promise.reject('发生错误,请稍后再试')
+                return Promise.reject(i18n.global.t('common.tips20'))
             }
         )
     }
@@ -122,7 +122,7 @@ export default new (class {
                     resolve(res.data)
                 }
             }).catch((err) => {
-                const msg = err ?? (errMsg ? '请求失败: ' + errMsg : '请求失败,请稍后重试')
+                const msg = err ?? (errMsg ? i18n.global.t('common.tips23') + errMsg : i18n.global.t('common.tips22'))
                 reject(msg)
             })
         })
@@ -140,7 +140,7 @@ export default new (class {
         const res = await this.request<CommonResult<T>>(config, errMsg)
         switch (res.code) {
             case ResultCode.InvalidToken: {
-                return Promise.reject('登录失效')
+                return Promise.reject(i18n.global.t('common.tips24'))
             }
             case ResultCode.Success: {
                 return res
@@ -163,7 +163,7 @@ export default new (class {
         const res = await this.request<CommonResult<T>>(config, errMsg)
         switch (res.code) {
             case ResultCode.InvalidToken: {
-                return Promise.reject('登录失效')
+                return Promise.reject(i18n.global.t('common.tips24'))
             }
             case 0: {
                 return res

+ 2 - 1
src/services/websocket/build/index.ts

@@ -2,6 +2,7 @@ import { v4 } from 'uuid'
 import { Package40, Package50 } from '../package';
 import { Package, ConnectionState, SendMessage, AsyncTask } from './types';
 import moment from 'moment'
+import { i18n } from '@/stores';
 
 /**
  * MTP2.0 长链通信类
@@ -257,7 +258,7 @@ export class MTP2WebSocket<T extends Package40 | Package50>{
         // 获取对应异步任务对象
         const asyncTask = this.asyncTaskMap.get(key);
         const onFail = asyncTask?.sendMessage.fail;
-        onFail && onFail('业务超时');
+        onFail && onFail(i18n.global.t('common.tips17'));
         this.asyncTaskMap.delete(key);
     }
 

+ 2 - 2
src/services/websocket/message.ts

@@ -1,6 +1,6 @@
 import { timerInterceptor } from '@/utils/timer'
 import { FunCode } from '@/constants/funcode'
-import { useErrorInfoStore } from '@/stores'
+import { i18n, useErrorInfoStore } from '@/stores'
 import eventBus from '@/services/bus'
 import { Package50 } from './package'
 import { decodeProto } from './package/package50/proto'
@@ -29,7 +29,7 @@ export async function pushMessage50(pkg: Package50, contentType: 'encrypted' | '
                 errcode = JSON.parse(res).RetCode
             }
             // 用户登出通知
-            eventBus.$emit('LogoutNotify', getErrorInfoByCode(errcode) || '账号已登出')
+            eventBus.$emit('LogoutNotify', getErrorInfoByCode(errcode) || i18n.global.t('user.login.tips5'))
             break
         }
         case FunCode.MoneyChangedNotify: {

+ 4 - 1
src/utils/vant/index.ts

@@ -1,6 +1,7 @@
 import { showNotify, NotifyType, showLoadingToast, showToast, showDialog, DialogOptions, ToastType } from 'vant'
 import { timerInterceptor } from '@/utils/timer'
 import plus from '@/utils/h5plus'
+import { i18n } from '@/stores'
 
 /**
  * 消息通知
@@ -60,7 +61,9 @@ export function fullloading(callback: (hideLoading: (msg?: string, type?: ToastT
 export function dialog(options: string | DialogOptions) {
     if (typeof options === 'string') {
         return showDialog({
-            message: options
+            message: options,
+            confirmButtonText: i18n.global.t('operation.confirm'),
+            cancelButtonText: i18n.global.t('operation.cancel')
         })
     }
     return showDialog(options)