82 lines
2.6 KiB
JavaScript
82 lines
2.6 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
if (!Array) {
|
|
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
|
_easycom_uni_icons2();
|
|
}
|
|
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
|
if (!Math) {
|
|
_easycom_uni_icons();
|
|
}
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
__name: "hs-radio-cell-picker",
|
|
props: [
|
|
"Enums",
|
|
"title",
|
|
"pickerIndex",
|
|
"value",
|
|
"borderTop",
|
|
"required",
|
|
"tip",
|
|
"key",
|
|
"des",
|
|
"padding",
|
|
"valueModel",
|
|
"disabled"
|
|
],
|
|
emits: ["change", "update:valueModel"],
|
|
setup(__props, { emit }) {
|
|
const props = __props;
|
|
const placeholder = "请选择";
|
|
const valueEd = common_vendor.ref("");
|
|
const pickerList = common_vendor.ref([]);
|
|
const onChange = (e) => {
|
|
let selectData = pickerList.value[e == null ? void 0 : e.detail.value];
|
|
valueEd.value = selectData == null ? void 0 : selectData.text;
|
|
emit("update:valueModel", selectData == null ? void 0 : selectData.value);
|
|
emit("change", selectData);
|
|
};
|
|
const getEnums = () => {
|
|
let list = Object.entries(props == null ? void 0 : props.Enums).map(
|
|
([key, value]) => ({
|
|
text: value.text,
|
|
value: value.value,
|
|
type: (value == null ? void 0 : value.type) || ""
|
|
})
|
|
);
|
|
pickerList.value = list;
|
|
};
|
|
common_vendor.watch(
|
|
() => props == null ? void 0 : props.Enums,
|
|
() => {
|
|
getEnums();
|
|
}
|
|
);
|
|
common_vendor.onMounted(() => {
|
|
getEnums();
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.t((props == null ? void 0 : props.title) || "标题"),
|
|
b: __props.required
|
|
}, __props.required ? {} : {}, {
|
|
c: common_vendor.t(valueEd.value || placeholder),
|
|
d: common_vendor.p({
|
|
type: "right",
|
|
size: "15",
|
|
color: "#999"
|
|
}),
|
|
e: common_vendor.n(valueEd.value ? "valueStyle" : "valueStyle placeholderStyle"),
|
|
f: props.borderTop ? "1rpx solid #eee" : "",
|
|
g: (props == null ? void 0 : props.padding) || "10rpx 0",
|
|
h: pickerList.value,
|
|
i: (props == null ? void 0 : props.key) || "text",
|
|
j: common_vendor.o(onChange),
|
|
k: props == null ? void 0 : props.disabled
|
|
});
|
|
};
|
|
}
|
|
});
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-565e829c"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/components/hs-radio-cell-picker/hs-radio-cell-picker.vue"]]);
|
|
wx.createComponent(Component);
|