li.shaoyi 2 anos atrás
pai
commit
feae064e90

+ 16 - 82
oem/tjmd/config/router.json

@@ -199,65 +199,25 @@
                     {
                         "authType": 1,
                         "sort": 1,
-                        "title": "商品合约",
-                        "code": "query_order_goods",
-                        "url": "goods",
+                        "title": "掉期市场",
+                        "code": "query_order_swap",
+                        "url": "swap",
                         "urlType": 1,
-                        "component": "views/query/order/goods/index.vue",
+                        "component": "views/query/order/swap/index.vue",
                         "children": [
                             {
                                 "authType": 2,
                                 "sort": 1,
                                 "title": "当前记录",
-                                "code": "query_order_goods_list",
-                                "component": "views/query/order/goods/list/index.vue"
+                                "code": "query_order_swap_list",
+                                "component": "views/query/order/swap/list/index.vue"
                             },
                             {
                                 "authType": 2,
                                 "sort": 2,
                                 "title": "历史记录",
-                                "code": "query_order_goods_history",
-                                "component": "views/query/order/goods/history/index.vue"
-                            }
-                        ]
-                    },
-                    {
-                        "authType": 1,
-                        "sort": 3,
-                        "title": "预售转让",
-                        "code": "query_order_presell",
-                        "url": "spot",
-                        "urlType": 1,
-                        "component": "views/query/order/presell/index.vue",
-                        "hidden": true,
-                        "children": [
-                            {
-                                "authType": 2,
-                                "sort": 1,
-                                "title": "当前认购",
-                                "code": "query_order_presell__list",
-                                "component": "views/query/order/presell/list/index.vue"
-                            },
-                            {
-                                "authType": 2,
-                                "sort": 2,
-                                "title": "历史认购",
-                                "code": "query_order_presell_history",
-                                "component": "views/query/order/presell/history/index.vue"
-                            },
-                            {
-                                "authType": 2,
-                                "sort": 3,
-                                "title": "当前转让",
-                                "code": "query_order_presell_transferlist",
-                                "component": "views/query/order/presell/transferlist/index.vue"
-                            },
-                            {
-                                "authType": 2,
-                                "sort": 4,
-                                "title": "历史转让",
-                                "code": "query_order_presell_transferhistory",
-                                "component": "views/query/order/presell/transferhistory/index.vue"
+                                "code": "query_order_swap_history",
+                                "component": "views/query/order/swap/history/index.vue"
                             }
                         ]
                     },
