li.shaoyi vor 2 Jahren
Ursprung
Commit
21cbe912f6
27 geänderte Dateien mit 203 neuen und 279 gelöschten Zeilen
  1. 1 1
      public/config/appconfig.json
  2. 2 4
      src/hooks/echarts/timeline/index.ts
  3. 1 6
      src/packages/gstj/components/modules/quote/chart/index.vue
  4. 30 30
      src/packages/gstj/components/modules/quote/forex/index.vue
  5. 2 12
      src/packages/gstj/components/modules/quote/index.vue
  6. 15 11
      src/packages/gstj/components/modules/quote/tik/index.vue
  7. 2 10
      src/packages/gstj/views/goods/detail/Index.vue
  8. 1 6
      src/packages/mobile/components/modules/quote/chart/index.vue
  9. 30 30
      src/packages/mobile/components/modules/quote/forex/index.vue
  10. 2 12
      src/packages/mobile/components/modules/quote/index.vue
  11. 15 11
      src/packages/mobile/components/modules/quote/tik/index.vue
  12. 2 10
      src/packages/mobile/views/goods/detail/Index.vue
  13. 3 12
      src/packages/mobile/views/market/detail/Index.vue
  14. 4 0
      src/packages/pc/components/modules/listing/index.less
  15. 1 7
      src/packages/pc/components/modules/quote/chart/index.vue
  16. 2 12
      src/packages/pc/components/modules/quote/index.vue
  17. 5 4
      src/packages/pc/components/modules/quote/tik/index.less
  18. 21 17
      src/packages/pc/components/modules/quote/tik/index.vue
  19. 2 12
      src/packages/pc/views/market/trade/goods/detail/components/chart/index.vue
  20. 1 6
      src/packages/sbyj/components/modules/quote/chart/index.vue
  21. 30 30
      src/packages/sbyj/components/modules/quote/forex/index.vue
  22. 2 12
      src/packages/sbyj/components/modules/quote/index.vue
  23. 15 11
      src/packages/sbyj/components/modules/quote/tik/index.vue
  24. 2 12
      src/services/api/goods/index.ts
  25. 10 0
      src/services/api/market/index.ts
  26. 0 1
      src/stores/modules/futures.ts
  27. 2 0
      src/types/model/goods.d.ts

+ 1 - 1
public/config/appconfig.json

@@ -1,5 +1,5 @@
 {
   "version": "1.0.0",
   "versionCode": "100000",
-  "apiUrl": "http://192.168.31.171:8080/cfg?key=test_171"
+  "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204"
 }

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

@@ -1,4 +1,4 @@
-import { ref, computed, watch, getCurrentInstance } from 'vue'
+import { ref, computed, watch } from 'vue'
 //import { timerInterceptor } from '@/utils/timer'
 import { queryTSData } from '@/services/api/quote'
 import { useFuturesStore } from '@/stores'
@@ -7,7 +7,6 @@ import { useOptions } from './options'
 import moment from 'moment'
 
 export function useTimelineChart(goodscode: string) {
-    const context = getCurrentInstance()
     const futuresStore = useFuturesStore()
     const { dataset, handleData, clearData, calcIndicator } = useDataset()
     const { options, initOptions, updateOptions } = useOptions(dataset)
@@ -41,13 +40,12 @@ export function useTimelineChart(goodscode: string) {
                 goodsCode: goodscode
             }
         }).then((res) => {
-            const { historyDatas, startTime, endTime } = res.data
+            const { historyDatas } = res.data
             if (historyDatas.length) {
                 dataIndex.value = historyDatas.length - 1
                 isEmpty.value = false
                 handleData(res.data)
             }
-            context?.emit('ready', startTime, endTime)
         }).finally(() => {
             loading.value = false
         })

+ 1 - 6
src/packages/gstj/components/modules/quote/chart/index.vue

@@ -16,7 +16,7 @@
             </Tabs>
             <Icon name="setting-o" style="padding: 0 .32rem;" v-if="false" />
         </div>
-        <TimeLine v-bind="{ goodsCode }" @ready="onReady" v-if="tabIndex === 0" />
+        <TimeLine v-bind="{ goodsCode }" v-if="tabIndex === 0" />
         <KLine v-bind="{ goodsCode, cycleType }" v-else />
     </div>
 </template>
@@ -35,7 +35,6 @@ defineProps({
     }
 })
 
-const emit = defineEmits(['ready'])
 const tabIndex = shallowRef(0) // 当前选中的标签
 const selectedText = shallowRef('') // 当前选中的分钟线
 const cycleType = shallowRef(ChartCycleType.Minutes) // 图表周期类型
@@ -104,10 +103,6 @@ const onPopoverSelect = (action: PopoverAction) => {
         }
     }
 }
-
-const onReady = (startTime: string, endTime: string) => {
-    emit('ready', startTime, endTime)
-}
 </script>
 
 <style lang="less">

+ 30 - 30
src/packages/gstj/components/modules/quote/forex/index.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="app-quote-forex">
-        <dl>
+        <dl v-if="quote">
             <dt>
                 <span>卖挂牌</span>
                 <span @click="navigateTo(BuyOrSell.Sell)" v-if="showMore">更多
@@ -9,31 +9,31 @@
             </dt>
             <dd @click="onSellClick(1)">
                 <span>卖一</span>
-                <span :class="quote?.askColor">{{ handleNumberValue(quote?.ask) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume) }}</span>
+                <span :class="quote.askColor">{{ handleNumberValue(quote.ask) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume) }}</span>
             </dd>
