"use strict";const e=require("../../common/vendor.js"),l=require("../../common/libraries/apiLoading.js"),a=require("../../common/libraries/tools.js"),u=require("../../gen/Apis.js");if(require("../../common/libraries/request.js"),require("../../common/store/useWeAppAuthStore.js"),require("../../common/store/useWatermarkStore.js"),require("../../common/store/useWorkStore.js"),!Array){(e.resolveComponent("hs-cell")+e.resolveComponent("up-tabs")+e.resolveComponent("hs-empty")+e.resolveComponent("uni-icons")+e.resolveComponent("hs-popup"))()}Math||((()=>"../hs-cell/hs-cell.js")+(()=>"../../node-modules/uview-plus/components/u-tabs/u-tabs.js")+(()=>"../hs-empty/hs-empty.js")+(()=>"../../uni_modules/uni-icons/components/uni-icons/uni-icons.js")+(()=>"../hs-popup/hs-popup.js"))();const o=e.defineComponent({__name:"hs-popup-project-houer",props:["title","defaultValueName"],emits:["close","change"],setup(o,{emit:n}){const i=o;let v="";const s=e.ref({page:1}),t=e.ref(""),d=e.ref({name:"",id:0}),r=e.ref([]),c=e.ref([]),m=e.ref([]),p=e.ref([]),f=e.ref([]),h=e.ref(""),_=e.ref(!1),g=e.ref(0),A=e.ref([{name:"小区"}]),j=e.ref([]);e.watch(()=>null==i?void 0:i.defaultValueName,()=>{h.value=null==i?void 0:i.defaultValueName});const k=a.debounce(e=>{e!==v&&(v=e,s.value.page=1,c.value=[],q(g.value))},500),y=()=>{_.value=!_.value,_.value&&setTimeout(()=>{g.value=0,c.value=[],$()},300)},b=e=>{t.value="",g.value=null==e?void 0:e.index,console.log(e,"eee")};e.watch(()=>g.value,e=>{q(e)});const q=e=>{0===e&&$(),1===e&&C(j.value[0]),2===e&&S(j.value[1]),3===e&&L(j.value[2])},$=()=>{l.getApiLoading(u.Apis.Asset.AssetHouses.SelectProject,{name:t.value,...s.value}).then(e=>{c.value=null==e?void 0:e.data,r.value=null==e?void 0:e.data,console.log(e)})},C=e=>{l.getApiLoading(u.Apis.Asset.AssetHouses.SelectBuilding,{asset_projects_id:null==e?void 0:e.id,name:t.value,...s.value}).then(e=>{m.value=null==e?void 0:e.data,r.value=null==e?void 0:e.data,console.log(e)})},S=e=>{var a;l.getApiLoading(u.Apis.Asset.AssetHouses.SelectUnit,{asset_projects_id:null==(a=j.value[0])?void 0:a.id,asset_buildings_id:null==e?void 0:e.id,name:t.value,...s.value}).then(e=>{p.value=null==e?void 0:e.data,r.value=null==e?void 0:e.data,console.log(e)})},L=e=>{var a,o;l.getApiLoading(u.Apis.Asset.AssetHouses.SelectHouse,{asset_projects_id:null==(a=j.value[0])?void 0:a.id,asset_buildings_id:null==(o=j.value[1])?void 0:o.id,asset_units_id:null==e?void 0:e.id,name:t.value,...s.value}).then(e=>{f.value=null==e?void 0:e.data,r.value=null==e?void 0:e.data,console.log(e)})};return(l,a)=>{var u,o;return e.e({a:e.o(y),b:e.p({title:null==i?void 0:i.title,isLink:!0,isPlaceholder:!0,required:!0,borderTop:!0,value:h.value}),c:e.o([e=>t.value=e.detail.value,(...l)=>e.unref(k)&&e.unref(k)(...l)]),d:e.o((...l)=>e.unref(k)&&e.unref(k)(...l)),e:t.value,f:_.value},_.value?{g:e.o(b),h:e.p({list:A.value,current:g.value||0})}:{},{i:!(null==(u=r.value)?void 0:u.length)},(null==(o=r.value)||o.length,{}),{j:0===g.value},0===g.value?{k:e.f(c.value,(l,a,u)=>{var o,n;return e.e({a:e.t(null==l?void 0:l.name),b:(null==(o=d.value)?void 0:o.id)===(null==l?void 0:l.id)},(null==(n=d.value)?void 0:n.id)===(null==l?void 0:l.id)?{c:"f6ca5cd0-4-"+u+",f6ca5cd0-1",d:e.p({type:"checkmarkempty",size:"20",color:"#FBA60D"})}:{},{e:`key_${a}`,f:e.o(e=>(e=>{t.value="",g.value=1,A.value=[{name:"小区"},{name:"楼栋"}],j.value[0]=e})(l),`key_${a}`)})})}:{},{l:1===g.value},1===g.value?{m:e.f(m.value,(l,a,u)=>{var o,n;return e.e({a:e.t(null==l?void 0:l.name),b:(null==(o=d.value)?void 0:o.id)===(null==l?void 0:l.id)},(null==(n=d.value)?void 0:n.id)===(null==l?void 0:l.id)?{c:"f6ca5cd0-5-"+u+",f6ca5cd0-1",d:e.p({type:"checkmarkempty",size:"20",color:"#FBA60D"})}:{},{e:`key_${a}`,f:e.o(e=>(e=>{t.value="",g.value=2,A.value=[{name:"小区"},{name:"楼栋"},{name:"单元"}],j.value[1]=e})(l),`key_${a}`)})})}:{},{n:2===g.value},2===g.value?{o:e.f(p.value,(l,a,u)=>{var o,n;return e.e({a:e.t(null==l?void 0:l.name),b:(null==(o=d.value)?void 0:o.id)===(null==l?void 0:l.id)},(null==(n=d.value)?void 0:n.id)===(null==l?void 0:l.id)?{c:"f6ca5cd0-6-"+u+",f6ca5cd0-1",d:e.p({type:"checkmarkempty",size:"20",color:"#FBA60D"})}:{},{e:`key_${a}`,f:e.o(e=>(e=>{t.value="",g.value=3,A.value=[{name:"小区"},{name:"楼栋"},{name:"单元"},{name:"房屋"}],j.value[2]=e})(l),`key_${a}`)})})}:{},{p:3===g.value},3===g.value?{q:e.f(f.value,(l,a,u)=>{var o,i;return e.e({a:e.t(null==l?void 0:l.name),b:(null==(o=d.value)?void 0:o.id)===(null==l?void 0:l.id)},(null==(i=d.value)?void 0:i.id)===(null==l?void 0:l.id)?{c:"f6ca5cd0-7-"+u+",f6ca5cd0-1",d:e.p({type:"checkmarkempty",size:"20",color:"#FBA60D"})}:{},{e:`key_${a}`,f:e.o(e=>(e=>{t.value="",j.value[3]=e,h.value=null==j?void 0:j.value.map(e=>null==e?void 0:e.name).join(""),n("change",j.value),y()})(l),`key_${a}`)})})}:{},{r:e.o(y),s:e.p({show:_.value,mode:"bottom",closeable:!0,round:20})})}}}),n=e._export_sfc(o,[["__scopeId","data-v-f6ca5cd0"]]);wx.createComponent(n);
