1import{A as I,B as k,_ as v,t as h,c as n,o,x as i,w as u,e as c,v as l,C as B,F as m,D as d,b as _,u as $,E as D}from"./index-ae80RWzP.js";import{_ as f}from"./PaginationComponent-BN3bFUGt.js";import{_ as P}from"./CategoriesBar-Dlopdj45.js";import N from"./place-D77T4IDD.js";import"./arrow-right-CsnO2xBg.js";const b={components:{CategoriesBar:P,PlaceIcon:N,PaginationComponent:f},data(){return{loading:!0,items:[],filteredItems:[],currentPage:1,pageSize:10,totalPages:1,totalItems:0}},computed:{...I(k,["currentLang"]),filterParams(){const e={};return this.currentPage&&(e.offset=(this.currentPage-1)*this.pageSize),this.pageSize&&(e.limit=this.pageSize),e.categoryId=1,e.sort="created",e.lang=this.currentLang,e}},watch:{filterParams(){this.fetchItems(),this.fetchCount()}},methods:{init(){this.loading=!0;const e=Number(this.$route.query.page)||1;this.currentPage=e;const t=[];t.push(this.fetchItems(),this.fetchCount()),Promise.all(t).finally(()=>{this.loading=!1})},fetchCount(){return this.$axiosApi.get("gazprom-app/content/news/count",{params:this.filterParams}).then(e=>{const{total:t,pages:r}=e.data;this.totalItems=t,this.totalPages=r}).catch(e=>{console.log(e)}).finally(()=>{this.loading=!1})},fetchItems(){return this.loading=!0,this.$axiosApi.get("gazprom-app/content/news",{params:this.filterParams}).then(e=>{this.items=e.data,this.filterNewsByDate()}).catch(e=>{console.log(e)}).finally(()=>{this.loading=!1})},filterNewsByDate(){this.filteredItems=this.items.sort((e,t)=>new Date(t.created).getTime()-new Date(e.created).getTime())},formatDate(e){const t=new Date(e),r=String(t.getDate()).padStart(2,"0"),g=String(t.getMonth()+1).padStart(2,"0"),a=t.getFullYear();return`${r}.${g}.${a}`},onPageChanged(e){this.currentPage=e,this.$router.push({path:this.$route.path,query:{...this.$route.query,page:String(e)}})},onPageSizeChanged(e){this.pageSize=e,this.currentPage=1}},beforeMount(){this.init()}},q={class:"container"},A={key:0,class:"all-news"},F={key:0,class:"news-description"},T={key:1,style:{display:"flex","flex-direction":"column",gap:"20px"}};function V(e,t,r,g,a,p){const y=P,S=B,C=h("router-link"),w=h("PlaceIcon"),x=f,z=D;return o(),n("div",q,[i(y),i(S,{tag:"h2",size:"small",style:{margin:"33px 0 30px 0"}},{default:u(()=>[c(l(e.$t("workSchedules.title")),1)]),_:1}),a.loading?(o(),n("div",T,[(o(),n(m,null,d(6,s=>i(z,{key:s,style:{height:"200px",width:"100%","border-radius":"32px","margin-bottom":"30px"}})),64))])):(o(),n("div",A,[(o(!0),n(m,null,d(a.filteredItems,s=>(o(),n("div",{key:s.id,class:"article"},[_("div",null,[i(C,{class:"news-title",to:`/consumers/news/${s.id}`},{default:u(()=>[c(l(s.title),1)]),_:2},1032,["to"]),s.description?(o(),n("div",F,[_("div",null,[i(w)]),c(" "+l(s.description),1)])):$("",!0)])]))),128)),i(x,{"current-page":a.currentPage,"total-items":a.totalItems,"page-size":a.pageSize,onPageChanged:p.onPageChanged,onPageSizeChanged:p.onPageSizeChanged},null,8,["current-page","total-items","page-size","onPageChanged","onPageSizeChanged"])]))])}const j=v(b,[["render",V],["__scopeId","data-v-3e8a1852"]]);export{j as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.