-            <dd @click="onSellClick(2)">
+            <dd @click="onSellClick(2)" v-if="quote.quotegear > 1">
                 <span>卖二</span>
-                <span :class="quote?.ask2Color">{{ handleNumberValue(quote?.ask2) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume2) }}</span>
+                <span :class="quote.ask2Color">{{ handleNumberValue(quote.ask2) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume2) }}</span>
             </dd>
-            <dd @click="onSellClick(3)">
+            <dd @click="onSellClick(3)" v-if="quote.quotegear > 2">
                 <span>卖三</span>
-                <span :class="quote?.ask3Color">{{ handleNumberValue(quote?.ask3) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume3) }}</span>
+                <span :class="quote.ask3Color">{{ handleNumberValue(quote.ask3) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume3) }}</span>
             </dd>
-            <dd @click="onSellClick(4)">
+            <dd @click="onSellClick(4)" v-if="quote.quotegear > 3">
                 <span>卖四</span>
-                <span :class="quote?.ask4Color">{{ handleNumberValue(quote?.ask4) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume4) }}</span>
+                <span :class="quote.ask4Color">{{ handleNumberValue(quote.ask4) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume4) }}</span>
             </dd>
-            <dd @click="onSellClick(5)">
+            <dd @click="onSellClick(5)" v-if="quote.quotegear > 4">
                 <span>卖五</span>
-                <span :class="quote?.ask5Color">{{ handleNumberValue(quote?.ask5) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume5) }}</span>
+                <span :class="quote.ask5Color">{{ handleNumberValue(quote.ask5) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume5) }}</span>
             </dd>
         </dl>
-        <dl>
+        <dl v-if="quote">
             <dt>
                 <span>买挂牌</span>
                 <span @click="navigateTo(BuyOrSell.Buy)" v-if="showMore">更多
@@ -42,28 +42,28 @@
             </dt>
             <dd @click="onBuyClick(1)">
                 <span>买一</span>
-                <span :class="quote?.bidColor">{{ handleNumberValue(quote?.bid) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume) }}</span>
+                <span :class="quote.bidColor">{{ handleNumberValue(quote.bid) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume) }}</span>
             </dd>
-            <dd @click="onBuyClick(2)">
+            <dd @click="onBuyClick(2)" v-if="quote.quotegear > 1">
                 <span>买二</span>
-                <span :class="quote?.bid2Color">{{ handleNumberValue(quote?.bid2) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume2) }}</span>
+                <span :class="quote.bid2Color">{{ handleNumberValue(quote.bid2) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume2) }}</span>
             </dd>
-            <dd @click="onBuyClick(3)">
+            <dd @click="onBuyClick(3)" v-if="quote.quotegear > 2">
                 <span>买三</span>
-                <span :class="quote?.bid3Color">{{ handleNumberValue(quote?.bid3) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume3) }}</span>
+                <span :class="quote.bid3Color">{{ handleNumberValue(quote.bid3) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume3) }}</span>
             </dd>
-            <dd @click="onBuyClick(4)">
+            <dd @click="onBuyClick(4)" v-if="quote.quotegear > 3">
                 <span>买四</span>
-                <span :class="quote?.bid4Color">{{ handleNumberValue(quote?.bid4) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume4) }}</span>
+                <span :class="quote.bid4Color">{{ handleNumberValue(quote.bid4) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume4) }}</span>
             </dd>
-            <dd @click="onBuyClick(5)">
+            <dd @click="onBuyClick(5)" v-if="quote.quotegear > 4">
                 <span>买五</span>
-                <span :class="quote?.bid5Color">{{ handleNumberValue(quote?.bid5) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume5) }}</span>
+                <span :class="quote.bid5Color">{{ handleNumberValue(quote.bid5) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume5) }}</span>
             </dd>
         </dl>
     </div>

+ 2 - 12
src/packages/gstj/components/modules/quote/index.vue

@@ -1,15 +1,13 @@
 <template>
     <div class="app-quote">
         <Price v-bind="{ goodsCode }" />
-        <Chart v-bind="{ goodsCode }" @ready="onReady" />
+        <Chart v-bind="{ goodsCode }" />
         <Forex v-bind="{ goodsCode }" v-if="showForex" />
-        <Tik v-bind="{ goodsCode, startTime, endTime }" />
+        <Tik v-bind="{ goodsCode }" />
     </div>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
-import { formatDate } from '@/filters'
 import Price from './price/index.vue'
 import Chart from './chart/index.vue'
 import Forex from './forex/index.vue'
@@ -22,12 +20,4 @@ defineProps({
     },
     showForex: Boolean,
 })
-
-const startTime = shallowRef<string>()
-const endTime = shallowRef<string>()
-
-const onReady = (start: string, end: string) => {
-    startTime.value = formatDate(start)
-    endTime.value = formatDate(end)
-}
 </script>

+ 15 - 11
src/packages/gstj/components/modules/quote/tik/index.vue

@@ -10,10 +10,10 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, watchEffect, watch } from 'vue'
+import { ref, watch } from 'vue'
 import { formatDate } from '@/filters'
 import { useRequest } from '@/hooks/request'
-import { queryHistoryTikDatas } from '@/services/api/market'
+import { queryHistoryTikDatas, queryMarketRun } from '@/services/api/market'
 import { useFuturesStore } from '@/stores'
 import AppList from '../../../base/list/index.vue'
 
@@ -22,8 +22,6 @@ const props = defineProps({
         type: String,
         required: true
     },
-    startTime: String,
-    endTime: String,
 })
 
 const futuresStore = useFuturesStore()
