"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"),l=require("../../../common/libraries/apiLoading.js"),i=require("../../../common/libraries/naviHelper.js"),s=require("../../../common/libraries/userUserLogin.js"),u=require("../../../gen/Apis.js"),d=require("./model.js"),r=o.useWorkStore(),t=()=>{var e,o,i;(null==(e=s.getUser)?void 0:e.getLoginStatus())&&l.getApiLoading(u.Apis.Asset.AssetHouses.SelectHouse,null==(i=null==(o=d.useModel)?void 0:o.formData)?void 0:i.value).then(e=>{d.useModel.dataList.value=null==e?void 0:e.data,console.log(e)})},a=()=>{var o,i,r;(null==(o=s.getUser)?void 0:o.getLoginStatus())&&l.getApiLoading(u.Apis.Asset.AssetHouses.SelectPermissionProject,null==(r=null==(i=d.useModel)?void 0:i.formData)?void 0:r.value).then(o=>{var l,i,s;d.useModel.dataList.value=null==o?void 0:o.data,1===(null==(l=null==o?void 0:o.data)?void 0:l.length)&&1===d.useModel.formData.value.page&&e.index.navigateTo({url:`/ME/instrument/list/index?id=${null==(s=null==(i=null==o?void 0:o.data)?void 0:i[0])?void 0:s.id}`}),console.log(o)})},n={getHouseList:t,getProjectList:a,handleLoadMore(e){var o,l,i,s;d.useModel.formData.value.page=e,"work_add"===(null==(l=null==(o=d.useModel)?void 0:o.selectType)?void 0:l.value)&&t(),"meter"===(null==(s=null==(i=d.useModel)?void 0:i.selectType)?void 0:s.value)&&a()},onSearch(){var e,o,l,i;d.useModel.formData.value.page=1,"work_add"===(null==(o=null==(e=d.useModel)?void 0:e.selectType)?void 0:o.value)&&t(),"meter"===(null==(i=null==(l=d.useModel)?void 0:l.selectType)?void 0:i.value)&&a()},handleSelectedHouse(e){var o,l;if(d.useModel.selectedHouseEd.value={id:null==e?void 0:e.id},"work_add"===(null==(l=null==(o=d.useModel)?void 0:o.selectType)?void 0:l.value))return r.selectWorkHouse=e,void i.showToastBack("选择成功！",1,!0)},handleSelectedProject(o){e.index.navigateTo({url:`/ME/instrument/list/index?id=${null==o?void 0:o.id}`})},hadnleNewBindingHouse(){var o;e.index.navigateTo({url:(null==(o=s.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;
