qiushang 1 year ago
parent
commit
25d438d5b0

BIN
bin/pdf-bg.png


+ 2 - 2
src/renderer/assets/css/home.scss

@@ -94,7 +94,7 @@ div,p{
 		content: '';
 		position: absolute;
 		height: 1px;
-		width: 30%;
+		width: 20%;
 		background-color: #eee;
 		top: 0;
 		left: 0;
@@ -106,7 +106,7 @@ div,p{
 		content: '';
 		position: absolute;
 		height: 1px;
-		width: 30%;
+		width: 20%;
 		background-color: #eee;
 		top: 0;
 		right: 0;

BIN
src/renderer/assets/image/bg.png


BIN
src/renderer/assets/image/play.png


+ 56 - 27
src/renderer/components/home.vue

@@ -204,6 +204,7 @@
 								 @click="refreshVideo()" v-if="menuIndex == '3'">点击刷新预览</el-button>
 							</div>
 							<div class="show-img" style="position:relative;overflow: hidden;" v-loading="imgLoading">
+								<!-- <img src="../assets/image/play.png" /> -->
 								<img @click="menuIndex == '3' ? playVideo() : ''" class="result-img" :src="imgSrc" />
 							</div>
 						</div>
@@ -350,7 +351,7 @@
 								<!-- 多个水印 -->
 								<template v-if="this.menuIndex == '2' && this.handleData.watermarkType == '2' && this.handleData.watermarkStyle == 3" >
 									<div v-for="(item, index) in watermarkImgList" :key="index">
-										<div class="handle-title">第{{index+2}}张水印信息 <Button size="small" type="error" @click="delWatermark(index)">删除</Button></div>
+										<div class="handle-title">第{{index+2}}张水印信息 <el-button type="danger" size="mini" @click="delWatermark(index)">删除</el-button></div>
 										<div class="handle-item" @click="waterMoreIndex = index">
 											<label class="handle-label">上传图片:</label>
 											<el-upload :style="{display: 'inline-block'}" action="/" :before-upload="getImgPathMore">
@@ -486,7 +487,7 @@ export default {
 				scaling: 100, // 水印缩放比例
 				watermarkPosition: 'Center', // 水印位置
 				fonts: 'c:\\windows\\fonts\\simkai.ttf',
-				rotate: 30,
+				rotate: 0,
 				direction:'0',
 				speed: 2,
 			},
@@ -598,6 +599,36 @@ export default {
 			}
 			electronApi.call('showItemInfolder',[path+'\\xy.xy'])
 		},
+		delWatermark(index){
+			this.$confirm('确认要删除该水印图片吗?', '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				this.watermarkImgList.splice(index, 1);
+			}).catch(() => {
+			});
+		},
+		// 再添加一张水印图片
+		moreImgWater(){
+			if(this.watermarkImgList.length >= 8){
+				this.$message.error("水印图片已达上限!");
+				return false;
+			}
+			let waterInfo = {
+				width: 0,
+				height: 0,
+				watermarkX: 0,
+				watermarkY: 0,
+				watermarkImgPath: '', //图片水印路径
+				watermarkImgType: '', //图片水印类型
+				watermarkImgOpactiy: 100, // 水印不透明度
+				scaling: 100, // 水印缩放比例
+				watermarkPosition: 'Center', // 水印位置
+				rotate: 0
+			};
+			this.watermarkImgList.push(waterInfo);
+		},
 		// 删除列表文件
 		delFile(index, event){
 			event.$event.stopPropagation();
@@ -775,7 +806,7 @@ export default {
 				// 取视频的第1帧
 				await this.dealVideo(index, info, tmpVideoPreviewPath, true).then(async (re) =>{
 					await electronApi.spawnExec(['ffmpeg.exe','-i', tmpVideoPreviewPath, '-vframes', 1, '-ss', '0:0:01', '-an', '-vcodec', 'png', '-f', 'rawvideo',imgPath, '-hide_banner','-y']).then((result) => {
-						console.log(result,'imgPathimgPath')
+						console.log(result, 'imgPathimgPath')
 					})
 				}).catch(err =>{
 					this.$message({message: '预览出现错误!', type: 'warning'});
@@ -965,12 +996,12 @@ export default {
 			
 				newPath = item.path;
 				
-				if(this.handleData.pathType == '2'){ // 自定义文件架判断有无 优速水印工厂 文件夹
-					if(fs.existsSync(this.downloadDir + separator + "优速水印工厂")){
-						this.handleData.newPath = this.downloadDir + separator + "优速水印工厂";
+				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 + "优速水印工厂");
-						this.handleData.newPath = this.downloadDir + separator + "优速水印工厂";
+						fs.mkdirSync(this.downloadDir + separator + pjson.softInfo.softName);
+						this.handleData.newPath = this.downloadDir + separator + pjson.softInfo.softName;
 					}
 				} else {
 					newPath = item.path.slice(0, lastIndex);
@@ -1024,15 +1055,13 @@ export default {
 				let lastIndex = item.path.lastIndexOf('.');
 				newPath = item.path;
 				
-				if(this.handleData.pathType == '2'){ // 判断有无 “优速水印工厂” 文件夹
-					if(fs.existsSync(this.downloadDir + separator + "优速水印工厂")){
-						this.handleData.newPath = this.downloadDir + separator + "优速水印工厂";
-					} else {
-						let a = fs.mkdirSync(this.downloadDir + separator + "优速水印工厂");
-						this.handleData.newPath = this.downloadDir + separator + "优速水印工厂";
-					}
-					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 {
+					let a = 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.pdf';
@@ -1250,7 +1279,7 @@ export default {
 						// 系统水印
 						if (this.$refs.headerRef.authority.isAuthority) {
 						}else{ // 系统水印
-							let from = 'from:https://www.yososoft.com';
+							let from = 'from:https://www.xingyousoft.com';
 							item.drawText(from, {
 								x: pdfInfo.width/2 - (from.length*0.5*20)/2, // 出现的 x 轴坐标
 								y: pdfInfo.height/2, // 出现的 y 轴坐标
@@ -1326,7 +1355,7 @@ export default {
 						// 系统水印
 						if (this.$refs.headerRef.authority.isAuthority) {
 						}else{ // 系统水印
-							let from = 'from:https://www.yososoft.com';
+							let from = 'from:https://www.xingyousoft.com';
 							item.drawText(from, {
 								x: pdfInfo.width/2 - (from.length*0.5*20)/2, // 出现的 x 轴坐标
 								y: pdfInfo.height/2, // 出现的 y 轴坐标
@@ -1528,7 +1557,7 @@ export default {
 					'-alpha', 'set', '-channel', 'A', '-evaluate', 'Multiply', this.handleData.watermarkImgOpactiy/100, '+channel', // 透明度
 					'-rotate', 
 					this.handleData.rotate ? this.handleData.rotate : 0,
-					'label:' + (this.handleData.watermarkValue ? this.handleData.watermarkValue : '优速水印工厂'),
+					'label:' + (this.handleData.watermarkValue ? this.handleData.watermarkValue : pjson.softInfo.softName),
 					'-gravity', 
 					'center',
 					'-extent',
@@ -1763,12 +1792,12 @@ export default {
 				let lastIndex = item.path.lastIndexOf('.');
 				newPath = item.path;
 				
-				if(this.handleData.pathType == '2'){ // 判断有无 “优速水印工厂” 文件夹
-					if(fs.existsSync(this.downloadDir + separator + "优速水印工厂")){
-						this.handleData.newPath = this.downloadDir + separator + "优速水印工厂";
+				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 + "优速水印工厂");
-						this.handleData.newPath = this.downloadDir + separator + "优速水印工厂";
+						fs.mkdirSync(this.downloadDir + separator + pjson.softInfo.softName);
+						this.handleData.newPath = this.downloadDir + separator + pjson.softInfo.softName;
 					}
 					newPath = this.handleData.newPath + "\/" + item.name;
 				}
@@ -1822,7 +1851,7 @@ export default {
 				}
 		
 				if (this.handleData.watermarkType == '1') { // 文字水印
-					let from = '优速水印工厂';
+					let from = pjson.softInfo.softName;
 					let sysWater = '';
 					
 					if(os.platform == 'linux'){
@@ -1923,7 +1952,7 @@ export default {
 			const os = require('os');
 			let version = os.release().split('.')[0] || 10;
 			if(Number(version) >= 10){
-				electronApi.spawnExec(['ffplay.exe','-x','1080','-autoexit',this.imgInfo.videoPath]).then((result) => {
+				electronApi.spawnExec(['ffplay.exe','-x','800','-y','600','-autoexit',this.imgInfo.videoPath]).then((result) => {
 				}).catch(err => {
 					this.$message.error('视频出现未知错误,无法预览!');
 				})
@@ -2067,7 +2096,7 @@ export default {
 					fontSize,
 					'-background',
 					'none',
-					'label:from:https://www.yososoft.com',
+					'label:from:https://www.xingyousoft.com',
 					sysDefaultTmpPath
 				];