li.shaoyi 3 년 전
부모
커밋
9eebe7d757

+ 1 - 1
src/views/market/market-spot/index.vue

@@ -60,7 +60,7 @@ export default defineComponent({
     function selectSection(value: TjmdMarketSection) {
       markets.value = value.mlist
       const index = marketsSetion.value.findIndex((el: TjmdMarketSection) => el.marketsectionid === value.marketsectionid)
-      if (index !== -1 && value.mlist.length) {
+      if (index > -1 && value.mlist.length) {
         onSelectMarket(index, value.mlist[0])
       }
     }

+ 95 - 109
src/views/market/market-spot/warehouse_pre_sale/warehouse_pre_sale_designate/components/buy/index.vue

@@ -1,51 +1,36 @@
 <template>
   <!-- 仓单贸易 贸易圈挂牌 卖-->
-  <div>
-    <a-table
-      :columns="columns"
-      :class="['srcollYTable', isBottom ? 'condSecondTabTableHalfTop' : 'condSecondTabTableHalfTopNoBottom', 'halfBottom',  tableList.length ? 'noPlaceHolder' : 'hasPlaceHolder']"
-      :scroll="{ x: '100%', y: isBottom ? 'calc((100vh- 443px)/2 - 14px)' : 'calc((100vh - 196px)/2 - 16px)' }"
-      :pagination="false"
-      :loading="loading"
-      :expandedRowKeys="expandedRowKeys"
-      :customRow="Rowclick"
-      rowKey="key"
-      :data-source="tableList"
-    >
-      <template #index="{ index }">
-        <span>{{ index + 1 }}</span>
-      </template>
-      <template #marginvalue="{ text }">
-        <span>{{ (text * 100).toFixed(2) + '%'}}</span>
-      </template>
-      <!-- 议价 -->
-      <template #canbargain="{ text }">
-        <span>{{ text ? '是' : '否' }}</span>
-      </template>
-      <!-- 整单 -->
-      <template #canpart="{ text }">
-        <span>{{ text === 1 ? '否' : '是' }}</span>
-      </template>
-      <!-- 挂牌有效期 -->
-      <template #validtime="{ text }">
-        <span>{{ formatTime(text, 'd') }}</span>
-      </template>
-    </a-table>
-    <!-- 右键 -->
-    <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="filterBtn(firstBtn)"></contextMenu>
-    <component
-      :is="componentId"
-      v-if="componentId"
-      :componentId="componentId"
-      :selectedRow="selectedRow"
-      :buyOrSell="BuyOrSell.Buy"
-      @cancel="closeComponent"
-    ></component>
-  </div>
+  <mtp-table-scroll>
+    <template #default="{ scroll }">
+      <a-table :columns="columns" class="srcollYTable halfBottom" :scroll="scroll" :pagination="false" :loading="loading" :customRow="Rowclick" :rowKey="(record, index) => index" :data-source="tableList">
+        <template #index="{ index }">
+          <span>{{ index + 1 }}</span>
+        </template>
+        <template #marginvalue="{ text }">
+          <span>{{ (text * 100).toFixed(2) + '%'}}</span>
+        </template>
+        <!-- 议价 -->
+        <template #canbargain="{ text }">
+          <span>{{ text ? '是' : '否' }}</span>
+        </template>
+        <!-- 整单 -->
+        <template #canpart="{ text }">
+          <span>{{ text === 1 ? '否' : '是' }}</span>
+        </template>
+        <!-- 挂牌有效期 -->
+        <template #validtime="{ text }">
+          <span>{{ formatTime(text, 'd') }}</span>
+        </template>
+      </a-table>
+    </template>
+  </mtp-table-scroll>
+  <!-- 右键 -->
+  <!-- <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="filterBtn(firstBtn)"></contextMenu> -->
+  <component :is="componentId" v-if="componentId" :componentId="componentId" :selectedRow="selectedRow" :buyOrSell="BuyOrSell.Buy" @cancel="closeComponent"></component>
 </template>
 
 <script lang="ts">
-import { EnumRouterName } from '@/common/constants/enumRouterName';
+import MtpTableScroll from '@/common/components/tableScroll/index.vue';
 import { queryTableList, contextMenu, defineAsyncComponent, defineComponent, ModalEnum, ComposeTableParam } from '@/common/export/commonTable';
 import { QueryOrderQuoteMyqQsp, QueryOrderQuoteMyqReq, QueryOrderQuoteReq, WrOrderQuote } from '@/services/go/wrtrade/interface';
 import { queryOrderQuote, queryQueryOrderQuoteMyq } from '@/services/go/wrtrade';
@@ -59,73 +44,74 @@ import { formatTime } from '@/common/methods';
 import Bus from '@/utils/eventBus/index';
 
 export default defineComponent({
-    name: 'warehouse_receipt_trade_blocs_buy',
-    components: {
-        contextMenu,
-        warehouse_receipt_trade_blocs_delisting: defineAsyncComponent(() => import('../delisting/index.vue')),
-        warehouse_receipt_trade_blocs_bargain_delisting: defineAsyncComponent(() => import('../delisting/index.vue')),
-        warehouse_receipt_trade_blocs_detail: defineAsyncComponent(() => import('@/views/market/market-spot/components/detail/index.vue')),
-    },
-    setup() {
-        const isBottom = getShowBottomValue();
-        // 表头
-        const { getBuyOrSellColumns } = handleColumns();
-        const columns = getBuyOrSellColumns(BuyOrSell.buy);
+  name: 'warehouse_receipt_trade_blocs_buy',
+  components: {
+    MtpTableScroll,
+    contextMenu,
+    warehouse_receipt_trade_blocs_delisting: defineAsyncComponent(() => import('../delisting/index.vue')),
+    warehouse_receipt_trade_blocs_bargain_delisting: defineAsyncComponent(() => import('../delisting/index.vue')),
+    warehouse_receipt_trade_blocs_detail: defineAsyncComponent(() => import('@/views/market/market-spot/components/detail/index.vue')),
+  },
+  setup() {
+    const isBottom = getShowBottomValue();
+    // 表头
+    const { getBuyOrSellColumns } = handleColumns();
+    const columns = getBuyOrSellColumns(BuyOrSell.buy);
 
-        // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<QueryOrderQuoteMyqQsp>();
-        // 获取列表数据
-        const queryTableAction = () => {
-            const param: QueryOrderQuoteMyqReq = {
-                buyorsell: BuyOrSell.buy,
-                haswr: 0,
-            };
-            queryTable(queryQueryOrderQuoteMyq, param);
-        };
-        // 表格通用逻辑
-        const param: ComposeTableParam = {
-            queryFn: queryTableAction,
-        };
-        const {
-            contextMenu,
-            openContext,
-            closeContext, // 右键
-            expandedRowKeys,
-            selectedRow,
-            Rowclick, // 表格折腾面板数据与单击、双击事件
-            componentId,
-            closeComponent,
-            openComponent, // 控制异步组件
-        } = handleComposeTable<QueryOrderQuoteMyqQsp>(param);
-        function search(value: Object) {
-            // const param: QueryOrderQuoteReq = {
-            //     wrpricetype: 2,
-            //     haswr: 1,
-            // };
-            // Object.assign(param, value);
-            // queryTable(queryOrderQuote, param);
-        }
-        // 单据挂牌成功 刷新数据
-        Bus.$on('spotTrade', queryTableAction);
-        return {
-            isBottom,
-            contextMenu,
-            openContext,
-            closeContext, // 右键
-            columns,
-            expandedRowKeys,
-            selectedRow,
-            Rowclick, // 表格折腾面板数据与单击、双击事件
-            componentId,
-            closeComponent, // 控制异步组件
-            loading,
-            tableList,
-            search,
-            formatTime,
-            filterBtn,
-            BuyOrSell,
-        };
-    },
+    // 表格列表数据
+    const { loading, tableList, queryTable } = queryTableList<QueryOrderQuoteMyqQsp>();
+    // 获取列表数据
+    const queryTableAction = () => {
+      const param: QueryOrderQuoteMyqReq = {
+        buyorsell: BuyOrSell.buy,
+        haswr: 0,
+      };
+      queryTable(queryQueryOrderQuoteMyq, param);
+    };
+    // 表格通用逻辑
+    const param: ComposeTableParam = {
+      queryFn: queryTableAction,
+    };
+    const {
+      contextMenu,
+      openContext,
+      closeContext, // 右键
+      expandedRowKeys,
+      selectedRow,
+      Rowclick, // 表格折腾面板数据与单击、双击事件
+      componentId,
+      closeComponent,
+      openComponent, // 控制异步组件
+    } = handleComposeTable<QueryOrderQuoteMyqQsp>(param);
+    function search(value: Object) {
+      // const param: QueryOrderQuoteReq = {
+      //     wrpricetype: 2,
+      //     haswr: 1,
+      // };
+      // Object.assign(param, value);
+      // queryTable(queryOrderQuote, param);
+    }
+    // 单据挂牌成功 刷新数据
+    Bus.$on('spotTrade', queryTableAction);
+    return {
+      isBottom,
+      contextMenu,
+      openContext,
+      closeContext, // 右键
+      columns,
+      expandedRowKeys,
+      selectedRow,
+      Rowclick, // 表格折腾面板数据与单击、双击事件
+      componentId,
+      closeComponent, // 控制异步组件
+      loading,
+      tableList,
+      search,
+      formatTime,
+      filterBtn,
+      BuyOrSell,
+    };
+  },
 });
 </script>
 <style lang="less">

+ 29 - 26
src/views/market/market-spot/warehouse_pre_sale/warehouse_pre_sale_designate/components/sell/index.vue

@@ -1,34 +1,36 @@
 <template>
   <!-- 仓单贸易 贸易圈挂牌 买-->
-  <div>
-    <a-table :columns="columns" :class="['srcollYTable', isBottom ? 'condSecondTabTableHalfTop' : 'condSecondTabTableHalfTopNoBottom',  tableList.length ? 'noPlaceHolder' : 'hasPlaceHolder']" :scroll="{ x: '100%', y: isBottom ? 'calc((100vh- 443px)/2 - 14px)' : 'calc((100vh - 196px)/2 - 16px)' }" :pagination="false" :loading="loading" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" rowKey="key" :data-source="tableList">
-      <template #index="{ index }">
-        <span>{{ index + 1 }}</span>
-      </template>
-      <template #marginvalue="{ text }">
-        <span>{{ (text * 100).toFixed(2) + '%'}}</span>
-      </template>
-      <!-- 议价 -->
-      <template #canbargain="{ text }">
-        <span>{{ text ? '是' : '否' }}</span>
-      </template>
-      <!-- 整单 -->
-      <template #canpart="{ text }">
-        <span>{{ text === 1 ? '否' : '是' }}</span>
-      </template>
-      <!-- 挂牌有效期 -->
-      <template #validtime="{ text }">
-        <span>{{ formatTime(text, 'd') }}</span>
-      </template>
-    </a-table>
-    <!-- 右键 -->
-    <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="filterBtn(firstBtn)"></contextMenu>
-    <component :is="componentId" v-if="componentId" :componentId="componentId" :selectedRow="selectedRow" :buyOrSell="BuyOrSell.sell" @cancel="closeComponent"></component>
-  </div>
+  <mtp-table-scroll>
+    <template #default="{ scroll }">
+      <a-table :columns="columns" class="srcollYTable condSecondTabTableHalfTop" :scroll="scroll" :pagination="false" :loading="loading" :customRow="Rowclick" :rowKey="(record, index) => index" :data-source="tableList">
+        <template #index="{ index }">
+          <span>{{ index + 1 }}</span>
+        </template>
+        <template #marginvalue="{ text }">
+          <span>{{ (text * 100).toFixed(2) + '%'}}</span>
+        </template>
+        <!-- 议价 -->
+        <template #canbargain="{ text }">
+          <span>{{ text ? '是' : '否' }}</span>
+        </template>
+        <!-- 整单 -->
+        <template #canpart="{ text }">
+          <span>{{ text === 1 ? '否' : '是' }}</span>
+        </template>
+        <!-- 挂牌有效期 -->
+        <template #validtime="{ text }">
+          <span>{{ formatTime(text, 'd') }}</span>
+        </template>
+      </a-table>
+    </template>
+  </mtp-table-scroll>
+  <!-- 右键 -->
+  <!-- <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="filterBtn(firstBtn)"></contextMenu> -->
+  <component :is="componentId" v-if="componentId" :componentId="componentId" :selectedRow="selectedRow" :buyOrSell="BuyOrSell.sell" @cancel="closeComponent"></component>
 </template>
 
 <script lang="ts">
-import { EnumRouterName } from '@/common/constants/enumRouterName';
+import MtpTableScroll from '@/common/components/tableScroll/index.vue';
 import { queryTableList, contextMenu, defineAsyncComponent, defineComponent, ModalEnum, ComposeTableParam } from '@/common/export/commonTable';
 import { QueryOrderQuoteMyqQsp, QueryOrderQuoteMyqReq, QueryOrderQuoteReq, WrOrderQuote } from '@/services/go/wrtrade/interface';
 import { queryOrderQuote, queryQueryOrderQuoteMyq } from '@/services/go/wrtrade';
@@ -44,6 +46,7 @@ import Bus from '@/utils/eventBus/index';
 export default defineComponent({
   name: 'warehouse_receipt_trade_blocs_sell',
   components: {
+    MtpTableScroll,
     contextMenu,
     warehouse_receipt_trade_blocs_delisting: defineAsyncComponent(() => import('../delisting/index.vue')),
     warehouse_receipt_trade_blocs_bargain_delisting: defineAsyncComponent(() => import('../delisting/index.vue')),

+ 33 - 38
src/views/market/market-spot/warehouse_pre_sale/warehouse_pre_sale_designate/index.vue

@@ -1,17 +1,12 @@
 <template>
   <!-- 仓单贸易 贸易圈挂牌-->
   <div class="topTableHeight">
-    <Filter :enumName="name"
-            @search="search"
-            @buy="buyOpen" />
-    <div>
+    <Filter :enumName="name" @search="search" @buy="buyOpen" />
+    <div class="topTableHeight__container">
       <Sell />
       <Buy />
     </div>
-    <component :is="componentId"
-               v-if="componentId"
-               :selectedRow="selectedRow"
-               @cancel="closeComponent"></component>
+    <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
   </div>
 </template>
 
@@ -27,36 +22,36 @@ import { ref } from 'vue';
 import Bus from '@/utils/eventBus';
 
 export default defineComponent({
-    name: EnumRouterName.warehouse_pre_sale_blocs,
-    components: {
-        Filter,
-        Buy,
-        Sell,
-        postBuying: defineAsyncComponent(() => import('./components/post-buying/index.vue')),
-    },
-    setup() {
-        const isBottom = getShowBottomValue();
-        const selectedRow = ref();
-        function queryFn() {
-            Bus.$emit('spotTrade', true);
-        }
-        // 控制异步组件
-        const { componentId, closeComponent } = handleModalComponent(queryFn, selectedRow);
-        function search() {}
-        function buyOpen(value: any) {
-            componentId.value = 'postBuying';
-            selectedRow.value = value;
-        }
-        return {
-            isBottom,
-            search,
-            buyOpen,
-            componentId,
-            closeComponent,
-            selectedRow,
-            name: EnumRouterName.warehouse_pre_sale_blocs,
-        };
-    },
+  name: EnumRouterName.warehouse_pre_sale_blocs,
+  components: {
+    Filter,
+    Buy,
+    Sell,
+    postBuying: defineAsyncComponent(() => import('./components/post-buying/index.vue')),
+  },
+  setup() {
+    const isBottom = getShowBottomValue();
+    const selectedRow = ref();
+    function queryFn() {
+      Bus.$emit('spotTrade', true);
+    }
+    // 控制异步组件
+    const { componentId, closeComponent } = handleModalComponent(queryFn, selectedRow);
+    function search() { }
+    function buyOpen(value: any) {
+      componentId.value = 'postBuying';
+      selectedRow.value = value;
+    }
+    return {
+      isBottom,
+      search,
+      buyOpen,
+      componentId,
+      closeComponent,
+      selectedRow,
+      name: EnumRouterName.warehouse_pre_sale_blocs,
+    };
+  },
 });
 </script>
 <style lang="less">