diff --git a/api/app/lib/controllers/alarm/data.js b/api/app/lib/controllers/alarm/data.js
index 7ad2046..65b0c7a 100644
--- a/api/app/lib/controllers/alarm/data.js
+++ b/api/app/lib/controllers/alarm/data.js
@@ -15,10 +15,10 @@ async function groupList (ctx) {
for (let g of groupRes) {
g.unit = await await clickHouse.anxinyun.query(`
SELECT DISTINCT
- t_alarm_group_unit.id AS id,t_alarm_group_unit.name AS name,t_alarm_group_unit.group_id AS groupId
+ t_alarm_group_unit.id AS id,t_alarm_group_unit.name AS name,t_alarm_group_unit.group_id AS groupId
FROM t_alarm_group_unit
INNER JOIN ${dataAlarm}.alarms
- ON t_alarm_group_unit.id = ${dataAlarm}.alarms.AlarmGroupUnit
+ ON t_alarm_group_unit.id = ${dataAlarm}.alarms.AlarmGroupUnit
WHERE group_id = ${g.id}
`).toPromise();
}
diff --git a/api/app/lib/controllers/alarm/video.js b/api/app/lib/controllers/alarm/video.js
index b4ed366..ce69e26 100644
--- a/api/app/lib/controllers/alarm/video.js
+++ b/api/app/lib/controllers/alarm/video.js
@@ -6,17 +6,27 @@ async function deviceType (ctx) {
try {
const { models } = ctx.fs.dc;
const { clickHouse } = ctx.app.fs
+ const { database: anxinyun } = clickHouse.anxinyun.opts.config
+ const { utils: { judgeSuper, anxinStrucIdRange } } = ctx.app.fs
+ let anxinStruc = await anxinStrucIdRange({
+ ctx,
+ })
+ const anxinStrucIds = anxinStruc.map(a => a.strucId)
const kindRes = await clickHouse.vcmp.query(`
- SELECT DISTINCT
- camera_kind.id AS id,camera_kind.kind AS kind
- FROM camera_kind
- INNER JOIN camera
- ON camera_kind.id = camera.kind_id
- INNER JOIN camera_status_alarm
- ON camera.channel_no = camera_status_alarm.channel_no
- AND camera.serial_no = camera_status_alarm.serial_no
- `).toPromise()
+ SELECT DISTINCT
+ camera_kind.id AS id,camera_kind.kind AS kind
+ FROM camera_kind
+ INNER JOIN camera
+ ON camera_kind.id = camera.kind_id
+ INNER JOIN camera_status_alarm
+ ON camera.channel_no = camera_status_alarm.channel_no
+ AND camera.serial_no = camera_status_alarm.serial_no
+ INNER JOIN ${anxinyun}.t_video_ipc
+ ON toString(${anxinyun}.t_video_ipc.channel_no) = camera_status_alarm.channel_no
+ AND ${anxinyun}.t_video_ipc.serial_no = camera_status_alarm.serial_no
+ ${`WHERE ${anxinyun}.t_video_ipc.structure IN (${anxinStrucIds.join(',')})`}
+ `).toPromise()
ctx.status = 200;
ctx.body = kindRes
} catch (error) {
@@ -28,13 +38,46 @@ async function deviceType (ctx) {
}
}
+async function exceptionType(ctx) {
+ try {
+ const { models } = ctx.fs.dc;
+ const { clickHouse } = ctx.app.fs
+ const { database: anxinyun } = clickHouse.anxinyun.opts.config
+ const { utils: { judgeSuper, anxinStrucIdRange } } = ctx.app.fs
+ let anxinStruc = await anxinStrucIdRange({
+ ctx,
+ })
+ const anxinStrucIds = anxinStruc.map(a => a.strucId)
+
+ const statusRes = await clickHouse.vcmp.query(`
+ SELECT DISTINCT
+ camera_status.id AS statusId,camera_status.describe AS describe
+ FROM camera_status
+ INNER JOIN camera_status_alarm
+ ON camera_status.id = camera_status_alarm.status_id
+ INNER JOIN ${anxinyun}.t_video_ipc
+ ON toString(${anxinyun}.t_video_ipc.channel_no) = camera_status_alarm.channel_no
+ AND ${anxinyun}.t_video_ipc.serial_no = camera_status_alarm.serial_no
+ ${`WHERE ${anxinyun}.t_video_ipc.structure IN (${anxinStrucIds.join(',')})`}
+ `).toPromise()
+ ctx.status = 200;
+ ctx.body = statusRes
+ } catch (error) {
+ ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
+ ctx.status = 400;
+ ctx.body = {
+ message: typeof error == 'string' ? error : undefined
+ }
+ }
+}
+
async function alarmList (ctx) {
try {
const { models } = ctx.fs.dc;
const { clickHouse } = ctx.app.fs
const { utils: { judgeSuper, anxinStrucIdRange } } = ctx.app.fs
const { database: anxinyun } = clickHouse.anxinyun.opts.config
- const { pepProjectId, keywordTarget, keyword, state, kindId, sustainTimeStart, sustainTimeEnd, limit, page, statusId, toExport} = ctx.query
+ const { pepProjectId, keywordTarget, keyword, state, kindId, sustainTimeStart, sustainTimeEnd, limit, page, statusId, toExport } = ctx.query
let anxinStruc = await anxinStrucIdRange({
ctx, pepProjectId, keywordTarget, keyword
@@ -78,7 +121,7 @@ async function alarmList (ctx) {
)
`)
}
- if(statusId){
+ if (statusId) {
statusAlarmWhereOption.push(`camera_status_alarm.status_id = ${statusId}`)
}
@@ -279,7 +322,7 @@ async function alarmList (ctx) {
}
}
-async function exportVideoAlarms(ctx, alarmList) {
+async function exportVideoAlarms (ctx, alarmList) {
let accessType = { yingshi: "萤石云", nvr: "NVR", ipc: "IPC", cascade: "级联" }
try {
const { clickHouse, utils: { simpleExcelDown, getExportAlarmHeader } } = ctx.app.fs;
@@ -328,7 +371,7 @@ async function exportVideoAlarms(ctx, alarmList) {
}
}
}
-async function confirm(ctx) {
+async function confirm (ctx) {
try {
const { alarmId, content, confirmPost } = ctx.request.body;
// TODO: 以视频·应用的秘钥进行鉴权
@@ -451,5 +494,6 @@ module.exports = {
alarmList,
confirm,
alarmAdded,
- vcmpAppAuthToken
+ vcmpAppAuthToken,
+ exceptionType
};
\ No newline at end of file
diff --git a/api/app/lib/routes/alarm/index.js b/api/app/lib/routes/alarm/index.js
index cfba9d0..9d97aaf 100644
--- a/api/app/lib/routes/alarm/index.js
+++ b/api/app/lib/routes/alarm/index.js
@@ -60,4 +60,7 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/vcmp/auth'] = { content: '获取视频平台应用鉴权token', visible: true };
router.get('/vcmp/auth', videoAlarm.vcmpAppAuthToken);
+
+ app.fs.api.logAttr['GET/alarm/video/exception_statusId'] = { content: '查询视频异常类型', visible: true };
+ router.get('/alarm/video/exception_statusId', videoAlarm.exceptionType);
};
diff --git a/web/client/src/sections/control/containers/control.jsx b/web/client/src/sections/control/containers/control.jsx
index 19fa77c..c4857d2 100644
--- a/web/client/src/sections/control/containers/control.jsx
+++ b/web/client/src/sections/control/containers/control.jsx
@@ -155,13 +155,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject
})
} else {
if (ProblemAlarm?.length > 0) {
- ProblemAlarm.sort((a, b) => {
- if (moment(a.StartTime).isBefore(b.StartTime)) {
- return 1
- } else {
- return -1
- }
- })
+ ProblemAlarm.sort((a, b) => (moment(a.StartTime).isBefore(b.StartTime) ? 1 : -1))
setProblemsList([...ProblemAlarm, ...problemsList])
}
}
@@ -187,19 +181,12 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject
}
})
}
- newest.sort((a, b) => {
- if (moment(a.time).isBefore(b.time)) {
- return 1
- } else {
- return -1
- }
- })
+ newest.sort((a, b) => (moment(a.time).isBefore(b.time) ? 1 : -1))
querydata.current = [...newest, ...querydata.current]
setQueryData1([...querydata.current])
}
}, [socketData])
- console.log(querydata.current);
useEffect(() => {
consoleToollink()
@@ -423,13 +410,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject
id: v.id,
}))
}
- data.sort((a, b) => {
- if (moment(a.time).isBefore(b.time)) {
- return 1
- } else {
- return -1
- }
- })
+ data.sort((a, b) => (moment(a.time).isBefore(b.time) ? 1 : -1))
// console.log(data)
querydata.current = data
setQueryData1(data)
@@ -505,13 +486,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject
id: v.id,
}))
}
- data.sort((a, b) => {
- if (moment(a.time).isBefore(b.time)) {
- return 1
- } else {
- return -1
- }
- })
+ data.sort((a, b) => (moment(a.time).isBefore(b.time) ? 1 : -1))
querydata.current = data
setQueryData1(data)
}
diff --git a/web/client/src/sections/install/components/systemModal.jsx b/web/client/src/sections/install/components/systemModal.jsx
index 48943f9..011109c 100644
--- a/web/client/src/sections/install/components/systemModal.jsx
+++ b/web/client/src/sections/install/components/systemModal.jsx
@@ -20,7 +20,8 @@ function adminModal (props) {
anxincloudArr,//修改时已经选择的安心云列表
anxinDelete,//修改时安心云项目有删除,显示提示信息
appArr,//修改时添加应用
- bindId
+ bindId,
+ mapping //修改时的映射类型
} = props;
const { install } = actions;
const form = useRef();//表单
@@ -236,16 +237,14 @@ function adminModal (props) {
}
+ >
{
[
{ name: '智慧类', value: 'wisdom' },
diff --git a/web/client/src/sections/install/containers/system.jsx b/web/client/src/sections/install/containers/system.jsx
index d0c83fe..e634b24 100644
--- a/web/client/src/sections/install/containers/system.jsx
+++ b/web/client/src/sections/install/containers/system.jsx
@@ -8,472 +8,477 @@ import '../style.less'
import { set } from 'nprogress';
const Example = (props) => {
- const { dispatch, actions, user, loading, socket } = props
- const { install } = actions;
- const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
- const [limits, setLimits] = useState()//每页实际条数
- const mylimits = useRef(); //每页实际条数
- const [selected, setSelected] = useState([]) //表格被勾选项
- const [systemModal, setSystemModal] = useState(false) //映射关系弹框
- const [systemEdit, setSystemEdit] = useState(false) //是否是修改
- const [anxincloudList, setAnxincloudList] = useState([]) //安心云列表
- const [peplist, setPeplist] = useState([]) //PEP项目管理项目列表
- const [appList, setAppList] = useState([]) //应用列表
- const [pepProjectId, setPepProjectId] = useState() //修改时项企id
- const [anxincloudArr, setAnxincloudArr] = useState([]) //修改时已经选择的安心云列表
- const [pepname, setPepname] = useState() //修改时自定义项目名称
- const [anxinDelete, setAnxinDelete] = useState([]) //修改时安心云项目有删除,显示提示信息
- const [appArr, setAppArr] = useState([]) //修改时添加应用
- const [bindId, setBindId] = useState() //修改时绑定的id
- const [tableKey, setTableKey] = useState([]) //修改时绑定的id
- const page = useRef(query.page);//哪一页
+ const { dispatch, actions, user, loading, socket } = props
+ const { install } = actions;
+ const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
+ const [limits, setLimits] = useState()//每页实际条数
+ const mylimits = useRef(); //每页实际条数
+ const [selected, setSelected] = useState([]) //表格被勾选项
+ const [systemModal, setSystemModal] = useState(false) //映射关系弹框
+ const [systemEdit, setSystemEdit] = useState(false) //是否是修改
+ const [anxincloudList, setAnxincloudList] = useState([]) //安心云列表
+ const [peplist, setPeplist] = useState([]) //PEP项目管理项目列表
+ const [appList, setAppList] = useState([]) //应用列表
+ const [pepProjectId, setPepProjectId] = useState() //修改时项企id
+ const [anxincloudArr, setAnxincloudArr] = useState([]) //修改时已经选择的安心云列表
+ const [pepname, setPepname] = useState() //修改时自定义项目名称
+ const [anxinDelete, setAnxinDelete] = useState([]) //修改时安心云项目有删除,显示提示信息
+ const [appArr, setAppArr] = useState([]) //修改时添加应用
+ const [bindId, setBindId] = useState() //修改时绑定的id
+ const [tableKey, setTableKey] = useState([]) //修改时绑定的id
+ const page = useRef(query.page);//哪一页
+ const [mapping, setMapping] = useState() //修改时的映射类型
- function handleRow (record, index) {//斑马条纹
- // 给偶数行设置斑马纹
- if (index % 2 === 0) {
- return {
- style: {
- background: '#FAFCFF',
- }
- };
- } else {
- return {};
- }
- }
+ function handleRow (record, index) {//斑马条纹
+ // 给偶数行设置斑马纹
+ if (index % 2 === 0) {
+ return {
+ style: {
+ background: '#FAFCFF',
+ }
+ };
+ } else {
+ return {};
+ }
+ }
- const [tableData, setTableData] = useState([]) //表格数据
+ const [tableData, setTableData] = useState([]) //表格数据
- const getPepProject = ()=>{
+ const getPepProject = () => {
dispatch(install.getProjectPmanage(query)).then((res) => {//获取PEP项目管理项目
setPeplist(res.payload.data)
- })
- }
+ })
+ }
- useEffect(() => {
- dispatch(install.getProjectAnxincloud(query)).then((res) => {//获取安心云项目
- setAnxincloudList(res.payload.data)
- })
- getPepProject()
- dispatch(install.getProjectAppList(query)).then((res) => {//获取应用列表
- setAppList(res.payload.data)
- })
- console.log('user',user);
- }, [])
- useEffect(() => {
- getProjectPomsList();
- }, [query]);
+ useEffect(() => {
+ dispatch(install.getProjectAnxincloud(query)).then((res) => {//获取安心云项目
+ setAnxincloudList(res.payload.data)
+ })
+ getPepProject()
+ dispatch(install.getProjectAppList(query)).then((res) => {//获取应用列表
+ setAppList(res.payload.data)
+ })
+ console.log('user', user);
+ }, [])
+ useEffect(() => {
+ getProjectPomsList();
+ }, [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 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)
}
- })
- }
- const [columns, setColumns] = useState([//表格属性
- {
- title: "序号",
- dataIndex: "index",
- key: 'index',
- render: (text, r, index) => {
- return index + 1;
- },
- },
- {
- title: 'PEP项企项目名称',
- dataIndex: "pepProjectName",
- key: 'pepProjectName',
- render: (_, row) => {
- return (
-
- {
- row.pepProjectIsDelete == 1 ? (
-
-
-
-
- ) : ('')
- }
-
- 7 || row?.name?.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
- {row.pepProjectName || row.name}
-
+ setTableKey(mytableKey)
+ setTableData(mytableData)
+ setLimits(res.payload.data.count)
+ mylimits.current = res.payload.data.rows.length
+ }
+ })
+ }
+ const [columns, setColumns] = useState([//表格属性
+ {
+ title: "序号",
+ dataIndex: "index",
+ key: 'index',
+ render: (text, r, index) => {
+ return index + 1;
+ },
+ },
+ {
+ title: 'PEP项企项目名称',
+ dataIndex: "pepProjectName",
+ key: 'pepProjectName',
+ render: (_, row) => {
+ return (
+
+ {
+ row.pepProjectIsDelete == 1 ? (
+
+
+
+
+ ) : ('')
+ }
+
+ 7 || row?.name?.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
+ {row.pepProjectName || row.name}
+
+
+ {
+ row.pepProjectName ? (
+
+
+
+
+
+ {row.constructionStatus}
+
+
+ ) : (
+
+
+
+
+
+ POMS
+
+
+ )
+ }
+
+ )
+ }
+ },
+ {
+ title: '安心云项目名称',
+ dataIndex: "anxinProject",
+ key: 'anxinProject',
+ width: 500,
+ render: (_, row) => {
+ let anxinerror = false
+ let anxinerrorArr = []
+ for (let i = 0; i < row.anxinProject.length; i++) {
+ if (row.anxinProject[i].projectState == -1) {
+ anxinerror = true
+ anxinerrorArr.push(row.anxinProject[i].name)
+ }
+ }
+ return (
+
+ {
+ anxinerror ? (
+
+
+
+
+ ) : ('')
+ }
+ {
+ row.anxinProject.map((item, index) => {
+ return (
+
+ {
+ row.anxinProject.length >= 3 ? (
+
+ 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: index > 2 ? 'none' : '', color: item.projectState == -1 ? '#F93920' : '' }}>
+ {item.name}
+
+
+ ) : row.anxinProject.length == 2 ? (
+
+ 12 ? '173.5px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.projectState == -1 ? '#F93920' : '' }}>
+ {item.name}
+
+
+ ) : (
+
+ 25 ? '358px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.projectState == -1 ? '#F93920' : '' }}>
+ {item.name}
+
+
+ )
+ }
+
1 ? 'none' : '' }}>
+
+ )
+ })
+ }
+ {
+ row.anxinProject.length > 3 ? (
+
+ {
+ row.anxinProject.map((item, index) => {
+ return (
+
+ {item.name},
+
+ )
+ })
+ }
+
+ } trigger="click" style={{ lineHeight: 2 }}>
+
+ +{row.anxinProject.length - 3}
+
- {
- row.pepProjectName ? (
-
-
-
-
-
- {row.constructionStatus}
-
-
- ) : (
-
-
-
-
-
- POMS
-
-
- )
+ ) : ('')
+ }
+
+ )
+ }
+ },
+ {
+ title: '关联时间',
+ dataIndex: "createTime",
+ key: 'time',
+ render: (_, row) => {
+ return moment(row.createTime).format("YYYY-MM-DD HH:mm:ss")||'无';
+ }
+ },
+ {
+ title: '修改时间',
+ dataIndex: "updateTime",
+ key: 'updateTime',
+ render: (_, row) => {
+ return (row.updateTime?moment(row.updateTime).format("YYYY-MM-DD HH:mm:ss"):moment(row.createTime).format("YYYY-MM-DD HH:mm:ss"));
+ }
+ },
+ {
+ title: '添加人员',
+ dataIndex: "pepUserName",
+ key: 'pepUserName',
+ render: (_, row) => {
+ return row.pepUserName||'无'
+ }
+ },
+ {
+ title: "管理",
+ width: "20%",
+ dataIndex: "text",
+ key: 'text',
+ render: (_, row) => {
+ return (
+
+
- )
- }
- },
- {
- title: '安心云项目名称',
- dataIndex: "anxinProject",
- key: 'anxinProject',
- width: 500,
- render: (_, row) => {
- let anxinerror = false
- let anxinerrorArr = []
- for (let i = 0; i < row.anxinProject.length; i++) {
- if (row.anxinProject[i].projectState == -1) {
- anxinerror = true
- anxinerrorArr.push(row.anxinProject[i].name)
- }
- }
- return (
-
- {
- anxinerror ? (
-
-
-
-
- ) : ('')
+ else {
+ setPepProjectId()
}
- {
- row.anxinProject.map((item, index) => {
- return (
-
- {
- row.anxinProject.length >= 3 ? (
-
- 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: index > 2 ? 'none' : '', color: item.projectState == -1 ? '#F93920' : '' }}>
- {item.name}
-
-
- ) : row.anxinProject.length == 2 ? (
-
- 12 ? '173.5px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.projectState == -1 ? '#F93920' : '' }}>
- {item.name}
-
-
- ) : (
-
- 25 ? '358px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.projectState == -1 ? '#F93920' : '' }}>
- {item.name}
-
-
- )
- }
-
1 ? 'none' : '' }}>
-
- )
- })
+ let myanxinArr = []
+ let anxinErrorList = []
+ for (let i = 0; i < row.anxinProject.length; i++) {
+ if (row.anxinProject[i].projectState !== -1) {
+ myanxinArr.push(row.anxinProject[i].id)
+ }
+ else {
+ anxinErrorList.push(row.anxinProject[i].name)
+ }
}
- {
- row.anxinProject.length > 3 ? (
-
- {
- row.anxinProject.map((item, index) => {
- return (
-
- {item.name},
-
- )
- })
- }
-
- } trigger="click" style={{ lineHeight: 2 }}>
-
- +{row.anxinProject.length - 3}
-
-
- ) : ('')
+ setAnxinDelete(anxinErrorList)
+ let myapparr = []
+ let myarrarrList = JSON.parse(JSON.stringify(row.apps))
+ for (let j = 0; j < row.apps.length; j++) {
+ delete myarrarrList[j].projectApp
+ myapparr.push(JSON.stringify(myarrarrList[j]))
}
-
- )
- }
- },
- {
- title: '关联时间',
- dataIndex: "createTime",
- key: 'time',
- render: (_, row) => {
- return moment(row.createTime).format("YYYY-MM-DD HH:mm:ss");
- }
- },
- {
- title: '修改时间',
- dataIndex: "updateTime",
- key: 'updateTime',
- render: (_, row) => {
- return moment(row.updateTime).format("YYYY-MM-DD HH:mm:ss");
- }
- },
- {
- title: '添加人员',
- dataIndex: "pepUserName",
- key: 'pepUserName',
- render: (_, row) => {
- return row.pepUserName
- }
- },
- {
- title: "管理",
- width: "20%",
- dataIndex: "text",
- key: 'text',
- render: (_, row) => {
- return (
-
-
-
{
- dispatch(install.deleteProjectBind({ bindId: row?.id, msg: '删除安心云、项目管理项目绑定关系' })).then(() => {
- getPepProject()
- if (page.current > 0 && mylimits.current < 2) {
- setQuery({ limit: 10, page: page.current - 1 })
- } else {
- setQuery({ limit: 10, page: page.current })
- }
- })
- }}
- >
-
-
-
- );
- },
- },
- ])
- const rowSelection = {
- selectedRowKeys: selected,
- // onSelect: (record, selected) => {
- // // console.log(`select row: ${selected}`, record);
- // },
- // onSelectAll: (selected, selectedRows) => {
- // // console.log(`select all rows: ${selected}`, selectedRows);
- // },
- onChange: (selectedRowKeys, selectedRows) => {
- setSelected(selectedRows.map(v => v.key))
- },
- }
- return (
- <>
-
-
-
-
-
系统映射
-
ASSOCIATION & MAPPING
-
-
-
-
-
-
-
平台通过映射能力将多个系统的结构化、非结构化、半结构化数据按照平台算法进行分类关联,形成整体项目信息结构,以项企PEP的项目名称进行规范。
-
-
-
-
-
-
-
-
勾选 {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([])
- })
- }}
- >
-
-
-
-
-
- 共{limits}条信息
-
-
{
- setQuery({ limit: pageSize, page: currentPage - 1 });
- page.current = currentPage - 1
- setSelected([])
- }}
- />
-
-
-
+
+ setAppArr(myapparr)
+ setAnxincloudArr(myanxinArr)
+ setBindId(row.id)
+ setMapping(row?.mappingClass)
+ setSystemEdit(true)
+ }}
+ >
+ 修改
+
+
{
+ dispatch(install.deleteProjectBind({ bindId: row?.id, msg: '删除安心云、项目管理项目绑定关系' })).then(() => {
+ getPepProject()
+ if (page.current > 0 && mylimits.current < 2) {
+ setQuery({ limit: 10, page: page.current - 1 })
+ } else {
+ setQuery({ limit: 10, page: page.current })
+ }
+ })
+ }}
+ >
+
+
+
+ );
+ },
+ },
+ ])
+ const rowSelection = {
+ selectedRowKeys: selected,
+ // onSelect: (record, selected) => {
+ // // console.log(`select row: ${selected}`, record);
+ // },
+ // onSelectAll: (selected, selectedRows) => {
+ // // console.log(`select all rows: ${selected}`, selectedRows);
+ // },
+ onChange: (selectedRowKeys, selectedRows) => {
+ setSelected(selectedRows.map(v => v.key))
+ },
+ }
+ return (
+ <>
+
+
+
+
+
系统映射
+
ASSOCIATION & MAPPING
+
+
+
+
- {//映射关系弹框
- systemModal ?
-
{
- setSystemModal(false);
+
+
平台通过映射能力将多个系统的结构化、非结构化、半结构化数据按照平台算法进行分类关联,形成整体项目信息结构,以项企PEP的项目名称进行规范。
+
+
+
+
+
+
+
+
勾选 {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([])
+ })
}}
- close={() => {
- setSystemModal(false);
- getProjectPomsList()
- getPepProject()
- }} >
- : ''
- }
- >
- )
+ >
+
+
+
+
+
+ 共{limits}条信息
+
+
{
+ setQuery({ limit: pageSize, page: currentPage - 1 });
+ page.current = currentPage - 1
+ setSelected([])
+ }}
+ />
+
+
+
+
+ {//映射关系弹框
+ systemModal ?
+ {
+ setSystemModal(false);
+ }}
+ close={() => {
+ setSystemModal(false);
+ getProjectPomsList()
+ getPepProject()
+ }} >
+ : ''
+ }
+ >
+ )
}
function mapStateToProps (state) {
- const { auth, global, ProjectPoms } = state;
- return {
- loading: ProjectPoms.isRequesting,
- user: auth.user,
- actions: global.actions,
- // members: members.data,
- };
+ const { auth, global, ProjectPoms } = state;
+ return {
+ loading: ProjectPoms.isRequesting,
+ user: auth.user,
+ actions: global.actions,
+ // members: members.data,
+ };
}
export default connect(mapStateToProps)(Example);
diff --git a/web/client/src/sections/problem/actions/problem.jsx b/web/client/src/sections/problem/actions/problem.jsx
index b8bf96e..903cb7d 100644
--- a/web/client/src/sections/problem/actions/problem.jsx
+++ b/web/client/src/sections/problem/actions/problem.jsx
@@ -149,6 +149,17 @@ export function getAlarmVideoDeviceKind () { //查询视频设备类型
});
}
+export function getAlarmVideoExceptionStatusId () { //查询视频异常类型
+ return dispatch => basicAction({
+ type: 'get',
+ dispatch: dispatch,
+ actionType: 'GET_ALARM_VIDEO_EXCEPTION_STATUS_ID',
+ url: `${ApiTable.getAlarmVideoExceptionStatusId}`,
+ msg: { option: '查询视频异常类型' },
+ reducer: { name: '' }
+ });
+ }
+
export function putAlarmVideoConfirm (data) { //确认视频告警
return dispatch => basicAction({
type: 'put',
diff --git a/web/client/src/sections/problem/components/sideSheet.jsx b/web/client/src/sections/problem/components/sideSheet.jsx
index 1d7740c..19efa7c 100644
--- a/web/client/src/sections/problem/components/sideSheet.jsx
+++ b/web/client/src/sections/problem/components/sideSheet.jsx
@@ -32,13 +32,7 @@ function SideSheets ({ dispatch, actions, close, alarmId }) {
dispatch(problem.getAlarmDataDetailAgg({ alarmId: alarmId })).then((res) => {
if (res?.success) {
let dataSort = res.payload.data || []
- dataSort.sort((a, b) => {
- if (moment(a.hours).isBefore(b.hours)) {
- return -1
- } else {
- return 1
- }
- })
+ dataSort.sort((a, b) => (moment(a.hours).isBefore(b.hours) ? -1 : 1))
let data = {
grid: {
left: '5%',
diff --git a/web/client/src/sections/problem/components/tableData.jsx b/web/client/src/sections/problem/components/tableData.jsx
index 7486d04..f9d75e5 100644
--- a/web/client/src/sections/problem/components/tableData.jsx
+++ b/web/client/src/sections/problem/components/tableData.jsx
@@ -10,14 +10,14 @@ import qs from "qs";
const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition, pepProjectId,
- selected, setSelected, setIfBulk, setConfirm, genre, setGenre, query, setQuery, tableData, setTableData, location, user }) => {
+ selected, setSelected, setIfBulk, setConfirm, genre, setGenre, query, setQuery, tableData, setTableData, location, user, statusId, setStatusId }) => {
const { problem } = actions
const [count, setCount] = useState(0) //
const [checkAll, setCheckAll] = useState(true) //查询
const api = useRef();
const search = useRef({
- state: '', keywordTarget: '', keyword: '', kindId: '', groupUnitId: '',
+ state: '', keywordTarget: '', keyword: '', kindId: '', groupUnitId: '', statusId: '',
errType: '', confirmState: '', onlineState: '', sustainTimeStart: '', sustainTimeEnd: ''
})
const kindName = useRef()
@@ -153,6 +153,11 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
setGenre(res.payload.data.map(v => ({ name: v.kind, value: v.id })))
}
})
+ dispatch(problem.getAlarmVideoExceptionStatusId()).then((res) => {
+ if (res.success) {
+ setStatusId(res.payload.data.map(v => ({ name: v.describe, value: v.statusId })))
+ }
+ })
}
}, [])
@@ -326,6 +331,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
keywordTarget: v.keywordTarget,
keyword: v.keyword,
kindId: v.kindId,
+ statusId: v.statusId,
groupUnitId: v.groupUnitId,
errType: v.errType,
confirmState: v.confirmState,
@@ -349,6 +355,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
keywordTarget: v.keywordTarget,
keyword: v.keyword,
kindId: v.kindId,
+ statusId: v.statusId,
groupUnitId: v.groupUnitId,
errType: v.errType,
confirmState: v.confirmState,
diff --git a/web/client/src/sections/problem/containers/dataAlarm.jsx b/web/client/src/sections/problem/containers/dataAlarm.jsx
index 4f1ca61..27ef6be 100644
--- a/web/client/src/sections/problem/containers/dataAlarm.jsx
+++ b/web/client/src/sections/problem/containers/dataAlarm.jsx
@@ -31,6 +31,7 @@ const DataAlarm = (props) => {
const [content, setContent] = useState(false); //确认内容
const [selected, setSelected] = useState([]) //表格被勾选项
const [genre, setGenre] = useState([]) //搜索类型
+ const [statusId, setStatusId] = useState([]) //异常类型
const [checkPop, setCheckPop] = useState(false) //查看弹框是否显现
const [alarmId, setAlarmId] = useState(false) //查看alarmId
const [query, setQuery] = useState({ limit: 10, page: 0 }) //分页
@@ -112,6 +113,10 @@ const DataAlarm = (props) => {
name: '设备类型', field: 'kindId',
data: genre,
},
+ {
+ name: '异常类型', field: 'statusId',
+ data: statusId,
+ },
{
name: '异常状态', field: 'state',
data: [
@@ -424,11 +429,13 @@ const DataAlarm = (props) => {
selected={selected}
setSelected={setSelected}
setGenre={setGenre}
+ setStatusId={setStatusId}
query={query}
setQuery={setQuery}
tableData={tableData}
setTableData={setTableData}
genre={genre}
+ statusId={statusId}
location={props.location?.query}
/>
{setup ? (
diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js
index 8ec5d94..b69f118 100644
--- a/web/client/src/utils/webapi.js
+++ b/web/client/src/utils/webapi.js
@@ -47,6 +47,7 @@ export const ApiTable = {
getAlarmVideoDeviceKind: 'alarm/video/device_kind', //查询视频设备类型
putAlarmVideoConfirm: 'alarm/video/confirm', //确认视频告警信息
getVcmpAuth: 'vcmp/auth', // 获取视频平台应用鉴权token
+ getAlarmVideoExceptionStatusId: 'alarm/video/exception_statusId', //查询视频设备类型
//服务-信鸽服务
getPush: "push", //获取推送配置列表