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                                                                 */
import { computed, ref, createBlock, openBlock, withCtx, createVNode, createElementBlock, createCommentVNode, createTextVNode, Fragment, createElementVNode } from "vue";
import { getCurrentItem, getEditConfigData } from "../../utils/common.mjs";
import emitter from "../../utils/eventBus.mjs";
import _sfc_main$1 from "../../../components/FileTypeSelect.vue.mjs";
import DocumentParam from "../../../components/DocumentParam.vue.mjs";
/* empty css               */
import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.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 { 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: "document",
  setup(__props) {
    const currentItem = computed(() => {
      return getCurrentItem();
    });
    const activeName = ref(["common"]);
    function handleTitleModeChange(value) {
      const item = currentItem.value;
      const fieldsData = getEditConfigData().fieldsData;
      const fieldInData = fieldsData == null ? void 0 : fieldsData.find((f) => {
        var _a;
        return ((_a = f.component) == null ? void 0 : _a.id) === item.id;
      });
      if (fieldInData) {
        fieldInData.h = value === "none" ? 2 : 3;
        emitter.emit("resizeEvent");
      }
    }
    return (_ctx, _cache) => {
      const _component_el_input = ElInput;
      const _component_el_form_item = ElFormItem;
      const _component_el_radio_button = ElRadioButton;
      const _component_el_radio_group = ElRadioGroup;
      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: activeName.value,
        "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => activeName.value = $event)
      }, {
        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(() => [
                  createVNode(_component_el_form_item, {
                    label: "标题",
                    required: ""
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_el_input, {
                        modelValue: currentItem.value.label,
                        "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => currentItem.value.label = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_el_form_item, { label: "标题模式" }, {
                    default: withCtx(() => [
                      createVNode(_component_el_radio_group, {
                        modelValue: currentItem.value.titleMode,
                        "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => currentItem.value.titleMode = $event),
                        size: "small",
                        onChange: handleTitleModeChange
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_el_radio_button, { value: "none" }, {
                            default: withCtx(() => _cache[9] || (_cache[9] = [
                              createTextVNode("无")
                            ])),
                            _: 1
                          }),
                          createVNode(_component_el_radio_button, { value: "label" }, {
                            default: withCtx(() => _cache[10] || (_cache[10] = [
                              createTextVNode("标题")
                            ])),
                            _: 1
                          }),
                          createVNode(_component_el_radio_button, { value: "subLabel" }, {
                            default: withCtx(() => _cache[11] || (_cache[11] = [
                              createTextVNode("子标题")
                            ])),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  currentItem.value.titleMode != "none" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                    currentItem.value.titleMode == "label" ? (openBlock(), createBlock(_component_el_form_item, {
                      key: 0,
                      label: "副标题"
                    }, {
                      default: withCtx(() => [
                        createVNode(_component_el_input, {
                          modelValue: currentItem.value.subLabel,
                          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => currentItem.value.subLabel = $event),
                          rows: 2,
                          type: "textarea",
                          resize: "none"
                        }, null, 8, ["modelValue"])
                      ]),
                      _: 1
                    })) : createCommentVNode("", true)
                  ], 64)) : createCommentVNode("", true),
                  createVNode(_component_el_form_item, { label: "是否允许补传" }, {
                    default: withCtx(() => [
                      createVNode(_component_el_switch, {
                        modelValue: currentItem.value.isSupplement,
                        "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => currentItem.value.isSupplement = $event)
                      }, null, 8, ["modelValue"]),
                      _cache[12] || (_cache[12] = createElementVNode("div", { class: "form-item-hint" }, "只读情况下是否允许补传", -1))
                    ]),
                    _: 1
                  }),
                  createVNode(_component_el_form_item, { label: "是否允许多文件上传" }, {
                    default: withCtx(() => [
                      createVNode(_component_el_switch, {
                        modelValue: currentItem.value.multiple,
                        "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => currentItem.value.multiple = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_el_form_item, { label: "是否允许下载" }, {
                    default: withCtx(() => [
                      createVNode(_component_el_switch, {
                        modelValue: currentItem.value.download,
                        "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => currentItem.value.download = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_el_form_item, { label: "允许上传的文件类型" }, {
                    default: withCtx(() => [
                      createVNode(_sfc_main$1, {
                        modelValue: currentItem.value.acceptType,
                        "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => currentItem.value.acceptType = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_el_form_item, { label: "要件参数" }, {
                    default: withCtx(() => [
                      createVNode(DocumentParam, {
                        modelValue: currentItem.value.essentialParams,
                        "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => currentItem.value.essentialParams = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["model"])
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["modelValue"]);
    };
  }
};
const document = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ca84a82c"]]);
export {
  document as default
};
