2026-01-30 09:54:46 +08:00

121 lines
4.9 KiB
JavaScript

"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");
require("../../common/libraries/request.js");
require("../../common/store/useWeAppAuthStore.js");
require("../../common/store/useWatermarkStore.js");
require("../../common/store/useWorkStore.js");
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
const _easycom_hs_scroll_view2 = common_vendor.resolveComponent("hs-scroll-view");
const _easycom_hs_popup2 = common_vendor.resolveComponent("hs-popup");
(_easycom_uni_icons2 + _easycom_hs_scroll_view2 + _easycom_hs_popup2)();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_hs_scroll_view = () => "../hs-scroll-view/hs-scroll-view.js";
const _easycom_hs_popup = () => "../hs-popup/hs-popup.js";
if (!Math) {
(_easycom_uni_icons + _easycom_hs_scroll_view + _easycom_hs_popup)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "hs-popup-project",
props: ["Apis", "baseStyle"],
emits: ["close", "change"],
setup(__props, { emit }) {
const props = __props;
const formData = common_vendor.ref({ page: 1 });
const meta = common_vendor.ref({});
const selectEd = common_vendor.ref({ name: "全部项目", id: 0 });
const pickerList = common_vendor.ref([]);
const popupShow = common_vendor.ref(false);
const onPopupShow = () => {
popupShow.value = !popupShow.value;
if (popupShow.value) {
formData.value.page = 1;
pickerList.value = [];
getPickerList();
}
};
const handleScrollLower = (e) => {
formData.value.page = (e == null ? void 0 : e.page) || 1;
getPickerList();
};
const getPickerList = () => {
var _a, _b, _c;
common_libraries_apiLoading.getApiLoading((_c = (_b = (_a = gen_Apis.Apis) == null ? void 0 : _a.Asset) == null ? void 0 : _b.AssetHouses) == null ? void 0 : _c.SelectProject, formData.value).then((res) => {
pickerList.value = [...pickerList.value, ...res == null ? void 0 : res.data];
meta.value = res == null ? void 0 : res.meta;
console.log(res);
});
};
const onSelectMerchant = (i) => {
selectEd.value = i;
emit("change", { asset_projects_id: i == null ? void 0 : i.id });
popupShow.value = !popupShow.value;
};
const handleClose = () => {
selectEd.value = { name: "全部项目", id: 0 };
emit("change", { asset_projects_id: void 0 });
};
return (_ctx, _cache) => {
var _a, _b, _c, _d, _e;
return common_vendor.e({
a: common_vendor.t((_a = selectEd.value) == null ? void 0 : _a.name),
b: common_vendor.s((props == null ? void 0 : props.baseStyle) || {}),
c: ((_b = selectEd.value) == null ? void 0 : _b.name) === "全部项目"
}, ((_c = selectEd.value) == null ? void 0 : _c.name) === "全部项目" ? {
d: common_vendor.p({
type: "down",
color: "#333",
size: "12"
})
} : {}, {
e: common_vendor.o(onPopupShow),
f: ((_d = selectEd.value) == null ? void 0 : _d.name) !== "全部项目"
}, ((_e = selectEd.value) == null ? void 0 : _e.name) !== "全部项目" ? {
g: common_vendor.p({
type: "close",
color: "#666",
size: "18"
}),
h: common_vendor.o(handleClose)
} : {}, {
i: common_vendor.f(pickerList.value, (i, index, i0) => {
var _a2, _b2;
return common_vendor.e({
a: common_vendor.t(i == null ? void 0 : i.name),
b: common_vendor.t(i == null ? void 0 : i.province),
c: common_vendor.t(i == null ? void 0 : i.city),
d: common_vendor.t(i == null ? void 0 : i.area),
e: ((_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) ? {
f: "7ecd4980-4-" + i0 + ",7ecd4980-3",
g: common_vendor.p({
type: "checkmarkempty",
size: "20",
color: "#2A7EFB"
})
} : {}, {
h: `key_${index}`,
i: common_vendor.o(($event) => onSelectMerchant(i), `key_${index}`)
});
}),
j: common_vendor.o(handleScrollLower),
k: common_vendor.p({
meta: meta.value
}),
l: common_vendor.o(onPopupShow),
m: 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-employee/src/components/hs-popup-project/hs-popup-project.vue"]]);
wx.createComponent(Component);