1 |
- System.register(["./index-legacy-b4bde969-1694675857467.js","./index-legacy-35b1c5cd-1694675857467.js","./api-legacy-a6670e6f-1694675857467.js","./index-legacy-eadbcfa4-1694675857467.js","./catchData-legacy-0a8b2cdd-1694675857467.js"],(function(t,e){"use strict";var i,a,n,s,d,o,c,l,r,_,g,u,m,f,h,v;return{setters:[t=>{i=t.T},t=>{a=t.d,n=t.u,s=t.e,d=t.n,o=t.f,c=t.w,l=t.F,r=t.j,_=t.k,g=t.A,u=t.t},t=>{m=t.a,f=t.b},t=>{h=t.T},t=>{v=t.u}],execute:function(){var j=document.createElement("style");j.textContent='._container_17qfj_1{display:flex;flex-direction:column;background:#FFFFFF;border-radius:1.04166667vw;min-height:100%}._tools_17qfj_8{padding:1.66666667vw 1.66666667vw 1.04166667vw;display:flex;align-items:flex-start;flex-shrink:0}._tools_17qfj_8 .n-input{margin-left:auto;width:18.75vw}._tools_17qfj_8 .n-input__input-el{height:100%;line-height:100%}._tools_17qfj_8 .n-button.n-button--disabled{cursor:initial;padding:0}._tools_17qfj_8 ._tagWrap_17qfj_26{flex:1;margin-right:1.04166667vw}._tools_17qfj_8 ._tags_17qfj_30{padding:.625vw 0}._tools_17qfj_8 ._tags_17qfj_30 ._firstButton_17qfj_33{display:flex;align-items:center;justify-content:center;height:100%;font-size:.9375rem;color:#999;line-height:1.30208333vw}._tools_17qfj_8 ._tags_17qfj_30 .n-button{min-width:5.3125vw;height:1.92708333vw;padding:0 1.25vw;font-size:.9375rem}._content_17qfj_48{flex:1;padding:0 .3125vw 1.875vw;gap:2.60416667vw 0;display:flex;flex-flow:row wrap;justify-content:flex-start;margin-left:-.625vw;margin-right:-.625vw}._content_17qfj_48._loadingContent_17qfj_58{min-height:50vh}._content_17qfj_48 ._itemWrap_17qfj_61{width:calc(100% / 6);padding-bottom:calc(100% / 6 * .909923);position:relative}._content_17qfj_48 ._itemWrap_17qfj_61 ._itemWrapBox_17qfj_66{position:absolute;left:0;top:0;width:100%;height:100%;padding:0 .625vw}._item_17qfj_61{margin:0 auto;position:relative;width:11.14583333vw;cursor:pointer;transition:all .3s}._item_17qfj_61 ._cover_17qfj_81{position:relative;overflow:hidden}._item_17qfj_61 ._cover_17qfj_81:before{content:"";position:absolute;top:5.57291667vw;left:0;width:11.14583333vw;height:11.14583333vw;background:#DDF2FF;border-radius:50%}._item_17qfj_61:hover{transform:scale(1.1)}._item_17qfj_61 ._itemImg_17qfj_98{position:relative;width:8.22916667vw;height:11.61458333vw;margin:auto;background-color:#edeff2;background-image:url('+new URL("icon_default-495cec59.svg",e.meta.url).href+');background-repeat:no-repeat;background-position:center center}._item_17qfj_61 ._itemImg_17qfj_98:before{content:"";position:absolute;top:.20833333vw;right:-.20833333vw;width:.20833333vw;height:calc(100% - .41666667vw);background-color:#c5c5c5;z-index:1}._item_17qfj_61 ._itemImg_17qfj_98:after{content:"";position:absolute;top:.10416667vw;right:-.10416667vw;width:.20833333vw;height:calc(100% - .20833333vw);background-color:#e7e7e7;z-index:2}._item_17qfj_61 ._itemImg_17qfj_98 ._itemBg_17qfj_128{position:absolute;top:0;left:0;width:100%;height:100%;z-index:4;background-repeat:no-repeat;background-image:linear-gradient(to right,rgba(0,0,0,.2) 0,rgba(255,255,255,.08) 0%,transparent .5%),linear-gradient(to right,rgba(0,0,0,.1) .3%,rgba(255,255,255,.09) 1.1%,transparent 1.3%);background-size:50% 100%,50% 100%;background-position:0% top,9% top}._item_17qfj_61 ._itemImg_17qfj_98 .n-image{position:relative;width:100%;height:100%;z-index:3}._item_17qfj_61 ._itemImg_17qfj_98 img{transition:opacity .3s;opacity:0}._item_17qfj_61 ._itemImg_17qfj_98 img[data-loaded=true]{opacity:1}._item_17qfj_61 ._itemName_17qfj_153{margin-top:.83333333vw;font-size:.83333333rem;line-height:1.14583333vw;font-weight:500;color:#333;text-align:center}\n',document.head.appendChild(j);const p="_container_17qfj_1",I="_tools_17qfj_8",w="_tagWrap_17qfj_26",q="_tags_17qfj_30",b="_firstButton_17qfj_33",y="_content_17qfj_48",x="_loadingContent_17qfj_58",k="_itemWrap_17qfj_61",A="_itemWrapBox_17qfj_66",T="_item_17qfj_61",C="_cover_17qfj_81",S="_itemImg_17qfj_98",z="_itemBg_17qfj_128",N="_itemName_17qfj_153";t("default",a({name:"XiaokuAi",setup(){const t=v(),e=n(),a=localStorage.getItem("xiaoku-ai-search"),j=a?JSON.parse(a):{},F=s({musicTagIds:j.musicTagIds?j.musicTagIds:[],enable:!0,subjectId:j.subjectId||null,keyword:"",page:1,rows:9999}),B=s({tags:[],tagChildren:[],tagActiveId:j.tagActiveId||"",tagActive:{},list:[],loading:!1}),W=async()=>{B.loading=!0;try{const t=await f({...F,musicTagIds:[B.tagActiveId,...F.musicTagIds].filter(Boolean)});Array.isArray(t?.data?.rows)&&(B.list=t.data.rows)}catch{}B.loading=!1},J=(t,e)=>{if(!t?.length)return;const i={columnName:t[0].columnName,list:[]},a=[];for(let n=0;n<t.length;n++)i.list.push({name:t[n].name,id:t[n].id,activeIndex:-1}),t[n].children&&a.push(...t[n].children);e.push(i),a.length&&J(a,e)};return d((async()=>{B.loading=!0;try{await(async()=>{const t=await m();if(Array.isArray(t?.data)&&t.data.length){B.tags=t.data||[];const e=B.tags.findIndex((t=>t.id==B.tagActiveId));if(e>-1){B.tagActiveId=t.data[e].id;const i=[];J(t.data[e].children,i),B.tagChildren=i}else{B.tagActiveId=t.data[0].id;const e=[];J(t.data[0].children,e),B.tagChildren=e}}})(),await W(),await t.getSubjects(),localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:B.tagActiveId,subjectId:F.subjectId,musicTagIds:F.musicTagIds}))}catch{}B.loading=!1})),()=>o("div",{class:p},[o("div",{class:I},[o("div",{class:w},[o("div",{class:q},[o(c,{size:[20,12]},{default:()=>[o("span",{class:b},[B.tags?.[0]?.columnName]),B.tags.map(((t,e)=>o(l,null,[o(r,{round:!0,secondary:B.tagActiveId!==t.id,type:B.tagActiveId===t.id?"primary":"default",onClick:()=>((t,e)=>{B.tagActiveId=t.id,F.musicTagIds=[],localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:t.id,subjectId:F.subjectId,musicTagIds:F.musicTagIds}));const i=[];J(B.tags[e].children,i),B.tagChildren=i,W()})(t,e)},{default:()=>[t.name]})])))]})]),B.tagChildren.map(((t,e)=>o("div",{class:q},[o(c,{size:[20,12]},{default:()=>[o("span",{class:b},[t.columnName]),t.list.map(((i,a)=>o(l,null,[o(r,{round:!0,secondary:t.activeIndex!==a,type:t.activeIndex===a?"primary":"default",onClick:()=>((t,e)=>{const i=B.tagChildren[t].list[B.tagChildren[t].activeIndex],a=B.tagChildren[t].list[e];i&&i.id!==a.id&&(F.musicTagIds=F.musicTagIds.filter((t=>t!==i.id))),F.musicTagIds.includes(a.id)?(F.musicTagIds=F.musicTagIds.filter((t=>t!==a.id)),B.tagChildren[t].activeIndex=-1):(F.musicTagIds.push(a.id),B.tagChildren[t].activeIndex=e),localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:B.tagActiveId,subjectId:F.subjectId,musicTagIds:F.musicTagIds})),W()})(e,a)},{default:()=>[i.name]})])))]})]))),o("div",{class:q},[o(c,{size:[20,12]},{default:()=>[o("span",{class:b},[_("声部")]),t.getSubjectAllList.map((t=>o(l,null,[o(r,{round:!0,secondary:t.id!==F.subjectId,type:t.id===F.subjectId?"primary":"default",onClick:()=>{F.subjectId=t.id,localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:B.tagActiveId,subjectId:t.id,musicTagIds:F.musicTagIds})),W()}},{default:()=>[t.name]})])))]})])]),o(i,{round:!0,onSearch:t=>{F.keyword=t,W()}},null)]),o(g,{show:B.loading},{default:()=>[o("div",{class:[y,B.loading?x:""]},[B.list.length>0?B.list.map(((t,i)=>o("div",{class:k},[o("div",{class:A},[o("div",{class:T,key:`item-${i}`,onClick:()=>{sessionStorage.setItem("musicSubjectList",JSON.stringify(t.subjects)),e.push({path:"/xiaoku-music",query:{id:t.id,name:t.name}})}},[o("div",{class:C},[o("div",{class:S},[o("div",{class:z},null),o(u,{objectFit:"cover",src:t.coverImg,lazy:!0,previewDisabled:!0,onLoad:t=>{t.target.dataset.loaded="true"}},null)])]),o("div",{class:N},[t.name])])])]))):"",!B.loading&&B.list.length<=0&&o(h,null,null)])]})])}}))}}}));
|