新增设置-其他-列表数据清理功能

This commit is contained in:
lyswhut
2023-03-15 17:44:20 +08:00
parent ec6e067938
commit 1e1aa65fc0
5 changed files with 33 additions and 0 deletions
@@ -42,6 +42,12 @@ dd
p
base-btn.btn(min :disabled="isDisabledLyricEditedCacheClear" @click="handleClearLyricEditedCache") {{$t('setting__other_lyric_edited_clear_btn')}}
dd
h3#other_lyric_edited {{$t('setting__other_listdata')}}
div
p
base-btn.btn(min @click="handleClearListData") {{$t('setting__other_listdata_clear_btn')}}
</template>
<script>
@@ -57,6 +63,7 @@ import { sizeFormate } from '@common/utils/common'
import { dialog } from '@renderer/plugins/Dialog'
import { useI18n } from '@renderer/plugins/i18n'
import { appSetting, updateSetting } from '@renderer/store/setting'
import { overwriteListFull } from '@renderer/store/list/listManage'
export default {
name: 'SettingOther',
@@ -166,6 +173,20 @@ export default {
}
refreshLyricEditedCount()
const handleClearListData = async() => {
if (!await dialog.confirm({
message: t('setting__other_listdata_clear_tip_confirm'),
cancelButtonText: t('cancel_button_text'),
confirmButtonText: t('setting__other_resource_cache_confirm'),
})) return
overwriteListFull({
defaultList: [],
loveList: [],
userList: [],
tempList: [],
})
}
return {
appSetting,
updateSetting,
@@ -189,6 +210,8 @@ export default {
lyricEditedCount,
isDisabledLyricEditedCacheClear,
handleClearLyricEditedCache,
handleClearListData,
}
},
}