@@ -36,7 +34,7 @@ const columns: Model.TableColumn[] = [
     { prop: 'Vol', label: '现量' },
 ]
 
-const { run } = useRequest(queryHistoryTikDatas, {
+const { run: getHistoryTikDatas } = useRequest(queryHistoryTikDatas, {
     manual: true,
     params: {
         goodsCode: props.goodsCode,
@@ -47,12 +45,18 @@ const { run } = useRequest(queryHistoryTikDatas, {
     }
 })
 
-watchEffect(() => {
-    if (props.startTime && props.endTime) {
-        run({
-            startTime: formatDate(props.startTime),
-            endTime: formatDate(props.endTime),
-        })
+useRequest(queryMarketRun, {
+    params: {
+        marketID: quote.value?.marketid
+    },
+    onSuccess: (res) => {
+        const market = res.data[0]
+        if (market) {
+            getHistoryTikDatas({
+                startTime: formatDate(market.startTime),
+                endTime: formatDate(market.endTime),
+            })
+        }
     }
 })
 

+ 2 - 10
src/packages/gstj/views/goods/detail/Index.vue

@@ -4,9 +4,9 @@
             <app-navbar :title="quote ? quote.goodscode + '/' + quote.goodsname : '挂牌大厅'" />
         </template>
         <component :is="Price" v-bind="{ goodsCode }" />
-        <component :is="Chart" v-bind="{ goodsCode }" @ready="onReady" />
+        <component :is="Chart" v-bind="{ goodsCode }" />
         <component :is="Forex" v-bind="{ goodsCode }" />
-        <component :is="Tik" v-bind="{ goodsCode, startTime, endTime }" />
+        <component :is="Tik" v-bind="{ goodsCode }" />
         <template #footer>
             <div class="g-form__footer">
                 <Button block type="danger" square @click="onListing(EBuildType.BUILDTYPE_OPEN)">订立</Button>
@@ -22,7 +22,6 @@
 <script lang="ts" setup>
 import { shallowRef, defineAsyncComponent, computed } from 'vue'
 import { Button } from 'vant'
-import { formatDate } from '@/filters'
 import { useNavigation } from '../../../router/navigation'
 import { useComponent } from '@/hooks/component'
 import { EBuildType } from '@/constants/client'
@@ -45,18 +44,11 @@ const goodsid = getQueryStringToNumber('goodsid')
 const quote = futuresStore.getQuoteInfo(goodsid)
 
 const goodsCode = computed(() => quote.value?.goodscode ?? '')
-const startTime = shallowRef<string>()
-const endTime = shallowRef<string>()
 const buildType = shallowRef<EBuildType>() // 挂牌类型
 const isDisabledClose = shallowRef(true)
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent()
 
-const onReady = (start: string, end: string) => {
-    startTime.value = formatDate(start)
-    endTime.value = formatDate(end)
-}
-
 const onListing = (type: EBuildType) => {
     buildType.value = type
     openComponent('listing')

+ 1 - 6
src/packages/mobile/components/modules/quote/chart/index.vue

@@ -16,7 +16,7 @@
             </Tabs>
             <Icon name="setting-o" style="padding: 0 .32rem;" v-if="false" />
         </div>
-        <TimeLine v-bind="{ goodsCode }" @ready="onReady" v-if="tabIndex === 0" />
+        <TimeLine v-bind="{ goodsCode }" v-if="tabIndex === 0" />
         <KLine v-bind="{ goodsCode, cycleType }" v-else />
     </div>
 </template>
@@ -35,7 +35,6 @@ defineProps({
     }
 })
 
-const emit = defineEmits(['ready'])
 const tabIndex = shallowRef(0) // 当前选中的标签
 const selectedText = shallowRef('') // 当前选中的分钟线
 const cycleType = shallowRef(ChartCycleType.Minutes) // 图表周期类型
@@ -104,10 +103,6 @@ const onPopoverSelect = (action: PopoverAction) => {
         }
     }
 }
-
-const onReady = (startTime: string, endTime: string) => {
-    emit('ready', startTime, endTime)
-}
 </script>
 
 <style lang="less">

+ 30 - 30
src/packages/mobile/components/modules/quote/forex/index.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="app-quote-forex">
-        <dl>
+        <dl v-if="quote">
             <dt>
                 <span>卖挂牌</span>
                 <span @click="navigateTo(BuyOrSell.Sell)" v-if="showMore">更多
@@ -9,31 +9,31 @@
             </dt>
             <dd @click="onSellClick(1)">
                 <span>卖一</span>
-                <span :class="quote?.askColor">{{ handleNumberValue(quote?.ask) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume) }}</span>
+                <span :class="quote.askColor">{{ handleNumberValue(quote.ask) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume) }}</span>
             </dd>
-            <dd @click="onSellClick(2)">
+            <dd @click="onSellClick(2)" v-if="quote.quotegear > 1">
                 <span>卖二</span>
-                <span :class="quote?.ask2Color">{{ handleNumberValue(quote?.ask2) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume2) }}</span>
+                <span :class="quote.ask2Color">{{ handleNumberValue(quote.ask2) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume2) }}</span>
             </dd>
-            <dd @click="onSellClick(3)">
+            <dd @click="onSellClick(3)" v-if="quote.quotegear > 2">
                 <span>卖三</span>
-                <span :class="quote?.ask3Color">{{ handleNumberValue(quote?.ask3) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume3) }}</span>
+                <span :class="quote.ask3Color">{{ handleNumberValue(quote.ask3) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume3) }}</span>
             </dd>
-            <dd @click="onSellClick(4)">
+            <dd @click="onSellClick(4)" v-if="quote.quotegear > 3">
                 <span>卖四</span>
