提交 | 用户 | 时间
|
ebc552
|
1 |
<template> |
L |
2 |
<el-drawer |
|
3 |
v-model="drawer" |
|
4 |
size="60%" |
|
5 |
title="历史详情" |
|
6 |
direction="rtl" |
|
7 |
:before-close="handleClose" |
|
8 |
> |
|
9 |
<!-- 搜索工作栏 --> |
|
10 |
<el-form |
|
11 |
class="-mb-15px" |
|
12 |
:model="queryParams" |
|
13 |
ref="queryFormRef" |
|
14 |
:inline="true" |
|
15 |
label-width="68px" |
|
16 |
> |
|
17 |
<el-form-item label="消息标题" prop="title"> |
|
18 |
<el-input |
|
19 |
v-model="queryParams.title" |
|
20 |
placeholder="请输入消息标题" |
|
21 |
clearable |
|
22 |
class="!w-240px" |
|
23 |
/> |
|
24 |
</el-form-item> |
|
25 |
<el-form-item label="监控对象" prop="alarmObj"> |
|
26 |
<el-input |
|
27 |
v-model="queryParams.alarmObj" |
|
28 |
placeholder="请输入监控对象" |
|
29 |
clearable |
|
30 |
class="!w-240px" |
|
31 |
/> |
|
32 |
</el-form-item> |
|
33 |
<el-form-item> |
|
34 |
<el-button @click="handleQuery"> |
|
35 |
<Icon icon="ep:search" class="mr-5px"/> |
|
36 |
搜索 |
|
37 |
</el-button> |
|
38 |
<el-button @click="resetQuery"> |
|
39 |
<Icon icon="ep:refresh" class="mr-5px"/> |
|
40 |
重置 |
|
41 |
</el-button> |
|
42 |
</el-form-item> |
|
43 |
</el-form> |
|
44 |
<!-- 列表 --> |
|
45 |
<el-table |
|
46 |
v-loading="loading" |
|
47 |
:data="list" |
|
48 |
row-key="id" |
|
49 |
> |
|
50 |
<el-table-column prop="title" label="消息标题"/> |
|
51 |
<el-table-column prop="content" label="消息内容"/> |
|
52 |
<el-table-column prop="alarmObj" label="监控对象"/> |
|
53 |
<el-table-column prop="pointId" label="监控点位"/> |
|
54 |
<el-table-column prop="itemId" label="预测项"/> |
|
55 |
<el-table-column prop="outId" label="输出"/> |
|
56 |
<el-table-column prop="currentValue" label="当前值"/> |
|
57 |
<el-table-column prop="outTime" label="超出时间"/> |
|
58 |
<el-table-column prop="outValue" label="超出值"/> |
|
59 |
<el-table-column prop="alarmType" label="预警类型"/> |
|
60 |
<el-table-column prop="alarmTime" label="预警时间"/> |
|
61 |
<el-table-column prop="createTime" label="创建时间"/> |
|
62 |
</el-table> |
|
63 |
<!-- 分页 --> |
|
64 |
<Pagination |
|
65 |
v-model:limit="queryParams.limit" |
|
66 |
v-model:page="queryParams.page" |
|
67 |
:total="total" |
|
68 |
@pagination="getList" |
|
69 |
/> |
|
70 |
</el-drawer> |
|
71 |
</template> |
|
72 |
<script lang="ts" setup> |
|
73 |
import * as MmPredictAlarmMessage from '@/api/model/pre/alarm/message' |
|
74 |
|
|
75 |
defineOptions({name: 'ChartParam'}) |
|
76 |
|
|
77 |
const drawer = ref(false) |
|
78 |
const loading = ref(false) // 列表的加载中 |
|
79 |
const total = ref(0) // 列表的总页数 |
|
80 |
const list = ref([]) // 字典表格数据 |
|
81 |
const queryParams = reactive({ |
|
82 |
page: 1, |
|
83 |
limit: 10, |
|
84 |
configId: undefined, |
|
85 |
title: undefined, |
|
86 |
content: undefined, |
|
87 |
alarmObj: undefined, |
|
88 |
pointId: undefined, |
|
89 |
itemId: undefined, |
|
90 |
outId: undefined, |
|
91 |
currentValue: undefined, |
|
92 |
outTime: undefined, |
|
93 |
outValue: undefined, |
|
94 |
alarmType: undefined, |
|
95 |
alarmTime: undefined, |
|
96 |
createTime: undefined, |
|
97 |
}) |
|
98 |
const queryFormRef = ref() // 搜索的表单 |
|
99 |
|
|
100 |
const getList = async () => { |
|
101 |
loading.value = true |
|
102 |
try { |
|
103 |
const data = await MmPredictAlarmMessage.getMmPredictAlarmMessagePage(queryParams) |
|
104 |
list.value = data.list |
|
105 |
total.value = data.total |
|
106 |
} finally { |
|
107 |
loading.value = false |
|
108 |
} |
|
109 |
} |
|
110 |
|
|
111 |
/** 打开弹窗 */ |
|
112 |
const open = async (configId?: string) => { |
|
113 |
resetForm() |
|
114 |
drawer.value = true |
|
115 |
queryParams.configId = configId |
|
116 |
if (configId) { |
|
117 |
getList() |
|
118 |
} |
|
119 |
} |
|
120 |
defineExpose({open}) // 提供 open 方法,用于打开弹窗 |
|
121 |
|
|
122 |
/** 重置表单 */ |
|
123 |
const resetForm = () => { |
|
124 |
queryParams.title = undefined |
|
125 |
queryParams.pointId = undefined |
|
126 |
} |
|
127 |
|
|
128 |
/** 搜索按钮操作 */ |
|
129 |
const handleQuery = () => { |
|
130 |
getList() |
|
131 |
} |
|
132 |
|
|
133 |
/** 重置按钮操作 */ |
|
134 |
const resetQuery = () => { |
|
135 |
queryFormRef.value.resetFields() |
|
136 |
handleQuery() |
|
137 |
} |
|
138 |
|
|
139 |
const handleClose = (done: () => void) => { |
|
140 |
drawer.value = false |
|
141 |
} |
|
142 |
</script> |