2 lines
3.6 KiB
JavaScript
2 lines
3.6 KiB
JavaScript
import{p as B,_ as b}from"./index.76a66f15.js";import{a$ as m,C as o,D as r,E as u,aJ as n,b2 as a,aV as p,b3 as d,b1 as F,c8 as I,bo as P,bV as C}from"./arco.f3c60d68.js";const D={components:{courseItem:B},data(){return{searchParams:{sort:"",order:"desc",offset:0,limit:10,course_id:this.courseId,user_id:this.userId},columns:[{title:"\u5B66\u5458",slotName:"user"},{title:"\u6765\u6E90",slotName:"platform",align:"center"},{title:"\u7D2F\u8BA1\u5B66\u4E60\u65F6\u957F(\u5206\u949F)",dataIndex:"total_study_time",align:"center",render:({record:t})=>t.total_study_time},{title:"\u9996\u6B21\u5B66\u4E60\u65F6\u95F4",slotName:"start_time",align:"center"},{title:"\u6700\u540E\u5B66\u4E60\u65F6\u95F4",slotName:"last_study_time",align:"center"},{title:"\u6253\u5F00\u6B21\u6570",dataIndex:"study_num",align:"center"}],data:[],tableLoading:!1,dataTotal:0}},props:{courseId:{type:[String,Number],default:0},userId:{type:[String,Number],default:0},groupType:{type:[String],default:"user"},timeFilter:{type:[Object,Array],default:()=>[]}},computed:{},watch:{timeFilter:{deep:!0,handler(t,s){this.getData()}}},mounted(){this.groupType=="user"?(this.columns[0]={title:"\u5B66\u5458",slotName:"user"},this.columns[1]={title:"\u6765\u6E90",slotName:"platform",align:"center"}):(this.columns[0]={title:"\u8BFE\u7A0B",slotName:"course",width:300},this.columns[1]={}),this.getData()},methods:{pageChange(t){this.searchParams.offset=t,this.getData()},pageSizeChange(t){this.searchParams.limit=t,this.refresh()},refresh(){this.searchParams.offset=0,this.getData()},download(){this.searchParams.group_type=this.groupType,this.searchParams.time_filter=this.timeFilter,this.$request.download("admin/data/course/exportStudy",this.searchParams)},getData(){this.tableLoading=!0,this.searchParams.group_type=this.groupType,this.searchParams.time_filter=this.timeFilter,this.$request.post("admin/data/course/studyDetail",this.searchParams).then(t=>{var s=t.data.rows;this.tableLoading=!1,this.data=s,this.dataTotal=t.data.total}).catch(t=>{this.tableLoading=!1,this.$message.error(t.msg)})}}};const E={class:"card-header-bar"},v={class:"card-title"},x={class:"time-filter"},N={key:0},T={key:1},k={key:1},S={key:0},V={key:1};function L(t,s,$,z,l,c){const h=I,_=m("icon-download"),g=P,f=m("user-item"),y=m("course-item"),w=C;return o(),r("div",null,[u("div",E,[u("div",v,[n(h,{heading:6},{default:a(()=>[...s[0]||(s[0]=[p(" \u5B66\u4E60\u8BE6\u60C5 ",-1)])]),_:1})]),u("div",x,[n(g,{onClick:c.download},{icon:a(()=>[n(_)]),default:a(()=>[s[1]||(s[1]=p(" \u4E0B\u8F7D\u5B66\u4E60\u6570\u636E ",-1))]),_:1},8,["onClick"])])]),n(w,{bordered:{wrapper:!1},pagination:{total:l.dataTotal,defaultPageSize:l.searchParams.limit,showTotal:!0,showPageSize:!0,showJumper:!0},style:{width:"100%","margin-top":"20px"},columns:l.columns,data:l.data,onPageChange:c.pageChange},{platform:a(({rowIndex:i,record:e})=>[e.user.platform?(o(),r("span",N,d(t.$t(e.user.platform.toLowerCase())),1)):(o(),r("span",T,"-"))]),start_time:a(({rowIndex:i,record:e})=>[u("span",null,d(t.$format.formatDate(e.start_time)),1)]),last_study_time:a(({rowIndex:i,record:e})=>[u("span",null,d(t.$format.formatDate(e.last_study_time)),1)]),user:a(({rowIndex:i,record:e})=>[e.user.id?(o(),F(f,{key:0,userinfo:e.user},null,8,["userinfo"])):(o(),r("span",k,"-"))]),course:a(({rowIndex:i,record:e})=>[n(y,{cover:e.course.cover,type:e.course.type,name:e.course.name},null,8,["cover","type","name"])]),course_type:a(({rowIndex:i,record:e})=>[e.course.type?(o(),r("span",S,d(t.$t(e.course.type.toLowerCase())),1)):(o(),r("span",V,"-"))]),_:1},8,["pagination","columns","data","onPageChange"])])}const J=b(D,[["render",L],["__scopeId","data-v-d47182f7"]]);export{J as d};
|