"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 common_libraries_tools = require("../../common/libraries/tools.js"); require("../../common/libraries/request.js"); require("../../common/store/useWeAppAuthStore.js"); if (!Array) { const _easycom_hs_cell2 = common_vendor.resolveComponent("hs-cell"); const _easycom_up_tabs2 = common_vendor.resolveComponent("up-tabs"); const _easycom_hs_empty2 = common_vendor.resolveComponent("hs-empty"); const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons"); const _easycom_hs_popup2 = common_vendor.resolveComponent("hs-popup"); (_easycom_hs_cell2 + _easycom_up_tabs2 + _easycom_hs_empty2 + _easycom_uni_icons2 + _easycom_hs_popup2)(); } const _easycom_hs_cell = () => "../hs-cell/hs-cell.js"; const _easycom_up_tabs = () => "../../node-modules/uview-plus/components/u-tabs/u-tabs.js"; const _easycom_hs_empty = () => "../hs-empty/hs-empty.js"; const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js"; const _easycom_hs_popup = () => "../hs-popup/hs-popup.js"; if (!Math) { (_easycom_hs_cell + _easycom_up_tabs + _easycom_hs_empty + _easycom_uni_icons + _easycom_hs_popup)(); } const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "hs-popup-project", props: ["title"], emits: ["close", "change"], setup(__props, { emit }) { const props = __props; let keywordStore = ""; const formData = common_vendor.ref({ page: 1 }); const searchValue = common_vendor.ref(""); const selectEd = common_vendor.ref({ name: "", id: 0 }); const pickerList = common_vendor.ref([]); const pickerListProject = common_vendor.ref([]); const pickerListBuilding = common_vendor.ref([]); const pickerListUnit = common_vendor.ref([]); common_vendor.ref([]); const popupShow = common_vendor.ref(false); const currentValue = common_vendor.ref(0); const itemsList = common_vendor.ref([{ name: "小区" }]); const selectValueEd = common_vendor.ref([]); const handleSearch = common_libraries_tools.debounce((e) => { if (e === keywordStore) { return; } keywordStore = e; formData.value.page = 1; pickerListProject.value = []; getPickerList(); }, 500); const onPopupShow = () => { popupShow.value = !popupShow.value; if (popupShow.value) { setTimeout(() => { currentValue.value = 0; pickerListProject.value = []; getPickerList(); }, 300); } }; const handleSwitchClick = (e) => { currentValue.value = e == null ? void 0 : e.index; console.log(e, "eee"); }; const getPickerList = () => { common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Asset.AssetHouses.SelectProject, { name: searchValue.value, ...formData.value }).then((res) => { pickerListProject.value = res == null ? void 0 : res.data; pickerList.value = res == null ? void 0 : res.data; console.log(res); }); }; const onSelectMerchant = (i) => { currentValue.value = 1; itemsList.value = [{ name: "小区" }, { name: "楼栋" }]; selectValueEd.value[0] = i; handleGetBuilding(i); }; const handleGetBuilding = (data) => { common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Asset.AssetHouses.SelectBuilding, { asset_projects_id: data == null ? void 0 : data.id, name: searchValue.value, ...formData.value }).then((res) => { pickerListBuilding.value = res == null ? void 0 : res.data; pickerList.value = res == null ? void 0 : res.data; console.log(res); }); }; const onSelectBuildingt = (i) => { currentValue.value = 2; itemsList.value = [{ name: "小区" }, { name: "楼栋" }, { name: "单元" }]; selectValueEd.value[1] = i; handleGetUnit(i); }; const handleGetUnit = (data) => { var _a; common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Asset.AssetHouses.SelectUnit, { asset_projects_id: (_a = selectValueEd.value[0]) == null ? void 0 : _a.id, asset_buildings_id: data == null ? void 0 : data.id, name: searchValue.value, ...formData.value }).then((res) => { pickerListUnit.value = res == null ? void 0 : res.data; pickerList.value = res == null ? void 0 : res.data; console.log(res); }); }; const onSelectUnit = (i) => { currentValue.value = 3; itemsList.value = [{ name: "小区" }, { name: "楼栋" }, { name: "单元" }, { name: "房屋" }]; selectValueEd.value[2] = i; }; return (_ctx, _cache) => { var _a, _b, _c; return common_vendor.e({ a: common_vendor.o(onPopupShow), b: common_vendor.p({ title: props == null ? void 0 : props.title, isLink: true, isPlaceholder: true, required: true, borderTop: true, value: (_a = selectEd.value) == null ? void 0 : _a.name }), c: common_vendor.o([ ($event) => searchValue.value = $event.detail.value, //@ts-ignore (...args) => common_vendor.unref(handleSearch) && common_vendor.unref(handleSearch)(...args) ]), d: common_vendor.o( //@ts-ignore (...args) => common_vendor.unref(handleSearch) && common_vendor.unref(handleSearch)(...args) ), e: searchValue.value, f: popupShow.value }, popupShow.value ? { g: common_vendor.o(handleSwitchClick), h: common_vendor.p({ list: itemsList.value, current: currentValue.value || 0 }) } : {}, { i: !((_b = pickerList.value) == null ? void 0 : _b.length) }, !((_c = pickerList.value) == null ? void 0 : _c.length) ? {} : {}, { j: currentValue.value === 0 }, currentValue.value === 0 ? { k: common_vendor.f(pickerListProject.value, (i, index, i0) => { var _a2, _b2; return common_vendor.e({ a: common_vendor.t(i == null ? void 0 : i.name), b: ((_a2 = selectEd.value) == null ? void 0 : _a2.id) === (i == null ? void 0 : i.id) }, ((_b2 = selectEd.value) == null ? void 0 : _b2.id) === (i == null ? void 0 : i.id) ? { c: "7ecd4980-4-" + i0 + ",7ecd4980-1", d: common_vendor.p({ type: "checkmarkempty", size: "20", color: "#FBA60D" }) } : {}, { e: `key_${index}`, f: common_vendor.o(($event) => onSelectMerchant(i), `key_${index}`) }); }) } : {}, { l: currentValue.value === 1 }, currentValue.value === 1 ? { m: common_vendor.f(pickerListBuilding.value, (i, index, i0) => { var _a2, _b2; return common_vendor.e({ a: common_vendor.t(i == null ? void 0 : i.name), b: ((_a2 = selectEd.value) == null ? void 0 : _a2.id) === (i == null ? void 0 : i.id) }, ((_b2 = selectEd.value) == null ? void 0 : _b2.id) === (i == null ? void 0 : i.id) ? { c: "7ecd4980-5-" + i0 + ",7ecd4980-1", d: common_vendor.p({ type: "checkmarkempty", size: "20", color: "#FBA60D" }) } : {}, { e: `key_${index}`, f: common_vendor.o(($event) => onSelectBuildingt(i), `key_${index}`) }); }) } : {}, { n: currentValue.value === 2 }, currentValue.value === 2 ? { o: common_vendor.f(pickerListUnit.value, (i, index, i0) => { var _a2, _b2; return common_vendor.e({ a: common_vendor.t(i == null ? void 0 : i.name), b: ((_a2 = selectEd.value) == null ? void 0 : _a2.id) === (i == null ? void 0 : i.id) }, ((_b2 = selectEd.value) == null ? void 0 : _b2.id) === (i == null ? void 0 : i.id) ? { c: "7ecd4980-6-" + i0 + ",7ecd4980-1", d: common_vendor.p({ type: "checkmarkempty", size: "20", color: "#FBA60D" }) } : {}, { e: `key_${index}`, f: common_vendor.o(($event) => onSelectUnit(i), `key_${index}`) }); }) } : {}, { p: common_vendor.o(onPopupShow), q: common_vendor.p({ show: popupShow.value, mode: "bottom", closeable: true, round: 20 }) }); }; } }); const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-7ecd4980"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/components/hs-popup-project/hs-popup-project.vue"]]); wx.createComponent(Component);