2025-08-29 09:51:02 +08:00
|
|
|
|
"use strict";
|
|
|
|
|
|
const common_vendor = require("../../common/vendor.js");
|
2026-01-15 19:26:00 +08:00
|
|
|
|
const common_libraries_getPageConfig = require("../../common/libraries/getPageConfig.js");
|
|
|
|
|
|
require("../../common/store/useWeAppAuthStore.js");
|
|
|
|
|
|
require("../../gen/Apis.js");
|
|
|
|
|
|
require("../../common/libraries/request.js");
|
|
|
|
|
|
require("../../common/store/useWorkStore.js");
|
|
|
|
|
|
require("../../common/libraries/apiLoading.js");
|
2025-08-29 09:51:02 +08:00
|
|
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
|
|
|
__name: "hs-radio",
|
|
|
|
|
|
props: [
|
|
|
|
|
|
"valueModel",
|
|
|
|
|
|
"Enums",
|
|
|
|
|
|
"size",
|
|
|
|
|
|
"radioStyle",
|
|
|
|
|
|
"selectStyle",
|
|
|
|
|
|
"disableds"
|
|
|
|
|
|
// 不可选数组 6-7 kfyy ,7.40 cook,
|
|
|
|
|
|
],
|
|
|
|
|
|
emits: ["update:valueModel", "onChange"],
|
|
|
|
|
|
setup(__props, { emit }) {
|
|
|
|
|
|
const props = __props;
|
|
|
|
|
|
const selectValue = common_vendor.ref("");
|
2026-01-15 19:26:00 +08:00
|
|
|
|
const getStyleInfo = () => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
...props.selectStyle,
|
|
|
|
|
|
...common_libraries_getPageConfig.getStyleBgInfo()
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
2025-08-29 09:51:02 +08:00
|
|
|
|
const getEnums = () => {
|
|
|
|
|
|
let list = Object.entries(props == null ? void 0 : props.Enums).map(
|
|
|
|
|
|
([_key, value]) => ({
|
|
|
|
|
|
text: value.text,
|
|
|
|
|
|
value: value.value
|
|
|
|
|
|
})
|
|
|
|
|
|
);
|
|
|
|
|
|
return list;
|
|
|
|
|
|
};
|
|
|
|
|
|
common_vendor.watch(
|
|
|
|
|
|
() => props == null ? void 0 : props.valueModel,
|
|
|
|
|
|
() => {
|
|
|
|
|
|
console.log("mounted2", props == null ? void 0 : props.valueModel);
|
|
|
|
|
|
selectValue.value = props == null ? void 0 : props.valueModel;
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
const onClick = (e) => {
|
|
|
|
|
|
var _a;
|
|
|
|
|
|
if ((_a = props == null ? void 0 : props.disableds) == null ? void 0 : _a.includes(e == null ? void 0 : e.value)) {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
selectValue.value = e == null ? void 0 : e.value;
|
|
|
|
|
|
emit("update:valueModel", e == null ? void 0 : e.value);
|
|
|
|
|
|
emit("onChange", e);
|
|
|
|
|
|
};
|
|
|
|
|
|
common_vendor.onMounted(() => {
|
|
|
|
|
|
console.log("mounted1", props == null ? void 0 : props.valueModel);
|
|
|
|
|
|
if (props == null ? void 0 : props.valueModel) {
|
|
|
|
|
|
selectValue.value = props == null ? void 0 : props.valueModel;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
return (_ctx, _cache) => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
a: common_vendor.f(getEnums(), (i, index, i0) => {
|
|
|
|
|
|
var _a;
|
|
|
|
|
|
return {
|
|
|
|
|
|
a: common_vendor.t(i == null ? void 0 : i.text),
|
|
|
|
|
|
b: `item_${index}`,
|
2026-01-15 19:26:00 +08:00
|
|
|
|
c: common_vendor.n(`item item_${props == null ? void 0 : props.size} ${((_a = props == null ? void 0 : props.disableds) == null ? void 0 : _a.includes(i == null ? void 0 : i.value)) ? "disabled" : ""}`),
|
|
|
|
|
|
d: common_vendor.s((i == null ? void 0 : i.value) === (props == null ? void 0 : props.valueModel) || (i == null ? void 0 : i.value) === selectValue.value ? getStyleInfo() : ""),
|
2025-08-29 09:51:02 +08:00
|
|
|
|
e: common_vendor.o(($event) => onClick(i), `item_${index}`)
|
|
|
|
|
|
};
|
|
|
|
|
|
}),
|
|
|
|
|
|
b: common_vendor.s(props == null ? void 0 : props.radioStyle)
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-252f0ac0"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/components/hs-radio/hs-radio.vue"]]);
|
|
|
|
|
|
wx.createComponent(Component);
|