1 |
- System.register(["./index-legacy-a6e573b9-1715840129614.js","./index-legacy-f35addb7-1715840129614.js","./api-legacy-d7b578f5-1715840129614.js","./index-legacy-2f080daf-1715840129614.js","./catchData-legacy-856cc1c0-1715840129614.js"],(function(t,e){"use strict";var n,i,a,o,s,r,d,l,c,_,g,m,u,v,h,k,p;return{setters:[t=>{n=t.T},t=>{i=t.d,a=t.u,o=t.e,s=t.p,r=t.f,d=t.w,l=t.F,c=t.j,_=t.k,g=t.aA,m=t.C,u=t.v},t=>{v=t.a,h=t.b},t=>{k=t.T},t=>{p=t.u}],execute:function(){var f=document.createElement("style");f.textContent='._container_1n8ok_1{display:flex;flex-direction:column;background:#FFFFFF;border-radius:1.04166667vw;min-height:100%}._tools_1n8ok_8{padding:1.66666667vw 1.66666667vw 1.04166667vw;display:flex;align-items:flex-start;flex-shrink:0}._tools_1n8ok_8 .n-input{margin-left:auto;width:18.75vw}._tools_1n8ok_8 .n-input__input-el{height:100%;line-height:100%}._tools_1n8ok_8 .n-button.n-button--disabled{cursor:initial;padding:0}._tools_1n8ok_8 ._tagWrap_1n8ok_26{flex:1;margin-right:1.04166667vw}._tools_1n8ok_8 ._tags_1n8ok_30{padding:.625vw 0}._tools_1n8ok_8 ._tags_1n8ok_30 ._firstButton_1n8ok_33{display:flex;align-items:center;justify-content:center;height:100%;font-size:max(.9375rem,13Px);color:#999;line-height:1.30208333vw}._tools_1n8ok_8 ._tags_1n8ok_30 .n-button{min-width:5.3125vw;height:1.92708333vw;padding:0 1.25vw;font-size:max(.9375rem,13Px)}._tools_1n8ok_8 ._tags_1n8ok_30 .n-button--primary-type{font-weight:500!important}._content_1n8ok_51{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_1n8ok_51._loadingContent_1n8ok_61{min-height:50vh}._content_1n8ok_51 ._itemWrap_1n8ok_64{width:calc(100% / 6);padding-bottom:calc(100% / 6 * .909923);position:relative}._content_1n8ok_51 ._itemWrap_1n8ok_64 ._itemWrapBox_1n8ok_69{position:absolute;left:0;top:0;width:100%;height:100%;padding:0 .625vw}._item_1n8ok_64{margin:0 auto;position:relative;width:11.14583333vw;cursor:pointer;transition:all .3s}._item_1n8ok_64 ._cover_1n8ok_84{position:relative;overflow:hidden}._item_1n8ok_64 ._cover_1n8ok_84:before{content:"";position:absolute;top:5.57291667vw;left:0;width:11.14583333vw;height:11.14583333vw;background:#DDF2FF;border-radius:50%}._item_1n8ok_64:hover{transform:scale(1.1)}._item_1n8ok_64 ._itemImg_1n8ok_101{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_1n8ok_64 ._itemImg_1n8ok_101:before{content:"";position:absolute;top:.20833333vw;right:-.20833333vw;width:.20833333vw;height:calc(100% - .41666667vw);background-color:#c5c5c5;z-index:1}._item_1n8ok_64 ._itemImg_1n8ok_101:after{content:"";position:absolute;top:.10416667vw;right:-.10416667vw;width:.20833333vw;height:calc(100% - .20833333vw);background-color:#e7e7e7;z-index:2}._item_1n8ok_64 ._itemImg_1n8ok_101 ._itemBg_1n8ok_131{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_1n8ok_64 ._itemImg_1n8ok_101 .n-image{position:relative;width:100%;height:100%;z-index:3}._item_1n8ok_64 ._itemImg_1n8ok_101 img{transition:opacity .3s;opacity:0}._item_1n8ok_64 ._itemImg_1n8ok_101 img[data-loaded=true]{opacity:1}._item_1n8ok_64 ._itemName_1n8ok_156{margin-top:.83333333vw;font-size:max(.83333333rem,12Px);line-height:1.14583333vw;font-weight:500;color:#333;text-align:center}._popSelect1_1n8ok_164{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_1n8ok_164 .n-base-select-option__content{width:80%!important}._textBtn_1n8ok_174 ._iconArrow_1n8ok_174{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_1n8ok_174:hover,._textBtn_1n8ok_174._textBtnActive_1n8ok_186{background:#198CFE!important;font-weight:500!important;color:#fff!important}._textBtn_1n8ok_174:hover ._iconArrow_1n8ok_174,._textBtn_1n8ok_174._textBtnActive_1n8ok_186 ._iconArrow_1n8ok_174{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(f);const I="_container_1n8ok_1",w="_tools_1n8ok_8",x="_tagWrap_1n8ok_26",b="_tags_1n8ok_30",y="_firstButton_1n8ok_33",A="_content_1n8ok_51",T="_loadingContent_1n8ok_61",C="_itemWrap_1n8ok_64",S="_itemWrapBox_1n8ok_69",B="_item_1n8ok_64",j="_cover_1n8ok_84",F="_itemImg_1n8ok_101",z="_itemBg_1n8ok_131",N="_itemName_1n8ok_156",E="_popSelect1_1n8ok_164",J="_textBtn_1n8ok_174",O="_iconArrow_1n8ok_174",W="_textBtnActive_1n8ok_186";t("default",i({name:"XiaokuAi",setup(){const t=p(),e=a(),i=localStorage.getItem("xiaoku-ai-search"),f=i?JSON.parse(i):{},L=o({musicTagIds:f.musicTagIds?f.musicTagIds:[],enable:!0,instrumentId:f.instrumentId||null,keyword:"",page:1,rows:9999}),D=o({tags:[],tagChildren:[],tagActiveId:f.tagActiveId||"",tagActive:{},tagIndex:f.instrumentId||0,list:[],loading:!1}),U=async()=>{D.loading=!0;try{const t=await h({...L,musicTagIds:[D.tagActiveId,...L.musicTagIds].filter(Boolean)});Array.isArray(t?.data?.rows)&&(D.list=t.data.rows)}catch{}D.loading=!1},P=(t,e)=>{if(!t?.length)return;const n={columnName:t[0].columnName,list:[]},i=[];for(let a=0;a<t.length;a++)n.list.push({name:t[a].name,id:t[a].id,activeIndex:-1}),t[a].children&&i.push(...t[a].children);e.push(n),i.length&&P(i,e)};s((async()=>{D.loading=!0;try{if(await(async()=>{const t=await v();if(Array.isArray(t?.data)&&t.data.length){D.tags=t.data||[];const e=D.tags.findIndex((t=>t.id==D.tagActiveId));if(e>-1){D.tagActiveId=t.data[e].id;const n=[];P(t.data[e].children,n),D.tagChildren=n}else{D.tagActiveId=t.data[0].id;const e=[];P(t.data[0].children,e),D.tagChildren=e}}})(),await U(),await t.getSubjects(),localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:D.tagActiveId,instrumentId:L.instrumentId,musicTagIds:L.musicTagIds})),console.log(L.instrumentId,"forms.instrumentId"),L.instrumentId){let e=[];t.getSubjectInstruments.forEach((t=>{Array.isArray(t.instruments)&&t.instruments.forEach((n=>{L.instrumentId===n.value&&(e=t.instruments||[])}))})),console.log(e,"childInstruments"),e.length>0&&R(e)}}catch{}D.loading=!1}));const R=t=>{const e={};return t?.forEach((t=>{t.id===D.tagIndex&&(e.selected=!0,e.name=t.name)})),e};return()=>r("div",{class:I},[r("div",{class:w},[r("div",{class:x},[r("div",{class:b},[r(d,{size:[20,12]},{default:()=>[r("span",{class:y},[D.tags?.[0]?.columnName]),D.tags.map(((t,e)=>r(l,null,[r(c,{round:!0,secondary:D.tagActiveId!==t.id,type:D.tagActiveId===t.id?"primary":"default",onClick:()=>((t,e)=>{D.tagActiveId=t.id,L.musicTagIds=[],localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:t.id,instrumentId:L.instrumentId,musicTagIds:L.musicTagIds}));const n=[];P(D.tags[e].children,n),D.tagChildren=n,U()})(t,e)},{default:()=>[t.name]})])))]})]),D.tagChildren.map(((t,e)=>r("div",{class:b},[r(d,{size:[20,12]},{default:()=>[r("span",{class:y},[t.columnName]),t.list.map(((n,i)=>r(l,null,[r(c,{round:!0,secondary:t.activeIndex!==i,type:t.activeIndex===i?"primary":"default",onClick:()=>((t,e)=>{const n=D.tagChildren[t].list[D.tagChildren[t].activeIndex],i=D.tagChildren[t].list[e];n&&n.id!==i.id&&(L.musicTagIds=L.musicTagIds.filter((t=>t!==n.id))),L.musicTagIds.includes(i.id)?(L.musicTagIds=L.musicTagIds.filter((t=>t!==i.id)),D.tagChildren[t].activeIndex=-1):(L.musicTagIds.push(i.id),D.tagChildren[t].activeIndex=e),localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:D.tagActiveId,instrumentId:L.instrumentId,musicTagIds:L.musicTagIds})),U()})(e,i)},{default:()=>[n.name]})])))]})]))),r("div",{class:b},[r(d,{size:[20,12]},{default:()=>[r("span",{class:y},[_("乐器")]),t.getSubjectInstruments.map((t=>t.instruments&&t.instruments.length>1?r(g,{options:t.instruments,trigger:"hover",value:D.tagIndex,"onUpdate:value":[t=>D.tagIndex=t,()=>{L.instrumentId=D.tagIndex,localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:D.tagActiveId,instrumentId:D.tagIndex,musicTagIds:L.musicTagIds})),U()}],scrollable:!0,key:t.value,class:[E]},{default:()=>[r(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,r("i",{class:O},null)]})]}):r(c,{round:!0,textColor:D.tagIndex===(t.value||0)?"#fff":"#000",color:D.tagIndex===(t.value||0)?"#198CFE":"rgba(46, 51, 56, .05)",type:D.tagIndex===(t.value||0)?"primary":"default",onClick:()=>{D.tagIndex=t.value||0,L.instrumentId=t.value,localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:D.tagActiveId,instrumentId:t.value,musicTagIds:L.musicTagIds})),U()}},{default:()=>[t.name]})))]})])]),r(n,{round:!0,onSearch:t=>{L.keyword=t,U()}},null)]),r(m,{show:D.loading},{default:()=>[r("div",{class:[A,D.loading?T:""]},[D.list.length>0?D.list.map(((t,n)=>r("div",{class:C},[r("div",{class:S},[r("div",{class:B,key:`item-${n}`,onClick:()=>{sessionStorage.setItem("musicSubjectList",JSON.stringify(t.subjects)),e.push({path:"/xiaoku-music",query:{id:t.id,name:t.name}})}},[r("div",{class:j},[r("div",{class:F},[r("div",{class:z},null),r(u,{objectFit:"cover",src:t.coverImg,lazy:!0,previewDisabled:!0,onLoad:t=>{t.target.dataset.loaded="true"}},null)])]),r("div",{class:N},[t.name])])])]))):"",!D.loading&&D.list.length<=0&&r(k,null,null)])]})])}}))}}}));
|