| 
					
				 | 
			
			
				@@ -4,10 +4,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       :action="action" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       :listType="listType" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       :fileList="fileList" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      :disabled="disabled" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       @preview="handlePreview" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       @change="handleChange" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       :beforeUpload="beforeUpload" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      :preview-file="previewFile" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       :data="params" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       :value="comVal" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     > 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -57,7 +57,7 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     upText: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       type: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      default: '上传' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      default: '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     value: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       type: String 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -66,14 +66,21 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       type: Object, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       default: function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          savePathType: 'ali' // 存储类型 local 服务器本地,ali 阿里云 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          savePathType: 'ali' // 存储类型 local 服务器本地,ali 阿里云, web 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    disabled: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      type: Boolean, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      default: false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    uploadType: { //  上传类型  img图片;attach附件;import导入 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      type: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      default: 'img' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   watch: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     value (a, b) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      console.log(a, '=--====') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.comVal = a || '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (a == undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.fileList = [] 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -93,19 +100,37 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     setFileList (a) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       const temp = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (a && a.length > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        a.split(',').map((item, index) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          if (item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            temp.push({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              uid: index, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              name: item, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              status: 'done', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              url: item, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              response: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                data: item 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (this.uploadType == 'img') { // 图片 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          a.split(',').map((item, index) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              temp.push({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                uid: index, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                name: item, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                status: 'done', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                url: item, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                response: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  data: item 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else if (this.uploadType == 'attach') { // 附件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          a.map((item, index) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              temp.push({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                uid: index, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                name: item.fileName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                status: 'done', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                url: item.filePath, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                response: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  data: item 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else if (this.uploadType == 'import') { // 导入 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.fileList = temp 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -116,39 +141,51 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (this.listType == 'text') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      console.log(file, '8888888888') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.previewImage = file.url || file.thumbUrl 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      // this.previewImage = file.response.data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.previewVisible = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     handleChange ({ file, fileList }) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      if (file.status == 'error') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // console.log(file, fileList, '-----change') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (file.status == 'error' || (file.response && (file.response.status == 500))) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.$message.error('上传失败,请重试!') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.fileList = this.validaFile(file, fileList) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.$emit('change', this.formatFile()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$emit('input', this.formatFile()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 格式化文件列表数据,给表单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     formatFile () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       const a = this.fileList 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      const temp = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      let temp = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      let obj = null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (a && a.length) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        a.map(item => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          if (item.response && item.status == 'done') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            temp.push(item.response.data) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (this.uploadType == 'img') { // 图片    将接口的返回图片地址逗号拼接后返回页面 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          a.map(item => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (item.response && item.status == 'done') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              temp.push(item.response.data) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          obj = temp.join(',') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else if (this.uploadType == 'attach') { // 附件    将接口的返回数据返回页面 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          a.map(item => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (item.response && item.status == 'done') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              temp = [...temp, ...item.response.data] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          obj = JSON.stringify(temp) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else if (this.uploadType == 'import') { // 导入 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      return temp.join(',') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      return obj 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 文件校验 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     validaFile (file, filesList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (filesList.length == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      console.log(file, filesList, this.beforeUpload(file, 0)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // console.log(file, filesList, this.beforeUpload(file, 0)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (!this.beforeUpload(file, 0) && file.status != 'removed') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         const index = filesList.findIndex(item => item.uid == file.uid) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         filesList.splice(index, 1) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -192,10 +229,12 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   .upload-file{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     float: left; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     overflow: hidden; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    height: 80px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /* you can make up upload button and sample style by using stylesheets */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     .ant-upload-select-picture-card i { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       font-size: 32px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       color: #999; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      margin-top: 9px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     .ant-upload-select-picture-card .ant-upload-text { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       margin-top: 8px; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -207,11 +246,16 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         padding: 4px 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    .ant-upload-list-picture-card-container{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      height: 80px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      width: 80px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     .ant-upload.ant-upload-select-picture-card, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     .ant-upload-list-picture-card .ant-upload-list-item{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       width:80px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       height:80px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       padding: 4px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      margin: 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     .ant-upload-list-item-info{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       padding: 0 22px 0 4px; 
			 |