feat: 更新 README 并添加清空字幕记录功能

- 更新 README 中的项目状态和下载链接
- 添加清空字幕记录的功能
- 优化字幕记录的导出和清空界面
- 更新代码以支持跨平台兼容性
- 添加开源协议
This commit is contained in:
himeditator
2025-06-22 00:17:43 +08:00
parent 42237a229c
commit e23249bc54
9 changed files with 69 additions and 11 deletions

View File

@@ -34,11 +34,18 @@
<span style="margin-right: 30px;">字幕记录</span>
<a-button
type="primary"
style="margin-right: 20px;"
@click="exportCaptions"
:disabled="captionData.length === 0"
>
导出字幕记录
</a-button>
<a-button
danger
@click="clearCaptions"
>
清空字幕记录
</a-button>
</div>
<a-table
:columns="columns"
@@ -128,6 +135,10 @@ function exportCaptions() {
document.body.removeChild(a)
URL.revokeObjectURL(url)
}
function clearCaptions() {
captionLog.clear()
}
</script>
<style scoped>

View File

@@ -21,11 +21,17 @@ export const useCaptionLogStore = defineStore('captionLog', () => {
}
})
function clear() {
captionData.value = []
window.electron.ipcRenderer.send('control.caption.clear')
}
window.electron.ipcRenderer.on('both.log.set', (_, logs) => {
captionData.value = logs
})
return {
captionData
captionData,
clear
}
})