告警
This commit is contained in:
parent
2e78d396eb
commit
5c27d9fd68
@ -31,12 +31,7 @@
|
||||
<el-option v-for="v in alarmTypes" :key="v.value" :label="v.label" :value="v.value"></el-option>
|
||||
</el-select>
|
||||
<div style="width: 20px"></div>
|
||||
<el-button
|
||||
:icon="Search"
|
||||
type="primary"
|
||||
@click="paginationOptions.current == 1 ? getalarmsList() : (paginationOptions.current = 1)"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button :loading="isLoading" :icon="Search" type="primary" @click="searchOperate()">查询</el-button>
|
||||
</el-space>
|
||||
</el-header>
|
||||
<el-main class="mainMain">
|
||||
@ -158,6 +153,11 @@ const alarmTypes = ref([
|
||||
{ label: '告警', value: 1 },
|
||||
{ label: '提示', value: 0 },
|
||||
])
|
||||
const isLoading = ref(false)
|
||||
const searchOperate = () => {
|
||||
isLoading.value = true
|
||||
paginationOptions.current == 1 ? getalarmsList() : (paginationOptions.current = 1)
|
||||
}
|
||||
|
||||
const searchalarms = (): GetAlarmsTableParam => {
|
||||
const start = timeRange.value[0]
|
||||
@ -198,6 +198,7 @@ const getalarmsList = () => {
|
||||
const transparams = searchalarms()
|
||||
getAlarmListReq(transparams)
|
||||
.then((res: any) => {
|
||||
isLoading.value = false
|
||||
if (res.code == 200) {
|
||||
paginationOptions.total = res.total
|
||||
alarmsTableData.value = res.rows.map((item: any) => {
|
||||
@ -211,6 +212,7 @@ const getalarmsList = () => {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
isLoading.value = false
|
||||
ElMessage.error(err?.response?.data?.msg ?? '查询失败')
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user