Quellcode durchsuchen

模具文档删除接口

Reiskuchen vor 5 Jahren
Ursprung
Commit
d6b2ac6635

+ 15 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/controller/MouldFileController.java

@@ -101,7 +101,7 @@ public class MouldFileController {
     }
 
     /**
-     * 项目文档的下载
+     * 模具文档的下载
      * 参数: token 用户身份凭证,id 项目id
      *
      * @return
@@ -113,5 +113,19 @@ public class MouldFileController {
         HttpRespMsg msg = mouldFileService.dowloadFile(mouldFile,token);
         return msg;
     }
+
+    /**
+     * 模具文档的删除
+     * 参数: id 文档id
+     *
+     * @return
+     */
+    @ApiOperation("项目文档的删除")
+    @RequestMapping("/delFile")
+    @ResponseBody
+    public HttpRespMsg delFile(MouldFile mouldFile){
+        HttpRespMsg msg = mouldFileService.delFile(mouldFile);
+        return msg;
+    }
 }
 

+ 1 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/service/MouldFileService.java

@@ -21,4 +21,5 @@ public interface MouldFileService extends IService<MouldFile> {
     HttpRespMsg dowloadFile(MouldFile projectFile, String token);
     HttpRespMsg getAllFileList(int mouldId, UserVO userVO);
     HttpRespMsg getFileList(int mouldId, Integer blongType, UserVO userVO);
+    HttpRespMsg delFile(MouldFile mouldFile);
 }

+ 7 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldFileServiceImpl.java

@@ -192,4 +192,11 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
         msg.data = list;
         return msg;
     }
+
+    @Override
+    public HttpRespMsg delFile(MouldFile mouldFile) {
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.data = mouldFileMapper.deleteById(mouldFile.getId());
+        return msg;
+    }
 }

+ 10 - 9
ys_vue/src/views/mold/moldDetail.vue

@@ -91,7 +91,7 @@
               :data="documents.mould"
               highlight-current-row
               v-loading="listLoading"
-              style="width: 100%;height:300px;"
+              style="width: 100%;"
             >
               <el-table-column type="index" width="40"></el-table-column>
               <el-table-column prop="fileName" label="名称" sortable></el-table-column>
@@ -107,7 +107,7 @@
               <el-table-column label="操作" width="200" sortable>
                 <template slot-scope="scope">
                   <el-button size="small" @click="checkOpen(scope.row.id, scope.row.fileName)">审批</el-button>
-                  <a :href="scope.row.fileUrl">
+                  <a :href="scope.row.fileUrl" :download="scope.row.fileName">
                     <el-button size="small" @click="download(scope.row.id)">下载</el-button>
                   </a>
                   <el-button size="small" type="danger">删除</el-button>
@@ -122,7 +122,7 @@
               :data="documents.part"
               highlight-current-row
               v-loading="listLoading"
-              style="width: 100%;height:300px;"
+              style="width: 100%;"
             >
               <el-table-column type="index" width="40"></el-table-column>
               <el-table-column prop="fileName" label="名称" sortable></el-table-column>
@@ -152,7 +152,7 @@
               :data="documents.check"
               highlight-current-row
               v-loading="listLoading"
-              style="width: 100%;height:300px;"
+              style="width: 100%;"
             >
               <el-table-column type="index" width="40"></el-table-column>
               <el-table-column prop="fileName" label="名称" sortable></el-table-column>
@@ -182,7 +182,7 @@
               :data="documents.maintain"
               highlight-current-row
               v-loading="listLoading"
-              style="width: 100%;height:300px;"
+              style="width: 100%;"
             >
               <el-table-column type="index" width="40"></el-table-column>
               <el-table-column prop="fileName" label="名称" sortable></el-table-column>
@@ -212,7 +212,7 @@
               :data="documents.update"
               highlight-current-row
               v-loading="listLoading"
-              style="width: 100%;height:300px;"
+              style="width: 100%;"
             >
               <el-table-column type="index" width="40"></el-table-column>
               <el-table-column prop="fileName" label="名称" sortable></el-table-column>
@@ -242,7 +242,7 @@
               :data="documents.abandon"
               highlight-current-row
               v-loading="listLoading"
-              style="width: 100%;height:300px;"
+              style="width: 100%;"
             >
               <el-table-column type="index" width="40"></el-table-column>
               <el-table-column prop="fileName" label="名称" sortable></el-table-column>
@@ -274,7 +274,7 @@
         :data="operations"
         highlight-current-row
         v-loading="listLoading"
-        style="width: 100%;height:300px;"
+        style="width: 100%;"
       >
         <el-table-column type="index" width="40"></el-table-column>
         <el-table-column prop="name" label="姓名" width="400" sortable></el-table-column>
@@ -442,7 +442,7 @@ export default {
     },
     //下载文件
     download(id) {
-      console.log(id + "被下载啦");
+      console.log(id + "被下载啦"); //这里应该有下载记录
     },
     //文件上传
     uploadFile(params) {
@@ -450,6 +450,7 @@ export default {
       var form = new FormData();
       form.append("file", fileObj);
       form.append("blongType", this.activeTab);
+      form.append("mouldId", this.detailId);
       this.http.uploadFile(
         this.port.mold.moldFileUpload,
         form,