Jelajahi Sumber

文件删除

lkk 5 bulan lalu
induk
melakukan
32104fec49

+ 8 - 2
src/api/ghss/hgxfx.js

@@ -10,8 +10,8 @@ const hgxfxApi = {
     ShapeUpload: '/file/upload/geom',
     ShapeUploadV1: '/file/upload/geom/v1',
     GetLog: '/apply/hgxfx/GetLog',
-    AddHgxfxV1:'/apply/hgxfx/AddHgxfxV1',
-    FileList:'/apply/gdbh/jctb/file/list'
+    AddHgxfxV1: '/apply/hgxfx/AddHgxfxV1',
+    FileList: '/apply/gdbh/jctb/file/list'
 }
 
 /**
@@ -180,4 +180,10 @@ export function FileList(parameter) {
             'Content-Type': 'application/json;charset=UTF-8'
         }
     })
+}
+export function deletFile(id) {
+    return request({
+        url: `/apply//gdbh/jctb/file/${id}`,
+        method: 'delete',
+    })
 }

+ 24 - 7
src/views/farmlandProtection/components/exportFile.vue

@@ -29,7 +29,6 @@
         ref="singleTable"
         :data="tableData"
         highlight-current-row
-        @current-change="handleCurrentChange"
         style="width: 100%"
       >
         <el-table-column type="index" label="序号" width="50">
@@ -50,6 +49,13 @@
             <span v-else>导入失败</span>
           </template>
         </el-table-column>
+        <el-table-column label="操作" width="60">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="handleDel(scope.row)"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
       </el-table>
       <el-pagination
         @size-change="handleSizeChange"
@@ -80,13 +86,13 @@
 </template>
 
 <script>
-import { ShapeUploadV1, FileList } from "@/api/ghss/hgxfx.js";
+import { ShapeUploadV1, FileList, deletFile } from "@/api/ghss/hgxfx.js";
 export default {
   components: {},
   data() {
     return {
       pageNum: 1,
-      pageSize: 2,
+      pageSize: 5,
       total: 0,
       showExp: true,
       fileList: [], //文件
@@ -143,6 +149,17 @@ export default {
         }
       });
     },
+    handleDel(row) {
+      deletFile(row.id).then((res) => {
+        if (res.code == 200) {
+          this.$message({
+            message: "删除成功成功!",
+            type: "success",
+          });
+          this.init();
+        }
+      });
+    },
   },
   watch: {},
   watch: {},
@@ -177,9 +194,9 @@ export default {
 .bodyCon {
   height: 36vh;
   /deep/ .el-pagination button:disabled {
-        color: #fff;
-        background-color: rgba(75, 185, 250, 0.2) !important;
-        cursor: not-allowed;
-    }
+    color: #fff;
+    background-color: rgba(75, 185, 250, 0.2) !important;
+    cursor: not-allowed;
+  }
 }
 </style>

+ 1 - 1
src/views/farmlandProtection/jctb/index.vue

@@ -125,7 +125,7 @@
     <el-dialog
       title="选择图斑"
       :visible.sync="dialogVisible"
-      width="40%"
+      width="45%"
       :before-close="handleClose"
       :modal-append-to-body="false"
       :close-on-click-modal="false"