import{c as n,r}from"./index.ff4c28df.js";import{M as g,s as o}from"./item.57b9d053.js";import{C as d}from"./index.ba731085.js";import{P as f}from"./index.54e86490.js";import{d as p,k as S,f as m,c as e,F as h,aw as y,ax as i,l as b,a as c,O as N,P as l,aM as v}from"./vendor.63aa8b19.js";import"./icon_album_active.66672e6b.js";var u=p({name:"list",props:{auditStatus:{type:String,default:""},onNumber:{type:Function,default:t=>{}}},data(){return{pageInfo:{limit:10,page:1,total:0,page_size:[10,20,40,50]},list:[],loading:!1,dataShow:!1}},mounted(){var t;((t=n.user.data)==null?void 0:t.entryFlag)&&this.getList()},methods:{async getList(){this.loading=!0;try{const{data:t}=await r.post("/api-website/music/sheet/teacher/list",{data:{auditStatus:this.auditStatus,page:this.pageInfo.page,rows:this.pageInfo.limit}});this.list=Array.isArray(t.list.rows)&&t.list.rows.map(a=>(typeof a.paymentType=="string"&&(a.paymentType=a.paymentType.split(",")),a))||[],this.pageInfo.total=t.list.total,t.list.total<=0&&(this.dataShow=!0),this.onNumber({doing:t.doing||0,pass:t.pass||0,unPass:t.unPass||0})}catch{}this.dataShow?this.loading=!1:setTimeout(()=>{this.loading=!1},200)},async onChangeState(t){S.confirm("\u786E\u8BA4\u4E0B\u67B6\u8BE5\u66F2\u8C31\u5417?","\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(async()=>{try{await r.post("/api-website/music/sheet/state/"+t.id),m.success("\u4E0B\u67B6\u6210\u529F"),this.pageInfo.page=1,this.getList()}catch{}})}},render(){var t;return e(h,null,[((t=n.user.data)==null?void 0:t.entryFlag)?e(h,null,[e("div",null,[e(y,{loading:this.loading,animated:!0,class:" w-full m-auto px-[14px] flex items-center flex-col",count:3},{default:()=>[this.list.map(a=>e(g,{onClick:s=>{["PASS","DOING"].includes(this.auditStatus)&&this.$router.push({path:"/muiscDetial",query:{id:s.id}}),(this.auditStatus==="UNPASS"||this.auditStatus==="OUT_SALE")&&(console.log(s),this.$router.push({path:"/userInfo/musicOperation",query:{type:"update",id:s.id}}))},onChangeState:s=>this.onChangeState(s),item:{id:a.id,auditStatus:this.auditStatus,addName:a.addName,addUserAvatar:a.addUserAvatar,musicSheetName:a.musicSheetName,subjectNames:a.subjectNames,exquisiteFlag:a.exquisiteFlag,albumNums:a.albumNums,titleImg:a.titleImg,composer:a.composer,chargeType:a.chargeType,paymentType:a.paymentType||[]},class:[o.musicListItem,"pt-2 cursor-pointer border-b border-solid border-[#E7E6E6] hover:bg-[#F4F4F4]"]},null))],template:()=>e("div",{class:"h-[94px] flex items-center justify-between w-full mb-2 pt-2"},[e("div",{class:"w-2/3 flex items-center"},[e(i,{variant:"circle",style:{width:"88px",height:"88px"}},null),e("div",{class:"w-1/2 pl-2"},[e(i,{variant:"h3"},null),e(i,{variant:"p",style:{width:"50%"}},null)])]),e(i,{variant:"p",style:{width:"20%"}},null)])})]),e(f,{total:this.pageInfo.total,page:this.pageInfo.page,"onUpdate:page":a=>this.pageInfo.page=a,limit:this.pageInfo.limit,"onUpdate:limit":a=>this.pageInfo.limit=a,pageSizes:this.pageInfo.page_size,pagination:this.getList},null),this.dataShow&&e(d,null,null)]):e("div",{class:"px-[38px]"},[e(d,{type:"teacherCert",message:"\u60A8\u8FD8\u672A\u5B8C\u6210\u8FBE\u4EBA\u8BA4\u8BC1\uFF0C\u8BA4\u8BC1\u540E\u624D\u53EF\u4E0A\u4F20\u4E50\u8C31\u54E6~",buttonVisibility:!0,buttonText:"\u53BB\u8BA4\u8BC1",onDetail:()=>{this.$router.push("/teacherAuth")}},null)])])}}),T=p({name:"music-class",data(){const t=sessionStorage.getItem("musicActiveName");return sessionStorage.removeItem("musicActiveName"),{activeName:t||"PASS",num:{doing:0,pass:0,unPass:0}}},render(){return e("div",{class:[o.liveClass,"relative px-[25px]"]},[e(b,{round:!0,type:"primary",class:"absolute right-11 top-4 z-10",onClick:()=>{var t;if((t=n.user.data)==null?void 0:t.entryFlag)this.$router.push({path:"/userInfo/musicOperation"});else{m.error("\u60A8\u8FD8\u672A\u5B8C\u6210\u8FBE\u4EBA\u8BA4\u8BC1\uFF0C\u8BA4\u8BC1\u540E\u624D\u53EF\u4E0A\u4F20\u4E50\u8C31\u54E6");return}}},{default:()=>[c("\u65B0\u5EFA\u4E50\u8C31")]}),e(N,{modelValue:this.activeName,"onUpdate:modelValue":t=>this.activeName=t},{default:()=>[e(l,{label:"\u5DF2\u4E0A\u67B6",name:"PASS"},{default:()=>[this.activeName==="PASS"&&e(u,{auditStatus:"PASS",onNumber:t=>{this.num=t}},null)]}),e(l,{label:"\u5BA1\u6838\u4E2D",name:"DOING"},{default:()=>[this.activeName==="DOING"&&e(u,{auditStatus:"DOING",onNumber:t=>{this.num=t}},null)]}),e(l,{name:"UNPASS"},{default:()=>[this.activeName==="UNPASS"&&e(u,{auditStatus:"UNPASS",onNumber:t=>{this.num=t}},null)],label:()=>e(v,{class:o.badge,value:this.num.unPass,hidden:this.num.unPass===0},{default:()=>[c("\u5BA1\u6838\u5931\u8D25")]})}),e(l,{label:"\u5DF2\u4E0B\u67B6",name:"OUT_SALE"},{default:()=>[this.activeName==="OUT_SALE"&&e(u,{auditStatus:"OUT_SALE",onNumber:t=>{this.num=t}},null)]})]})])}});export{T as default};
