1 |
- import{d as h,ah as g,ag as S,r as y,$ as _,c as a,aj as w,q as v,ai as b,a5 as O,ak as C,al as I,m as d,b9 as T}from"./index.332c7f08.js";import{O as k}from"./index.a8f5f4b5.js";import{O as L}from"./index.626c48f9.js";import{O as P}from"./index.d7c1b6ac.js";import{L as A}from"./index.b186dfda.js";import{C as x}from"./index.91135ff9.js";import{I as D}from"./index.96a8db5e.js";import{A as N}from"./index.1fff19a4.js";import"./use-tab-status.9d769af8.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]"&&!I(i)}var Q=h({name:"orchestra-information",setup(){const i=g(),n=S(),t=y({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()=>{T({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 _(()=>{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(w,null,{right:()=>a("span",{class:s.addPhone,onClick:()=>{n.push("/add-information")}},[v("\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?b(e.createTime).format("YYYY\u5E74MM\u6708DD\u65E5"):""]),a(O,{name:"ellipsis",size:23,color:"#777777",style:{fontWeight:"bold"},onClick:p=>{p.stopPropagation(),t.selectItem=e,t.oPopover=!0}},null)])])})))?o:{default:()=>[o]})]}):a(C,{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(k,{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};
|