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