"use strict";const e=require("../../common/vendor.js"),o=require("../../common/libraries/getPageConfig.js"),s=require("../../common/libraries/userUserLogin.js"),n=require("../../common/libraries/naviHelper.js"),u=require("../../common/libraries/apiLoading.js"),l=require("../../gen/Apis.js"),i=require("../../gen/Enums.js");require("../../common/libraries/request.js");const a=require("../../common/store/useWeAppAuthStore.js");if(require("../../common/store/useWorkStore.js"),require("../../common/libraries/setTabBar.js"),!Array){(e.resolveComponent("hs-enum-tag")+e.resolveComponent("uni-icons")+e.resolveComponent("up-icon")+e.resolveComponent("hs-popup"))()}Math||((()=>"../hs-enum-tag/hs-enum-tag.js")+(()=>"../../uni_modules/uni-icons/components/uni-icons/uni-icons.js")+(()=>"../../node-modules/uview-plus/components/u-icon/u-icon.js")+(()=>"../hs-popup/hs-popup.js"))();const r=e.defineComponent({__name:"hs-popup-switch-house",props:["show","dataList","pageSource","defaultHouseId"],emits:["close","change"],setup(r,{emit:t}){const d=r,c=e.ref([]),p=e.ref({page:1}),v=e.ref({}),h=a.useWeAppAuthStore();e.watch((()=>null==d?void 0:d.show),(()=>{(null==d?void 0:d.show)&&(p.value.page=1,c.value=[],_())}));const m=()=>{t("close")},g=()=>{var o;e.index.navigateTo({url:(null==(o=null==h?void 0:h.data)?void 0:o.user)?"/INDEX/binding/index":"/pages/login"})},_=()=>{var e;(null==(e=s.getUserLogin)?void 0:e.getLoginStatus())&&u.getApiLoading(l.Apis.Archive.HouseOccupants.List,null==p?void 0:p.value).then((e=>{c.value=[...c.value,...null==e?void 0:e.data],v.value=null==e?void 0:e.meta,console.log(e)}))};return(s,a)=>{var r,p;return e.e({a:null==(r=c.value)?void 0:r.length},(null==(p=c.value)?void 0:p.length)?{b:e.f(c.value,((s,a,r)=>{var d,c,p,v,m,g,_;return e.e({a:e.t(null==(d=null==s?void 0:s.asset_house)?void 0:d.full_name),b:"66b36f5a-1-"+r+",66b36f5a-0",c:e.p({value:null==s?void 0:s.house_relation,Enums:e.unref(i.HouseOccupantsHouseRelationEnum)}),d:(null==s?void 0:s.asset_houses_id)===(null==(v=null==(p=null==(c=e.unref(h))?void 0:c.data)?void 0:p.selected_house)?void 0:v.id)},(null==s?void 0:s.asset_houses_id)===(null==(_=null==(g=null==(m=e.unref(h))?void 0:m.data)?void 0:g.selected_house)?void 0:_.id)?{e:"66b36f5a-2-"+r+",66b36f5a-0",f:e.p({type:"checkbox-filled",size:"20",color:e.unref(o.getStyleColorValueInfo)()})}:{g:"66b36f5a-3-"+r+",66b36f5a-0",h:e.p({type:"circle",size:"20",color:"#999"})},{i:a,j:e.o((e=>(e=>{var o,s;(null==e?void 0:e.asset_houses_id)!==(null==(s=null==(o=null==h?void 0:h.data)?void 0:o.selected_house)?void 0:s.id)?u.getApiLoading(l.Apis.Archive.HouseOccupants.UpdateSelectedHouse,{asset_houses_id:null==e?void 0:e.asset_houses_id}).then((o=>{null==h||h.me((()=>{t("change",e)})),console.log(o)})):n.showToast("已是该房屋！")})(s)),a)})}))}:{},{c:e.p({name:"plus-circle",size:"25",color:"#3D3D3D"}),d:e.o(g),e:e.n("archive_houses"===(null==d?void 0:d.pageSource)?"popup_content archive_houses_content":"popup_content"),f:e.o(m),g:e.p({show:null==d?void 0:d.show,mode:"bottom",closeable:!0,round:20})})}}}),t=e._export_sfc(r,[["__scopeId","data-v-66b36f5a"]]);wx.createComponent(t);
