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, watch, createBlock, openBlock, unref, isRef, withCtx, createVNode, createElementBlock, createCommentVNode, createTextVNode, Fragment } from "vue";
import { getCurrentItem, getEditConfigData } from "../../utils/common.mjs";
import emitter from "../../utils/eventBus.mjs";
import ValueSelector from "../../../components/ValueSelector.vue.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";
const _sfc_main = {
  __name: "approvalHistory",
  setup(__props) {
    const currentItem = computed(() => {
      return getCurrentItem();
    });
    const activeName = ref(["common"]);
    watch(
      currentItem.value.titleMode,
      (value) => {
        handleTitleModeChange(value);
      },
      {
        immediate: true
      }
    );
    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_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[5] || (_cache[5] = ($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_radio_group, {
                        modelValue: unref(currentItem).titleMode,
                        "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(currentItem).titleMode = $event),
                        size: "small",
                        onChange: handleTitleModeChange
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_el_radio_button, { value: "none" }, {
                            default: withCtx(() => _cache[6] || (_cache[6] = [
                              createTextVNode("无")
                            ])),
                            _: 1
                          }),
                          createVNode(_component_el_radio_button, { value: "label" }, {
                            default: withCtx(() => _cache[7] || (_cache[7] = [
                              createTextVNode("标题")
                            ])),
                            _: 1
                          }),
                          createVNode(_component_el_radio_button, { value: "subLabel" }, {
                            default: withCtx(() => _cache[8] || (_cache[8] = [
                              createTextVNode("子标题")
                            ])),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  unref(currentItem).titleMode != "none" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                    unref(currentItem).titleMode == "label" ? (openBlock(), createBlock(_component_el_form_item, {
                      key: 0,
                      label: "副标题"
                    }, {
                      default: withCtx(() => [
                        createVNode(_component_el_input, {
                          modelValue: unref(currentItem).subLabel,
                          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(currentItem).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(ValueSelector, {
                        modelValue: unref(currentItem).traceNoFieldName,
                        "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(currentItem).traceNoFieldName = $event),
                        size: "default"
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_el_form_item, { label: "默认显示" }, {
                    default: withCtx(() => [
                      createVNode(_component_el_radio_group, {
                        modelValue: unref(currentItem).appHisDefault,
                        "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(currentItem).appHisDefault = $event),
                        size: "small"
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_el_radio_button, { value: "timeLine" }, {
                            default: withCtx(() => _cache[9] || (_cache[9] = [
                              createTextVNode("时间轴")
                            ])),
                            _: 1
                          }),
                          createVNode(_component_el_radio_button, { value: "flowChart" }, {
                            default: withCtx(() => _cache[10] || (_cache[10] = [
                              createTextVNode("流程图")
                            ])),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["model"])
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["modelValue"]);
    };
  }
};
export {
  _sfc_main as default
};
