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                                                                        */
/* empty css                                                                  */
/* empty css                                                                     */
/* empty css                                                                 */
import { computed, ref, createBlock, openBlock, unref, isRef, withCtx, createVNode } from "vue";
import EventConfigButton from "../../../components/EventConfigButton.vue.mjs";
import { getCurrentItem } from "../../utils/common.mjs";
import ConditionConfigButton from "../../../components/ConditionConfigButton.vue2.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 { ElInput } from "../../../../../node_modules/element-plus/es/components/input/index.mjs";
import { ElSelect, ElOption } from "../../../../../node_modules/element-plus/es/components/select/index.mjs";
const _sfc_main = {
  __name: "optBtn",
  setup(__props) {
    const currentItem = computed(() => {
      return getCurrentItem();
    });
    const activeName = ref(["common"]);
    function handleEventConfirm(data) {
      currentItem.value.eventConfig = data;
    }
    return (_ctx, _cache) => {
      const _component_el_input = ElInput;
      const _component_el_form_item = ElFormItem;
      const _component_el_option = ElOption;
      const _component_el_select = ElSelect;
      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: unref(currentItem)
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_form_item, {
                    label: "按钮名称",
                    required: ""
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_el_input, {
                        modelValue: unref(currentItem).label,
                        "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(currentItem).label = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_el_form_item, { label: "权限标识" }, {
                    default: withCtx(() => [
                      createVNode(_component_el_input, {
                        modelValue: unref(currentItem).permission,
                        "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(currentItem).permission = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_el_form_item, { label: "禁用条件" }, {
                    default: withCtx(() => [
                      createVNode(ConditionConfigButton, {
                        condition: unref(currentItem).disableCondition,
                        onConfirm: (data) => unref(currentItem).disableCondition = data
                      }, null, 8, ["condition", "onConfirm"])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_el_form_item, { label: "风格" }, {
                    default: withCtx(() => [
                      createVNode(_component_el_select, {
                        modelValue: unref(currentItem).btnStyle,
                        "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(currentItem).btnStyle = $event)
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_el_option, {
                            label: "默认",
                            value: "default"
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_el_form_item, { label: "事件配置" }, {
                    default: withCtx(() => [
                      createVNode(EventConfigButton, {
                        config: unref(currentItem).eventConfig,
                        onConfirm: handleEventConfirm
                      }, null, 8, ["config"])
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["model"])
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["modelValue"]);
    };
  }
};
export {
  _sfc_main as default
};
