index-legacy.229f3b53.js 6.9 KB

1
  1. !function(){var t=document.createElement("style");t.innerHTML="._train_8q9to_1{--van-tab-active-text-color: var(--van-primary-color);--van-tab-text-color: #333;--van-tab-font-size: .42667rem}._train_8q9to_1 ._cellGroup_8q9to_6{margin:.32rem .34667rem 0;overflow:hidden;border-radius:.26667rem}._train_8q9to_1 ._cellGroup_8q9to_6 ._select_8q9to_11{height:1.2rem}._train_8q9to_1 ._cellGroup_8q9to_6 ._select_8q9to_11 ._icon_8q9to_14{width:.45333rem;height:.45333rem;margin-right:.10667rem;flex-shrink:0}._train_8q9to_1 ._cellGroup_8q9to_6 ._select_8q9to_11 .van-cell__title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}._train_8q9to_1 ._cellGroup_8q9to_6 ._select_8q9to_11 .van-cell__right-icon{color:#333;transform:rotate(90deg);margin:0 0 0 .10667rem}._reportList_8q9to_30{width:auto;margin:0 .34667rem .32rem;padding:.4rem .32rem;border-radius:.26667rem}._reportList_8q9to_30 .van-cell__title{font-size:.42667rem;color:#333}._reportList_8q9to_30 .van-cell_label{font-size:.37333rem;color:#777}._reportList_8q9to_30 .van-cell__value{flex:0 auto}\n",document.head.appendChild(t),System.register(["./index-legacy.eb062188.js","./index-legacy.ad813f4d.js","./index-legacy.d64e5695.js","./index-legacy.fad72574.js","./index-legacy.918b8c74.js","./index-legacy.5f462740.js","./index-legacy.38b799d5.js","./index-legacy.ac7c51db.js","./use-tab-status-legacy.91417466.js","./utils-legacy.6e8de97c.js","./Picker-legacy.95f03705.js","./index-legacy.fab451f1.js","./index-legacy.10d8486a.js"],(function(t){"use strict";var e,a,r,o,i,s,n,l,c,h,d,u,m,p,_,f,g,v,y,w,b,S,Y;return{setters:[function(t){e=t.d,a=t.R,r=t.ag,o=t.r,i=t.ai,s=t.$,n=t.c,l=t.B,c=t.q,h=t.ak,d=t.P,u=t.b2,m=t.al,p=t.m,_=t.aj},function(t){f=t.O},function(t){g=t.O},function(t){v=t.L},function(t){y=t.C},function(t){w=t.D},function(t){b=t.P},function(t){S=t.T,Y=t.a},function(){},function(){},function(){},function(){},function(){}],execute:function(){var L={train:"_train_8q9to_1",cellGroup:"_cellGroup_8q9to_6",select:"_select_8q9to_11",icon:"_icon_8q9to_14",reportList:"_reportList_8q9to_30"};var q=e({name:"train-list",props:{type:{type:String,default:"WEEKLY"},orchestraList:{type:Array,default:()=>[]}},setup(t){const e=a(["year","month"]),_=r(),f=o({showPopoverTime:!1,timeName:i().format("YYYY")+"年"+i().format("MM")+"月",currentDate:[i().format("YYYY"),i().format("MM")],orchestraStatus:!1,selectOrchestra:{},isClick:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1,refreshing:!1,height:0},params:{page:1,rows:20}}),S=async()=>{try{if(f.isClick)return;f.isClick=!0;const e=i(f.currentDate[0]+"-"+f.currentDate[1]+"01"),a=e.startOf("month").format("YYYY-MM-DD"),r=e.endOf("month").format("YYYY-MM-DD"),{data:o}=await p.post("/api-school/orchestraReport/page",{data:{reportType:t.type,page:f.params.page,rows:f.params.rows,orchestraId:f.selectOrchestra.value,startTime:a,endTime:r}});if(f.listState.loading=!1,f.listState.refreshing=!1,f.list.length>0&&1===o.current)return;f.list=f.list.concat(o.rows||[]),f.listState.finished=o.current>=o.pages,f.params.page=o.current+1,f.listState.dataShow=f.list.length>0,f.isClick=!1}catch{f.listState.dataShow=!1,f.listState.finished=!0,f.listState.refreshing=!1,f.isClick=!1}},Y=()=>{f.params.page=1,f.list=[],f.listState.dataShow=!0,f.listState.loading=!1,f.listState.finished=!1,S()},q=t=>{f.timeName=t.selectedValues[0]+"年"+t.selectedValues[1]+"月",f.showPopoverTime=!1,Y()},x=t=>{if(t&&t.length>13){return t.substring(0,8)+"..."+t.substring(t.length-5,t.length)}return t};return s((async()=>{try{t.orchestraList.length>0&&(f.selectOrchestra=t.orchestraList[0]),await S()}catch{}})),()=>{let a;return n("div",{style:{minHeight:"calc(100vh - var(--van-tabs-line-height) - var(--header-height))",overflow:"hidden"}},[n("div",{class:"searchGroup",style:"background: transparent"},[n("div",{class:["searchItem",f.showPopoverTime&&"searchItem-active"],onClick:()=>{f.showPopoverTime=!0}},[f.timeName,n("i",{class:"arrow"},null)]),n("div",{class:["searchItem",f.orchestraStatus&&"searchItem-active"],onClick:()=>{f.orchestraStatus=!0}},[n("span",null,[f.selectOrchestra.text||" "]),n("i",{class:"arrow"},null)])]),n("div",{style:{overflowY:"auto",height:"calc(100vh - var(--van-tabs-line-height) - var(--header-height) - 1.17333rem)"}},[f.listState.dataShow?n(g,{modelValue:f.listState.refreshing,"onUpdate:modelValue":t=>f.listState.refreshing=t,onRefresh:Y,style:{minHeight:"calc(100vh - var(--van-tabs-line-height) - var(--header-height) - 1.17333rem)"}},{default:()=>{return[n(v,{finished:f.listState.finished,finishedText:" ",style:{overflow:"hidden"},onLoad:S,immediateCheck:!1},(e=a=f.list.map((e=>n(y,{center:!0,class:L.reportList},{title:()=>n("div",null,[x(e.orchestraName)]),value:()=>n(l,{type:"primary",round:!0,size:"small",onClick:()=>(e=>{const a="WEEKLY"===t.type?"/train-week-report":"/train-month-report";_.push({path:a,query:{id:e.id}})})(e)},{default:()=>[c("查看报告")]}),label:()=>"WEEKLY"===t.type?n("div",{class:L.time},[i(e.startTime).format("YYYY/MM/DD"),c("-"),i(e.endTime).format("YYYY/MM/DD")]):n("div",{class:L.time},[e.monthlyTime])}))),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!m(e)?a:{default:()=>[a]}))];var e}}):n(h,{btnStatus:!1,tips:"暂无训练报告"},null)]),n(d,{show:f.showPopoverTime,"onUpdate:show":t=>f.showPopoverTime=t,position:"bottom",round:!0,teleport:"body",class:"popupBottomSearch"},{default:()=>[n(w,{onCancel:()=>{f.showPopoverTime=!1},onConfirm:q,modelValue:f.currentDate,"onUpdate:modelValue":t=>f.currentDate=t,formatter:u,columnsType:e.value},null)]}),n(d,{show:f.orchestraStatus,"onUpdate:show":t=>f.orchestraStatus=t,position:"bottom",round:!0,class:"popupBottomSearch",teleport:"body"},{default:()=>[n(b,{columns:t.orchestraList,onCancel:()=>f.orchestraStatus=!1,onConfirm:t=>{f.selectOrchestra=t.selectedOptions[0],f.orchestraStatus=!1,Y()}},null)]})])}}});t("default",e({name:"train-report",setup(){const t=sessionStorage.getItem("train-report-tab"),e=o({loading:!0,tabValue:t||"WEEKLY",orchestraList:[],height:"auto"});return(async()=>{try{e.loading=!0;const{data:t}=await p.post("/api-school/orchestra/page",{data:{page:1,rows:100,status:"DONE",type:"DELIVERY"}}),a=t.rows||[],r=[];a.forEach((t=>{r.push({text:t.name,value:t.id})})),r.unshift({text:"全部乐团",value:""}),e.orchestraList=[...r],e.loading=!1}catch{e.loading=!1}})(),()=>n("div",{class:L.train},[n(f,{position:"top",onGetHeight:t=>{document.documentElement.style.setProperty("--header-height",t+"px"),e.height=t}},{default:()=>[n(_,{border:!1},null)]}),!e.loading&&n(S,{sticky:!0,lineWidth:20,lineHeight:4,offsetTop:e.height,swipeable:!0,animated:!0,active:e.tabValue,"onUpdate:active":t=>e.tabValue=t,onChange:t=>{sessionStorage.setItem("train-report-tab",t)}},{default:()=>[n(Y,{title:"周报",name:"WEEKLY"},{default:()=>[n(q,{type:"WEEKLY",orchestraList:e.orchestraList},null)]}),n(Y,{title:"月报",name:"MONTHLY"},{default:()=>[n(q,{type:"MONTHLY",orchestraList:e.orchestraList},null)]})]})])}}))}}}))}();