|
@@ -55,7 +55,7 @@ import { getShowBottomValue } from '@/common/config/constrolBottom';
|
|
|
import { handleModalComponent } from '@/common/setup/asyncComponent';
|
|
import { handleModalComponent } from '@/common/setup/asyncComponent';
|
|
|
import { handleQuotePriceColor, handleSubcriteOnDemandQuote, quoteAmplitude, quoteAmplituOfVibration, quoteChange } from '@/common/setup/table/tableQuote';
|
|
import { handleQuotePriceColor, handleSubcriteOnDemandQuote, quoteAmplitude, quoteAmplituOfVibration, quoteChange } from '@/common/setup/table/tableQuote';
|
|
|
import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
|
|
import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
|
|
|
-import { ref } from 'vue';
|
|
|
|
|
|
|
+import { ref, reactive, Ref, toRefs } from 'vue';
|
|
|
import { getColumnsList, useExternalexchange } from './setup';
|
|
import { getColumnsList, useExternalexchange } from './setup';
|
|
|
import { getTableButton } from '@/common/setup/table/button';
|
|
import { getTableButton } from '@/common/setup/table/button';
|
|
|
import { contextMenu, defineAsyncComponent, defineComponent } from '@/common/export/commonTable';
|
|
import { contextMenu, defineAsyncComponent, defineComponent } from '@/common/export/commonTable';
|
|
@@ -64,6 +64,9 @@ import { TableEventCB } from '@/common/setup/table/interface';
|
|
|
import { getTableEvent } from '@/common/export/table';
|
|
import { getTableEvent } from '@/common/export/table';
|
|
|
import { ContextMenuTemp } from '@/common/components/contextMenu/interface';
|
|
import { ContextMenuTemp } from '@/common/components/contextMenu/interface';
|
|
|
import { BtnListType } from '@/common/components/btnList/interface';
|
|
import { BtnListType } from '@/common/components/btnList/interface';
|
|
|
|
|
+import APP from '@/services';
|
|
|
|
|
+import { Goods } from '@/services/go/ermcp/goodsInfo/interface';
|
|
|
|
|
+import { getQuoteDayInfoByCode } from '@/services/bus/goods';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'spot_trade_order_transaction_swap',
|
|
name: 'spot_trade_order_transaction_swap',
|
|
@@ -73,22 +76,54 @@ export default defineComponent({
|
|
|
trade: defineAsyncComponent(() => import('./compoments/futures-trade/index.vue')),
|
|
trade: defineAsyncComponent(() => import('./compoments/futures-trade/index.vue')),
|
|
|
},
|
|
},
|
|
|
setup() {
|
|
setup() {
|
|
|
|
|
+ interface Quote {
|
|
|
|
|
+ goodscode: string;
|
|
|
|
|
+ goodsname: string;
|
|
|
|
|
+ decimalplace: number;
|
|
|
|
|
+ last?: Ref;
|
|
|
|
|
+ presettle?: Ref;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const goodsList = APP.get('Goods') as Goods[];
|
|
|
|
|
+ const tableList = reactive<Quote[]>([]);
|
|
|
|
|
+ const quoteList = ref<QueryQuoteDayRsp[]>([]);
|
|
|
|
|
+
|
|
|
|
|
+ goodsList.forEach((el) => {
|
|
|
|
|
+ const quote = getQuoteDayInfoByCode(el.goodscode);
|
|
|
|
|
+ if (quote) {
|
|
|
|
|
+ quoteList.value.push(quote);
|
|
|
|
|
+ }
|
|
|
|
|
+ tableList.push({
|
|
|
|
|
+ goodscode: el.goodscode,
|
|
|
|
|
+ goodsname: el.goodsname,
|
|
|
|
|
+ decimalplace: el.decimalplace,
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
const isBottom = getShowBottomValue();
|
|
const isBottom = getShowBottomValue();
|
|
|
- const selectedRow = ref<QueryQuoteDayRsp>();
|
|
|
|
|
const buttons = getTableButton();
|
|
const buttons = getTableButton();
|
|
|
console.log('buttons', buttons);
|
|
console.log('buttons', buttons);
|
|
|
- const { index, loading, tabList, tableList, hanldeQuoteData } = useExternalexchange();
|
|
|
|
|
|
|
+ const { index, loading, tabList, hanldeQuoteData } = useExternalexchange();
|
|
|
// 行情按需订阅
|
|
// 行情按需订阅
|
|
|
- let stopSubcribe = handleSubcriteOnDemandQuote<QueryQuoteDayRsp>(tableList);
|
|
|
|
|
|
|
+ let stopSubcribe = handleSubcriteOnDemandQuote<QueryQuoteDayRsp>(quoteList);
|
|
|
function changeTab(index: number, current: TabList) {
|
|
function changeTab(index: number, current: TabList) {
|
|
|
hanldeQuoteData(index);
|
|
hanldeQuoteData(index);
|
|
|
console.log(index, current);
|
|
console.log(index, current);
|
|
|
// 停止上次订阅
|
|
// 停止上次订阅
|
|
|
stopSubcribe();
|
|
stopSubcribe();
|
|
|
// 重新发起订阅
|
|
// 重新发起订阅
|
|
|
- stopSubcribe = handleSubcriteOnDemandQuote<QueryQuoteDayRsp>(tableList);
|
|
|
|
|
|
|
+ stopSubcribe = handleSubcriteOnDemandQuote<QueryQuoteDayRsp>(quoteList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ quoteList.value.forEach((item) => {
|
|
|
|
|
+ const refs = toRefs(item);
|
|
|
|
|
+ const index = tableList.findIndex((e) => e.goodscode === item.goodscode);
|
|
|
|
|
+ if (index > -1) {
|
|
|
|
|
+ tableList[index].last = refs.last;
|
|
|
|
|
+ tableList[index].presettle = refs.presettle;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
// 右键逻辑
|
|
// 右键逻辑
|
|
|
const { contextMenu, closeContext: closeContextAction } = handleContextMenu();
|
|
const { contextMenu, closeContext: closeContextAction } = handleContextMenu();
|
|
|
// 右键回调函数
|
|
// 右键回调函数
|
|
@@ -99,7 +134,7 @@ export default defineComponent({
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
// 表格事件
|
|
// 表格事件
|
|
|
- const { Rowclick } = getTableEvent<QueryQuoteDayRsp>(eventsCB);
|
|
|
|
|
|
|
+ const { selectedRow, Rowclick } = getTableEvent<QueryQuoteDayRsp>(eventsCB);
|
|
|
// 控制异步组件
|
|
// 控制异步组件
|
|
|
const { componentId, closeComponent, openComponent } = handleModalComponent(() => {}, selectedRow);
|
|
const { componentId, closeComponent, openComponent } = handleModalComponent(() => {}, selectedRow);
|
|
|
// 关闭右键
|
|
// 关闭右键
|