import { defineComponent, getCurrentInstance, ref, toRefs, onMounted, onUnmounted, openBlock, createElementBlock, Fragment, renderList, unref, withModifiers, createElementVNode, toDisplayString, normalizeClass, createCommentVNode, createTextVNode, pushScopeId, popScopeId } from "vue";
import _imports_0 from "./images/left.mjs";
import _imports_1 from "./images/middle.mjs";
import "./index.vue_vue_type_style_index_0_scoped_true_lang.mjs";
import _export_sfc from "../../../../_virtual/plugin-vue_export-helper.mjs";
const _withScopeId = (n) => (pushScopeId("data-v-09ecf365"), n = n(), popScopeId(), n);
const _hoisted_1 = { class: "footer02" };
const _hoisted_2 = ["onClick"];
const _hoisted_3 = { class: "header" };
const _hoisted_4 = { class: "checkBoxList" };
const _hoisted_5 = ["onClick"];
const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("img", {
  src: _imports_0,
  class: "icon"
}, null, -1));
const _hoisted_7 = {
  key: 1,
  class: "arrow"
};
const _hoisted_8 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("img", {
  src: _imports_1,
  class: "middlePng"
}, null, -1));
const _hoisted_9 = ["onClick"];
const _hoisted_10 = { class: "header" };
const _hoisted_11 = { class: "checkBoxList" };
const _hoisted_12 = ["onClick"];
const _hoisted_13 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("img", {
  src: _imports_0,
  class: "icon"
}, null, -1));
const _hoisted_14 = {
  key: 1,
  class: "arrow"
};
const __default__ = defineComponent({ name: "EFooter02" });
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    chartConfig: {
      type: Object,
      required: true,
      default: () => {
        return {
          option: {
            dataset: {
              list: [
                {
                  key: "\u6210\u90FD\u5E02",
                  showModel: false,
                  children: [
                    {
                      key: "\u6210\u534E\u533A",
                      checked: false
                    },
                    {
                      key: "\u9AD8\u65B0\u533A",
                      checked: false
                    }
                  ]
                },
                {
                  key: "\u8FD0\u8F93\u4F01\u4E1A"
                },
                {
                  key: "\u65BD\u5DE5\u573A\u5730",
                  children: [
                    {
                      key: "\u623F\u5EFA\u5DE5\u7A0B",
                      checked: false
                    },
                    {
                      key: "\u5E02\u653F\u5DE5\u7A0B",
                      checked: false
                    },
                    {
                      key: "\u96F6\u661F\u5DE5\u7A0B",
                      checked: false
                    },
                    {
                      key: "\u5176\u4ED6\u5DE5\u7A0B",
                      checked: false
                    }
                  ]
                },
                {
                  key: "\u6D88\u7EB3\u573A",
                  children: [
                    {
                      key: "\u7EFC\u5408\u6D88\u7EB3\u573A",
                      checked: false
                    },
                    {
                      key: "\u56FA\u5B9A\u6D88\u7EB3\u573A",
                      checked: false
                    },
                    {
                      key: "\u4E34\u65F6\u6D88\u7EB3\u573A\uFF08\u5806\u5761\uFF09",
                      checked: false
                    },
                    {
                      key: "\u4E34\u65F6\u6D88\u7EB3\u573A\uFF08\u56DE\u586B\uFF09",
                      checked: false
                    },
                    {
                      key: "\u5176\u4ED6",
                      checked: false
                    }
                  ]
                },
                {
                  key: "\u8F66\u8F86\u4F4D\u7F6E"
                },
                {
                  key: "\u9884\u8B66\u4F4D\u7F6E "
                }
              ]
            }
          }
        };
      }
    }
  },
  setup(__props) {
    const props = __props;
    const internalInstance = getCurrentInstance();
    const ShowModelIndex = ref(-1);
    const openModel = (item, index) => {
      if (ShowModelIndex.value == index) {
        ShowModelIndex.value = -1;
        return;
      }
      if (item.children)
        ShowModelIndex.value = index;
    };
    const chooseChecked = (jtem) => {
      jtem.checked = !jtem.checked;
      internalInstance.ctx.$forceUpdate();
    };
    const { dataset } = toRefs(props.chartConfig.option);
    const { list } = toRefs(dataset.value);
    onMounted(() => {
      document.addEventListener("click", () => {
        ShowModelIndex.value = -1;
      });
    });
    onUnmounted(() => {
      document.removeEventListener("click", () => {
        ShowModelIndex.value = -1;
      });
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        (openBlock(true), createElementBlock(Fragment, null, renderList(unref(list), (item, index) => {
          return openBlock(), createElementBlock(Fragment, { key: index }, [
            index < 3 ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: "leftBox",
              onClick: withModifiers(($event) => openModel(item, index), ["stop"])
            }, [
              ShowModelIndex.value == index ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: "modelBox",
                onClick: _cache[0] || (_cache[0] = withModifiers(() => {
                }, ["stop"]))
              }, [
                createElementVNode("div", _hoisted_3, toDisplayString(item.key), 1),
                createElementVNode("div", _hoisted_4, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(item.children, (jtem, jndex) => {
                    return openBlock(), createElementBlock("div", {
                      key: jndex,
                      onClick: withModifiers(($event) => chooseChecked(jtem), ["stop"])
                    }, [
                      createElementVNode("div", {
                        class: normalizeClass(["check", {
                          checked: jtem.checked
                        }])
                      }, null, 2),
                      _hoisted_6,
                      createElementVNode("div", null, toDisplayString(jtem.key), 1)
                    ], 8, _hoisted_5);
                  }), 128))
                ])
              ])) : createCommentVNode("", true),
              createTextVNode(" " + toDisplayString(item.key) + " ", 1),
              item.children ? (openBlock(), createElementBlock("div", _hoisted_7)) : createCommentVNode("", true)
            ], 8, _hoisted_2)) : createCommentVNode("", true)
          ], 64);
        }), 128)),
        _hoisted_8,
        (openBlock(true), createElementBlock(Fragment, null, renderList(unref(list), (item, index) => {
          return openBlock(), createElementBlock(Fragment, { key: index }, [
            index >= 3 ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: "rightBox",
              onClick: withModifiers(($event) => openModel(item, index), ["stop"])
            }, [
              ShowModelIndex.value == index ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: "modelBox",
                onClick: _cache[1] || (_cache[1] = withModifiers(() => {
                }, ["stop"]))
              }, [
                createElementVNode("div", _hoisted_10, toDisplayString(item.key), 1),
                createElementVNode("div", _hoisted_11, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(item.children, (jtem, jndex) => {
                    return openBlock(), createElementBlock("div", {
                      key: jndex,
                      onClick: withModifiers(($event) => chooseChecked(jtem), ["stop"])
                    }, [
                      createElementVNode("div", {
                        class: normalizeClass(["check", {
                          checked: jtem.checked
                        }])
                      }, null, 2),
                      _hoisted_13,
                      createElementVNode("div", null, toDisplayString(jtem.key), 1)
                    ], 8, _hoisted_12);
                  }), 128))
                ])
              ])) : createCommentVNode("", true),
              createTextVNode(" " + toDisplayString(item.key) + " ", 1),
              item.children ? (openBlock(), createElementBlock("div", _hoisted_14)) : createCommentVNode("", true)
            ], 8, _hoisted_9)) : createCommentVNode("", true)
          ], 64);
        }), 128))
      ]);
    };
  }
});
var _EFooter02 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-09ecf365"]]);
export { _EFooter02 as default };
