diff --git a/web/client/src/sections/install/containers/roles.jsx b/web/client/src/sections/install/containers/roles.jsx index 08227fc..95a0f86 100644 --- a/web/client/src/sections/install/containers/roles.jsx +++ b/web/client/src/sections/install/containers/roles.jsx @@ -56,7 +56,7 @@ const Roles = (props) => { let anxinerror = false let anxinerrorArr = [] for (let i = 0; i < row.correlationProject.length; i++) { - if (row.correlationProject[i].del == -1) { + if (row.correlationProject[i].del == true) { anxinerror = true anxinerrorArr.push(row.correlationProject[i].pepProjectName) } @@ -65,7 +65,7 @@ const Roles = (props) => {
{ anxinerror ? ( - +
diff --git a/web/client/src/sections/install/containers/system.jsx b/web/client/src/sections/install/containers/system.jsx index 7874a0e..b33458f 100644 --- a/web/client/src/sections/install/containers/system.jsx +++ b/web/client/src/sections/install/containers/system.jsx @@ -131,7 +131,7 @@ const Example = (props) => {
- PMOS + POMS
) diff --git a/web/client/src/sections/service/actions/emPush.js b/web/client/src/sections/service/actions/emPush.js new file mode 100644 index 0000000..52db5a4 --- /dev/null +++ b/web/client/src/sections/service/actions/emPush.js @@ -0,0 +1,74 @@ +'use strict'; + +import { ApiTable, basicAction } from '$utils' + +export function getPush () { //获取推送配置列表 + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_PUSH', + url: `${ApiTable.getPush}`, + msg: { error: '获取推送配置列表失败' }, + reducer: { name: '' } + }); +} + +export function postPush (data) {//添加/编辑成员 + let msg = '' + if (data) { + msg = data.msg + } + return (dispatch) => + basicAction({ + type: "post", + dispatch: dispatch, + data, + actionType: "POST_PUSH", + url: `${ApiTable.postPush}`, + msg: { option: msg }, //添加/编辑成员 + reducer: { name: "" }, + }); +} +export function getOrganizationUsers () { //获取全部未删除用户 + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_ORGANIZATION_USERS', + url: `${ApiTable.getOrganizationUsers}`, + msg: { error: '获取全部未删除用户' }, + reducer: { name: '' } + }); +} +export function getProjectPoms (query) {//获取已绑定项目 + return (dispatch) => basicAction({ + type: "get", + dispatch: dispatch, + actionType: "GET_PROJECT_POMS", + query: query, + url: `${ApiTable.getProjectPoms}`, + msg: { option: "获取已绑定项目" }, + reducer: { name: "ProjectPoms", params: { noClear: true } }, + }); +} +export function getProjectStructure (query) {//获取绑定项目下结构物 + return (dispatch) => basicAction({ + type: "get", + dispatch: dispatch, + actionType: "GET_PROJECT_STRUCTURE", + query: query, + url: `${ApiTable.getProjectStructure}`, + msg: { option: "获取绑定项目下结构物" }, + reducer: { name: "ProjectStructure", params: { noClear: true } }, + }); +} +export function getProjectStatus (query) {//获取项目状态列表 + return (dispatch) => basicAction({ + type: "get", + dispatch: dispatch, + actionType: "GET_PROJECT_STATUS", + query: query, + url: `${ApiTable.getProjectStatus}`, + msg: { option: "获取项目状态列表" }, + reducer: { name: "ProjectStatus", params: { noClear: true } }, + }); +} \ No newline at end of file diff --git a/web/client/src/sections/service/actions/emPush.jsx b/web/client/src/sections/service/actions/emPush.jsx deleted file mode 100644 index d4dcd9e..0000000 --- a/web/client/src/sections/service/actions/emPush.jsx +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -import { ApiTable, basicAction } from '$utils' - -export function getPush () { //获取推送配置列表 - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_PUSH', - url: `${ApiTable.getPush}`, - msg: { error: '获取推送配置列表失败' }, - reducer: { name: '' } - }); -} diff --git a/web/client/src/sections/service/components/pushModal.jsx b/web/client/src/sections/service/components/pushModal.jsx index b2c73cd..6cf391c 100644 --- a/web/client/src/sections/service/components/pushModal.jsx +++ b/web/client/src/sections/service/components/pushModal.jsx @@ -1,7 +1,8 @@ import React, { useState, useRef, useEffect } from "react"; import { connect } from "react-redux"; -import { Modal, Form } from "@douyinfe/semi-ui"; +import { Modal, Form, Notification } from "@douyinfe/semi-ui"; import { IconAlertCircle } from '@douyinfe/semi-icons'; +import './pushModal.less' function pushModal (props) { @@ -12,47 +13,219 @@ function pushModal (props) { dispatch, pepList, actions, - adminEdit,//是否是编辑 + pushEdit,//是否是编辑 editObj, + user } = props; - const { install } = actions; + const { service } = actions; const form = useRef();//表单 const [disablePeople, setDisablePeople] = useState(true); //页码信息 const [peopleList, setPeopleList] = useState([]); //人员List const [departmentId, setDepartmentId] = useState(); //部门id const [peopleId, setPeopleId] = useState(); //人员id + const [abnormal, setAbnormal] = useState(false); //异常率推送机制disable + const [usersList, setUsersList] = useState([]); //获取全部未删除用户 + const [structure, setStructure] = useState(true); //结构物disable + const [projectPoms, setProjectPoms] = useState([]); //获取已绑定项目 + const [projectStructure, setProjectStructure] = useState([]); //获取绑定项目下结构物 + const [timeTypeDis, setTimeTypeDis] = useState(true); //通知时效disable + const [projectStatus, setProjectStatus] = useState([]); //获取项目状态列表 + + + + + //初始化 useEffect(() => { - if (editObj.id) { - let departmentList = [] - for (let i = 0; i < pepList.length; i++) { - if (pepList[i].id == editObj.departments[0].id) { - departmentList = pepList[i].users + // if (editObj.id) { + // let departmentList = [] + // for (let i = 0; i < pepList.length; i++) { + // if (pepList[i].id == editObj.departments[0].id) { + // departmentList = pepList[i].users + // } + // } + // setPeopleList(departmentList) + // setDepartmentId(editObj.departments[0].id) + // setPeopleId(editObj.pepUserId) + // setDisablePeople(false) + // } + getOrganizationUsersList()//获取全部未删除用户 + getProjectPomsList()//获取已绑定项目 + }, []); + function getOrganizationUsersList () {//获取全部未删除用户 + dispatch(service.getOrganizationUsers()).then((res) => { + if (res.success) { + setUsersList(res.payload.data) + } + }) + } + function getProjectPomsList () {//获取已绑定项目 + dispatch(service.getProjectPoms()).then((res) => { + if (res.success) { + setProjectPoms(res.payload?.data?.rows) + } + }) + } + function getProjectStructureList (value) {//获取绑定项目下结构物 + dispatch(service.getProjectStructure({ pomsProjectId: value })).then((res) => { + if (res.success) { + let mylist = [] + for (let i = 0; i < res.payload?.data.length; i++) { + mylist.push(res.payload?.data[i].id) } + setProjectStructure(res.payload?.data) + form.current.setValue('strucId', mylist) + form.current.validate(['strucId','timeType']) + setStructure(false) + setTimeTypeDis(false) } - setPeopleList(departmentList) - setDepartmentId(editObj.departments[0].id) - setPeopleId(editObj.pepUserId) - setDisablePeople(false) - } - }, []); - + }) + } + function getProjectStatusList () {//获取项目状态列表 + dispatch(service.getProjectStatus()).then((res) => { + if (res.success) { + setProjectStatus(res.payload?.data) + let mylist = [] + for (let i = 0; i < res.payload?.data.length; i++) { + mylist.push(res.payload?.data[i].id) + } + form.current.setValue('timeType', mylist) + form.current.validate(['strucId','timeType']) + } + }) + } function handleOk () { //点击弹框确定 右边按钮 form.current .validate() .then((values) => { - if (adminEdit) { - dispatch(install.deteleOrganizationAdmin({id:editObj.id,msg:''})).then( - dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId, msg: '修改管理员' })).then((res) => {//获取项企(PEP)全部部门及其下用户 - if (res.success) { - close(); - } - }) - ) + if (pushEdit) { + dispatch(service.postPush({ pushId: pushId, pepUserId: values.pepUserId, msg: '编辑推送配置' })).then((res) => {//获取项企(PEP)全部部门及其下用户 + if (res.success) { + close(); + } + }) } else { - dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId, msg: '新增管理员' })).then((res) => {//获取项企(PEP)全部部门及其下用户 + let obj = JSON.parse(JSON.stringify(values)) + if (obj.timeType[0] == null) { + obj.timeType = [] + } + let regu = /^[0-9]*[1-9][0-9]*$/; + if (obj.tactics == 'immediately') { + if (obj.interval1) { + if (regu.test(obj.interval1)) { + if (obj.interval1 <= 1440) { + obj.tacticsParams = { + interval: obj.interval1 + } + delete obj.interval1 + delete obj.interval2 + delete obj.interval3 + delete obj.deviceProportion + } else { + Notification.error({ + content: '即时推送时间不能大于1440分钟', + duration: 2, + }) + } + } else { + Notification.error({ + content: '即时推送时间应为正整数', + duration: 2, + }) + } + } else { + Notification.error({ + content: '即时推送时间应为正整数', + duration: 2, + }) + } + } + else if (obj.tactics == 'continue') { + if (obj.interval2) { + if (regu.test(obj.interval2)) { + if (obj.interval2 <= 1440) { + obj.tacticsParams = { + interval: obj.interval2 + } + delete obj.interval1 + delete obj.interval2 + delete obj.interval3 + delete obj.deviceProportion + } else { + Notification.error({ + content: '持续时长推送时间不能大于1440分钟', + duration: 2, + }) + } + } else { + Notification.error({ + content: '持续时长推送时间应为正整数', + duration: 2, + }) + } + } else { + Notification.error({ + content: '持续时长推送时间应为正整数', + duration: 2, + }) + } + } + else { + if (regu.test(obj.interval3) && regu.test(obj.deviceProportion)) { + if (obj.interval3 <= 720 && obj.deviceProportion <= 100) { + obj.tacticsParams = { + interval: obj.interval3, + deviceProportion: obj.deviceProportion + } + delete obj.interval1 + delete obj.interval2 + delete obj.interval3 + delete obj.deviceProportion + } else if (obj.interval3 <= 720 && obj.deviceProportion > 100) { + Notification.error({ + content: '异常率推送异常率不能超过100%', + duration: 2, + }) + } else if (obj.interval3 > 720 && obj.deviceProportion <= 100) { + Notification.error({ + content: '异常率推送时间不能超过720小时', + duration: 2, + }) + } else { + Notification.error({ + content: '异常率推送时间不能超过720小时', + duration: 2, + }) + Notification.error({ + content: '异常率推送异常率不能超过100%', + duration: 2, + }) + } + } else if (regu.test(obj.interval3) && !regu.test(obj.deviceProportion)) { + Notification.error({ + content: '异常率推送异常率应为正整数', + duration: 2, + }) + } else if (!regu.test(obj.interval3) && regu.test(obj.deviceProportion)) { + Notification.error({ + content: '异常率推送时间应为正整数', + duration: 2, + }) + } else { + Notification.error({ + content: '异常率推送异常率应为正整数', + duration: 2, + }) + Notification.error({ + content: '异常率推送时间应为正整数', + duration: 2, + }) + } + } + console.log('obj', obj); + dispatch(service.postPush({ ...obj, msg: '新增推送配置' })).then((res) => {//获取项企(PEP)全部部门及其下用户 if (res.success) { close(); } @@ -67,60 +240,122 @@ function pushModal (props) { return ( <> -
-
-
-
成员成为管理员后,拥有平台所有权限和项目,成员的普通角色会被禁用。
-
+
{ + console.log('values', values); for (var key in field) { - if (key == 'department') { - if (values.department >= 0) { - let departmentList = [] - for (let i = 0; i < pepList.length; i++) { - if (pepList[i].id == values.department) { - departmentList = pepList[i].users - } - } - setPeopleList(departmentList) - setDisablePeople(false) - form.current.setValue('pepUserId', undefined); + if (key == 'tactics') { + if (values.tactics == 'abnormal_rate') { + form.current.setValue('alarmType', undefined) + setAbnormal(true) } else { - setPeopleList([]) - setDisablePeople(true) - form.current.setValue('pepUserId', undefined); + setAbnormal(false) + } + } + if (key == 'pomsProjectId') { + getProjectStructureList(values.pomsProjectId)//获取绑定项目下结构物 + for (let i = 0; i < projectPoms.length; i++) { + if (values.pomsProjectId == projectPoms[i].id) { + if (projectPoms[i].pepProjectId) { + getProjectStatusList()//获取项目状态列表 + } + else { + setProjectStatus([{ construction_status: 'POMS', id: null }]) + form.current.setValue('timeType', [null]) + form.current.validate() + } + } } } } + + // for (var key in field) { + // if (key == 'department') { + // if (values.department >= 0) { + // let departmentList = [] + // for (let i = 0; i < pepList.length; i++) { + // if (pepList[i].id == values.department) { + // departmentList = pepList[i].users + // } + // } + // setPeopleList(departmentList) + // setDisablePeople(false) + // form.current.setValue('pepUserId', undefined); + // } + // else { + // setPeopleList([]) + // setDisablePeople(true) + // form.current.setValue('pepUserId', undefined); + // } + // } + // } }} getFormApi={(formApi) => (form.current = formApi)} > +
+ 项目信息配置 +
+
+ +
+
+ + { + projectPoms.map((item, index) => { + return ( + + {item.pepProjectName || item.name} + + ) + }) + } + +
{ - pepList.map((item, index) => { + projectStructure.map((item, index) => { return ( {item.name} @@ -130,21 +365,136 @@ function pushModal (props) { }
+
+ + + 发现在 + + 分钟内,有告警源新增,则通过【信鸽服务】发送一条通知信息。 + + } + style={{ width: 198 }}> + 即时推送机制 + + + 告警源持续产生时间超过 + + 分钟,则通过【信鸽服务】发送一条通知信息。 + + } + style={{ width: 198 }}> + 持续时长推送机制 + + + 异常设备数量达到项目或结构物内设备总数量的 + + %,且持续时长超过 + + 小时,则通过【信鸽服务】发送一条通知信息。 + + } + style={{ width: 260 }}> + 异常率推送机制 + + +
+ + 数据中断 + 数据异常 + 策略命中 + 视频异常 + 应用异常 + 设备异常 + +
+
+ 接收信息配置 +
+
+ { + projectStatus.map((item, index) => { + return ( + + {item.construction_status} + + ) + }) + } + + { - peopleList.map((item, index) => { + usersList.map((item, index) => { return ( - + {item.name} ) @@ -152,9 +502,29 @@ function pushModal (props) { }
+
+ 不在项目节点的通知策略,会自动失效. +
+
+ + + 启用 + + + 禁用 + + +
- + ); } diff --git a/web/client/src/sections/service/components/pushModal.less b/web/client/src/sections/service/components/pushModal.less new file mode 100644 index 0000000..78a5cf8 --- /dev/null +++ b/web/client/src/sections/service/components/pushModal.less @@ -0,0 +1,10 @@ +.pushInput{ + .semi-input-wrapper-default{ + height: 20px !important; + line-height: 20px !important; + } + .semi-input-default{ + height: 20px !important; + line-height: 20px !important; + } +} \ No newline at end of file diff --git a/web/client/src/sections/service/containers/emPush.jsx b/web/client/src/sections/service/containers/emPush.jsx index b93f90d..b988ae8 100644 --- a/web/client/src/sections/service/containers/emPush.jsx +++ b/web/client/src/sections/service/containers/emPush.jsx @@ -1,9 +1,9 @@ import React, { useEffect, useRef, useState } from 'react'; import { connect } from 'react-redux'; -import { Skeleton, Button, Pagination, Form, Popconfirm, Table } from '@douyinfe/semi-ui'; +import { Skeleton, Button, Pagination, Form, Popconfirm, Table, Tooltip } from '@douyinfe/semi-ui'; import { SkeletonScreen, } from "$components"; import moment from "moment"; -import pushModal from '../components/pushModal' +import PushModal from '../components/pushModal' import '../style.less' import { Setup } from "$components"; // import { set } from 'nprogress'; @@ -18,9 +18,8 @@ const EmPush = (props) => { const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 const [limits, setLimits] = useState()//每页实际条数 const mylimits = useRef(); //每页实际条数 - const [selected, setSelected] = useState([]) //表格被勾选项 const [pushModal, setPushModal] = useState(false) //信鸽弹框 - const [systemEdit, setSystemEdit] = useState(false) //是否是修改 + const [pushEdit, setPushEdit] = useState(false) //是否是修改 const [anxincloudList, setAnxincloudList] = useState([]) //安心云列表 const [peplist, setPeplist] = useState([]) //PEP项目管理项目列表 const [appList, setAppList] = useState([]) //应用列表 @@ -31,20 +30,39 @@ const EmPush = (props) => { const [appArr, setAppArr] = useState([]) //修改时添加应用 const [bindId, setBindId] = useState() //修改时绑定的id const [tableKey, setTableKey] = useState([]) //修改时绑定的id + const [projectStatus, setProjectStatus] = useState([]); //获取项目状态列表 const page = useRef(query.page);//哪一页 const EMPUSH = "empush"; const tableList = [//表格属性 - { - title: '推送信息', - list: [ - { name: "策略类型", value: "pushWay" }, - { name: "推送机制", value: "noticeWay" }, - { name: "监听设备数量", value: "monitorCount" }, - { name: "累计推送次数", value: "logCount" }, - ] - }, -]; - + { + title: '推送信息', + list: [ + { name: "策略名称", value: "name" }, + { name: "创建时间", value: "createTime" }, + { name: "关联项目", value: "projectName" }, + { name: "接收人", value: "receiverPepUser" }, + { name: "推送方式", value: "pushType" }, + { name: "监听问题模块", value: "alarmType" }, + { name: "生效项目节点", value: "timeType" }, + { name: "推送机制", value: "tactics" }, + { name: "启用状态", value: "disable" }, + { name: "推送次数", value: "pushCount" }, + ] + }, + ]; + const alarmTypeObj = { + data_outages: '数据中断', + data_exception: '数据异常', + strategy_hit: '策略命中', + video_exception: '视频异常', + app_exception: '应用异常', + device_exception: '设备异常', + } + const tacticsObj = { + immediately: '即时推送机制', + continue: '持续时长推送机制', + abnormal_rate: '异常率推送机制', + } function handleRow (record, index) {//斑马条纹 @@ -63,61 +81,54 @@ const EmPush = (props) => { const [tableData, setTableData] = useState([]) //表格数据 useEffect(() => { - attribute(); - dispatch(service.getPush(query)).then((res) => {//获取推送配置列表 - // console.log('res.payload.datares.payload.data',res.payload.data); - // setAnxincloudList(res.payload.data) - }) + // dispatch(service.getPush(query)).then((res) => {//获取推送配置列表 + // console.log('res.payload.datares.payload.data',res.payload.data); + // setAnxincloudList(res.payload.data) + // }) // dispatch(install.getProjectPmanage(query)).then((res) => {//获取PEP项目管理项目 // setPeplist(res.payload.data) // }) // dispatch(install.getProjectAppList(query)).then((res) => {//获取应用列表 // setAppList(res.payload.data) // }) + getProjectStatusList() localStorage.getItem(EMPUSH) == null - ? localStorage.setItem( - EMPUSH, - JSON.stringify(['pushWay','noticeWay','logCount','monitorCount']) - ) - : ""; + ? localStorage.setItem( + EMPUSH, + JSON.stringify(['name', 'createTime', 'projectName', 'receiverPepUser', 'alarmType', 'timeType', 'tactics', 'disable']) + ) + : ""; + attribute(); }, []) useEffect(() => { - // getProjectPomsList(); + getPushList(); }, [query]); - function getProjectPomsList () { - // dispatch(install.getProjectPoms(query)).then((res) => {//获取已绑定项目 - // if (res.success) { - // let mytableData = JSON.parse(JSON.stringify(res.payload.data.rows)); - // let mytableKey = [] - // for (let index = 0; index < mytableData.length; index++) { - // mytableData[index].key = mytableData[index].id - // mytableKey.push(mytableData[index].id) - // } - // setTableKey(mytableKey) - // setTableData(mytableData) - // setLimits(res.payload.data.count) - // mylimits.current = res.payload.data.rows.length - // } - // }) + function getPushList () { + dispatch(service.getPush(query)).then((res) => {//获取已绑定项目 + if (res.success) { + // let mytableData = JSON.parse(JSON.stringify(res.payload.data.rows)); + // let mytableKey = [] + // for (let index = 0; index < mytableData.length; index++) { + // mytableData[index].key = mytableData[index].id + // mytableKey.push(mytableData[index].id) + // } + // setTableKey(mytableKey) + // setTableData(mytableData) + setTableData(res.payload.data) + setLimits(res.payload.data.length) + mylimits.current = res.payload.data.length + } + }) } - const [columns, setColumns] = useState([//表格属性 - { - title: "策略编号", - dataIndex: "index", - key: 'index', - render: (text, r, index) => { - return index + 1; - }, - }, - { - title: '策略名称', - dataIndex: "pepProjectName", - key: 'pepProjectName', - render: (_, row) => { - return row.pepProjectName + function getProjectStatusList () {//获取项目状态列表 + dispatch(service.getProjectStatus()).then((res) => { + if (res.success) { + setProjectStatus(res.payload?.data) } - }, + }) + } + const [columns, setColumns] = useState([//表格属性 { title: "操作", width: "20%", @@ -128,38 +139,38 @@ const EmPush = (props) => {
@@ -186,12 +197,6 @@ const EmPush = (props) => { }, }, ]) - const rowSelection = { - selectedRowKeys: selected, - onChange: (selectedRowKeys, selectedRows) => { - setSelected(selectedRows.map(v => v.key)) - }, - } //获取表格属性设置 function attribute () { const arr = localStorage.getItem(EMPUSH) @@ -200,59 +205,184 @@ const EmPush = (props) => { const column = [ { - title: "关联项目", - dataIndex: "noticeWay", - key: "noticeWay", - render: (_, r, index) => { - return r.noticeWay; - }, + title: '策略名称', + dataIndex: "name", + key: 'name', + render: (_, row) => { + return row.name + } }, { title: "创建时间", - dataIndex: "logCount", - key: "logCount", + dataIndex: "createTime", + key: "createTime", render: (_, r, index) => { - return (r.logCount + '次') + return moment(r.createTime).format('YYYY-MM-DD HH:mm:ss'); }, }, { - title: "接收人", - dataIndex: "monitorCount", - key: "monitorCount", + title: '关联项目', + dataIndex: "projectName", + key: "projectName", + render: (_, row) => { + let anxinerror = false + let anxinerrorArr = '' + if (row.pomsProject.del == true) { + anxinerror = true + anxinerrorArr = row.pomsProject.pepProject?.projectName || row.pomsProject.name + } + return ( +
+ { + anxinerror ? ( + +
+ +
+
) : ('') + } + { +
+ +
7 || row.pomsProject?.name?.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: row.pomsProject.del ? '#F93920' : '' }}> + {row.pomsProject.pepProject?.projectName || row.pomsProject.name} +
+
+
+ } +
+ ) + } + }, + { + title: '接收人', + dataIndex: "receiverPepUser", + key: 'receiverPepUser', + render: (_, row) => { + return ( +
+ { + row.receiverPepUser.map((item, index) => { + return ( +
+
1 ? 'none' : '', color: '#005ABD' }}> + {item.name} +
+
0 ? 'none' : '' }}>
+
+ ) + }) + } + { + row.receiverPepUser.length > 2 ? ( + + { + row.receiverPepUser.map((item, index) => { + return ( +
+ {item.name}, +
+ ) + }) + } +
+ } trigger="click" style={{ lineHeight: 2 }}> +
+ +{row.receiverPepUser.length - 2} +
+ + ) : ('') + } +
+ ) + } + }, + { + title: "推送方式", + dataIndex: "pushType", + key: "pushType", render: (_, r, index) => { - return r.monitorCount + return '邮件通知'; }, }, { - title: "监听问题", - dataIndex: "pushWay", - key: "pushWay", + title: "监听问题模块", + dataIndex: "alarmType", + key: "alarmType", + render: (_, row) => { + return ( +
+ { + // alarmTypeObj + row.alarmType.map((item, index) => { + return ( +
+
1 ? 'none' : '' }}> + {alarmTypeObj[item]} +
+
0 ? 'none' : '' }}>
+
+ ) + }) + } + { + row.alarmType.length > 2 ? ( + + { + row.alarmType.map((item, index) => { + return ( +
+ {alarmTypeObj[item]}, +
+ ) + }) + } +
+ } trigger="click" style={{ lineHeight: 2 }}> +
+ +{row.alarmType.length - 2} +
+ + ) : ('') + } +
+ ) + } + }, + { + title: "生效项目节点", + dataIndex: "timeType", + key: "timeType", render: (_, r, index) => { - return r.pushWay=='email' ? '邮件通知' : '短信通知'; + // projectStatus + return r.timeType[0] }, }, { - title: "通知时效", - dataIndex: "text1", - key: "text1", + title: "推送机制", + dataIndex: "tactics", + key: "tactics", render: (_, r, index) => { - return r.text1 + return tacticsObj[r.tactics] }, }, { title: "启用状态", - dataIndex: "text2", - key: "text2", + dataIndex: "disable", + key: "disable", render: (_, r, index) => { - return r.text2 + // projectStatus + return r.disable }, }, { title: "推送次数", - dataIndex: "time", - key: "time", + dataIndex: "pushCount", + key: "pushCount", render: (_, r, index) => { - return r.time + return r.pushCount }, }, ]; @@ -260,7 +390,7 @@ const EmPush = (props) => { let colum = column.filter((item) => { return item.key === arr[i]; }); - columns.splice(i + 2, 0, colum[0]); + columns.splice(columns.length - 1, 0, colum[0]); } setSetupp(columns); } @@ -332,15 +462,15 @@ const EmPush = (props) => { height: 32, borderRadius: 2, marginRight: 32, - background:'#FFFFFF', - color:'#005ABD', - border:'1px solid #005ABD' + background: '#FFFFFF', + color: '#005ABD', + border: '1px solid #005ABD' }} - // onClick={() => { }} + // onClick={() => { }} > 查询 -
+
setSetup(true)} />
-
预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留预留
+
EM推送提供对映射关系组的项目、结构物问题的监听和通知服务,支持对设备异常率、问题持续时间、即时响应等策略定义的动态推送。
{ empty="暂无数据" pagination={false} onRow={handleRow} - rowSelection={rowSelection} />
{ }} >
-
勾选 {selected.length}条 信息
- - { - // dispatch(install.deleteProjectBind({ bindId: selected.join(','), msg: '删除安心云、项目管理项目绑定关系' })).then(() => { - // if (page.current > 0 && mylimits.current == selected.length) { - // setQuery({ limit: 10, page: page.current - 1 }) - // } else { - // setQuery({ limit: 10, page: page.current }) - // } - // setSelected([]) - // }) - }} - > - -
@@ -438,49 +532,38 @@ const EmPush = (props) => { onChange={(currentPage, pageSize) => { setQuery({ limit: pageSize, page: currentPage - 1 }); page.current = currentPage - 1 - setSelected([]) }} />
- {/* {//映射关系弹框 + {//推送配置弹框 pushModal ? { setPushModal(false); }} close={() => { setPushModal(false); - getProjectPomsList() + getPushList() }} > : '' - } */} + } {setup ? ( - { - setSetup(false); - attribute(); - // setcameraSetup(false); - }} - /> - ) : ( - "" - )} + { + setSetup(false); + attribute(); + }} + /> + ) : ( + "" + )} ) } diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index ca385b4..36b3e65 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -50,6 +50,10 @@ export const ApiTable = { //服务-信鸽服务 getPush: "push", //获取推送配置列表 + postPush: "push", //新增/编辑推送配置 + getOrganizationUsers: "organization/users", //获取全部未删除用户 + getProjectStructure: "project/structure", //获取绑定项目下结构物 + getProjectStatus: "project/status", //获取项目状态列表 //控制台 consoleToollink: 'console/toollink', //常用工具