|
|
@@ -2,8 +2,7 @@
|
|
|
<!-- 买卖大厅 -->
|
|
|
<div class="buy-sell-market">
|
|
|
<div class="buy-sell-market-title">
|
|
|
- <a class="backIcon"
|
|
|
- @click="cancelAction">
|
|
|
+ <a class="backIcon" @click="cancelAction">
|
|
|
<LeftOutlined />
|
|
|
</a>
|
|
|
<div class="titleBtn">
|
|
|
@@ -13,16 +12,14 @@
|
|
|
<div class="inlineBar">
|
|
|
<div class="valNums bdf1 ml10">
|
|
|
<!-- 最新价 -->
|
|
|
- <div
|
|
|
- :class="['firstNum', 'start', handleQuotePriceColor(selectedRow.last, selectedRow.presettle)]">
|
|
|
+ <div :class="['firstNum', 'start', handleQuotePriceColor(selectedRow.last, selectedRow.presettle)]">
|
|
|
{{ handleNoneValue(selectedRow.last) }}</div>
|
|
|
<div class="lastNum start">
|
|
|
<!-- 涨跌值 -->
|
|
|
<div :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">
|
|
|
{{ quoteChange(selectedRow, selectedRow.decimalplace) }}</div>
|
|
|
<!-- 涨跌幅 -->
|
|
|
- <div class="ml20"
|
|
|
- :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">
|
|
|
+ <div class="ml20" :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">
|
|
|
{{ quoteAmplitude(selectedRow, selectedRow.decimalplace) }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -31,8 +28,7 @@
|
|
|
<div class="greenBar green">
|
|
|
<div class="numBlock ml15">
|
|
|
<div class="first">卖价</div>
|
|
|
- <div class="last"
|
|
|
- :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)">
|
|
|
+ <div class="last" :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)">
|
|
|
{{ handleNoneValue(selectedRow.ask) }}</div>
|
|
|
</div>
|
|
|
<div class="numBlock">
|
|
|
@@ -45,8 +41,7 @@
|
|
|
<div class="redBar red1">
|
|
|
<div class="numBlock">
|
|
|
<div class="first">买价</div>
|
|
|
- <div class="last"
|
|
|
- :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)">
|
|
|
+ <div class="last" :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)">
|
|
|
{{ handleNoneValue(selectedRow.bid) }}</div>
|
|
|
</div>
|
|
|
<div class="numBlock">
|
|
|
@@ -56,36 +51,24 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <BtnList :btnList="handleBtnList()"
|
|
|
- :record="selectedRow"
|
|
|
- @click="openComponent" />
|
|
|
+ <BtnList :btnList="handleBtnList()" :record="selectedRow" @click="openComponent" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 交易图表 -->
|
|
|
<!-- <Chart v-if="showComponentsId === ComponentType.chart" @update="changeComponent" :deliverGoods="deliverGoods" /> -->
|
|
|
- <Chart v-if="showComponentsId === ComponentType.chart"
|
|
|
- @update="changeComponent"
|
|
|
- :selectedRow="selectedRow" />
|
|
|
+ <Chart v-if="showComponentsId === ComponentType.chart" @update="changeComponent" :selectedRow="selectedRow" />
|
|
|
<!-- 买卖大厅内容 -->
|
|
|
- <a-row class="buySellHall"
|
|
|
- v-if="showComponentsId === ComponentType.marketContent">
|
|
|
+ <a-row class="buySellHall" v-if="showComponentsId === ComponentType.marketContent">
|
|
|
<a-col :span="12">
|
|
|
- <Sell ref="sellRef"
|
|
|
- :parantSelectedRow="deliverGoods" />
|
|
|
+ <Sell ref="sellRef" :parantSelectedRow="deliverGoods" />
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <Buy ref="buyRef"
|
|
|
- :parantSelectedRow="deliverGoods" />
|
|
|
+ <Buy ref="buyRef" :parantSelectedRow="deliverGoods" />
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
<!-- 成交明细 -->
|
|
|
- <StockExchange :deliverGoods="deliverGoods"
|
|
|
- v-if="showComponentsId === ComponentType.tradeDetail" />
|
|
|
- <component :is="componentId"
|
|
|
- v-if="componentId"
|
|
|
- :selectedRow="selectedRow"
|
|
|
- :deliverGoods="deliverGoods"
|
|
|
- @cancel="closeComponent"></component>
|
|
|
+ <StockExchange :deliverGoods="deliverGoods" v-if="showComponentsId === ComponentType.tradeDetail" />
|
|
|
+ <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" :deliverGoods="deliverGoods" @cancel="closeComponent"></component>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -114,97 +97,101 @@ import { handleSubcriteOnDemandQuote, handleQuotePriceColor, quoteChange, quoteA
|
|
|
import { Tradesfer } from '../../spot_trade_order_transaction_listing_transfer/interface';
|
|
|
|
|
|
export default defineComponent({
|
|
|
- emits: ['cancel', 'update'],
|
|
|
- name: 'buy-sell-market',
|
|
|
- props: {
|
|
|
- selectedRow: {
|
|
|
- type: Object as PropType<Tradesfer>,
|
|
|
- default: {},
|
|
|
- },
|
|
|
- deliverGoods: {
|
|
|
- type: Object as PropType<QueryDeliveryRelationRsp>,
|
|
|
- default: {},
|
|
|
- },
|
|
|
+ emits: ['cancel', 'update'],
|
|
|
+ name: 'buy-sell-market',
|
|
|
+ props: {
|
|
|
+ selectedRow: {
|
|
|
+ type: Object as PropType<Tradesfer>,
|
|
|
+ default: {},
|
|
|
},
|
|
|
- components: {
|
|
|
- Buy,
|
|
|
- Sell,
|
|
|
- BtnList,
|
|
|
- Chart,
|
|
|
- LeftOutlined,
|
|
|
- Listing: defineAsyncComponent(() => import('../listing/index.vue')),
|
|
|
- Detail: defineAsyncComponent(() => import('../detail/index.vue')),
|
|
|
- StockExchange,
|
|
|
+ deliverGoods: {
|
|
|
+ type: Object as PropType<QueryDeliveryRelationRsp>,
|
|
|
+ default: {},
|
|
|
},
|
|
|
- setup(props, context) {
|
|
|
- const loading = ref<boolean>(false);
|
|
|
- const { visible, cancel } = _closeModal(context);
|
|
|
- function handleBtnList() {
|
|
|
- const result: BtnListType[] = [{ lable: '挂牌求购', code: 'Listing', className: 'operBtn' }];
|
|
|
- if (props.selectedRow.deliverytype) {
|
|
|
- result.push({ lable: '详情', code: 'Detail', className: 'btnDeafault' });
|
|
|
- }
|
|
|
- return result;
|
|
|
- }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ Buy,
|
|
|
+ Sell,
|
|
|
+ BtnList,
|
|
|
+ Chart,
|
|
|
+ LeftOutlined,
|
|
|
+ Listing: defineAsyncComponent(() => import('../listing/index.vue')),
|
|
|
+ Detail: defineAsyncComponent(() => import('../detail/index.vue')),
|
|
|
+ StockExchange,
|
|
|
+ },
|
|
|
+ setup(props, context) {
|
|
|
+ const loading = ref<boolean>(false);
|
|
|
+ const { visible, cancel } = _closeModal(context);
|
|
|
+ function handleBtnList() {
|
|
|
+ const result: BtnListType[] = [{ lable: '挂牌求购', code: 'Listing', className: 'operBtn' }];
|
|
|
+ if (props.selectedRow.deliverytype) {
|
|
|
+ result.push({ lable: '详情', code: 'Detail', className: 'btnDeafault' });
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
- onBeforeUnmount(() => {
|
|
|
- TimerUtils.clearInterval('buyAndSellMartet');
|
|
|
- TimerUtils.clearTimeout('debounce');
|
|
|
- });
|
|
|
- const buyRef = ref<null | { queryTableAction: Function }>(null);
|
|
|
- const sellRef = ref<null | { queryTableAction: Function }>(null);
|
|
|
- const queryFn = () => {
|
|
|
- buyRef.value?.queryTableAction();
|
|
|
- sellRef.value?.queryTableAction();
|
|
|
- };
|
|
|
- const { componentId, closeComponent, openComponent } = handleModalComponent(queryFn, ref({}));
|
|
|
+ onBeforeUnmount(() => {
|
|
|
+ TimerUtils.clearInterval('buyAndSellMartet');
|
|
|
+ TimerUtils.clearTimeout('debounce');
|
|
|
+ });
|
|
|
+ const buyRef = ref<null | { queryTableAction: Function }>(null);
|
|
|
+ const sellRef = ref<null | { queryTableAction: Function }>(null);
|
|
|
+ const queryFn = () => {
|
|
|
+ buyRef.value?.queryTableAction();
|
|
|
+ sellRef.value?.queryTableAction();
|
|
|
+ };
|
|
|
+ const { componentId, closeComponent, openComponent } = handleModalComponent(queryFn, ref({}));
|
|
|
|
|
|
- const showComponentsId = ref<ComponentType>(ComponentType.chart);
|
|
|
+ const showComponentsId = ref<ComponentType>(ComponentType.chart);
|
|
|
|
|
|
- // 切换组件
|
|
|
- function changeComponent(type: ComponentType) {
|
|
|
- showComponentsId.value = type;
|
|
|
- }
|
|
|
- // 返回上层组件
|
|
|
- function cancelAction() {
|
|
|
- if (showComponentsId.value === ComponentType.chart) {
|
|
|
- cancel();
|
|
|
- } else {
|
|
|
- showComponentsId.value = ComponentType.chart;
|
|
|
- }
|
|
|
- }
|
|
|
+ // 切换组件
|
|
|
+ function changeComponent(type: ComponentType) {
|
|
|
+ showComponentsId.value = type;
|
|
|
+ }
|
|
|
+ // 返回上层组件
|
|
|
+ function cancelAction() {
|
|
|
+ if (showComponentsId.value === ComponentType.chart) {
|
|
|
+ cancel();
|
|
|
+ } else {
|
|
|
+ showComponentsId.value = ComponentType.chart;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- TimerUtils.setInterval(
|
|
|
- () => {
|
|
|
- queryFn();
|
|
|
- },
|
|
|
- 10 * 1000,
|
|
|
- 'buyAndSellMartet'
|
|
|
- );
|
|
|
- // 单据挂牌成功 通知买大厅刷新数据
|
|
|
- Bus.$on('spotTrade', queryFn);
|
|
|
+ TimerUtils.setInterval(
|
|
|
+ () => {
|
|
|
+ queryFn();
|
|
|
+ },
|
|
|
+ 10 * 1000,
|
|
|
+ 'buyAndSellMartet'
|
|
|
+ );
|
|
|
+ // 单据挂牌成功 通知买大厅刷新数据
|
|
|
+ const stopNotify = Bus.$on('spotTrade', queryFn);
|
|
|
|
|
|
- return {
|
|
|
- buyRef,
|
|
|
- sellRef,
|
|
|
- cancel,
|
|
|
- visible,
|
|
|
- componentId,
|
|
|
- closeComponent,
|
|
|
- openComponent,
|
|
|
- changeComponent,
|
|
|
- ComponentType,
|
|
|
- showComponentsId,
|
|
|
- cancelAction,
|
|
|
- handleSubcriteOnDemandQuote,
|
|
|
- handleQuotePriceColor,
|
|
|
- handleNoneValue,
|
|
|
- quoteChange,
|
|
|
- quoteAmplitude,
|
|
|
- quoteAmplituOfVibration,
|
|
|
- handleBtnList,
|
|
|
- };
|
|
|
- },
|
|
|
+ onBeforeUnmount(() => {
|
|
|
+ stopNotify();
|
|
|
+ })
|
|
|
+
|
|
|
+ return {
|
|
|
+ buyRef,
|
|
|
+ sellRef,
|
|
|
+ cancel,
|
|
|
+ visible,
|
|
|
+ componentId,
|
|
|
+ closeComponent,
|
|
|
+ openComponent,
|
|
|
+ changeComponent,
|
|
|
+ ComponentType,
|
|
|
+ showComponentsId,
|
|
|
+ cancelAction,
|
|
|
+ handleSubcriteOnDemandQuote,
|
|
|
+ handleQuotePriceColor,
|
|
|
+ handleNoneValue,
|
|
|
+ quoteChange,
|
|
|
+ quoteAmplitude,
|
|
|
+ quoteAmplituOfVibration,
|
|
|
+ handleBtnList,
|
|
|
+ };
|
|
|
+ },
|
|
|
});
|
|
|
</script>
|
|
|
<style lang="less">
|