소스 검색

最新代码

like 6 달 전
부모
커밋
7e2e7f4d91

+ 5 - 0
snowy-admin-web/src/api/coldchain/alarmUserApi.js

@@ -13,6 +13,11 @@ export default {
 	alarmUserPage(data) {
 		return request('page', data, 'get')
 	},
+
+	alarmUserList(data) {
+		return request('list', data, 'get')
+	},
+
 	// 提交报警接收人表单 edit为true时为编辑,默认为新增
 	alarmUserSubmitForm(data, edit = false) {
 		return request(edit ? 'edit' : 'add', data)

+ 42 - 19
snowy-admin-web/src/components/HomeCard/SysWarningCard/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<div class="home_count">
 		<div class="warning-title">
-			<div>通知列表</div>
+			<div>告警列表</div>
 			<a-button type="link" @click="leaveFor('/motoring/report')">更多</a-button>
 		</div>
 		<a-table
@@ -15,7 +15,7 @@
 		>
 			<template #bodyCell="{ column, record }">
 				<template v-if="column.dataIndex === 'action'">
-					<a-button type="link" size="small" @click="handlerEdit(record)">编辑</a-button>
+					<!-- <a-button type="link" size="small" @click="handlerEdit(record)">编辑</a-button> -->
 					<a-divider type="vertical" />
 					<a-popconfirm title="删除此数据?" @confirm="deleteData(record)">
 						<a-button type="link" danger size="small">删除</a-button>
@@ -36,54 +36,77 @@
 	import router from '@/router'
 	const columns = ref([
 		{
-			title: '通知标题',
-			dataIndex: 'title',
+			title: '序号',
+			dataIndex: 'index',
+			align: 'center',
+			width: 50
+		},
+		{
+			title: '告警来源',
+			dataIndex: 'source',
 			align: 'center',
 			ellipsis: true,
 			resizable: true
 		},
+
 		{
-			title: '通知类型',
-			dataIndex: 'type',
+			title: '告警优先级',
+			dataIndex: 'priority',
 			align: 'center',
 			ellipsis: true,
 			resizable: true,
-			customRender({ value }) {
-				return value == '1' ? '系统' : '预警'
-			}
+			width: 100
 		},
 		{
-			title: '通知内容',
-			dataIndex: 'content',
+			title: '告警类型',
+			dataIndex: 'alarmType',
 			align: 'center',
 			ellipsis: true,
 			resizable: true
 		},
 		{
-			title: '传感器路数',
-			dataIndex: 'sensorRoute',
+			title: '告警内容',
+			dataIndex: 'message',
+			align: 'center',
+			ellipsis: true,
+			resizable: true,
+			width: 500
+		},
+		{
+			title: '告警值',
+			dataIndex: 'value',
+			align: 'center',
+			ellipsis: true,
+			resizable: true,
+			width: 80
+		},
+		{
+			title: '告警接收人',
+			dataIndex: 'alarmUsers',
 			align: 'center',
 			ellipsis: true,
 			resizable: true
 		},
 		{
-			title: '创建人',
-			dataIndex: 'createUserName',
+			title: '告警处理状态',
+			dataIndex: 'status',
 			align: 'center',
 			ellipsis: true,
 			resizable: true
 		},
 		{
-			title: '创建时间',
-			dataIndex: 'createTime',
+			title: '告警时间',
+			dataIndex: 'alarmTime',
 			align: 'center',
 			ellipsis: true,
 			resizable: true
 		},
 		{
 			title: '操作',
-			dataIndex: 'action',
-			align: 'center'
+			dataIndex: 'options',
+			align: 'center',
+			ellipsis: true,
+			resizable: true
 		}
 	])
 	const dataSource = ref([])

+ 20 - 0
snowy-admin-web/src/views/biz/monitor/object/form.vue

@@ -22,6 +22,16 @@
 					<a-select-option value="2">停用</a-select-option>
 				</a-select>
 			</a-form-item>
+			<a-form-item label="报警接收人" name="alarmUsers">
+				<a-select
+					v-model:value="formData.alarmUsers"
+					mode="multiple"
+					style="width: 100%"
+					placeholder="请选择报警接收人"
+					:options="alarmUsersOptions"
+					:field-names="{ label: 'userName', value: 'openId' }"
+				></a-select>
+			</a-form-item>
 			<a-form-item label="监测位置区域">
 				<a-input v-model:value="formData.monitorPoint" placeholder="请输入监测位置区域" allow-clear />
 			</a-form-item>
@@ -37,6 +47,8 @@
 <script setup>
 	import { required } from '@/utils/formRules'
 	import setupApi from '@/api/basicset/setupApi'
+	import alarmUserApi from '@/api/coldchain/alarmUserApi'
+	const alarmUsersOptions = ref([]) // 报警接收人数据
 
 	// 默认是关闭状态
 	const visible = ref(false)
@@ -47,6 +59,7 @@
 	const formRules = {
 		name: [required('请输入对象名称')],
 		status: [required('请选择对象状态')]
+		// alarmUsers: [required('请选择报警接收人')]
 	}
 
 	// 表单数据
@@ -54,6 +67,7 @@
 
 	// 打开抽屉
 	const onOpen = (record) => {
+		setalarmUsersData()
 		visible.value = true
 		if (record) {
 			formData.value = Object.assign({}, record)
@@ -61,6 +75,12 @@
 			formData.value = { status: '1' }
 		}
 	}
+	//获取报警接收人的数据
+	const setalarmUsersData = () => {
+		alarmUserApi.alarmUserList().then((res) => {
+			alarmUsersOptions.value = res || []
+		})
+	}
 	// 关闭抽屉
 	const onClose = () => {
 		formRef.value.resetFields()

+ 7 - 5
snowy-admin-web/src/views/motoring/report/initData.js

@@ -25,7 +25,8 @@ export const initColumns = [
 		dataIndex: 'priority',
 		align: 'center',
 		ellipsis: true,
-		resizable: true
+		resizable: true,
+		width: 100
 	},
 	{
 		title: '告警类型',
@@ -40,14 +41,15 @@ export const initColumns = [
 		align: 'center',
 		ellipsis: true,
 		resizable: true,
-		width: 200
+		width: 500
 	},
 	{
 		title: '告警值',
 		dataIndex: 'value',
 		align: 'center',
 		ellipsis: true,
-		resizable: true
+		resizable: true,
+		width: 80
 	},
 	{
 		title: '告警接收人',
@@ -57,8 +59,8 @@ export const initColumns = [
 		resizable: true
 	},
 	{
-		title: '创建人',
-		dataIndex: 'createUserName',
+		title: '告警处理状态',
+		dataIndex: 'status',
 		align: 'center',
 		ellipsis: true,
 		resizable: true