li.shaoyi 1 年之前
父节点
当前提交
135ca8f5cc

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

@@ -1,8 +1,8 @@
 {
   "appId": "com.muchinfo.gcszt",
   "appName": "贵茶数字通",
-  "version": "1.0.9",
-  "versionCode": "100009",
+  "version": "1.0.10",
+  "versionCode": "100010",
   "apiUrl": "http://192.168.31.134:8080/cfg?key=test_134",
   "tradeChannel": "ws",
   "modules": [

+ 4 - 3
script/build.js

@@ -4,9 +4,10 @@ const { spawn } = require('child_process')
 const argv = process.argv
 const env = oemEnv.find((e) => argv.includes(e.VUE_APP_ENV))
 
-if (env) { 
-    spawn('npx', ['vue-cli-service', 'build'], {
-        env:{
+if (env) {
+    const args = ['vue-cli-service', 'build', ...argv]
+    spawn('npx', args, {
+        env: {
             ...process.env,
             ...env,
         },

+ 1 - 1
src/packages/mobile/views/report/components/index.vue

@@ -138,7 +138,7 @@ const requestData = () => {
 
 // 切换报表类型
 const onChange = () => {
-    const dateString = marketInfo.value?.pretradedate ?? new Date().toISOString()
+    const dateString = marketInfo.value?.pretradedate || new Date().toISOString()
     currentDate.value = moment(dateString).format(pickerFormat.value).split('-')
     requestData()
 }

+ 8 - 0
src/packages/pc/components/layouts/page/index.vue

@@ -53,6 +53,14 @@
             </el-popover>
           </li>
           <li>
+            <el-popover trigger="hover" title="公式" content="斩仓率 = (风险率 / 斩仓风险率) * 100%" :width="280">
+              <template #reference>
+                <span :class="accountStore.currentAccount.hazardRatioColor" style="cursor: pointer;">斩仓率:{{
+                  parsePercent(accountStore.currentAccount.liquidationRate) }}</span>
+              </template>
+            </el-popover>
+          </li>
+          <li>
             <span>用户ID:</span>
             <span>{{ loginStore.userId }}</span>
           </li>

+ 6 - 1
src/stores/modules/account.ts

@@ -39,6 +39,7 @@ export const useAccountStore = defineStore(() => {
             profitLoss: number; // 浮动盈亏
             hazardValue: number; // 风险净值
             hazardRatio: number; // 风险率
+            liquidationRate: number; // 斩仓率
             hazardRatioColor: string; // 风险率颜色
         })[] = []
 
@@ -128,6 +129,9 @@ export const useAccountStore = defineStore(() => {
                 hazardRatioColor = 'g-risk-red'
             }
 
+            // 计算斩仓率 任务 #5808
+            const liquidationRate = cutriskratio ? hazardRatio / cutriskratio : 0
+
             result.push({
                 ...item,
                 freezeMargin,
@@ -136,7 +140,8 @@ export const useAccountStore = defineStore(() => {
                 profitLoss,
                 hazardValue,
                 hazardRatio,
-                hazardRatioColor
+                hazardRatioColor,
+                liquidationRate
             })
         })