"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
require("../../../../../node_modules/element-plus/es/index.js");
;/* empty css                                                             */
;/* empty css                                                                    */
;/* empty css                                                                         */
;/* empty css                                                                */
;/* empty css                                                                  */
;/* empty css                                                                 */
;/* empty css                                                                       */
;/* empty css                                                                        */
;/* empty css                                                                 */
;/* empty css                                                                        */
;/* empty css                                                                    */
;/* empty css                                                                     */
;/* empty css                                                                     */
;/* empty css                                                                  */
;/* empty css                                                               */
;/* empty css                                                                  */
;/* empty css                                                                        */
;/* empty css                                                                  */
const Vue = require("vue");
const common = require("../../utils/common.js");
const OptionConfig = require("../../../components/OptionConfig.vue.js");
const index = require("../aside/index.js");
const EventConfigButton = require("../../../components/EventConfigButton.vue.js");
;/* empty css              */
const _pluginVue_exportHelper = require("../../../../../_virtual/_plugin-vue_export-helper.js");
const index$1 = require("../../../../../node_modules/element-plus/es/components/collapse/index.js");
const index$2 = require("../../../../../node_modules/element-plus/es/components/select/index.js");
const index$3 = require("../../../../../node_modules/element-plus/es/components/form/index.js");
const index$4 = require("../../../../../node_modules/element-plus/es/components/input/index.js");
const index$5 = require("../../../../../node_modules/element-plus/es/components/checkbox/index.js");
const index$6 = require("../../../../../node_modules/element-plus/es/components/input-number/index.js");
const index$7 = require("../../../../../node_modules/element-plus/es/components/radio/index.js");
const index$8 = require("../../../../../node_modules/element-plus/es/components/switch/index.js");
const _sfc_main = {
  __name: "widgets",
  props: {
    column: {
      type: Object
    },
    isComp: {
      type: Boolean,
      default: false
    }
  },
  setup(__props) {
    const props = __props;
    const currentItem = Vue.computed(() => {
      return props.column || common.getCurrentItem();
    });
    const activeName = Vue.ref(["common"]);
    const fieldTypes = Vue.computed(() => {
      var _a;
      const basicComponents = index.default.find((c) => c.name === "basic");
      return ((_a = basicComponents == null ? void 0 : basicComponents.children) == null ? void 0 : _a.filter((c) => c.isShow)) || [];
    });
    function handleFieldTypeChange(fieldType) {
      currentItem.value;
    }
    function handleFormatChange(value) {
      currentItem.value.align = "center";
      switch (value) {
        case "percentage":
          currentItem.value.suffix = "%";
          break;
        case "permillage":
          currentItem.value.suffix = "‰";
          break;
        case "permillion":
          currentItem.value.suffix = "‱";
          break;
        case "yuan":
        case "wan":
        case "million":
          currentItem.value.suffix = "";
          currentItem.value.align = "right";
          break;
        default:
          currentItem.value.suffix = "";
          break;
      }
    }
    return (_ctx, _cache) => {
      const _component_el_option = index$2.ElOption;
      const _component_el_select = index$2.ElSelect;
      const _component_el_input = index$4.ElInput;
      const _component_el_form_item = index$3.ElFormItem;
      const _component_el_checkbox = index$5.ElCheckbox;
      const _component_el_input_number = index$6.ElInputNumber;
      const _component_el_radio_button = index$7.ElRadioButton;
      const _component_el_radio_group = index$7.ElRadioGroup;
      const _component_el_switch = index$8.ElSwitch;
      const _component_el_form = index$3.ElForm;
      const _component_el_collapse_item = index$1.ElCollapseItem;
      const _component_el_collapse = index$1.ElCollapse;
      return Vue.openBlock(), Vue.createBlock(_component_el_collapse, {
        class: "setting",
        modelValue: Vue.unref(activeName),
        "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => Vue.isRef(activeName) ? activeName.value = $event : null)
      }, {
        default: Vue.withCtx(() => [
          Vue.createVNode(_component_el_collapse_item, {
            name: "common",
            title: "基本属性"
          }, {
            default: Vue.withCtx(() => [
              Vue.createVNode(_component_el_select, {
                teleported: false,
                modelValue: Vue.unref(currentItem).fieldType,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => Vue.unref(currentItem).fieldType = $event),
                size: "small",
                class: "field-type-select",
                onChange: handleFieldTypeChange,
                placement: "bottom-end",
                style: Vue.normalizeStyle(__props.isComp ? { top: 0 } : {})
              }, {
                default: Vue.withCtx(() => [
                  (Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(Vue.unref(fieldTypes), (type) => {
                    return Vue.openBlock(), Vue.createBlock(_component_el_option, {
                      key: type.fieldType,
                      label: type.label,
                      value: type.fieldType
                    }, null, 8, ["label", "value"]);
                  }), 128))
                ]),
                _: 1
              }, 8, ["modelValue", "style"]),
              (Vue.openBlock(), Vue.createBlock(_component_el_form, {
                "label-position": "top",
                "label-width": "auto",
                model: Vue.unref(currentItem),
                key: Vue.unref(currentItem).id
              }, {
                default: Vue.withCtx(() => [
                  Vue.createVNode(_component_el_form_item, {
                    label: "标题",
                    required: ""
                  }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_input, {
                        modelValue: Vue.unref(currentItem).label,
                        "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => Vue.unref(currentItem).label = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.createVNode(_component_el_form_item, { label: "字段名称" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_input, {
                        modelValue: Vue.unref(currentItem).fieldName,
                        "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => Vue.unref(currentItem).fieldName = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.unref(currentItem).fieldType === "number" ? (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, { key: 0 }, [
                    Vue.createVNode(_component_el_form_item, { label: "格式" }, {
                      default: Vue.withCtx(() => [
                        Vue.createVNode(_component_el_select, {
                          modelValue: Vue.unref(currentItem).format,
                          "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => Vue.unref(currentItem).format = $event),
                          teleported: false,
                          onChange: handleFormatChange
                        }, {
                          default: Vue.withCtx(() => [
                            Vue.createVNode(_component_el_option, {
                              label: "数值",
                              value: "number"
                            }),
                            Vue.createVNode(_component_el_option, {
                              label: "金额(元)",
                              value: "yuan"
                            }),
                            Vue.createVNode(_component_el_option, {
                              label: "金额(万元)",
                              value: "wan"
                            }),
                            Vue.createVNode(_component_el_option, {
                              label: "金额(百万元)",
                              value: "million"
                            }),
                            Vue.createVNode(_component_el_option, {
                              label: "百分比",
                              value: "percentage"
                            }),
                            Vue.createVNode(_component_el_option, {
                              label: "千分比",
                              value: "permillage"
                            }),
                            Vue.createVNode(_component_el_option, {
                              label: "万分比",
                              value: "permillion"
                            })
                          ]),
                          _: 1
                        }, 8, ["modelValue"])
                      ]),
                      _: 1
                    }),
                    Vue.createVNode(_component_el_form_item, null, {
                      default: Vue.withCtx(() => [
                        Vue.createVNode(_component_el_checkbox, {
                          modelValue: Vue.unref(currentItem).hasDecimalPlaces,
                          "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => Vue.unref(currentItem).hasDecimalPlaces = $event),
                          label: "保留小数位数"
                        }, null, 8, ["modelValue"]),
                        Vue.unref(currentItem).hasDecimalPlaces ? (Vue.openBlock(), Vue.createBlock(_component_el_input_number, {
                          key: 0,
                          style: { "margin-left": "10px", "width": "80px" },
                          modelValue: Vue.unref(currentItem).decimalPlaces,
                          "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => Vue.unref(currentItem).decimalPlaces = $event),
                          min: 0,
                          max: 10,
                          "controls-position": "right",
                          size: "small"
                        }, null, 8, ["modelValue"])) : Vue.createCommentVNode("", true)
                      ]),
                      _: 1
                    })
                  ], 64)) : Vue.createCommentVNode("", true),
                  Vue.unref(currentItem).fieldType === "select" || Vue.unref(currentItem).fieldType === "multipleSelection" ? (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, { key: 1 }, [
                    Vue.createVNode(OptionConfig.default, {
                      modelValue: Vue.unref(currentItem).optionConfig,
                      "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => Vue.unref(currentItem).optionConfig = $event)
                    }, null, 8, ["modelValue"]),
                    Vue.createVNode(_component_el_form_item, { label: "标签效果" }, {
                      default: Vue.withCtx(() => [
                        Vue.createVNode(_component_el_select, {
                          modelValue: Vue.unref(currentItem).optionStyle,
                          "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => Vue.unref(currentItem).optionStyle = $event),
                          teleported: false
                        }, {
                          default: Vue.withCtx(() => [
                            Vue.createVNode(_component_el_option, {
                              label: "默认",
                              value: "default"
                            })
                          ]),
                          _: 1
                        }, 8, ["modelValue"])
                      ]),
                      _: 1
                    })
                  ], 64)) : Vue.createCommentVNode("", true),
                  Vue.unref(currentItem).fieldType === "date" ? (Vue.openBlock(), Vue.createBlock(_component_el_form_item, {
                    key: 2,
                    label: "类型"
                  }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_select, {
                        modelValue: Vue.unref(currentItem).dateType,
                        "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => Vue.unref(currentItem).dateType = $event),
                        teleported: false
                      }, {
                        default: Vue.withCtx(() => [
                          Vue.createVNode(_component_el_option, {
                            label: "年-月-日",
                            value: "date"
                          }),
                          Vue.createVNode(_component_el_option, {
                            label: "年-周",
                            value: "week"
                          }),
                          Vue.createVNode(_component_el_option, {
                            label: "年-月",
                            value: "month"
                          }),
                          Vue.createVNode(_component_el_option, {
                            label: "年",
                            value: "year"
                          }),
                          Vue.createVNode(_component_el_option, {
                            label: "年-月-日 时:分",
                            value: "datetime-minute"
                          }),
                          Vue.createVNode(_component_el_option, {
                            label: "年-月-日 时:分:秒",
                            value: "datetime"
                          }),
                          Vue.createVNode(_component_el_option, {
                            label: "多日期",
                            value: "dates"
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  })) : Vue.createCommentVNode("", true),
                  Vue.createVNode(_component_el_form_item, { label: "宽度模式" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_radio_group, {
                        modelValue: Vue.unref(currentItem).widthMode,
                        "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => Vue.unref(currentItem).widthMode = $event),
                        size: "small"
                      }, {
                        default: Vue.withCtx(() => [
                          Vue.createVNode(_component_el_radio_button, { value: "auto" }, {
                            default: Vue.withCtx(() => _cache[23] || (_cache[23] = [
                              Vue.createTextVNode("自适应")
                            ])),
                            _: 1
                          }),
                          Vue.createVNode(_component_el_radio_button, { value: "fixed" }, {
                            default: Vue.withCtx(() => _cache[24] || (_cache[24] = [
                              Vue.createTextVNode("固定宽度")
                            ])),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.unref(currentItem).widthMode === "fixed" ? (Vue.openBlock(), Vue.createBlock(_component_el_form_item, {
                    key: 3,
                    label: "固定宽度"
                  }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_input_number, {
                        modelValue: Vue.unref(currentItem).width,
                        "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => Vue.unref(currentItem).width = $event),
                        min: 80,
                        max: 500,
                        class: "width-input"
                      }, {
                        append: Vue.withCtx(() => _cache[25] || (_cache[25] = [
                          Vue.createTextVNode("px")
                        ])),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  })) : Vue.createCommentVNode("", true),
                  Vue.unref(currentItem).widthMode === "auto" ? (Vue.openBlock(), Vue.createBlock(_component_el_form_item, {
                    key: 4,
                    label: "最小宽度"
                  }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_input_number, {
                        modelValue: Vue.unref(currentItem).minWidth,
                        "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => Vue.unref(currentItem).minWidth = $event),
                        min: 80,
                        max: 500,
                        class: "width-input"
                      }, {
                        append: Vue.withCtx(() => _cache[26] || (_cache[26] = [
                          Vue.createTextVNode("px")
                        ])),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  })) : Vue.createCommentVNode("", true),
                  Vue.createVNode(_component_el_form_item, { label: "超出自动换行" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_switch, {
                        modelValue: Vue.unref(currentItem).isOverflowWrap,
                        "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => Vue.unref(currentItem).isOverflowWrap = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.createVNode(_component_el_form_item, { label: "表头对齐方式" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_select, {
                        modelValue: Vue.unref(currentItem).headerAlign,
                        "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => Vue.unref(currentItem).headerAlign = $event),
                        teleported: false
                      }, {
                        default: Vue.withCtx(() => [
                          Vue.createVNode(_component_el_option, {
                            label: "左对齐",
                            value: "left"
                          }),
                          Vue.createVNode(_component_el_option, {
                            label: "居中",
                            value: "center"
                          }),
                          Vue.createVNode(_component_el_option, {
                            label: "右对齐",
                            value: "right"
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.createVNode(_component_el_form_item, { label: "数据对齐方式" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_select, {
                        modelValue: Vue.unref(currentItem).align,
                        "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => Vue.unref(currentItem).align = $event),
                        teleported: false
                      }, {
                        default: Vue.withCtx(() => [
                          Vue.createVNode(_component_el_option, {
                            label: "左对齐",
                            value: "left"
                          }),
                          Vue.createVNode(_component_el_option, {
                            label: "居中",
                            value: "center"
                          }),
                          Vue.createVNode(_component_el_option, {
                            label: "右对齐",
                            value: "right"
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.createVNode(_component_el_form_item, { label: "前置内容" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_input, {
                        modelValue: Vue.unref(currentItem).prefix,
                        "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => Vue.unref(currentItem).prefix = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.createVNode(_component_el_form_item, { label: "后置内容" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_input, {
                        modelValue: Vue.unref(currentItem).suffix,
                        "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => Vue.unref(currentItem).suffix = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.createVNode(_component_el_form_item, { label: "数据脱敏" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_input, {
                        modelValue: Vue.unref(currentItem).dataMasking,
                        "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => Vue.unref(currentItem).dataMasking = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.createVNode(_component_el_form_item, { label: "超链接" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_checkbox, {
                        modelValue: Vue.unref(currentItem).isLink,
                        "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => Vue.unref(currentItem).isLink = $event),
                        label: "启用超链接"
                      }, null, 8, ["modelValue"]),
                      Vue.unref(currentItem).isLink ? (Vue.openBlock(), Vue.createBlock(EventConfigButton.default, {
                        key: 0,
                        config: Vue.unref(currentItem).linkConfig,
                        onConfirm: (data) => Vue.unref(currentItem).linkConfig = data
                      }, null, 8, ["config", "onConfirm"])) : Vue.createCommentVNode("", true)
                    ]),
                    _: 1
                  }),
                  Vue.createVNode(_component_el_form_item, { label: "字段排序" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_radio_group, {
                        modelValue: Vue.unref(currentItem).sortRule,
                        "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => Vue.unref(currentItem).sortRule = $event),
                        size: "small"
                      }, {
                        default: Vue.withCtx(() => [
                          Vue.createVNode(_component_el_radio_button, { value: "none" }, {
                            default: Vue.withCtx(() => _cache[27] || (_cache[27] = [
                              Vue.createTextVNode("无")
                            ])),
                            _: 1
                          }),
                          Vue.createVNode(_component_el_radio_button, { value: "static" }, {
                            default: Vue.withCtx(() => _cache[28] || (_cache[28] = [
                              Vue.createTextVNode("前台排序")
                            ])),
                            _: 1
                          }),
                          Vue.createVNode(_component_el_radio_button, { value: "server" }, {
                            default: Vue.withCtx(() => _cache[29] || (_cache[29] = [
                              Vue.createTextVNode("后台排序")
                            ])),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.createVNode(_component_el_form_item, { label: "其他" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_checkbox, {
                        modelValue: Vue.unref(currentItem).isFixed,
                        "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => Vue.unref(currentItem).isFixed = $event),
                        label: "左侧固定"
                      }, null, 8, ["modelValue"]),
                      Vue.createVNode(_component_el_checkbox, {
                        modelValue: Vue.unref(currentItem).canCopy,
                        "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => Vue.unref(currentItem).canCopy = $event),
                        label: "复制"
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["model"]))
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["modelValue"]);
    };
  }
};
const widgets = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-ee9264c8"]]);
exports.default = widgets;
