浏览代码

pssr 附件

jiangbiao 2 月之前
父节点
当前提交
acaf6e1579
共有 1 个文件被更改,包括 9 次插入6 次删除
  1. 9 6
      ui/src/views/pssr/file/index.vue

+ 9 - 6
ui/src/views/pssr/file/index.vue

@@ -20,7 +20,7 @@
 </template>
 
 <script>
-import {delFile} from "@/api/pssr/file";
+import {delFile, listFile} from "@/api/pssr/file";
 import {getToken} from "@/utils/auth";
 
 export default {
@@ -41,12 +41,15 @@ export default {
   methods: {
     init(subId, forShort, itemId, fileList) {
       this.open = true;
-      this.fileList = fileList;
       this.uploadKey = Date.now();
-      this.fileList.forEach(item => {
-        item.url = process.env.VUE_APP_BASE_API + item.fileUrl;
-        item.name = item.fileName;
-      });
+      this.fileList=[]
+      listFile({subId:subId,forShort:forShort,itemId:itemId}).then(res=>{
+        this.fileList=res.rows;
+        this.fileList.forEach(item => {
+          item.url = process.env.VUE_APP_BASE_API + item.fileUrl;
+          item.name = item.fileName;
+        });
+      })
       this.action = process.env.VUE_APP_BASE_API + "/pssr/file/uploadFile?subId=" + subId + "&itemId=" + itemId
         + "&forShort=" + forShort
     },