|
|
@@ -2,54 +2,48 @@
|
|
|
<!-- 买卖大厅 -->
|
|
|
<div class="buy-sell-market">
|
|
|
<div class="buy-sell-market-title">
|
|
|
- <a class="backIcon"
|
|
|
- @click="cancel">
|
|
|
+ <a class="backIcon" @click="cancel">
|
|
|
<LeftOutlined />
|
|
|
</a>
|
|
|
<div class="titleBtn">
|
|
|
- <div class="name">{{selectedRow.goodsname}}</div>
|
|
|
+ <div class="name">{{ selectedRow.goodsname }}</div>
|
|
|
<div class="arrowRightIcon"></div>
|
|
|
</div>
|
|
|
<div class="priceBar bdf1 ml20">
|
|
|
<div class="greenBar">
|
|
|
<div class="numBlock">
|
|
|
<div class="first">卖量</div>
|
|
|
- <div class="last green">{{selectedRow.askvolume ? selectedRow.askvolume : '--'}}</div>
|
|
|
+ <div class="last green">{{ selectedRow.askvolume ? selectedRow.askvolume : '--' }}</div>
|
|
|
</div>
|
|
|
<div class="numBlock">
|
|
|
<div class="first">买量</div>
|
|
|
- <div class="last white">{{selectedRow.bidvolume ? selectedRow.bidvolume : '--'}}</div>
|
|
|
+ <div class="last white">{{ selectedRow.bidvolume ? selectedRow.bidvolume : '--' }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 历史走势按钮 -->
|
|
|
- <a-button class="historyBtn"
|
|
|
- @click="openComponent({code: 'HisChart'})">
|
|
|
+ <a-button class="historyBtn" @click="openComponent({ code: 'HisChart' })">
|
|
|
历史走势
|
|
|
<LineChartOutlined />
|
|
|
</a-button>
|
|
|
- <BtnList :btnList="firstBtn"
|
|
|
- :record="selectedRow"
|
|
|
- @click="openComponent" />
|
|
|
+ <BtnList :btnList="firstBtn" :record="selectedRow" @click="openComponent" />
|
|
|
</div>
|
|
|
<a-row class="buySellHall">
|
|
|
<a-col :span="12">
|
|
|
- <Sell :enumName="enumName"
|
|
|
- ref="sellRef"
|
|
|
- :parantSelectedRow="selectedRow" />
|
|
|
+ <Sell :enumName="enumName" ref="sellRef" :parantSelectedRow="selectedRow" />
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <Buy :enumName="enumName"
|
|
|
- ref="buyRef"
|
|
|
- :parantSelectedRow="selectedRow" />
|
|
|
+ <Buy :enumName="enumName" ref="buyRef" :parantSelectedRow="selectedRow" />
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
- <component :is="componentId"
|
|
|
- v-if="componentId"
|
|
|
- :selectedRow="selectedRow"
|
|
|
- :goodsPrice="getGoodsPrice()"
|
|
|
- :enumName="enumName"
|
|
|
- @cancel="closeComponent"></component>
|
|
|
+ <component
|
|
|
+ :is="componentId"
|
|
|
+ v-if="componentId"
|
|
|
+ :selectedRow="selectedRow"
|
|
|
+ :goodsPrice="getGoodsPrice()"
|
|
|
+ :enumName="enumName"
|
|
|
+ @cancel="closeComponent"
|
|
|
+ ></component>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -76,89 +70,78 @@ import { getBtnList } from '../../setup';
|
|
|
import { RefGoodsList } from '../../interface';
|
|
|
|
|
|
export default defineComponent({
|
|
|
- emits: ['cancel', 'update'],
|
|
|
- name: 'buy-sell-market',
|
|
|
- props: {
|
|
|
- selectedRow: {
|
|
|
- type: Object as PropType<RefGoodsList>,
|
|
|
- default: {},
|
|
|
- },
|
|
|
- enumName: {
|
|
|
- default: '',
|
|
|
- type: String as PropType<EnumRouterName>,
|
|
|
- },
|
|
|
+ emits: ['cancel', 'update'],
|
|
|
+ name: 'buy-sell-market',
|
|
|
+ props: {
|
|
|
+ selectedRow: {
|
|
|
+ type: Object as PropType<RefGoodsList>,
|
|
|
+ default: {},
|
|
|
},
|
|
|
- components: {
|
|
|
- Buy,
|
|
|
- Sell,
|
|
|
- BtnList,
|
|
|
- LeftOutlined,
|
|
|
- DownOutlined,
|
|
|
- LineChartOutlined,
|
|
|
- Detail: defineAsyncComponent(() => import('../detail/index.vue')),
|
|
|
- PostBuying: defineAsyncComponent(() => import('../post_buying/index.vue')),
|
|
|
- HisChart: defineAsyncComponent(() => import('../history-chart/index.vue')),
|
|
|
+ enumName: {
|
|
|
+ default: '',
|
|
|
+ type: String as PropType<EnumRouterName>,
|
|
|
},
|
|
|
- setup(props, context) {
|
|
|
- const loading = ref<boolean>(false);
|
|
|
- const { visible, cancel } = _closeModal(context);
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ Buy,
|
|
|
+ Sell,
|
|
|
+ BtnList,
|
|
|
+ LeftOutlined,
|
|
|
+ DownOutlined,
|
|
|
+ LineChartOutlined,
|
|
|
+ Detail: defineAsyncComponent(() => import('../detail/index.vue')),
|
|
|
+ PostBuying: defineAsyncComponent(() => import('../post_buying/index.vue')),
|
|
|
+ HisChart: defineAsyncComponent(() => import('../history-chart/index.vue')),
|
|
|
+ },
|
|
|
+ setup(props, context) {
|
|
|
+ const loading = ref<boolean>(false);
|
|
|
+ const { visible, cancel } = _closeModal(context);
|
|
|
|
|
|
- // const { isWR, isFloat } = handleIs(props.enumName, BuyOrSell.buy);
|
|
|
- // 买卖大厅 配置数据
|
|
|
- // 表格操作按钮列表
|
|
|
- // 获取浮动价商品实时价格
|
|
|
+ // 获取浮动价商品实时价格
|
|
|
|
|
|
- function getGoodsPrice() {
|
|
|
- const result = getQuoteDayInfoByCodeFindPrice(props.selectedRow.goodscode);
|
|
|
- // setGoodsPrice(result);
|
|
|
- return result;
|
|
|
- }
|
|
|
- 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 { hasFinacing } = handleFinacing(loading, props.selectedRow.wrfactortypeid);
|
|
|
- function handleBtnList(list: BtnListType[]) {
|
|
|
- // if (!hasFinacing()) {
|
|
|
- // return list.filter((e) => e.code !== 'spot_trade_warehouse_financing_delisting');
|
|
|
- // } else {
|
|
|
- // return list;
|
|
|
- // }
|
|
|
- }
|
|
|
- // 单据挂牌成功 通知买大厅刷新数据
|
|
|
- Bus.$on('spotTrade', queryFn);
|
|
|
+ function getGoodsPrice() {
|
|
|
+ const result = getQuoteDayInfoByCodeFindPrice(props.selectedRow.goodscode);
|
|
|
+ // setGoodsPrice(result);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ 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({}));
|
|
|
|
|
|
- return {
|
|
|
- buyRef,
|
|
|
- sellRef,
|
|
|
- cancel,
|
|
|
- getGoodsPrice,
|
|
|
- visible,
|
|
|
- firstBtn: getBtnList(false),
|
|
|
- buyMarket: [],
|
|
|
- sellMarket: [],
|
|
|
- componentId,
|
|
|
- closeComponent,
|
|
|
- openComponent,
|
|
|
- enumName: props.enumName,
|
|
|
- handleBtnList,
|
|
|
- };
|
|
|
- },
|
|
|
+ // 单据挂牌成功 通知买大厅刷新数据
|
|
|
+ Bus.$on('spotTrade', queryFn);
|
|
|
+
|
|
|
+ return {
|
|
|
+ buyRef,
|
|
|
+ sellRef,
|
|
|
+ cancel,
|
|
|
+ getGoodsPrice,
|
|
|
+ visible,
|
|
|
+ firstBtn: getBtnList(false),
|
|
|
+ buyMarket: [],
|
|
|
+ sellMarket: [],
|
|
|
+ componentId,
|
|
|
+ closeComponent,
|
|
|
+ openComponent,
|
|
|
+ enumName: props.enumName,
|
|
|
+ };
|
|
|
+ },
|
|
|
});
|
|
|
</script>
|
|
|
<style lang="less">
|
|
|
.priceBar {
|
|
|
- .flex;
|
|
|
- flex-direction: column;
|
|
|
- height: 32px;
|
|
|
- .greenBar,
|
|
|
- .redBar {
|
|
|
- height: 16px;
|
|
|
- line-height: 16px;
|
|
|
- color: var(--m-grey17);
|
|
|
- }
|
|
|
+ .flex;
|
|
|
+ flex-direction: column;
|
|
|
+ height: 32px;
|
|
|
+ .greenBar,
|
|
|
+ .redBar {
|
|
|
+ height: 16px;
|
|
|
+ line-height: 16px;
|
|
|
+ color: var(--m-grey17);
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|