import { ref, watch, onMounted, createBlock, openBlock, resolveDynamicComponent, unref, isRef } from "vue";
import { loadComponentByPath } from "../../utils/common.mjs";
const path = "/bus/module/comm/risk/components/RiskInterceptResult";
const _sfc_main = /* @__PURE__ */ Object.assign({
  inheritAttrs: false
}, {
  __name: "RiskSchRenderer",
  props: {
    // 是否显示
    modelValue: {
      type: Boolean,
      default: false
    },
    ctx: {
      type: Object,
      default: {}
    },
    schNo: {
      type: String,
      default: ""
    },
    busNo: {
      type: String,
      default: ""
    },
    paramList: {
      type: Object,
      default: {}
    }
  },
  emits: ["update:modelValue", "confirm", "cancel"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const dialogVisible = ref(false);
    watch(
      () => {
        return props.modelValue;
      },
      (val) => {
        dialogVisible.value = val;
      },
      {
        immediate: true
      }
    );
    watch(dialogVisible, (val) => {
      emit("update:modelValue", val);
    });
    function confirm(data) {
      emit("confirm", data);
    }
    function cancel(data) {
      emit("cancel", data);
    }
    const currentComponent = ref(null);
    onMounted(() => {
      loadComponentByPath(path, props.ctx.$router, currentComponent);
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(resolveDynamicComponent(unref(currentComponent)), {
        modelValue: unref(dialogVisible),
        "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(dialogVisible) ? dialogVisible.value = $event : null),
        schNo: __props.schNo,
        busNo: __props.busNo,
        paramList: __props.paramList,
        onConfirm: confirm,
        onCancel: cancel
      }, null, 40, ["modelValue", "schNo", "busNo", "paramList"]);
    };
  }
});
export {
  _sfc_main as default
};
