index.ab55cb2c.js 5.6 KB

1
  1. import{r as m,c as I}from"./index.6a4e44aa.js";import{d as f,r as S,S as v,o as w,c as t,a1 as W,a2 as Z,w as p,a as C,F as D}from"./vendor.9f3c6e4d.js";const E="_wrap_1gb9v_1",B="_searchline_1gb9v_17",N="_searchBtn_1gb9v_18",y="_selectWrap_1gb9v_21",U="_line_1gb9v_69",O="_inputSelect_1gb9v_74",J="_searchIcon_1gb9v_133",M="_searchWrap_1gb9v_136";var c={wrap:E,searchline:B,searchBtn:N,selectWrap:y,line:U,inputSelect:O,searchIcon:J,searchWrap:M},G="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAyCAYAAAAayliMAAAAAXNSR0IArs4c6QAACA1JREFUaEPVWW1wVOUVfs7dzRchaBypjKMQIWpZdjf4QfYmaapgAy1+YG32RoLaYaCdsS1tUaZT/5T0l21VcNCZtiPilJZC7oIUZqAw7RAacHfzQQ1718hHSvGjrRJqtAQSsnvv6dzNhJK97967m8QMfX/uOed5n+e978c5ZwnjGJ6o6nEZWMQSLyDQHQzMIkYJQIUMvkTAZwDOgOgEsRExXMaheOXyD8YxpSWUcgXztKszXDqtBvGTYNyRUzwRA9xGjK2YMrg1VvHUxZziBc5ZCyhvVacX5eEnAFYBKBrvxEw4D9CG/oH+jWcXrhwcK15WAvxtodVs8M8B3DDWiWziegB+Wqtq+PNYsG0FlEd/N60I+ZvBCI4FPNsYBgwAz8c/wHooip5tnOmXUcDwXucDAFXkAjhO390DN05d3nP70svZ4ggFeKN7bgJfPkpAuSMQ0afEOGQQwiCclAzq1aXkIOmuYon5ZnbRXIBrYeDLIBQ44gF/0kvwULdXGcrC1/oFPHF1qusC/gLgblsAok5mfrF/8OKebA6h78i2UuQXrAAbz4JRZofNxDvigYZGENhJhOUL+CLqNgCNNoHnwFirVSu/dwIX2T2qmu+aiWeYsZ6AwkwYTLQuLgdfcppjlAB/OPQUE/8mMyi6jASWddcq7zsBO9n90V0ys74bwIwMvkMSS/Lx6vq37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PNFl5biK3Uvnp/QVTzveHGHhYjMtn+5g8H1YrA5nmHd0XioSaGLw+I0mJtl241L86m06ck9DUlWlgNxiyDbllsSplrx3WKAH3dP46byhRegSAJWkaASGgPUlYOZ5M1d8eeoB1fgPArRnJEb2mycFvOy2EpbU4P7K9TIcrCuCmzOAYIsLrRtJ4KV7zuLieFgT7IzsDzMZzkOgR8/q2wT/WZ6DWbutctaBWGH/nrruNhH6YYP7fZTsYjKOQsB86h9mln4wHTvWCmoz7W1rc59y9N1O+NJcMo5YYj2Y6qGkz9NAUd02s4rFzTqs/6hZKd67oUCt1HfuIxR0zG3CzDZgAkJ8Ngat9iOgdMnjJ8WrlH74j22YjL29TgtzfPBF47N9ZHeJ0J3+Heicn8SYAT65kcvUnwsGkgcbuauWT4XZj8jCBZwF8XGdaZP4uwnT8j8x/cGsxX1do5ierwZByJZaF/wBAP9Xk+l+Y78zcv+6a5b6sHx6dUtDbOvNXRCIcBYwQ8IZD1SDeKKodsiApcmEQ9rBurBu5CDyd6kxXAib52ywBhGNIJOq02hV9o7ZdrpN7o2odGGsI+GqGZqwT5AUAu5ikjXG5Pna1sy/SvAmgNTa3U6drIK+ua+HXP7W9hZwYmPa7WtXpyTw8yMQLiWkBgDnCg0u4CKZTIIQlxiF3XuGBTG361DuULFVh3lgZBhHa+91YfOZexeymZP6XMhsRo3xamtz+It+MJPRpbjYK4ZYuJhmfdS8IfpxLDnVPZ2feUOKM2ZV4xIZD2wANLe6Rn/hP1mcgZ0HjCPDE1Xz3BdrFYEsRfwWWEBlKFiy5JgWYJMv3byooKp1hXuFLbdbiwDUrICXi9P6CovP9f8DwhZE26ILhlr52TQswGZe1vFE4taB4DxEWX6WgnyRaGgsEj1zzAlIi/t5SWPJx714w6gDzVsODI82G/wsBpohbwmrR9YRmuGlDfEHQfOxS47+y8wc8/IF7YgAAAABJRU5ErkJggg==";const d={SEARCH:"music-songbook-subject",VIDEO:"video-subject"},g=(a,i,e="get")=>{if(!a)return"";if(e==="get"){let l=localStorage.getItem(a);return l=l?JSON.parse(l):{name:"",id:""},l}else return localStorage.setItem(a,i),""};var R=f({name:"searchInput",props:{title:{type:String,default:""},isWhile:{type:Boolean,default:!0},searchVal:{type:Object,default:{}},holder:{type:String,default:"\u641C\u4E00\u641C\u4F60\u60F3\u7EC3\u4E60\u7684\u66F2\u76EE"},type:{type:String,default:"search"}},emits:["startSearch"],setup(a,i){const e=S({title:a.title,search:a.searchVal.search,subject:null,subjectList:[],holder:a.holder});v(()=>a.searchVal,s=>{e.search=s.search?s.search:"",e.subject=Number(a.searchVal.subject||a.searchVal.lessonSubject)?Number(a.searchVal.subject||a.searchVal.lessonSubject):""},{deep:!0});const l=async()=>{var s;console.log("\u8C03\u7528");try{const j=(await m.get("/api-website/open/subject/subjectSelect",{params:{type:"MUSIC"}})).data||[],o=[];j.forEach(r=>{r.subjects&&r.subjects.length>0&&r.subjects.forEach(u=>{o.push(u)})});const h=g(d[a.type==="search"?"SEARCH":"VIDEO"]);console.log(h,"subjects found"),e.subjectList=o;const A=((s=I.user.data)==null?void 0:s.subjectId)||"";if(h.id)e.subject=Number(h.id);else if(A){const r=Number(A.split(",")[0]);e.subject=r,o.forEach(u=>{u.id==r&&g(d[a.type==="search"?"SEARCH":"VIDEO"],JSON.stringify({id:r,name:u.name}),"set")})}}catch(n){console.log(n)}},b=()=>{i.emit("startSearch",{search:e.search,subject:e.subject});const s={id:e.subject,name:""};e.subjectList.forEach(n=>{n.id==s.id&&(s.name=n.name)}),g(d[a.type==="search"?"SEARCH":"VIDEO"],JSON.stringify(s),"set")};return w(()=>{l()}),()=>t(D,null,[t("div",{class:[c.wrap]},[t("div",{class:c.selectWrap,id:"selectWrap"},[t(W,{modelValue:e.subject,"onUpdate:modelValue":s=>e.subject=s,placeholder:"\u8BF7\u9009\u62E9\u58F0\u90E8",style:"width: 175px",class:["subSelect",e.subject?"hasVal":""]},{default:()=>[e.subjectList.map(s=>t(Z,{label:s.name,value:s.id},null))],suffix:()=>t("div",{class:c.san},null)}),t("div",{class:c.line},null)]),t("div",{class:c.searchWrap},[t("img",{src:G,alt:""},null)]),t(p,{modelValue:e.search,"onUpdate:modelValue":s=>e.search=s,placeholder:e.holder,clearable:!0,class:c.inputSelect},null),t("div",{class:c.searchline},null),t("div",{class:c.searchBtn,onClick:b},[C("\u641C\u7D22")])])])}});export{d as S,R as s,g as u};