|
@@ -9,12 +9,14 @@ import {fetchPlayList, fetchScanConfig, musicAppStart} from "@/apis/musicControl
|
|
import {ErrorCode} from "@/types/apiTypes.ts";
|
|
import {ErrorCode} from "@/types/apiTypes.ts";
|
|
import {Tab, TabGroup, TabList, TabPanel, TabPanels} from "@headlessui/vue";
|
|
import {Tab, TabGroup, TabList, TabPanel, TabPanels} from "@headlessui/vue";
|
|
import ScanListInfo from "@/components/music/common/scanListInfo.vue";
|
|
import ScanListInfo from "@/components/music/common/scanListInfo.vue";
|
|
|
|
+import {KuiDialogCmd} from "@/components/public/kui-dialog-cmd.ts";
|
|
|
|
+import addPlayList from "@/components/music/dialog/addPlayList.vue";
|
|
|
|
|
|
defineComponent({
|
|
defineComponent({
|
|
name: "musicIndex"
|
|
name: "musicIndex"
|
|
})
|
|
})
|
|
|
|
|
|
-defineProps({
|
|
|
|
|
|
+const props = defineProps({
|
|
windowId: {
|
|
windowId: {
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
@@ -79,6 +81,7 @@ function showMusicSetting()
|
|
message.info("show music setting");
|
|
message.info("show music setting");
|
|
musicViewShow.value = showSetting;
|
|
musicViewShow.value = showSetting;
|
|
selectPlaylistIndex.value = -1;
|
|
selectPlaylistIndex.value = -1;
|
|
|
|
+ siteTab.value = -1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -94,11 +97,13 @@ async function fetchScanSetting()
|
|
}
|
|
}
|
|
|
|
|
|
async function changeTab(index: number) {
|
|
async function changeTab(index: number) {
|
|
- if (site_view_key.value === site_views[index])
|
|
|
|
|
|
+
|
|
|
|
+ siteTab.value = index
|
|
|
|
+ if (musicViewShow.value !== showSetting && site_view_key.value === site_views[index] )
|
|
{
|
|
{
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- siteTab.value = index
|
|
|
|
|
|
+
|
|
site_view_key.value = site_views[index];
|
|
site_view_key.value = site_views[index];
|
|
if (site_view_key.value === site_playList)
|
|
if (site_view_key.value === site_playList)
|
|
{
|
|
{
|
|
@@ -122,6 +127,28 @@ function changeScanList(index: number)
|
|
selectScanIndex.value = index;
|
|
selectScanIndex.value = index;
|
|
musicViewShow.value = showScanList;
|
|
musicViewShow.value = showScanList;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+const kuiDialog = new KuiDialogCmd({
|
|
|
|
+ showContent: addPlayList,
|
|
|
|
+ mountTarget: props.windowId,
|
|
|
|
+ className: 'dialog',
|
|
|
|
+ on: {
|
|
|
|
+ },
|
|
|
|
+ onClose: closeDialogHandle
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+function closeDialogHandle()
|
|
|
|
+{
|
|
|
|
+ loadPlayList();
|
|
|
|
+ return true;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function addBtnClickHandle()
|
|
|
|
+{
|
|
|
|
+ message.info("add btn click");
|
|
|
|
+ kuiDialog.show()
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -140,7 +167,9 @@ function changeScanList(index: number)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <TabGroup as="div" class="site-chunk play-list" :selectedIndex="siteTab" @change="changeTab">
|
|
|
|
|
|
+ <TabGroup as="div" class="site-chunk play-list"
|
|
|
|
+ :selectedIndex="siteTab"
|
|
|
|
+ @change="changeTab">
|
|
<TabList as="div" class="tab-head">
|
|
<TabList as="div" class="tab-head">
|
|
<Tab as="template" v-slot="{ selected }" >
|
|
<Tab as="template" v-slot="{ selected }" >
|
|
<button :class="`tab-head-item ${selected?'head-select':''}`">
|
|
<button :class="`tab-head-item ${selected?'head-select':''}`">
|
|
@@ -183,6 +212,11 @@ function changeScanList(index: number)
|
|
|
|
|
|
<!-- 设置-->
|
|
<!-- 设置-->
|
|
<div class="setting-group">
|
|
<div class="setting-group">
|
|
|
|
+ <icon-svg class="icon mr-2"
|
|
|
|
+ v-if="musicViewShow === showPlayList"
|
|
|
|
+ @click.stop.capture="addBtnClickHandle"
|
|
|
|
+ v-tooltip.top="'添加歌单'"
|
|
|
|
+ icon-name="add"/>
|
|
<icon-svg class="icon" @click.stop.capture="showMusicSetting" icon-name="setting"/>
|
|
<icon-svg class="icon" @click.stop.capture="showMusicSetting" icon-name="setting"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|