1
0
forked from dyf/dyf-vue-ui

报警列表卡片,模式页面布局修改,估计播放,优化体验

This commit is contained in:
fengerli
2025-08-30 14:45:55 +08:00
parent e07a4fea01
commit 031f6135c1
18 changed files with 1302 additions and 392 deletions

View File

@ -27,8 +27,8 @@
:loading-text="forceAlarmLoading ? '报警中...' : '强制报警'"> {{
forceAlarmLoading ? '报警中' : '强制报警' }}</el-button>
<div style="position: absolute; right:30px; top:20px">
<el-input v-model="queryParams.deviceMac" placeholder="MAC/IMEI" clearable
style="width: 200px; margin-right: 20px;" />
<el-input v-model="queryParams.content" placeholder="MAC/IMEI" clearable
style="width: 200px; margin-right: 20px;" @keyup.enter="handleQuery" @input="handleInput" />
<el-button type="primary" plain @click="toggleFilter">高级筛选</el-button>
</div>
@ -171,6 +171,7 @@ const deviceTypeOptions = ref([]); //设备类型
const enabledDeptOptions = ref();
const forceAlarmLoading = ref(false) //强制报警
const sendTextLoading = ref(false)
const debounceTimer = ref(null) // 用于防抖的定时器
const form = ref({
messageToSend: ''
})
@ -186,7 +187,8 @@ const initData: PageData<'', deviceQuery> = {
personnelBy: '',
communicationMode: '',
groupId: '',
deviceType: ''
deviceType: '',
content: ''
},
rules: undefined,
form: ''
@ -258,7 +260,15 @@ const handleNodeClick = (data: any) => {
queryParams.value.groupId = data.id;
handleQuery();
};
const handleInput = () => {
if (debounceTimer.value) {
clearTimeout(debounceTimer.value)
}
// 300ms后执行查询避免输入过程中频繁调用接口
debounceTimer.value = setTimeout(() => {
handleQuery() // 调用查询接口的方法
}, 300)
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
@ -363,10 +373,11 @@ const submitForm = async () => {
return
}
// 4. 获取设备状态
// 获取实时状态类型:FunctionAccessBatchstatusRule 批量 ,FunctionAccessStatusRule 单个
const statusRes = await getDeviceStatus({
functionMode: 2,
batchId,
typeName,
typeName: 'FunctionAccessBatchStatusRule',
deviceImeiList,
deviceIds,
interval: 500
@ -423,7 +434,7 @@ const forceAlarm = async () => {
const statusRes = await getDeviceStatus({
functionMode: 2,
batchId,
typeName,
typeName: 'FunctionAccessBatchStatusRule',
deviceImeiList,
deviceIds,
interval: 500