1 |
- import{M as T}from"./index-fcc8c1c4.js";import{d as Y,O as w,o as D,w as C,g as e,R as x,I as k,h as u,B as b,T as V,N as B,a as G,S as s}from"./index-7efc3749.js";import{i as E}from"./icon-timer-ac089c62.js";import{S as N,b as L,a as n}from"./index-713253ef.js";import{C as y}from"./index-a1fc7980.js";import{C as g}from"./index-4a491eda.js";import{G as v,a as f}from"./index-f7d0f5db.js";import{M as W}from"./index-2b5b03fc.js";import{D as I,a as O}from"./index-500b9e7e.js";import{L as R}from"./index-046fabcc.js";import"./index-8bbe635b.js";import"./use-tab-status-34b987e0.js";const F="_patrolDropDown_1sv47_1",A="_cellGroup_1sv47_19",H="_timer_1sv47_22",P="_iconTimer_1sv47_28",U="_patrolContainer_1sv47_32",q="_num_1sv47_38",j="_btn_1sv47_69",o={patrolDropDown:F,cellGroup:A,timer:H,iconTimer:P,patrolContainer:U,num:q,btn:j},z=Y({name:"skeleton-modal",props:{show:{type:Boolean,default:!1},showCount:{type:Array,default:()=>[1,2,3,4,5,6]},isLink:{type:Boolean,default:!0}},setup(i,{slots:t}){const r=w({loading:!1});return D(()=>{r.loading=i.show}),C(()=>i.show,()=>{r.loading=i.show}),()=>e(N,{loading:r.loading,style:"flex-wrap: wrap"},{template:()=>e("div",{style:{height:i.isLink?"calc(100vh - var(--header-height))":"auto",overflow:"hidden",width:"100%"}},[i.showCount.map(()=>e(y,{inset:!0,class:o.cellGroup},{default:()=>[e(g,{center:!0},{title:()=>e("div",{class:o.timer},[e(L,{class:o.iconTimer},null),e(n,{rowWidth:"40%",style:{marginTop:"0"}},null)]),label:()=>e("div",{class:o.patrolContainer},[e(v,{columnNum:2,border:!1},{default:()=>[e(f,null,{icon:()=>e(n,{rowWidth:"40%",style:{width:"50px"},class:o.num},null),text:()=>e("div",{class:"van-grid-item__text"},[e(n,{rowWidth:"40%",style:{width:"50px"},class:o.num},null)])}),e(f,null,{icon:()=>e(n,{rowWidth:"40%",style:{width:"50px"},class:o.num},null),text:()=>e("div",{class:"van-grid-item__text"},[e(n,{rowWidth:"40%",style:{width:"50px"},class:o.num},null)])})]}),e(n,{class:o.btn,rowWidth:"20%"},null)])})]}))]),default:()=>t.default&&t.default()})}}),rt=Y({name:"patrol-evaluation",setup(){const i=B(),t=w({isClick:!1,listState:{dataShow:!0,loading:!0,finished:!1,refreshing:!1},params:{startTime:"",endTime:"",page:1,rows:20},statusValue:"week",statusColumns:[{text:"本周",value:"week"},{text:"本月",value:"month"},{text:"本学期",value:"term"}],list:[]}),r=async()=>{try{if(t.isClick)return;t.isClick=!0;const{data:a}=await G.post("/api-web/coursePatrolEvaluation/pageStat",{data:t.params}),l=a||{};t.listState.refreshing?t.list=l.rows||[]:t.list=t.list.concat(l.rows||[]),t.listState.finished=l.pageNo>=l.totalPage,t.params.page=l.pageNo+1}catch(a){t.listState.finished=!0}finally{setTimeout(()=>{t.listState.dataShow=t.list.length>0,t.listState.refreshing=!1,t.listState.loading=!1,t.isClick=!1},500)}},M=()=>{t.params.page=1,r()},p=()=>{if(t.statusValue=="week"){const a=s().startOf("week").add(1,"day").format("YYYY-MM-DD"),l=s().endOf("week").add(1,"day").format("YYYY-MM-DD");t.params.startTime=a,t.params.endTime=l}else if(t.statusValue=="month"){const a=s().startOf("month").format("YYYY-MM-DD"),l=s().endOf("month").format("YYYY-MM-DD");t.params.startTime=a,t.params.endTime=l}else if(t.statusValue=="term"){const a=s().year(),l="09-01",d="03-01",_=s(a+l).format("YYYY-MM-DD"),S=s(a+d).format("YYYY-MM-DD"),h=s().format("YYYY-MM-DD"),m=s(h).isBefore(s(_)),c=s(h).isBefore(s(S));console.log(m,c,"before"),m&&c&&(t.params.startTime=s(a-1+l).format("YYYY-MM-DD"),t.params.endTime=s(s().year()+d).subtract(1,"day").format("YYYY-MM-DD")),!m&&!c&&(t.params.startTime=s(s().year()+l).format("YYYY-MM-DD"),t.params.endTime=s(s().year()+d).add(1,"year").subtract(1,"day").format("YYYY-MM-DD")),m&&!c&&(t.params.startTime=s(a+d).format("YYYY-MM-DD"),t.params.endTime=s(a+l).subtract(1,"day").format("YYYY-MM-DD"))}};return D(()=>{p(),r()}),()=>e("div",{class:o["patrol-evaluation"]},[e(T,{position:"top"},{default:()=>[e(x,null,null),e(I,{class:o.patrolDropDown},{default:()=>[e(O,{modelValue:t.statusValue,"onUpdate:modelValue":a=>t.statusValue=a,options:t.statusColumns,onChange:()=>{p(),t.listState.dataShow=!0,t.listState.refreshing=!0,t.params.page=1,r()}},null)]})]}),e(z,{show:t.listState.loading,"onUpdate:show":a=>t.listState.loading=a},{default:()=>[e(W,{modelValue:t.listState.refreshing,"onUpdate:modelValue":a=>t.listState.refreshing=a,onRefresh:()=>M(),style:{minHeight:"calc(100vh - var(--header-height))"}},{default:()=>[e(R,{finished:t.listState.finished,finishedText:" ",style:{overflow:"hidden"},onLoad:r,immediateCheck:!1},{default:()=>[t.listState.dataShow?t.list.map(a=>e(y,{inset:!0,class:o.cellGroup},{default:()=>[e(g,{center:!0},{title:()=>e("div",{class:o.timer},[e(k,{name:E,class:o.iconTimer},null),a.date]),label:()=>e("div",{class:o.patrolContainer},[e(v,{columnNum:2,border:!1},{default:()=>[e(f,null,{icon:()=>e("div",{class:o.num},[e("span",null,[a.patrolCount]),u("节")]),text:()=>e("div",{class:"van-grid-item__text"},[u("已评价")])}),e(f,null,{icon:()=>e("div",{class:o.num},[e("span",null,[a.totalCount]),u("节")]),text:()=>e("div",{class:"van-grid-item__text"},[u("全部课程")])})]}),e(b,{type:"primary",class:o.btn,size:"small",round:!0,onClick:()=>{i.push({path:"/patrol-evaluation-detail",query:{date:a.date}})}},{default:()=>[u("查看详情")]})])})]})):e(V,{style:{minHeight:"calc(100vh - var(--header-height))"},description:"暂无数据"},null)]})]})]})])}});export{rt as default};
|