从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
+1 -1
View File
@@ -267,7 +267,7 @@ export default {
flex: auto;
}
.no-item {
.noItem {
position: relative;
height: 100%;
display: flex;
+3 -3
View File
@@ -105,8 +105,8 @@
<script>
import { clipboardWriteText } from '@common/utils/electron'
import { assertApiSupport } from '@renderer/store/utils'
import SearchList from './components/SearchList'
import MusicSortModal from './components/MusicSortModal'
import SearchList from './components/SearchList.vue'
import MusicSortModal from './components/MusicSortModal.vue'
import useListInfo from './useListInfo'
import useList from './useList'
import useMenu from './useMenu'
@@ -396,7 +396,7 @@ export default {
flex: auto;
}
.no-item {
.noItem {
position: relative;
height: 100%;
display: flex;
@@ -43,7 +43,7 @@ import { isFullscreen } from '@renderer/store'
import { appSetting } from '@renderer/store/setting'
import { getFontSizeWithScreen } from '@renderer/utils'
import { LIST_IDS } from '@common/constants'
import { useI18n } from '@/lang'
import { useI18n } from '@root/lang'
export default {
props: {
@@ -227,7 +227,7 @@ export default {
}
}
.no-item {
.noItem {
position: relative;
height: 200px;
display: flex;
@@ -74,7 +74,7 @@
import { ref, computed } from '@common/utils/vueTools'
// import { dialog } from '@renderer/plugins/Dialog'
import { getListMusics, updateListMusicsPosition } from '@renderer/store/list/action'
import { useI18n } from '@/lang'
import { useI18n } from '@root/lang'
import { LIST_IDS } from '@common/constants'
@@ -214,7 +214,7 @@ export default {
color: var(--color-font);
}
.no-item {
.noItem {
position: relative;
height: 200px;
display: flex;
+3 -3
View File
@@ -82,9 +82,9 @@
import { openUrl } from '@common/utils/electron'
import musicSdk from '@renderer/utils/musicSdk'
import DuplicateMusicModal from './components/DuplicateMusicModal'
import ListSortModal from './components/ListSortModal'
import ListUpdateModal from './components/ListUpdateModal'
import DuplicateMusicModal from './components/DuplicateMusicModal.vue'
import ListSortModal from './components/ListSortModal.vue'
import ListUpdateModal from './components/ListUpdateModal.vue'
import { defaultList, loveList, userLists, fetchingListStatus } from '@renderer/store/list/state'
import { removeUserList } from '@renderer/store/list/action'
+2 -2
View File
@@ -8,8 +8,8 @@
<script>
import { getListPrevSelectId } from '@renderer/utils/data'
import MyList from './MyList'
import MusicList from './MusicList'
import MyList from './MyList/index.vue'
import MusicList from './MusicList/index.vue'
export default {
name: 'List',
@@ -90,26 +90,26 @@ const handleSearch = (text) => {
flex-flow: column nowrap;
// justify-content: center;
}
.noitem-list-container {
.noitemListContainer {
padding: 3% 15px 15px;
// margin-top: -20px;
min-height: 300px;
max-height: 94.7%;
}
.noitem-list {
+.noitem-list {
.noitemList {
+.noitemList {
margin-top: 15px;
}
}
.noitem-hot-search-list {
.noitemHotSearchList {
min-height: 106px;
}
.noitem-list-title {
.noitemListTitle {
color: var(--color-font);
padding: 5px 5px 8px;
font-size: 14px;
}
.noitem-list-item {
.noitemListItem {
display: inline-block;
margin: 3px 5px;
background-color: var(--color-button-background);
@@ -128,7 +128,7 @@ const handleSearch = (text) => {
background-color: var(--color-button-background-active);
}
}
.history-clear-btn {
.historyClearBtn {
padding: 0 5px;
margin-left: 5px;
color: var(--color-font-label);
@@ -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',
+6 -6
View File
@@ -172,13 +172,13 @@ export default {
flex-flow: column nowrap;
}
.song-list-header {
.songListHeader {
flex: none;
display: flex;
flex-flow: row nowrap;
height: 80px;
}
.song-list-header-left {
.songListHeaderLeft {
flex: none;
margin-left: 15px;
height: 100%;
@@ -191,7 +191,7 @@ export default {
opacity: .9;
box-shadow: 0 0 2px 0 rgba(0,0,0,.2);
}
.play-num {
.playNum {
position: absolute;
bottom: 0;
left: 0;
@@ -204,7 +204,7 @@ export default {
.mixin-ellipsis-1;
}
.song-list-header-middle {
.songListHeaderMiddle {
flex: auto;
padding: 2px 7px;
h3 {
@@ -220,13 +220,13 @@ export default {
color: var(--color-font-label);
}
}
.song-list-header-right {
.songListHeaderRight {
flex: none;
display: flex;
align-items: center;
padding-right: 15px;
.header-right-btn {
.headerRightBtn {
border-radius: 0;
&:first-child {
border-top-left-radius: 4px;
@@ -49,7 +49,7 @@ const props = defineProps({
},
})
const emit = defineEmits(['update:model-value'])
const emit = defineEmits(['update:modelValue'])
const router = useRouter()
const route = useRoute()
@@ -54,7 +54,7 @@ watch(() => props.source, async(source) => {
<style lang="less" module>
@import '@renderer/assets/styles/layout.less';
.tag-list {
.tagList {
font-size: 12px;
position: relative;
@@ -113,7 +113,7 @@ onBeforeUnmount(() => {
<style lang="less" module>
@import '@renderer/assets/styles/layout.less';
.tag-list {
.tagList {
font-size: 12px;
position: relative;