import{O as h}from"./index.a817bb82.js";import{d as g,ah as S,ag as y,r as _,$ as w,c as a,aj as v,q as b,ai as O,a5 as C,ak as I,al as T,m as d,b9 as k}from"./index.d1dca38b.js";import{O as L}from"./index.ef6c32f1.js";import{O as P}from"./index.3aa1e6eb.js";import{L as A}from"./index.876ff047.js";import{C as x}from"./index.2f930c00.js";import{I as D}from"./index.6c52b1a0.js";import{A as N}from"./index.8d8e6351.js";import"./use-tab-status.03ea8dd0.js";const U="_information_1b28o_1",j="_addPhone_1b28o_4",q="_img_1b28o_8",R="_title_1b28o_16",G="_content_1b28o_24",H="_time_1b28o_31",V="_informationGroup_1b28o_37";var s={information:U,addPhone:j,img:q,title:R,content:G,time:H,informationGroup:V};function F(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!T(i)}var Q=g({name:"orchestra-information",setup(){const i=S(),n=y(),t=_({addStatus:!1,isLoading:!1,dialogStatus:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1,refreshing:!1,height:0},params:{type:"HOT_CONSULTATION",clientType:"SCHOOL",page:1,rows:20},oPopover:!1,selectItem:{},selectType:"add"}),l=async()=>{try{if(t.isLoading)return;t.isLoading=!0;const o=await d.post("/api-school/sysNewsInformation/page",{data:{...t.params,orchestraPhotoAlbumId:i.query.photoId}});t.listState.loading=!1,t.listState.refreshing=!1;const e=o.data||{};if(t.list.length>0&&e.current===1)return;const c=e.rows||[];t.list=t.list.concat(c),t.listState.finished=e.current>=e.pages,t.params.page=e.current+1,t.listState.dataShow=t.list.length>0,t.isLoading=!1}catch{t.listState.dataShow=!1,t.listState.finished=!0,t.listState.refreshing=!1,t.isLoading=!1}},r=()=>{t.params.page=1,t.list=[],t.listState.dataShow=!0,t.listState.loading=!1,t.listState.finished=!1,l()},f=o=>{try{console.log(o,"item"),o.linkUrl?window.location.href=o.linkUrl:n.push({path:"/information-detail",query:{id:o.id}})}catch{}},m=async()=>{n.push({name:"add-information",query:{id:t.selectItem.id}})},u=async()=>{k({message:"\u60A8\u786E\u8BA4\u5220\u9664\u8BE5\u8D44\u8BAF\u5417\uFF1F"}).then(async()=>{try{await d.post("/api-school/sysNewsInformation/remove",{requestType:"form",data:{id:t.selectItem.id}}),r()}catch{}})};return w(()=>{l()}),()=>{let o;return a("div",{class:[s.information,!t.listState.dataShow&&"emptyRootContainer"]},[a(P,{position:"top",onGetHeight:e=>{t.listState.height=e}},{default:()=>[a(v,null,{right:()=>a("span",{class:s.addPhone,onClick:()=>{n.push("/add-information")}},[b("\u6DFB\u52A0\u8D44\u8BAF")])})]}),t.listState.dataShow?a(L,{modelValue:t.listState.refreshing,"onUpdate:modelValue":e=>t.listState.refreshing=e,onRefresh:r,style:{minHeight:`calc(100vh - ${t.listState.height}px)`}},{default:()=>[a(A,{finished:t.listState.finished,finishedText:" ",onLoad:l,immediateCheck:!1,class:s.informationGroup},F(o=t.list.map((e,c)=>a(x,{center:!0,class:s.cell,onClick:()=>f(e)},{icon:()=>a(D,{src:e.coverImage,class:s.img,fit:"cover"},null),title:()=>a("div",null,[a("div",{class:[s.title,"van-ellipsis"]},[e.title]),a("div",{class:[s.content,"van-multi-ellipsis--l2"]},[e.summary]),a("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},[a("div",{class:s.time},[e.createTime?O(e.createTime).format("YYYY\u5E74MM\u6708DD\u65E5"):""]),a(C,{name:"ellipsis",size:23,color:"#777777",style:{fontWeight:"bold"},onClick:p=>{p.stopPropagation(),t.selectItem=e,t.oPopover=!0}},null)])])})))?o:{default:()=>[o]})]}):a(I,{btnStatus:!1,tips:"\u6682\u65E0\u8D44\u8BAF"},null),a(N,{cancelText:"\u53D6\u6D88",show:t.oPopover,"onUpdate:show":e=>t.oPopover=e,closeOnClickAction:!0,actions:[{name:"\u4FEE\u6539",callback:()=>m()},{name:"\u5220\u9664",color:"#F44541",callback:()=>{t.dialogStatus=!0}}]},null),a(h,{show:t.dialogStatus,"onUpdate:show":e=>t.dialogStatus=e,title:"\u5220\u9664\u8D44\u8BAF",message:"\u662F\u5426\u5220\u9664\u8BE5\u8D44\u8BAF\uFF1F\u786E\u8BA4\u540E\u5B66\u5458\u7AEF\u3001\u4F34\u5B66\u7AEF\u5C06\u540C\u6B65\u5220\u9664",messageAlign:"left",dialogMarginTop:"env(safe-area-inset-top)",showCancelButton:!0,onConfirm:u},null)])}}});export{Q as default};
