import{s}from"./index.module-422ac088.js";import{M as m}from"./index-b6a8ef64.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-e308c7ec.js";import{M as N}from"./index-740abac3.js";import{D as R}from"./drop-down-modal-5d7090fb.js";import{b as r,d as k}from"./constant-a400d214.js";import{S as I}from"./skeletion-index-modal-42b35ae4.js";import{M as O}from"./index-90726a6a.js";import{D as E,a as b}from"./index-3d258070.js";import{L as G}from"./index-64ac7a14.js";import{C as L}from"./index-e6c77f12.js";import{C as d}from"./index-46b2caad.js";import{T as Y}from"./index-137fd46c.js";import"./index-a68ddf56.js";import"./index-a2161ccf.js";import"./index-d91c1a06.js";import"./use-tab-status-665308c9.js";import"./index-72730134.js";import"./index-1f0a723a.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};
