从webpack迁移到vite

This commit is contained in:
lyswhut
2023-08-07 18:49:14 +08:00
parent 31e16a7ed7
commit 028bf5919d
166 changed files with 3071 additions and 11869 deletions
@@ -9,10 +9,10 @@ material-modal(:show="modelValue" teleport="#view" @close="handleCloseModal" @af
div(:class="$style.row")
base-checkbox(id="play_timeout_end" :model-value="appSetting['player.waitPlayEndStop']" :label="$t('play_timeout_end')" @update:model-value="updateSetting({'player.waitPlayEndStop': $event})")
div(:class="[$style.row, $style.tip, { [$style.show]: !!timeLabel }]")
p {{$t('play_timeout_tip', { time: timeLabel })}}
p {{ $t('play_timeout_tip', { time: timeLabel }) }}
div(:class="$style.footer")
base-btn(:class="$style.footerBtn" @click="handleCancel") {{ $t(timeLabel ? 'play_timeout_stop' : 'play_timeout_close') }}
base-btn(:class="$style.footerBtn" @click="handleConfirm") {{$t(timeLabel ? 'play_timeout_update' : 'play_timeout_confirm')}}
base-btn(:class="$style.footerBtn" @click="handleConfirm") {{ $t(timeLabel ? 'play_timeout_update' : 'play_timeout_confirm') }}
</template>
<script>
@@ -31,13 +31,13 @@ export default {
default: false,
},
},
emits: ['update:model-value'],
emits: ['update:modelValue'],
setup(props, { emit }) {
const { timeLabel } = useTimeout()
const time = ref(appSetting['player.waitPlayEndStopTime'])
const handleCloseModal = () => {
emit('update:model-value', false)
emit('update:modelValue', false)
}
const handleCancel = () => {
if (timeLabel.value) {
@@ -6,17 +6,17 @@ dd
base-btn.btn.gap-left(min @click="handleImportPlayList") {{ $t('setting__backup_part_import_list') }}
base-btn.btn.gap-left(min @click="handleExportPlayList") {{ $t('setting__backup_part_export_list') }}
base-btn.btn.gap-left(min @click="handleImportSetting") {{ $t('setting__backup_part_import_setting') }}
base-btn.btn.gap-left(min @click="handleExportSetting") {{$t('setting__backup_part_export_setting')}}
base-btn.btn.gap-left(min @click="handleExportSetting") {{ $t('setting__backup_part_export_setting') }}
dd
h3#backup_all {{ $t('setting__backup_all') }}
div
base-btn.btn.gap-left(min @click="handleImportAllData") {{ $t('setting__backup_all_import') }}
base-btn.btn.gap-left(min @click="handleExportAllData") {{$t('setting__backup_all_export')}}
base-btn.btn.gap-left(min @click="handleExportAllData") {{ $t('setting__backup_all_export') }}
dd
h3#backup_other {{ $t('setting__backup_other') }}
div
base-btn.btn.gap-left(min @click="handleExportPlayListToText") {{ $t('setting__backup_other_export_list_text') }}
base-btn.btn.gap-left(min @click="handleExportPlayListToCsv") {{$t('setting__backup_other_export_list_csv')}}
base-btn.btn.gap-left(min @click="handleExportPlayListToCsv") {{ $t('setting__backup_other_export_list_csv') }}
</template>
<script>
@@ -385,7 +385,7 @@ export default {
</script>
<style lang="less" module>
.save-path {
.savePath {
font-size: 12px;
}
</style>
@@ -20,7 +20,7 @@ dd
div(:class="$style.bg")
div(:class="$style.bgContent")
svg-icon(:class="$style.icon" name="plus")
span(:class="$style.label") {{$t('theme_add')}}
span(:class="$style.label") {{ $t('theme_add') }}
dd
div
@@ -33,7 +33,7 @@ dd
.gap-top
base-checkbox(id="setting_to_tray" :model-value="appSetting['tray.enable']" :label="$t('setting__basic_to_tray')" @update:model-value="updateSetting({'tray.enable': $event})")
.p.gap-top
base-btn.btn(min @click="isShowPlayTimeoutModal = true") {{$t('setting__play_timeout')}} {{ timeLabel ? ` (${timeLabel})` : '' }}
base-btn.btn(min @click="isShowPlayTimeoutModal = true") {{ $t('setting__play_timeout')}} {{ timeLabel ? ` (${timeLabel})` : '' }}
dd
h3#basic_source {{ $t('setting__basic_source') }}
@@ -43,7 +43,7 @@ dd
:id="`setting_api_source_${item.id}`" name="setting_api_source"
need :model-value="appSetting['common.apiSource']" :disabled="item.disabled" :value="item.id" :label="item.label" @update:model-value="updateSetting({'common.apiSource': $event})")
.p.gap-top
base-btn.btn(min @click="isShowUserApiModal = true") {{$t('setting__basic_source_user_api_btn')}}
base-btn.btn(min @click="isShowUserApiModal = true") {{ $t('setting__basic_source_user_api_btn') }}
dd
h3#basic_window_size {{ $t('setting__basic_window_size') }}
@@ -55,7 +55,7 @@ dd
dd
h3#basic_font_size {{ $t('setting__basic_font_size') }}
div
//- base-selection.gap-teft(:list="fontSizeList" :modelValue="appSetting['common.fontSize']" @update:model-value="updateSetting({'common.fontSize': $event})")
//- base-selection.gap-teft(:list="fontSizeList" :model-value="appSetting['common.fontSize']" @update:model-value="updateSetting({'common.fontSize': $event})")
base-checkbox.gap-left(
v-for="item in fontSizeList" :id="`setting_basic_font_size_${item.id}`" :key="item.id"
name="setting_basic_font_size" need :model-value="appSetting['common.fontSize']" :value="item.id"
@@ -107,16 +107,16 @@ user-api-modal(v-model="isShowUserApiModal")
<script>
import { computed, ref, watch, reactive, shallowReactive } from '@common/utils/vueTools'
import { windowSizeList, userApi, isFullscreen, themeId } from '@renderer/store'
import { langList, useI18n } from '@/lang'
import { langList, useI18n } from '@root/lang'
import { getSystemFonts } from '@renderer/utils/ipc'
import apiSourceInfo from '@renderer/utils/musicSdk/api-source-info'
import { useTimeout } from '@renderer/core/player/timeoutStop'
import { dialog } from '@renderer/plugins/Dialog'
import ThemeSelectorModal from './ThemeSelectorModal'
import ThemeEditModal from './ThemeEditModal'
import PlayTimeoutModal from './PlayTimeoutModal'
import UserApiModal from './UserApiModal'
import ThemeSelectorModal from './ThemeSelectorModal.vue'
import ThemeEditModal from './ThemeEditModal/index.vue'
import PlayTimeoutModal from './PlayTimeoutModal.vue'
import UserApiModal from './UserApiModal.vue'
import { appSetting, updateSetting } from '@renderer/store/setting'
import { getThemes, applyTheme, findTheme, buildBgUrl } from '@renderer/store/utils'
@@ -26,7 +26,7 @@ dd
.gap-top
base-checkbox(id="setting_desktop_lyric_zoom" :model-value="appSetting['desktopLyric.style.isZoomActiveLrc']" :label="$t('desktop_lyric__lrc_active_zoom_on')" @update:model-value="updateSetting({ 'desktopLyric.style.isZoomActiveLrc': $event })")
//- .gap-top
base-checkbox(id="setting_desktop_lyric_fontWeight" :modelValue="appSetting['desktopLyric.style.fontWeight']" @update:model-value="updateSetting({ 'desktopLyric.style.fontWeight': $event })" :label="$t('setting__desktop_lyric_font_weight')")
base-checkbox(id="setting_desktop_lyric_fontWeight" :model-value="appSetting['desktopLyric.style.fontWeight']" @update:model-value="updateSetting({ 'desktopLyric.style.fontWeight': $event })" :label="$t('setting__desktop_lyric_font_weight')")
dd
h3#setting__desktop_lyric_font_weight {{ $t('setting__desktop_lyric_font_weight') }}
@@ -60,7 +60,7 @@ dd
div
.p
base-btn.btn(min @click="changeLineGap(-1)") {{ $t('setting__desktop_lyric_line_gap_dec') }}
base-btn.btn(min @click="changeLineGap(1)") {{$t('setting__desktop_lyric_line_gap_add')}}
base-btn.btn(min @click="changeLineGap(1)") {{ $t('setting__desktop_lyric_line_gap_add') }}
dd
h3#desktop_lyric_color {{ $t('setting__desktop_lyric_color') }}
div
@@ -76,7 +76,7 @@ dd
div(ref="lyric_shadow_color_ref" :class="$style.color")
div(:class="$style.label") {{ $t('setting__desktop_lyric_shadow_color') }}
.p.gap-top
base-btn.btn(min @click="resetColor") {{$t('setting__desktop_lyric_color_reset')}}
base-btn.btn(min @click="resetColor") {{ $t('setting__desktop_lyric_color_reset') }}
dd
h3#desktop_lyric_font {{ $t('setting__desktop_lyric_font') }}
div
@@ -86,7 +86,7 @@ dd
h3#desktop_lyric_reset {{ $t('setting__desktop_lyric_reset') }}
div
.p.gap-top
base-btn.btn(min @click="resetWindowSetting") {{$t('setting__desktop_lyric_reset_window')}}
base-btn.btn(min @click="resetWindowSetting") {{ $t('setting__desktop_lyric_reset_window') }}
</template>
@@ -12,7 +12,7 @@ dd(:aria-label="$t('setting__download_path_title')")
| {{ $t('setting__download_path_label') }}
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')}}
base-btn.btn(min @click="handleChangeSavePath") {{ $t('setting__download_path_change_btn') }}
dd
h3#download_use_other_source
| {{ $t('setting__download_use_other_source') }}
@@ -105,7 +105,7 @@ export default {
</script>
<style lang="less" module>
.save-path {
font-size: 12px;
}
// .savePath {
// font-size: 12px;
// }
</style>
@@ -15,7 +15,7 @@ dd
| {{ $t('setting__other_resource_cache_label') }}
span.auto-hidden {{ cacheSize }}
.p
base-btn.btn(min :disabled="isDisabledResourceCacheClear" @click="clearResourceCache") {{$t('setting__other_resource_cache_clear_btn')}}
base-btn.btn(min :disabled="isDisabledResourceCacheClear" @click="clearResourceCache") {{ $t('setting__other_resource_cache_clear_btn') }}
dd
h3#other_other_source {{ $t('setting__other_other_cache') }}
@@ -32,7 +32,7 @@ dd
.p
base-btn.btn(min :disabled="isDisabledOtherSourceCacheClear" @click="handleClearOtherSourceCache") {{ $t('setting__other_other_source_clear_btn') }}
base-btn.btn(min :disabled="isDisabledMusicUrlCacheClear" @click="handleClearMusicUrlCache") {{ $t('setting__other_music_url_clear_btn') }}
base-btn.btn(min :disabled="isDisabledLyricRawCacheClear" @click="handleClearLyricRawCache") {{$t('setting__other_lyric_raw_clear_btn')}}
base-btn.btn(min :disabled="isDisabledLyricRawCacheClear" @click="handleClearLyricRawCache") {{ $t('setting__other_lyric_raw_clear_btn') }}
dd
h3#other_lyric_edited {{ $t('setting__other_lyric_edited_cache') }}
@@ -41,13 +41,13 @@ dd
| {{ $t('setting__other_lyric_edited_label') }}
span.auto-hidden {{ lyricEditedCount }}
.p
base-btn.btn(min :disabled="isDisabledLyricEditedCacheClear" @click="handleClearLyricEditedCache") {{$t('setting__other_lyric_edited_clear_btn')}}
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')}}
base-btn.btn(min @click="handleClearListData") {{ $t('setting__other_listdata_clear_btn') }}
</template>
@@ -120,10 +120,6 @@ export default {
</script>
<style lang="less" module>
.save-path {
font-size: 12px;
}
.portInput[disabled], .hostInput[disabled] {
opacity: .8 !important;
}
@@ -19,8 +19,8 @@ dd
.p(v-else-if="versionInfo.status != 'downloading'")
span {{ $t('setting__update_new_version') }}
.p
base-btn.btn.gap-left(min @click="showUpdateModal") {{$t('setting__update_open_version_modal_btn')}}
.p.small(v-else-if="versionInfo.status =='checking'") {{$t('setting__update_checking')}}
base-btn.btn.gap-left(min @click="showUpdateModal") {{ $t('setting__update_open_version_modal_btn') }}
.p.small(v-else-if="versionInfo.status =='checking'") {{ $t('setting__update_checking') }}
</template>
<script>
@@ -157,7 +157,7 @@ export default {
default: '',
},
},
emits: ['update:model-value', 'submit'],
emits: ['update:modelValue', 'submit'],
setup(props, { emit }) {
const themeName = ref('')
const isDark = ref(false)
@@ -417,7 +417,7 @@ export default {
}
const handleCancel = () => {
handlePreview(false)
emit('update:model-value', false)
emit('update:modelValue', false)
}
// 保存
const handleSubmit = async() => {
@@ -440,7 +440,7 @@ export default {
handlePreview(false)
await saveTheme(theme)
emit('submit')
emit('update:model-value', false)
emit('update:modelValue', false)
}
// 删除
const handleRemove = async() => {
@@ -475,7 +475,7 @@ export default {
if (index > -1) themeInfo.userThemes.splice(index, 1)
handlePreview(false)
emit('submit')
emit('update:model-value', false)
emit('update:modelValue', false)
}
// 另存为
const handleSaveNew = async() => {
@@ -498,7 +498,7 @@ export default {
handlePreview(false)
await saveTheme(theme)
emit('submit')
emit('update:model-value', false)
emit('update:modelValue', false)
}
return {
@@ -1,5 +1,5 @@
<template>
<material-modal :show="modelValue" bg-close="bg-close" teleport="#view" @close="$emit('update:model-value', false)">
<material-modal :show="modelValue" bg-close="bg-close" teleport="#view" @close="$emit('update:modelValue', false)">
<main :class="$style.main">
<h2>{{ $t('theme_selector_modal__title') }}</h2>
<div class="scroll" :class="$style.content">
@@ -50,7 +50,7 @@ export default {
default: false,
},
},
emits: ['update:model-value'],
emits: ['update:modelValue'],
setup(props) {
const themeInfo = reactive({
themeLights: [],
@@ -21,7 +21,7 @@ material-modal(:show="modelValue" bg-close teleport="#view" @close="handleClose"
p {{ $t('user_api__note') }}
div(:class="$style.footer")
base-btn(:class="$style.footerBtn" @click="handleImport") {{ $t('user_api__btn_import') }}
//- base-btn(:class="$style.footerBtn" @click="handleExport") {{$t('user_api__btn_export')}}
//- base-btn(:class="$style.footerBtn" @click="handleExport") {{ $t('user_api__btn_export') }}
</template>
<script>
@@ -39,7 +39,7 @@ export default {
default: false,
},
},
emits: ['update:model-value'],
emits: ['update:modelValue'],
setup() {
return {
userApi,
@@ -89,7 +89,7 @@ export default {
userApi.list = await removeUserApi([api.id])
},
handleClose() {
this.$emit('update:model-value', false)
this.$emit('update:modelValue', false)
},
handleOpenUrl(url) {
openUrl(url)
+15 -15
View File
@@ -52,21 +52,21 @@ import { ref, computed, nextTick } from '@common/utils/vueTools'
import { useI18n } from '@renderer/plugins/i18n'
import { useRoute } from '@common/utils/vueRouter'
import SettingBasic from './components/SettingBasic'
import SettingPlay from './components/SettingPlay'
import SettingPlayDetail from './components/SettingPlayDetail'
import SettingDesktopLyric from './components/SettingDesktopLyric'
import SettingSearch from './components/SettingSearch'
import SettingList from './components/SettingList'
import SettingDownload from './components/SettingDownload'
import SettingSync from './components/SettingSync'
import SettingHotKey from './components/SettingHotKey'
import SettingNetwork from './components/SettingNetwork'
import SettingOdc from './components/SettingOdc'
import SettingBackup from './components/SettingBackup'
import SettingOther from './components/SettingOther'
import SettingUpdate from './components/SettingUpdate'
import SettingAbout from './components/SettingAbout'
import SettingBasic from './components/SettingBasic.vue'
import SettingPlay from './components/SettingPlay.vue'
import SettingPlayDetail from './components/SettingPlayDetail.vue'
import SettingDesktopLyric from './components/SettingDesktopLyric.vue'
import SettingSearch from './components/SettingSearch.vue'
import SettingList from './components/SettingList.vue'
import SettingDownload from './components/SettingDownload.vue'
import SettingSync from './components/SettingSync.vue'
import SettingHotKey from './components/SettingHotKey.vue'
import SettingNetwork from './components/SettingNetwork.vue'
import SettingOdc from './components/SettingOdc.vue'
import SettingBackup from './components/SettingBackup.vue'
import SettingOther from './components/SettingOther.vue'
import SettingUpdate from './components/SettingUpdate.vue'
import SettingAbout from './components/SettingAbout.vue'
export default {
name: 'Setting',