huangbin 4 years ago
parent
commit
a59ee5aa67
1 changed files with 87 additions and 79 deletions
  1. 87 79
      src/views/market/spot_trade/components/buy-sell-market/index.vue

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

@@ -1,84 +1,88 @@
 <template>
-    <!-- 买卖大厅 -->
-    <div class="buy-sell-market">
-        <div class="buy-sell-market-title">
-            <a class="backIcon" @click="cancel">
-                <LeftOutlined />
-            </a>
-            <div class="titleBtn">
-                <div class="name">{{selectedRow.deliverygoodsname}}</div>
-                <div class="arrowRightIcon"></div>
-            </div>
-            <div class="titleBtn titleBtn2">
-                <div class="arrowLeftIcon"></div>
-                <div class="name">{{selectedRow.wrgoodsname}}</div>
-                <div class="arrowRightIcon"></div>
-            </div>
-            <div class="titleBtn titleBtn3">
-                <div class="arrowLeftIcon"></div>
-                <div class="name">{{selectedRow.warehousename}}</div>
-            </div>
-            <div class="green">
-                <div class="numBlock" v-if="isFloatPrice()">
-                    <div class="first">卖基差</div>
-                    <div class="last">{{selectedRow.sellpricemove}}</div>
-                </div>
-                <div class="numBlock" v-else>
-                    <div class="first">卖价</div>
-                    <div class="last">{{selectedRow.sellprice}}</div>
-                </div>
-                <div class="numBlock">
-                    <div class="first">卖量</div>
-                    <div class="last">{{selectedRow.sellqty}}</div>
-                </div>
-            </div>
-            <div class="red ml35">
-                <div class="numBlock" v-if="isFloatPrice()">
-                    <div class="first">买基差</div>
-                    <div class="last">{{selectedRow.buypricemove}}</div>
-                </div>
-                <div class="numBlock" v-else>
-                    <div class="first">买价</div>
-                    <div class="last">{{selectedRow.buyprice}}</div>
-                </div>
-                <div class="numBlock">
-                    <div class="first">买量</div>
-                    <div class="last">{{selectedRow.buyqty}}</div>
-                </div>
-            </div>
-            <div class="market" v-if="isFloatPrice()">
-                <div class="first">{{selectedRow.goodscode}}</div>
-                <div class="last red">{{getGoodsPrice()}}</div>
-                <LineChartOutlined />
-            </div>
-            <BtnList :btnList="temp(firstBtn)" :record="selectedRow" @click="openComponent" />
+  <!-- 买卖大厅 -->
+  <div class="buy-sell-market">
+    <div class="buy-sell-market-title">
+      <a class="backIcon"
+         @click="cancel">
+        <LeftOutlined />
+      </a>
+      <div class="titleBtn">
+        <div class="name">{{selectedRow.deliverygoodsname}}</div>
+        <div class="arrowRightIcon"></div>
+      </div>
+      <div class="titleBtn titleBtn2">
+        <div class="arrowLeftIcon"></div>
+        <div class="name">{{selectedRow.wrgoodsname}}</div>
+        <div class="arrowRightIcon"></div>
+      </div>
+      <div class="titleBtn titleBtn3">
+        <div class="arrowLeftIcon"></div>
+        <div class="name">{{selectedRow.warehousename}}</div>
+      </div>
+      <div class="green">
+        <div class="numBlock"
+             v-if="isFloatPrice()">
+          <div class="first">卖基差</div>
+          <div class="last">{{selectedRow.sellpricemove}}</div>
         </div>
-        <a-row class="buySellHall">
-            <a-col :span="12" v-if="sellMarket.isMarket">
-                <Sell
-                    :enumName="enumName"
-                    ref="sellRef"
-                    :parantSelectedRow="selectedRow"
-                    :btnList="sellMarket.btnList"
-                />
-            </a-col>
-            <a-col :span="12" v-if="buyMarket.isMarket">
-                <Buy
-                    :enumName="enumName"
-                    ref="buy"
-                    :parantSelectedRow="selectedRow"
-                    :btnList="buyMarket.btnList"
-                />
-            </a-col>
-        </a-row>
-        <component
-            :is="componentId"
-            v-if="componentId"
-            :selectedRow="selectedRow"
-            :enumName="enumName"
-            @cancel="closeComponent"
-        ></component>
+        <div class="numBlock"
+             v-else>
+          <div class="first">卖价</div>
+          <div class="last">{{selectedRow.sellprice}}</div>
+        </div>
+        <div class="numBlock">
+          <div class="first">卖量</div>
+          <div class="last">{{selectedRow.sellqty}}</div>
+        </div>
+      </div>
+      <div class="red ml35">
+        <div class="numBlock"
+             v-if="isFloatPrice()">
+          <div class="first">买基差</div>
+          <div class="last">{{selectedRow.buypricemove}}</div>
+        </div>
+        <div class="numBlock"
+             v-else>
+          <div class="first">买价</div>
+          <div class="last">{{selectedRow.buyprice}}</div>
+        </div>
+        <div class="numBlock">
+          <div class="first">买量</div>
+          <div class="last">{{selectedRow.buyqty}}</div>
+        </div>
+      </div>
+      <div class="market"
+           v-if="isFloatPrice()">
+        <div class="first">{{selectedRow.goodscode}}</div>
+        <div class="last red">{{getGoodsPrice()}}</div>
+        <LineChartOutlined />
+      </div>
+      <BtnList :btnList="temp(firstBtn)"
+               :record="selectedRow"
+               @click="openComponent" />
     </div>
+    <a-row class="buySellHall">
+      <a-col :span="12"
+             v-if="sellMarket.isMarket">
+        <Sell :enumName="enumName"
+              ref="sellRef"
+              :parantSelectedRow="selectedRow"
+              :btnList="sellMarket.btnList" />
+      </a-col>
+      <a-col :span="12"
+             v-if="buyMarket.isMarket">
+        <Buy :enumName="enumName"
+             ref="buy"
+             :parantSelectedRow="selectedRow"
+             :btnList="buyMarket.btnList" />
+      </a-col>
+    </a-row>
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               :enumName="enumName"
+               @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">
@@ -150,7 +154,11 @@ export default defineComponent({
         });
         const { childRef: buyRef, loadChildComponentData: loadBuyData } = handleChildComponentMethod();
         const { childRef: sellRef, loadChildComponentData: loadSellData } = handleChildComponentMethod();
-        const { componentId, closeComponent, openComponent } = handleModalComponent(loadBuyData, ref({}));
+        const queryFn = () => {
+            loadBuyData();
+            loadSellData();
+        };
+        const { componentId, closeComponent, openComponent } = handleModalComponent(queryFn, ref({}));
         TimerUtils.setInterval(
             () => {
                 loadBuyData();