"use strict";const e=require("../../../common/vendor.js"),o=require("../../../common/libraries/apiLoading.js"),s=require("../../../gen/Apis.js"),i=require("./model.js"),r=require("../../../common/libraries/naviHelper.js");require("../../../common/libraries/request.js"),require("../../../common/store/useWatermarkStore.js"),require("../../../common/store/useWeAppAuthStore.js");const l=require("../../../common/store/useWorkStore.js"),a=require("../../../common/libraries/userUserLogin.js"),t=l.useWorkStore(),u=()=>{var e,r,l;(null==(e=a.getUser)?void 0:e.getLoginStatus())&&o.getApiLoading(s.Apis.Asset.AssetHouses.SelectProject,null==(l=null==(r=i.useModel)?void 0:r.formData)?void 0:l.value).then((e=>{var o,s;i.useModel.dataList.value=[...null==(s=null==(o=i.useModel)?void 0:o.dataList)?void 0:s.value,...null==e?void 0:e.data],i.useModel.metaData.value=null==e?void 0:e.meta,console.log(e)}))},n={getProjectList:u,handleLoadMore(e){i.useModel.formData.value.page=e,u()},handleSelectedProject(l){var a,u,n;"emergency_add"===(null==(u=null==(a=i.useModel)?void 0:a.source)?void 0:u.value)?(n=l,o.getApiLoading(s.Apis.Emergency.EmergencyEventTeams.GetPermission,{asset_projects_id:null==n?void 0:n.id}).then((o=>{var s;(null==(s=null==o?void 0:o.data)?void 0:s.permission)?(i.useModel.selectedHouseEd.value=n,t.selectWorkProject=n,r.showToastBack("选择成功！",1,!0)):e.index.navigateTo({url:`/pages/public/select_project/pages/permission_show?id=${null==n?void 0:n.id}`}),console.log(o)}))):(i.useModel.selectedHouseEd.value=l,t.selectWorkProject=l,r.showToastBack("选择成功！",1,!0))},hadnleNewBindingHouse(){var o;e.index.navigateTo({url:(null==(o=a.getUser)?void 0:o.getLoginStatus())?"/INDEX/binding/index":"/pages/login"})},handleQueryHouseArchives(o){e.index.navigateTo({url:`/INDEX/archive_houses/index?id=${null==o?void 0:o.asset_houses_id}`})}};exports.method=n;
