fix(emergency,healthMonitor): 修复通知消息弹窗重复提交问题并优化页面细节

- 为通知消息弹窗的\"保存并发送\"和\"保存\"按钮添加 loading 状态和 disabled 禁用,防止重复提交
- 优化应急管理列表页面和 AED 设备地图页面的代码格式
This commit is contained in:
2026-04-01 14:48:34 +08:00
parent a9db38e5e1
commit 4f848e7ce9
4 changed files with 31 additions and 17 deletions
+1 -1
View File
@@ -20,7 +20,7 @@
fontSize: props.size ?? '30px',
opacity: 0.5,
transition: 'opacity 0.5s',
display: 'none',
display: 'block',
});
const bodyStyle = ref({
+12 -1
View File
@@ -40,7 +40,7 @@
/>
<div class="bottom-top">
<div class="top-title"> <img :src="aedP" alt="" /> {{ showWindowInfo?.name }} </div>
<div class="top-title-bottom"> 距离{{ showWindowInfo?.dis ? showWindowInfo?.dis : 0 }}m </div>
<div class="top-title-bottom"> 距离{{ formatDistance(showWindowInfo?.dis) }} </div>
<div class="top-title-describe"> {{ showWindowInfo?.installAddress ? showWindowInfo?.installAddress : '无' }} </div>
<div class="table-list">
<div class="label-d"> 设备厂家 </div>
@@ -411,6 +411,17 @@
window.open(getFileAccessHttpUrl(v), '_blank');
}
/**
* 格式化距离:超过1000米换算为千米,保留两位小数
*/
function formatDistance(dis) {
if (!dis) return '0m';
if (dis >= 1000) {
return (dis / 1000).toFixed(2) + 'km';
}
return dis + 'm';
}
function getName(val, list) {
if (!val && val !== 0) return '';
for (let i = 0; i < list.length; i++) {
@@ -212,17 +212,17 @@
const [registerTable, { reload, getForm, getDataSource, setTableData }] = tableContext;
</script>
<style scoped lang="less">
:deep(.ant-table-cell-fix-left, .ant-table-cell-fix-right) {
position: relative;
border-bottom: none !important;
&:after {
position: absolute;
content: '';
width: 100%;
top: 0;
left: 0;
border-bottom: 1px solid #f0f0f0;
}
}
//:deep(.ant-table-cell-fix-left, .ant-table-cell-fix-right) {
// position: relative;
// //border-bottom: none !important;
// border-bottom: 2px solid #f0f0f0 !important;
// &:after {
// position: absolute;
// content: '';
// width: 100%;
// top: 0;
// left: 0;
// border-bottom: 1px solid #f0f0f0;
// }
//}
</style>
@@ -7,8 +7,8 @@
</BasicForm>
<template #footer v-if="title !== '查看'">
<a-button @click="handleCanel">取消</a-button>
<a-button type="primary" @click="handleSubmit(1)">保存并发送</a-button>
<a-button type="primary" @click="handleSubmit(2)">保存</a-button>
<a-button type="primary" :loading="submitting" :disabled="submitting" @click="handleSubmit(1)">保存并发送</a-button>
<a-button type="primary" :loading="submitting" :disabled="submitting" @click="handleSubmit(2)">保存</a-button>
</template>
</BasicModal>
<ChooseSome
@@ -35,6 +35,7 @@
// Emits声明
const emit = defineEmits(['register', 'success', 'userData']);
const isUpdate = ref(true);
const submitting = ref(false);
const [examinationModal, { openDrawer }] = useDrawer();
//设置标题
const title = ref(String);
@@ -100,6 +101,7 @@
//表单提交事件
async function handleSubmit(type: number) {
try {
submitting.value = true;
let values = await validate();
setModalProps({ confirmLoading: true });
//提交表单
@@ -109,6 +111,7 @@
//刷新列表
emit('success');
} finally {
submitting.value = false;
setModalProps({ confirmLoading: false });
}
}