@@ -300,57 +260,31 @@
                     {
                         "authType": 1,
                         "sort": 1,
-                        "title": "商品合约",
-                        "code": "query_trade_goods",
-                        "url": "goods",
+                        "title": "掉期市场",
+                        "code": "query_trade_swap",
+                        "url": "swap",
                         "urlType": 1,
-                        "component": "views/query/trade/goods/index.vue",
+                        "component": "views/query/trade/swap/index.vue",
                         "children": [
                             {
                                 "authType": 2,
                                 "sort": 1,
                                 "title": "当前记录",
-                                "code": "query_trade_goods_list",
-                                "component": "views/query/trade/goods/list/index.vue"
+                                "code": "query_trade_swap_list",
+                                "component": "views/query/trade/swap/list/index.vue"
                             },
                             {
                                 "authType": 2,
                                 "sort": 2,
                                 "title": "历史记录",
-                                "code": "query_trade_goods_history",
-                                "component": "views/query/trade/goods/history/index.vue"
+                                "code": "query_trade_swap_history",
+                                "component": "views/query/trade/swap/history/index.vue"
                             }
                         ]
                     },
                     {
                         "authType": 1,
                         "sort": 2,
-                        "title": "预售转让",
-                        "code": "query_trade_presell",
-                        "url": "spot",
-                        "urlType": 1,
-                        "component": "views/query/trade/presell/index.vue",
-                        "hidden": true,
-                        "children": [
-                            {
-                                "authType": 2,
-                                "sort": 1,
-                                "title": "当前记录",
-                                "code": "query_trade_presell_list",
-                                "component": "views/query/trade/presell/list/index.vue"
-                            },
-                            {
-                                "authType": 2,
-                                "sort": 2,
-                                "title": "历史记录",
-                                "code": "query_trade_presell_history",
-                                "component": "views/query/trade/presell/history/index.vue"
-                            }
-                        ]
-                    },
-                    {
-                        "authType": 1,
-                        "sort": 3,
                         "title": "现货仓单",
                         "code": "query_trade_spot",
                         "url": "spot",

+ 28 - 22
src/hooks/hqchart/timeline/dataset.ts

@@ -87,34 +87,40 @@ export function useDataset(goodsCode: string) {
                 if (historyDatas.length) {
                     const [lastItem] = historyDatas.slice(-1)
                     callback({
-                        stock: [
-                            {
-                                symbol: state.symbol,
-                                yclose: preSettle,
-                                date: Number(moment(lastItem.ts).format('YYYYMMDD')),
-                                time: Number(moment(lastItem.ts).format('HHmm')),
-                                minute: historyDatas.map((e) => ({
-                                    price: e.c,
-                                    open: e.o || null,
-                                    high: e.h || null,
-                                    low: e.l || null,
-                                    vol: e.tv,
-                                    amount: e.tt || null,
-                                    date: Number(moment(e.ts).format('YYYYMMDD')),
-                                    time: Number(moment(e.ts).format('HHmm')),
-                                }))
-                            }
-                        ]
+                        stock: [{
+                            symbol: state.symbol,
+                            yclose: preSettle,
+                            date: Number(moment(lastItem.ts).format('YYYYMMDD')),
+                            time: Number(moment(lastItem.ts).format('HHmm')),
+                            minute: historyDatas.map((e) => ({
+                                price: e.c,
+                                open: e.o || null,
+                                high: e.h || null,
+                                low: e.l || null,
+                                vol: e.tv,
+                                amount: e.tt || null,
+                                date: Number(moment(e.ts).format('YYYYMMDD')),
+                                time: Number(moment(e.ts).format('HHmm')),
+                            }))
+                        }]
                     })
                 } else {
-                    data.Self.EnableSplashScreen({
-                        Title: '暂无数据',
-                        Draw: true,
+                    callback({
+                        stock: [{
+                            symbol: state.symbol,
+                            yclose: preSettle,
+                            date: Number(moment(new Date()).format('YYYYMMDD')),
+                            time: Number(moment(new Date()).format('HHmm')),
+                            minute: []
+                        }]
                     })
                 }
             })
         } else {
-            callback({ stock: [] })
+            data.Self.EnableSplashScreen({
+                Title: '暂无数据',
+                Draw: true,
+            })
         }
     }
 

+ 1 - 1
src/packages/mobile/views/goods/detail/components/listing/Index.vue

@@ -28,7 +28,7 @@
                             </div>
                         </template>
                     </Field>
-                    <template v-if="formData.BuyOrSell === BuyOrSell.Buy || quote?.tradeproperty !== 2">
+                    <template v-if="buyOrSell === BuyOrSell.Buy || quote?.tradeproperty !== 2">
                         <Field label="预估可订立量">
                             <template #input>
                                 <span>{{ total.enableQty }}</span>

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

@@ -45,6 +45,10 @@
       <div class="statusbar-right">
         <ul>
           <li>
+            <span>风险率:</span>
+            <span>{{ parsePercent(accountStore.currentAccount.hazardRatio) }}</span>
+          </li>
+          <li>
             <span>用户ID:</span>
             <span>{{ loginStore.userId }}</span>
           </li>
@@ -53,10 +57,6 @@
             <span>{{ loginStore.loginId }}</span>
           </li>
           <li>
-            <span>风险率:</span>
-            <span>{{ parsePercent(accountStore.currentAccount.hazardRatio) }}</span>
-          </li>
-          <li>
             <!-- <span>{{ serverTime?.format('MM/DD') }}</span> -->
             <span>{{ serverTime?.format('HH:mm:ss') }}</span>
           </li>

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

@@ -59,11 +59,11 @@
                 </li>
                 <li v-if="globalStore.hasQuotationProperty('holdvolume')">
                     <span>持仓量</span>
-                    <span>{{ handleNumberValue(quote.holdvolume) }}</span>
+                    <span>{{ changeUnit(quote.holdvolume) }}</span>
                 </li>
                 <li v-if="globalStore.hasQuotationProperty('totalvolume') && quote.marketid != 99201">
                     <span>成交量</span>
-                    <span>{{ handleNumberValue(quote.totalvolume) }}</span>
+                    <span>{{ changeUnit(quote.totalvolume) }}</span>
                 </li>
             </ul>
         </div>

+ 3 - 2
src/packages/pc/views/account/sign/components/sign/index.vue

