li.shaoyi 1 ano atrás
pai
commit
c792bf321a

+ 2 - 2
app/package.json

@@ -1,6 +1,6 @@
 {
-  "name": "trading-beta",
-  "version": "1.0.22",
+  "name": "trading",
+  "version": "1.0.7",
   "main": "main.js",
   "dependencies": {
     "electron-updater": "^6.1.4",

+ 4 - 3
oem/gzcj/config/appconfig.json

@@ -1,8 +1,8 @@
 {
   "appId": "com.muchinfo.gzcj",
   "appName": "贵州茶交",
-  "version": "1.0.6",
-  "versionCode": "100006",
+  "version": "1.0.7",
+  "versionCode": "100007",
   "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204",
   "tradeChannel": "ws",
   "modules": [
@@ -11,5 +11,6 @@
   ],
   "quotationProperties": [
     "holdvolume"
-  ]
+  ],
+  "i18nEnabled": false
 }

+ 2 - 2
oem/tss/config/appconfig.json

@@ -1,8 +1,8 @@
 {
   "appId": "com.muchinfo.tss",
   "appName": "TCE",
-  "version": "1.0.25",
-  "versionCode": "100025",
+  "version": "1.0.26",
+  "versionCode": "100026",
   "apiUrl": "http://192.168.31.158:16240/cfg?key=dev_104",
   "tradeChannel": "ws",
   "showLoginAlert": true,

+ 2 - 1
src/packages/gzcj/main.ts

@@ -13,11 +13,12 @@ import VXETable from 'vxe-table'
 import 'vxe-table/lib/style.css'
 import './assets/themes/style.less' // 主题样式
 // import { timerInterceptor } from '@/utils/timer'
-// import { useGlobalStore } from '@/stores'
+import { i18n } from '@/stores'
 // import Vconsole from 'vconsole'
 // new Vconsole()
 
 const app = createApp(App)
+app.use(i18n)
 app.use(router)
 app.use(directives)
 app.use(VXETable)

+ 19 - 16
src/packages/pc/components/layouts/header/components/setting/index.vue

@@ -53,12 +53,14 @@
                 </el-form-item>
             </el-form>
         </fieldset>
-        <fieldset class="g-fieldset">
+        <fieldset class="g-fieldset" v-if="globalStore.getSystemInfo('i18nEnabled')">
             <legend class="g-fieldset__legend">{{ t('mine.setting.others') }}</legend>
             <el-form ref="formRef" class="el-form--horizontal" label-width="80px">
                 <el-form-item :label="t('mine.setting.language')">
-                    <el-select effect="dark" :placeholder="t('common.choice')" v-model="luanguage" @change="changeLuanguage">
-                        <el-option v-for="item in dataList" :key="item.langcode" :label="item.langname" :value="item.langcode"/>
+                    <el-select effect="dark" :placeholder="t('common.choice')" v-model="luanguage"
+                        @change="changeLuanguage">
+                        <el-option v-for="item in dataList" :key="item.langcode" :label="item.langname"
+                            :value="item.langcode" />
                     </el-select>
                 </el-form-item>
             </el-form>
@@ -74,13 +76,14 @@
 import { ref, computed } from 'vue'
 import { ElMessageBox, FormInstance } from 'element-plus'
 import { getBuyOrSellList } from '@/constants/order'
-import { useSettingStore, i18n } from '@/stores'
+import { useGlobalStore, useSettingStore, i18n } from '@/stores'
 import { localData } from '@/stores/storage'
 import { useRequest } from '@/hooks/request'
 import { getI18nConfigs } from '@/services/api/common'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import eventBus from '@/services/bus'
 
+const globalStore = useGlobalStore()
 const settingStore = useSettingStore()
 const formRef = ref<FormInstance>()
 const show = ref(true)
@@ -109,18 +112,18 @@ const { dataList } = useRequest(getI18nConfigs, {})
 const changeLuanguage = (e: string) => {
     ElMessageBox.confirm(t('user.login.tips6'), t('common.tips'), { confirmButtonText: t('common.ikonw'), cancelButtonText: t('operation.cancel') }).then(() => {
         switch (e) {
-        case 'zh-CN':
-            i18n.global.locale = 'zh-CN'
-            break;
-        case 'en':
-            i18n.global.locale = 'en-US'
-            break;
-        case 'zh-TW':
-            i18n.global.locale ='zh-TW'
-            break;
-        default:
-            i18n.global.locale = 'th'
-            break;
+            case 'zh-CN':
+                i18n.global.locale = 'zh-CN'
+                break;
+            case 'en':
+                i18n.global.locale = 'en-US'
+                break;
+            case 'zh-TW':
+                i18n.global.locale = 'zh-TW'
+                break;
+            default:
+                i18n.global.locale = 'th'
+                break;
         }
         /// 设置语言
         localData.setValue('appLanguage', i18n.global.locale)

+ 4 - 2
src/packages/pc/views/auth/components/layout/index.vue

@@ -5,7 +5,7 @@
         <pre>{{ i18n.global.t('app.slogan') }}</pre>
       </div>
       <div class="right">
-        <el-dropdown class="right-lang" @command="changeLuanguage">
+        <el-dropdown class="right-lang" @command="changeLuanguage" v-if="globalStore.getSystemInfo('i18nEnabled')">
           <div style="cursor: pointer;">
             <span>{{ luanguage }}</span>
             <AppIcon icon="CaretBottom" />
@@ -36,7 +36,7 @@
 
 <script lang="ts" setup>
 import { computed } from 'vue'
-import { i18n } from '@/stores'
+import { i18n,useGlobalStore } from '@/stores'
 import { useRequest } from '@/hooks/request'
 import { getI18nConfigs } from '@/services/api/common'
 import { localData } from '@/stores/storage'
@@ -54,6 +54,8 @@ defineProps({
 const meta = document.getElementsByTagName('meta')
 const version = meta.namedItem('revised')?.content ?? '0'
 
+const globalStore = useGlobalStore()
+
 const { dataList, run } = useRequest(getI18nConfigs, {
   manual: true
 })