index.ec2530f5.js 4.7 KB

1
  1. import{d as A,O as F,P as B,Q as E,S as n,g as j,U as D,j as e,F as m,z as p,B as q,C as M,w as S}from"./index.394decd7.js";import{L as R}from"./index.dc786267.js";import{D as x,a as N}from"./index.5d26697d.js";import"./index.9e0d46e4.js";import{T as y}from"./index.dab716ce.js";import{S as z}from"./index.ada5e712.js";import{g as U}from"./music.a1b63125.js";import{S as P}from"./index.06b816c0.js";import{C as $}from"./index.e6e212d8.js";import{b as H}from"./bg-image.e9966434.js";import{T as O}from"./index.88270f6d.js";import"./use-tab-status.723110ee.js";import"./use-id.e2f22365.js";import"./index.224299a1.js";import"./icon-xin2.4ab2a52d.js";import"./index.ae2dd816.js";import"./index.75a0444f.js";import"./index.b9aedd1d.js";const V="_sticky_2w2qn_1",G="_titleActive_2w2qn_31",J="_listContainer_2w2qn_34",K="_line_2w2qn_46",Q="_active_2w2qn_52",Y="_label_2w2qn_55",W="_alumnList_2w2qn_68",X="_bgImg_2w2qn_75",Z="_tagTabs_2w2qn_83",ee="_fleg_2w2qn_113",te="_iconFree_2w2qn_119",ae="_iconFreeDisable_2w2qn_123",se="_searchResult_2w2qn_129",le="_searchTitle_2w2qn_134",re="_radio_2w2qn_139";var s={sticky:V,titleActive:G,listContainer:J,line:K,active:Q,label:Y,alumnList:W,bgImg:X,tagTabs:Z,fleg:ee,iconFree:te,iconFreeDisable:ae,searchResult:se,searchTitle:le,"radio-group":"_radio-group_2w2qn_139",radio:re,"organ-radio":"_organ-radio_2w2qn_170"},ke=A({name:"MusicList",props:{teacherId:{type:String||Number,default:""},myself:{type:Boolean,default:!1}},setup({onItemClick:oe},{expose:ie}){localStorage.setItem("behaviorId",U());const _=F(),k=B(),u=_.query.subjectType||"";let c="";u==="SUBJECT"?c="\u58F0\u90E8\u7EC3\u4E60":u==="MUSIC"?c="\u72EC\u594F\u66F2\u76EE":u==="ENSEMBLE"&&(c="\u5408\u594F\u7EC3\u4E60");const a=E({keyword:_.query.search||"",subjectType:u,page:1,subjectId:null,level:"",type:"",title:c}),l=n(null),v=n(!1),h=n(!1),g=n(!1),o=n({}),w=n(),b=n(j.platformType==="STUDENT"?"/api-student":"/api-teacher"),T=t=>{a.page=1,a.keyword=t,l.value=null,f()},f=async()=>{var r,d,C;v.value=!0,g.value=!1;const t={...a};try{const i=await S.post(`${b.value}/tenantAlbumMusic/page`,{data:t});if(((d=(r=l.value)==null?void 0:r.rows)==null?void 0:d.length)>0&&i.data.pageNo===1)return;if(l.value){const L=(((C=l.value)==null?void 0:C.rows)||[]).concat(i.data.rows||[]);l.value.rows=L}l.value=l.value||i.data,a.page=i.data.pageNo+1,h.value=i.data.pageNo>=i.data.totalPage}catch{g.value=!0}v.value=!1},I=async()=>{const{data:t}=await S.post(`${b.value}/tenantAlbumMusic/selectCondition`,{data:{subjectType:a.subjectType}});o.value=t||{}};return D(async()=>{v.value=!0,await I(),await f()}),()=>e(m,null,[e("div",{class:s.sticky},[e(O,null,{default:()=>[e($,{background:"transparent",isFixed:!1,border:!1,title:c,color:"#131415"},null),e(z,{onSearch:T,type:"tenant",background:"transparent",inputBackground:"transparent"},{left:()=>e(x,null,{default:()=>[e(N,{titleClass:a.subjectId||a.type||a.level?s.titleActive:"",title:"\u7B5B\u9009",ref:w},{default:()=>[e("div",{class:s.searchResult,style:{maxHeight:"45vh",overflowY:"auto"}},[o.value.subjects&&o.value.subjects.length>0&&e(m,null,[e("div",{class:s.searchTitle},[p("\u58F0\u90E8")]),e("div",{class:[s["radio-group"],s.radio,s["organ-radio"]]},[o.value.subjects.map(t=>{const r=t.id===a.subjectId;return e(y,{size:"large",plain:r,type:r?"primary":"default",round:!0,onClick:()=>{a.subjectId=t.id}},{default:()=>[t.name]})})])]),o.value.levelList&&o.value.levelList.length>0&&e(m,null,[e("div",{class:s.searchTitle},[p("\u7EA7\u522B")]),e("div",{class:[s["radio-group"],s.radio,s["organ-radio"]]},[o.value.levelList.map(t=>{const r=t.id===a.level;return e(y,{size:"large",plain:r,type:r?"primary":"default",round:!0,onClick:()=>{a.level=t.id}},{default:()=>[t.value]})})])]),o.value.typeList&&o.value.typeList.length>0&&e(m,null,[e("div",{class:s.searchTitle},[p("\u7C7B\u578B")]),e("div",{class:[s["radio-group"],s.radio,s["organ-radio"]]},[o.value.typeList.map(t=>{const r=t.id===a.type;return e(y,{size:"large",plain:r,type:r?"primary":"default",round:!0,onClick:()=>{a.type=t.id}},{default:()=>[t.value]})})])])]),e("div",{class:["btnGroup","btnMore"]},[e(q,{type:"primary",plain:!0,round:!0,onClick:()=>{a.subjectId=null,a.level="",a.type=""}},{default:()=>[p("\u91CD \u7F6E")]}),e(q,{type:"primary",round:!0,block:!0,onClick:()=>{var t;T(""),(t=w.value)==null||t.toggle()}},{default:()=>[p("\u786E \u8BA4")]})])]})]})})]}),e("img",{class:s.bgImg,src:H},null)]),e("div",{class:s.alumnList},[e(R,{finished:h.value,"finished-text":(l.value&&l.value.rows.length,""),onLoad:f,error:g.value,immediateCheck:!1},{default:()=>[l.value&&l.value.rows.length?e(P,{showTitleImg:!0,list:l.value.rows,onDetail:t=>{k.push({path:"/music-detail",query:{subjectType:u,id:t.id}})}},null):!v.value&&e(M,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]})])])}});export{ke as default};