新增设置-其他-列表数据清理功能
This commit is contained in:
@@ -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,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user