1 |
- System.register(["./index-legacy-7963955d-1724872791500.js","./index-legacy-508a3c9b-1724872791500.js","./api-legacy-aef9f6ea-1724872791500.js","./index-legacy-d33e259a-1724872791500.js","./catchData-legacy-1ba95ddb-1724872791500.js"],(function(e,t){"use strict";var i,a,n,l,r,c,o,d,s,h,_,u,g,m,f,v,p,I,w,x,b,y;return{setters:[e=>{i=e.T},e=>{a=e.d,n=e.u,l=e.e,r=e.q,c=e.f,o=e.N,d=e.g,s=e.x,h=e.F,_=e.j,u=e.aC,g=e.E,m=e.w,f=e.D,v=e.aO,p=e.r,I=e.A},e=>{w=e.a,x=e.b},e=>{b=e.T},e=>{y=e.u}],execute:function(){var S=document.createElement("style");S.textContent='._container_1hf18_1{display:flex;flex-direction:column;background:#FFFFFF;border-radius:1.04166667vw;min-height:100%}._tools_1hf18_8{padding:1.66666667vw 1.66666667vw 1.04166667vw;display:flex;align-items:flex-start;flex-shrink:0}._tools_1hf18_8 .n-input{margin-left:auto;width:18.75vw}._tools_1hf18_8 .n-input__input-el{height:100%;line-height:100%}._tools_1hf18_8 .n-button.n-button--disabled{cursor:initial;padding:0}._tools_1hf18_8 ._tagWrap_1hf18_26{flex:1;margin-right:1.45833333vw}._tools_1hf18_8 ._tags_1hf18_30{padding:.625vw 0}._tools_1hf18_8 ._tags_1hf18_30 ._firstButton_1hf18_33{display:flex;align-items:center;justify-content:center;height:100%;font-size:max(.9375rem,13Px);color:#999;line-height:1.30208333vw}._tools_1hf18_8 ._tags_1hf18_30 .n-form-item-label{height:1.92708333vw;min-height:1.92708333vw}._tools_1hf18_8 ._tags_1hf18_30 .n-form-item-feedback-wrapper{min-height:0}._tools_1hf18_8 ._tags_1hf18_30 .n-button{min-width:5.3125vw;height:1.92708333vw;padding:0 1.25vw;font-size:max(.9375rem,13Px)}._tools_1hf18_8 ._tags_1hf18_30 .n-button--primary-type{font-weight:500!important}._content_1hf18_58{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_1hf18_58._loadingContent_1hf18_68{min-height:50vh}._content_1hf18_58 ._itemWrap_1hf18_71{width:calc(100% / 6);padding-bottom:calc(100% / 6 * .909923);position:relative}._content_1hf18_58 ._itemWrap_1hf18_71 ._itemWrapBox_1hf18_76{position:absolute;left:0;top:0;width:100%;height:100%;padding:0 .625vw}._item_1hf18_71{margin:0 auto;position:relative;width:11.14583333vw;cursor:pointer;transition:all .3s}._item_1hf18_71 ._cover_1hf18_91{position:relative;overflow:hidden}._item_1hf18_71 ._cover_1hf18_91:before{content:"";position:absolute;top:5.57291667vw;left:0;width:11.14583333vw;height:11.14583333vw;background:#DDF2FF;border-radius:50%}._item_1hf18_71:hover{transform:scale(1.1)}._item_1hf18_71 ._itemImg_1hf18_108{position:relative;width:8.22916667vw;height:11.61458333vw;margin:auto;background-color:#edeff2;background-image:url('+new URL("icon_default-495cec59.svg",t.meta.url).href+');background-repeat:no-repeat;background-position:center center}._item_1hf18_71 ._itemImg_1hf18_108:before{content:"";position:absolute;top:.20833333vw;right:-.20833333vw;width:.20833333vw;height:calc(100% - .41666667vw);background-color:#c5c5c5;z-index:1}._item_1hf18_71 ._itemImg_1hf18_108:after{content:"";position:absolute;top:.10416667vw;right:-.10416667vw;width:.20833333vw;height:calc(100% - .20833333vw);background-color:#e7e7e7;z-index:2}._item_1hf18_71 ._itemImg_1hf18_108 ._itemBg_1hf18_138{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_1hf18_71 ._itemImg_1hf18_108 .n-image{position:relative;width:100%;height:100%;z-index:3}._item_1hf18_71 ._itemImg_1hf18_108 img{transition:opacity .3s;opacity:0}._item_1hf18_71 ._itemImg_1hf18_108 img[data-loaded=true]{opacity:1}._item_1hf18_71 ._itemName_1hf18_163{margin-top:.83333333vw;font-size:max(.83333333rem,12Px);line-height:1.14583333vw;font-weight:500;color:#333;text-align:center}._popSelect1_1hf18_171{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_1hf18_171 .n-base-select-option__content{width:80%!important}._textBtn_1hf18_181 ._iconArrow_1hf18_181{display:inline-block;margin-left:.41666667vw;margin-top:.10416667vw;width:.41666667vw;height:.26041667vw;background:url('+new URL("icon-arrow-8824ea53.svg",t.meta.url).href+") no-repeat center center / contain;transform:rotate(180deg);color:#131415;fill:#131415}._textBtn_1hf18_181:hover,._textBtn_1hf18_181._textBtnActive_1hf18_193{background:#198CFE!important;font-weight:500!important;color:#fff!important}._textBtn_1hf18_181:hover ._iconArrow_1hf18_181,._textBtn_1hf18_181._textBtnActive_1hf18_193 ._iconArrow_1hf18_181{transform:rotate(0);background:url("+new URL("icon-arrow2-36201eb5.svg",t.meta.url).href+") no-repeat center center / contain;color:#fff;fill:#fff;margin-top:0}\n",document.head.appendChild(S);const A="_container_1hf18_1",k="_tools_1hf18_8",N="_tagWrap_1hf18_26",C="_tags_1hf18_30",j="_content_1hf18_58",T="_loadingContent_1hf18_68",B="_itemWrap_1hf18_71",F="_itemWrapBox_1hf18_76",z="_item_1hf18_71",E="_cover_1hf18_91",O="_itemImg_1hf18_108",P="_itemBg_1hf18_138",R="_itemName_1hf18_163",J="_popSelect1_1hf18_171",W="_textBtn_1hf18_181",D="_iconArrow_1hf18_181",L="_textBtnActive_1hf18_193";function U(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)}const q=a({name:"ChildNodeSearch",props:{activeRow:{type:Object,default:()=>({})},list:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1}},emits:["selectChildTag"],setup(e,{emit:t}){const{activeRow:i}=v(e),a=p({});I((()=>e.activeRow),(()=>{i.value=e.activeRow,n()}));const n=()=>{i.value.activeIndex?(i.value.children||[]).forEach((e=>{if(e.id===i.value.activeIndex){let t,i="";e.children&&(t=[{columnName:e.children[0].columnName,name:"全部",id:""},...e.children],i=e.children[0].columnName,a.value={...e,columnName:i,activeIndex:e.activeIndex,children:t})}})):a.value={}};return r((()=>{n()})),()=>c(h,null,[i.value?.id&&c(h,null,[c(d,{label:i.value.columnName+"",class:C},{default:()=>[c(s,{size:[12,8]},{default:()=>[i.value?.children.map((n=>c(h,null,[c(_,{round:!0,secondary:(i.value.activeIndex||"")!=n.id,type:(i.value.activeIndex||"")==n.id?"primary":"default",onClick:()=>{if(e.loading)return;let l;i.value.activeIndex=n.id;let r="";n.children?(l=[{columnName:n.children[0].columnName,name:"全部",id:""},...n.children],r=n.children[0].columnName,a.value={...n,columnName:r,activeIndex:"",children:l}):a.value={},t("selectChildTag",i.value.activeIndex)}},{default:()=>[n.name]})])))]})]}),c(q,{activeRow:a.value,onSelectChildTag:e=>{t("selectChildTag",e||i.value.activeIndex)}},null)])])}});e("default",a({name:"XiaokuAi",setup(){const e=y(),t=n(),a=localStorage.getItem("xiaoku-ai-search"),f=a?JSON.parse(a):{},v=f.childSelectId||f.tagActiveId,p=l({musicTagIds:v?[v]:[],enable:!0,instrumentId:f.instrumentId||null,keyword:"",page:1,rows:9999}),I=l({tags:[],tagChildren:[],tagActiveId:f.tagActiveId||"",tagActive:{},tagIndex:f.instrumentId||0,list:[],loading:!1,selectParents:{},childSelectId:f.childSelectId||null}),S=(e,t,i=[])=>{for(const a of t){if(a.children&&a.children.length>0){const t=S(e,a.children,[...i,a.id]);if(t.includes(e))return t}if(a.id===e)return[...i,e]}return i},X=(e,t)=>{for(const i of t){if(e.includes(i.id)&&i.children&&i.children.length>0){let t;i.children.forEach((i=>{e.includes(i.id)&&(t=i.id)})),i.activeIndex=t}i.children&&i.children.length>0&&X(e,i.children)}},$=e=>{for(const t of e)t.children&&t.children.length,t.activeIndex="",t.children&&t.children.length>0&&$(t.children)},G=async()=>{I.loading=!0;try{const e=I.childSelectId||I.tagActiveId,t=await x({...p,musicTagIds:[e]});Array.isArray(t?.data?.rows)&&(I.list=t.data.rows)}catch{}I.loading=!1};r((async()=>{I.loading=!0;try{if(await(async()=>{const e=await w();if(Array.isArray(e?.data)&&e.data.length){const t=e.data||[];if(I.tags=[{columnName:t[0].columnName,name:"全部",id:""},...t],I.tagActiveId){let e=S(f.childSelectId,I.tags);const t=e.findIndex((e=>e===f.childSelectId));e=e.slice(0,t+1),X(e,I.tags),I.tags.forEach((t=>{if(t.id===I.tagActiveId){let i,a="";if(t.children){let n;i=[{columnName:t.children[0].columnName,name:"全部",id:""},...t.children],a=t.children[0].columnName,t.children.forEach((t=>{e.includes(t.id)&&(n=t.id)})),I.selectParents={...t,columnName:a,activeIndex:n||"",children:i}}else I.selectParents={}}}))}else I.tagActiveId=I.tags[0].id}})(),await G(),await e.getSubjects(),localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:I.tagActiveId,instrumentId:p.instrumentId,childSelectId:I.childSelectId,musicTagIds:p.musicTagIds})),p.instrumentId){let t=[];e.getSubjectInstruments.forEach((e=>{Array.isArray(e.instruments)&&e.instruments.forEach((i=>{p.instrumentId===i.value&&(t=e.instruments||[])}))})),t.length>0&&H(t)}}catch{}I.loading=!1}));const H=e=>{const t={};return e?.forEach((e=>{e.id===I.tagIndex&&(t.selected=!0,t.name=e.name)})),t};return()=>{let a,n;return c("div",{class:A},[c("div",{class:k},[c("div",{class:N},[c(o,{labelAlign:"left",labelPlacement:"left"},{default:()=>[c(d,{label:I.tags?.[0]?.columnName||"",class:C},{default:()=>[c(s,{size:[12,8]},U(a=I.tags.map((e=>c(h,null,[c(_,{round:!0,secondary:I.tagActiveId!==e.id,type:I.tagActiveId===e.id?"primary":"default",onClick:()=>(e=>{if(I.loading)return;let t;I.tagActiveId=e.id,I.childSelectId=null,$(I.tags);let i="";e.children?(t=[{columnName:e.children[0].columnName,name:"全部",id:""},...e.children],i=e.children[0].columnName,I.selectParents={...e,columnName:i,activeIndex:"",children:t}):I.selectParents={},localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:I.tagActiveId,instrumentId:p.instrumentId,childSelectId:I.childSelectId})),G()})(e)},{default:()=>[e.name]})]))))?a:{default:()=>[a]})]}),c(q,{activeRow:I.selectParents,loading:I.loading,onSelectChildTag:e=>{I.childSelectId=e,localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:I.tagActiveId,instrumentId:p.instrumentId,childSelectId:I.childSelectId,musicTagIds:p.musicTagIds})),G()}},null),c(d,{label:"乐器",class:C},{default:()=>[c(s,{size:[12,8]},U(n=e.getSubjectInstruments.map((e=>e.instruments&&e.instruments.length>1?c(u,{options:e.instruments,trigger:"hover",value:I.tagIndex,"onUpdate:value":[e=>I.tagIndex=e,()=>{p.instrumentId=I.tagIndex,localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:I.tagActiveId,instrumentId:I.tagIndex,musicTagIds:p.musicTagIds})),G()}],scrollable:!0,key:e.value,class:[J]},{default:()=>[c(_,{round:!0,textColor:H(e.instruments).selected?"#fff":"#000",color:H(e.instruments).selected?"#198CFE":"rgba(46, 51, 56, .05)",type:H(e.instruments).selected?"primary":"default",class:[W,H(e.instruments).selected&&L]},{default:()=>[H(e.instruments).name||e.name,c("i",{class:D},null)]})]}):c(_,{round:!0,textColor:I.tagIndex===(e.value||0)?"#fff":"#000",color:I.tagIndex===(e.value||0)?"#198CFE":"rgba(46, 51, 56, .05)",type:I.tagIndex===(e.value||0)?"primary":"default",onClick:()=>{I.tagIndex=e.value||0,p.instrumentId=e.value,localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:I.tagActiveId,instrumentId:e.value,musicTagIds:p.musicTagIds})),G()}},{default:()=>[e.name]}))))?n:{default:()=>[n]})]})]})]),c(i,{round:!0,onSearch:e=>{p.keyword=e,G()}},null)]),c(g,{show:I.loading},{default:()=>[c("div",{class:[j,I.loading?T:""]},[I.list.length>0?I.list.map(((e,i)=>c("div",{class:B},[c("div",{class:F},[c("div",{class:z,key:`item-${i}`,onClick:()=>{sessionStorage.setItem("musicSubjectList",JSON.stringify(e.subjects)),t.push({path:"/xiaoku-music",query:{id:e.id,name:e.name}})}},[c("div",{class:E},[c("div",{class:O},[c("div",{class:P},null),c(m,{objectFit:"cover",src:e.coverImg,lazy:!0,previewDisabled:!0,onLoad:e=>{e.target.dataset.loaded="true"}},null)])]),c("div",{class:R},[e.name])])])]))):"",!I.loading&&I.list.length<=0&&c(b,null,null)])]})])}}}))}}}));
|