<template>
|
<el-drawer
|
v-model="drawer"
|
size="60%"
|
title="历史详情"
|
direction="rtl"
|
:before-close="handleClose"
|
>
|
<!-- 搜索工作栏 -->
|
<el-form
|
class="-mb-15px"
|
:model="queryParams"
|
ref="queryFormRef"
|
:inline="true"
|
label-width="68px"
|
>
|
<el-form-item label="消息标题" prop="title">
|
<el-input
|
v-model="queryParams.title"
|
placeholder="请输入消息标题"
|
clearable
|
class="!w-240px"
|
/>
|
</el-form-item>
|
<el-form-item label="监控对象" prop="alarmObj">
|
<el-input
|
v-model="queryParams.alarmObj"
|
placeholder="请输入监控对象"
|
clearable
|
class="!w-240px"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-button @click="handleQuery">
|
<Icon icon="ep:search" class="mr-5px"/>
|
搜索
|
</el-button>
|
<el-button @click="resetQuery">
|
<Icon icon="ep:refresh" class="mr-5px"/>
|
重置
|
</el-button>
|
</el-form-item>
|
</el-form>
|
<!-- 列表 -->
|
<el-table
|
v-loading="loading"
|
:data="list"
|
row-key="id"
|
>
|
<el-table-column prop="title" label="消息标题" header-align="center" align="left" min-width="150"/>
|
<el-table-column prop="content" label="消息内容" header-align="center" align="left" min-width="200"/>
|
<el-table-column prop="alarmObj" label="监控对象" align="left" min-width="150"/>
|
<el-table-column prop="alarmType" label="预警类型" align="left" min-width="150"/>
|
<el-table-column prop="alarmTime" label="预警时间" align="left" min-width="150"/>
|
</el-table>
|
<!-- 分页 -->
|
<Pagination
|
v-model:limit="queryParams.limit"
|
v-model:page="queryParams.page"
|
:total="total"
|
@pagination="getList"
|
/>
|
</el-drawer>
|
</template>
|
<script lang="ts" setup>
|
import * as MmPredictAlarmMessage from '@/api/model/pre/alarm/message'
|
|
defineOptions({name: 'ChartParam'})
|
|
const drawer = ref(false)
|
const loading = ref(false) // 列表的加载中
|
const total = ref(0) // 列表的总页数
|
const list = ref([]) // 字典表格数据
|
const queryParams = reactive({
|
page: 1,
|
limit: 10,
|
configId: undefined,
|
title: undefined,
|
content: undefined,
|
alarmObj: undefined,
|
pointId: undefined,
|
itemId: undefined,
|
outId: undefined,
|
currentValue: undefined,
|
outTime: undefined,
|
outValue: undefined,
|
alarmType: undefined,
|
alarmTime: undefined,
|
createTime: undefined,
|
})
|
const queryFormRef = ref() // 搜索的表单
|
|
const getList = async () => {
|
loading.value = true
|
try {
|
const data = await MmPredictAlarmMessage.getMmPredictAlarmMessagePage(queryParams)
|
list.value = data.list
|
total.value = data.total
|
} finally {
|
loading.value = false
|
}
|
}
|
|
/** 打开弹窗 */
|
const open = async (configId?: string) => {
|
resetForm()
|
drawer.value = true
|
queryParams.configId = configId
|
if (configId) {
|
getList()
|
}
|
}
|
defineExpose({open}) // 提供 open 方法,用于打开弹窗
|
|
/** 重置表单 */
|
const resetForm = () => {
|
queryParams.title = undefined
|
queryParams.pointId = undefined
|
}
|
|
/** 搜索按钮操作 */
|
const handleQuery = () => {
|
getList()
|
}
|
|
/** 重置按钮操作 */
|
const resetQuery = () => {
|
queryFormRef.value.resetFields()
|
handleQuery()
|
}
|
|
const handleClose = (done: () => void) => {
|
drawer.value = false
|
}
|
</script>
|