'use strict';

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

var vue = require('vue');
var index = require('../../svg-icon/index.js');
var elementPlus = require('element-plus');

"use strict";
const _hoisted_1 = { class: "tree-menu-node" };
const _hoisted_2 = { key: 1 };
var script = /* @__PURE__ */ vue.defineComponent({
  __name: "tree-menu-node",
  props: {
    actions: { type: null, required: true },
    node: { type: null, required: true },
    data: { type: null, required: true }
  },
  setup(__props) {
    const props = __props;
    const showTag = (item) => {
      if (item.status == false) {
        return false;
      }
      const isMeta = item.key.indexOf("meta.") !== -1;
      if (isMeta) {
        const key = item.key.split(".")[1];
        return props.data.meta[key] === item.value;
      }
      return props.data[item.key] === item.value;
    };
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
        vue.createElementVNode(
          "span",
          null,
          vue.toDisplayString(props.node.label),
          1
          /* TEXT */
        ),
        (vue.openBlock(true), vue.createElementBlock(
          vue.Fragment,
          null,
          vue.renderList(__props.actions, (item, index$1) => {
            return vue.openBlock(), vue.createElementBlock(
              vue.Fragment,
              {
                key: item.key
              },
              [
                showTag(item) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElTag), {
                  key: 0,
                  round: "",
                  size: "small",
                  style: { "margin-left": "10px" },
                  type: item.type
                }, {
                  default: vue.withCtx(() => [
                    item.tagIcon ? (vue.openBlock(), vue.createBlock(vue.unref(index.MeSvgIcon), {
                      key: 0,
                      name: item.tagIcon
                    }, null, 8, ["name"])) : (vue.openBlock(), vue.createElementBlock(
                      "div",
                      _hoisted_2,
                      vue.toDisplayString(item.tagLabel),
                      1
                      /* TEXT */
                    ))
                  ]),
                  _: 2
                  /* DYNAMIC */
                }, 1032, ["type"])) : vue.createCommentVNode("v-if", true)
              ],
              64
              /* STABLE_FRAGMENT */
            );
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ]);
    };
  }
});

exports.default = script;
//# sourceMappingURL=tree-menu-node.vue2.js.map
