index-legacy-3d29262c.js 7.1 KB

1
  1. System.register(["./index-legacy-683aaa3e.js","./index-legacy-40373f6b.js","./api-legacy-8ef69f96.js","./index-legacy-deacce5b.js","./catchData-legacy-57b1db3e.js"],(function(t,e){"use strict";var i,a,c,n,s,d,o,l,r,m,g,_,h,u,w,v,p;return{setters:[t=>{i=t.T},t=>{a=t.d,c=t.u,n=t.e,s=t.n,d=t.f,o=t.w,l=t.F,r=t.j,m=t.k,g=t.A,_=t.t,h=t.aV},t=>{u=t.a,w=t.b},t=>{v=t.T},t=>{p=t.u}],execute:function(){var I=document.createElement("style");I.textContent='._container_hcm5w_1{display:flex;flex-direction:column;background:#FFFFFF;border-radius:1.04166667vw;min-height:100%}._tools_hcm5w_8{padding:1.66666667vw 1.66666667vw 1.04166667vw;display:flex;align-items:flex-start;flex-shrink:0}._tools_hcm5w_8 .n-input{margin-left:auto;width:18.75vw}._tools_hcm5w_8 .n-input__input-el{height:100%;line-height:100%}._tools_hcm5w_8 .n-button.n-button--disabled{cursor:initial;padding:0}._tools_hcm5w_8 ._tagWrap_hcm5w_26{flex:1;margin-right:1.04166667vw}._tools_hcm5w_8 ._tags_hcm5w_30{padding:.625vw 0}._tools_hcm5w_8 ._tags_hcm5w_30 ._firstButton_hcm5w_33{display:flex;align-items:center;justify-content:center;height:100%;font-size:.9375rem;color:#999;line-height:1.30208333vw}._tools_hcm5w_8 ._tags_hcm5w_30 .n-button{min-width:5.3125vw;height:1.92708333vw;padding:0 1.25vw;font-size:.9375rem}._content_hcm5w_48{flex:1;padding:1.04166667vw 1.875vw 1.875vw}._content_hcm5w_48._loadingContent_hcm5w_52{min-height:50vh}._item_hcm5w_55{position:relative;width:11.14583333vw;cursor:pointer;transition:all .3s}._item_hcm5w_55 ._cover_hcm5w_61{position:relative;overflow:hidden}._item_hcm5w_55 ._cover_hcm5w_61:before{content:"";position:absolute;top:5.57291667vw;left:0;width:11.14583333vw;height:11.14583333vw;background:#DDF2FF;border-radius:50%}._item_hcm5w_55:hover{transform:scale(1.1)}._item_hcm5w_55 ._itemImg_hcm5w_78{position:relative;width:8.22916667vw;height:11.61458333vw;margin:auto;background-color:#edeff2;background-image:url('+new URL("icon_default-18367801.svg",e.meta.url).href+');background-repeat:no-repeat;background-position:center center}._item_hcm5w_55 ._itemImg_hcm5w_78:before{content:"";position:absolute;top:.20833333vw;right:-.20833333vw;width:.20833333vw;height:calc(100% - .41666667vw);background-color:#c5c5c5;z-index:1}._item_hcm5w_55 ._itemImg_hcm5w_78:after{content:"";position:absolute;top:.10416667vw;right:-.10416667vw;width:.20833333vw;height:calc(100% - .20833333vw);background-color:#e7e7e7;z-index:2}._item_hcm5w_55 ._itemImg_hcm5w_78 ._itemBg_hcm5w_108{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_hcm5w_55 ._itemImg_hcm5w_78 .n-image{position:relative;width:100%;height:100%;z-index:3}._item_hcm5w_55 ._itemImg_hcm5w_78 img{transition:opacity .3s;opacity:0}._item_hcm5w_55 ._itemImg_hcm5w_78 img[data-loaded=true]{opacity:1}._item_hcm5w_55 ._itemName_hcm5w_133{margin-top:.83333333vw;font-size:.83333333rem;font-weight:500;color:#333;text-align:center}\n',document.head.appendChild(I);const f="_container_hcm5w_1",b="_tools_hcm5w_8",y="_tagWrap_hcm5w_26",x="_tags_hcm5w_30",k="_firstButton_hcm5w_33",j="_content_hcm5w_48",A="_loadingContent_hcm5w_52",T="_item_hcm5w_55",C="_cover_hcm5w_61",S="_itemImg_hcm5w_78",z="_itemBg_hcm5w_108",N="_itemName_hcm5w_133";t("default",a({name:"XiaokuAi",setup(){const t=p(),e=c(),a=localStorage.getItem("xiaoku-ai-search"),I=a?JSON.parse(a):{},F=n({musicTagIds:I.musicTagIds?I.musicTagIds:[],enable:!0,subjectId:I.subjectId||null,keyword:"",page:1,rows:9999}),O=n({tags:[],tagChildren:[],tagActiveId:I.tagActiveId||"",tagActive:{},list:[],loading:!1}),J=async()=>{O.loading=!0;try{const t=await w({...F,musicTagIds:[O.tagActiveId,...F.musicTagIds].filter(Boolean)});Array.isArray(t?.data?.rows)&&(O.list=t.data.rows)}catch{}O.loading=!1},B=(t,e)=>{if(!t?.length)return;const i={columnName:t[0].columnName,list:[]},a=[];for(let c=0;c<t.length;c++)i.list.push({name:t[c].name,id:t[c].id,activeIndex:-1}),t[c].children&&a.push(...t[c].children);e.push(i),a.length&&B(a,e)};return s((async()=>{O.loading=!0;try{await(async()=>{const t=await u();if(Array.isArray(t?.data)&&t.data.length){O.tags=t.data||[];const e=O.tags.findIndex((t=>t.id==O.tagActiveId));if(e>-1){O.tagActiveId=t.data[e].id;const i=[];B(t.data[e].children,i),O.tagChildren=i}else{O.tagActiveId=t.data[0].id;const e=[];B(t.data[0].children,e),O.tagChildren=e}}})(),await J(),await t.getSubjects(),localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:O.tagActiveId,subjectId:F.subjectId,musicTagIds:F.musicTagIds}))}catch{}O.loading=!1})),()=>{let a;return d("div",{class:f},[d("div",{class:b},[d("div",{class:y},[d("div",{class:x},[d(o,{size:[20,12]},{default:()=>[d("span",{class:k},[O.tags?.[0]?.columnName]),O.tags.map(((t,e)=>d(l,null,[d(r,{round:!0,secondary:O.tagActiveId!==t.id,type:O.tagActiveId===t.id?"primary":"default",onClick:()=>((t,e)=>{O.tagActiveId=t.id,F.musicTagIds=[],localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:t.id,subjectId:F.subjectId,musicTagIds:F.musicTagIds}));const i=[];B(O.tags[e].children,i),O.tagChildren=i,J()})(t,e)},{default:()=>[t.name]})])))]})]),O.tagChildren.map(((t,e)=>d("div",{class:x},[d(o,{size:[20,12]},{default:()=>[d("span",{class:k},[t.columnName]),t.list.map(((i,a)=>d(l,null,[d(r,{round:!0,secondary:t.activeIndex!==a,type:t.activeIndex===a?"primary":"default",onClick:()=>((t,e)=>{const i=O.tagChildren[t].list[O.tagChildren[t].activeIndex],a=O.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)),O.tagChildren[t].activeIndex=-1):(F.musicTagIds.push(a.id),O.tagChildren[t].activeIndex=e),localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:O.tagActiveId,subjectId:F.subjectId,musicTagIds:F.musicTagIds})),J()})(e,a)},{default:()=>[i.name]})])))]})]))),d("div",{class:x},[d(o,{size:[20,12]},{default:()=>[d("span",{class:k},[m("声部")]),t.getSubjectAllList.map((t=>d(l,null,[d(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:O.tagActiveId,subjectId:t.id,musicTagIds:F.musicTagIds})),J()}},{default:()=>[t.name]})])))]})])]),d(i,{round:!0,onSearch:t=>{F.keyword=t,J()}},null)]),d(g,{show:O.loading},{default:()=>{return[d("div",{class:[j,O.loading?A:""]},[O.list.length>0?d(o,{size:[50,40]},(t=a=O.list.map(((t,i)=>d("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}})}},[d("div",{class:C},[d("div",{class:S},[d("div",{class:z},null),d(_,{objectFit:"cover",src:t.coverImg,lazy:!0,previewDisabled:!0,onLoad:t=>{t.target.dataset.loaded="true"}},null)])]),d("div",{class:N},[t.name])]))),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!h(t)?a:{default:()=>[a]})):"",!O.loading&&O.list.length<=0&&d(v,null,null)])];var t}})])}}}))}}}));