orchestra-information.7ec5daef.js 4.0 KB

1
  1. import{O as h}from"./index.120b6f0d.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.1c621181.js";import{O as L}from"./index.b0685ec5.js";import{O as P}from"./index.b491c24a.js";import{L as A}from"./index.d5ee0b18.js";import{C as x}from"./index.fd5ae97b.js";import{I as D}from"./index.4c221cbe.js";import{A as N}from"./index.7c36c16c.js";import"./use-tab-status.40058c51.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};