li.shaoyi %!s(int64=2) %!d(string=hai) anos
pai
achega
273bd037de

+ 2 - 1
public/config/appconfig.json

@@ -1,5 +1,6 @@
 {
   "version": "1.0.0",
   "versionCode": "100000",
-  "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204"
+  "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204",
+  "appName": "多元世纪"
 }

+ 2 - 2
src/hooks/echarts/candlestick/index.ts

@@ -211,8 +211,8 @@ export function useCandlestickChart(goodscode: string) {
     }
 
     // 监听行情推送
-    watch(() => quote.value, () => {
-        if (!loading.value && !isEmpty.value) {
+    watch(() => quote.value, (q) => {
+        if (q?.last && !loading.value && !isEmpty.value) {
             updateChart();
         }
     })

+ 2 - 2
src/hooks/echarts/smoothedline/index.ts

@@ -56,8 +56,8 @@ export function useSmoothedLineChart(goodscode: string) {
     }
 
     // 监听行情推送
-    watch(() => quote.value?.last, () => {
-        if (!loading.value && quote.value) {
+    watch(() => quote.value, (q) => {
+        if (q?.last && !loading.value && quote.value) {
             const { last, lasttime } = quote.value
             const { date, price } = dataset.line.source
             date.push(formatDate(lasttime, 'HH:mm:ss'))

+ 2 - 2
src/hooks/echarts/timeline/index.ts

@@ -102,8 +102,8 @@ export function useTimelineChart(goodscode: string) {
     }
 
     // 监听行情推送
-    watch(() => quote.value, () => {
-        if (!loading.value && !isEmpty.value) {
+    watch(() => quote.value, (q) => {
+        if (q?.last && !loading.value && !isEmpty.value) {
             updateChart()
         }
     })

+ 10 - 7
src/packages/gstj/components/modules/quote/tik/index.vue

@@ -4,14 +4,17 @@
             {{ formatDate(value, 'HH:mm:ss') }}
         </template>
         <template #PE="{ value }">
-            <span>{{ value }}</span>
+            <span>{{ handleNumberValue(value) }}</span>
+        </template>
+        <template #Vol="{ value }">
+            <span>{{ handleNumberValue(value) }}</span>
         </template>
     </AppList>
 </template>
 
 <script lang="ts" setup>
 import { ref, watch } from 'vue'
-import { formatDate } from '@/filters'
+import { formatDate, handleNumberValue } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { queryHistoryTikDatas, queryMarketRun } from '@/services/api/market'
 import { useFuturesStore } from '@/stores'
@@ -60,8 +63,8 @@ useRequest(queryMarketRun, {
     }
 })
 
-watch(() => quote.value?.last, () => {
-    if (quote.value) {
+watch(() => quote.value, (q) => {
+    if (q?.last) {
         const list = dataList.value
         if (list.length > 9) {
             // 移除列表最后一条记录
@@ -75,12 +78,12 @@ watch(() => quote.value?.last, () => {
             Bid: 0,
             HI: 0,
             HV: 0,
-            PE: quote.value.last,
+            PE: q.last,
             TDR: 0,
             TK: 0,
-            TS: quote.value.lasttime,
+            TS: q.lasttime,
             TT: 0,
-            Vol: quote.value.lastvolume,
+            Vol: q.lastvolume,
         })
     }
 })

+ 10 - 7
src/packages/mobile/components/modules/quote/tik/index.vue

@@ -4,14 +4,17 @@
             {{ formatDate(value, 'HH:mm:ss') }}
         </template>
         <template #PE="{ value }">
-            <span>{{ value }}</span>
+            <span>{{ handleNumberValue(value) }}</span>
+        </template>
+        <template #Vol="{ value }">
+            <span>{{ handleNumberValue(value) }}</span>
         </template>
     </AppList>
 </template>
 
 <script lang="ts" setup>
 import { ref, watch } from 'vue'
-import { formatDate } from '@/filters'
+import { formatDate, handleNumberValue } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { queryHistoryTikDatas, queryMarketRun } from '@/services/api/market'
 import { useFuturesStore } from '@/stores'
@@ -60,8 +63,8 @@ useRequest(queryMarketRun, {
     }
 })
 
-watch(() => quote.value?.last, () => {
-    if (quote.value) {
+watch(() => quote.value, (q) => {
+    if (q?.last) {
         const list = dataList.value
         if (list.length > 9) {
             // 移除列表最后一条记录
@@ -75,12 +78,12 @@ watch(() => quote.value?.last, () => {
             Bid: 0,
             HI: 0,
             HV: 0,
-            PE: quote.value.last,
+            PE: q.last,
             TDR: 0,
             TK: 0,
-            TS: quote.value.lasttime,
+            TS: q.lasttime,
             TT: 0,
-            Vol: quote.value.lastvolume,
+            Vol: q.lastvolume,
         })
     }
 })

+ 8 - 8
src/packages/pc/components/modules/quote/tik/index.vue

@@ -8,8 +8,8 @@
             <ul>
                 <li v-for="(item, index) in dataList" :key="index">
                     <span>{{ formatDate(item.TS, 'HH:mm:ss') }}</span>
-                    <span :class="handlePriceColor(quote.presettle, item.PE)">{{ item.PE }}</span>
-                    <span>{{ item.Vol }}</span>
+                    <span :class="handlePriceColor(item.PE, quote.presettle)">{{ handleNumberValue(item.PE) }}</span>
+                    <span>{{ handleNumberValue(item.Vol) }}</span>
                 </li>
             </ul>
         </div>
@@ -18,7 +18,7 @@
 
 <script lang="ts" setup>
 import { ref, watch } from 'vue'
-import { formatDate, handlePriceColor } from '@/filters'
+import { formatDate, handleNumberValue, handlePriceColor } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { queryHistoryTikDatas, queryMarketRun } from '@/services/api/market'
 import { useFuturesStore } from '@/stores'
@@ -60,8 +60,8 @@ useRequest(queryMarketRun, {
     }
 })
 
-watch(() => quote.value?.last, () => {
-    if (quote.value) {
+watch(() => quote.value, (q) => {
+    if (q?.last) {
         const list = dataList.value
         if (list.length > 9) {
             // 移除列表最后一条记录
@@ -75,12 +75,12 @@ watch(() => quote.value?.last, () => {
             Bid: 0,
             HI: 0,
             HV: 0,
-            PE: quote.value.last,
+            PE: q.last,
             TDR: 0,
             TK: 0,
-            TS: quote.value.lasttime,
+            TS: q.lasttime,
             TT: 0,
-            Vol: quote.value.lastvolume,
+            Vol: q.lastvolume,
         })
     }
 })

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

@@ -72,7 +72,9 @@ defineProps({
 })
 
 const { loading, dataList, run } = useRequest(queryTradePosition, {
-
+    params: {
+        tradeMode: '50'
+    },
 })
 
 const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.TradePositionRsp>({ rowKey: 'pkid' })

+ 5 - 2
src/packages/qxst/components/modules/quote/tik/index.vue

@@ -4,14 +4,17 @@
             {{ formatDate(value, 'HH:mm:ss') }}
         </template>
         <template #PE="{ value }">
-            <span>{{ value }}</span>
+            <span>{{ handleNumberValue(value) }}</span>
+        </template>
+        <template #Vol="{ value }">
+            <span>{{ handleNumberValue(value) }}</span>
         </template>
     </AppList>
 </template>
 
 <script lang="ts" setup>
 import { ref, watch } from 'vue'
-import { formatDate } from '@/filters'
+import { formatDate, handleNumberValue } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { queryHistoryTikDatas, queryMarketRun } from '@/services/api/market'
 import { useFuturesStore } from '@/stores'

+ 6 - 3
src/packages/sbyj/components/modules/quote/tik/index.vue

@@ -4,18 +4,21 @@
             {{ formatDate(value, 'HH:mm:ss') }}
         </template>
         <template #PE="{ value }">
-            <span>{{ value }}</span>
+            <span>{{ handleNumberValue(value) }}</span>
+        </template>
+        <template #Vol="{ value }">
+            <span>{{ handleNumberValue(value) }}</span>
         </template>
     </AppList>
 </template>
 
 <script lang="ts" setup>
 import { ref, watch } from 'vue'
-import { formatDate } from '@/filters'
+import { formatDate, handleNumberValue } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { queryHistoryTikDatas, queryMarketRun } from '@/services/api/market'
 import { useFuturesStore } from '@/stores'
-import AppList from '@/packages/sbyj/components/base/list/index.vue'
+import AppList from '../../../base/list/index.vue'
 
 const props = defineProps({
     goodsCode: {

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

@@ -28,7 +28,7 @@ export const useAccountStore = defineStore(() => {
             // 计算冻结资金
             const freezeMargin = item.freezecharge + item.freezemargin + item.otherfreezemargin + item.outamountfreeze
             // 计算可用资金
-            const avaiableMoney = item.currentbalance - freezeMargin
+            const avaiableMoney = item.currentbalance - item.usedmargin - freezeMargin
 
             result.push({
                 ...item,

+ 16 - 20
src/stores/modules/position.ts

@@ -12,7 +12,6 @@ const useStore = defineStore(() => {
     const futuresStore = useFuturesStore()
     const state = reactive({
         loading: false,
-        tradeMode: 0,
         orderPositionList: <Model.TradePositionRsp[]>[], // 持仓汇总列表
     })
 
@@ -48,35 +47,32 @@ const useStore = defineStore(() => {
         return result
     })
 
-    const orderPositionList = computed(() => {
-        if (state.tradeMode) {
-            return orderPositionComputedList.value.filter((e) => e.trademode === state.tradeMode)
-        }
-        return orderPositionComputedList.value
-    })
-
-    // 获取持仓数量
-    const getOrderQty = (buyOrSell: BuyOrSell, goodsCode: string) => {
-        return computed(() => {
-            const item = state.orderPositionList.find((e) => e.goodscode === goodsCode && e.buyorsell === buyOrSell)
-            return item?.enableqty ?? 0
-        })
-    }
-
     // 接收持仓变化通知
     const posChangedNtf = eventBus.$on('PosChangedNtf', () => getTradePosition())
 
     return {
         ...toRefs(state),
         getTradePosition,
-        getOrderQty,
-        orderPositionList,
+        orderPositionComputedList,
         posChangedNtf,
     }
 })
 
 export const usePositionStore = (tradeMode = 0) => {
     const store = useStore()
-    store.tradeMode = tradeMode
-    return store
+
+    const positionList = computed(() => store.orderPositionList.filter((e) => tradeMode ? e.trademode === tradeMode : true))
+
+    // 获取持仓数量
+    const getOrderQty = (buyOrSell: BuyOrSell, goodsCode: string) => {
+        return computed(() => {
+            const item = positionList.value.find((e) => e.goodscode === goodsCode && e.buyorsell === buyOrSell)
+            return item?.enableqty ?? 0
+        })
+    }
+
+    return {
+        positionList,
+        getOrderQty
+    }
 }