浏览代码

用印上传附件增加word格式

jwyu 3 年之前
父节点
当前提交
1c7166995e
共有 3 个文件被更改,包括 23 次插入2 次删除
  1. 8 1
      pages-approve/seal/addSeal.vue
  2. 15 1
      pages-approve/seal/detail.vue
  3. 二进制
      pages-approve/static/word.png

+ 8 - 1
pages-approve/seal/addSeal.vue

@@ -230,7 +230,7 @@
 
 			//预览文件
 			handlePreviewFiles(e){
-				if (e.type === "pdf") {
+				if (e.type === "pdf"||e.type==='word') {
 					preViewFile(e.url)
 				} else {
 					uni.previewImage({
@@ -243,12 +243,19 @@
 			async handleUpload(){
 				const res=await uploadFiles({type:'all'})
 				const reg = /\.(pdf)$/;
+				const reg2=	/\.doc|\.docx$/
 				if(reg.test(res[0])){
 					this.file={
 						type:'pdf',
 						url:res[0],
 						img:require('../static/pdf.png')
 					}
+				}else if(reg2.test(res[0])){
+					this.file={
+						type:'word',
+						url:res[0],
+						img:require('../static/word.png')
+					}
 				}else{
 					this.file={
 						type:'img',

+ 15 - 1
pages-approve/seal/detail.vue

@@ -246,12 +246,19 @@
 			async handleUpload(){
 				const res=await uploadFiles({type:'all'})
 				const reg = /\.(pdf)$/;
+				const reg2=	/\.doc|\.docx$/
 				if(reg.test(res[0])){
 					this.files={
 						type:'pdf',
 						url:res[0],
 						img:require('../static/pdf.png')
 					}
+				}else if(reg2.test(res[0])){
+					this.files={
+						type:'word',
+						url:res[0],
+						img:require('../static/word.png')
+					}
 				}else{
 					this.files={
 						type:'img',
@@ -427,7 +434,7 @@
 			
 			//预览文件
 			handlepreViewFile(e){
-				if (e.type === "pdf") {
+				if (e.type === "pdf"||e.type==='word') {
 					preViewFile(e.url)
 				} else {
 					uni.previewImage({
@@ -534,12 +541,19 @@
 			//处理文件
 			handleFile(filesUrl){
 				const reg = /\.(pdf)$/;
+				const reg2=	/\.doc|\.docx$/
 				if(reg.test(filesUrl)){
 					this.files={
 						type: "pdf",
 						url: filesUrl,
 						img: require("../static/pdf.png"),
 					}
+				}else if(reg2.test(filesUrl)){
+					this.files={
+						type: "word",
+						url: filesUrl,
+						img: require("../static/word.png"),
+					}
 				}else{
 					this.files={
 						type: "img",

二进制
pages-approve/static/word.png