-                <span :class="quote?.ask4Color">{{ handleNumberValue(quote?.ask4) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume4) }}</span>
+                <span :class="quote.ask4Color">{{ handleNumberValue(quote.ask4) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume4) }}</span>
             </dd>
-            <dd @click="onSellClick(5)">
+            <dd @click="onSellClick(5)" v-if="quote.quotegear > 4">
                 <span>卖五</span>
-                <span :class="quote?.ask5Color">{{ handleNumberValue(quote?.ask5) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume5) }}</span>
+                <span :class="quote.ask5Color">{{ handleNumberValue(quote.ask5) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume5) }}</span>
             </dd>
         </dl>
-        <dl>
+        <dl v-if="quote">
             <dt>
                 <span>买挂牌</span>
                 <span @click="navigateTo(BuyOrSell.Buy)" v-if="showMore">更多
@@ -42,28 +42,28 @@
             </dt>
             <dd @click="onBuyClick(1)">
                 <span>买一</span>
-                <span :class="quote?.bidColor">{{ handleNumberValue(quote?.bid) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume) }}</span>
+                <span :class="quote.bidColor">{{ handleNumberValue(quote.bid) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume) }}</span>
             </dd>
-            <dd @click="onBuyClick(2)">
+            <dd @click="onBuyClick(2)" v-if="quote.quotegear > 1">
                 <span>买二</span>
-                <span :class="quote?.bid2Color">{{ handleNumberValue(quote?.bid2) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume2) }}</span>
+                <span :class="quote.bid2Color">{{ handleNumberValue(quote.bid2) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume2) }}</span>
             </dd>
-            <dd @click="onBuyClick(3)">
+            <dd @click="onBuyClick(3)" v-if="quote.quotegear > 2">
                 <span>买三</span>
-                <span :class="quote?.bid3Color">{{ handleNumberValue(quote?.bid3) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume3) }}</span>
+                <span :class="quote.bid3Color">{{ handleNumberValue(quote.bid3) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume3) }}</span>
             </dd>
-            <dd @click="onBuyClick(4)">
+            <dd @click="onBuyClick(4)" v-if="quote.quotegear > 3">
                 <span>买四</span>
-                <span :class="quote?.bid4Color">{{ handleNumberValue(quote?.bid4) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume4) }}</span>
+                <span :class="quote.bid4Color">{{ handleNumberValue(quote.bid4) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume4) }}</span>
             </dd>
-            <dd @click="onBuyClick(5)">
+            <dd @click="onBuyClick(5)" v-if="quote.quotegear > 4">
                 <span>买五</span>
-                <span :class="quote?.bid5Color">{{ handleNumberValue(quote?.bid5) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume5) }}</span>
+                <span :class="quote.bid5Color">{{ handleNumberValue(quote.bid5) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume5) }}</span>
             </dd>
         </dl>
     </div>

+ 2 - 12
src/packages/mobile/components/modules/quote/index.vue

@@ -1,15 +1,13 @@
 <template>
     <div class="app-quote">
         <Price v-bind="{ goodsCode }" />
-        <Chart v-bind="{ goodsCode }" @ready="onReady" />
+        <Chart v-bind="{ goodsCode }" />
         <Forex v-bind="{ goodsCode }" v-if="showForex" />
-        <Tik v-bind="{ goodsCode, startTime, endTime }" />
+        <Tik v-bind="{ goodsCode }" />
     </div>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
-import { formatDate } from '@/filters'
 import Price from './price/index.vue'
 import Chart from './chart/index.vue'
 import Forex from './forex/index.vue'
@@ -22,12 +20,4 @@ defineProps({
     },
     showForex: Boolean,
 })
-
-const startTime = shallowRef<string>()
-const endTime = shallowRef<string>()
-
-const onReady = (start: string, end: string) => {
-    startTime.value = formatDate(start)
-    endTime.value = formatDate(end)
-}
 </script>

+ 15 - 11
src/packages/mobile/components/modules/quote/tik/index.vue

@@ -10,10 +10,10 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, watchEffect, watch } from 'vue'
+import { ref, watch } from 'vue'
 import { formatDate } from '@/filters'
 import { useRequest } from '@/hooks/request'
-import { queryHistoryTikDatas } from '@/services/api/market'
+import { queryHistoryTikDatas, queryMarketRun } from '@/services/api/market'
 import { useFuturesStore } from '@/stores'
 import AppList from '../../../base/list/index.vue'
 
@@ -22,8 +22,6 @@ const props = defineProps({
         type: String,
         required: true
     },
-    startTime: String,
-    endTime: String,
 })
 
 const futuresStore = useFuturesStore()
@@ -36,7 +34,7 @@ const columns: Model.TableColumn[] = [
     { prop: 'Vol', label: '现量' },
 ]
 
