|
@@ -107,7 +107,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div v-if="(menuIndex != '8' && audioList.length == 0) || (menuIndex == 8 && videoList.length == 0)" class="upload-area">
|
|
|
+ <div v-if="(imgList.length == 0 && menuIndex == '1') || (audioList.length == 0 && menuIndex == '2') || (videoList.length == 0 && menuIndex == '3') || (pdfList.length == 0 && menuIndex == '4') || (wordList.length == 0 && menuIndex == '5') || (pptList.length == 0 && menuIndex == '6')" class="upload-area">
|
|
|
<div class="file-area" @click="pickFile()" id="drag-audio" @dragover.prevent @drop="handleDrop">
|
|
|
<div class="file-area-pos">
|
|
|
<img v-if="menuIndex == '1'" src="../assets/image/a-img.png" class="upload-img"/>
|
|
@@ -127,16 +127,60 @@
|
|
|
<div class="soft-content" v-else>
|
|
|
<div class="content-left">
|
|
|
<div class="table-scroll" @dragover.prevent @drop="handleDrop">
|
|
|
- <vxe-table
|
|
|
+ <vxe-table v-show="menuIndex == '1'"
|
|
|
+ show-overflow class="img-table" max-height="100%" empty-text="没有更多数据了!" :loading="tabLoading"
|
|
|
+ :loading-config="{icon: 'vxe-icon-indicator roll', text: '文件加载中...'}" :row-config="{isHover: true}"
|
|
|
+ :edit-config="{trigger: 'click', mode: 'cell'}" :data="imgList" :scroll-y="{enabled: true}">
|
|
|
+ <vxe-column field="name" :title="'文件名称'+'(' + imgList.length + ')'"></vxe-column>
|
|
|
+ <vxe-column field="size" title="大小" width="140"></vxe-column>
|
|
|
+ <vxe-column field="duration" title="尺寸" width="140">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <span v-if="row.width">{{row.width + '*' + row.height}}</span>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="progress" title="转换进度" width="200">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-progress :text-inside="true" :stroke-width="20" :percentage="row.percent"></el-progress>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column title="操作" width="90">
|
|
|
+ <template #default="{ row, rowIndex }">
|
|
|
+ <i class="el-icon-delete cur-pointer" style="font-size: 20px;" @click="delFile(rowIndex, 'imgList')"></i>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+
|
|
|
+ <vxe-table v-show="menuIndex == '2'"
|
|
|
show-overflow class="img-table" max-height="100%" empty-text="没有更多数据了!" :loading="tabLoading"
|
|
|
:loading-config="{icon: 'vxe-icon-indicator roll', text: '文件加载中...'}" :row-config="{isHover: true}"
|
|
|
:edit-config="{trigger: 'click', mode: 'cell'}" :data="audioList" :scroll-y="{enabled: true}">
|
|
|
<vxe-column field="name" :title="'文件名称'+'(' + audioList.length + ')'"></vxe-column>
|
|
|
- <vxe-column field="size" title="大小" width="140">
|
|
|
+ <vxe-column field="size" title="大小" width="140"></vxe-column>
|
|
|
+ <vxe-column field="duration" title="时间" width="140">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <span>{{formatSeconds(row.duration)}}</span>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="progress" title="转换进度" width="200">
|
|
|
<template #default="{ row }">
|
|
|
- <span>{{$utils.handleSize(row.size)}}</span>
|
|
|
+ <el-progress :text-inside="true" :stroke-width="20" :percentage="row.percent"></el-progress>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column title="操作" width="90">
|
|
|
+ <template #default="{ row, rowIndex }">
|
|
|
+ <i class="el-icon-view cur-pointer" style="font-size: 20px; margin-right: 5px;" @click="showFile(rowIndex)"></i>
|
|
|
+ <i class="el-icon-delete cur-pointer" style="font-size: 20px;" @click="delFile(rowIndex, 'audioList')"></i>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+
|
|
|
+ <vxe-table v-show="menuIndex == '3'"
|
|
|
+ show-overflow class="img-table" max-height="100%" empty-text="没有更多数据了!" :loading="tabLoading"
|
|
|
+ :loading-config="{icon: 'vxe-icon-indicator roll', text: '文件加载中...'}" :row-config="{isHover: true}"
|
|
|
+ :edit-config="{trigger: 'click', mode: 'cell'}" :data="videoList" :scroll-y="{enabled: true}">
|
|
|
+ <vxe-column field="name" :title="'文件名称'+'(' + videoList.length + ')'"></vxe-column>
|
|
|
+ <vxe-column field="size" title="大小" width="140"></vxe-column>
|
|
|
<vxe-column field="duration" title="时间" width="140">
|
|
|
<template #default="{ row }">
|
|
|
<span>{{formatSeconds(row.duration)}}</span>
|
|
@@ -150,7 +194,61 @@
|
|
|
<vxe-column title="操作" width="90">
|
|
|
<template #default="{ row, rowIndex }">
|
|
|
<i class="el-icon-view cur-pointer" style="font-size: 20px; margin-right: 5px;" @click="showFile(rowIndex)"></i>
|
|
|
- <i class="el-icon-delete cur-pointer" style="font-size: 20px;" @click="delFile(rowIndex)"></i>
|
|
|
+ <i class="el-icon-delete cur-pointer" style="font-size: 20px;" @click="delFile(rowIndex, 'videoList')"></i>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+
|
|
|
+ <vxe-table v-show="menuIndex == '4'"
|
|
|
+ show-overflow class="img-table" max-height="100%" empty-text="没有更多数据了!" :loading="tabLoading"
|
|
|
+ :loading-config="{icon: 'vxe-icon-indicator roll', text: '文件加载中...'}" :row-config="{isHover: true}"
|
|
|
+ :edit-config="{trigger: 'click', mode: 'cell'}" :data="pdfList" :scroll-y="{enabled: true}">
|
|
|
+ <vxe-column field="name" :title="'文件名称'+'(' + pdfList.length + ')'"></vxe-column>
|
|
|
+ <vxe-column field="size" title="大小" width="140"></vxe-column>
|
|
|
+ <vxe-column field="progress" title="转换进度" width="200">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-progress :text-inside="true" :stroke-width="20" :percentage="row.percent"></el-progress>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column title="操作" width="90">
|
|
|
+ <template #default="{ row, rowIndex }">
|
|
|
+ <i class="el-icon-delete cur-pointer" style="font-size: 20px;" @click="delFile(rowIndex, 'pdfList')"></i>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+
|
|
|
+ <vxe-table v-show="menuIndex == '5'"
|
|
|
+ show-overflow class="img-table" max-height="100%" empty-text="没有更多数据了!" :loading="tabLoading"
|
|
|
+ :loading-config="{icon: 'vxe-icon-indicator roll', text: '文件加载中...'}" :row-config="{isHover: true}"
|
|
|
+ :edit-config="{trigger: 'click', mode: 'cell'}" :data="wordList" :scroll-y="{enabled: true}">
|
|
|
+ <vxe-column field="name" :title="'文件名称'+'(' + wordList.length + ')'"></vxe-column>
|
|
|
+ <vxe-column field="size" title="大小" width="140"></vxe-column>
|
|
|
+ <vxe-column field="progress" title="转换进度" width="200">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-progress :text-inside="true" :stroke-width="20" :percentage="row.percent"></el-progress>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column title="操作" width="90">
|
|
|
+ <template #default="{ row, rowIndex }">
|
|
|
+ <i class="el-icon-delete cur-pointer" style="font-size: 20px;" @click="delFile(rowIndex, 'wordList')"></i>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+
|
|
|
+ <vxe-table v-show="menuIndex == '6'"
|
|
|
+ show-overflow class="img-table" max-height="100%" empty-text="没有更多数据了!" :loading="tabLoading"
|
|
|
+ :loading-config="{icon: 'vxe-icon-indicator roll', text: '文件加载中...'}" :row-config="{isHover: true}"
|
|
|
+ :edit-config="{trigger: 'click', mode: 'cell'}" :data="pptList" :scroll-y="{enabled: true}">
|
|
|
+ <vxe-column field="name" :title="'文件名称'+'(' + pptList.length + ')'"></vxe-column>
|
|
|
+ <vxe-column field="size" title="大小" width="140"></vxe-column>
|
|
|
+ <vxe-column field="progress" title="转换进度" width="200">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-progress :text-inside="true" :stroke-width="20" :percentage="row.percent"></el-progress>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column title="操作" width="90">
|
|
|
+ <template #default="{ row, rowIndex }">
|
|
|
+ <i class="el-icon-delete cur-pointer" style="font-size: 20px;" @click="delFile(rowIndex, 'pptList')"></i>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
</vxe-table>
|
|
@@ -159,14 +257,34 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 底部设置区域 -->
|
|
|
- <div class="img-footer-area" v-if="(menuIndex != '8' && audioList.length > 0) || (menuIndex == 8 && videoList.length > 0)">
|
|
|
+ <div class="img-footer-area" v-if="(imgList.length > 0 && menuIndex == '1') || (audioList.length > 0 && menuIndex == '2') || (videoList.length > 0 && menuIndex == '3') || (pdfList.length > 0 && menuIndex == '4') || (wordList.length > 0 && menuIndex == '5') || (pptList.length > 0 && menuIndex == '6')">
|
|
|
<div class="footer-line-between">
|
|
|
- <!-- 1格式转化 -->
|
|
|
- <div class="handle-item" v-if="menuIndex == '1' || menuIndex == '2'">
|
|
|
- <label class="handle-label">输出格式:</label>
|
|
|
- <el-select v-model="handleData.format" style="width:100px;" size="small">
|
|
|
- <el-option v-for="(item, key) in outputAudio" :key="key" :value="item" :label="item"></el-option>
|
|
|
+ <!-- 1 -->
|
|
|
+ <div class="handle-item" v-if="menuIndex == '1'">
|
|
|
+ <label class="handle-label">压缩质量:</label>
|
|
|
+ <el-input-number size="small" :min="1" :max="100" v-model="handleData.imgQuality" style="width: 120px;" controls-position="right"></el-input-number>
|
|
|
+ <span class="tips">数值越低图片压缩的越小</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 2音频压缩 -->
|
|
|
+ <div class="handle-item" v-if="menuIndex == '2'">
|
|
|
+ <label class="handle-label">压缩级别:</label>
|
|
|
+ <el-select v-model="handleData.compressLevel" style="width:100px;" size="small">
|
|
|
+ <el-option :value="1" label="1"></el-option>
|
|
|
+ <el-option :value="2" label="2"></el-option>
|
|
|
+ <el-option :value="3" label="3"></el-option>
|
|
|
+ <el-option :value="4" label="4"></el-option>
|
|
|
+ <el-option :value="5" label="5"></el-option>
|
|
|
+ <el-option :value="6" label="6"></el-option>
|
|
|
+ <el-option :value="7" label="7"></el-option>
|
|
|
+ <el-option :value="8" label="8"></el-option>
|
|
|
+ <el-option :value="9" label="9"></el-option>
|
|
|
</el-select>
|
|
|
+ <span style="margin-left: 10px; font-size: 12px; color: #F56C6C;">等级越高压缩效果越好</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 3 -->
|
|
|
+ <div class="handle-item" v-if="menuIndex == '3'">
|
|
|
<label class="handle-label">声道:</label>
|
|
|
<el-select v-model="handleData.type" style="width:100px;" size="small">
|
|
|
<el-option :value="1" label="同源音频"></el-option>
|
|
@@ -199,80 +317,25 @@
|
|
|
</el-select>
|
|
|
</div>
|
|
|
|
|
|
- <!-- 3音频压缩 -->
|
|
|
- <div class="handle-item" v-if="menuIndex == '3'">
|
|
|
- <label class="handle-label">压缩级别:</label>
|
|
|
- <el-select v-model="handleData.compressLevel" style="width:100px;" size="small">
|
|
|
- <el-option :value="1" label="1"></el-option>
|
|
|
- <el-option :value="2" label="2"></el-option>
|
|
|
- <el-option :value="3" label="3"></el-option>
|
|
|
- <el-option :value="4" label="4"></el-option>
|
|
|
- <el-option :value="5" label="5"></el-option>
|
|
|
- <el-option :value="6" label="6"></el-option>
|
|
|
- <el-option :value="7" label="7"></el-option>
|
|
|
- <el-option :value="8" label="8"></el-option>
|
|
|
- <el-option :value="9" label="9"></el-option>
|
|
|
- </el-select>
|
|
|
- <span style="margin-left: 10px; font-size: 12px; color: #F56C6C;">等级越高压缩效果越好</span>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 音频分割 -->
|
|
|
+ <!-- 4 -->
|
|
|
<div class="handle-item" v-if="menuIndex == '4'">
|
|
|
- <label class="handle-label">分割格式:</label>
|
|
|
- <el-select v-model="handleData.format" style="width:100px;" size="small">
|
|
|
- <el-option v-for="(item,key) in outputAudio" :key="key" :value="item" :label="item"></el-option>
|
|
|
- </el-select>
|
|
|
-
|
|
|
- <label class="handle-label">分割模式:</label>
|
|
|
- <el-select v-model="handleData.split_type" style="width:100px;" size="small">
|
|
|
- <el-option :value="1" label="按份分割"></el-option>
|
|
|
- <!-- <el-option :value="2" label="截取分割"></el-option> -->
|
|
|
- <el-option :value="3" label="平均分割"></el-option>
|
|
|
- </el-select>
|
|
|
-
|
|
|
- <template v-if="handleData.split_type == 1">
|
|
|
- <label class="handle-label">分割分数:</label>
|
|
|
- <el-select v-model="handleData.split_num" style="width:100px;" size="small">
|
|
|
- <el-option :value="2" label="2"></el-option>
|
|
|
- <el-option :value="3" label="3"></el-option>
|
|
|
- <el-option :value="4" label="4"></el-option>
|
|
|
- <el-option :value="5" label="5"></el-option>
|
|
|
- <el-option :value="6" label="6"></el-option>
|
|
|
- <el-option :value="7" label="7"></el-option>
|
|
|
- <el-option :value="8" label="8"></el-option>
|
|
|
- <el-option :value="9" label="9"></el-option>
|
|
|
- <el-option :value="10" label="10"></el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
+ <label class="handle-label">压缩质量:</label>
|
|
|
+ <el-input-number size="small" :min="1" :max="300" v-model="handleData.pdfQuality" style="width: 120px;" controls-position="right"></el-input-number>
|
|
|
+ <span class="tips">数值越低压缩的越小(1-300)</span>
|
|
|
</div>
|
|
|
|
|
|
- <!-- 音频变速 -->
|
|
|
+ <!-- 5 -->
|
|
|
<div class="handle-item" v-if="menuIndex == '5'">
|
|
|
- <label class="handle-label">播放速度:</label>
|
|
|
- <el-slider class="info-input" v-model="handleData.speed" :min="0.5" :max="2.0" :step="0.05" style="margin-right: 10px;"></el-slider> {{handleData.speed}}倍
|
|
|
+ <label class="handle-label">压缩质量:</label>
|
|
|
+ <el-input-number size="small" :min="1" :max="100" v-model="handleData.officeQuality" style="width: 120px;" controls-position="right"></el-input-number>
|
|
|
+ <span class="tips">数值越低压缩的越小</span>
|
|
|
</div>
|
|
|
|
|
|
- <!-- 音量调整 -->
|
|
|
+ <!-- 6 -->
|
|
|
<div class="handle-item" v-if="menuIndex == '6'">
|
|
|
- <label class="handle-label">音量大小:</label>
|
|
|
- <el-slider class="info-input" v-model="handleData.volume" :min="0.5" :max="2.0" :step="0.05" style="margin-right: 10px;"></el-slider> {{handleData.volume}}
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 音频反转 -->
|
|
|
- <div class="handle-item" v-if="menuIndex == '7'">
|
|
|
- <label class="handle-label">输出格式:</label>
|
|
|
- <el-checkbox size="small" v-model="handleData.isOriginal">同原音频</el-checkbox>
|
|
|
- <el-select v-if="!handleData.isOriginal" v-model="handleData.format" style="width:100px;margin-left: 5px;" size="small">
|
|
|
- <el-option v-for="(item, key) in outputAudio" :key="key" :value="item" :label="item"></el-option>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 提取音频 -->
|
|
|
- <div class="handle-item" v-if="menuIndex == '8'">
|
|
|
- <label class="handle-label">提取格式:</label>
|
|
|
- <el-select v-model="videoFormat" style="width:100px;margin-left: 5px;" size="small">
|
|
|
- <el-option v-for="(item, key) in outputVideo" :key="key" :value="item" :label="item"></el-option>
|
|
|
- </el-select>
|
|
|
+ <label class="handle-label">压缩质量:</label>
|
|
|
+ <el-input-number size="small" :min="1" :max="100" v-model="handleData.officeQuality" style="width: 120px;" controls-position="right"></el-input-number>
|
|
|
+ <span class="tips">数值越低压缩的越小</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -354,6 +417,7 @@ import electronApi from '@/utils/electronApi';
|
|
|
import softUpdate from './update.vue';
|
|
|
import softHeader from './header.vue';
|
|
|
import pjson from '/package.json'
|
|
|
+const sizeOf = require('image-size')
|
|
|
let separator = '';
|
|
|
if (os.platform == 'linux') {
|
|
|
separator = '/'
|
|
@@ -397,7 +461,33 @@ export default {
|
|
|
|
|
|
downloadDir: '', // 默认下载目录
|
|
|
handleData: {
|
|
|
- pathType: 2,
|
|
|
+ width: 1280,
|
|
|
+ height: 720,
|
|
|
+ format: 'mp4',
|
|
|
+ newPath: os.userInfo().homedir + separator + "Downloads", // 新路径
|
|
|
+ type: 1, // 输出目录类型
|
|
|
+ quality: '0.3', // 视频品质
|
|
|
+ audioQuality:'-1',
|
|
|
+ fenbianlv: -1,
|
|
|
+ audioRemove:false,
|
|
|
+ start:0,
|
|
|
+ limit:5,
|
|
|
+
|
|
|
+ pdfCompValue:1,
|
|
|
+ wordCompValue:1,
|
|
|
+ pptCompValue:1,
|
|
|
+
|
|
|
+ auto_format:'mp3',
|
|
|
+ auto_bit: '320k',
|
|
|
+ auto_pinlv: 16000,
|
|
|
+ auto_channel: 1,
|
|
|
+
|
|
|
+ compressratio: 100,
|
|
|
+ imgQuality: 90, // 图片压缩质量
|
|
|
+ pdfQuality: 50,
|
|
|
+ officeQuality: 60,
|
|
|
+ imgScale: 100, // 缩放比例
|
|
|
+
|
|
|
isOriginal: true,
|
|
|
format: 'mp3',
|
|
|
newPath: os.userInfo().homedir + separator + "Downloads", // 新路径
|
|
@@ -536,35 +626,71 @@ export default {
|
|
|
imgScale: 100, // 缩放比例
|
|
|
};
|
|
|
},
|
|
|
+ setDefaultInfo(){
|
|
|
+ let fileList = [];
|
|
|
+ switch(this.menuIndex){
|
|
|
+ case '1':
|
|
|
+ fileList = this.imgList;
|
|
|
+ break;
|
|
|
+ case '2':
|
|
|
+ fileList = this.videoList;
|
|
|
+ break;
|
|
|
+ case '3':
|
|
|
+ fileList = this.videoList;
|
|
|
+ break;
|
|
|
+ case '4':
|
|
|
+ fileList = this.pdfList;
|
|
|
+ break;
|
|
|
+ case '5':
|
|
|
+ fileList = this.wordList;
|
|
|
+ break;
|
|
|
+ case '6':
|
|
|
+ fileList = this.pptList;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if(fileList[0]){
|
|
|
+ this.imgInfo = fileList[0];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeFenbianlv(val){
|
|
|
+ if (val == 6) {
|
|
|
+ this.handleData.height = 720
|
|
|
+ } else if (val == 7) {
|
|
|
+ this.handleData.height = 960
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeHeight() {
|
|
|
+ if (this.handleData.height > 0) {
|
|
|
+ if (this.handleData.fenbianlv == 6) {
|
|
|
+ this.handleData.width = Math.round((this.handleData.height * 16) / 9)
|
|
|
+ } else if (this.handleData.fenbianlv == 7) {
|
|
|
+ this.handleData.width = Math.round((this.handleData.height * 4) / 3)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeWidth() {
|
|
|
+ if (this.handleData.width > 0) {
|
|
|
+ if (this.handleData.fenbianlv == 6) {
|
|
|
+ this.handleData.height = Math.round((this.handleData.width * 9) / 16)
|
|
|
+ } else if (this.handleData.fenbianlv == 7) {
|
|
|
+ this.handleData.height = Math.round((this.handleData.width * 3) / 4)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
// 查看文件信息
|
|
|
showFile(rowIndex){
|
|
|
this.showIndex = rowIndex;
|
|
|
this.fileDetailModel = true;
|
|
|
},
|
|
|
// 删除文件
|
|
|
- delFile(rowIndex){
|
|
|
- this.$confirm('确认删除此音频吗?', '提示', {
|
|
|
+ delFile(rowIndex, list){
|
|
|
+ this.$confirm('确认删除此文件吗?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- this.audioList.splice(rowIndex, 1);
|
|
|
- if (this.audioList.length == 0) {
|
|
|
- this.clearList();
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
-
|
|
|
- });
|
|
|
- },
|
|
|
- // 删除文件
|
|
|
- delVideoFile(rowIndex){
|
|
|
- this.$confirm('确认删除此视频吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.videoList.splice(rowIndex, 1);
|
|
|
- if (this.videoList.length == 0) {
|
|
|
+ this[list].splice(rowIndex, 1);
|
|
|
+ if (this[list].length == 0) {
|
|
|
this.clearList();
|
|
|
}
|
|
|
}).catch(() => {
|
|
@@ -646,21 +772,21 @@ export default {
|
|
|
if(this.menuIndex == '1'){
|
|
|
if(!this.$refs.headerRef.authority.isAuthority){
|
|
|
if(size > 1024*300){
|
|
|
- this.$notify.error({
|
|
|
- title: '提示',
|
|
|
- message: '免费版,文件最大不能超过300KB!'
|
|
|
- });
|
|
|
- return false;
|
|
|
+ // this.$notify.error({
|
|
|
+ // title: '提示',
|
|
|
+ // message: '免费版,文件最大不能超过300KB!'
|
|
|
+ // });
|
|
|
+ // return false;
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
if(!this.$refs.headerRef.authority.isAuthority){
|
|
|
if(size > 1024*1024*2){
|
|
|
- this.$notify.error({
|
|
|
- title: '提示',
|
|
|
- message: '免费版,文件最大不能超过2M!'
|
|
|
- });
|
|
|
- return false;
|
|
|
+ // this.$notify.error({
|
|
|
+ // title: '提示',
|
|
|
+ // message: '免费版,文件最大不能超过2M!'
|
|
|
+ // });
|
|
|
+ // return false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -680,7 +806,7 @@ export default {
|
|
|
}else{
|
|
|
let flag = true;
|
|
|
switch(this.menuIndex){
|
|
|
- case 1:
|
|
|
+ case '1':
|
|
|
if(this.imgFormat.indexOf(imgInfo.type.toUpperCase()) == -1){
|
|
|
this.$Message.warning('不是有效的图片文件! - '+ file);
|
|
|
}else{
|
|
@@ -703,7 +829,73 @@ export default {
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
- case 2:
|
|
|
+ case '2':
|
|
|
+ if(this.inputVideo.indexOf("video/"+imgInfo.type.toLowerCase()) == -1){
|
|
|
+ this.$Message.warning('不是有效的视频文件! - '+ file);
|
|
|
+ }else{
|
|
|
+ // ffprobe -v quiet -print_format json -show_format -show_streams aa11.mp4
|
|
|
+ electronApi.spawnExec(['ffprobe.exe','-i', file, '-v', 'quiet', '-print_format', 'json', '-show_format', '-show_streams']).then((result) => {
|
|
|
+ // 替换括号里面的数据,防止提取数据时出现错误
|
|
|
+ result = result.stdout.toString()
|
|
|
+ result = JSON.parse(result);
|
|
|
+ // console.log(result,'reeeeeeeeeeee')
|
|
|
+
|
|
|
+ let type = filename.substr(filename.lastIndexOf('.')+1);
|
|
|
+ let fenbianlv = '-';
|
|
|
+ let rotate = 0;
|
|
|
+ let v_codec_name = '';
|
|
|
+ let a_codec_name = '';
|
|
|
+
|
|
|
+ result.streams[1] = result.streams[1] ? result.streams[1] : {};
|
|
|
+
|
|
|
+ if(result.streams && result.streams[0]){
|
|
|
+ result.streams.map((item, index) => {
|
|
|
+ if(item.codec_type == 'video'){
|
|
|
+ v_codec_name = item.codec_name;
|
|
|
+ if(item.width || item.height){
|
|
|
+ fenbianlv = item.width + 'x'+ item.height;
|
|
|
+ }
|
|
|
+ }else if(item.codec_type == 'audio'){
|
|
|
+ a_codec_name = item.codec_name;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if(result.streams[0].tags){
|
|
|
+ rotate = result.streams[0].tags.rotate;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ let imgInfo2 = {
|
|
|
+ name: filename,
|
|
|
+ size: this.$utils.handleSize(size),
|
|
|
+ path: file,
|
|
|
+ type: filename.substr(filename.lastIndexOf('.')+1),
|
|
|
+ duration: result.format.duration,
|
|
|
+ bitrate: result.format.bit_rate,
|
|
|
+ fenbianlv: fenbianlv,
|
|
|
+ percent: 0,
|
|
|
+ rotate: rotate,
|
|
|
+ audio_bitrate: result.streams[1].bit_rate || 0,
|
|
|
+ v_codec_name: v_codec_name,
|
|
|
+ a_codec_name: a_codec_name,
|
|
|
+ };
|
|
|
+
|
|
|
+ let flag = true;
|
|
|
+ for (let m = 0; m < this.audioList.length; m++) {
|
|
|
+ if (this.audioList[m].name == imgInfo2.name && this.audioList[m].path == imgInfo2.path) {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (flag) {
|
|
|
+ this.audioList.push(imgInfo2);
|
|
|
+ }else{
|
|
|
+ this.$Message.warning('该文件已经在队列中 - ' + file);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case '3':
|
|
|
if(this.inputVideo.indexOf("video/"+imgInfo.type.toLowerCase()) == -1){
|
|
|
this.$Message.warning('不是有效的视频文件! - '+ file);
|
|
|
}else{
|
|
@@ -769,7 +961,7 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
break;
|
|
|
- case 3:
|
|
|
+ case '4':
|
|
|
if("pdf".indexOf(imgInfo.type.toLowerCase()) == -1){
|
|
|
this.$Message.warning('不是有效的PDF文件! - '+ file);
|
|
|
}else{
|
|
@@ -785,7 +977,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
- case 4:
|
|
|
+ case '5':
|
|
|
if("doc,docx".indexOf(imgInfo.type.toLowerCase()) == -1){
|
|
|
this.$Message.warning('不是有效的WORD文件! - '+ file);
|
|
|
}else{
|
|
@@ -800,7 +992,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- case 5:
|
|
|
+ case '6':
|
|
|
if("ppt,pptx".indexOf(imgInfo.type.toLowerCase()) == -1){
|
|
|
this.$Message.warning('不是有效的PPT文件! - '+ file);
|
|
|
}else{
|
|
@@ -901,24 +1093,17 @@ export default {
|
|
|
newPath = item.path;
|
|
|
|
|
|
suffix = item.name.lastIndexOf('.') != -1 ? item.name.substr(item.name.lastIndexOf('.')+1) : item.type;
|
|
|
-
|
|
|
- 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;
|
|
|
- }
|
|
|
+
|
|
|
+ if(fs.existsSync(this.downloadDir + separator + pjson.softInfo.softName)){
|
|
|
+ this.handleData.newPath = this.downloadDir + separator + pjson.softInfo.softName;
|
|
|
} else {
|
|
|
- newPath = item.path.slice(0, lastIndex);
|
|
|
- this.handleData.newPath = newPath;
|
|
|
+ fs.mkdirSync(this.downloadDir + separator + pjson.softInfo.softName);
|
|
|
+ this.handleData.newPath = this.downloadDir + separator + pjson.softInfo.softName;
|
|
|
}
|
|
|
|
|
|
if (this.handleData.autoRename) {
|
|
|
newPath = item.path.slice(0, lastIndex) + '_tty.' + 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('.')) + '_tty.' + suffix;
|
|
|
} else {
|
|
|
newPath = this.handleData.newPath + separator + item.name.slice(0, item.name.lastIndexOf('.')) + '.' +suffix;
|
|
|
}
|