Browse Source

重新配置兼容文件

306132416@qq.com 4 years ago
parent
commit
a42f00c9e0

+ 2 - 2
src/views/data/UploadInfor.vue

@@ -143,7 +143,7 @@
     <div class="uploadFile">
       <p class="title">附件</p>
       <label for="fileInput" @change="getFileInfo($event)"
-        >导入<input type="file" ref="referenceUpload" name="fileName" id="fileInput" multiple 
+        >导入<input type="file" ref="referenceUpload" name="fileName" id="fileInput" multiple
       /></label>
       <div class="fileDes">
         <p v-for="(item, index) in fileDes" :key="index"
@@ -414,7 +414,7 @@ export default {
     // 获取文件,文件名
     getFileInfo: function (event) {
       let file = event.target.files;
-      file.forEach((item) => {
+      Array.from(file).forEach((item) => {
         this.file.push(item);
         this.fileDes.push(item.name);
       });

+ 2 - 2
src/views/data/UploadLink.vue

@@ -497,7 +497,7 @@ export default {
       this.file = [];
       let file = event.target.files;
       let fileDes = [];
-      file.forEach((item) => {
+      Array.from(file).forEach((item) => {
         fileDes.push(item.name);
         this.file.push(item);
       });
@@ -749,7 +749,7 @@ export default {
     this.userId = localStorage.getItem("userId");
     this.pageRefresh();
   },
- 
+
 };
 </script>
 

+ 3 - 3
src/views/notification/editPage/editPage.vue

@@ -105,7 +105,7 @@ export default {
       this.checkName();
       if(this.contentParam.area.length === 0){
         alert('请选择地区')
-        return; 
+        return;
       }
       if (!this.tipFlag) {
         if (id) {
@@ -188,7 +188,7 @@ export default {
     // 获取文件,文件名
     getFileInfo: function (event) {
       let file = event.target.files;
-      file.forEach((item) => {
+      Array.from(file).forEach((item) => {
         this.file.push(item);
         this.contentParam.files.push(item);
       });
@@ -261,7 +261,7 @@ export default {
         this.tipText = "标题不能为空";
         this.tipFlag = true;
         return;
-      } 
+      }
       // else if (include >= 0 && !this.noticeId) {
       //   this.tipText = "资料名称不能重复,请重新输入";
       //   this.tipFlag = true;