<template>
    <el-dialog v-model="showModal" title="" width="50rem" class="hc-modal-border" draggable destroy-on-close @closed="cancelClick" style="text-align:center">
        <div class="modalbox">
            <h1 class="fsize">永久性销毁</h1>
            <p class="m20">请确认是否销毁您所勾选的【{{length}}】盒案卷信息，一旦销毁将无法复原</p>

        </div>

        <template #footer>
            <el-alert title="改销毁为物理销毁，后台技术不会存储该数据，一经销毁再也找不回来数据" type="warning" :closable="false"  />
            <div class="dialog-footer" style="margin-top: 20px">
                <el-button size="large" @click="cancelClick">
                    <HcIcon name="close"/>
                    <span>先取消，容我想想</span>
                </el-button>
                <el-button type="primary" hc-btn :loading="isLoading" @click="confirmClick">
                    <HcIcon name="check"/>
                    <span>确认销毁</span>
                </el-button>
            </div>
        </template>
    </el-dialog>
</template>

<script setup>
import {ref, watch} from "vue"
import {useAppStore} from "~src/store";
//import {sendNotice, saveSmsTimeout} from '~api/other';
import config from '~src/config/index';
//参数
const props = defineProps({
    show: {
        type: Boolean,
        default: false
    },
    loading: {
        type: Boolean,
        default: false
    },
    length:{
         type: Number,
        default: 0
    }
})

//变量
const userStore = useAppStore()


const showModal = ref(props.show)
const isLoading = ref(props.loading)

//监听
watch(() => [
    props.show,
    props.loading,
], ([show,  loading, user]) => {
    showModal.value = show
    isLoading.value = loading
})




//事件
// const emit = defineEmits(['cancel', 'confirm'])
const emits = defineEmits(['upshow','comfirmDestory'])
//取消
const cancelClick = () => {
      showModal.value = false
        emits('upshow', false)
}

//确认
const confirmClick = async () => {
    showModal.value = true
    emits('comfirmDestory')
     
}



</script>
<style lang="scss">
.modalbox{
 .m20{
     margin-top: 20px;
 }
 .fsize{
     font-size: 1.25rem;
 }
}
</style>
