import{s}from"./index.module-422ac088.js";import{M as m}from"./index-6b314488.js";import{d as h,i as g,O as A,o as S,g as a,R as v,I as w,S as y,T as C,N as D,a as M}from"./index-1d4a9afa.js";import{M as N}from"./index-575d1b2d.js";import{D as R}from"./drop-down-modal-3282bbb5.js";import{b as r,d as k}from"./constant-a400d214.js";import{S as I}from"./skeletion-index-modal-6fa9a542.js";import{M as O}from"./index-8fc031c0.js";import{D as E,a as b}from"./index-ab43c325.js";import{L as G}from"./index-5807759e.js";import{C as L}from"./index-b8090118.js";import{C as d}from"./index-a27d7671.js";import{T as Y}from"./index-7e17edc9.js";import"./index-dbc03ded.js";import"./index-6d1e9935.js";import"./index-22c9ea74.js";import"./use-tab-status-a36febbc.js";import"./index-fc00eb76.js";import"./index-c272bcfa.js";const T="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAPNJREFUaEPtWdsNwjAMtAeBJZwlmISZmIQl4iXoIEERIFWUqnapRY2u307ie9iNFabkHyfPnwDg1wqGKVBKObXWLh0gM59rrdcIsGEARORGRIdn0oOqHrMBaOOEVTWErJBNe+IiAgAWy0GBOZZgIYt/eos2xrnDoICRMiiAIjZaZS4MFoKFYKEvGdidhUaT1GsYCYLo3nb4NNlNutDbJOU+JXjBZLL7PwDpLbSVBXAbNTKJq8Tu/gNG5RbDUAOLFD0CUAOoAaNVMJF5iUIXMjKGLoQuZLQKupCXqPSPfOmfWb2KrY0Pa6NrE/KuAwAvY1vH3wH7G7YxyJgWewAAAABJRU5ErkJggg==",et=h({name:"activtiy-record",setup(){const p=D(),i=g(),t=A({activeValue:"",activeColumns:[{text:"全部活动",value:""}],isClick:!1,listState:{dataShow:!0,loading:!0,finished:!1,refreshing:!1},params:{type:"",keyword:"",page:1,rows:20},list:[]}),c=e=>{e.value&&e.value.toggle()},u=()=>{let e="";return t.activeColumns.forEach(o=>{t.params.type===o.value&&(e=o.text)}),e},l=async()=>{try{if(t.isClick)return;t.isClick=!0;const{data:e}=await M.post("/api-web/schoolActivity/page",{data:t.params}),o=e||{};t.listState.refreshing?t.list=o.rows||[]:t.list=t.list.concat(o.rows||[]),t.listState.finished=o.pageNo>=o.totalPage,t.params.page=o.pageNo+1}catch(e){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)}},n=()=>{t.params.page=1,l()},f=e=>{p.push({path:"/activity-record-detail",query:{id:e.id}})};return S(()=>{for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&t.activeColumns.push({text:r[e],value:e});l()}),()=>a("div",{class:s["activity-record"]},[a(m,{position:"top"},{default:()=>[a(v,null,{right:()=>a(w,{name:T,class:s.iconAdd,onClick:()=>{p.push("activity-record-operation")}},null)}),a(N,{placeholder:"请输入活动名称",disabled:t.listState.refreshing,onSearch:e=>{t.params.keyword=e,t.listState.refreshing=!0,n()}},{left:()=>a(E,{class:s.patrolDetailDropDown,closeOnClickOutside:!1},{default:()=>[a(b,{title:u(),ref:i},{default:()=>[a(R,{selectValues:t.params.type,columns:t.activeColumns,open:i.value.state.showPopup,onDropDownClose:()=>c(i),onDropDownConfirm:e=>{t.params.type=e[0],c(i),t.listState.refreshing=!0,n()}},null)]})]})})]}),a(I,{show:t.listState.loading,"onUpdate:show":e=>t.listState.loading=e},{default:()=>[a(O,{modelValue:t.listState.refreshing,"onUpdate:modelValue":e=>t.listState.refreshing=e,onRefresh:()=>n(),style:{minHeight:"calc(100vh - var(--header-height))"}},{default:()=>[a(G,{finished:t.listState.finished,finishedText:" ",style:{overflow:"hidden",marginBottom:"18px"},onLoad:l,immediateCheck:!1},{default:()=>[t.listState.dataShow?t.list.map(e=>a(L,{inset:!0,class:s.cellGroup,onClick:()=>f(e)},{default:()=>[a(d,{center:!0,isLink:!0,class:s.cellTitle,clickable:!1},{icon:()=>a(Y,{plain:!0,type:"primary",class:s.tag},{default:()=>[r[e.type]]}),title:()=>a("div",{class:[s.title,"van-ellipsis"]},[e.name])}),a(d,{class:s.cellTimer,center:!0,title:`活动日期:${y(e.startTime).format("YYYY年MM月DD日")}`,value:k[e.status],valueClass:[e.status==="PROCESSING"?s.ing:"",e.status==="END"?s.end:""]},null)]})):a(C,{style:{minHeight:"calc(100vh - var(--header-height))"},description:"暂无数据"},null)]})]})]})])}});export{et as default};