"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");
  _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-picker-levels",
  props: [
    "Enums",
    "title",
    "pickerIndex",
    "value",
    "borderTop",
    "required",
    "disabled",
    "tip",
    "key",
    "des",
    "padding",
    "valueModel",
    "placeholder",
    "titleStyle",
    "rightStyle",
    "defaultValue"
  ],
  emits: ["change", "update:valueModel"],
  setup(__props, { emit }) {
    const props = __props;
    const borderStyle = "1rpx solid #eee";
    const paddingStyle = "15rpx 0";
    const pickerList = common_vendor.ref([]);
    const selectValue = common_vendor.ref("");
    const onChange = (e) => {
      let selectData = pickerList.value[e == null ? void 0 : e.detail.value];
      selectValue.value = selectData == null ? void 0 : selectData.label;
      emit("update:valueModel", (selectData == null ? void 0 : selectData.value) || "");
      emit("change", selectData);
    };
    common_vendor.watch(
      () => props.defaultValue,
      (newVal) => {
        selectValue.value = newVal;
      }
    );
    const getPickerList = () => {
      common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Emergency.EmergencyEventLevels.Select, {}).then((res) => {
        pickerList.value = res == null ? void 0 : res.data;
        console.log(res);
      });
    };
    common_vendor.onMounted(() => {
      getPickerList();
    });
    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.s(props.titleStyle),
        d: selectValue.value
      }, selectValue.value ? {
        e: common_vendor.t(selectValue.value)
      } : {
        f: common_vendor.t((props == null ? void 0 : props.placeholder) || "请选择")
      }, {
        g: common_vendor.p({
          type: "right",
          color: "#333",
          size: "12"
        }),
        h: common_vendor.s(props.rightStyle),
        i: props.borderTop ? borderStyle : "",
        j: (props == null ? void 0 : props.padding) || paddingStyle,
        k: pickerList.value,
        l: (props == null ? void 0 : props.key) || "label",
        m: props == null ? void 0 : props.disabled,
        n: common_vendor.o(onChange)
      });
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-c0acef32"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/components/hs-radio-picker-levels/hs-radio-picker-levels.vue"]]);
wx.createComponent(Component);
