fix(emergency,healthMonitor): 修复通知消息弹窗重复提交问题并优化页面细节
- 为通知消息弹窗的\"保存并发送\"和\"保存\"按钮添加 loading 状态和 disabled 禁用,防止重复提交 - 优化应急管理列表页面和 AED 设备地图页面的代码格式
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
fontSize: props.size ?? '30px',
|
fontSize: props.size ?? '30px',
|
||||||
opacity: 0.5,
|
opacity: 0.5,
|
||||||
transition: 'opacity 0.5s',
|
transition: 'opacity 0.5s',
|
||||||
display: 'none',
|
display: 'block',
|
||||||
});
|
});
|
||||||
|
|
||||||
const bodyStyle = ref({
|
const bodyStyle = ref({
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
/>
|
/>
|
||||||
<div class="bottom-top">
|
<div class="bottom-top">
|
||||||
<div class="top-title"> <img :src="aedP" alt="" /> {{ showWindowInfo?.name }} </div>
|
<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="top-title-describe"> {{ showWindowInfo?.installAddress ? showWindowInfo?.installAddress : '无' }} </div>
|
||||||
<div class="table-list">
|
<div class="table-list">
|
||||||
<div class="label-d"> 设备厂家: </div>
|
<div class="label-d"> 设备厂家: </div>
|
||||||
@@ -411,6 +411,17 @@
|
|||||||
window.open(getFileAccessHttpUrl(v), '_blank');
|
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) {
|
function getName(val, list) {
|
||||||
if (!val && val !== 0) return '';
|
if (!val && val !== 0) return '';
|
||||||
for (let i = 0; i < list.length; i++) {
|
for (let i = 0; i < list.length; i++) {
|
||||||
|
|||||||
@@ -212,17 +212,17 @@
|
|||||||
const [registerTable, { reload, getForm, getDataSource, setTableData }] = tableContext;
|
const [registerTable, { reload, getForm, getDataSource, setTableData }] = tableContext;
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
:deep(.ant-table-cell-fix-left, .ant-table-cell-fix-right) {
|
//:deep(.ant-table-cell-fix-left, .ant-table-cell-fix-right) {
|
||||||
position: relative;
|
// position: relative;
|
||||||
border-bottom: none !important;
|
// //border-bottom: none !important;
|
||||||
|
// border-bottom: 2px solid #f0f0f0 !important;
|
||||||
&:after {
|
// &:after {
|
||||||
position: absolute;
|
// position: absolute;
|
||||||
content: '';
|
// content: '';
|
||||||
width: 100%;
|
// width: 100%;
|
||||||
top: 0;
|
// top: 0;
|
||||||
left: 0;
|
// left: 0;
|
||||||
border-bottom: 1px solid #f0f0f0;
|
// border-bottom: 1px solid #f0f0f0;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+5
-2
@@ -7,8 +7,8 @@
|
|||||||
</BasicForm>
|
</BasicForm>
|
||||||
<template #footer v-if="title !== '查看'">
|
<template #footer v-if="title !== '查看'">
|
||||||
<a-button @click="handleCanel">取消</a-button>
|
<a-button @click="handleCanel">取消</a-button>
|
||||||
<a-button type="primary" @click="handleSubmit(1)">保存并发送</a-button>
|
<a-button type="primary" :loading="submitting" :disabled="submitting" @click="handleSubmit(1)">保存并发送</a-button>
|
||||||
<a-button type="primary" @click="handleSubmit(2)">保存</a-button>
|
<a-button type="primary" :loading="submitting" :disabled="submitting" @click="handleSubmit(2)">保存</a-button>
|
||||||
</template>
|
</template>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
<ChooseSome
|
<ChooseSome
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
// Emits声明
|
// Emits声明
|
||||||
const emit = defineEmits(['register', 'success', 'userData']);
|
const emit = defineEmits(['register', 'success', 'userData']);
|
||||||
const isUpdate = ref(true);
|
const isUpdate = ref(true);
|
||||||
|
const submitting = ref(false);
|
||||||
const [examinationModal, { openDrawer }] = useDrawer();
|
const [examinationModal, { openDrawer }] = useDrawer();
|
||||||
//设置标题
|
//设置标题
|
||||||
const title = ref(String);
|
const title = ref(String);
|
||||||
@@ -100,6 +101,7 @@
|
|||||||
//表单提交事件
|
//表单提交事件
|
||||||
async function handleSubmit(type: number) {
|
async function handleSubmit(type: number) {
|
||||||
try {
|
try {
|
||||||
|
submitting.value = true;
|
||||||
let values = await validate();
|
let values = await validate();
|
||||||
setModalProps({ confirmLoading: true });
|
setModalProps({ confirmLoading: true });
|
||||||
//提交表单
|
//提交表单
|
||||||
@@ -109,6 +111,7 @@
|
|||||||
//刷新列表
|
//刷新列表
|
||||||
emit('success');
|
emit('success');
|
||||||
} finally {
|
} finally {
|
||||||
|
submitting.value = false;
|
||||||
setModalProps({ confirmLoading: false });
|
setModalProps({ confirmLoading: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user