-
-
-
成员成为管理员后,拥有平台所有权限和项目,成员的普通角色会被禁用。
-
+
-
+
>
);
}
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={() => { }}
>
查询
-