import "../../../../../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import { useTargetData } from "../../../../../hooks/useTargetData.hook.mjs";
import { useDesignStore } from "../../../../../../../../../store/modules/designStore/designStore.mjs";
import "../../../../../../../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.mjs";
import "../../../../../../../../../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.mjs";
import "../../../../../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.mjs";
import "../../../../../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.mjs";
import "../../../../../../../../../../node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.mjs";
import "../../../../../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseClone.mjs";
import "../../../../../../../../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.mjs";
import "../../../../../../../../../enums/pageEnum.mjs";
import "../../../../../../../../../router/index.mjs";
import "../../../../../../../../../settings/designSetting.mjs";
import "../../../../../../../../../components/GoLoading/index.mjs";
import "../../../../../../../../../components/GoSkeleton/index.vue.mjs";
import { icon } from "../../../../../../../../../plugins/icon.mjs";
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode as createBaseVNode, createBlock, createTextVNode, createCommentVNode, Fragment, renderList, pushScopeId, popScopeId } from "../../../../../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { useCssVars } from "../../../../../../../../../../node_modules/.pnpm/@vue_runtime-dom@3.3.4/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.mjs";
import { toRefs, unref } from "../../../../../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
import { normalizeClass, toDisplayString } from "../../../../../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
const _withScopeId = (n) => (pushScopeId("data-v-43dfb7fe"), n = n(), popScopeId(), n);
const _hoisted_1 = { class: "go-chart-data-pond-list" };
const _hoisted_2 = { class: "pond-item-box" };
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("span", null, " 创建 ", -1));
const _hoisted_4 = ["onClick"];
const _hoisted_5 = { class: "item-content" };
const _hoisted_6 = { class: "item-content-body" };
const _hoisted_7 = ["onClick"];
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  emits: ["createPond", "deletePond"],
  setup(__props, { emit }) {
    useCssVars((_ctx) => ({
      "1013e1a5": themeColor.value
    }));
    const { DuplicateOutlineIcon, TrashIcon } = icon.ionicons5;
    const designStore = useDesignStore();
    const { chartEditStore, targetData } = useTargetData();
    const { requestDataPond } = toRefs(chartEditStore.getRequestGlobalConfig);
    const selectPondId = computed(() => {
      return targetData.value.request.requestDataPondId;
    });
    const themeColor = computed(() => {
      return designStore.getAppTheme;
    });
    const createPond = () => {
      emit("createPond", true);
    };
    const deletePond = (target, targetData2) => {
      target.stopPropagation();
      target.preventDefault();
      emit("deletePond", targetData2);
    };
    const clickHandle = (item) => {
      targetData.value.request.requestDataPondId = item.dataPondId;
    };
    return (_ctx, _cache) => {
      const _component_n_timeline_item = resolveComponent("n-timeline-item");
      const _component_n_timeline = resolveComponent("n-timeline");
      const _component_n_icon = resolveComponent("n-icon");
      const _component_n_button = resolveComponent("n-button");
      const _component_n_divider = resolveComponent("n-divider");
      const _component_n_a = resolveComponent("n-a");
      const _component_n_text = resolveComponent("n-text");
      const _component_n_space = resolveComponent("n-space");
      const _component_n_tag = resolveComponent("n-tag");
      const _component_n_ellipsis = resolveComponent("n-ellipsis");
      const _component_n_scrollbar = resolveComponent("n-scrollbar");
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createVNode(_component_n_timeline, {
          class: "pond-item-timeline",
          style: { "width": "20px" }
        }, {
          default: withCtx(() => [
            createVNode(_component_n_timeline_item, { type: "info" }),
            createVNode(_component_n_timeline_item, { type: "success" })
          ]),
          _: 1
        }),
        createBaseVNode("div", _hoisted_2, [
          createVNode(_component_n_button, {
            class: "create-btn go-py-4",
            ghost: "",
            onClick: createPond
          }, {
            icon: withCtx(() => [
              createVNode(_component_n_icon, null, {
                default: withCtx(() => [
                  createVNode(unref(DuplicateOutlineIcon))
                ]),
                _: 1
              })
            ]),
            default: withCtx(() => [
              _hoisted_3
            ]),
            _: 1
          }),
          createVNode(_component_n_divider, { style: { "margin": "10px 0" } }),
          !unref(requestDataPond).length ? (openBlock(), createBlock(_component_n_space, {
            key: 0,
            justify: "center"
          }, {
            default: withCtx(() => [
              createVNode(_component_n_text, {
                class: "not-layer-text",
                depth: 3
              }, {
                default: withCtx(() => [
                  createTextVNode(" 暂无数据内容， "),
                  createVNode(_component_n_a, { onClick: createPond }, {
                    default: withCtx(() => [
                      createTextVNode("立即创建")
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })
            ]),
            _: 1
          })) : createCommentVNode("", true),
          createVNode(_component_n_scrollbar, { style: { "max-height": "490px" } }, {
            default: withCtx(() => [
              (openBlock(true), createElementBlock(Fragment, null, renderList(unref(requestDataPond), (item) => {
                return openBlock(), createElementBlock("div", {
                  key: item.dataPondId,
                  class: normalizeClass([{ select: item.dataPondId === selectPondId.value }, "pond-item"]),
                  onClick: ($event) => clickHandle(item)
                }, [
                  createBaseVNode("div", _hoisted_5, [
                    createBaseVNode("div", _hoisted_6, [
                      createBaseVNode("div", null, [
                        createVNode(_component_n_tag, {
                          class: "go-mr-1",
                          type: item.dataPondId === selectPondId.value ? "warning" : "",
                          bordered: false
                        }, {
                          default: withCtx(() => [
                            createTextVNode(" 名称 ")
                          ]),
                          _: 2
                        }, 1032, ["type"]),
                        createVNode(_component_n_ellipsis, { style: { "max-width": "180px" } }, {
                          default: withCtx(() => [
                            createTextVNode(toDisplayString(item.dataPondName || "暂无"), 1)
                          ]),
                          _: 2
                        }, 1024)
                      ]),
                      createBaseVNode("div", null, [
                        createVNode(_component_n_tag, {
                          class: "go-mr-1",
                          type: item.dataPondId === selectPondId.value ? "warning" : "",
                          bordered: false
                        }, {
                          default: withCtx(() => [
                            createTextVNode(" 地址 ")
                          ]),
                          _: 2
                        }, 1032, ["type"]),
                        createVNode(_component_n_ellipsis, { style: { "max-width": "180px" } }, {
                          default: withCtx(() => [
                            createTextVNode(toDisplayString(item.dataPondRequestConfig.requestUrl || "暂无"), 1)
                          ]),
                          _: 2
                        }, 1024)
                      ])
                    ]),
                    createBaseVNode("div", {
                      class: "item-content-icon go-transition-quick",
                      onClick: ($event) => deletePond($event, item)
                    }, [
                      createVNode(_component_n_icon, null, {
                        default: withCtx(() => [
                          createVNode(unref(TrashIcon))
                        ]),
                        _: 1
                      })
                    ], 8, _hoisted_7)
                  ]),
                  createBaseVNode("div", {
                    class: normalizeClass({ "select-modal": item.dataPondId === selectPondId.value })
                  }, null, 2)
                ], 10, _hoisted_4);
              }), 128))
            ]),
            _: 1
          })
        ])
      ]);
    };
  }
});
export {
  _sfc_main as default
};