-const { run } = useRequest(queryHistoryTikDatas, {
+const { run: getHistoryTikDatas } = useRequest(queryHistoryTikDatas, {
     manual: true,
     params: {
         goodsCode: props.goodsCode,
@@ -47,12 +45,18 @@ const { run } = useRequest(queryHistoryTikDatas, {
     }
 })
 
-watchEffect(() => {
-    if (props.startTime && props.endTime) {
-        run({
-            startTime: formatDate(props.startTime),
-            endTime: formatDate(props.endTime),
-        })
+useRequest(queryMarketRun, {
+    params: {
+        marketID: quote.value?.marketid
+    },
+    onSuccess: (res) => {
+        const market = res.data[0]
+        if (market) {
+            getHistoryTikDatas({
+                startTime: formatDate(market.startTime),
+                endTime: formatDate(market.endTime),
+            })
+        }
     }
 })
 

+ 2 - 10
src/packages/mobile/views/goods/detail/Index.vue

@@ -4,9 +4,9 @@
             <app-navbar :title="quote ? quote.goodscode + '/' + quote.goodsname : '挂牌大厅'" />
         </template>
         <component :is="Price" v-bind="{ goodsCode }" />
-        <component :is="Chart" v-bind="{ goodsCode }" @ready="onReady" />
+        <component :is="Chart" v-bind="{ goodsCode }" />
         <component :is="Forex" v-bind="{ goodsCode }" />
-        <component :is="Tik" v-bind="{ goodsCode, startTime, endTime }" />
+        <component :is="Tik" v-bind="{ goodsCode }" />
         <template #footer>
             <div class="g-form__footer">
                 <Button block type="danger" square @click="onListing(EBuildType.BUILDTYPE_OPEN)">订立</Button>
@@ -22,7 +22,6 @@
 <script lang="ts" setup>
 import { shallowRef, defineAsyncComponent, computed } from 'vue'
 import { Button } from 'vant'
-import { formatDate } from '@/filters'
 import { useNavigation } from '../../../router/navigation'
 import { useComponent } from '@/hooks/component'
 import { EBuildType } from '@/constants/client'
@@ -45,18 +44,11 @@ const goodsid = getQueryStringToNumber('goodsid')
 const quote = futuresStore.getQuoteInfo(goodsid)
 
 const goodsCode = computed(() => quote.value?.goodscode ?? '')
-const startTime = shallowRef<string>()
-const endTime = shallowRef<string>()
 const buildType = shallowRef<EBuildType>() // 挂牌类型
 const isDisabledClose = shallowRef(true)
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent()
 
-const onReady = (start: string, end: string) => {
-    startTime.value = formatDate(start)
-    endTime.value = formatDate(end)
-}
-
 const onListing = (type: EBuildType) => {
     buildType.value = type
     openComponent('listing')

+ 3 - 12
src/packages/mobile/views/market/detail/Index.vue

@@ -4,14 +4,13 @@
             <app-navbar :title="futuresStore.getGoodsName(goodsCode) ?? '商品详情'" />
         </template>
         <component :is="Price" v-bind="{ goodsCode }" />
-        <component :is="Chart" v-bind="{ goodsCode }" @ready="onReady" />
-        <component :is="Tik" v-bind="{ goodsCode, startTime, endTime }" />
+        <component :is="Chart" v-bind="{ goodsCode }" />
+        <component :is="Tik" v-bind="{ goodsCode }" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, defineAsyncComponent } from 'vue'
-import { formatDate } from '@/filters'
+import { defineAsyncComponent } from 'vue'
 import { useNavigation } from '../../../router/navigation'
 import { useFuturesStore } from '@/stores'
 
@@ -22,12 +21,4 @@ const Tik = defineAsyncComponent(() => import('../../../components/modules/quote
 const { getQueryString } = useNavigation()
 const goodsCode = getQueryString('goodscode')
 const futuresStore = useFuturesStore()
-
-const startTime = shallowRef<string>()
-const endTime = shallowRef<string>()
-
-const onReady = (start: string, end: string) => {
-    startTime.value = formatDate(start)
-    endTime.value = formatDate(end)
-}
 </script>

+ 4 - 0
src/packages/pc/components/modules/listing/index.less

@@ -9,6 +9,10 @@
 
         .app-quote-forex {
             height: 100%;
+
+            li {
+                cursor: pointer;
+            }
         }
     }
 

+ 1 - 7
src/packages/pc/components/modules/quote/chart/index.vue

@@ -3,8 +3,7 @@
         <div class="app-quote-chart__header">
             <app-tabs class="app-tabs--info" :data-list="dataList" @change="onTabChange" />
         </div>
-        <TimeLine class="app-quote-chart__body" v-bind="{ goodsCode }" @ready="onReady"
-            v-if="cycleType === ChartCycleType.Time" />
+        <TimeLine class="app-quote-chart__body" v-bind="{ goodsCode }" v-if="cycleType === ChartCycleType.Time" />
         <KLine class="app-quote-chart__body" v-bind="{ goodsCode, cycleType }" v-else />
     </div>
 </template>
@@ -23,7 +22,6 @@ defineProps({
     }
 })
 
-const emit = defineEmits(['ready'])
 const dataList = getChartCycleTypeList()
 const cycleType = shallowRef(ChartCycleType.Time) // 图表周期类型
 
@@ -31,10 +29,6 @@ const cycleType = shallowRef(ChartCycleType.Time) // 图表周期类型
 const onTabChange = (index: number) => {
     cycleType.value = dataList[index].value
 }
-
-const onReady = (startTime: string, endTime: string) => {
-    emit('ready', startTime, endTime)
-}
 </script>
 
 <style lang="less">

+ 2 - 12
src/packages/pc/components/modules/quote/index.vue

@@ -1,15 +1,13 @@
 <template>
     <div class="app-quote">
         <Price v-bind="{ goodsCode }" />
-        <Chart v-bind="{ goodsCode }" @ready="onReady" />
+        <Chart v-bind="{ goodsCode }" />
         <Forex v-bind="{ goodsCode }" v-if="showForex" />
-        <Tik v-bind="{ goodsCode, startTime, endTime }" />
+        <Tik v-bind="{ goodsCode }" />
     </div>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
-import { formatDate } from '@/filters'
 import Price from './price/index.vue'
 import Chart from './chart/index.vue'
 import Forex from './forex/index.vue'
@@ -22,12 +20,4 @@ defineProps({
     },
     showForex: Boolean,
 })
-
-const startTime = shallowRef<string>()
-const endTime = shallowRef<string>()
-
-const onReady = (start: string, end: string) => {
-    startTime.value = formatDate(start)
-    endTime.value = formatDate(end)
-}
 </script>

+ 5 - 4
src/packages/pc/components/modules/quote/tik/index.less

@@ -1,22 +1,23 @@
 .app-quote-tik {
-    color: #fff;
+    color: #ACB8C0;
 
     &__header {
         display: flex;
         justify-content: space-between;
         align-items: center;
         background-color: #333;
-        padding: 5px;
+        padding: 6px;
     }
 
     &__body {
         ul {
+            font-size: 12px;
             text-align: center;
-            padding: 5px;
+            padding: 8px;
 
             li {
                 display: flex;
-                padding: 3px 0;
+                padding: 4px 0;
 
                 span {
                     flex: 1;

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

@@ -2,13 +2,13 @@
     <div class="app-quote-tik">
         <div class="app-quote-tik__header">
             <h4>成交明细</h4>
-            <span>更多</span>
+            <!-- <span>更多</span> -->
         </div>
-        <div class="app-quote-tik__body">
+        <div class="app-quote-tik__body" v-if="quote">
             <ul>
                 <li v-for="(item, index) in dataList" :key="index">
                     <span>{{ formatDate(item.TS, 'HH:mm:ss') }}</span>
-                    <span>{{ item.PE }}</span>
+                    <span :class="handlePriceColor(quote.presettle, item.PE)">{{ item.PE }}</span>
                     <span>{{ item.Vol }}</span>
                 </li>
             </ul>
@@ -17,10 +17,10 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, watchEffect, watch } from 'vue'
-import { formatDate } from '@/filters'
+import { ref, watch } from 'vue'
+import { formatDate, handlePriceColor } from '@/filters'
 import { useRequest } from '@/hooks/request'
-import { queryHistoryTikDatas } from '@/services/api/market'
+import { queryHistoryTikDatas, queryMarketRun } from '@/services/api/market'
 import { useFuturesStore } from '@/stores'
 
 const props = defineProps({
@@ -28,38 +28,42 @@ const props = defineProps({
         type: String,
         required: true
     },
-    startTime: String,
-    endTime: String,
 })
 
 const futuresStore = useFuturesStore()
 const quote = futuresStore.getQuoteInfo(props.goodsCode)
 const dataList = ref<Model.HistoryTikDatasRsp[]>([])
 
-const { run } = useRequest(queryHistoryTikDatas, {
+const { run: getHistoryTikDatas } = useRequest(queryHistoryTikDatas, {
     manual: true,
     params: {
         goodsCode: props.goodsCode,
-        count: 10
+        count: 20
     },
     onSuccess: (res) => {
         dataList.value = res.data
     }
 })
 
-watchEffect(() => {
-    if (props.startTime && props.endTime) {
-        run({
-            startTime: formatDate(props.startTime),
-            endTime: formatDate(props.endTime),
-        })
+useRequest(queryMarketRun, {
+    params: {
+        marketID: quote.value?.marketid
+    },
+    onSuccess: (res) => {
+        const market = res.data[0]
+        if (market) {
+            getHistoryTikDatas({
+                startTime: formatDate(market.startTime),
+                endTime: formatDate(market.endTime),
+            })
+        }
     }
 })
 
 watch(() => quote.value?.last, () => {
     if (quote.value) {
         const list = dataList.value
-        if (list.length > 9) {
+        if (list.length > 19) {
             // 移除列表最后一条记录
             list.pop()
         }

+ 2 - 12
src/packages/pc/views/market/trade/goods/detail/components/chart/index.vue

@@ -1,19 +1,17 @@
 <template>
     <div class="market-trade-goods-detail-chart">
         <div class="block-left">
-            <Chart v-bind="{ goodsCode }" @ready="onReady" />
+            <Chart v-bind="{ goodsCode }" />
         </div>
         <div class="block-right">
             <Price v-bind="{ goodsCode }" />
             <Forex v-bind="{ goodsCode }" />
-            <Tik v-bind="{ goodsCode, startTime, endTime }" />
+            <Tik v-bind="{ goodsCode }" />
         </div>
     </div>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
-import { formatDate } from '@/filters'
 import Price from '@pc/components/modules/quote/price/index.vue'
 import Chart from '@pc/components/modules/quote/chart/index.vue'
 import Forex from '@pc/components/modules/quote/forex/index.vue'
@@ -25,14 +23,6 @@ defineProps({
         required: true
     },
 })
-
-const startTime = shallowRef<string>()
-const endTime = shallowRef<string>()
-
-const onReady = (start: string, end: string) => {
-    startTime.value = formatDate(start)
-    endTime.value = formatDate(end)
-}
 </script>
 
 <style lang="less">

+ 1 - 6
src/packages/sbyj/components/modules/quote/chart/index.vue

@@ -16,7 +16,7 @@
             </Tabs>
             <Icon name="setting-o" style="padding: 0 .32rem;" v-if="false" />
         </div>
-        <TimeLine v-bind="{ goodsCode }" @ready="onReady" v-if="tabIndex === 0" />
+        <TimeLine v-bind="{ goodsCode }" v-if="tabIndex === 0" />
         <KLine v-bind="{ goodsCode, cycleType }" v-else />
     </div>
 </template>
@@ -35,7 +35,6 @@ defineProps({
     }
 })
 
-const emit = defineEmits(['ready'])
 const tabIndex = shallowRef(0) // 当前选中的标签
 const selectedText = shallowRef('') // 当前选中的分钟线
 const cycleType = shallowRef(ChartCycleType.Minutes) // 图表周期类型
@@ -104,10 +103,6 @@ const onPopoverSelect = (action: PopoverAction) => {
         }
     }
 }
-
-const onReady = (startTime: string, endTime: string) => {
-    emit('ready', startTime, endTime)
-}
 </script>
 
 <style lang="less">

+ 30 - 30
src/packages/sbyj/components/modules/quote/forex/index.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="app-quote-forex">
-        <dl>
+        <dl v-if="quote">
             <dt>
                 <span>卖挂牌</span>
                 <span @click="navigateTo(BuyOrSell.Sell)" v-if="showMore">更多
@@ -9,31 +9,31 @@
             </dt>
             <dd @click="onSellClick(1)">
                 <span>卖一</span>
-                <span :class="quote?.askColor">{{ handleNumberValue(quote?.ask) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume) }}</span>
+                <span :class="quote.askColor">{{ handleNumberValue(quote.ask) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume) }}</span>
             </dd>
-            <dd @click="onSellClick(2)">
+            <dd @click="onSellClick(2)" v-if="quote.quotegear > 1">
                 <span>卖二</span>
-                <span :class="quote?.ask2Color">{{ handleNumberValue(quote?.ask2) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume2) }}</span>
+                <span :class="quote.ask2Color">{{ handleNumberValue(quote.ask2) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume2) }}</span>
             </dd>
-            <dd @click="onSellClick(3)">
+            <dd @click="onSellClick(3)" v-if="quote.quotegear > 2">
                 <span>卖三</span>
-                <span :class="quote?.ask3Color">{{ handleNumberValue(quote?.ask3) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume3) }}</span>
+                <span :class="quote.ask3Color">{{ handleNumberValue(quote.ask3) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume3) }}</span>
             </dd>
-            <dd @click="onSellClick(4)">
+            <dd @click="onSellClick(4)" v-if="quote.quotegear > 3">
                 <span>卖四</span>
-                <span :class="quote?.ask4Color">{{ handleNumberValue(quote?.ask4) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume4) }}</span>
+                <span :class="quote.ask4Color">{{ handleNumberValue(quote.ask4) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume4) }}</span>
             </dd>
-            <dd @click="onSellClick(5)">
+            <dd @click="onSellClick(5)" v-if="quote.quotegear > 4">
                 <span>卖五</span>
-                <span :class="quote?.ask5Color">{{ handleNumberValue(quote?.ask5) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume5) }}</span>
+                <span :class="quote.ask5Color">{{ handleNumberValue(quote.ask5) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume5) }}</span>
             </dd>
         </dl>
-        <dl>
+        <dl v-if="quote">
             <dt>
                 <span>买挂牌</span>
                 <span @click="navigateTo(BuyOrSell.Buy)" v-if="showMore">更多
@@ -42,28 +42,28 @@
             </dt>
             <dd @click="onBuyClick(1)">
                 <span>买一</span>
-                <span :class="quote?.bidColor">{{ handleNumberValue(quote?.bid) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume) }}</span>
+                <span :class="quote.bidColor">{{ handleNumberValue(quote.bid) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume) }}</span>
             </dd>
-            <dd @click="onBuyClick(2)">
+            <dd @click="onBuyClick(2)" v-if="quote.quotegear > 1">
                 <span>买二</span>
-                <span :class="quote?.bid2Color">{{ handleNumberValue(quote?.bid2) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume2) }}</span>
+                <span :class="quote.bid2Color">{{ handleNumberValue(quote.bid2) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume2) }}</span>
             </dd>
-            <dd @click="onBuyClick(3)">
+            <dd @click="onBuyClick(3)" v-if="quote.quotegear > 2">
                 <span>买三</span>
-                <span :class="quote?.bid3Color">{{ handleNumberValue(quote?.bid3) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume3) }}</span>
+                <span :class="quote.bid3Color">{{ handleNumberValue(quote.bid3) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume3) }}</span>
             </dd>
