import "../../../../../node_modules/element-plus/es/index.mjs";
/* empty css                                                             */
/* empty css                                                                */
import { inject, ref, watchEffect, createBlock, openBlock, mergeProps, withCtx, createVNode, createTextVNode, toDisplayString, unref } from "vue";
import Node from "./Node.vue2.mjs";
import { ElText } from "../../../../../node_modules/element-plus/es/components/text/index.mjs";
const _sfc_main = {
  __name: "ServiceNode",
  props: {
    node: Object
  },
  setup(__props) {
    const { nodesError } = inject("flowDesign", { nodesError: ref({}) });
    const props = __props;
    const content = ref("");
    watchEffect(() => {
      const errors = [];
      const { id, name, implementationType, implementation } = props.node;
      if (!implementationType) {
        errors.push({ id, name, message: "执行类型为空" });
        content.value = "执行类型为空";
      } else if (!implementation) {
        errors.push({ id, name, message: "执行值为空" });
        content.value = "执行值为空";
      } else {
        content.value = `执行服务`;
      }
      if (errors.length > 0) {
        nodesError.value[id] = errors;
      } else {
        delete nodesError.value[id];
      }
    });
    return (_ctx, _cache) => {
      const _component_el_text = ElText;
      return openBlock(), createBlock(Node, mergeProps(_ctx.$attrs, {
        icon: "el:Tools",
        color: "#ffc107",
        node: __props.node
      }), {
        default: withCtx(() => [
          createVNode(_component_el_text, null, {
            default: withCtx(() => [
              createTextVNode(toDisplayString(unref(content)), 1)
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 16, ["node"]);
    };
  }
};
export {
  _sfc_main as default
};
