"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                                                               */
const Vue = require("vue");
const common = require("../../utils/common.js");
;/* empty css             */
const _pluginVue_exportHelper = require("../../../../../_virtual/_plugin-vue_export-helper.js");
const index = require("../../../../../node_modules/element-plus/es/components/row/index.js");
const index$1 = require("../../../../../node_modules/element-plus/es/components/col/index.js");
const _hoisted_1 = { class: "grid-content" };
const _hoisted_2 = { class: "grid-content-statistics" };
const _sfc_main = {
  __name: "Layout",
  props: {
    templateKey: {
      type: String,
      default: ""
    },
    initFormMode: {
      type: String,
      default: ""
    },
    initFormData: {
      type: Object,
      default: {}
    }
  },
  emits: ["loaded"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const layoutRowRef = Vue.ref();
    const formData = Vue.ref(props.initFormData);
    const emit = __emit;
    const showCard = Vue.ref(false);
    function loaded(option, formData2) {
      showCard.value = true;
      let offsetHeight = layoutRowRef.value.$el.offsetHeight;
      const cols = layoutRowRef.value.$el.querySelectorAll(".el-col");
      cols.forEach((col) => {
        col.style.height = offsetHeight + "px";
      });
      emit("loaded", common.cloneDeep(formData2));
    }
    return (_ctx, _cache) => {
      const _component_fec_form = Vue.resolveComponent("fec-form");
      const _component_el_col = index$1.ElCol;
      const _component_el_row = index.ElRow;
      const _directive_fec_layout = Vue.resolveDirective("fec-layout");
      return Vue.withDirectives((Vue.openBlock(), Vue.createBlock(_component_el_row, {
        gutter: 8,
        class: "fec-layout-row",
        ref_key: "layoutRowRef",
        ref: layoutRowRef
      }, {
        default: Vue.withCtx(() => [
          Vue.createVNode(_component_el_col, {
            span: 18,
            style: { "padding-left": "0" }
          }, {
            default: Vue.withCtx(() => [
              Vue.createElementVNode("div", _hoisted_1, [
                Vue.createVNode(_component_fec_form, {
                  ref: "formRef",
                  templateKey: __props.templateKey,
                  modelValue: Vue.unref(formData),
                  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => Vue.isRef(formData) ? formData.value = $event : null),
                  onLoaded: loaded,
                  initFormMode: __props.initFormMode
                }, null, 8, ["templateKey", "modelValue", "initFormMode"])
              ])
            ]),
            _: 1
          }),
          Vue.createVNode(_component_el_col, {
            span: 6,
            style: { "padding-right": "0" }
          }, {
            default: Vue.withCtx(() => [
              Vue.createElementVNode("div", _hoisted_2, [
                Vue.unref(showCard) ? Vue.renderSlot(_ctx.$slots, "card", { key: 0 }, void 0, true) : Vue.createCommentVNode("", true)
              ])
            ]),
            _: 3
          })
        ]),
        _: 3
      })), [
        [_directive_fec_layout]
      ]);
    };
  }
};
const _Layout = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-1eb7b697"]]);
exports.default = _Layout;
