From d6df9bcaf447ee24b0a5943eb74895ff8beac733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E8=90=8C=E5=93=92=E8=B5=AB=E8=90=9D?= Date: Wed, 1 Mar 2023 17:53:52 +0800 Subject: [PATCH] :sparkles: Feature: add {atuo} for rename placholders, represent for auto increment number ISSUES CLOSED: #14 --- src/renderer/manage/pages/bucketPage.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/renderer/manage/pages/bucketPage.vue b/src/renderer/manage/pages/bucketPage.vue index 02028c6..a5db105 100644 --- a/src/renderer/manage/pages/bucketPage.vue +++ b/src/renderer/manage/pages/bucketPage.vue @@ -1319,6 +1319,13 @@ https://www.baidu.com/img/bd_logo1.png" > {{ item.descriptionB }} + + 自增数字 + @@ -2578,6 +2585,9 @@ async function BatchRename () { ElMessage.warning('没有需要重命名的文件') return } + for (let i = 0; i < matchedFiles.length; i++) { + matchedFiles[i].newName = matchedFiles[i].newName.replaceAll('{auto}', (i + 1).toString()) + } let successCount = 0 let failCount = 0 const error = new Error('error') @@ -2942,6 +2952,7 @@ function singleRename () { ElMessage.info('新文件名与原文件名相同,无需重命名') return } + itemToBeRenamed.value.newName = itemToBeRenamed.value.newName.replaceAll('{auto}', '1') const item = currentPageFilesInfo[index] const param = { // tcyun