import{q as s,r as n}from"./index.1f84bfe1.js";import{C as r}from"./index.2d005e3b.js";import{P as f}from"./index.df62445e.js";import{I as m}from"./index.c0eb749d.js";import{d as u,j as g,E as d,c as e,F as p,aj as v,ak as i,k as S,a as x,C as w,D as l}from"./vendor.9f3c6e4d.js";const y="_liveClass_1u6h7_1",I="_items_1u6h7_21";var h={liveClass:y,items:I},o=u({name:"list",props:{auditStatus:{type:String,default:""}},data(){return{pageInfo:{limit:9,page:1,total:0,page_size:[10,20,40,50]},list:[],loading:!0,dataShow:!1}},mounted(){var t;((t=s.user.data)==null?void 0:t.entryFlag)&&this.getList()},methods:{async getList(){var t;this.loading=!0;try{const{data:a}=await n.post("/api-website/videoLessonGroup/page",{data:{auditStatus:this.auditStatus,page:this.pageInfo.page,rows:this.pageInfo.limit,teacherId:(t=s.user.data)==null?void 0:t.userId}});this.list=a.rows||[],this.pageInfo.total=a.total,a.total<=0&&(this.dataShow=!0)}catch{}this.dataShow?this.loading=!1:setTimeout(()=>{this.loading=!1},200)},onDetail(t){if(this.auditStatus==="UNPASS"){this.$router.push({path:"/userInfo/videoOperation",query:{type:"edit",groupId:t.id}});return}},async onOffCourse(t){g.confirm("\u786E\u8BA4\u4E0B\u67B6\u8BE5\u8BFE\u7A0B\u5417?","\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(async()=>{try{await n.post("/api-website/videoLessonGroup/updateShelves",{data:{id:t.id,shelvesFlag:0}}),d.success("\u4E0B\u67B6\u6210\u529F"),this.pageInfo.page=1,this.getList()}catch{}})}},render(){var t;return e(p,null,[((t=s.user.data)==null?void 0:t.entryFlag)?e(p,null,[e("div",{class:"flex flex-wrap"},[e(v,{loading:this.loading,animated:!0,class:"flex justify-between",count:3},{default:()=>[this.list.map(a=>e("div",{class:["w-1/3 pt-8",h.items],onClick:()=>this.onDetail(a)},[e(m,{item:{type:"video",status:this.auditStatus,id:a.id,backgroundPic:a.lessonCoverUrl,courseGroupName:a.lessonName,studentCount:a.countStudent,avatar:a.avatar,teacherName:a.username,coursePrice:a.lessonPrice,courseNum:a.lessonCount,shelvesFlag:a.shelvesFlag},onOffCourse:c=>{this.onOffCourse(c)}},null)]))],template:()=>e("div",{class:"w-[218px]"},[e("div",{class:"flex flex-col pt-8 w-[218px] rounded-[10px] overflow-hidden m-auto"},[e(i,{variant:"image",style:{width:"100%",height:"122px"}},null),e("div",{class:"text-base px-2.5 pt-2 text-[#666666] leading-none font-semibold whitespace-nowrap overflow-hidden text-ellipsis"},[e(i,{variant:"h3"},null)]),e("div",{class:"mx-2.5 pt-1.5 pb-2 flex items-center justify-between"},[e(i,{variant:"p",style:{width:"20%"}},null),e("p",{style:{width:"60%"}},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(r,null,null)]):e(r,{type:"teacherCert",message:"\u60A8\u8FD8\u672A\u5B8C\u6210\u8FBE\u4EBA\u8BA4\u8BC1\uFF0C\u8BA4\u8BC1\u540E\u624D\u53EF\u521B\u5EFA\u89C6\u9891\u8BFE\u54E6~",buttonVisibility:!0,buttonText:"\u53BB\u8BA4\u8BC1",onDetail:()=>{this.$router.push("/teacherAuth")}},null)])}}),P=u({name:"video-class",data(){const t=sessionStorage.getItem("videoActiveName");return sessionStorage.removeItem("videoActiveName"),{activeName:t||"PASS"}},render(){return e("div",{class:[h.liveClass,"relative px-[25px]"]},[e(S,{round:!0,type:"primary",class:"absolute right-11 top-3 z-10",onClick:()=>{var t;if((t=s.user.data)==null?void 0:t.entryFlag)this.$router.push("/userInfo/videoOperation");else{d.error("\u60A8\u8FD8\u672A\u5B8C\u6210\u8FBE\u4EBA\u8BA4\u8BC1\uFF0C\u8BA4\u8BC1\u540E\u624D\u53EF\u521B\u5EFA\u89C6\u9891\u8BFE");return}}},{default:()=>[x("\u65B0\u5EFA\u8BFE\u7A0B")]}),e(w,{modelValue:this.activeName,"onUpdate:modelValue":t=>this.activeName=t},{default:()=>[e(l,{label:"\u5DF2\u4E0A\u67B6",name:"PASS"},{default:()=>[this.activeName==="PASS"&&e(o,{auditStatus:"PASS"},null)]}),e(l,{label:"\u5BA1\u6838\u4E2D",name:"DOING"},{default:()=>[this.activeName==="DOING"&&e(o,{auditStatus:"DOING"},null)]}),e(l,{label:"\u5BA1\u6838\u5931\u8D25",name:"UNPASS"},{default:()=>[this.activeName==="UNPASS"&&e(o,{auditStatus:"UNPASS"},null)]}),e(l,{label:"\u5DF2\u4E0B\u67B6",name:"OUT_SALE"},{default:()=>[this.activeName==="OUT_SALE"&&e(o,{auditStatus:"OUT_SALE"},null)]})]})])}});export{P as default};