1 |
- import{r as S,c as j}from"./index.ec43d267.js";import{d as m,r as w,S as I,o as f,c as t,a1 as W,a2 as Z,w as C,a as D,F as p}from"./vendor.1514baa4.js";const B="_wrap_3a9v4_1",E="_active_3a9v4_15",N="_searchline_3a9v4_18",y="_searchBtn_3a9v4_20",U="_selectWrap_3a9v4_24",O="_line_3a9v4_72",J="_inputSelect_3a9v4_77",M="_searchIcon_3a9v4_136",G="_searchWrap_3a9v4_139";var c={wrap:B,active:E,searchline:N,searchBtn:y,selectWrap:U,line:O,inputSelect:J,searchIcon:M,searchWrap:G},H="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/Lx6vq37bCuCEh9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3Uvnp/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"},A=(s,o,e="get")=>{if(!s)return"";if(e==="get"){let l=localStorage.getItem(s);return l=l?JSON.parse(l):{name:"",id:""},l}else return localStorage.setItem(s,o),""};var Y=m({name:"searchInput",props:{title:{type:String,default:""},isWhile:{type:Boolean,default:!0},searchVal:{type:Object,default:{}},showSearch:{type:Boolean,default:!1},holder:{type:String,default:"\u641C\u4E00\u641C\u4F60\u60F3\u7EC3\u4E60\u7684\u66F2\u76EE"},type:{type:String,default:"search"}},emits:["startSearch"],setup(s,o){const e=w({title:s.title,search:s.searchVal.search,subject:null,subjectList:[],holder:s.holder});I(()=>s.searchVal,a=>{e.search=a.search?a.search:"",e.subject=Number(s.searchVal.subject||s.searchVal.lessonSubject)?Number(s.searchVal.subject||s.searchVal.lessonSubject):""},{deep:!0});const l=async()=>{var a;console.log("\u8C03\u7528");try{const v=(await S.get("/api-website/open/subject/subjectSelect",{params:{type:"MUSIC"}})).data||[],i=[];v.forEach(r=>{r.subjects&&r.subjects.length>0&&r.subjects.forEach(u=>{i.push(u)})});const h=A(d[s.type==="search"?"SEARCH":"VIDEO"]);console.log(h,"subjects found"),e.subjectList=i;const g=((a=j.user.data)==null?void 0:a.subjectId)||"";if(h.id)e.subject=Number(h.id);else if(g){const r=Number(g.split(",")[0]);e.subject=r,i.forEach(u=>{u.id==r&&A(d[s.type==="search"?"SEARCH":"VIDEO"],JSON.stringify({id:r,name:u.name}),"set")})}}catch(n){console.log(n)}},b=()=>{o.emit("startSearch",{search:e.search,subject:e.subject});const a={id:e.subject,name:""};e.subjectList.forEach(n=>{n.id==a.id&&(a.name=n.name)}),A(d[s.type==="search"?"SEARCH":"VIDEO"],JSON.stringify(a),"set")};return f(()=>{l(),console.log(s.showSearch,"showSearch")}),()=>t(p,null,[t("div",{class:[c.wrap,s.showSearch?c.active:""]},[t("div",{class:c.selectWrap,id:"selectWrap"},[t(W,{modelValue:e.subject,"onUpdate:modelValue":a=>e.subject=a,placeholder:"\u8BF7\u9009\u62E9\u58F0\u90E8",style:"width: 175px",class:["subSelect",e.subject?"hasVal":""]},{default:()=>[e.subjectList.map(a=>t(Z,{label:a.name,value:a.id},null))],suffix:()=>t("div",{class:c.san},null)}),t("div",{class:c.line},null)]),t("div",{class:c.searchWrap},[t("img",{src:H,alt:""},null)]),t(C,{modelValue:e.search,"onUpdate:modelValue":a=>e.search=a,placeholder:e.holder,clearable:!0,class:c.inputSelect},null),t("div",{class:c.searchline},null),t("div",{class:c.searchBtn,onClick:b},[D("\u641C\u7D22")])])])}});export{d as S,Y as s,A as u};
|