| | |
| | | <template> |
| | | <div> |
| | | 预警设置 |
| | | </div> |
| | | <div class="system-warning-container"> |
| | | <el-card shadow="hover"> |
| | | <el-table :data="state.tableData.data" style="width: 100%"> |
| | | <el-table-column align="center" prop="name" label="预警名称"/> |
| | | <el-table-column align="center" prop="threshold" label="连续超过阈值点数"/> |
| | | <el-table-column label="操作" show-overflow-tooltip width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="openDialog('查看', scope.row)">查看</el-button> |
| | | <el-button size="small" text type="primary" @click="openDialog('修改', scope.row)">修改</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | <set-dialog ref="setRef" @getSetData=initSetData></set-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import {reactive, ref, onMounted} from "vue"; |
| | | import { TableDataState } from "/@/types/warning"; |
| | | import setDialog from "./component/setDialog.vue"; |
| | | import { warningSetApi } from "/@/api/warningManage/warningSet"; |
| | | import {ElMessage} from "element-plus/es"; |
| | | |
| | | const setRef = ref(); |
| | | const state = reactive<TableDataState>({ |
| | | tableData: { |
| | | data: [] |
| | | } |
| | | }); |
| | | //页面加载 |
| | | onMounted(() => { |
| | | initSetData(); |
| | | }); |
| | | |
| | | const initSetData = async () => { |
| | | let res = await warningSetApi().getWarnSetPage({}); |
| | | if(res.data.code == 100) { |
| | | state.tableData.data = res.data.data; |
| | | }else { |
| | | ElMessage({ |
| | | type: 'error', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | const openDialog = (type: string, value: any) => { |
| | | setRef.value.openDialog(type, value); |
| | | }; |
| | | </script> |
| | | |
| | | |
| | | |
| | | <style scoped lang="scss"> |
| | | |
| | | </style> |