index.c98fe1e6.js 4.5 KB

1
  1. import{q as n,r}from"./index.1f84bfe1.js";import{M as g,s as o}from"./item.d6030152.js";import{C as d}from"./index.2d005e3b.js";import{P as f}from"./index.df62445e.js";import{d as m,j as S,E as h,c as e,F as p,aj as N,ak as i,k as b,a as c,C as v,D as l,ay as y}from"./vendor.9f3c6e4d.js";var u=m({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=t.list.rows||[],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),h.success("\u4E0B\u67B6\u6210\u529F"),this.pageInfo.page=1,this.getList()}catch{}})}},render(){var t;return e(p,null,[((t=n.user.data)==null?void 0:t.entryFlag)?e(p,null,[e("div",null,[e(N,{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,titleImg:a.titleImg,composer:a.composer,chargeType:a.chargeType},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)])])}}),P=m({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{h.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(v,{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(y,{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{P as default};