zhaoke 2 жил өмнө
parent
commit
ef2394431b
1 өөрчлөгдсөн 13 нэмэгдсэн , 19 устгасан
  1. 13 19
      src/views/upload/index.vue

+ 13 - 19
src/views/upload/index.vue

@@ -38,7 +38,7 @@
         <div class="manageTitle">{{ title2 }}</div>
         <div class="upload-header-right">
           <el-date-picker v-model="flightDate" size="small" type="daterange" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="dateRangePickerOptions" :clearable="false" />
-          <el-button class="btn-refresh" type="primary" icon="el-icon-refresh" @click="getTableData" />
+          <el-button class="btn-refresh" type="primary" icon="el-icon-refresh" @click="getStateData" />
         </div>
       </header>
       <main class="upload-main">
@@ -50,11 +50,11 @@
                   <div>{{ currDate(scope.row.thedate) }}</div>
                 </template>
               </el-table-column>
-              <el-table-column width="80" prop="total" label="次数"></el-table-column>
+              <el-table-column width="100" prop="total" label="次数"></el-table-column>
             </el-table>
           </div>
           <div v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" class="upload-main-content-right">
-            <el-table ref="table" :data="tableData" border stripe fit height="100%" class="upload-table" :cell-class-name="cellClass">
+            <el-table :data="tableData" border stripe fit height="100%" class="upload-table" :cell-class-name="cellClass">
               <el-table-column v-for="column in tableColumns" :key="column.key" :prop="column.prop" :label="column.prop">
                 <template slot-scope="scope">
                   <el-tooltip v-if="column.showTooltip" class="item" effect="dark" placement="top-start">
@@ -202,24 +202,18 @@ export default {
       }
     }
   },
-  watch: {
-    flightDate: {
-      handler () {
-        this.getTableData()
-      },
-      deep: true,
-      immediate: true,
-    },
-  },
+  // watch: {
+  //   flightDate: {
+  //     handler () {
+  //       this.getTableData()
+  //     },
+  //     deep: true,
+  //     immediate: true,
+  //   },
+  // },
   created () {
     this.getStateData()
   },
-  updated () {
-    // table数据更新
-    this.$nextTick(() => {
-      this.$refs.table?.doLayout()
-    })
-  },
   methods: {
     beforeUpload (file) {
       const progress = this.getProgress(file)
@@ -303,6 +297,7 @@ export default {
         }
         this.$message.success(`${file.name} 上传成功`)
         this.setState(file, 1)
+        this.getStateData()
       } catch (error) {
         this.$message.error(`${file.name} 上传失败`)
         this.setState(file, 2)
@@ -433,7 +428,6 @@ export default {
       }
       &-right {
         flex: 1;
-        width: calc(100% - 350px);
       }
     }
   }