import{s}from"./index.module-422ac088.js";import{M as m}from"./index-cf657a5b.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-e362c2e8.js";import{M as N}from"./index-2a51a0f7.js";import{D as R}from"./drop-down-modal-4b54f8a5.js";import{b as r,d as k}from"./constant-a400d214.js";import{S as I}from"./skeletion-index-modal-9802b867.js";import{M as O}from"./index-04aee2cb.js";import{D as E,a as b}from"./index-8b701a0f.js";import{L as G}from"./index-7861a26d.js";import{C as L}from"./index-7571fa92.js";import{C as d}from"./index-5c45ec33.js";import{T as Y}from"./index-3ee0a851.js";import"./index-6c6fed8e.js";import"./index-14b5dea2.js";import"./index-f57b4c5f.js";import"./use-tab-status-92e284d0.js";import"./index-5276fe86.js";import"./index-85ccd873.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};