17 changed files with 2598 additions and 259 deletions
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,153 @@ |
|||
<template> |
|||
<div v-if="visible" class="radius-dialog"> |
|||
<div class="dialog-content"> |
|||
<div class="dialog-header"> |
|||
<h3>输入半径</h3> |
|||
<div class="close-btn" @click="closeDialog">×</div> |
|||
</div> |
|||
|
|||
<div class="dialog-body"> |
|||
<el-form :model="formData" :rules="rules" ref="formRef" label-width="80px" size="small"> |
|||
<el-form-item label="半径" prop="radius"> |
|||
<el-input-number |
|||
v-model="formData.radius" |
|||
:min="0.1" |
|||
:precision="2" |
|||
placeholder="请输入半径" |
|||
style="width: 100%;" |
|||
></el-input-number> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="单位" prop="unit"> |
|||
<el-radio-group v-model="formData.unit"> |
|||
<el-radio-button label="km">千米</el-radio-button> |
|||
<el-radio-button label="m">米</el-radio-button> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
|
|||
<div class="dialog-footer"> |
|||
<el-button @click="closeDialog">取消</el-button> |
|||
<el-button type="primary" @click="confirmRadius">确定</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'RadiusDialog', |
|||
props: { |
|||
visible: { |
|||
type: Boolean, |
|||
default: false |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
formData: { |
|||
radius: 50, |
|||
unit: 'km' |
|||
}, |
|||
rules: { |
|||
radius: [ |
|||
{ required: true, message: '请输入半径', trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
closeDialog() { |
|||
this.$emit('update:visible', false) |
|||
}, |
|||
confirmRadius() { |
|||
this.$refs.formRef.validate((valid) => { |
|||
if (valid) { |
|||
this.$emit('confirm', { |
|||
radius: this.formData.radius, |
|||
unit: this.formData.unit |
|||
}) |
|||
this.closeDialog() |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.radius-dialog { |
|||
position: fixed; |
|||
top: 0; |
|||
left: 0; |
|||
right: 0; |
|||
bottom: 0; |
|||
z-index: 1000; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
pointer-events: none; |
|||
} |
|||
|
|||
.dialog-content { |
|||
position: relative; |
|||
background: white; |
|||
border-radius: 8px; |
|||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); |
|||
width: 90%; |
|||
max-width: 400px; |
|||
animation: dialog-fade-in 0.3s ease; |
|||
pointer-events: auto; |
|||
} |
|||
|
|||
@keyframes dialog-fade-in { |
|||
from { |
|||
opacity: 0; |
|||
transform: translateY(-20px); |
|||
} |
|||
to { |
|||
opacity: 1; |
|||
transform: translateY(0); |
|||
} |
|||
} |
|||
|
|||
.dialog-header { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
padding: 16px 20px; |
|||
border-bottom: 1px solid #e8e8e8; |
|||
} |
|||
|
|||
.dialog-header h3 { |
|||
margin: 0; |
|||
font-size: 16px; |
|||
font-weight: 600; |
|||
color: #333; |
|||
} |
|||
|
|||
.close-btn { |
|||
font-size: 20px; |
|||
color: #999; |
|||
cursor: pointer; |
|||
transition: color 0.3s; |
|||
} |
|||
|
|||
.close-btn:hover { |
|||
color: #666; |
|||
} |
|||
|
|||
.dialog-body { |
|||
padding: 20px; |
|||
} |
|||
|
|||
.dialog-footer { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: flex-end; |
|||
padding: 16px 20px; |
|||
border-top: 1px solid #e8e8e8; |
|||
gap: 10px; |
|||
} |
|||
</style> |
|||
Loading…
Reference in new issue