YangJian0701 il y a 1 an
Parent
commit
071ebdc077
2 fichiers modifiés avec 54 ajouts et 2 suppressions
  1. 42 0
      src/components/yFiles.vue
  2. 12 2
      src/views/ValidationTemplate/index.vue

+ 42 - 0
src/components/yFiles.vue

@@ -0,0 +1,42 @@
+<template>
+	<div class="files-mai">
+		<div class="files-mai-pir">
+			<div class="files-mai1">
+				<img src="@/assets/img/flies.png" alt="" srcset="">
+				<div>点击虚线框内,<span style="color: #409EFF;">上传文件</span></div>
+			</div>
+			<div class="el-upload__tip" slot="tip">只能上传doc/docx文件,不支持上传其他类型文件</div>
+		</div>
+		<input type="file" accept=".doc, .docx" style="position: absolute;left: 0;top: 0;width: 100%;height: 100%;opacity:0;cursor: pointer;">
+	</div>
+</template>
+
+<script>
+</script>
+
+<style lang="scss">
+	.files-mai {
+		border: 1px dashed #d9d9d9;
+		border-radius: 6px;
+		position: relative;
+		height: 150px;
+		.files-mai-pir{
+			height: 100%;
+			.files-mai1 {
+				height: 100%;
+				color: #606266;
+				font-size: 14px;
+				text-align: center;
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				justify-content: center;
+			
+				img {
+					width: 60px;
+					height: 60px;
+				}
+			}
+		}
+	}
+</style>

+ 12 - 2
src/views/ValidationTemplate/index.vue

@@ -192,7 +192,7 @@
 						  ref="uploadFile"
 						  class="upload-demo"
 						  drag
-						  action="http://coldverifylocal.coldbaozhida.com/GenerateReport/upload"
+						  action="https://coldverifylocal.coldbaozhida.com/GenerateReport/upload"
 						  :auto-upload='false'
 						  accept=".doc, .docx"
 						  :on-success="successFun"
@@ -202,6 +202,7 @@
 						  <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
 						  <div class="el-upload__tip" slot="tip">只能上传doc/docx文件,不支持上传其他类型文件</div>
 						</el-upload>
+						<!-- <yfile></yfile> -->
 						<el-button type="primary" @click="submit" style="margin: 50px auto 0 auto;">立即提交</el-button>
 					</div>
 				</el-drawer>	
@@ -245,9 +246,11 @@
 		PDFToken
 	} from "@/api/pdfToken.js";
 	import files from "@/components/files"
+	import yfile from "@/components/yFiles"
+	import axios from "axios"
 	export default {
 		name: 'ValidationTemplate',
-		components:{files},
+		components:{files,yfile},
 		filters:{
 			lableData(e){
 				const resIt = arrLabel.find(item=>{
@@ -344,6 +347,13 @@
 				console.log('上传失败1',err)
 			},
 			submit(){
+				// axios.post({
+				// 	url:'http://coldverifylocal.coldbaozhida.com/GenerateReport/upload'
+				// }).then(function (response) {
+				//     console.log('上传',response);
+				// }).catch(function (error) {
+				//     console.log(error);
+				// });
 				this.$refs.uploadFile.submit();
 			},
 			errorFun(err){