Joywork/complexes/js/30d997c22bf2d30d.js

2 lines
4.7 KiB
JavaScript
Raw Permalink Normal View History

2026-05-22 20:21:54 +02:00
"use strict";(self["webpackChunkcomplexes"]=self["webpackChunkcomplexes"]||[]).push([[230],{69230:function(e,a,s){s.r(a),s.d(a,{default:function(){return x}});var t=s(56768),l=s(90144),n=s(69689),o=s(48985),i=s(60568),r=s(22093),c=s(81387),m=s(69970),u=s(82815),p=s(6017),d=s(6192);const v={class:"homePage relative bg-white flex justify-start items-start"},f={key:0,class:"loader-div"},y={key:1,class:"viewHome flex flex-col w-full h-full min-h-full justify-start items-start px-7.5 py-5",ref:"viewHome"},w={class:"viewHome__body w-full h-full"};var h={__name:"ApartmentsList",setup(e){const a=(0,d.K)(),s=(0,c.lq)(),h=(0,l.KR)([]),_=(0,l.KR)({}),A=(0,l.KR)(!1),x={rooms:[],selectedTypes:[],selectedDecorations:[],selectedPaymentTypes:[],selectedInstallments:[],customSelectedInstallments:[],initialPayment:"",paymentTerm:"",installmentPrice:{min:"",max:""},floor:{from:"",to:""},price:{min:"",max:""},square:{min:"",max:""},squareKitchen:{min:"",max:""},useSquarePrice:!1,hiddenPrice:!1,onlyFree:!1,view:{name:"Список",value:"list",icon:"list"},limit:{total:{min:"",max:""},area:{min:"",max:""},kitchen_area:{min:"",max:""},room_types:[],decoration_types:[],window_placements:[],payment_types:[]}},P=(0,l.KR)((0,u.JH)(x)),E=(0,l.KR)({}),F=(0,l.KR)(!0),b=()=>{P.value=(0,u.JH)({...x,view:P.value.view,limit:E.value})},g=(0,t.EW)((()=>(h.value||[]).reduce(((e,a)=>e+a.floors.reduce(((e,a)=>e+a.rooms.reduce(((e,a)=>e+ +a.visible),0)),0)),0))),I=(0,t.EW)((()=>_.value&&k.value?k.value.floors.filter((e=>e.rooms.find((e=>e.position==_.value.position)))):[])),k=(0,t.EW)((()=>_.value?h.value.find((e=>e.id==_.value.entrance_id)):null)),R=e=>{_.value=e,A.value=!0},T=()=>{A.value=!1,setTimeout((()=>{_.value={}}),350)},C=e=>{const a=k.value.floors.find((a=>a.position==e));R(a.rooms.find((e=>e.position==_.value.position)))},K=()=>{h.value.forEach((e=>{e.floors.forEach((e=>{e.rooms.forEach((e=>(0,u.T)(e,P.value)))}))}))};(0,t.wB)(P,(e=>{e&&K()}),{deep:!0});const W=()=>{Object.entries(s.query).forEach((([e,a])=>{const s=["period","selectedMetros","address","complexes"];if(s.includes(e))return;if(null===a||"null"===a||""===a||"number"===typeof a&&isNaN(a))return;"area_from"==e&&(e="square_min"),"area_to"==e&&(e="square_max"),"price_from"==e&&(e="price_min"),"price_to"==e&&(e="price_max"),"selectedDecorations"==e&&Array.isArray(a)&&(a=a.map((e=>parseInt(e)))),"selectedDecorations"==e&&"string"==typeof a&&(a=[parseInt(a)]),"selectedWindowsPlacements"==e&&Array.isArray(a)&&(a=a.map((e=>parseInt(e)))),"selectedWindowsPlacements"==e&&"string"==typeof a&&(a=[parseInt(a)]),"initialPayment"===e&&(a=parseFloat(a)||""),"paymentTerm"===e&&(a=parseFloat(a)||""),"installmentPrice_min"===e&&(a=parseFloat(a)||""),"installmentPrice_max"===e&&(a=parseFloat(a)||""),"selectedInstallments"===e&&(a=Array.isArray(a)?a.map((e=>parseInt(e))):"string"===typeof a?[parseInt(a)]:[]),"selectedPaymentTypes"===e&&("string"===typeof a?a=[a]:Array.isArray(a)||(a=[]));const t=e.split("_");t.length>1?P.value[t[0]][t[1]]=a:P.value[e]="true"==a||"false"!=a&&a}))};return(0,t.sV)((async()=>{await r.A.getComplexEntrances(s.params.id,["rooms"]).then((e=>{const a=e.data.sort(((e,a)=>e.position>a.position?1:-1));a.forEach((e=>e.floors=e.floors.sort(((e,a)=>e.position>a.position?1:-1)))),a.forEach((e=>e.floors.forEach((e=>e.rooms.forEach((e=>{e.visible=!1})))))),h.value=a})).finally((()=>F.value=!1)),s.params.id&&await r.A.getFilterFields(null,s.params.id).then((({data:e})=>{E.value=e,P.value.limit=E.value})),await(0,t.dY)(),W(),K(),p.A.$on("clear-filters",b)})),(0,t.hi)((()=>{p.A.$off("clear-filters",b)})),(e,s)=>((0,t.uX)(),(0,t.CE)("div",v,[F.value?((0,t.uX)(),(0,t.CE)("div",f,s[2]||(s[2]=[(0,t.Lk)("img",{src:n},null,-1)]))):((0,t.uX)(),(0,t.CE)("div",y,[(0,t.bF)(i.A,{show_plans:!1,show_floors:!1,show_facades:!1,show_change_view:!1,"onUpdate:isOpenFiltersMenu":s[0]||(s[0]=a=>e.isOpenFiltersMenu=a),filters:P.value,filteredCount:g.value,"onUpdate:viewType":s[1]||(s[1]=a=>e.viewType=a)},null,8,["filters","filteredCount"]),(0,t.Lk)("div",w,[(0,t.bF)(o.A,{decorations:(0,l.R1)(a).decorations,windo
//# sourceMappingURL=30d997c22bf2d30d.js.map