1 |
- System.register(["./index-legacy-4d465a36-1720699367816.js","./index-legacy-e0181e36-1720699367816.js","./api-legacy-4f8e78c7-1720699367816.js","./index-legacy-de40bbb0-1720699367816.js","./catchData-legacy-09d2944a-1720699367816.js"],(function(e,t){"use strict";var i,a,n,l,r,c,o,d,s,u,_,g,m,h,v,b,f,p,I,w;return{setters:[e=>{i=e.T},e=>{a=e.d,n=e.u,l=e.e,r=e.q,c=e.f,o=e.x,d=e.F,s=e.j,u=e.k,_=e.aC,g=e.E,m=e.w,h=e.aO,v=e.r,b=e.A},e=>{f=e.a,p=e.b},e=>{I=e.T},e=>{w=e.u}],execute:function(){var z=document.createElement("style");z.textContent='._container_7qbzu_1{display:flex;flex-direction:column;background:#FFFFFF;border-radius:1.04166667vw;min-height:100%}._tools_7qbzu_8{padding:1.66666667vw 1.66666667vw 1.04166667vw;display:flex;align-items:flex-start;flex-shrink:0}._tools_7qbzu_8 .n-input{margin-left:auto;width:18.75vw}._tools_7qbzu_8 .n-input__input-el{height:100%;line-height:100%}._tools_7qbzu_8 .n-button.n-button--disabled{cursor:initial;padding:0}._tools_7qbzu_8 ._tagWrap_7qbzu_26{flex:1;margin-right:1.45833333vw}._tools_7qbzu_8 ._tags_7qbzu_30{padding:.625vw 0}._tools_7qbzu_8 ._tags_7qbzu_30 ._firstButton_7qbzu_33{display:flex;align-items:center;justify-content:center;height:100%;font-size:max(.9375rem,13Px);color:#999;line-height:1.30208333vw}._tools_7qbzu_8 ._tags_7qbzu_30 .n-button{min-width:5.3125vw;height:1.92708333vw;padding:0 1.25vw;font-size:max(.9375rem,13Px)}._tools_7qbzu_8 ._tags_7qbzu_30 .n-button--primary-type{font-weight:500!important}._content_7qbzu_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_7qbzu_51._loadingContent_7qbzu_61{min-height:50vh}._content_7qbzu_51 ._itemWrap_7qbzu_64{width:calc(100% / 6);padding-bottom:calc(100% / 6 * .909923);position:relative}._content_7qbzu_51 ._itemWrap_7qbzu_64 ._itemWrapBox_7qbzu_69{position:absolute;left:0;top:0;width:100%;height:100%;padding:0 .625vw}._item_7qbzu_64{margin:0 auto;position:relative;width:11.14583333vw;cursor:pointer;transition:all .3s}._item_7qbzu_64 ._cover_7qbzu_84{position:relative;overflow:hidden}._item_7qbzu_64 ._cover_7qbzu_84:before{content:"";position:absolute;top:5.57291667vw;left:0;width:11.14583333vw;height:11.14583333vw;background:#DDF2FF;border-radius:50%}._item_7qbzu_64:hover{transform:scale(1.1)}._item_7qbzu_64 ._itemImg_7qbzu_101{position:relative;width:8.22916667vw;height:11.61458333vw;margin:auto;background-color:#edeff2;background-image:url('+new URL("icon_default-18367801.svg",t.meta.url).href+');background-repeat:no-repeat;background-position:center center}._item_7qbzu_64 ._itemImg_7qbzu_101:before{content:"";position:absolute;top:.20833333vw;right:-.20833333vw;width:.20833333vw;height:calc(100% - .41666667vw);background-color:#c5c5c5;z-index:1}._item_7qbzu_64 ._itemImg_7qbzu_101:after{content:"";position:absolute;top:.10416667vw;right:-.10416667vw;width:.20833333vw;height:calc(100% - .20833333vw);background-color:#e7e7e7;z-index:2}._item_7qbzu_64 ._itemImg_7qbzu_101 ._itemBg_7qbzu_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_7qbzu_64 ._itemImg_7qbzu_101 .n-image{position:relative;width:100%;height:100%;z-index:3}._item_7qbzu_64 ._itemImg_7qbzu_101 img{transition:opacity .3s;opacity:0}._item_7qbzu_64 ._itemImg_7qbzu_101 img[data-loaded=true]{opacity:1}._item_7qbzu_64 ._itemName_7qbzu_156{margin-top:.83333333vw;font-size:max(.83333333rem,12Px);line-height:1.14583333vw;font-weight:500;color:#333;text-align:center}._popSelect1_7qbzu_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_7qbzu_164 .n-base-select-option__content{width:80%!important}._textBtn_7qbzu_174 ._iconArrow_7qbzu_174{display:inline-block;margin-left:.41666667vw;margin-top:.10416667vw;width:.41666667vw;height:.26041667vw;background:url('+new URL("icon-arrow-66c56d73.svg",t.meta.url).href+") no-repeat center center / contain;transform:rotate(180deg);color:#131415;fill:#131415}._textBtn_7qbzu_174:hover,._textBtn_7qbzu_174._textBtnActive_7qbzu_186{background:#198CFE!important;font-weight:500!important;color:#fff!important}._textBtn_7qbzu_174:hover ._iconArrow_7qbzu_174,._textBtn_7qbzu_174._textBtnActive_7qbzu_186 ._iconArrow_7qbzu_174{transform:rotate(0);background:url("+new URL("icon-arrow2-3d2121db.svg",t.meta.url).href+") no-repeat center center / contain;color:#fff;fill:#fff;margin-top:0}\n",document.head.appendChild(z);const q="_container_7qbzu_1",x="_tools_7qbzu_8",y="_tagWrap_7qbzu_26",S="_tags_7qbzu_30",A="_firstButton_7qbzu_33",k="_content_7qbzu_51",N="_loadingContent_7qbzu_61",C="_itemWrap_7qbzu_64",T="_itemWrapBox_7qbzu_69",B="_item_7qbzu_64",j="_cover_7qbzu_84",F="_itemImg_7qbzu_101",E="_itemBg_7qbzu_131",R="_itemName_7qbzu_156",O="_popSelect1_7qbzu_164",P="_textBtn_7qbzu_174",J="_iconArrow_7qbzu_174",W="_textBtnActive_7qbzu_186",L=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}=h(e),a=v({});b((()=>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(d,null,[i.value?.id&&c(d,null,[c("div",{class:S},[c(o,{size:[12,8]},{default:()=>[c("span",{class:A},[i.value.columnName]),i.value?.children.map((n=>c(d,null,[c(s,{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(L,{activeRow:a.value,onSelectChildTag:e=>{t("selectChildTag",e||i.value.activeIndex)}},null)])])}});e("default",a({name:"XiaokuAi",setup(){const e=w(),t=n(),a=localStorage.getItem("xiaoku-ai-search"),h=a?JSON.parse(a):{},v=h.childSelectId||h.tagActiveId,b=l({musicTagIds:v?[v]:[],enable:!0,instrumentId:h.instrumentId||null,keyword:"",page:1,rows:9999}),z=l({tags:[],tagChildren:[],tagActiveId:h.tagActiveId||"",tagActive:{},tagIndex:h.instrumentId||0,list:[],loading:!1,selectParents:{},childSelectId:h.childSelectId||null}),D=(e,t,i=[])=>{for(const a of t){if(a.children&&a.children.length>0){const t=D(e,a.children,[...i,a.id]);if(t.includes(e))return t}if(a.id===e)return[...i,e]}return i},U=(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&&U(e,i.children)}},X=e=>{for(const t of e)t.children&&t.children.length,t.activeIndex="",t.children&&t.children.length>0&&X(t.children)},$=async()=>{z.loading=!0;try{const e=z.childSelectId||z.tagActiveId,t=await p({...b,musicTagIds:[e]});Array.isArray(t?.data?.rows)&&(z.list=t.data.rows)}catch{}z.loading=!1};r((async()=>{z.loading=!0;try{if(await(async()=>{const e=await f();if(Array.isArray(e?.data)&&e.data.length){const t=e.data||[];if(z.tags=[{columnName:t[0].columnName,name:"全部",id:""},...t],z.tagActiveId){let e=D(h.childSelectId,z.tags);const t=e.findIndex((e=>e===h.childSelectId));e=e.slice(0,t+1),U(e,z.tags),z.tags.forEach((t=>{if(t.id===z.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)})),z.selectParents={...t,columnName:a,activeIndex:n||"",children:i}}else z.selectParents={}}}))}else z.tagActiveId=z.tags[0].id}})(),await $(),await e.getSubjects(),localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:z.tagActiveId,instrumentId:b.instrumentId,childSelectId:z.childSelectId,musicTagIds:b.musicTagIds})),b.instrumentId){let t=[];e.getSubjectInstruments.forEach((e=>{Array.isArray(e.instruments)&&e.instruments.forEach((i=>{b.instrumentId===i.value&&(t=e.instruments||[])}))})),t.length>0&&G(t)}}catch{}z.loading=!1}));const G=e=>{const t={};return e?.forEach((e=>{e.id===z.tagIndex&&(t.selected=!0,t.name=e.name)})),t};return()=>c("div",{class:q},[c("div",{class:x},[c("div",{class:y},[c("div",{class:S},[c(o,{size:[12,8]},{default:()=>[c("span",{class:A},[z.tags?.[0]?.columnName]),z.tags.map((e=>c(d,null,[c(s,{round:!0,secondary:z.tagActiveId!==e.id,type:z.tagActiveId===e.id?"primary":"default",onClick:()=>(e=>{if(z.loading)return;let t;z.tagActiveId=e.id,z.childSelectId=null,X(z.tags);let i="";e.children?(t=[{columnName:e.children[0].columnName,name:"全部",id:""},...e.children],i=e.children[0].columnName,z.selectParents={...e,columnName:i,activeIndex:"",children:t}):z.selectParents={},localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:z.tagActiveId,instrumentId:b.instrumentId,childSelectId:z.childSelectId})),$()})(e)},{default:()=>[e.name]})])))]})]),c(L,{activeRow:z.selectParents,loading:z.loading,onSelectChildTag:e=>{z.childSelectId=e,localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:z.tagActiveId,instrumentId:b.instrumentId,childSelectId:z.childSelectId,musicTagIds:b.musicTagIds})),$()}},null),c("div",{class:S},[c(o,{size:[12,8]},{default:()=>[c("span",{class:A},[u("乐器")]),e.getSubjectInstruments.map((e=>e.instruments&&e.instruments.length>1?c(_,{options:e.instruments,trigger:"hover",value:z.tagIndex,"onUpdate:value":[e=>z.tagIndex=e,()=>{b.instrumentId=z.tagIndex,localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:z.tagActiveId,instrumentId:z.tagIndex,musicTagIds:b.musicTagIds})),$()}],scrollable:!0,key:e.value,class:[O]},{default:()=>[c(s,{round:!0,textColor:G(e.instruments).selected?"#fff":"#000",color:G(e.instruments).selected?"#198CFE":"rgba(46, 51, 56, .05)",type:G(e.instruments).selected?"primary":"default",class:[P,G(e.instruments).selected&&W]},{default:()=>[G(e.instruments).name||e.name,c("i",{class:J},null)]})]}):c(s,{round:!0,textColor:z.tagIndex===(e.value||0)?"#fff":"#000",color:z.tagIndex===(e.value||0)?"#198CFE":"rgba(46, 51, 56, .05)",type:z.tagIndex===(e.value||0)?"primary":"default",onClick:()=>{z.tagIndex=e.value||0,b.instrumentId=e.value,localStorage.setItem("xiaoku-ai-search",JSON.stringify({tagActiveId:z.tagActiveId,instrumentId:e.value,musicTagIds:b.musicTagIds})),$()}},{default:()=>[e.name]})))]})])]),c(i,{round:!0,onSearch:e=>{b.keyword=e,$()}},null)]),c(g,{show:z.loading},{default:()=>[c("div",{class:[k,z.loading?N:""]},[z.list.length>0?z.list.map(((e,i)=>c("div",{class:C},[c("div",{class:T},[c("div",{class:B,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:j},[c("div",{class:F},[c("div",{class:E},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])])])]))):"",!z.loading&&z.list.length<=0&&c(I,null,null)])]})])}}))}}}));
|