1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<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>