index.vue 2.93 KB
<template>
<!--  <el-dialog-->
<!--      v-model="dialogVisible"-->
<!--      title="提示"-->
<!--      align-center-->
<!--      width="400px"-->
<!--  >-->
<!--    <template #content>-->
<!--      <div style="display: flex; align-items: center;">-->
<!--        <el-icon style="color: orange; font-size: 18px; margin: 5px"><WarningFilled /></el-icon>-->
<!--        <div style="font-size: 14px">{{ prompt }}</div>-->
<!--      </div>-->
<!--    </template>-->
<!--    <template #footer>-->
<!--      <div style="margin-top: 10px">-->
<!--        <el-button @click="cancel">取消</el-button>-->
<!--        <el-button type="primary" @click="confirm">确认</el-button>-->
<!--      </div>-->
<!--    </template>-->
<!--  </el-dialog>-->

  <el-dialog
      class="my_dialog__header_deep"
      v-model="dialogVisible"

      align-center
      :before-close="cancel"
      style="width: 420px;height: 195px;margin-top: 300px" :fullscreen="true"
  >
    <template #header>
      <div style="display: flex;">
        <div>{{cn.reminder}}</div>
        <div>{{en.reminder}}</div>
      </div>
    </template>
    <div style="display: flex;flex-direction: column">
     <div style="display: flex;" >
       <el-icon style="color: orange;font-size: 18px;margin-right: 12px"><WarningFilled /></el-icon>
       <div class="contentText" style="font-size: 14px">{{ content }}</div>
     </div>
      <div style="display: flex;" >
        <div class="contentText" style="font-size: 14px">{{ englishContent }}</div>
      </div>
    </div>
    <template #footer>
      <div style="margin-top: 10px">
        <el-button class="btn-B" @click="cancel">{{cn.cancel}}{{en.cancel}}</el-button>
        <el-button class="btn-A" @click="confirm">{{cn.confirm}}{{en.confirm}}</el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script setup>
import { ref, defineProps, defineEmits, watch } from 'vue';
import { WarningFilled } from '@element-plus/icons-vue';
import en from '@/locales/Delectdialog/en.json';
import cn from '@/locales/Delectdialog/cn.json';
const props = defineProps({
  visible: {
    type: Boolean,
    default: false
  },
  content: {
    type: String,
    default: '确定删除该项目吗?'
  },
  englishContent: {
    type: String,
    default: 'Are you sure to delete this project?'
  },
});

const emits = defineEmits(['confirm', 'cancel']);

const dialogVisible = ref(props.visible);

// 监听 visible 属性变化,更新对话框显示状态
watch(() => props.visible, (newValue) => {
  dialogVisible.value = newValue;
});

const confirm = () => {
  emits('confirm');

};

const cancel = () => {
  emits('cancel');

};
</script>
<style lang="scss">
.my_dialog__header_deep{
  .el-dialog__header.show-close{
    background-color: #ffffff;
  }
  .el-dialog__header.show-close{
    padding: 14px 18px;
  }
  .el-dialog__body{
    padding: 20px;
  }
  .el-dialog__footer{
    padding: 0;
    margin: 14px;
  }
}
.contentText{
  font-size: 14px;
  color: #5B6373;
}
</style>