-            <dd @click="onBuyClick(4)">
+            <dd @click="onBuyClick(4)" v-if="quote.quotegear > 3">
                 <span>买四</span>
-                <span :class="quote?.bid4Color">{{ handleNumberValue(quote?.bid4) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume4) }}</span>
+                <span :class="quote.bid4Color">{{ handleNumberValue(quote.bid4) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume4) }}</span>
             </dd>
-            <dd @click="onBuyClick(5)">
+            <dd @click="onBuyClick(5)" v-if="quote.quotegear > 4">
                 <span>买五</span>
-                <span :class="quote?.bid5Color">{{ handleNumberValue(quote?.bid5) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume5) }}</span>
+                <span :class="quote.bid5Color">{{ handleNumberValue(quote.bid5) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume5) }}</span>
             </dd>
         </dl>
     </div>

+ 2 - 12
src/packages/sbyj/components/modules/quote/index.vue

@@ -1,15 +1,13 @@
 <template>
     <div class="app-quote">
         <Price v-bind="{ goodsCode }" />
-        <Chart v-bind="{ goodsCode }" @ready="onReady" />
+        <Chart v-bind="{ goodsCode }" />
         <Forex v-bind="{ goodsCode }" v-if="showForex" />
-        <Tik v-bind="{ goodsCode, startTime, endTime }" />
+        <Tik v-bind="{ goodsCode }" />
     </div>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
