"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
require("../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.js");
require("../../../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.js");
require("../../../../../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js");
require("../../../../../../node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseClone.js");
require("../../../../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.js");
require("../../../../../enums/pageEnum.js");
require("../../../../../router/index.js");
require("../../../../../store/modules/designStore/designStore.js");
require("../../../../../settings/designSetting.js");
require("../../../../../components/GoLoading/index.js");
require("../../../../../components/GoSkeleton/index.vue.js");
const icon = require("../../../../../plugins/icon.js");
const runtimeCore_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js");
const reactivity_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js");
const shared_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.js");
const _hoisted_1 = { class: "go-tables-basic" };
const _sfc_main = /* @__PURE__ */ runtimeCore_esmBundler.defineComponent({
  __name: "index",
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const { SearchIcon } = icon.icon.ionicons5;
    const inputData = reactivity_esmBundler.ref("");
    const filterData = runtimeCore_esmBundler.computed(() => {
      var _a, _b;
      return (_b = (_a = option == null ? void 0 : option.dataset) == null ? void 0 : _a.source) == null ? void 0 : _b.filter((item) => {
        return Object.values(item).some((val) => {
          return String(val).toLowerCase().includes(inputData.value.toLowerCase());
        });
      });
    });
    const { align, pagination, inputShow } = reactivity_esmBundler.toRefs(props.chartConfig.option);
    pagination.value.onChange = (page) => {
      pagination.value.page = page;
    };
    const { w, h } = reactivity_esmBundler.toRefs(props.chartConfig.attr);
    const option = reactivity_esmBundler.reactive({
      dataset: props.chartConfig.option.dataset,
      style: props.chartConfig.option.style
    });
    runtimeCore_esmBundler.watch(
      () => props.chartConfig.option.dataset,
      (newData) => {
        var _a, _b;
        option.dataset = newData;
        (_b = (_a = option == null ? void 0 : option.dataset) == null ? void 0 : _a.dimensions) == null ? void 0 : _b.forEach((header) => {
          header.align = align.value;
        });
      },
      {
        immediate: true,
        deep: true
      }
    );
    return (_ctx, _cache) => {
      const _component_n_icon = runtimeCore_esmBundler.resolveComponent("n-icon");
      const _component_n_input = runtimeCore_esmBundler.resolveComponent("n-input");
      const _component_n_data_table = runtimeCore_esmBundler.resolveComponent("n-data-table");
      return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock("div", _hoisted_1, [
        runtimeCore_esmBundler.createVNode(_component_n_input, {
          value: inputData.value,
          "onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputData.value = $event),
          placeholder: "请输入信息",
          style: shared_esmBundler.normalizeStyle([`display: ${reactivity_esmBundler.unref(inputShow)}`, { "margin-bottom": "5px", "float": "right", "width": "240px" }])
        }, {
          prefix: runtimeCore_esmBundler.withCtx(() => [
            runtimeCore_esmBundler.createVNode(_component_n_icon, { component: reactivity_esmBundler.unref(SearchIcon) }, null, 8, ["component"])
          ]),
          _: 1
        }, 8, ["value", "style"]),
        runtimeCore_esmBundler.createVNode(_component_n_data_table, {
          style: shared_esmBundler.normalizeStyle(`
      width: ${reactivity_esmBundler.unref(w)}px;
      height: ${reactivity_esmBundler.unref(h)}px;
      font-size: ${option.style.fontSize}px;
      border-width: ${option.style.border === "on" ? option.style.borderWidth : 0}px;
      border-color: ${option.style.borderColor};
      border-style: ${option.style.borderStyle}`),
          bordered: option.style.border === "on",
          "single-column": option.style.singleColumn === "on",
          "single-line": option.style.singleLine === "on",
          "bottom-bordered": option.style.bottomBordered === "on",
          striped: option.style.striped === "on",
          "max-height": reactivity_esmBundler.unref(h),
          size: "small",
          columns: option.dataset.dimensions,
          data: filterData.value,
          pagination: reactivity_esmBundler.unref(pagination)
        }, null, 8, ["style", "bordered", "single-column", "single-line", "bottom-bordered", "striped", "max-height", "columns", "data", "pagination"])
      ]);
    };
  }
});
exports.default = _sfc_main;
