"use strict";
const common_vendor = require("../../common/vendor.js");
const common_libraries_apiLoading = require("../../common/libraries/apiLoading.js");
const gen_Apis = require("../../gen/Apis.js");
const INDEX_collection_model = require("./model.js");
const common_libraries_naviHelper = require("../../common/libraries/naviHelper.js");
require("../../common/libraries/request.js");
const common_store_useWeAppAuthStore = require("../../common/store/useWeAppAuthStore.js");
const common_store_useWorkStore = require("../../common/store/useWorkStore.js");
require("../../common/libraries/userUserLogin.js");
common_store_useWorkStore.useWorkStore();
common_store_useWeAppAuthStore.useWeAppAuthStore();
const getHouseList = () => {
  common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Archive.HouseOccupants.List, {}).then((res) => {
    INDEX_collection_model.useModel.dataList.value = res == null ? void 0 : res.data;
    INDEX_collection_model.useModel.metaData.value = res == null ? void 0 : res.meta;
    console.log(res);
  });
};
const method = {
  getHouseList,
  handleTableChange(e) {
    INDEX_collection_model.useModel.current.value = e;
    if (e) {
      INDEX_collection_model.useModel.dataList.value = [];
    } else {
      getHouseList();
    }
    console.log(e, "eee");
  },
  toNext() {
    var _a, _b, _c;
    if (!((_c = (_b = (_a = INDEX_collection_model.useModel) == null ? void 0 : _a.formData) == null ? void 0 : _b.value) == null ? void 0 : _c.asset_houses_id)) {
      return common_libraries_naviHelper.showToastBack("请选择房屋！");
    }
    common_vendor.index.navigateTo({
      url: "/INDEX/collection/confirm"
    });
  },
  handleSelect(e) {
    INDEX_collection_model.useModel.formData.value.asset_houses_id = e == null ? void 0 : e.asset_houses_id;
  }
};
exports.method = method;
