import "../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import SettingItem from "../../../../../components/Pages/ChartItemSetting/SettingItem.vue2.mjs";
import SettingItemBox from "../../../../../components/Pages/ChartItemSetting/SettingItemBox.vue.mjs";
import _sfc_main$1 from "../../../../../components/Pages/ChartItemSetting/CollapseItem.vue.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 "../../../../../store/modules/designStore/designStore.mjs";
import "../../../../../settings/designSetting.mjs";
import "../../../../../components/GoLoading/index.mjs";
import "../../../../../components/GoSkeleton/index.vue.mjs";
import "../../../../../store/modules/chartEditStore/chartEditStore.mjs";
import "../../../../../components/Pages/ChartItemSetting/StylesSetting.vue.mjs";
import { defineComponent, watch, resolveComponent, openBlock, createBlock, withCtx, createVNode, createTextVNode, createElementVNode as createBaseVNode } from "../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { ref, unref } from "../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
const _hoisted_1 = { style: { "width": "260px" } };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "config",
  props: {
    optionData: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const page = [
      { label: "2", value: 2 },
      { label: "5", value: 5 },
      { label: "10", value: 10 },
      { label: "15", value: 15 },
      { label: "30", value: 30 }
    ];
    const borderFlag = [
      { label: "显示", value: "on" },
      { label: "不显示", value: "off" }
    ];
    const columnFlag = [
      { label: "显示", value: "off" },
      { label: "不显示", value: "on" }
    ];
    const lineFlag = [
      { label: "显示", value: "off" },
      { label: "不显示", value: "on" }
    ];
    const bottom_borderedFlag = [
      { label: "显示", value: "on" },
      { label: "不显示", value: "off" }
    ];
    const stripedFlag = [
      { label: "显示", value: "on" },
      { label: "不显示", value: "off" }
    ];
    const borderStyleFlag = [
      { label: "实线边框", value: "solid" },
      { label: "虚线边框", value: "dashed" },
      { label: "点状边框", value: "dotted" },
      { label: "双线边框", value: "double" }
    ];
    const inputSelect = [
      { label: "停用", value: "none" },
      { label: "启用", value: "flex" }
    ];
    const header = ref();
    const median = ref([]);
    props.optionData.dataset.dimensions.forEach((item) => {
      median.value.push(item.title);
    });
    watch(
      () => props.optionData,
      () => {
        median.value = [];
        props.optionData.dataset.dimensions.forEach((item) => {
          median.value.push(item.title);
        });
        header.value = median.value.toString();
      },
      {
        deep: false,
        immediate: true
      }
    );
    watch([header], ([headerNew], [headerOld]) => {
      if (headerNew !== headerOld) {
        headerNew.split(",").forEach((item, index) => {
          if (index + 1 <= props.optionData.dataset.dimensions.length) {
            props.optionData.dataset.dimensions[index].title = headerNew.split(",")[index];
          }
        });
      }
    });
    return (_ctx, _cache) => {
      const _component_n_tag = resolveComponent("n-tag");
      const _component_n_select = resolveComponent("n-select");
      const _component_n_input_number = resolveComponent("n-input-number");
      const _component_n_input = resolveComponent("n-input");
      const _component_n_color_picker = resolveComponent("n-color-picker");
      return openBlock(), createBlock(unref(_sfc_main$1), {
        name: "表格设置",
        expanded: true
      }, {
        default: withCtx(() => [
          createVNode(_component_n_tag, { type: "primary" }, {
            default: withCtx(() => [
              createTextVNode("若配置无响应，请在预览页面查看效果")
            ]),
            _: 1
          }),
          createVNode(unref(SettingItemBox), {
            alone: true,
            name: "对齐方式"
          }, {
            default: withCtx(() => [
              createVNode(unref(SettingItem), { alone: true }, {
                default: withCtx(() => [
                  createVNode(_component_n_select, {
                    value: __props.optionData.align,
                    "onUpdate:value": _cache[0] || (_cache[0] = ($event) => __props.optionData.align = $event),
                    size: "small",
                    options: [
                      { label: "靠左", value: "left" },
                      { label: "居中", value: "center" },
                      { label: "靠右", value: "right" }
                    ]
                  }, null, 8, ["value"])
                ]),
                _: 1
              })
            ]),
            _: 1
          }),
          createVNode(unref(SettingItemBox), {
            alone: false,
            name: "分页设置"
          }, {
            default: withCtx(() => [
              createVNode(unref(SettingItem), {
                name: "默认页码",
                alone: true
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_input_number, {
                    value: __props.optionData.pagination.page,
                    "onUpdate:value": _cache[1] || (_cache[1] = ($event) => __props.optionData.pagination.page = $event),
                    size: "small",
                    placeholder: "字体大小"
                  }, null, 8, ["value"])
                ]),
                _: 1
              }),
              createVNode(unref(SettingItem), {
                name: "分页",
                alone: true
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_select, {
                    value: __props.optionData.pagination.pageSize,
                    "onUpdate:value": _cache[2] || (_cache[2] = ($event) => __props.optionData.pagination.pageSize = $event),
                    size: "small",
                    options: page
                  }, null, 8, ["value"])
                ]),
                _: 1
              })
            ]),
            _: 1
          }),
          createVNode(unref(SettingItemBox), {
            alone: false,
            name: "表格数据"
          }, {
            default: withCtx(() => [
              createVNode(unref(SettingItem), {
                name: "表头名称",
                class: "form_name"
              }, {
                default: withCtx(() => [
                  createBaseVNode("div", _hoisted_1, [
                    createVNode(_component_n_input, {
                      value: header.value,
                      "onUpdate:value": _cache[3] || (_cache[3] = ($event) => header.value = $event),
                      size: "small",
                      placeholder: "表头数据(英文','分割)"
                    }, null, 8, ["value"])
                  ])
                ]),
                _: 1
              })
            ]),
            _: 1
          }),
          createVNode(unref(SettingItemBox), {
            alone: false,
            name: "表格样式"
          }, {
            default: withCtx(() => [
              createVNode(unref(SettingItem), {
                name: "显示边框",
                alone: true
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_select, {
                    value: __props.optionData.style.border,
                    "onUpdate:value": _cache[4] || (_cache[4] = ($event) => __props.optionData.style.border = $event),
                    size: "small",
                    options: borderFlag
                  }, null, 8, ["value"])
                ]),
                _: 1
              }),
              createVNode(unref(SettingItem), {
                name: "底部边框",
                alone: true
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_select, {
                    value: __props.optionData.style.bottomBordered,
                    "onUpdate:value": _cache[5] || (_cache[5] = ($event) => __props.optionData.style.bottomBordered = $event),
                    size: "small",
                    options: bottom_borderedFlag
                  }, null, 8, ["value"])
                ]),
                _: 1
              }),
              createVNode(unref(SettingItem), {
                name: "列分割线",
                alone: true
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_select, {
                    value: __props.optionData.style.singleLine,
                    "onUpdate:value": _cache[6] || (_cache[6] = ($event) => __props.optionData.style.singleLine = $event),
                    size: "small",
                    options: columnFlag
                  }, null, 8, ["value"])
                ]),
                _: 1
              }),
              createVNode(unref(SettingItem), {
                name: "行分割线",
                alone: true
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_select, {
                    value: __props.optionData.style.singleColumn,
                    "onUpdate:value": _cache[7] || (_cache[7] = ($event) => __props.optionData.style.singleColumn = $event),
                    size: "small",
                    options: lineFlag
                  }, null, 8, ["value"])
                ]),
                _: 1
              }),
              createVNode(unref(SettingItem), {
                name: "斑马条纹",
                alone: true
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_select, {
                    value: __props.optionData.style.striped,
                    "onUpdate:value": _cache[8] || (_cache[8] = ($event) => __props.optionData.style.striped = $event),
                    size: "small",
                    options: stripedFlag
                  }, null, 8, ["value"])
                ]),
                _: 1
              }),
              createVNode(unref(SettingItem), {
                name: "字体大小",
                alone: true
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_input_number, {
                    value: __props.optionData.style.fontSize,
                    "onUpdate:value": _cache[9] || (_cache[9] = ($event) => __props.optionData.style.fontSize = $event),
                    min: 12,
                    size: "small",
                    placeholder: "字体大小"
                  }, null, 8, ["value"])
                ]),
                _: 1
              }),
              createVNode(unref(SettingItem), {
                name: "边框宽度",
                alone: true
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_input_number, {
                    value: __props.optionData.style.borderWidth,
                    "onUpdate:value": _cache[10] || (_cache[10] = ($event) => __props.optionData.style.borderWidth = $event),
                    min: 0,
                    size: "small",
                    placeholder: "字体大小"
                  }, null, 8, ["value"])
                ]),
                _: 1
              }),
              createVNode(unref(SettingItem), {
                name: "边框颜色",
                alone: true
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_color_picker, {
                    size: "small",
                    modes: ["rgb"],
                    value: __props.optionData.style.borderColor,
                    "onUpdate:value": _cache[11] || (_cache[11] = ($event) => __props.optionData.style.borderColor = $event)
                  }, null, 8, ["value"])
                ]),
                _: 1
              }),
              createVNode(unref(SettingItem), {
                name: "边框样式",
                alone: true
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_select, {
                    value: __props.optionData.style.borderStyle,
                    "onUpdate:value": _cache[12] || (_cache[12] = ($event) => __props.optionData.style.borderStyle = $event),
                    size: "small",
                    options: borderStyleFlag
                  }, null, 8, ["value"])
                ]),
                _: 1
              }),
              createVNode(unref(SettingItem), {
                name: "表格搜索（前端静态搜索）",
                alone: true
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_select, {
                    value: __props.optionData.inputShow,
                    "onUpdate:value": _cache[13] || (_cache[13] = ($event) => __props.optionData.inputShow = $event),
                    size: "small",
                    options: inputSelect
                  }, null, 8, ["value"])
                ]),
                _: 1
              })
            ]),
            _: 1
          })
        ]),
        _: 1
      });
    };
  }
});
export {
  _sfc_main as default
};
