orchestra-information.2de6a930.js 4.0 KB

1
  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 C,ak as O,al as I,m as c,bd as A}from"./index.5f7ffb46.js";import{O as F}from"./index.95a99ca5.js";import{O as D}from"./index.1d6ac2c5.js";import{O as T}from"./index.7790de2a.js";import{L as k}from"./index.9ef28852.js";import{C as B}from"./index.abd668f7.js";import{I as L}from"./index.276a5d68.js";import{A as P}from"./index.78e196a2.js";import"./use-tab-status.69b57a37.js";const x="_information_1b28o_1",E="_addPhone_1b28o_4",N="_img_1b28o_8",U="_title_1b28o_16",j="_content_1b28o_24",q="_time_1b28o_31",R="_informationGroup_1b28o_37";var s={information:x,addPhone:E,img:N,title:U,content:j,time:q,informationGroup:R};function G(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 c.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 u=e.rows||[];t.list=t.list.concat(u),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()},d=o=>{try{console.log(o,"item"),o.linkUrl?window.location.href=o.linkUrl:n.push({path:"/information-detail",query:{id:o.id}})}catch{}},f=async()=>{n.push({name:"add-information",query:{id:t.selectItem.id}})},m=async()=>{A({message:"\u60A8\u786E\u8BA4\u5220\u9664\u8BE5\u8D44\u8BAF\u5417\uFF1F"}).then(async()=>{try{await c.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(T,{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(D,{modelValue:t.listState.refreshing,"onUpdate:modelValue":e=>t.listState.refreshing=e,onRefresh:r,style:{minHeight:`calc(100vh - ${t.listState.height}px)`}},{default:()=>[a(k,{finished:t.listState.finished,finishedText:" ",onLoad:l,immediateCheck:!1,class:s.informationGroup},G(o=t.list.map((e,u)=>a(B,{center:!0,class:s.cell,onClick:()=>d(e)},{icon:()=>a(L,{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(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(O,{btnStatus:!1,tips:"\u6682\u65E0\u8D44\u8BAF"},null),a(P,{cancelText:"\u53D6\u6D88",show:t.oPopover,"onUpdate:show":e=>t.oPopover=e,closeOnClickAction:!0,actions:[{name:"\u4FEE\u6539",callback:()=>f()},{name:"\u5220\u9664",color:"#F44541",callback:()=>{t.dialogStatus=!0}}]},null),a(F,{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:m},null)])}}});export{Q as default};