1 |
- System.register(["./index-legacy-359d7699-1714304141006.js","./index-legacy-c927fc84-1714304141006.js","./api-legacy-ff109d95-1714304141006.js","./index-legacy-92d204b4-1714304141006.js","./catchData-legacy-8920de5a-1714304141006.js"],(function(t,e){"use strict";var a,i,n,s,r,o,d,l,c,_,g,m,u,f,v,h,p;return{setters:[t=>{a=t.T},t=>{i=t.d,n=t.u,s=t.e,r=t.p,o=t.f,d=t.w,l=t.F,c=t.j,_=t.k,g=t.aA,m=t.C,u=t.v},t=>{f=t.a,v=t.b},t=>{h=t.T},t=>{p=t.u}],execute:function(){var I=document.createElement("style");I.textContent='._container_1ejaf_1{display:flex;flex-direction:column;background:#FFFFFF;border-radius:1.04166667vw;min-height:100%}._tools_1ejaf_8{padding:1.66666667vw 1.66666667vw 1.04166667vw;display:flex;align-items:flex-start;flex-shrink:0}._tools_1ejaf_8 .n-input{margin-left:auto;width:18.75vw}._tools_1ejaf_8 .n-input__input-el{height:100%;line-height:100%}._tools_1ejaf_8 .n-button.n-button--disabled{cursor:initial;padding:0}._tools_1ejaf_8 ._tagWrap_1ejaf_26{flex:1;margin-right:1.04166667vw}._tools_1ejaf_8 ._tags_1ejaf_30{padding:.625vw 0}._tools_1ejaf_8 ._tags_1ejaf_30 ._firstButton_1ejaf_33{display:flex;align-items:center;justify-content:center;height:100%;font-size:max(.9375rem,13Px);color:#999;line-height:1.30208333vw}._tools_1ejaf_8 ._tags_1ejaf_30 .n-button{min-width:5.3125vw;height:1.92708333vw;padding:0 1.25vw;font-size:max(.9375rem,13Px)}._content_1ejaf_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_1ejaf_48._loadingContent_1ejaf_58{min-height:50vh}._content_1ejaf_48 ._itemWrap_1ejaf_61{width:calc(100% / 6);padding-bottom:calc(100% / 6 * .909923);position:relative}._content_1ejaf_48 ._itemWrap_1ejaf_61 ._itemWrapBox_1ejaf_66{position:absolute;left:0;top:0;width:100%;height:100%;padding:0 .625vw}._item_1ejaf_61{margin:0 auto;position:relative;width:11.14583333vw;cursor:pointer;transition:all .3s}._item_1ejaf_61 ._cover_1ejaf_81{position:relative;overflow:hidden}._item_1ejaf_61 ._cover_1ejaf_81:before{content:"";position:absolute;top:5.57291667vw;left:0;width:11.14583333vw;height:11.14583333vw;background:#DDF2FF;border-radius:50%}._item_1ejaf_61:hover{transform:scale(1.1)}._item_1ejaf_61 ._itemImg_1ejaf_98{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_1ejaf_61 ._itemImg_1ejaf_98:before{content:"";position:absolute;top:.20833333vw;right:-.20833333vw;width:.20833333vw;height:calc(100% - .41666667vw);background-color:#c5c5c5;z-index:1}._item_1ejaf_61 ._itemImg_1ejaf_98:after{content:"";position:absolute;top:.10416667vw;right:-.10416667vw;width:.20833333vw;height:calc(100% - .20833333vw);background-color:#e7e7e7;z-index:2}._item_1ejaf_61 ._itemImg_1ejaf_98 ._itemBg_1ejaf_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_1ejaf_61 ._itemImg_1ejaf_98 .n-image{position:relative;width:100%;height:100%;z-index:3}._item_1ejaf_61 ._itemImg_1ejaf_98 img{transition:opacity .3s;opacity:0}._item_1ejaf_61 ._itemImg_1ejaf_98 img[data-loaded=true]{opacity:1}._item_1ejaf_61 ._itemName_1ejaf_153{margin-top:.83333333vw;font-size:max(.83333333rem,12Px);line-height:1.14583333vw;font-weight:500;color:#333;text-align:center}._popSelect1_1ejaf_161{font-size:.83333333rem;width:12.5vw;box-shadow:0 .10416667vw .83333333vw rgba(0,0,0,.08);border-radius:.57291667vw;--n-option-height: 1.77083333vw}._popSelect1_1ejaf_161 .n-base-select-option__content{width:80%!important}._textBtn_1ejaf_171 ._iconArrow_1ejaf_171{display:inline-block;margin-left:.41666667vw;margin-top:.10416667vw;width:.41666667vw;height:.26041667vw;background:url('+new URL("icon-arrow-66c56d73.svg",e.meta.url).href+") no-repeat center center / contain;transform:rotate(180deg);color:#131415;fill:#131415}._textBtn_1ejaf_171:hover,._textBtn_1ejaf_171._textBtnActive_1ejaf_183{background:#198CFE!important;font-weight:500!important;color:#fff!important}._textBtn_1ejaf_171:hover ._iconArrow_1ejaf_171,._textBtn_1ejaf_171._textBtnActive_1ejaf_183 ._iconArrow_1ejaf_171{transform:rotate(0);background:url("+new URL("icon-arrow2-3d2121db.svg",e.meta.url).href+") no-repeat center center / contain;color:#fff;fill:#fff;margin-top:0}\n",document.head.appendChild(I);const j="_container_1ejaf_1",w="_tools_1ejaf_8",x="_tagWrap_1ejaf_26",b="_tags_1ejaf_30",y="_firstButton_1ejaf_33",k="_content_1ejaf_48",A="_loadingContent_1ejaf_58",T="_itemWrap_1ejaf_61",C="_itemWrapBox_1ejaf_66",S="_item_1ejaf_61",B="_cover_1ejaf_81",F="_itemImg_1ejaf_98",z="_itemBg_1ejaf_128",N="_itemName_1ejaf_153",E="_popSelect1_1ejaf_161",J="_textBtn_1ejaf_171",O="_iconArrow_1ejaf_171",W="_textBtnActive_1ejaf_183";t("default",i({name:"XiaokuAi",setup(){const t=p(),e=n(),i=localStorage.getItem("xiaoku-ai-search"),I=i?JSON.parse(i):{},L=s({musicTagIds:I.musicTagIds?I.musicTagIds:[],enable:!0,instrumentId:I.instrumentId||null,keyword:"",page:1,rows:9999}),U=s({tags:[],tagChildren:[],tagActiveId:I.tagActiveId||"",tagActive:{},tagIndex:I.instrumentId||0,list:[],loading:!1}),D=async()=>{U.loading=!0;try{const t=await v({...L,musicTagIds:[U.tagActiveId,...L.musicTagIds].filter(Boolean)});Array.isArray(t?.data?.rows)&&(U.list=t.data.rows)}catch{}U.loading=!1},P=(t,e)=>{if(!t?.length)return;const a={columnName:t[0].columnName,list:[]},i=[];for(let n=0;n<t.length;n++)a.list.push({name:t[n].name,id:t[n].id,activeIndex:-1}),t[n].children&&i.push(...t[n].children);e.push(a),i.length&&P(i,e)};r((async()=>{U.loading=!0;try{if(await(async()=>{const t=await f();if(Array.isArray(t?.data)&&t.data.length){U.tags=t.data||[];const e=U.tags.findIndex((t=>t.id==U.tagActiveId));if(e>-1){U.tagActiveId=t.data[e].id;const a=[];P(t.data[e].children,a),U.tagChildren=a}else{U.tagActiveId=t.data[0].id;const e=[];P(t.data[0].children,e),U.tagChildren=e}}})(),await D(),await t.getSubjects(),localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:U.tagActiveId,instrumentId:L.instrumentId,musicTagIds:L.musicTagIds})),L.instrumentId){let e=[];t.getSubjectInstruments.forEach((t=>{Array.isArray(t.instruments)&&t.instruments.forEach((a=>{L.instrumentId===a.value&&(e=t.instruments||[])}))})),e.length>0?R(e):L.instrumentId=""}}catch{}U.loading=!1}));const R=t=>{const e={};return t?.forEach((t=>{t.id===U.tagIndex&&(e.selected=!0,e.name=t.name)})),e};return()=>o("div",{class:j},[o("div",{class:w},[o("div",{class:x},[o("div",{class:b},[o(d,{size:[20,12]},{default:()=>[o("span",{class:y},[U.tags?.[0]?.columnName]),U.tags.map(((t,e)=>o(l,null,[o(c,{round:!0,secondary:U.tagActiveId!==t.id,type:U.tagActiveId===t.id?"primary":"default",onClick:()=>((t,e)=>{U.tagActiveId=t.id,L.musicTagIds=[],localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:t.id,instrumentId:L.instrumentId,musicTagIds:L.musicTagIds}));const a=[];P(U.tags[e].children,a),U.tagChildren=a,D()})(t,e)},{default:()=>[t.name]})])))]})]),U.tagChildren.map(((t,e)=>o("div",{class:b},[o(d,{size:[20,12]},{default:()=>[o("span",{class:y},[t.columnName]),t.list.map(((a,i)=>o(l,null,[o(c,{round:!0,secondary:t.activeIndex!==i,type:t.activeIndex===i?"primary":"default",onClick:()=>((t,e)=>{const a=U.tagChildren[t].list[U.tagChildren[t].activeIndex],i=U.tagChildren[t].list[e];a&&a.id!==i.id&&(L.musicTagIds=L.musicTagIds.filter((t=>t!==a.id))),L.musicTagIds.includes(i.id)?(L.musicTagIds=L.musicTagIds.filter((t=>t!==i.id)),U.tagChildren[t].activeIndex=-1):(L.musicTagIds.push(i.id),U.tagChildren[t].activeIndex=e),localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:U.tagActiveId,instrumentId:L.instrumentId,musicTagIds:L.musicTagIds})),D()})(e,i)},{default:()=>[a.name]})])))]})]))),o("div",{class:b},[o(d,{size:[20,12]},{default:()=>[o("span",{class:y},[_("乐器")]),t.getSubjectInstruments.map((t=>t.instruments&&t.instruments.length>1?o(g,{options:t.instruments,trigger:"hover",value:U.tagIndex,"onUpdate:value":[t=>U.tagIndex=t,()=>{L.instrumentId=U.tagIndex,localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:U.tagActiveId,instrumentId:U.tagIndex,musicTagIds:L.musicTagIds})),D()}],scrollable:!0,key:t.value,class:[E]},{default:()=>[o(c,{round:!0,textColor:R(t.instruments).selected?"#fff":"#000",color:R(t.instruments).selected?"#198CFE":"rgba(46, 51, 56, .05)",type:R(t.instruments).selected?"primary":"default",class:[J,R(t.instruments).selected&&W]},{default:()=>[R(t.instruments).name||t.name,o("i",{class:O},null)]})]}):o(c,{round:!0,textColor:U.tagIndex===(t.value||0)?"#fff":"#000",color:U.tagIndex===(t.value||0)?"#198CFE":"rgba(46, 51, 56, .05)",type:U.tagIndex===(t.value||0)?"primary":"default",onClick:()=>{U.tagIndex=t.value||0,L.instrumentId=t.value,localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:U.tagActiveId,instrumentId:t.id,musicTagIds:L.musicTagIds})),D()}},{default:()=>[t.name]})))]})])]),o(a,{round:!0,onSearch:t=>{L.keyword=t,D()}},null)]),o(m,{show:U.loading},{default:()=>[o("div",{class:[k,U.loading?A:""]},[U.list.length>0?U.list.map(((t,a)=>o("div",{class:T},[o("div",{class:C},[o("div",{class:S,key:`item-${a}`,onClick:()=>{sessionStorage.setItem("musicSubjectList",JSON.stringify(t.subjects)),e.push({path:"/xiaoku-music",query:{id:t.id,name:t.name}})}},[o("div",{class:B},[o("div",{class:F},[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])])])]))):"",!U.loading&&U.list.length<=0&&o(h,null,null)])]})])}}))}}}));
|