import{Q as r}from"./QueryInput.7afa399e.js";import{T as o}from"./TableLayout.05a39499.js";import{g as l,s as c,d as u}from"./live-manage.d907c119.js";import{d as v}from"./data-report.0c7c73f2.js";import{n as h}from"./vueComponentNormalizer.9ef17bb1.js";/* empty css *//* empty css */import"./index.f5168bf8.js";import"./index.2adbb9ac.js";var d=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("div",{staticClass:"v-page live-lectures"},[i("h2",{staticClass:"v-title"},[e._v("\u76F4\u64AD\u5217\u8868")]),i("div",{staticClass:"live-lectures-header"},[i("searchInput",{on:{query:e.getSearchList},model:{value:e.searchValue,callback:function(t){e.searchValue=t},expression:"searchValue"}}),i("div",{staticClass:"header-manage"},[i("el-button",{attrs:{type:"danger",round:""},on:{click:function(){e.removeSelect()}}},[e._v("\u5220\u9664\u9009\u4E2D")]),i("el-button",{attrs:{type:"primary",round:""},on:{click:e.addLive}},[e._v("\u65B0\u5EFA\u76F4\u64AD")])],1)],1),i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticClass:"live-lectures-content"},[i("TableLayout",{attrs:{data:e.liveList,column:e.column,pageInfo:e.pageInfo,selection:""},on:{"current-change":e.pageChange,"size-change":e.pageSizeChange,"selection-change":e.selectionChange},scopedSlots:e._u([{key:"lecturer",fn:function(t){var s;return[e._v(" "+e._s((s=t.row.lecturerInfo)===null||s===void 0?void 0:s.name)+" ")]}},{key:"status",fn:function(t){return[t.row.status==0?i("el-tag",{attrs:{type:"info"}},[e._v("\u672A\u5F00\u59CB")]):e._e(),t.row.status==1?i("el-tag",[e._v("\u76F4\u64AD\u4E2D")]):e._e(),t.row.status==2?i("el-tag",{attrs:{type:"success"}},[e._v("\u5DF2\u5B8C\u6210")]):e._e()]}},{key:"startTime",fn:function(t){return[e._v(" "+e._s(new Date(t.row.startTime).format("yyyy-MM-dd"))+" ")]}},{key:"createTime",fn:function(t){return[e._v(" "+e._s(new Date(t.row.createTime).format("yyyy-MM-dd"))+" ")]}},{key:"action",fn:function(t){return[t.row.status==2?i("el-button",{attrs:{type:"text"},on:{click:function(s){return e.copyLiveInfo(t.row)}}},[i("i",{staticClass:"i-j-rypj-zhongxin"}),e._v(" \u518D\u6B21\u76F4\u64AD")]):e._e(),t.row.status==1&&e.checkIsLecturer(t.row.creator)?i("el-button",{staticStyle:{color:"#e6a23c"},attrs:{type:"text"},on:{click:function(s){return e.toLivePlay(t.row)}}},[i("i",{staticClass:"el-icon-video-play"}),e._v(" \u7EE7\u7EED\u76F4\u64AD")]):e._e(),t.row.status==0&&e.checkIsLecturer(t.row.creator)?i("el-button",{staticStyle:{color:"#02c761"},attrs:{type:"text"},on:{click:function(s){return e.toLivePlay(t.row)}}},[i("i",{staticClass:"i-j-rypj-kaishi"}),e._v(" \u8FDB\u884C\u76F4\u64AD")]):e._e(),t.row.status==0&&e.checkIsLecturer(t.row.creator)?i("el-button",{attrs:{type:"text"},on:{click:function(s){return e.editorLive(t.row)}}},[i("i",{staticClass:"el-icon-edit"}),e._v(" \u7F16\u8F91")]):e._e(),e.checkIsLecturer(t.row.creator)?i("el-button",{staticStyle:{color:"#f56c6c"},attrs:{type:"text"},on:{click:function(s){return e.removeSelect(t.row.id)}}},[i("i",{staticClass:"i-j-ksap-shanchu"}),e._v(" \u5220\u9664")]):e._e()]}}])})],1)])},g=[];const p={components:{searchInput:r,TableLayout:o},data(){return{column:[{prop:"title",label:"\u76F4\u64AD\u540D\u79F0",align:"center","show-overflow-tooltip":!0,"min-width":"150px"},{prop:"status",label:"\u72B6\u6001",align:"center",width:100},{prop:"startTime",label:"\u5F00\u59CB\u65F6\u95F4",align:"center"},{prop:"duration",label:"\u9884\u8BA1\u65F6\u957F",align:"center"},{prop:"lecturer",label:"\u8BB2\u5E08",align:"center",width:150},{prop:"createTime",label:"\u521B\u5EFA\u65F6\u95F4",align:"center"},{prop:"action",label:"\u64CD\u4F5C",align:"center"}],listLoading:!1,liveList:[],nowSeletedLive:[],searchValue:"",pageInfo:{page:1,pageSize:10,total:0}}},methods:{async getLiveList(){this.listLoading=!0;const{data:e}=await l(this.pageInfo);this.pageInfo.total=e.total,this.liveList=e.data,this.listLoading=!1},checkIsLecturer(e){return e===this.$store.user.id},async getSearchList(){if(this.listLoading=!0,this.page=1,this.searchValue.trim().length<=0)this.getLiveList();else{const{data:e}=await c({...this.pageInfo,value:this.searchValue});this.liveList=e.data,this.pageInfo.total=e.total,this.listLoading=!1}},pageChange(e){this.pageInfo.page=e,this.getLiveList()},pageSizeChange(e){this.pageInfo.pageSize=e,this.getLiveList()},selectionChange(e){this.nowSeletedLive=e},copyLiveInfo(e){this.$router.push({path:"/online-course/live-lectures/live-editor",query:{id:e.id,isCopy:!0}})},async removeSelect(e){let a=this.nowSeletedLive.map(i=>i.id);!e&&a.length<=0?this.$message.warning("\u8BF7\u9009\u62E9\u5220\u9664\u9879\u76EE"):e&&(a=[e]),await this.$confirm("\u5C06\u5220\u9664\u9009\u4E2D\u7684\u76F4\u64AD\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F","\u5220\u9664\u63D0\u793A",{type:"warning"}),await u(a),this.$message.success("\u5220\u9664\u6210\u529F"),this.nowSeletedLive=[],this.pageInfo.page>1&&this.pageInfo.page--,this.getLiveList()},addLive(){this.$router.push({path:"/online-course/live-lectures/live-editor",query:{id:0}})},editorLive(e){this.$router.push({path:"/online-course/live-lectures/live-editor",query:{id:e.id}})},toLivePlay(e){this.$router.push({path:"/online-course/live-lectures/live-play",query:{id:e.id}})}},async created(){},activated(){this.getLiveList()},mixins:[v("LIVE_TEACHING")]},n={};var f=h(p,d,g,!1,_,"ceb0144e",null,null);function _(e){for(let a in n)this[a]=n[a]}const x=function(){return f.exports}();export{x as default};