فهرست منبع

Merge remote-tracking branch 'origin/master'

yu jie 4 سال پیش
والد
کامیت
247331724b

+ 2 - 5
src/common/methods/request/resultInfo.ts

@@ -28,7 +28,7 @@ export function commonResultInfo(fn: Promise<any>, sign: ResultInfo, loading: Re
         return Promise.resolve(sign[0])
     })
         .catch((err: string) => {
-            console.warn(`${fn}调用失败: err`);
+            console.warn(`${fn}调用失败: ${err}`);
             message.error(sign[1] + err)
             return Promise.reject(sign[1] + err)
         }).finally(() => {
@@ -67,7 +67,7 @@ export function controlResultInfo(fn: Promise<any>, msgInfo: [string, string] =
         message.success(sucInfo)
         return res;
     }).catch(err => {
-        console.warn(`${fn}调用失败: err`);
+        console.warn(`${fn}调用失败: ${err}`);
         const result = errInfo + err
         message.error(result)
         Promise.reject(result)
@@ -109,9 +109,6 @@ export function controlResultErrInfo(fn: Promise<any>) {
  * @returns
  */
 export function requestResultLoadingAndInfo(fn: Function, param: any, loading: Ref<boolean>, messageInfo: [string, string] = ['成功', '失败']) {
-    const cacheFn = () => controlResultInfo(controlLoading(fn, loading, param), messageInfo)
-    // 防抖
-    // return debounce(cacheFn, 2000)
     return controlResultInfo(controlLoading(fn, loading, param), messageInfo)
 }
 

+ 6 - 22
src/services/bus/account.ts

@@ -1,6 +1,8 @@
 import APP from '@/services';
 import { getLoginData } from '@/services/bus/login';
+import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
 import { LongType } from '@/services/socket/login/interface/index';
+import { Ref } from 'vue';
 import { AccountListItem } from '../dataCenter/interafce/account';
 
 export function getAllTaAccount(): AccountListItem[] {
@@ -68,6 +70,10 @@ export const getUserId = (): number => {
     }
 };
 
+
+export function getQuoteDayInfo(): Ref<QueryQuoteDayRsp[]> {
+    return APP.getRef('quoteDayInfo');
+}
 /**
  * 计算浮动盈亏
  */
@@ -82,28 +88,6 @@ function calcHolderSumDynProfit() {
     // }
 }
 
-/**
- *  计算商品市值计算
- */
-export function calcAmount() {
-    // 持仓列表(盘面)
-    const holds = APP.get('myGoodsHold');
-    // 挂牌
-    let totalNum = 0;
-    for (let i = 0; i < holds.length; i++) {
-        const itemHold = holds[i];
-        const { last, agreeunit, buycurpositionqty, decimalplace } = itemHold;
-        if (last) {
-            // 商品市值计算: 最新价*持仓数量*合约单位
-            const lastPrice = +last.toFixed(decimalplace);
-            totalNum += lastPrice * buycurpositionqty * agreeunit;
-        } else {
-            totalNum += buycurpositionqty;
-        }
-    }
-    totalNum = +totalNum.toFixed(2);
-    APP.set('marketValue', totalNum);
-}
 
 /**
  * 获取可用余额

+ 1 - 11
src/services/dataCenter/index.ts

@@ -1,5 +1,5 @@
 import { reactive, toRefs } from 'vue';
-import { LastUpdateTimeModel, LoginaccountModel, MarketrunModal, SelectedAccountModel, TradeDateModel, UserAccountModel, UserInfoModel } from './initDataModel/account';
+import { LoginaccountModel, MarketrunModal, SelectedAccountModel, UserAccountModel, UserInfoModel } from './initDataModel/account';
 import { NeedClearSourceDataType, NoClearSourceDataType } from './interface';
 
 /**
@@ -22,21 +22,11 @@ const needClearSourceData: NeedClearSourceDataType = {
     DeliveryGoodsList: [],
     marketRun: new MarketrunModal(), // 市场运行信息
 
-    queryClientFixedADConfigs: [],
     // checkTokenTimeDiff: Math.floor(Math.random() * 6 + 5) * 60 * 1000,
     checkTokenTimeDiff: 1 * 60 * 1000,
     accountList: [],
     selectedAccount: new SelectedAccountModel(),
-    areaRoleMarketList: [],
-    taAccountMarketList: [],
-    lastUpdateTime: new LastUpdateTimeModel(),
-    ssystemParam: [],
-    tradeDate: new TradeDateModel(),
-    myGoodsHold: [],
     quoteDayInfo: [],
-    marketValue: 0,
-    noticeInfo: [],
-    collctList: [],
 };
 
 /**

+ 1 - 31
src/services/dataCenter/initDataModel/account.ts

@@ -1,23 +1,7 @@
-import { AccountListItem, LastUpdateTime, TradeDate } from '@/services/dataCenter/interafce/account';
+import { AccountListItem } from '@/services/dataCenter/interafce/account';
 import { Marketrun } from '@/services/go/commonMarket/interface';
 import { Loginaccount, Useraccount, Userinfo } from '@/services/go/useInfo/interface';
 
-/**
- *  获取最后更新时间模型类
- */
-export class LastUpdateTimeModel implements LastUpdateTime {
-    dictionaryUTime = 0.0; // 枚举常量字典最后更新时间
-    errorcodeUTime = 0.0; // 错误码字典最后更新时间
-    marketsUTime = 0.0; // 市场更新时间
-    goodsUTime = 0.0; // 商品更新时间
-    configUTime = 0.0; // 终端配置参数更新时间
-    riskMsgUTime = 0.0; // 风险协议书更新时间
-    tradeDate = 0.0; // 交易日
-    menuUTime = 0.0; // 菜单更新时间
-    dvGoodsUTime = 0.0; // 交收商品更新时间
-    exUTime = 0.0; // 交易所更新时间
-    goodsGroupUTime = 0.0; // 商品组更新时间
-}
 
 /**
  * 用户信息模型类
@@ -76,20 +60,6 @@ export class UserInfoModel implements Userinfo {
     wskhinfo = '';
 }
 
-export class TradeDateModel implements TradeDate {
-    afternexttradedate = '';
-    clearquoteflag = '';
-    manualflag = '';
-    marketid = '';
-    nexttradedate = '';
-    pretradedate = '';
-    reckonflag = '';
-    runstatus = '';
-    tradedate = '';
-    tradedate2 = '';
-    updatetime = '';
-}
-
 export class LoginaccountModel implements Loginaccount {
     canoutin = 0;
     clientroleid = 0;

+ 0 - 33
src/services/dataCenter/interafce/account.ts

@@ -84,39 +84,6 @@ export interface AccountListItem {
     userid: number;//用户ID
 }
 
-/**
- * 最后更新时间模
- */
-export interface LastUpdateTime {
-    dictionaryUTime: number; // 枚举常量字典最后更新时间
-    errorcodeUTime: number; // 错误码字典最后更新时间
-    marketsUTime: number; // 市场更新时间
-    goodsUTime: number; // 商品更新时间
-    configUTime: number; // 终端配置参数更新时间
-    riskMsgUTime: number; // 风险协议书更新时间
-    tradeDate: number; // 交易日
-    menuUTime: number; // 菜单更新时间
-    dvGoodsUTime: number; // 交收商品更新时间
-    exUTime: number; // 交易所更新时间
-    goodsGroupUTime: number; // 商品组更新时间
-}
-/**
- * 交易日
- */
-export interface TradeDate {
-    afternexttradedate: string;
-    clearquoteflag: string;
-    manualflag: string;
-    marketid: string;
-    nexttradedate: string;
-    pretradedate: string;
-    reckonflag: string;
-    runstatus: string;
-    tradedate: string;
-    tradedate2: string;
-    updatetime: string;
-}
-
 export interface WPFINfO {
     account: string;
     name: string;

+ 0 - 9
src/services/dataCenter/interafce/error.ts

@@ -1,12 +1,3 @@
-/**
- * 系统参数
- */
-export interface SystemParam {
-    ParamCode: string;
-    ParamName: string;
-    ParamRemark: string;
-    ParamValue: string;
-}
 
 /**
  * 错误码

+ 3 - 17
src/services/dataCenter/interface.ts

@@ -1,13 +1,9 @@
 import { OperationTabMenu, TableDefineRsp } from '@/services/go/commonService/interface';
 import { ErmcpDeliveryGoodsDetailEx, Goods } from '@/services/go/ermcp/goodsInfo/interface';
+import * as advert from '@/services/go/quote/interface';
 import * as useInfo from '@/services/go/useInfo/interface';
-import * as mineType from '@/services/http/mine/interface';
-import * as Type from '@/services/http/notice/interface';
 import { Marketrun } from '../go/commonMarket/interface';
-import * as advert from '../http/advert/interface';
-import { QuoteDay } from '../http/quote/interface';
-import { AccountListItem, LastUpdateTime, TradeDate } from './interafce/account';
-import { SystemParam } from './interafce/error';
+import { AccountListItem } from './interafce/account';
 
 /**
  * 说明:登录分为游客和账号,所以退出登录的时候,
@@ -41,20 +37,10 @@ export interface NeedClearSourceDataType {
     DeliveryGoodsList: ErmcpDeliveryGoodsDetailEx[], // 现货品种
     marketRun: Marketrun, // 市场运行信息
 
-    queryClientFixedADConfigs: advert.fixedADConfigs[]; //首页图片广告
     checkTokenTimeDiff: number; // 轮休校验token时间差
     accountList: AccountListItem[]; // 资金账户列表
     selectedAccount: AccountListItem; // 当前选中的资金账号
-    areaRoleMarketList: any[]; // 机构角色市场权限
-    taAccountMarketList: any[]; // 资金账号市场权限
-    lastUpdateTime: LastUpdateTime; // 时间戳集合
-    ssystemParam: SystemParam[]; // 系统参数
-    tradeDate: TradeDate;
-    myGoodsHold: mineType.queryHsbyMyGoods[]; // 我的持仓数据
-    quoteDayInfo: QuoteDay[]; // 行情盘面信息
-    marketValue: number; // 商品市值
-    noticeInfo: Type.QueryNoticeRsp[]; // 通知公告信息
-    collctList: number[]; // 收藏商品列表
+    quoteDayInfo: advert.QueryQuoteDayRsp[]; // 行情盘面信息
 }
 
 export { advert };

+ 0 - 13
src/services/socket/account/enum.ts

@@ -1,13 +0,0 @@
-export enum LastUpdateTime_enum {
-    dictionaryUTime = 20, // 枚举常量字典最后更新时间
-    errorcodeUTime, // 错误码字典最后更新时间
-    marketsUTime, // 市场更新时间
-    goodsUTime, // 商品更新时间
-    configUTime, // 终端配置参数更新时间
-    riskMsgUTime, // 风险协议书更新时间
-    tradeDate, // 交易日
-    menuUTime, // 菜单更新时间
-    dvGoodsUTime, // 交收商品更新时间
-    exUTime, // 交易所更新时间
-    goodsGroupUTime, // 商品组更新时间
-}

+ 0 - 131
src/services/socket/account/index.ts

@@ -16,111 +16,6 @@ const getAccoutIdList = () => {
 };
 
 /**
- *  * 构建登录后数据查询请求包
- * @param QueryItem 不填返回全部结果集,填写后表示按需查询,多个以“,”隔开
- * 1-账号信息 2-资金账户列表 3- 交易规则和费用规则 4- 最大通知id 5- 更新时间戳
- */
-// export const queryAccountInfo = (QueryItem: string | number): Promise<string> => {
-//     return new Promise((resolve, reject) => {
-//         const LoginID = getLongTypeLoginID();
-//         const params = {
-//             protobufName: 'LoginQueryReq',
-//             funCodeName: 'LoginQueryReq',
-//             reqParams: { LoginID, QueryItem },
-//         };
-//         const package50 = buildProtoReq50(params);
-//         APP.sendTradingServer(package50, undefined, {
-//             onSuccess: (res) => {
-//                 const { isSuccess, result } = parseProtoRsp50(res, 'LoginQueryRsp');
-//                 if (isSuccess) {
-//                     const { AccountInfo, TAAccountList, ParamValues } = result;
-//                     // 数据中心存入用户信息
-//                     APP.set('userInfo', AccountInfo);
-//                     const accountList = TAAccountList.map((el: any) => {
-//                         return el.TaAccountInfo;
-//                     });
-//                     // 数据中心存入资金账号列表
-//                     APP.set('accountList', accountList);
-//                     // 时间戳集合
-//                     const lastUpdateTime: any = new LastUpdateTimeModel();
-//                     ParamValues.forEach((el: any) => {
-//                         const { Key, Value } = el;
-//                         if (Key) {
-//                             const name = LastUpdateTime_enum[Key];
-//                             lastUpdateTime[name] = Number(Value);
-//                         }
-//                     });
-//                     APP.set('lastUpdateTime', lastUpdateTime);
-//                     // 注意:商品交易规则和费用规则列表 暂未做处理,需要处理在此处理, 具体查看 proto LoginQueryRsp
-//                     resolve('ok');
-//                 } else {
-//                     reject(result);
-//                 }
-//             },
-//             onFail: (err) => {
-//                 reject(err.message);
-//             },
-//         } as Callback);
-//     });
-// };
-
-/**
- * 查询机构角色市场权限
- */
-export const queryAreaRoleMarket = (): Promise<string> => {
-    return new Promise((resolve, reject) => {
-        const params = {
-            statement: 'Client_QueryTAAccountMarket',
-            params: {
-                areaUserId: String(APP.get('userInfo').MemberUserid), // 机构用户ID
-                roleType: '7', // 角色类型 -  6:自营会员 7:纪经会员
-            },
-        };
-        const package50 = buildProtoReq50(params);
-        APP.sendTradingServer(package50, undefined, {
-            onSuccess: (res) => {
-                const { isSuccess, result } = parseProtoRsp50(res);
-                if (isSuccess) {
-                    APP.set('areaRoleMarketList', result);
-                    resolve('ok');
-                } else {
-                    reject(result);
-                }
-            },
-            onFail: (err) => {
-                reject(err.message);
-            },
-        } as Callback);
-    });
-};
-
-/**
- * 查询非投资者查资金市场权限
- */
-export const queryTaAccountMarket = (): Promise<string> => {
-    return new Promise((resolve, reject) => {
-        const params = {
-            statement: 'Client_QueryTAAccountMarket',
-            params: { taAccountIdList: getAccoutIdList() },
-        };
-        const package50 = buildProtoReq50(params);
-        APP.sendTradingServer(package50, undefined, {
-            onSuccess: (res) => {
-                const { isSuccess, result } = parseProtoRsp50(res);
-                if (isSuccess) {
-                    APP.set('taAccountMarketList', result);
-                    resolve('ok');
-                } else {
-                    reject(result);
-                }
-            },
-            onFail: (err) => {
-                reject(err.message);
-            },
-        } as Callback);
-    });
-};
-/**
  * 查询全部账户交易费用与规则信息的方法
  */
 export const queryAccountTradeRuleAndFeeAndMargin = (): Promise<any> => {
@@ -145,32 +40,6 @@ export const queryAccountTradeRuleAndFeeAndMargin = (): Promise<any> => {
         } as Callback);
     });
 };
-/**
- * 查询交易日
- */
-export const queryTradeDate = (): Promise<string> => {
-    return new Promise((resolve, reject) => {
-        const params = {
-            statement: 'ClientSearchMarketRun',
-            params: { marketId: '0' },
-        };
-        const package50 = buildProtoReq50(params);
-        APP.sendTradingServer(package50, undefined, {
-            onSuccess: (res) => {
-                const { isSuccess, result } = parseProtoRsp50(res);
-                if (isSuccess) {
-                    APP.set('tradeDate', result[0]);
-                    resolve('ok');
-                } else {
-                    reject(result);
-                }
-            },
-            onFail: (err) => {
-                reject(err.message);
-            },
-        } as Callback);
-    });
-};
 
 /**
  * 修改密码

+ 0 - 54
src/services/socket/error/index.ts

@@ -1,54 +0,0 @@
-import APP from '@/services';
-import { buildProtoReq50, parseProtoRsp50 } from '@/services/socket/protobuf/buildReq';
-import { Callback } from '@/utils/websocket/index';
-
-/**
- * 查询系统参数
- */
-export function querySystemParam(): Promise<string> {
-    return new Promise((resolve, reject) => {
-        const params = {
-            protobufName: 'ConfigQueryReq',
-            funCodeName: 'ConfigQueryReq',
-            reqParams: { configUTime: APP.get('lastUpdateTime').configUTime },
-        };
-        const package50 = buildProtoReq50(params);
-        APP.sendTradingServer(package50, undefined, {
-            onSuccess: (res) => {
-                const { isSuccess, result } = parseProtoRsp50(res, 'ConfigQueryRsp');
-                if (isSuccess) {
-                    APP.set('ssystemParam', result.ConfigInfoList);
-                    resolve('ok');
-                } else {
-                    reject(result);
-                }
-            },
-            onFail: (err) => reject(err.message),
-        } as Callback);
-    });
-}
-/**
- * funcode查找错误码
- */
-export function queryErrorCode(): Promise<string> {
-    return new Promise((resolve, reject) => {
-        const params = {
-            protobufName: 'ErrorCodeQueryReq',
-            funCodeName: 'ErrorCodeQueryReq',
-            reqParams: { errorcodeUTime: APP.get('lastUpdateTime').errorcodeUTime },
-        };
-        const package50 = buildProtoReq50(params);
-        APP.sendTradingServer(package50, undefined, {
-            onSuccess: (res) => {
-                const { isSuccess, result } = parseProtoRsp50(res, 'ErrorCodeQueryRsp');
-                if (isSuccess) {
-                    // APP.set('errorCodeList', result.ErrorCodeList);
-                    resolve('ok');
-                } else {
-                    reject(result);
-                }
-            },
-            onFail: (err) => reject(err.message),
-        } as Callback);
-    });
-}

+ 4 - 4
src/views/market/spot_trade/components/buy-sell-market/index.vue

@@ -22,21 +22,21 @@
       <div class="green">
         <div class="numBlock">
           <div class="first">卖基差</div>
-          <div class="last">125.00</div>
+          <div class="last">{{selectedRow.sellpricemove}}</div>
         </div>
         <div class="numBlock">
           <div class="first">卖量</div>
-          <div class="last">10000</div>
+          <div class="last">{{selectedRow.sellqty}}</div>
         </div>
       </div>
       <div class="red ml35">
         <div class="numBlock">
           <div class="first">买基差</div>
-          <div class="last">120.00</div>
+          <div class="last">{{selectedRow.buypricemove}}</div>
         </div>
         <div class="numBlock">
           <div class="first">买量</div>
-          <div class="last">10000</div>
+          <div class="last">{{selectedRow.buyqty}}</div>
         </div>
       </div>
       <div class="market">