<template>
  <baseDialog v-bind="$attrs">
    <slot name="content"> </slot>
    <slot></slot>
    <template #footer>
      <div class="flex-center">
        <el-button @click="emits('addConfim')" v-if="showPageType.add">{{
          confirmText || "确定新增"
        }}</el-button>
        <el-button
          type="primary"
          @click="emits('editConfim')"
          v-if="showPageType.edit"
          >确认修改</el-button
        >
        <slot name="footer"></slot>
        <el-button type="danger" @click="emits('closeConfirm')">关闭</el-button>
      </div>
    </template>
  </baseDialog>
</template>

<script lang="ts" setup>
import { onMounted } from "vue";
const props = defineProps<{
  /**
   * 根据增删改查的字段控制按钮的显示和隐藏
   */
  showPageType: { [key: string]: boolean };
  confirmText?: string;
}>();
const emits = defineEmits(["addConfim", "editConfim", "closeConfirm"]);
</script>
<style lang="scss" scoped></style>
