qiushang hace 1 año
padre
commit
228dce6f64
Se han modificado 2 ficheros con 25 adiciones y 18 borrados
  1. 3 1
      src/renderer/assets/css/home.scss
  2. 22 17
      src/renderer/components/home.vue

+ 3 - 1
src/renderer/assets/css/home.scss

@@ -60,6 +60,7 @@ div,p{
 .title {
   padding: 10px;
   font-size: 12px;
+  font-weight: 600;
   background-color: #eee;
 }
 
@@ -150,7 +151,8 @@ div,p{
 }
 
 .result-img {
-  max-width: 85%;
+  max-width: 50vh;
+  max-height: 50vh;
   align-items: center;
   margin: auto;
 }

+ 22 - 17
src/renderer/components/home.vue

@@ -206,7 +206,9 @@
 							</div>
 							<div class="show-img" style="position:relative;overflow: hidden;" v-loading="imgLoading">
 								<img v-if="menuIndex == '3'" @click="playVideo()" src="../assets/image/play.png" class="play-icon" />
+								<!-- <el-image class="result-img" :src="imgSrc" fit="scale-down"></el-image> -->
 								<img class="result-img" :src="imgSrc" />
+								
 							</div>
 						</div>
 						
@@ -1010,9 +1012,9 @@ export default {
 				}
 		
 				if (this.handleData.autoRename) {
-				    newPath = item.path.slice(0, lastIndex) + '_tty.' + suffix;
+				    newPath = item.path.slice(0, lastIndex) + '_xy.' + suffix;
 				    if (this.handleData.pathType == '2') {
-				    	newPath = this.handleData.newPath + separator + item.name.slice(0, item.name.lastIndexOf('.')) + '_tty.' + suffix;
+				    	newPath = this.handleData.newPath + separator + item.name.slice(0, item.name.lastIndexOf('.')) + '_xy.' + suffix;
 				    }
 				} else {
 					newPath = this.handleData.newPath + separator + item.name.slice(0, item.name.lastIndexOf('.')) + '.' +suffix;
@@ -1065,10 +1067,10 @@ export default {
 				newPath = this.handleData.newPath + "\/" + item.name;
 				
 				if (this.handleData.autoRename) {
-					newPath = item.path.slice(0, lastIndex) + '_tty.pdf';
+					newPath = item.path.slice(0, lastIndex) + '_xy.pdf';
 					if (this.handleData.pathType == '2') {
 						let lastIndex = item.name.lastIndexOf('.');
-						let newName = item.name.slice(0, lastIndex) + '_tty.pdf';
+						let newName = item.name.slice(0, lastIndex) + '_xy.pdf';
 						newPath = this.handleData.newPath + "\/" + newName;
 					}
 				}
@@ -1213,10 +1215,10 @@ export default {
 		
 				if(this.handleData.watermarkType == 1){ // 文字
 					if(os.platform == 'linux'){
-						customFont = await pdfDoc.embedFont(StandardFonts.Helvetica);
+						customFont = await pdfDoc.embedFont(StandardFonts.Helvetica, {subset: true});
 					}else{
 						let fontBuffer = await electronApi.fileStream(this.handleData.fonts);
-						customFont = await pdfDoc.embedFont(fontBuffer)
+						customFont = await pdfDoc.embedFont(fontBuffer, {subset: true})
 					}
 				}else if(this.handleData.watermarkType == 2){ // 图片
 					const buffer = await electronApi.fileStream(this.handleData.watermarkImgPath);  
@@ -1227,7 +1229,7 @@ export default {
 					}else if(this.handleData.watermarkImgType == 'pdf'){
 						imgSource = await pdfDoc.embedPdf(buffer);
 					}
-					customFont = await pdfDoc.embedFont(StandardFonts.Helvetica);
+					customFont = await pdfDoc.embedFont(StandardFonts.Helvetica, {subset: true});
 				}
 		
 				const rgbObj = this.getRgb();
@@ -1793,21 +1795,20 @@ export default {
 				let lastIndex = item.path.lastIndexOf('.');
 				newPath = item.path;
 				
-				if(this.handleData.pathType == '2'){ // 判断有无  文件夹
-					if(fs.existsSync(this.downloadDir + separator + pjson.softInfo.softName)){
-						this.handleData.newPath = this.downloadDir + separator + pjson.softInfo.softName;
-					} else {
-						fs.mkdirSync(this.downloadDir + separator + pjson.softInfo.softName);
-						this.handleData.newPath = this.downloadDir + separator + pjson.softInfo.softName;
-					}
-					newPath = this.handleData.newPath + "\/" + item.name;
+				
+				if(fs.existsSync(this.downloadDir + separator + pjson.softInfo.softName)){
+					this.handleData.newPath = this.downloadDir + separator + pjson.softInfo.softName;
+				} else {
+					fs.mkdirSync(this.downloadDir + separator + pjson.softInfo.softName);
+					this.handleData.newPath = this.downloadDir + separator + pjson.softInfo.softName;
 				}
+				newPath = this.handleData.newPath + "\/" + item.name;
 				
 				if (this.handleData.autoRename) {
-					newPath = item.path.slice(0, lastIndex) + '_tty.' + item.suffix;
+					newPath = item.path.slice(0, lastIndex) + '_xy.' + item.suffix;
 					if (this.handleData.pathType == '2') {
 						let lastIndex = item.name.lastIndexOf('.');
-						let newName = item.name.slice(0, lastIndex) + '_tty.' + item.suffix;
+						let newName = item.name.slice(0, lastIndex) + '_xy.' + item.suffix;
 						newPath = this.handleData.newPath + "\/" + newName;
 					}
 				}
@@ -2367,4 +2368,8 @@ export default {
 			opacity: 1;
 		}
 	}
+	
+	.el-upload-list{
+		display: none;
+	}
 </style>