-import { formatDate } from '@/filters'
 import Price from './price/index.vue'
 import Chart from './chart/index.vue'
 import Forex from './forex/index.vue'
@@ -22,12 +20,4 @@ defineProps({
     },
     showForex: Boolean,
 })
-
-const startTime = shallowRef<string>()
-const endTime = shallowRef<string>()
-
-const onReady = (start: string, end: string) => {
-    startTime.value = formatDate(start)
-    endTime.value = formatDate(end)
-}
 </script>

+ 15 - 11
src/packages/sbyj/components/modules/quote/tik/index.vue

@@ -10,10 +10,10 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, watchEffect, watch } from 'vue'
+import { ref, watch } from 'vue'
 import { formatDate } from '@/filters'
 import { useRequest } from '@/hooks/request'
-import { queryHistoryTikDatas } from '@/services/api/market'
+import { queryHistoryTikDatas, queryMarketRun } from '@/services/api/market'
 import { useFuturesStore } from '@/stores'
 import AppList from '@/packages/sbyj/components/base/list/index.vue'
 
@@ -22,8 +22,6 @@ const props = defineProps({
         type: String,
         required: true
     },
-    startTime: String,
-    endTime: String,
 })
 
 const futuresStore = useFuturesStore()
@@ -36,7 +34,7 @@ const columns: Model.TableColumn[] = [
     { prop: 'Vol', label: '现量' },
 ]
 
