huangbin 4 yıl önce
ebeveyn
işleme
bccf39b368

+ 132 - 131
src/common/methods/table/interface.ts

@@ -1,132 +1,133 @@
 
-	interface CustomRender {
-		customRender: string;
-	}
-	// 动态表头类型
-	export interface ColumnType {
-		key: string;
-		dataIndex: string;
-		title: string;
-		width?: number;
-		align: string; //  AlignType 对齐方式 - 1:居中对齐 2:左对齐 3:右对齐
-		filteredValue?: string | null;
-		slots?: CustomRender;
-		onFilter?: Function;
-		sorter?: Function;
-		render?: Function;
-		customRender?: Function;
-	}
-	export interface TableKey {table_pcweb_delivery:string, // 现货合同
-table_pcweb_userinfo:string, // 客户资料
-table_pcweb_warehouse:string, // 仓库信息
-table_pcweb_purchase_pointprice:string, // 采购_待点价
-table_pcweb_purchase_settle:string, // 采购_履约交收
-table_pcweb_purchase_all:string, // 采购_全部
-table_pcweb_sales_pointprice:string, // 销售_待点价
-table_pcweb_sales_settle:string, // 销售_履约交收
-table_pcweb_sales_all:string, // 销售_全部
-table_pcweb_exposure:string, // 实时敞口
-table_pcweb_exposure_spotposition:string, // 敞口--现货头寸
-table_pcweb_exposure_spotposition_detail:string, // 敞口--现货头寸--现货明细
-table_pcweb_exposure_futuresposition:string, // 敞口--期货头寸
-table_pcweb_exposure_futuresposition_detail:string, // 敞口--现货头寸--期货明细
-table_pcweb_report_spot_detail_day:string, // 现货日报表-详情
-table_pcweb_exposure_detail:string, // 实时敞口--现货明细
-table_pcweb_exposure_futures_detail:string, // 实时敞口--期货明细
-table_pcweb_report_spot_detail_month:string, // 现货月报表-详情
-table_pcweb_report_fincial_payment_day:string, // 报表-财务报表-款项-日报表
-table_pcweb_report_fincial_invoice_day:string, // 报表-财务报表-发票-日报表
-table_pcweb_report_fincial_month:string, // 报表-财务报表-月报表
-table_pcweb_business_aduit_dj:string, // 业务审核-点价
-table_pcweb_business_aduit_js:string, // 业务审核-交收
-table_pcweb_fincial_aduit_fp:string, // 业务审核-发票
-table_pcweb_fincial_aduit_kx:string, // 财务审核-款项
-table_pcweb_stock_aduit_in:string, // 库存审核-入库
-table_pcweb_stock_aduit_out:string, // 库存审核-出库
-table_pcweb_manager_warehouse_manager:string, // 库存管理-库存管理
-table_pcweb_manager_warehouse_manager_in:string, // 库存管理-入库明细
-table_pcweb_manager_warehouse_manager_out:string, // 库存管理-出库明细
-table_pcweb_stock_manage_current:string, // 库存管理-当前库存
-table_pcweb_stock_manage_applylog:string, // 库存管理-当前库存
-table_pcweb_hedging_plan:string, // 业务-套保计划
-table_pcweb_current_inventory:string, // 库存查询-当前库存
-table_pcweb_application_record:string, // 库存查询-申请记录
-table_pcweb_someprice_detail_dj:string, // 现货合同详情-点价记录
-table_pcweb_someprice_detail_js:string, // 现货合同详情-交收记录
-table_pcweb_someprice_detail_kx:string, // 现货合同详情-款项记录
-table_pcweb_someprice_detail_fp:string, // 现货合同详情-发票记录
-table_pcweb_someprice_detail_stock:string, // 现货合同详情-入库记录
-table_pcweb_someprice_detail_stock_out:string, // 现货合同详情-出库记录
-table_pcweb_someprice_detail_change:string, // 现货合同详情-变更记录
-table_pcweb_exposure_report:string, // 报表-敞口报表
-table_pcweb_futures_report:string, // 报表-期货报表
-table_pcweb_spot_report:string, // 报表-现货报表
-table_pcweb_finance_report:string, // 报表-财务报表
-table_pcweb_warehouse_category_report:string, // 报表-库存报表
-table_pcweb_warehouse_report:string, // 报表-库存报表
-table_pcweb_aggregate_profit_and_loss:string, // 报表-汇总损益报表
-table_pcweb_change_in_spot_contract:string, // 报表-敞口报表-现货合同变动量明细
-table_pcweb_change_in_hedging_plan:string, // 报表-敞口报表-套保计划变动量明细
-table_pcweb_change_in_future:string, // 报表-敞口报表-期货变动量明细
-table_pcweb_change_in_parameter_adjustment:string, // 报表-敞口报表-参数调整变动量明细
-table_pcweb_spot_report_details:string, // 报表-现货报表-现货明细
-table_pcweb_financial_statement_category_breakdown:string, // 报表-财务报表-品类明细
-table_pcweb_financial_statement_brand_details:string, // 报表-财务报表-品类明细
-table_pcweb_futures_statement_account_details:string, // 报表-期货报表-账户明细
-table_pcweb_inventory_commodity_report_brand_details:string, // 报表-库存(商品)报表-品牌明细
-table_pcweb_inventory_commodity_report_warehouse_details:string, // 报表-库存(商品)报表-仓库明细
-table_pcweb_inventory_warehouse_report_warehouse_details:string, // 报表-库存(仓库)报表-仓库明细
-table_pcweb_inventory_summary_profit_and_loss_details:string, // 报表-汇总损益报表-损益明细
-table_pcweb_qhj_recharge_review:string, // 铂金宝-充值提现审核-充值审核
-table_pcweb_qhj_withdrawal_review:string, // 铂金宝-充值提现审核-提现审核
-table_pcweb_qhj_pickup_query:string, // 铂金宝-提货查询
-table_pcweb_qhj_fixed_investment_price_query:string, // 铂金宝-定投价查询
-table_pcweb_qhj_fixed_investment_plan_query:string, // 铂金宝-定投查询-定投计划查询
-table_pcweb_qhj_fixed_investment_flow_query:string, // 铂金宝-定投查询-定投流水查询
-table_pcweb_qhj_fixed_financing_information:string, // 铂金宝-融资信息
-table_pcweb_qhj_customer_info:string, // 铂金宝-客户资料
-table_pcweb_qhj_holder_order:string, // 铂金宝-单据查询-持仓单
-table_pcweb_qhj_order:string, // 铂金宝-单据查询-委托单
-table_pcweb_qhj_pay_bill:string, // 铂金宝-单据查询-待付单
-table_pcweb_qhj_deal_order:string, // 铂金宝-单据查询-成交单
-table_pcweb_spot_and_price:string, // 铂金宝-现货市价
-table_pcweb_agreement:string, // 铂金宝-协议管理
-table_pcweb_spot_trade_warehouse_price:string, // 现货贸易-仓单贸易-一口价
-table_pcweb_spot_trade_warehouse_float:string, // 现货贸易-仓单贸易
-table_pcweb_spot_trade_warehouse_sale_price:string, // 现货贸易-仓单预售
-table_pcweb_spot_trade_warehouse_sale_float:string, // 现货贸易-仓单预售
-table_pcweb_spot_trade_warehouse_price_trading_hall_sale:string, // 现货贸易-仓单贸易-买卖大厅
-table_pcweb_spot_trade_warehouse_price_trading_hall_buy:string, // 现货贸易-仓单贸易-买卖大厅
-table_pcweb_spot_trade_warehouse_float_trading_hall_sale:string, // 现货贸易-仓单贸易-买卖大厅
-table_pcweb_spot_trade_warehouse_float_trading_hall_buy:string, // 现货贸易-仓单贸易-买卖大厅
-table_pcweb_spot_trade_warehouse_presale_price_trading_hall_sale:string, // 现货贸易-仓单预售-买卖大厅
-table_pcweb_spot_trade_warehouse_presale_price_trading_hall_buy:string, // 现货贸易-仓单预售-买卖大厅
-table_pcweb_spot_trade_warehouse_presale_float_trading_hall_sale:string, // 现货贸易-仓单预售-买卖大厅
-table_pcweb_spot_trade_warehouse_presale_float_trading_hall_buy:string, // 现货贸易-仓单预售-买卖大厅
-table_pcweb_spot_trade_bottom_spot_warrant_spot_summary:string, // 底部栏-现货仓单
-table_pcweb_spot_trade_bottom_spot_warrant_inventory_summary:string, // 底部栏-现货仓单
-table_pcweb_spot_trade_bottom_spot_warrant_spot_detail:string, // 底部栏-现货仓单
-table_pcweb_spot_trade_bottom_spot_warrant_pending_order:string, // 底部栏-现货仓单
-table_pcweb_spot_trade_bottom_spot_warrant_deal:string, // 底部栏-现货仓单
-table_pcweb_spot_trade_bottom_spot_warrant_designated_deal:string, // 底部栏-现货仓单
-table_pcweb_spot_trade_bottom_spot_warrant_pick_up:string, // 底部栏-现货仓单
-table_pcweb_spot_trade_bottom_pre_sale_order_summary:string, // 底部栏-预售仓单
-table_pcweb_spot_trade_bottom_pre_sale_pending_order:string, // 底部栏-预售仓单
-table_pcweb_spot_trade_bottom_pre_sale_make_deal:string, // 底部栏-预售仓单
-table_pcweb_spot_trade_bottom_commodity_contract_summary:string, // 底部栏-商品合约
-table_pcweb_spot_trade_bottom_commodity_contract_commission:string, // 底部栏-商品合约
-table_pcweb_spot_trade_bottom_commodity_contract_make_deal:string, // 底部栏-商品合约
-table_pcweb_spot_trade_bottom_commodity_contract_settlement:string, // 底部栏-商品合约
-table_pcweb_spot_trade_bottom_performance_info_buy:string, // 底部栏-履约信息
-table_pcweb_spot_trade_bottom_performance_info_sale:string, // 底部栏-履约信息
-table_pcweb_spot_trade_bottom_funding_info_summary:string, // 底部栏-资金信息
-table_pcweb_spot_trade_bottom_funding_info_log:string, // 底部栏-资金信息
-table_pcweb_financing_manage_bottom_apply_order:string, // 底部栏-融资管理
-table_pcweb_financing_manage_bottom_contract:string, // 底部栏-融资管理
-table_pcweb_financing_manage_bottom_commodity_order_summary:string, // 底部栏-商品订单
-table_pcweb_financing_manage_bottom_commodity_order_entrust:string, // 底部栏-商品订单
-table_pcweb_financing_manage_bottom_commodity_order_deal:string, // 底部栏-商品订单
-table_pcweb_financing_manage_bottom_commodity_order_settlement:string, // 底部栏-商品订单
-table_pcweb_financing_manage_order_transaction:string, // 现货贸易-订单交易
-table_pcweb_financing_manage_reference_market:string, // 现货贸易-参考行情 
- }
+interface CustomRender {
+	customRender: string;
+}
+// 动态表头类型
+export interface ColumnType {
+	key: string;
+	dataIndex?: string;
+	title: string;
+	width?: number;
+	align?: string; //  AlignType 对齐方式 - 1:居中对齐 2:左对齐 3:右对齐
+	filteredValue?: string | null;
+	slots?: CustomRender;
+	onFilter?: Function;
+	sorter?: Function;
+	render?: Function;
+	customRender?: Function;
+}
+export interface TableKey {
+	table_pcweb_delivery: string, // 现货合同
+	table_pcweb_userinfo: string, // 客户资料
+	table_pcweb_warehouse: string, // 仓库信息
+	table_pcweb_purchase_pointprice: string, // 采购_待点价
+	table_pcweb_purchase_settle: string, // 采购_履约交收
+	table_pcweb_purchase_all: string, // 采购_全部
+	table_pcweb_sales_pointprice: string, // 销售_待点价
+	table_pcweb_sales_settle: string, // 销售_履约交收
+	table_pcweb_sales_all: string, // 销售_全部
+	table_pcweb_exposure: string, // 实时敞口
+	table_pcweb_exposure_spotposition: string, // 敞口--现货头寸
+	table_pcweb_exposure_spotposition_detail: string, // 敞口--现货头寸--现货明细
+	table_pcweb_exposure_futuresposition: string, // 敞口--期货头寸
+	table_pcweb_exposure_futuresposition_detail: string, // 敞口--现货头寸--期货明细
+	table_pcweb_report_spot_detail_day: string, // 现货日报表-详情
+	table_pcweb_exposure_detail: string, // 实时敞口--现货明细
+	table_pcweb_exposure_futures_detail: string, // 实时敞口--期货明细
+	table_pcweb_report_spot_detail_month: string, // 现货月报表-详情
+	table_pcweb_report_fincial_payment_day: string, // 报表-财务报表-款项-日报表
+	table_pcweb_report_fincial_invoice_day: string, // 报表-财务报表-发票-日报表
+	table_pcweb_report_fincial_month: string, // 报表-财务报表-月报表
+	table_pcweb_business_aduit_dj: string, // 业务审核-点价
+	table_pcweb_business_aduit_js: string, // 业务审核-交收
+	table_pcweb_fincial_aduit_fp: string, // 业务审核-发票
+	table_pcweb_fincial_aduit_kx: string, // 财务审核-款项
+	table_pcweb_stock_aduit_in: string, // 库存审核-入库
+	table_pcweb_stock_aduit_out: string, // 库存审核-出库
+	table_pcweb_manager_warehouse_manager: string, // 库存管理-库存管理
+	table_pcweb_manager_warehouse_manager_in: string, // 库存管理-入库明细
+	table_pcweb_manager_warehouse_manager_out: string, // 库存管理-出库明细
+	table_pcweb_stock_manage_current: string, // 库存管理-当前库存
+	table_pcweb_stock_manage_applylog: string, // 库存管理-当前库存
+	table_pcweb_hedging_plan: string, // 业务-套保计划
+	table_pcweb_current_inventory: string, // 库存查询-当前库存
+	table_pcweb_application_record: string, // 库存查询-申请记录
+	table_pcweb_someprice_detail_dj: string, // 现货合同详情-点价记录
+	table_pcweb_someprice_detail_js: string, // 现货合同详情-交收记录
+	table_pcweb_someprice_detail_kx: string, // 现货合同详情-款项记录
+	table_pcweb_someprice_detail_fp: string, // 现货合同详情-发票记录
+	table_pcweb_someprice_detail_stock: string, // 现货合同详情-入库记录
+	table_pcweb_someprice_detail_stock_out: string, // 现货合同详情-出库记录
+	table_pcweb_someprice_detail_change: string, // 现货合同详情-变更记录
+	table_pcweb_exposure_report: string, // 报表-敞口报表
+	table_pcweb_futures_report: string, // 报表-期货报表
+	table_pcweb_spot_report: string, // 报表-现货报表
+	table_pcweb_finance_report: string, // 报表-财务报表
+	table_pcweb_warehouse_category_report: string, // 报表-库存报表
+	table_pcweb_warehouse_report: string, // 报表-库存报表
+	table_pcweb_aggregate_profit_and_loss: string, // 报表-汇总损益报表
+	table_pcweb_change_in_spot_contract: string, // 报表-敞口报表-现货合同变动量明细
+	table_pcweb_change_in_hedging_plan: string, // 报表-敞口报表-套保计划变动量明细
+	table_pcweb_change_in_future: string, // 报表-敞口报表-期货变动量明细
+	table_pcweb_change_in_parameter_adjustment: string, // 报表-敞口报表-参数调整变动量明细
+	table_pcweb_spot_report_details: string, // 报表-现货报表-现货明细
+	table_pcweb_financial_statement_category_breakdown: string, // 报表-财务报表-品类明细
+	table_pcweb_financial_statement_brand_details: string, // 报表-财务报表-品类明细
+	table_pcweb_futures_statement_account_details: string, // 报表-期货报表-账户明细
+	table_pcweb_inventory_commodity_report_brand_details: string, // 报表-库存(商品)报表-品牌明细
+	table_pcweb_inventory_commodity_report_warehouse_details: string, // 报表-库存(商品)报表-仓库明细
+	table_pcweb_inventory_warehouse_report_warehouse_details: string, // 报表-库存(仓库)报表-仓库明细
+	table_pcweb_inventory_summary_profit_and_loss_details: string, // 报表-汇总损益报表-损益明细
+	table_pcweb_qhj_recharge_review: string, // 铂金宝-充值提现审核-充值审核
+	table_pcweb_qhj_withdrawal_review: string, // 铂金宝-充值提现审核-提现审核
+	table_pcweb_qhj_pickup_query: string, // 铂金宝-提货查询
+	table_pcweb_qhj_fixed_investment_price_query: string, // 铂金宝-定投价查询
+	table_pcweb_qhj_fixed_investment_plan_query: string, // 铂金宝-定投查询-定投计划查询
+	table_pcweb_qhj_fixed_investment_flow_query: string, // 铂金宝-定投查询-定投流水查询
+	table_pcweb_qhj_fixed_financing_information: string, // 铂金宝-融资信息
+	table_pcweb_qhj_customer_info: string, // 铂金宝-客户资料
+	table_pcweb_qhj_holder_order: string, // 铂金宝-单据查询-持仓单
+	table_pcweb_qhj_order: string, // 铂金宝-单据查询-委托单
+	table_pcweb_qhj_pay_bill: string, // 铂金宝-单据查询-待付单
+	table_pcweb_qhj_deal_order: string, // 铂金宝-单据查询-成交单
+	table_pcweb_spot_and_price: string, // 铂金宝-现货市价
+	table_pcweb_agreement: string, // 铂金宝-协议管理
+	table_pcweb_spot_trade_warehouse_price: string, // 现货贸易-仓单贸易-一口价
+	table_pcweb_spot_trade_warehouse_float: string, // 现货贸易-仓单贸易
+	table_pcweb_spot_trade_warehouse_sale_price: string, // 现货贸易-仓单预售
+	table_pcweb_spot_trade_warehouse_sale_float: string, // 现货贸易-仓单预售
+	table_pcweb_spot_trade_warehouse_price_trading_hall_sale: string, // 现货贸易-仓单贸易-买卖大厅
+	table_pcweb_spot_trade_warehouse_price_trading_hall_buy: string, // 现货贸易-仓单贸易-买卖大厅
+	table_pcweb_spot_trade_warehouse_float_trading_hall_sale: string, // 现货贸易-仓单贸易-买卖大厅
+	table_pcweb_spot_trade_warehouse_float_trading_hall_buy: string, // 现货贸易-仓单贸易-买卖大厅
+	table_pcweb_spot_trade_warehouse_presale_price_trading_hall_sale: string, // 现货贸易-仓单预售-买卖大厅
+	table_pcweb_spot_trade_warehouse_presale_price_trading_hall_buy: string, // 现货贸易-仓单预售-买卖大厅
+	table_pcweb_spot_trade_warehouse_presale_float_trading_hall_sale: string, // 现货贸易-仓单预售-买卖大厅
+	table_pcweb_spot_trade_warehouse_presale_float_trading_hall_buy: string, // 现货贸易-仓单预售-买卖大厅
+	table_pcweb_spot_trade_bottom_spot_warrant_spot_summary: string, // 底部栏-现货仓单
+	table_pcweb_spot_trade_bottom_spot_warrant_inventory_summary: string, // 底部栏-现货仓单
+	table_pcweb_spot_trade_bottom_spot_warrant_spot_detail: string, // 底部栏-现货仓单
+	table_pcweb_spot_trade_bottom_spot_warrant_pending_order: string, // 底部栏-现货仓单
+	table_pcweb_spot_trade_bottom_spot_warrant_deal: string, // 底部栏-现货仓单
+	table_pcweb_spot_trade_bottom_spot_warrant_designated_deal: string, // 底部栏-现货仓单
+	table_pcweb_spot_trade_bottom_spot_warrant_pick_up: string, // 底部栏-现货仓单
+	table_pcweb_spot_trade_bottom_pre_sale_order_summary: string, // 底部栏-预售仓单
+	table_pcweb_spot_trade_bottom_pre_sale_pending_order: string, // 底部栏-预售仓单
+	table_pcweb_spot_trade_bottom_pre_sale_make_deal: string, // 底部栏-预售仓单
+	table_pcweb_spot_trade_bottom_commodity_contract_summary: string, // 底部栏-商品合约
+	table_pcweb_spot_trade_bottom_commodity_contract_commission: string, // 底部栏-商品合约
+	table_pcweb_spot_trade_bottom_commodity_contract_make_deal: string, // 底部栏-商品合约
+	table_pcweb_spot_trade_bottom_commodity_contract_settlement: string, // 底部栏-商品合约
+	table_pcweb_spot_trade_bottom_performance_info_buy: string, // 底部栏-履约信息
+	table_pcweb_spot_trade_bottom_performance_info_sale: string, // 底部栏-履约信息
+	table_pcweb_spot_trade_bottom_funding_info_summary: string, // 底部栏-资金信息
+	table_pcweb_spot_trade_bottom_funding_info_log: string, // 底部栏-资金信息
+	table_pcweb_financing_manage_bottom_apply_order: string, // 底部栏-融资管理
+	table_pcweb_financing_manage_bottom_contract: string, // 底部栏-融资管理
+	table_pcweb_financing_manage_bottom_commodity_order_summary: string, // 底部栏-商品订单
+	table_pcweb_financing_manage_bottom_commodity_order_entrust: string, // 底部栏-商品订单
+	table_pcweb_financing_manage_bottom_commodity_order_deal: string, // 底部栏-商品订单
+	table_pcweb_financing_manage_bottom_commodity_order_settlement: string, // 底部栏-商品订单
+	table_pcweb_financing_manage_order_transaction: string, // 现货贸易-订单交易
+	table_pcweb_financing_manage_reference_market: string, // 现货贸易-参考行情
+}