@@ -39,7 +39,8 @@
                 <template v-else-if="(item.fieldcode === 'bank_branch_name')">
                     <el-form-item :label="item.fieldname" :prop="item.fieldcode" v-if="showExtendInfo(item)">
                         <el-select placeholder="请输入" v-model="item.value" value-key="branchnum" :loading="searchLoading"
-                            :remote-method="remoteMethod" filterable remote clearable allow-create @change="onBankChange">
+                            :remote-method="remoteMethod" filterable remote clearable allow-create @change="onBankChange"
+                            @clear="dataList = []">
                             <template v-for="(item, index) in dataList" :key="index">
                                 <el-option :label="item.branchname" :value="item" />
                             </template>
@@ -249,7 +250,7 @@ const formSubmit = () => {
                             obj['smsSerialNo'] = CenterErrMsg.value
                         }
                         formData.extendInfo = JSON.stringify(obj)
-                        
+
                         onSubmit().then(() => {
                             ElMessage.success(bankInfo.value?.signstatus != undefined ? '签约信息修改成功' : '签约提交成功,请耐心等待审核。')
                             onCancel(true)

+ 26 - 0
src/packages/pc/views/market/trade/goods/index.vue

@@ -4,9 +4,35 @@
 </template>
 
 <script lang="ts" setup>
+// import { computed } from 'vue'
+// import { useUserStore } from '@/stores'
 import AppAuthComponent from '@pc/components/modules/auth-component/index.vue'
 
 defineProps({
     code: String
 })
+
+//const userStore = useUserStore()
+
+// 用户市场权限
+// const userMarket = computed(() => userStore.userData.markets.reduce<string[]>((pre, cur) => {
+//     switch (cur.marketid) {
+//         case 50101:
+//             pre.push('market_trade_goods_50101')
+//             break
+//         case 50102:
+//             pre.push('market_trade_goods_50102')
+//             break
+//         case 50103:
+//             pre.push('market_trade_goods_50103')
+//             break
+//         case 50104:
+//             pre.push('market_trade_goods_50104')
+//             break
+//         case 16201:
+//             pre.push('market_trade_goods_16201')
+//             break
+//     }
+//     return pre
+// }, []))
 </script>

+ 58 - 0
src/packages/pc/views/market/trade/index.vue

@@ -0,0 +1,58 @@
+<!-- 根据市场板块动态配置(未完成) -->
+<template>
+    <app-tabs class="app-tabs--primary" :data-list="dataList" prop-label="marketsectionname" @change="onTabChange">
+        <app-tabs class="app-tabs--primary" :data-list="marketList" v-model:data-index="marketIndex" direction="bottom"
+            prop-label="marketname" @change="onMarketChange">
+            <component ref="componentRef" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
+        </app-tabs>
+    </app-tabs>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, defineAsyncComponent } from 'vue'
+import { useComponent } from '@/hooks/component'
+import { useRequest } from '@/hooks/request'
+import { queryTjmdMarketSection } from '@/services/api/swap'
+import AppTabs from '@/components/base/tabs/index.vue'
+
+const componentMap = new Map<string, unknown>([
+    ['order', defineAsyncComponent(() => import('./goods/list/index.vue'))], // 订单挂牌
+    ['99201', defineAsyncComponent(() => import('./market/index.vue'))], // 参考行情
+])
+
+const { componentRef, componentId, openComponent, closeComponent } = useComponent()
+const marketList = shallowRef<Model.TjmdMarketSectionRsp['mlist']>([])
+const marketIndex = shallowRef(-1)
+
+const { dataList } = useRequest(queryTjmdMarketSection, {
+    onSuccess: (res) => {
+        const [firstTab] = res.data
+        const [firstMarket] = firstTab?.mlist ?? []
+        if (firstMarket) {
+            onTabChange(0)
+        }
+    }
+})
+
+const onTabChange = (index: number) => {
+    const item = dataList.value[index]
+    marketList.value = item.mlist
+    componentId.value = undefined
+
+    if (marketList.value.length) {
+        marketIndex.value = 0
+        onMarketChange(0)
+    }
+}
+
+const onMarketChange = (index: number) => {
+    const item = marketList.value[index]
+    if (item) {
+        if ([50101, 50102, 50103, 50104, 16201].includes(item.marketid)) {
+            openComponent('order')
+        } else {
+            openComponent(item.marketid.toString())
+        }
+    }
+}
+</script>