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                                                                     */
/* empty css                                                               */
/* 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 { getCurrentInstance, computed, useModel, ref, watch, createBlock, openBlock, withCtx, createVNode, unref, createTextVNode, createElementBlock, createCommentVNode, createElementVNode, withKeys, isRef, Fragment, renderList, normalizeClass, withDirectives, vShow, withModifiers, toDisplayString } from "vue";
import { VueDraggable as lo } from "../../../../node_modules/vue-draggable-plus/dist/vue-draggable-plus.mjs";
import { Plus as plus_default, Close as close_default, Check as check_default, Delete as delete_default, Rank as rank_default, Edit as edit_default } from "../../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
import { getEditConfigData, cloneDeep, getEditConfigDialogs, setEditConfigDialogs } from "../utils/common.mjs";
import TemplateSelector from "../../components/TemplateSelector.vue2.mjs";
import api from "../../api/index.mjs";
import ParamsConfig from "../../components/ParamsConfig.vue2.mjs";
import _sfc_main$1 from "../../components/DataSourceSelect.vue.mjs";
import FieldSetMapping from "../../components/FieldSetMapping.vue2.mjs";
import OnlyFLowConfigButton from "../../components/OnlyFLowConfigButton.vue2.mjs";
import _sfc_main$2 from "../../components/FormulaEditorInput.vue.mjs";
import { defaultProperty } from "../table/aside/index.mjs";
import { defaultTableConfig } from "../table/default.mjs";
import widgets from "../table/property/widgets.vue.mjs";
/* empty css                                                              */
/* empty css                                                                */
/* empty css            */
import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.mjs";
import { ElDialog } from "../../../../node_modules/element-plus/es/components/dialog/index.mjs";
import { ElContainer, ElAside, ElHeader, ElMain } from "../../../../node_modules/element-plus/es/components/container/index.mjs";
import { ElButton } from "../../../../node_modules/element-plus/es/components/button/index.mjs";
import { ElInput } from "../../../../node_modules/element-plus/es/components/input/index.mjs";
import { ElLink } from "../../../../node_modules/element-plus/es/components/link/index.mjs";
import { ElIcon } from "../../../../node_modules/element-plus/es/components/icon/index.mjs";
import { ElScrollbar } from "../../../../node_modules/element-plus/es/components/scrollbar/index.mjs";
import { ElForm, ElFormItem } from "../../../../node_modules/element-plus/es/components/form/index.mjs";
import { ElRadioGroup, ElRadioButton } from "../../../../node_modules/element-plus/es/components/radio/index.mjs";
import { ElSelect, ElOption } from "../../../../node_modules/element-plus/es/components/select/index.mjs";
import { ElPopover } from "../../../../node_modules/element-plus/es/components/popover/index.mjs";
import { ElSwitch } from "../../../../node_modules/element-plus/es/components/switch/index.mjs";
import { ElCheckbox } from "../../../../node_modules/element-plus/es/components/checkbox/index.mjs";
import { ElMessage } from "../../../../node_modules/element-plus/es/components/message/index.mjs";
const _hoisted_1 = { key: 0 };
const _hoisted_2 = { class: "dialog-menu-item is-editing" };
const _hoisted_3 = { class: "new-item-content" };
const _hoisted_4 = { class: "edit-actions" };
const _hoisted_5 = ["onClick"];
const _hoisted_6 = { class: "dialog-content" };
const _hoisted_7 = { class: "dialog-name-wrapper" };
const _hoisted_8 = { style: { "display": "flex", "gap": "16px", "width": "100%" } };
const _hoisted_9 = { class: "col-panel" };
const _hoisted_10 = { class: "col-header" };
const _hoisted_11 = { class: "col-rules-list" };
const _hoisted_12 = { class: "drag-handle" };
const _hoisted_13 = { class: "custom-col-btns" };
const _hoisted_14 = { class: "col-property" };
const _hoisted_15 = { class: "footer-buttons-container" };
const _hoisted_16 = {
  key: 0,
  class: "empty-tip"
};
const _hoisted_17 = {
  key: 1,
  class: "footer-buttons"
};
const _hoisted_18 = {
  key: 1,
  class: "empty-selection"
};
const _hoisted_19 = { class: "dialog-footer" };
const _sfc_main = {
  __name: "index",
  props: {
    "modelValue": { required: true },
    "modelModifiers": {}
  },
  emits: ["update:modelValue"],
  setup(__props) {
    const currentInstance = getCurrentInstance();
    const ctx = currentInstance.proxy;
    const editConfigData = computed(() => {
      return getEditConfigData();
    });
    const dialogVisible = useModel(__props, "modelValue");
    const selectedDialogs = ref([]);
    const activeDialogIndex = ref(-1);
    watch(dialogVisible, (val) => {
      if (val) {
        isEditingNew.value = false;
        editingDialogIndex.value = -1;
        selectedDialogs.value = cloneDeep(getEditConfigDialogs());
        if (selectedDialogs.value.length > 0 && activeDialogIndex.value === -1) {
          activeDialogIndex.value = 0;
        }
      }
    });
    const isEditingNew = ref(false);
    const newDialogName = ref("");
    const editingDialogIndex = ref(-1);
    const editingDialogName = ref("");
    const startAddDialog = () => {
      isEditingNew.value = true;
      newDialogName.value = "";
    };
    const confirmAddDialog = () => {
      if (!newDialogName.value.trim()) {
        ElMessage.warning("请输入弹层名称");
        return;
      }
      selectedDialogs.value.push({
        id: "dialog_" + Date.now(),
        name: newDialogName.value,
        dialogSize: "standard",
        dialogParams: [],
        customWidth: "",
        // 自定义宽度
        customMaxHeight: "",
        // 自定义最大高度
        contentSource: "table",
        tableContent: "select",
        selectionMode: "single",
        isSubTablePagination: true,
        isSubTableReadOnly: false,
        componentPath: "",
        fieldMapping: [],
        subFormMode: "edit",
        subFormFooterButtons: [],
        // 表单底部按钮
        componentParams: []
      });
      isEditingNew.value = false;
      newDialogName.value = "";
      activeDialogIndex.value = selectedDialogs.value.length - 1;
    };
    const cancelAddDialog = () => {
      isEditingNew.value = false;
      newDialogName.value = "";
    };
    const handleRemoveDialog = (index) => {
      selectedDialogs.value.splice(index, 1);
      if (activeDialogIndex.value === index) {
        activeDialogIndex.value = -1;
      } else if (activeDialogIndex.value > index) {
        activeDialogIndex.value--;
      }
    };
    const startEditDialog = (index) => {
      editingDialogIndex.value = index;
      editingDialogName.value = selectedDialogs.value[index].name;
    };
    const onEditOutside = () => {
      if (editingDialogIndex.value !== -1) {
        if (!editingDialogName.value.trim()) {
          ElMessage.warning("请输入弹层名称");
          return;
        }
        selectedDialogs.value[editingDialogIndex.value].name = editingDialogName.value;
        editingDialogIndex.value = -1;
        editingDialogName.value = "";
      }
    };
    const onConfirm = () => {
      setEditConfigDialogs(selectedDialogs.value);
      dialogVisible.value = false;
    };
    const tableOptions = ref(null);
    const formOptions = ref(null);
    const currentDialog = computed(() => {
      const data = selectedDialogs.value[activeDialogIndex.value];
      if (!data.fieldMapping) {
        data.fieldMapping = [];
      }
      if (!data.customTableConfig) {
        data.customTableConfig = cloneDeep(defaultTableConfig);
        data.customTableConfig.fieldsData = [];
        data.customTableConfig.dataSources = editConfigData.value.dataSources;
      } else {
        data.customTableConfig.dataSources = editConfigData.value.dataSources;
        data.customTableConfig.queryConfig.enabled = false;
      }
      if ((data == null ? void 0 : data.contentSource) == "table") {
        const pkId = data == null ? void 0 : data.subTableId;
        if (pkId) {
          api.getById(ctx.$http, pkId, false).then((data2) => {
            tableOptions.value = JSON.parse(data2.context);
          });
        }
      } else if ((data == null ? void 0 : data.contentSource) == "form") {
        const pkId = data == null ? void 0 : data.subFormId;
        if (pkId) {
          api.getById(ctx.$http, pkId, false).then((data2) => {
            formOptions.value = JSON.parse(data2.context);
          });
        }
      }
      return data;
    });
    function tableSelectorConfirm(data) {
      tableOptions.value = data;
      currentDialog.value.subTableMode = null;
    }
    function formSelectorConfirm(data) {
      formOptions.value = data;
    }
    const tableMode = computed(() => {
      var _a;
      return (_a = tableOptions.value) == null ? void 0 : _a.mode;
    });
    const tableFields = computed(() => {
      var _a, _b, _c, _d;
      if (currentDialog.value.tableContent === "custom") {
        return ((_b = (_a = currentDialog.value) == null ? void 0 : _a.customTableConfig) == null ? void 0 : _b.fieldsData) || [];
      } else if (currentDialog.value.tableContent === "select") {
        return [
          ...((_c = tableOptions.value) == null ? void 0 : _c.fieldsData) || [],
          ...((_d = tableOptions.value) == null ? void 0 : _d.hiddenFields) || []
        ];
      }
    });
    const formFooterBtn = computed(() => {
      var _a;
      const btnList = (_a = formOptions.value) == null ? void 0 : _a.pageFooterConfig.actions;
      if (btnList) {
        return btnList.filter((item) => item.btnType == "primary");
      }
      return [];
    });
    const isButtonSelected = (btnId) => {
      var _a, _b;
      return (_b = (_a = currentDialog.value) == null ? void 0 : _a.subFormFooterButtons) == null ? void 0 : _b.includes(btnId);
    };
    const toggleButton = (btn) => {
      if (!currentDialog.value.subFormFooterButtons) {
        currentDialog.value.subFormFooterButtons = [];
      }
      const index = currentDialog.value.subFormFooterButtons.indexOf(btn.id);
      if (index > -1) {
        currentDialog.value.subFormFooterButtons.splice(index, 1);
      } else {
        currentDialog.value.subFormFooterButtons.push(btn.id);
      }
    };
    function handleOnlyFlowConfirm(data) {
      currentDialog.value.callbackEventConfig = data;
    }
    const addTableCol = () => {
      currentDialog.value.customTableConfig.fieldsData.push({
        fieldType: "text",
        label: "",
        ...defaultProperty,
        fieldName: ""
      });
    };
    const removeCol = (index) => {
      currentDialog.value.customTableConfig.fieldsData.splice(index, 1);
    };
    return (_ctx, _cache) => {
      const _component_el_button = ElButton;
      const _component_el_header = ElHeader;
      const _component_el_input = ElInput;
      const _component_el_link = ElLink;
      const _component_el_icon = ElIcon;
      const _component_el_main = ElMain;
      const _component_el_container = ElContainer;
      const _component_el_aside = ElAside;
      const _component_el_form_item = ElFormItem;
      const _component_el_radio_button = ElRadioButton;
      const _component_el_radio_group = ElRadioGroup;
      const _component_el_option = ElOption;
      const _component_el_select = ElSelect;
      const _component_el_scrollbar = ElScrollbar;
      const _component_el_popover = ElPopover;
      const _component_el_switch = ElSwitch;
      const _component_el_checkbox = ElCheckbox;
      const _component_el_form = ElForm;
      const _component_el_dialog = ElDialog;
      return openBlock(), createBlock(_component_el_dialog, {
        modelValue: dialogVisible.value,
        "onUpdate:modelValue": _cache[31] || (_cache[31] = ($event) => dialogVisible.value = $event),
        width: "50%",
        title: "页面弹层配置",
        draggable: "",
        overflow: "",
        "append-to-body": "",
        class: "fec-dev-designer-dialog"
      }, {
        footer: withCtx(() => [
          createElementVNode("div", _hoisted_19, [
            createVNode(_component_el_button, {
              onClick: _cache[30] || (_cache[30] = ($event) => dialogVisible.value = false)
            }, {
              default: withCtx(() => _cache[51] || (_cache[51] = [
                createTextVNode("取消")
              ])),
              _: 1
            }),
            createVNode(_component_el_button, {
              type: "primary",
              onClick: onConfirm
            }, {
              default: withCtx(() => _cache[52] || (_cache[52] = [
                createTextVNode("确定")
              ])),
              _: 1
            })
          ])
        ]),
        default: withCtx(() => [
          createVNode(_component_el_container, { style: { "border": "1px solid #ebeef5", "border-radius": "4px", "height": "600px" } }, {
            default: withCtx(() => [
              createVNode(_component_el_aside, { width: "300px" }, {
                default: withCtx(() => [
                  createVNode(_component_el_container, null, {
                    default: withCtx(() => [
                      createVNode(_component_el_header, {
                        height: "40px",
                        style: { "background-color": "#f2f2f2", "line-height": "40px" }
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_el_button, {
                            type: "primary",
                            link: "",
                            icon: unref(plus_default),
                            onClick: startAddDialog
                          }, {
                            default: withCtx(() => _cache[32] || (_cache[32] = [
                              createTextVNode(" 新增弹层 ")
                            ])),
                            _: 1
                          }, 8, ["icon"])
                        ]),
                        _: 1
                      }),
                      createVNode(_component_el_main, { style: { "padding": "10px" } }, {
                        default: withCtx(() => [
                          unref(isEditingNew) ? (openBlock(), createElementBlock("div", _hoisted_1, [
                            createElementVNode("div", _hoisted_2, [
                              createElementVNode("div", _hoisted_3, [
                                createVNode(_component_el_input, {
                                  modelValue: unref(newDialogName),
                                  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(newDialogName) ? newDialogName.value = $event : null),
                                  placeholder: "请输入弹层名称",
                                  size: "default",
                                  onKeyup: withKeys(confirmAddDialog, ["enter"]),
                                  class: "new-item-input"
                                }, null, 8, ["modelValue"]),
                                createElementVNode("div", _hoisted_4, [
                                  createVNode(_component_el_button, {
                                    size: "small",
                                    icon: unref(close_default),
                                    onClick: cancelAddDialog
                                  }, {
                                    default: withCtx(() => _cache[33] || (_cache[33] = [
                                      createTextVNode(" 取消 ")
                                    ])),
                                    _: 1
                                  }, 8, ["icon"]),
                                  createVNode(_component_el_button, {
                                    type: "primary",
                                    size: "small",
                                    icon: unref(check_default),
                                    onClick: confirmAddDialog
                                  }, {
                                    default: withCtx(() => _cache[34] || (_cache[34] = [
                                      createTextVNode(" 确认 ")
                                    ])),
                                    _: 1
                                  }, 8, ["icon"])
                                ])
                              ])
                            ])
                          ])) : createCommentVNode("", true),
                          (openBlock(true), createElementBlock(Fragment, null, renderList(unref(selectedDialogs), (dialog, index) => {
                            return openBlock(), createElementBlock("div", {
                              key: index,
                              class: normalizeClass([
                                "dialog-menu-item",
                                { "is-active": unref(activeDialogIndex) === index }
                              ]),
                              onClick: ($event) => activeDialogIndex.value = index
                            }, [
                              createElementVNode("div", _hoisted_6, [
                                createElementVNode("div", _hoisted_7, [
                                  withDirectives(createVNode(_component_el_input, {
                                    onBlur: ($event) => onEditOutside(),
                                    maxlength: "30",
                                    modelValue: unref(editingDialogName),
                                    "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(editingDialogName) ? editingDialogName.value = $event : null),
                                    size: "small"
                                  }, null, 8, ["onBlur", "modelValue"]), [
                                    [vShow, unref(editingDialogIndex) === index]
                                  ]),
                                  withDirectives(createVNode(_component_el_link, {
                                    icon: "Edit",
                                    onClick: withModifiers(($event) => startEditDialog(index), ["stop"])
                                  }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(dialog.name), 1)
                                    ]),
                                    _: 2
                                  }, 1032, ["onClick"]), [
                                    [vShow, unref(editingDialogIndex) !== index]
                                  ])
                                ]),
                                createVNode(_component_el_icon, {
                                  class: "delete-icon",
                                  onClick: withModifiers(($event) => handleRemoveDialog(index), ["stop"])
                                }, {
                                  default: withCtx(() => [
                                    createVNode(unref(delete_default))
                                  ]),
                                  _: 2
                                }, 1032, ["onClick"])
                              ])
                            ], 10, _hoisted_5);
                          }), 128))
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }),
              createVNode(_component_el_main, { style: { "border-left": "1px solid #ebeef5", "padding": "0" } }, {
                default: withCtx(() => [
                  unref(activeDialogIndex) !== -1 ? (openBlock(), createBlock(_component_el_container, {
                    key: 0,
                    style: { "height": "100%" }
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_el_header, {
                        height: "40px",
                        class: "dialog-header"
                      }, {
                        default: withCtx(() => [
                          createElementVNode("div", null, toDisplayString(unref(currentDialog).name), 1)
                        ]),
                        _: 1
                      }),
                      createVNode(_component_el_main, { style: { "padding": "12px 20px 0 20px" } }, {
                        default: withCtx(() => [
                          createVNode(_component_el_scrollbar, null, {
                            default: withCtx(() => [
                              createVNode(_component_el_form, {
                                model: unref(currentDialog),
                                "label-width": "130px",
                                style: { "padding-right": "20px" },
                                size: "small"
                              }, {
                                default: withCtx(() => [
                                  createVNode(_component_el_form_item, { label: "弹层标题" }, {
                                    default: withCtx(() => [
                                      createVNode(_component_el_input, {
                                        modelValue: unref(currentDialog).dialogTitle,
                                        "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(currentDialog).dialogTitle = $event),
                                        placeholder: "请输入弹层标题",
                                        clearable: ""
                                      }, null, 8, ["modelValue"])
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(_component_el_form_item, { label: "弹层尺寸" }, {
                                    default: withCtx(() => [
                                      createVNode(_component_el_radio_group, {
                                        modelValue: unref(currentDialog).dialogSize,
                                        "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(currentDialog).dialogSize = $event)
                                      }, {
                                        default: withCtx(() => [
                                          createVNode(_component_el_radio_button, { value: "standard" }, {
                                            default: withCtx(() => _cache[35] || (_cache[35] = [
                                              createTextVNode("标准")
                                            ])),
                                            _: 1
                                          }),
                                          createVNode(_component_el_radio_button, { value: "large" }, {
                                            default: withCtx(() => _cache[36] || (_cache[36] = [
                                              createTextVNode("更大")
                                            ])),
                                            _: 1
                                          }),
                                          createVNode(_component_el_radio_button, { value: "small" }, {
                                            default: withCtx(() => _cache[37] || (_cache[37] = [
                                              createTextVNode("更小")
                                            ])),
                                            _: 1
                                          }),
                                          createVNode(_component_el_radio_button, { value: "custom" }, {
                                            default: withCtx(() => _cache[38] || (_cache[38] = [
                                              createTextVNode("自定义")
                                            ])),
                                            _: 1
                                          })
                                        ]),
                                        _: 1
                                      }, 8, ["modelValue"])
                                    ]),
                                    _: 1
                                  }),
                                  unref(currentDialog).dialogSize === "custom" ? (openBlock(), createBlock(_component_el_form_item, {
                                    key: 0,
                                    label: "自定义尺寸"
                                  }, {
                                    default: withCtx(() => [
                                      createElementVNode("div", _hoisted_8, [
                                        createVNode(_component_el_input, {
                                          modelValue: unref(currentDialog).customWidth,
                                          "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(currentDialog).customWidth = $event),
                                          placeholder: "宽度，如：800px、60%",
                                          style: { "flex": "1" }
                                        }, null, 8, ["modelValue"]),
                                        createVNode(_component_el_input, {
                                          modelValue: unref(currentDialog).customMaxHeight,
                                          "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(currentDialog).customMaxHeight = $event),
                                          placeholder: "最大高度，如：600px、80vh",
                                          style: { "flex": "1" }
                                        }, null, 8, ["modelValue"])
                                      ])
                                    ]),
                                    _: 1
                                  })) : createCommentVNode("", true),
                                  createVNode(_component_el_form_item, { label: "弹层参数" }, {
                                    default: withCtx(() => [
                                      createVNode(ParamsConfig, {
                                        modelValue: unref(currentDialog).dialogParams,
                                        "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => unref(currentDialog).dialogParams = $event)
                                      }, null, 8, ["modelValue"])
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(_component_el_form_item, { label: "弹层类型" }, {
                                    default: withCtx(() => [
                                      createVNode(_component_el_radio_group, {
                                        modelValue: unref(currentDialog).contentSource,
                                        "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(currentDialog).contentSource = $event)
                                      }, {
                                        default: withCtx(() => [
                                          createVNode(_component_el_radio_button, { value: "table" }, {
                                            default: withCtx(() => _cache[39] || (_cache[39] = [
                                              createTextVNode("列表")
                                            ])),
                                            _: 1
                                          }),
                                          createVNode(_component_el_radio_button, { value: "form" }, {
                                            default: withCtx(() => _cache[40] || (_cache[40] = [
                                              createTextVNode("表单")
                                            ])),
                                            _: 1
                                          }),
                                          createVNode(_component_el_radio_button, { value: "tree" }, {
                                            default: withCtx(() => _cache[41] || (_cache[41] = [
                                              createTextVNode("树形")
                                            ])),
                                            _: 1
                                          }),
                                          createVNode(_component_el_radio_button, { value: "component" }, {
                                            default: withCtx(() => _cache[42] || (_cache[42] = [
                                              createTextVNode("组件")
                                            ])),
                                            _: 1
                                          })
                                        ]),
                                        _: 1
                                      }, 8, ["modelValue"])
                                    ]),
                                    _: 1
                                  }),
                                  unref(currentDialog).contentSource === "table" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
                                    createVNode(_component_el_form_item, { label: "列表内容" }, {
                                      default: withCtx(() => [
                                        createVNode(_component_el_radio_group, {
                                          modelValue: unref(currentDialog).tableContent,
                                          "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => unref(currentDialog).tableContent = $event)
                                        }, {
                                          default: withCtx(() => [
                                            createVNode(_component_el_radio_button, { value: "select" }, {
                                              default: withCtx(() => _cache[43] || (_cache[43] = [
                                                createTextVNode("选择列表")
                                              ])),
                                              _: 1
                                            }),
                                            createVNode(_component_el_radio_button, { value: "custom" }, {
                                              default: withCtx(() => _cache[44] || (_cache[44] = [
                                                createTextVNode("自定义")
                                              ])),
                                              _: 1
                                            })
                                          ]),
                                          _: 1
                                        }, 8, ["modelValue"])
                                      ]),
                                      _: 1
                                    }),
                                    unref(currentDialog).tableContent === "select" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                                      createVNode(_component_el_form_item, { label: "选择列表" }, {
                                        default: withCtx(() => [
                                          createVNode(TemplateSelector, {
                                            modelValue: unref(currentDialog).subTableName,
                                            "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => unref(currentDialog).subTableName = $event),
                                            templateKey: unref(currentDialog).subTableKey,
                                            "onUpdate:templateKey": _cache[10] || (_cache[10] = ($event) => unref(currentDialog).subTableKey = $event),
                                            templateId: unref(currentDialog).subTableId,
                                            "onUpdate:templateId": _cache[11] || (_cache[11] = ($event) => unref(currentDialog).subTableId = $event),
                                            templateType: "table",
                                            onConfirm: tableSelectorConfirm
                                          }, null, 8, ["modelValue", "templateKey", "templateId"])
                                        ]),
                                        _: 1
                                      }),
                                      createVNode(_component_el_form_item, { label: "列表模式" }, {
                                        default: withCtx(() => [
                                          createVNode(_component_el_select, {
                                            modelValue: unref(currentDialog).subTableMode,
                                            "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => unref(currentDialog).subTableMode = $event),
                                            clearable: ""
                                          }, {
                                            default: withCtx(() => [
                                              (openBlock(true), createElementBlock(Fragment, null, renderList(unref(tableMode), (mode) => {
                                                return openBlock(), createBlock(_component_el_option, {
                                                  key: mode.key,
                                                  label: mode.name,
                                                  value: mode.key
                                                }, null, 8, ["label", "value"]);
                                              }), 128))
                                            ]),
                                            _: 1
                                          }, 8, ["modelValue"])
                                        ]),
                                        _: 1
                                      })
                                    ], 64)) : createCommentVNode("", true),
                                    unref(currentDialog).tableContent === "custom" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
                                      createVNode(_component_el_form_item, { label: "列配置" }, {
                                        default: withCtx(() => [
                                          createElementVNode("div", _hoisted_9, [
                                            createElementVNode("div", _hoisted_10, [
                                              createVNode(_component_el_button, {
                                                type: "primary",
                                                size: "small",
                                                onClick: addTableCol,
                                                icon: "Plus",
                                                link: ""
                                              }, {
                                                default: withCtx(() => _cache[45] || (_cache[45] = [
                                                  createTextVNode(" 添加列配置 ")
                                                ])),
                                                _: 1
                                              })
                                            ]),
                                            createElementVNode("div", _hoisted_11, [
                                              createVNode(unref(lo), {
                                                modelValue: unref(currentDialog).customTableConfig.fieldsData,
                                                "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => unref(currentDialog).customTableConfig.fieldsData = $event),
                                                animation: 150,
                                                handle: ".drag-handle"
                                              }, {
                                                default: withCtx(() => [
                                                  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(currentDialog).customTableConfig.fieldsData, (col, index) => {
                                                    return openBlock(), createElementBlock("div", {
                                                      key: index,
                                                      class: "col-rule-item"
                                                    }, [
                                                      createElementVNode("div", _hoisted_12, [
                                                        createVNode(_component_el_icon, null, {
                                                          default: withCtx(() => [
                                                            createVNode(unref(rank_default))
                                                          ]),
                                                          _: 1
                                                        })
                                                      ]),
                                                      createVNode(_component_el_input, {
                                                        modelValue: col.label,
                                                        "onUpdate:modelValue": ($event) => col.label = $event,
                                                        size: "small",
                                                        placeholder: "列标题"
                                                      }, null, 8, ["modelValue", "onUpdate:modelValue"]),
                                                      createVNode(_component_el_input, {
                                                        modelValue: col.fieldName,
                                                        "onUpdate:modelValue": ($event) => col.fieldName = $event,
                                                        size: "small",
                                                        placeholder: "字段名"
                                                      }, null, 8, ["modelValue", "onUpdate:modelValue"]),
                                                      createElementVNode("div", _hoisted_13, [
                                                        createVNode(_component_el_popover, {
                                                          placement: "right",
                                                          width: 200,
                                                          trigger: "click"
                                                        }, {
                                                          reference: withCtx(() => [
                                                            createVNode(_component_el_button, {
                                                              icon: unref(edit_default),
                                                              link: "",
                                                              type: "primary",
                                                              class: "edit-btn"
                                                            }, null, 8, ["icon"])
                                                          ]),
                                                          default: withCtx(() => [
                                                            createElementVNode("div", _hoisted_14, [
                                                              createVNode(_component_el_scrollbar, { "wrap-class": "col-property-scrollbar" }, {
                                                                default: withCtx(() => [
                                                                  createVNode(widgets, {
                                                                    column: col,
                                                                    isComp: ""
                                                                  }, null, 8, ["column"])
                                                                ]),
                                                                _: 2
                                                              }, 1024)
                                                            ])
                                                          ]),
                                                          _: 2
                                                        }, 1024),
                                                        createVNode(_component_el_button, {
                                                          icon: unref(delete_default),
                                                          link: "",
                                                          type: "danger",
                                                          class: "delete-btn",
                                                          onClick: ($event) => removeCol(index)
                                                        }, null, 8, ["icon", "onClick"])
                                                      ])
                                                    ]);
                                                  }), 128))
                                                ]),
                                                _: 1
                                              }, 8, ["modelValue"])
                                            ])
                                          ])
                                        ]),
                                        _: 1
                                      }),
                                      createVNode(_component_el_form_item, { label: "主键字段" }, {
                                        default: withCtx(() => [
                                          createVNode(_component_el_input, {
                                            modelValue: unref(currentDialog).customTableConfig.pkFieldName,
                                            "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => unref(currentDialog).customTableConfig.pkFieldName = $event),
                                            placeholder: "请输入主键字段",
                                            clearable: ""
                                          }, null, 8, ["modelValue"])
                                        ]),
                                        _: 1
                                      }),
                                      createVNode(_component_el_form_item, { label: "数据源" }, {
                                        default: withCtx(() => [
                                          createVNode(_sfc_main$1, {
                                            modelValue: unref(currentDialog).customTableConfig.dataSourceId,
                                            "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => unref(currentDialog).customTableConfig.dataSourceId = $event)
                                          }, null, 8, ["modelValue"])
                                        ]),
                                        _: 1
                                      })
                                    ], 64)) : createCommentVNode("", true),
                                    createVNode(_component_el_form_item, { label: "是否翻页" }, {
                                      default: withCtx(() => [
                                        createVNode(_component_el_switch, {
                                          modelValue: unref(currentDialog).isSubTablePagination,
                                          "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => unref(currentDialog).isSubTablePagination = $event)
                                        }, null, 8, ["modelValue"])
                                      ]),
                                      _: 1
                                    }),
                                    createVNode(_component_el_form_item, { label: "是否只读" }, {
                                      default: withCtx(() => [
                                        createVNode(_component_el_switch, {
                                          modelValue: unref(currentDialog).isSubTableReadOnly,
                                          "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => unref(currentDialog).isSubTableReadOnly = $event)
                                        }, null, 8, ["modelValue"])
                                      ]),
                                      _: 1
                                    }),
                                    !unref(currentDialog).isSubTableReadOnly ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
                                      createVNode(_component_el_form_item, { label: "选择模式" }, {
                                        default: withCtx(() => [
                                          createVNode(_component_el_radio_group, {
                                            modelValue: unref(currentDialog).selectionMode,
                                            "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => unref(currentDialog).selectionMode = $event)
                                          }, {
                                            default: withCtx(() => [
                                              createVNode(_component_el_radio_button, { value: "none" }, {
                                                default: withCtx(() => _cache[46] || (_cache[46] = [
                                                  createTextVNode("无")
                                                ])),
                                                _: 1
                                              }),
                                              createVNode(_component_el_radio_button, { value: "single" }, {
                                                default: withCtx(() => _cache[47] || (_cache[47] = [
                                                  createTextVNode("单选")
                                                ])),
                                                _: 1
                                              }),
                                              createVNode(_component_el_radio_button, { value: "multiple" }, {
                                                default: withCtx(() => _cache[48] || (_cache[48] = [
                                                  createTextVNode("多选")
                                                ])),
                                                _: 1
                                              })
                                            ]),
                                            _: 1
                                          }, 8, ["modelValue"])
                                        ]),
                                        _: 1
                                      }),
                                      unref(currentDialog).selectionMode != "none" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                                        createVNode(_component_el_form_item, { label: "选取后反显格式" }, {
                                          default: withCtx(() => [
                                            createVNode(unref(_sfc_main$2), {
                                              title: "反显格式配置",
                                              formulaConf: unref(currentDialog).displayFormat,
                                              "onUpdate:formulaConf": _cache[19] || (_cache[19] = ($event) => unref(currentDialog).displayFormat = $event),
                                              modelValue: unref(currentDialog).displayFormatText,
                                              "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => unref(currentDialog).displayFormatText = $event),
                                              fieldList: unref(tableFields)
                                            }, null, 8, ["formulaConf", "modelValue", "fieldList"])
                                          ]),
                                          _: 1
                                        }),
                                        unref(currentDialog).selectionMode == "single" ? (openBlock(), createBlock(_component_el_form_item, {
                                          key: 0,
                                          label: "行数据全部赋值表单"
                                        }, {
                                          default: withCtx(() => [
                                            createVNode(_component_el_switch, {
                                              modelValue: unref(currentDialog).isRowDataAssignToForm,
                                              "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => unref(currentDialog).isRowDataAssignToForm = $event)
                                            }, null, 8, ["modelValue"])
                                          ]),
                                          _: 1
                                        })) : createCommentVNode("", true),
                                        createVNode(_component_el_form_item, { label: "选取后表单赋值映射" }, {
                                          default: withCtx(() => [
                                            createVNode(FieldSetMapping, {
                                              modelValue: unref(currentDialog).fieldMapping,
                                              "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => unref(currentDialog).fieldMapping = $event),
                                              fieldLabel: "赋值表单字段",
                                              valueLabel: "列表字段",
                                              valueOptions: unref(tableFields),
                                              valueSelectMode: ""
                                            }, null, 8, ["modelValue", "valueOptions"])
                                          ]),
                                          _: 1
                                        })
                                      ], 64)) : createCommentVNode("", true),
                                      createVNode(_component_el_form_item, { label: "回调事件配置" }, {
                                        default: withCtx(() => [
                                          createVNode(OnlyFLowConfigButton, {
                                            config: unref(currentDialog).callbackEventConfig,
                                            onConfirm: handleOnlyFlowConfirm
                                          }, null, 8, ["config"])
                                        ]),
                                        _: 1
                                      })
                                    ], 64)) : createCommentVNode("", true)
                                  ], 64)) : createCommentVNode("", true),
                                  unref(currentDialog).contentSource === "form" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
                                    createVNode(_component_el_form_item, { label: "选择表单" }, {
                                      default: withCtx(() => [
                                        createVNode(TemplateSelector, {
                                          modelValue: unref(currentDialog).subFormName,
                                          "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => unref(currentDialog).subFormName = $event),
                                          templateKey: unref(currentDialog).subFormKey,
                                          "onUpdate:templateKey": _cache[24] || (_cache[24] = ($event) => unref(currentDialog).subFormKey = $event),
                                          templateId: unref(currentDialog).subFormId,
                                          "onUpdate:templateId": _cache[25] || (_cache[25] = ($event) => unref(currentDialog).subFormId = $event),
                                          templateType: "form",
                                          onConfirm: formSelectorConfirm
                                        }, null, 8, ["modelValue", "templateKey", "templateId"])
                                      ]),
                                      _: 1
                                    }),
                                    createVNode(_component_el_form_item, { label: "表单模式" }, {
                                      default: withCtx(() => [
                                        createVNode(_component_el_radio_group, {
                                          modelValue: unref(currentDialog).subFormMode,
                                          "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => unref(currentDialog).subFormMode = $event)
                                        }, {
                                          default: withCtx(() => [
                                            createVNode(_component_el_radio_button, { value: "edit" }, {
                                              default: withCtx(() => _cache[49] || (_cache[49] = [
                                                createTextVNode("编辑")
                                              ])),
                                              _: 1
                                            }),
                                            createVNode(_component_el_radio_button, { value: "query" }, {
                                              default: withCtx(() => _cache[50] || (_cache[50] = [
                                                createTextVNode("查看")
                                              ])),
                                              _: 1
                                            })
                                          ]),
                                          _: 1
                                        }, 8, ["modelValue"])
                                      ]),
                                      _: 1
                                    }),
                                    createVNode(_component_el_form_item, { label: "表单底部按钮" }, {
                                      default: withCtx(() => [
                                        createElementVNode("div", _hoisted_15, [
                                          !unref(formFooterBtn) || unref(formFooterBtn).length === 0 ? (openBlock(), createElementBlock("div", _hoisted_16, " 暂无可用按钮 ")) : (openBlock(), createElementBlock("div", _hoisted_17, [
                                            (openBlock(true), createElementBlock(Fragment, null, renderList(unref(formFooterBtn), (btn) => {
                                              return openBlock(), createBlock(_component_el_checkbox, {
                                                key: btn.id,
                                                "model-value": isButtonSelected(btn.id),
                                                onChange: ($event) => toggleButton(btn)
                                              }, {
                                                default: withCtx(() => [
                                                  createTextVNode(toDisplayString(btn.label), 1)
                                                ]),
                                                _: 2
                                              }, 1032, ["model-value", "onChange"]);
                                            }), 128))
                                          ]))
                                        ])
                                      ]),
                                      _: 1
                                    })
                                  ], 64)) : createCommentVNode("", true),
                                  unref(currentDialog).contentSource === "component" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
                                    createVNode(_component_el_form_item, { label: "组件路由地址" }, {
                                      default: withCtx(() => [
                                        createVNode(_component_el_input, {
                                          modelValue: unref(currentDialog).componentPath,
                                          "onUpdate:modelValue": _cache[27] || (_cache[27] = ($event) => unref(currentDialog).componentPath = $event),
                                          placeholder: "请输入组件路径",
                                          clearable: ""
                                        }, null, 8, ["modelValue"])
                                      ]),
                                      _: 1
                                    }),
                                    createVNode(_component_el_form_item, { label: "组件参数" }, {
                                      default: withCtx(() => [
                                        createVNode(ParamsConfig, {
                                          modelValue: unref(currentDialog).componentParams,
                                          "onUpdate:modelValue": _cache[28] || (_cache[28] = ($event) => unref(currentDialog).componentParams = $event)
                                        }, null, 8, ["modelValue"])
                                      ]),
                                      _: 1
                                    }),
                                    createVNode(_component_el_form_item, { label: "组件是否是弹层" }, {
                                      default: withCtx(() => [
                                        createVNode(_component_el_switch, {
                                          modelValue: unref(currentDialog).componentIsDialog,
                                          "onUpdate:modelValue": _cache[29] || (_cache[29] = ($event) => unref(currentDialog).componentIsDialog = $event)
                                        }, null, 8, ["modelValue"])
                                      ]),
                                      _: 1
                                    })
                                  ], 64)) : createCommentVNode("", true)
                                ]),
                                _: 1
                              }, 8, ["model"])
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  })) : (openBlock(), createElementBlock("div", _hoisted_18, "请从左侧选择一个弹层"))
                ]),
                _: 1
              })
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["modelValue"]);
    };
  }
};
const DialogDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7b357db6"]]);
export {
  DialogDialog as default
};
