import "../../../../../node_modules/element-plus/es/index.mjs";
/* empty css                                                             */
/* empty css                                                                    */
/* empty css                                                                         */
/* empty css                                                                */
/* empty css                                                                  */
/* empty css                                                                     */
/* empty css                                                                 */
/* empty css                                                                       */
/* empty css                                                                        */
import { computed, ref, createBlock, openBlock, unref, isRef, withCtx, createVNode, createCommentVNode, createElementBlock, createTextVNode, Fragment } from "vue";
import { getCurrentItem, getEditConfigData } from "../../utils/common.mjs";
import { ElCollapse, ElCollapseItem } from "../../../../../node_modules/element-plus/es/components/collapse/index.mjs";
import { ElForm, ElFormItem } from "../../../../../node_modules/element-plus/es/components/form/index.mjs";
import { ElRadioGroup, ElRadioButton } from "../../../../../node_modules/element-plus/es/components/radio/index.mjs";
import { ElSwitch } from "../../../../../node_modules/element-plus/es/components/switch/index.mjs";
const _sfc_main = {
  __name: "filterWidgets",
  setup(__props) {
    const currentItem = computed(() => {
      return getCurrentItem();
    });
    const activeName = ref(["common"]);
    const editConfigData = computed(() => getEditConfigData());
    const fieldInfo = computed(() => {
      var _a, _b;
      const fieldId = (_a = currentItem.value) == null ? void 0 : _a.fieldId;
      if (!fieldId) return null;
      const allFields = ((_b = editConfigData.value) == null ? void 0 : _b.fieldsData) || [];
      return allFields.find((f) => f.id === fieldId);
    });
    return (_ctx, _cache) => {
      const _component_el_radio_button = ElRadioButton;
      const _component_el_radio_group = ElRadioGroup;
      const _component_el_form_item = ElFormItem;
      const _component_el_switch = ElSwitch;
      const _component_el_form = ElForm;
      const _component_el_collapse_item = ElCollapseItem;
      const _component_el_collapse = ElCollapse;
      return openBlock(), createBlock(_component_el_collapse, {
        class: "setting",
        modelValue: unref(activeName),
        "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(activeName) ? activeName.value = $event : null)
      }, {
        default: withCtx(() => [
          createVNode(_component_el_collapse_item, {
            name: "common",
            title: "基本属性"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_form, {
                "label-position": "top",
                "label-width": "auto",
                model: currentItem.value
              }, {
                default: withCtx(() => {
                  var _a, _b, _c, _d, _e, _f;
                  return [
                    ((_a = fieldInfo.value) == null ? void 0 : _a.fieldType) === "text" || ((_b = fieldInfo.value) == null ? void 0 : _b.fieldType) === "textarea" ? (openBlock(), createBlock(_component_el_form_item, {
                      key: 0,
                      label: "查询类型"
                    }, {
                      default: withCtx(() => [
                        createVNode(_component_el_radio_group, {
                          modelValue: currentItem.value.queryType,
                          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => currentItem.value.queryType = $event)
                        }, {
                          default: withCtx(() => [
                            createVNode(_component_el_radio_button, { value: "exact" }, {
                              default: withCtx(() => _cache[4] || (_cache[4] = [
                                createTextVNode("精准查询")
                              ])),
                              _: 1
                            }),
                            createVNode(_component_el_radio_button, { value: "fuzzy" }, {
                              default: withCtx(() => _cache[5] || (_cache[5] = [
                                createTextVNode("模糊查询")
                              ])),
                              _: 1
                            })
                          ]),
                          _: 1
                        }, 8, ["modelValue"])
                      ]),
                      _: 1
                    })) : createCommentVNode("", true),
                    editConfigData.value.queryConfig.mode === "dynamic" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
                      createVNode(_component_el_form_item, { label: "独占一行" }, {
                        default: withCtx(() => [
                          createVNode(_component_el_switch, {
                            modelValue: currentItem.value.isExclusiveRow,
                            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => currentItem.value.isExclusiveRow = $event)
                          }, null, 8, ["modelValue"])
                        ]),
                        _: 1
                      }),
                      ((_c = fieldInfo.value) == null ? void 0 : _c.fieldType) === "radio" || ((_d = fieldInfo.value) == null ? void 0 : _d.fieldType) === "checkbox" || ((_e = fieldInfo.value) == null ? void 0 : _e.fieldType) === "select" || ((_f = fieldInfo.value) == null ? void 0 : _f.fieldType) === "multipleSelection" ? (openBlock(), createBlock(_component_el_form_item, {
                        key: 0,
                        label: "按钮样式"
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_el_switch, {
                            modelValue: currentItem.value.isButtonStyle,
                            "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => currentItem.value.isButtonStyle = $event)
                          }, null, 8, ["modelValue"])
                        ]),
                        _: 1
                      })) : createCommentVNode("", true)
                    ], 64)) : createCommentVNode("", true)
                  ];
                }),
                _: 1
              }, 8, ["model"])
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["modelValue"]);
    };
  }
};
export {
  _sfc_main as default
};
