Feature: add {atuo} for rename placholders, represent for auto increment number

ISSUES CLOSED: #14
This commit is contained in:
萌萌哒赫萝 2023-03-01 17:53:52 +08:00
parent 327a7ac50d
commit d6df9bcaf4

View File

@ -1319,6 +1319,13 @@ https://www.baidu.com/img/bd_logo1.png"
> >
{{ item.descriptionB }} {{ item.descriptionB }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item
label="{auto}"
align="center"
label-style="width: 100px;"
>
自增数字
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-popover> </el-popover>
</span> </span>
@ -2578,6 +2585,9 @@ async function BatchRename () {
ElMessage.warning('没有需要重命名的文件') ElMessage.warning('没有需要重命名的文件')
return return
} }
for (let i = 0; i < matchedFiles.length; i++) {
matchedFiles[i].newName = matchedFiles[i].newName.replaceAll('{auto}', (i + 1).toString())
}
let successCount = 0 let successCount = 0
let failCount = 0 let failCount = 0
const error = new Error('error') const error = new Error('error')
@ -2942,6 +2952,7 @@ function singleRename () {
ElMessage.info('新文件名与原文件名相同,无需重命名') ElMessage.info('新文件名与原文件名相同,无需重命名')
return return
} }
itemToBeRenamed.value.newName = itemToBeRenamed.value.newName.replaceAll('{auto}', '1')
const item = currentPageFilesInfo[index] const item = currentPageFilesInfo[index]
const param = { const param = {
// tcyun // tcyun