"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                                                                 */
const Vue = require("vue");
const common = require("../../utils/common.js");
const TemplateSelector = require("../../../components/TemplateSelector.vue2.js");
const eventBus = require("../../utils/eventBus.js");
const ValueSelector = require("../../../components/ValueSelector.vue.js");
const ParamsConfig = require("../../../components/ParamsConfig.vue2.js");
const index = require("../../../../../node_modules/element-plus/es/components/collapse/index.js");
const index$1 = require("../../../../../node_modules/element-plus/es/components/form/index.js");
const index$2 = require("../../../../../node_modules/element-plus/es/components/input/index.js");
const index$3 = require("../../../../../node_modules/element-plus/es/components/radio/index.js");
const _sfc_main = {
  __name: "subForm",
  setup(__props) {
    const currentItem = Vue.computed(() => {
      return common.getCurrentItem();
    });
    const activeName = Vue.ref(["common"]);
    function handleTitleModeChange(value) {
      const item = currentItem.value;
      const fieldsData = common.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;
        eventBus.default.emit("resizeEvent");
      }
    }
    return (_ctx, _cache) => {
      const _component_el_input = index$2.ElInput;
      const _component_el_form_item = index$1.ElFormItem;
      const _component_el_radio_button = index$3.ElRadioButton;
      const _component_el_radio_group = index$3.ElRadioGroup;
      const _component_el_form = index$1.ElForm;
      const _component_el_collapse_item = index.ElCollapseItem;
      const _component_el_collapse = index.ElCollapse;
      return Vue.openBlock(), Vue.createBlock(_component_el_collapse, {
        class: "setting",
        modelValue: Vue.unref(activeName),
        "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => Vue.isRef(activeName) ? activeName.value = $event : null)
      }, {
        default: Vue.withCtx(() => [
          Vue.createVNode(_component_el_collapse_item, {
            name: "common",
            title: "基本属性"
          }, {
            default: Vue.withCtx(() => [
              (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[0] || (_cache[0] = ($event) => Vue.unref(currentItem).label = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.createVNode(_component_el_form_item, { label: "标题模式" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_radio_group, {
                        modelValue: Vue.unref(currentItem).titleMode,
                        "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => Vue.unref(currentItem).titleMode = $event),
                        size: "small",
                        onChange: handleTitleModeChange
                      }, {
                        default: Vue.withCtx(() => [
                          Vue.createVNode(_component_el_radio_button, { value: "none" }, {
                            default: Vue.withCtx(() => _cache[12] || (_cache[12] = [
                              Vue.createTextVNode("无")
                            ])),
                            _: 1
                          }),
                          Vue.createVNode(_component_el_radio_button, { value: "label" }, {
                            default: Vue.withCtx(() => _cache[13] || (_cache[13] = [
                              Vue.createTextVNode("标题")
                            ])),
                            _: 1
                          }),
                          Vue.createVNode(_component_el_radio_button, { value: "subLabel" }, {
                            default: Vue.withCtx(() => _cache[14] || (_cache[14] = [
                              Vue.createTextVNode("子标题")
                            ])),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.unref(currentItem).titleMode != "none" ? (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, { key: 0 }, [
                    Vue.unref(currentItem).titleMode == "label" ? (Vue.openBlock(), Vue.createBlock(_component_el_form_item, {
                      key: 0,
                      label: "副标题"
                    }, {
                      default: Vue.withCtx(() => [
                        Vue.createVNode(_component_el_input, {
                          modelValue: Vue.unref(currentItem).subLabel,
                          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => Vue.unref(currentItem).subLabel = $event),
                          rows: 2,
                          type: "textarea",
                          resize: "none"
                        }, null, 8, ["modelValue"])
                      ]),
                      _: 1
                    })) : Vue.createCommentVNode("", true)
                  ], 64)) : Vue.createCommentVNode("", true),
                  Vue.createVNode(_component_el_form_item, { label: "显示模式" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_radio_group, {
                        modelValue: Vue.unref(currentItem).displayMode,
                        "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => Vue.unref(currentItem).displayMode = $event),
                        size: "small"
                      }, {
                        default: Vue.withCtx(() => [
                          Vue.createVNode(_component_el_radio_button, { value: "all" }, {
                            default: Vue.withCtx(() => _cache[15] || (_cache[15] = [
                              Vue.createTextVNode("始终显示")
                            ])),
                            _: 1
                          }),
                          Vue.createVNode(_component_el_radio_button, { value: "edit" }, {
                            default: Vue.withCtx(() => _cache[16] || (_cache[16] = [
                              Vue.createTextVNode("编辑时显示")
                            ])),
                            _: 1
                          }),
                          Vue.createVNode(_component_el_radio_button, { value: "query" }, {
                            default: Vue.withCtx(() => _cache[17] || (_cache[17] = [
                              Vue.createTextVNode("查看时显示")
                            ])),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.createVNode(_component_el_form_item, { label: "数据来源" }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(_component_el_radio_group, {
                        modelValue: Vue.unref(currentItem).dataSourceFrom,
                        "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => Vue.unref(currentItem).dataSourceFrom = $event),
                        size: "small"
                      }, {
                        default: Vue.withCtx(() => [
                          Vue.createVNode(_component_el_radio_button, { value: "main" }, {
                            default: Vue.withCtx(() => _cache[18] || (_cache[18] = [
                              Vue.createTextVNode("主页面获取")
                            ])),
                            _: 1
                          }),
                          Vue.createVNode(_component_el_radio_button, { value: "self" }, {
                            default: Vue.withCtx(() => _cache[19] || (_cache[19] = [
                              Vue.createTextVNode("子表单自加载")
                            ])),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.unref(currentItem).dataSourceFrom == "self" ? (Vue.openBlock(), Vue.createBlock(_component_el_form_item, {
                    key: 1,
                    label: "表单参数"
                  }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(ParamsConfig.default, {
                        modelValue: Vue.unref(currentItem).subFormParams,
                        "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => Vue.unref(currentItem).subFormParams = $event)
                      }, null, 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).formSource,
                        "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => Vue.unref(currentItem).formSource = $event),
                        size: "small"
                      }, {
                        default: Vue.withCtx(() => [
                          Vue.createVNode(_component_el_radio_button, { value: "select" }, {
                            default: Vue.withCtx(() => _cache[20] || (_cache[20] = [
                              Vue.createTextVNode("选择表单")
                            ])),
                            _: 1
                          }),
                          Vue.createVNode(_component_el_radio_button, { value: "dynamic" }, {
                            default: Vue.withCtx(() => _cache[21] || (_cache[21] = [
                              Vue.createTextVNode("动态表单")
                            ])),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  Vue.unref(currentItem).formSource == "select" ? (Vue.openBlock(), Vue.createBlock(_component_el_form_item, {
                    key: 2,
                    label: "选择子表单"
                  }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(TemplateSelector.default, {
                        modelValue: Vue.unref(currentItem).subFormName,
                        "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => Vue.unref(currentItem).subFormName = $event),
                        templateKey: Vue.unref(currentItem).subFormKey,
                        "onUpdate:templateKey": _cache[8] || (_cache[8] = ($event) => Vue.unref(currentItem).subFormKey = $event),
                        templateId: Vue.unref(currentItem).subFormId,
                        "onUpdate:templateId": _cache[9] || (_cache[9] = ($event) => Vue.unref(currentItem).subFormId = $event),
                        templateType: "form"
                      }, null, 8, ["modelValue", "templateKey", "templateId"])
                    ]),
                    _: 1
                  })) : Vue.unref(currentItem).formSource == "dynamic" ? (Vue.openBlock(), Vue.createBlock(_component_el_form_item, {
                    key: 3,
                    label: "表单标识"
                  }, {
                    default: Vue.withCtx(() => [
                      Vue.createVNode(ValueSelector.default, {
                        modelValue: Vue.unref(currentItem).dynamicSubFormKey,
                        "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => Vue.unref(currentItem).dynamicSubFormKey = $event),
                        size: "default"
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  })) : Vue.createCommentVNode("", true)
                ]),
                _: 1
              }, 8, ["model"]))
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["modelValue"]);
    };
  }
};
exports.default = _sfc_main;