-const { run } = useRequest(queryHistoryTikDatas, {
+const { run: getHistoryTikDatas } = useRequest(queryHistoryTikDatas, {
     manual: true,
     params: {
         goodsCode: props.goodsCode,
@@ -47,12 +45,18 @@ const { run } = useRequest(queryHistoryTikDatas, {
     }
 })
 
-watchEffect(() => {
-    if (props.startTime && props.endTime) {
-        run({
-            startTime: formatDate(props.startTime),
-            endTime: formatDate(props.endTime),
-        })
+useRequest(queryMarketRun, {
+    params: {
+        marketID: quote.value?.marketid
+    },
+    onSuccess: (res) => {
+        const market = res.data[0]
+        if (market) {
+            getHistoryTikDatas({
+                startTime: formatDate(market.startTime),
+                endTime: formatDate(market.endTime),
+            })
+        }
     }
 })
 

+ 2 - 12
src/services/api/goods/index.ts

@@ -130,16 +130,6 @@ export function queryTHJProduct(config: RequestConfig<Model.THJProductReq> = {})
 }
 
 /**
- * 查询市场运行信息
- */
-export function queryMarketRun(config: RequestConfig<Model.MarketRunReq> = {}) {
-    return http.commonRequest<Model.MarketRunRsp[]>({
-        url: '/Market/QueryMarketRun',
-        params: config.data,
-    })
-}
-
-/**
  * 查询市场交易参数配置
  */
 export function queryWrMarketTradeConfig(config: RequestConfig<Model.WrMarketTradeConfigReq> = {}) {
@@ -171,7 +161,7 @@ export function queryWrStandardFactoryItem(config: RequestConfig<Model.WrStandar
 /**
  * 查询企业风管期货商品信息
  */
- export function queryTouristGoods(config: RequestConfig = {}) {
+export function queryTouristGoods(config: RequestConfig = {}) {
     return http.commonRequest<Model.GoodsRsp[]>({
         url: '/sbyj/GetTouristGoods',
     })
@@ -180,7 +170,7 @@ export function queryWrStandardFactoryItem(config: RequestConfig<Model.WrStandar
 /**
  * 获取游客商品盘面信息
  */
- export function queryTouristQuoteDay(config: RequestConfig<Model.QuoteDayReq> = {}) {
+export function queryTouristQuoteDay(config: RequestConfig<Model.QuoteDayReq> = {}) {
     return http.commonRequest<Model.QuoteDayRsp[]>({
         url: '/Quote/GetTouristQuoteDay',
         params: config.data,

+ 10 - 0
src/services/api/market/index.ts

@@ -2,6 +2,16 @@ import http from '@/services/http'
 import { RequestConfig } from '@/services/http/types'
 
 /**
+ * 查询市场运行信息
+ */
+export function queryMarketRun(config: RequestConfig<Model.MarketRunReq> = {}) {
+    return http.commonRequest<Model.MarketRunRsp[]>({
+        url: '/Market/QueryMarketRun',
+        params: config.data,
+    })
+}
+
+/**
  * 获取现货行情
  */
 export function querySpotGoodsPrice(config: RequestConfig<Model.SpotGoodsPriceReq> = {}) {

+ 0 - 1
src/stores/modules/futures.ts

@@ -189,7 +189,6 @@ export const useFuturesStore = defineStore(() => {
     const getQuotePrice = (code?: string | number) => {
         return computed(() => {
             const quote = getQuoteInfo(code)
-            console.log(quote.value)
             return quote.value?.last ?? 0
         })
     }

+ 2 - 0
src/types/model/goods.d.ts

@@ -261,6 +261,7 @@ declare namespace Model {
         afternexttradedate: string
         /// 行情清盘标志- 1:未发送 2:已发送 3:已回复
         clearquoteflag: number
+        endTime: string; // 结束时间
         /// 最新交易日(结算成功)
         lastreckondate: string
         /// 机器时间
@@ -279,6 +280,7 @@ declare namespace Model {
         runstatus: number
         /// 时间段号[多时段时用]
         sectionid: number
+        startTime: string; // 开始时间
         /// 当前交易日(服务) 资金结算完成即变更,供交易服务使用
         tradedate: string
         /// 当前交易日(行情) 在第一个市场待开市时变更为TradeDate,供行情及终端系统使用