2026-03-30 10:57:32 +08:00
|
|
|
<template>
|
2026-04-21 15:34:43 +08:00
|
|
|
<div v-if="visible" class="confirm-dialog-overlay" @click="handleOverlayClick">
|
2026-03-30 10:57:32 +08:00
|
|
|
<div class="confirm-dialog" @click.stop>
|
2026-04-03 18:08:42 +08:00
|
|
|
<!-- 四个角的装饰 -->
|
|
|
|
|
<div class="corner corner-top-left"></div>
|
|
|
|
|
<div class="corner corner-top-right"></div>
|
|
|
|
|
<div class="corner corner-bottom-left"></div>
|
|
|
|
|
<div class="corner corner-bottom-right"></div>
|
2026-03-30 10:57:32 +08:00
|
|
|
<!-- 标题栏 -->
|
|
|
|
|
<div class="dialog-header">
|
|
|
|
|
<div class="header-title">{{ title }}</div>
|
|
|
|
|
<div class="close-btn" @click="handleCancel">
|
|
|
|
|
<el-icon><Close /></el-icon>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 提示内容 -->
|
|
|
|
|
<div class="dialog-content">
|
|
|
|
|
<p class="confirm-message">{{ message }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 按钮区域 -->
|
|
|
|
|
<div class="dialog-footer">
|
2026-04-03 18:08:42 +08:00
|
|
|
<el-button type="primary" class="btn-confirm" @click="handleCancel">
|
2026-03-30 10:57:32 +08:00
|
|
|
{{ cancelText }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="primary" class="btn-confirm" @click="handleConfirm">
|
|
|
|
|
{{ confirmText }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2026-04-21 15:34:43 +08:00
|
|
|
import { Close } from '@element-plus/icons-vue';
|
2026-03-30 10:57:32 +08:00
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
visible: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
|
|
|
|
title: {
|
|
|
|
|
type: String,
|
2026-04-21 15:34:43 +08:00
|
|
|
default: '提示',
|
2026-03-30 10:57:32 +08:00
|
|
|
},
|
|
|
|
|
message: {
|
|
|
|
|
type: String,
|
2026-04-21 15:34:43 +08:00
|
|
|
default: '',
|
2026-03-30 10:57:32 +08:00
|
|
|
},
|
|
|
|
|
confirmText: {
|
|
|
|
|
type: String,
|
2026-04-21 15:34:43 +08:00
|
|
|
default: '已拨打',
|
2026-03-30 10:57:32 +08:00
|
|
|
},
|
|
|
|
|
cancelText: {
|
|
|
|
|
type: String,
|
2026-04-21 15:34:43 +08:00
|
|
|
default: '未拨打',
|
2026-03-30 10:57:32 +08:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2026-04-21 15:34:43 +08:00
|
|
|
const emit = defineEmits(['update:visible', 'confirm', 'cancel']);
|
2026-03-30 10:57:32 +08:00
|
|
|
|
|
|
|
|
// 确认
|
|
|
|
|
const handleConfirm = () => {
|
2026-04-21 15:34:43 +08:00
|
|
|
emit('confirm');
|
|
|
|
|
emit('update:visible', false);
|
2026-03-30 10:57:32 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 取消
|
|
|
|
|
const handleCancel = () => {
|
2026-04-21 15:34:43 +08:00
|
|
|
emit('cancel');
|
|
|
|
|
emit('update:visible', false);
|
2026-03-30 10:57:32 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 点击遮罩关闭
|
|
|
|
|
const handleOverlayClick = () => {
|
|
|
|
|
handleCancel();
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.confirm-dialog-overlay {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
background-color: rgba(0, 0, 0, 0.6);
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
z-index: 2200;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.confirm-dialog {
|
2026-04-02 16:35:45 +08:00
|
|
|
width: 80vw;
|
2026-04-03 18:08:42 +08:00
|
|
|
max-width: 300px;
|
2026-04-21 15:34:43 +08:00
|
|
|
background: linear-gradient(135deg, rgba(20, 50, 90, 0.95) 0%, rgba(10, 30, 60, 0.98) 100%);
|
2026-03-30 10:57:32 +08:00
|
|
|
border: 1px solid rgba(64, 169, 255, 0.3);
|
|
|
|
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
|
|
|
|
overflow: hidden;
|
2026-04-02 16:35:45 +08:00
|
|
|
animation: dialogSlideIn 0.3s ease-out;
|
2026-04-03 18:08:42 +08:00
|
|
|
position: relative;
|
2026-04-02 16:35:45 +08:00
|
|
|
|
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
width: 90vw;
|
|
|
|
|
max-width: 90vw;
|
|
|
|
|
}
|
2026-04-03 18:08:42 +08:00
|
|
|
// 四个角的装饰
|
|
|
|
|
.corner {
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 20px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
border: 1px solid #40a9ff;
|
|
|
|
|
z-index: 100;
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
|
|
|
|
|
&.corner-top-left {
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
border-right: none;
|
|
|
|
|
border-bottom: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.corner-top-right {
|
|
|
|
|
top: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
border-left: none;
|
|
|
|
|
border-bottom: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.corner-bottom-left {
|
|
|
|
|
bottom: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
border-right: none;
|
|
|
|
|
border-top: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.corner-bottom-right {
|
|
|
|
|
bottom: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
border-left: none;
|
|
|
|
|
border-top: none;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-02 16:35:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@keyframes dialogSlideIn {
|
|
|
|
|
from {
|
|
|
|
|
opacity: 0;
|
|
|
|
|
transform: scale(0.8) translateY(-50px);
|
|
|
|
|
}
|
|
|
|
|
to {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
transform: scale(1) translateY(0);
|
|
|
|
|
}
|
2026-03-30 10:57:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 标题栏
|
|
|
|
|
.dialog-header {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 12px 16px;
|
2026-04-21 15:34:43 +08:00
|
|
|
background: linear-gradient(90deg, rgba(64, 169, 255, 0.15) 0%, rgba(64, 169, 255, 0.05) 100%);
|
2026-03-30 10:57:32 +08:00
|
|
|
border-bottom: 1px solid rgba(64, 169, 255, 0.2);
|
|
|
|
|
|
|
|
|
|
.header-title {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #fff;
|
2026-04-02 16:35:45 +08:00
|
|
|
flex: 1;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
white-space: nowrap;
|
2026-03-30 10:57:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.close-btn {
|
2026-04-02 16:35:45 +08:00
|
|
|
width: 19px;
|
|
|
|
|
height: 19px;
|
2026-03-30 10:57:32 +08:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
color: rgba(255, 255, 255, 0.6);
|
|
|
|
|
cursor: pointer;
|
2026-04-02 16:35:45 +08:00
|
|
|
font-size: 13px;
|
2026-03-30 10:57:32 +08:00
|
|
|
transition: color 0.3s;
|
2026-04-02 16:35:45 +08:00
|
|
|
flex-shrink: 0;
|
2026-03-30 10:57:32 +08:00
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 内容区域
|
|
|
|
|
.dialog-content {
|
|
|
|
|
padding: 24px 20px;
|
|
|
|
|
text-align: center;
|
2026-04-02 16:35:45 +08:00
|
|
|
max-height: 40vh;
|
|
|
|
|
overflow-y: auto;
|
2026-03-30 10:57:32 +08:00
|
|
|
|
|
|
|
|
.confirm-message {
|
2026-04-02 16:35:45 +08:00
|
|
|
font-size: 16px;
|
2026-03-30 10:57:32 +08:00
|
|
|
color: rgba(255, 255, 255, 0.9);
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
margin: 0;
|
2026-04-02 16:35:45 +08:00
|
|
|
word-wrap: break-word;
|
|
|
|
|
word-break: break-all;
|
2026-03-30 10:57:32 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 按钮区域
|
|
|
|
|
.dialog-footer {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
gap: 16px;
|
|
|
|
|
padding: 0 20px 20px;
|
2026-04-02 16:35:45 +08:00
|
|
|
flex-wrap: wrap;
|
2026-03-30 10:57:32 +08:00
|
|
|
|
|
|
|
|
.btn-cancel {
|
|
|
|
|
min-width: 80px;
|
2026-04-02 16:35:45 +08:00
|
|
|
height: 26px;
|
|
|
|
|
padding: 0 16px;
|
2026-03-30 10:57:32 +08:00
|
|
|
background-color: transparent;
|
|
|
|
|
border: 1px solid rgba(64, 169, 255, 0.4);
|
|
|
|
|
color: rgba(255, 255, 255, 0.8);
|
2026-04-02 16:35:45 +08:00
|
|
|
font-size: 10px;
|
2026-03-30 10:57:32 +08:00
|
|
|
border-radius: 4px;
|
|
|
|
|
transition: all 0.3s;
|
2026-04-02 16:35:45 +08:00
|
|
|
flex: 1;
|
|
|
|
|
min-flex: 64px;
|
2026-03-30 10:57:32 +08:00
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
background-color: rgba(64, 169, 255, 0.1);
|
|
|
|
|
border-color: rgba(64, 169, 255, 0.6);
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-confirm {
|
|
|
|
|
min-width: 80px;
|
2026-04-02 16:35:45 +08:00
|
|
|
height: 26px;
|
|
|
|
|
padding: 0 16px;
|
2026-03-30 10:57:32 +08:00
|
|
|
background: linear-gradient(135deg, #40a9ff 0%, #1890ff 100%);
|
|
|
|
|
border: none;
|
|
|
|
|
color: #fff;
|
2026-04-02 16:35:45 +08:00
|
|
|
font-size: 10px;
|
2026-03-30 10:57:32 +08:00
|
|
|
border-radius: 4px;
|
|
|
|
|
transition: all 0.3s;
|
2026-04-02 16:35:45 +08:00
|
|
|
flex: 1;
|
|
|
|
|
min-flex: 64px;
|
2026-03-30 10:57:32 +08:00
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
background: linear-gradient(135deg, #69c0ff 0%, #40a9ff 100%);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|