'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../../../hooks/index.js');
var useDialogEvents = require('../../../../hooks/composables/useDialogEvents.js');

const _hoisted_1 = {
  key: 0,
  class: "menu-text-badge"
};
const _hoisted_2 = ["onClick"];
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "subItem",
  props: {
    // 菜单列表
    chil: {
      type: Array,
      default: () => []
    }
  },
  setup(__props) {
    const props = __props;
    const events = useDialogEvents.useFormEvents();
    const chils = vue.computed(() => {
      return props.chil;
    });
    const onALinkClick = (val) => {
      events.onFormDialogOpen({
        name: "setFOpenLink",
        data: val
      });
    };
    return (_ctx, _cache) => {
      const _component_SvgIcon = vue.resolveComponent("SvgIcon");
      const _component_sub_item = vue.resolveComponent("sub-item", true);
      const _component_el_sub_menu = vue.resolveComponent("el-sub-menu");
      const _component_el_menu_item = vue.resolveComponent("el-menu-item");
      return vue.openBlock(true), vue.createElementBlock(
        vue.Fragment,
        null,
        vue.renderList(chils.value, (val) => {
          return vue.openBlock(), vue.createElementBlock(
            vue.Fragment,
            null,
            [
              val.children && val.children.length > 0 ? (vue.openBlock(), vue.createBlock(_component_el_sub_menu, {
                index: val.path,
                key: val.path
              }, {
                title: vue.withCtx(() => [
                  vue.createVNode(_component_SvgIcon, {
                    name: val.meta.icon,
                    style: { "font-size": "16px" }
                  }, null, 8, ["name"]),
                  vue.createElementVNode(
                    "span",
                    null,
                    vue.toDisplayString(_ctx.$t(`message.menu.${val.meta.title}`)),
                    1
                    /* TEXT */
                  )
                ]),
                default: vue.withCtx(() => [
                  vue.createVNode(_component_sub_item, {
                    chil: val.children
                  }, null, 8, ["chil"])
                ]),
                _: 2
                /* DYNAMIC */
              }, 1032, ["index"])) : (vue.openBlock(), vue.createBlock(_component_el_menu_item, {
                index: val.path,
                key: val.path
              }, {
                default: vue.withCtx(() => [
                  !val.meta.isLink || val.meta.isLink && val.meta.isIframe ? (vue.openBlock(), vue.createElementBlock(
                    vue.Fragment,
                    { key: 0 },
                    [
                      vue.createVNode(_component_SvgIcon, {
                        name: val.meta.icon,
                        style: { "font-size": "16px" }
                      }, null, 8, ["name"]),
                      vue.createElementVNode(
                        "span",
                        null,
                        vue.toDisplayString(_ctx.$t(`message.menu.${val.meta.title}`)),
                        1
                        /* TEXT */
                      ),
                      val.meta.showTextBadge ? (vue.openBlock(), vue.createElementBlock(
                        "span",
                        _hoisted_1,
                        vue.toDisplayString(val.meta.showTextBadge),
                        1
                        /* TEXT */
                      )) : vue.createCommentVNode("v-if", true)
                    ],
                    64
                    /* STABLE_FRAGMENT */
                  )) : (vue.openBlock(), vue.createElementBlock("a", {
                    key: 1,
                    class: "w100",
                    onClick: vue.withModifiers(($event) => onALinkClick(val), ["prevent"])
                  }, [
                    vue.createVNode(_component_SvgIcon, {
                      name: val.meta.icon,
                      style: { "font-size": "16px" }
                    }, null, 8, ["name"]),
                    vue.createTextVNode(
                      " " + vue.toDisplayString(_ctx.$t(`message.menu.${val.meta.title}`)),
                      1
                      /* TEXT */
                    )
                  ], 8, _hoisted_2))
                ]),
                _: 2
                /* DYNAMIC */
              }, 1032, ["index"]))
            ],
            64
            /* STABLE_FRAGMENT */
          );
        }),
        256
        /* UNKEYED_FRAGMENT */
      );
    };
  }
});

exports.default = _sfc_main;
