<template>
  <vxe-modal
    v-model="showEdit"
    :z-index="1006"
    @hide="onHide"
    title="检查信息"
    width="800"
    esc-closable
    mask-closable
    show-footer
  >
    <div class="h-[400px] overflow-auto">
      共计：{{ errors.length }} 条错误！
      <el-alert style="margin-bottom: 4px;" v-for="(err,index) in errors" :key="index" :title="err" type="error" show-icon :closable="false" />
    </div>

    <template #footer>
      <el-button type="primary" @click="showEdit = false">关闭</el-button>
    </template>
  </vxe-modal>
</template>

<script lang="ts" setup>
import { ref } from 'vue'

const showEdit = ref(false)
const errors = ref([])

const onHide = () => {
  errors.value = []
}
const openModal = (errs) => {
  showEdit.value = true
  errors.value = errs || []
}

defineExpose({
  openModal
})
</script>
<style lang="scss" scoped></style>