+ 48 - 1
src/common/setup/table/clolumn.ts

@@ -87,7 +87,7 @@ export function getTableColumns() {
         console.log('过滤参数', value);
 
         filteredInfo.value = value
-        registerColumn(cacheTableKey, cacheFilterKeyList, cacheColumnCB)
+        registerColumn(cacheTableKey, cacheFilterKeyList)
     }
     return { columns, registerColumn, updateColumn }
 }
@@ -142,3 +142,50 @@ function getFromatterFn(val: string) {
 export function expandIcon(props: any) {
     return null
 }
+
+export function handleTableColums(columnsParam: ColumnType[], filterKeyList: string[] = []) {
+    // 表头数据
+    const columns = ref<ColumnType[]>([]);
+    // 过滤信息
+    const filteredInfo = ref();
+    function registerColumn() {
+        const filtered = filteredInfo.value || {};
+        columns.value.length = 0
+        columnsParam.forEach((item, index) => {
+            const { key, title, width, align, } = item;
+            const obj: ColumnType = { key, title, dataIndex: key, slots: { customRender: key } }
+            // 过滤
+            if (filterKeyList.includes(key)) {
+                obj.onFilter = (value: string, record: any) => record[key].toString().includes(String(value))
+                obj.filteredValue = filtered[key] || null;
+            }
+            // 宽度
+            if (width) {
+                obj.width = width
+            } else {
+                if (title.includes('时间') || title.includes('编号')) {
+                    obj.width = 200
+                } else {
+                    const len = title.length
+                    if (len > 4) {
+                        obj.width = 120 + 10 * (len - 4)
+                    } else {
+                        obj.width = 120 // 默认120
+                    }
+                }
+            }
+            align ? (obj.align = align) : (obj.align = 'center')
+            columns.value.push(obj)
+        })
+        console.log('columns', columns)
+    }
+    registerColumn()
+    /**
+     * 更新动态表头
+     */
+    function updateColumn(value: object) {
+        filteredInfo.value = value
+        registerColumn()
+    }
+    return { columns, updateColumn }
+}

+ 33 - 0
src/services/bus/goods.ts

@@ -1,5 +1,7 @@
 import { TradeMode } from '@/common/constants/enumCommon';
+import { initData } from '@/common/methods';
 import APP from '@/services';
+import { Ref, ref } from 'vue';
 import { Goods } from '../go/ermcp/goodsInfo/interface';
 import { QueryQuoteDayRsp } from '../go/quote/interface';
 import { Goodsgroup } from '../go/useInfo/interface';
@@ -10,6 +12,37 @@ export function getGoodsList(): Goods[] {
     return APP.get('Goods')
 }
 
+// 通过trademode 获取商品
+export function getGoodsListByTrade(trademode: TradeMode): Ref<Goods[]> {
+    const result = ref<Goods[]>([])
+    initData(() => {
+        const marketInfo = getMarketByTradeMode(trademode)
+        if (marketInfo) {
+            result.value = getGoodsList().filter(e => e.marketid === marketInfo.marketid)
+        }
+    })
+    return result
+}
+
+// 通过trademode 获取行情,并获取goodsname
+export function getQutoGoodsByTradeMode(trademode: TradeMode) {
+    const result = ref<QueryQuoteDayRsp[]>([])
+    initData(() => {
+        const marketInfo = getMarketByTradeMode(trademode)
+        if (marketInfo) {
+            const goodsList = getGoodsList().filter(e => e.marketid === marketInfo.marketid)
+            goodsList.forEach(el => {
+                const quote = getQuoteDayInfoByCode(el.goodscode);
+                if (quote) {
+                    Object.assign(quote, { goodsname: el.goodsname })
+                    result.value.push(quote)
+                }
+            })
+        }
+    })
+    return result
+}
+
 export function getGoodsByCode(goodsCode: string): Goods | undefined {
     return getGoodsList().find(e => e.goodscode === goodsCode)
 }

+ 3 - 4
src/utils/qt/common.ts

@@ -1,5 +1,4 @@
-import timerUtil from '@/utils/timer/timerUtil';
-import { TimeoutTimerNames } from '@/utils/timer/timerUtil';
+import timerUtil, { TimeoutTimerNames } from '@/utils/timer/timerUtil';
 /**
  * 防抖(debounce)
  * @param fn 需要防抖的函数
@@ -7,7 +6,7 @@ import { TimeoutTimerNames } from '@/utils/timer/timerUtil';
  * @returns
  */
 export function debounce(fn: () => void, wait: number, timer: keyof TimeoutTimerNames = 'debounce'): void {
-    return (function() {
+    return (function () {
         timerUtil.clearTimeout(timer);
         timerUtil.setTimeout(fn, wait, timer);
     })();
@@ -79,7 +78,7 @@ export function changeUnit(value: number, decimals = 3): string {
             fm = 1000000000000000;
         }
         newValue[1] = text1;
-        newValue[0] = parseInt((value / fm).toFixed(decimals)) + '';
+        newValue[0] = (value / fm).toFixed(decimals) + '';
     }
     if (value < 1000) {
         newValue[1] = '';

+ 101 - 11
src/views/market/spot_trade/spot_trade_reference_market/index.vue

@@ -1,26 +1,116 @@
 <template>
-  <!-- 参考行情 -->
-  <div class="topTableHeight40">
-    <router-view></router-view>
-    <ThridMenu :list="tabList"
-               :selectedKey="index"
-               @selectMenu="changeTab" />
+  <!--订单交易 挂牌转让-->
+  <div class="topTableHeight">
+    <a-table :columns="columns"
+             class="srcollYTable"
+             :scroll="{ x: '100%', y: 'calc(100vh - 479px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="goodscode"
+             ref="tableRef"
+             :data-source="goodsList">
+      <template #totalturnover="{ text }">
+        <span>{{changeUnit(text)}}</span>
+      </template>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="firstBtn"></contextMenu>
+    <component :is="componentId"
+               v-if="componentId"
+               :enumName="name"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent } from 'vue';
-import ThridMenu from '@/common/components/thirdMenu/index.vue';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
-import { handleMartketThirdRouter } from '@/common/setup/matket/router';
+import { queryTableList, BtnList, contextMenu, defineAsyncComponent, defineComponent, ModalEnum, ComposeTableParam } from '@/common/export/commonTable';
+import { QueryOrderQuoteReq } from '@/services/go/wrtrade/interface';
+import { queryOrderQuote } from '@/services/go/wrtrade';
+import { handleComposeTable } from '@/views/market/spot_trade/setup';
+import { ref } from 'vue';
+import { handleSubcriteQuote } from '@/common/setup/table/tableQuote';
+import { QueryDeliveryRelationRsp } from '@/services/go/delivery/interface';
+import { getGoodsListByTrade, getQutoGoodsByTradeMode } from '@/services/bus/goods';
+import { TradeMode } from '@/common/constants/enumCommon';
+import { handleTableColums } from '@/common/setup/table/clolumn';
+import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
+import { changeUnit } from '@/utils/qt/common';
+
+const columnsList = [
+    { title: '序号', key: 'orderid' },
+    { title: '代码', key: 'goodscode' },
+    { title: '名称', key: 'goodsname' },
+    { title: '买价', key: 'bid' },
+    { title: '买量', key: 'bidvolume' },
+    { title: '卖价', key: 'ask' },
+    { title: '卖量', key: 'askvolume' },
+
+    { title: '最新价', key: 'last' },
+
+    // { title: '涨跌', key: 'goodscode' },
+    // { title: '幅度', key: 'goodscode' },
+    { title: '今开', key: 'opened' },
+    { title: '昨收价', key: 'preclose' },
+    { title: '最低价', key: 'lowest' },
+    { title: '最高价', key: 'highest' },
+    // {title: '振幅', key: 'goodscode'},
+    // {title: '总量', key: 'goodscode'},
+    // {title: '现量', key: 'goodscode'},
+    { title: '持仓量', key: 'holdvolume' },
+    // { title: '日增', key: 'goodscode' },
+    { title: '金额', key: 'totalturnover' },
+];
 
 export default defineComponent({
     name: EnumRouterName.spot_trade_reference_market,
     components: {
-        ThridMenu,
+        contextMenu,
+        // [ModalEnum.spot_trade_warehouse_detail]: defineAsyncComponent(() => import('../../components/detail/index.vue')),
+        // [ModalEnum.spot_trade_warehouse_post_buying]: defineAsyncComponent(() => import('../../components/post_buying/index.vue')),
+        buyAndSell: defineAsyncComponent(() => import('../components/buy-sell-market/index.vue')),
+        // postBuying: defineAsyncComponent(() => import('../../components/post_buying/index.vue')),
     },
     setup() {
-        return { ...handleMartketThirdRouter(EnumRouterName.spot_trade_reference_market) };
+        // 表头
+        const { columns } = handleTableColums(columnsList);
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList<QueryDeliveryRelationRsp>();
+        const tableRef = ref<any>(null);
+        // 行情商品
+        const goodsList = getQutoGoodsByTradeMode(TradeMode.quote99);
+        // 行情按需订阅
+        handleSubcriteQuote<QueryQuoteDayRsp>(goodsList);
+        // 获取列表数据
+        const queryTableAction = () => {
+            const param: QueryOrderQuoteReq = {
+                wrpricetype: 1,
+                haswr: 1,
+            };
+            queryTable(queryOrderQuote, param);
+        };
+        // 表格通用逻辑
+        const param: ComposeTableParam = {
+            queryFn: queryTableAction,
+            menuType: EnumRouterName.warehouse_receipt_trade_price,
+            tableName: 'table_pcweb_spot_trade_warehouse_price',
+            tableFilterKey: [],
+            isDetail: false,
+        };
+        return {
+            ...handleComposeTable<QueryDeliveryRelationRsp>(param),
+            loading,
+            tableList,
+            goodsList,
+            tableRef,
+            columns,
+            changeUnit,
+        };
     },
 });
 </script>