新增设置-下载设置-同时下载任务数设置(#1498)
This commit is contained in:
@@ -13,6 +13,13 @@ dd(:aria-label="$t('setting__download_path_title')")
|
||||
span.auto-hidden.hover(:class="$style.savePath" :aria-label="$t('setting__download_path_open_label')" @click="openDirInExplorer(appSetting['download.savePath'])") {{ appSetting['download.savePath'] }}
|
||||
.p
|
||||
base-btn.btn(min @click="handleChangeSavePath") {{ $t('setting__download_path_change_btn') }}
|
||||
|
||||
dd
|
||||
h3#download_max_num {{ $t('setting__download_max_num') }}
|
||||
div
|
||||
p
|
||||
base-selection.gap-left(:class="$style.selectWidth" :model-value="appSetting['download.maxDownloadNum']" :list="maxNums" item-key="id" item-name="id" @change="handleUpdateMaxNum")
|
||||
|
||||
dd
|
||||
h3#download_use_other_source
|
||||
| {{ $t('setting__download_use_other_source') }}
|
||||
@@ -59,6 +66,7 @@ import { computed } from '@common/utils/vueTools'
|
||||
import { showSelectDialog, openDirInExplorer } from '@renderer/utils/ipc'
|
||||
import { useI18n } from '@renderer/plugins/i18n'
|
||||
import { appSetting, updateSetting } from '@renderer/store/setting'
|
||||
import { dialog } from '@renderer/plugins/Dialog'
|
||||
|
||||
export default {
|
||||
name: 'SettingDownload',
|
||||
@@ -76,6 +84,14 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
const maxNums = new Array(6).fill(null).map((_, i) => ({ id: i + 1 }))
|
||||
const handleUpdateMaxNum = async({ id }) => {
|
||||
if (id > 3) {
|
||||
if (!await dialog.confirm(window.i18n.t('setting__download_max_num_tip'))) return
|
||||
}
|
||||
updateSetting({ 'download.maxDownloadNum': id })
|
||||
}
|
||||
|
||||
const musicNames = computed(() => {
|
||||
return [
|
||||
{ value: '歌名 - 歌手', name: t('setting__download_name1') },
|
||||
@@ -98,6 +114,8 @@ export default {
|
||||
handleChangeSavePath,
|
||||
musicNames,
|
||||
lrcFormatList,
|
||||
maxNums,
|
||||
handleUpdateMaxNum,
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -107,4 +125,7 @@ export default {
|
||||
// .savePath {
|
||||
// font-size: 12px;
|
||||
// }
|
||||
.selectWidth {
|
||||
width: 60px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user