Selaa lähdekoodia

价格 样式修改

xiao547607 4 vuotta sitten
vanhempi
commit
3cfc7efd56
1 muutettua tiedostoa jossa 33 lisäystä ja 23 poistoa
  1. 33 23
      src/views/bus/routeInfo-price-list.vue

+ 33 - 23
src/views/bus/routeInfo-price-list.vue

@@ -12,21 +12,21 @@
     <el-divider></el-divider>
     <el-row class="button-group">
       <el-button
-          type="primary"
-          size="small"
-          icon="ios-search"
-          @click="changePage()"
-          :loading="loading"
-          >刷新</el-button
-        >
-        <el-button
-          type="primary"
-          size="small"
-          icon="ios-search"
-          @click="editPrice()"
-          :loading="loading"
-          >编辑</el-button
-        >
+        type="primary"
+        size="small"
+        icon="ios-search"
+        @click="changePage()"
+        :loading="loading"
+        >刷新</el-button
+      >
+      <el-button
+        type="primary"
+        size="small"
+        icon="ios-search"
+        @click="editPrice()"
+        :loading="loading"
+        >编辑</el-button
+      >
       <el-button
         type="primary"
         size="small"
@@ -42,12 +42,14 @@
         icon="el-icon-download"
         :loading="xlsLoading"
         @click="downloadAll"
-      >导出数据</el-button>
+        >导出数据</el-button
+      >
     </el-row>
     <el-table
       :data="tableData"
-      style="min-height: 400px"
       v-loading="loading"
+      ref="formTable"
+      :height="tableHeight"
       stripe
       @selection-change="handleSelectionChange"
     >
@@ -133,7 +135,6 @@
       :routeId="routeId"
       @close="onDetailModalClose"
     ></routeInfo-price-detail>
-    
   </div>
 </template>
 <script>
@@ -144,6 +145,7 @@ import shiftInfoApi from "@/api/bus/shiftInfo";
 
 import passengerInfoApi from "@/api/bus/passengerInfo";
 import priceInfoApi from "@/api/bus/priceInfo";
+import pageUtil from "@/utils/page";
 
 import { getToken } from "@/utils/auth"; // get token from cookie
 export default {
@@ -173,17 +175,18 @@ export default {
       showDialog: true,
       stationPriceColumns: [],
       batchImportVisible: false,
-      routeId:"",
+      routeId: "",
       uploadUrlXls: Constant.serverUrl + "/bus/priceInfo/importXls",
       uploadXlsData: {
         subFolder: "driver",
-        routeId:""
+        routeId: "",
       },
       headers: {
         Authorization: getToken(),
       },
-      batchImportFileList:[],
-      xlsLoading:false,
+      batchImportFileList: [],
+      xlsLoading: false,
+      tableHeight: 400,
     };
   },
   methods: {
@@ -205,6 +208,13 @@ export default {
           var jsonData = response.data;
           self.tableData = jsonData.stationInfoList;
           self.stationPriceColumns = jsonData.stationPriceColumns;
+
+          setTimeout(() => {
+            console.log(self.$refs.formTable.$el.offsetTop);
+            self.tableHeight = pageUtil.autoAdjustHeight(
+              self.$refs.formTable.$el
+            );
+          }, 1000);
         })
         .catch((error) => {
           self.loading = false;
@@ -328,7 +338,7 @@ export default {
     this.routeId = routeId;
     this.changePage();
   },
-  
+
   components: {
     "routeInfo-price-detail": priceDetail,
   },