1 #10

Merged
fanxb merged 6 commits from main into dev 2022-05-26 23:19:41 +08:00
3 changed files with 30 additions and 20 deletions
Showing only changes of commit 3f8b659462 - Show all commits

View File

@ -4,23 +4,24 @@ import * as path from 'path';
const rootPath = path.resolve(__dirname, '..'); const rootPath = path.resolve(__dirname, '..');
let config = { let config = {
rootPath, rootPath,
port: process.env.PORT ? parseInt(process.env.PORT) : 8089, port: process.env.PORT ? parseInt(process.env.PORT) : 8089,
token: process.env.TOKEN ? process.env.TOKEN : null, token: process.env.TOKEN ? process.env.TOKEN : null,
urlPrefix: '/openRenamer/api', urlPrefix: '/openRenamer/api',
//是否为windows平台 //是否为windows平台
isWindows: process.platform.toLocaleLowerCase().includes("win"), isWindows: process.platform.toLocaleLowerCase().includes("win"),
bodyLimit: { bodyLimit: {
formLimit: '2mb', formLimit: '200mb',
urlencoded: true, jsonLimit: '200mb',
multipart: true, urlencoded: true,
formidable: { multipart: true,
uploadDir: path.join(rootPath, 'files', 'temp', 'uploads'), formidable: {
keepExtenstions: true, uploadDir: path.join(rootPath, 'files', 'temp', 'uploads'),
maxFieldsSize: 1024 * 1024 keepExtenstions: true,
} maxFieldsSize: 1024 * 1024 * 200
}, }
publicPath: new Set(["POST/public/checkToken"]) },
publicPath: new Set(["POST/public/checkToken"])
}; };
export default config; export default config;

View File

@ -42,7 +42,7 @@ export default {
name: "Home", name: "Home",
data() { data() {
return { return {
version: "1.6.1", version: "1.6.2",
latestVersion: null, latestVersion: null,
activeIndex: location.pathname, activeIndex: location.pathname,
showNewVersion: false showNewVersion: false

View File

@ -60,7 +60,7 @@
<div class="fileBlock"> <div class="fileBlock">
<!-- 左侧原始文件名 --> <!-- 左侧原始文件名 -->
<div style="width:50%;"> <div style="width:50%;">
<div v-for="(item, index) in fileList" :key="index" class="oneLine"> <div v-for="(item, index) in showFileList" :key="index" class="oneLine">
<el-checkbox class="oneLineText" style="width: 95%" v-model="item.checked"> <el-checkbox class="oneLineText" style="width: 95%" v-model="item.checked">
<el-tooltip show-after="300" style="color:white" effect="dark" :content="item.name" placement="top"> <el-tooltip show-after="300" style="color:white" effect="dark" :content="item.name" placement="top">
<span class="oneLineText" style="width: 100%;display: inline-block">{{ item.name }}</span> <span class="oneLineText" style="width: 100%;display: inline-block">{{ item.name }}</span>
@ -70,7 +70,7 @@
</div> </div>
<!-- 右边的预览文件名 --> <!-- 右边的预览文件名 -->
<div style="width:50%"> <div style="width:50%">
<div v-for="(item, index) in changedFileList" :key="index" class="oneLine"> <div v-for="(item, index) in showChangedFileList" :key="index" class="oneLine">
<div style="display:inline-block;width:72%;" class="oneLineText"> <div style="display:inline-block;width:72%;" class="oneLineText">
<el-tooltip show-after="300" style="color:white" effect="dark" :content="item.name" placement="top"> <el-tooltip show-after="300" style="color:white" effect="dark" :content="item.name" placement="top">
<span class="oneLineText" style="width: 100%;display: inline-block">{{ item.name }}</span> <span class="oneLineText" style="width: 100%;display: inline-block">{{ item.name }}</span>
@ -131,6 +131,12 @@ export default {
computed: { computed: {
allChecked() { allChecked() {
return this.fileList.length > 0 && this.fileList.filter(item => item.checked).length === this.fileList.length; return this.fileList.length > 0 && this.fileList.filter(item => item.checked).length === this.fileList.length;
},
showFileList() {
return this.fileList.length > 500 ? this.fileList.slice(0, 500) : this.fileList;
},
showChangedFileList() {
return this.changedFileList && this.changedFileList.length > 500 ? this.changedFileList.slice(0, 500) : this.changedFileList;
} }
}, },
async created() { async created() {
@ -155,6 +161,9 @@ export default {
}, },
// //
async showResult() { async showResult() {
if (this.fileList.length > 500) {
this.$message.info("文件数过多仅展示前500个(不影响重命名)");
}
this.changedFileList = []; this.changedFileList = [];
if (!this.checkRuleAndFile()) { if (!this.checkRuleAndFile()) {
return; return;