From 4e3b0ffb433f6e331cd2eae93bcd874d41b8de84 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期四, 23 五月 2024 17:37:07 +0800
Subject: [PATCH] 解决标准库bug

---
 src/components/tool/value-table.vue |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/src/components/tool/value-table.vue b/src/components/tool/value-table.vue
index 5785a9d..57471ca 100644
--- a/src/components/tool/value-table.vue
+++ b/src/components/tool/value-table.vue
@@ -95,6 +95,12 @@
     align-items: center;
     justify-content: center;
   }
+  .el-table__empty-text{
+    text-align: left;
+    width: 100%;
+    display: inline-block;
+    margin-left: 200px;
+  }
 </style>
 
 <template>
@@ -156,7 +162,7 @@
         :total="total">
       </el-pagination>
     </div>
-    <el-dialog title="缂栬緫" :visible.sync="upDia" :width="data.row==1?'500px':500+data.row * 200 + 'px'" append-to-body>
+    <el-dialog title="缂栬緫" :visible.sync="upDia" :width="data.row==1?'500px':540+data.row * 200 + 'px'" append-to-body>
       <div class="body" style="max-height: 550px;overflow-y: auto;padding: 5px 10px 5px 0;">
         <div v-if="data.row > 1">
           <div v-for="(a, ai) in upHead" :key="ai" style="line-height: 50px;">
@@ -225,7 +231,7 @@
         <el-button type="primary" @click="saveUpData" :loading="upLoad">纭� 瀹�</el-button>
       </span>
     </el-dialog>
-    <el-dialog title="鏂板" :visible.sync="addDia" :width="data.row==1?'500px':500+data.row * 200 + 'px'" append-to-body>
+    <el-dialog title="鏂板" :visible.sync="addDia" :width="data.row==1?'500px':540+data.row * 200 + 'px'" append-to-body>
       <div class="body" v-if="addDia" style="max-height: 550px;overflow-y: auto;padding: 5px 10px 5px 0;">
         <div v-if="data.row > 1">
           <div v-for="(a, ai) in upHead" :key="ai" style="line-height: 50px;">
@@ -303,7 +309,7 @@
     <el-dialog title="鏁版嵁瀵煎叆" :visible.sync="uploadDia" width="500px">
       <div style="margin: 0 auto;">
         <el-upload ref="upload" drag :action="javaApi + inputUrl" :headers="token" :file-list="fileList" name="file"
-          :auto-upload="false" accept=".csv" :limit="1" :on-change="beforeUpload" :on-success="onSuccess"
+          :auto-upload="false" :accept="data.accept===undefined?'.csv':data.accept" :limit="1" :on-change="beforeUpload" :on-success="onSuccess"
           :on-error="onError" :data="{param: data.uploadStr}">
           <i class="el-icon-upload"></i>
           <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
@@ -558,14 +564,17 @@
       },
       sizeChange(val) {
         this.page.size = val
-        this.selectList()
+        this.selectList('page')
       },
       currentChange(val) {
         this.page.current = val
-        this.selectList()
+        this.selectList('page')
       },
-      selectList() {
+      selectList(val) {
         this.loading = true
+        if(val===undefined){
+          this.page.current = 1;
+        }
         if (this.data.isPage != undefined && this.data.isPage != true) {
           this.page = {
             current: -1,
@@ -587,6 +596,7 @@
           this.total = res.data.body.total
           this.tableHead = res.data.head
           this.tableData = res.data.body.records
+          // console.log(JSON.stringify(this.tableHead)+"---------"+JSON.stringify(this.tableData))
           for (var a in this.data.selectField) {
             if (this.data.selectField[a].choose == true) {
               this.tableData.map(b => {
@@ -954,7 +964,8 @@
         this.uploadDia = true
       },
       beforeUpload(file, fileList) {
-        if (file.raw.type != 'text/csv') {
+        console.log(file.raw.type);
+        if (file.raw.type != (this.data.inputType===undefined?'text/csv':this.data.inputType)) {
           this.$message.error('涓婁紶鏂囦欢鏍煎紡涓嶆纭�');
           this.$refs.upload.clearFiles()
           return false;

--
Gitblit v1.9.3