Browse Source

(*)解决冲突

dev
wuqun 2 years ago
parent
commit
5a7800afb4
  1. 4
      api/app/lib/controllers/alarm/data.js
  2. 72
      api/app/lib/controllers/alarm/video.js
  3. 3
      api/app/lib/routes/alarm/index.js
  4. 33
      web/client/src/sections/control/containers/control.jsx
  5. 11
      web/client/src/sections/install/components/systemModal.jsx
  6. 895
      web/client/src/sections/install/containers/system.jsx
  7. 11
      web/client/src/sections/problem/actions/problem.jsx
  8. 8
      web/client/src/sections/problem/components/sideSheet.jsx
  9. 11
      web/client/src/sections/problem/components/tableData.jsx
  10. 7
      web/client/src/sections/problem/containers/dataAlarm.jsx
  11. 1
      web/client/src/utils/webapi.js

4
api/app/lib/controllers/alarm/data.js

@ -15,10 +15,10 @@ async function groupList (ctx) {
for (let g of groupRes) { for (let g of groupRes) {
g.unit = await await clickHouse.anxinyun.query(` g.unit = await await clickHouse.anxinyun.query(`
SELECT DISTINCT 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 FROM t_alarm_group_unit
INNER JOIN ${dataAlarm}.alarms 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} WHERE group_id = ${g.id}
`).toPromise(); `).toPromise();
} }

72
api/app/lib/controllers/alarm/video.js

@ -6,17 +6,27 @@ async function deviceType (ctx) {
try { try {
const { models } = ctx.fs.dc; const { models } = ctx.fs.dc;
const { clickHouse } = ctx.app.fs 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(` const kindRes = await clickHouse.vcmp.query(`
SELECT DISTINCT SELECT DISTINCT
camera_kind.id AS id,camera_kind.kind AS kind camera_kind.id AS id,camera_kind.kind AS kind
FROM camera_kind FROM camera_kind
INNER JOIN camera INNER JOIN camera
ON camera_kind.id = camera.kind_id ON camera_kind.id = camera.kind_id
INNER JOIN camera_status_alarm INNER JOIN camera_status_alarm
ON camera.channel_no = camera_status_alarm.channel_no ON camera.channel_no = camera_status_alarm.channel_no
AND camera.serial_no = camera_status_alarm.serial_no AND camera.serial_no = camera_status_alarm.serial_no
`).toPromise() 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.status = 200;
ctx.body = kindRes ctx.body = kindRes
} catch (error) { } 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) { async function alarmList (ctx) {
try { try {
const { models } = ctx.fs.dc; const { models } = ctx.fs.dc;
const { clickHouse } = ctx.app.fs const { clickHouse } = ctx.app.fs
const { utils: { judgeSuper, anxinStrucIdRange } } = ctx.app.fs const { utils: { judgeSuper, anxinStrucIdRange } } = ctx.app.fs
const { database: anxinyun } = clickHouse.anxinyun.opts.config 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({ let anxinStruc = await anxinStrucIdRange({
ctx, pepProjectId, keywordTarget, keyword ctx, pepProjectId, keywordTarget, keyword
@ -78,7 +121,7 @@ async function alarmList (ctx) {
) )
`) `)
} }
if(statusId){ if (statusId) {
statusAlarmWhereOption.push(`camera_status_alarm.status_id = ${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: "级联" } let accessType = { yingshi: "萤石云", nvr: "NVR", ipc: "IPC", cascade: "级联" }
try { try {
const { clickHouse, utils: { simpleExcelDown, getExportAlarmHeader } } = ctx.app.fs; 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 { try {
const { alarmId, content, confirmPost } = ctx.request.body; const { alarmId, content, confirmPost } = ctx.request.body;
// TODO: 以视频·应用的秘钥进行鉴权 // TODO: 以视频·应用的秘钥进行鉴权
@ -451,5 +494,6 @@ module.exports = {
alarmList, alarmList,
confirm, confirm,
alarmAdded, alarmAdded,
vcmpAppAuthToken vcmpAppAuthToken,
exceptionType
}; };

3
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 }; app.fs.api.logAttr['GET/vcmp/auth'] = { content: '获取视频平台应用鉴权token', visible: true };
router.get('/vcmp/auth', videoAlarm.vcmpAppAuthToken); 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);
}; };

33
web/client/src/sections/control/containers/control.jsx

@ -155,13 +155,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject
}) })
} else { } else {
if (ProblemAlarm?.length > 0) { if (ProblemAlarm?.length > 0) {
ProblemAlarm.sort((a, b) => { ProblemAlarm.sort((a, b) => (moment(a.StartTime).isBefore(b.StartTime) ? 1 : -1))
if (moment(a.StartTime).isBefore(b.StartTime)) {
return 1
} else {
return -1
}
})
setProblemsList([...ProblemAlarm, ...problemsList]) setProblemsList([...ProblemAlarm, ...problemsList])
} }
} }
@ -187,19 +181,12 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject
} }
}) })
} }
newest.sort((a, b) => { newest.sort((a, b) => (moment(a.time).isBefore(b.time) ? 1 : -1))
if (moment(a.time).isBefore(b.time)) {
return 1
} else {
return -1
}
})
querydata.current = [...newest, ...querydata.current] querydata.current = [...newest, ...querydata.current]
setQueryData1([...querydata.current]) setQueryData1([...querydata.current])
} }
}, [socketData]) }, [socketData])
console.log(querydata.current);
useEffect(() => { useEffect(() => {
consoleToollink() consoleToollink()
@ -423,13 +410,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject
id: v.id, id: v.id,
})) }))
} }
data.sort((a, b) => { data.sort((a, b) => (moment(a.time).isBefore(b.time) ? 1 : -1))
if (moment(a.time).isBefore(b.time)) {
return 1
} else {
return -1
}
})
// console.log(data) // console.log(data)
querydata.current = data querydata.current = data
setQueryData1(data) setQueryData1(data)
@ -505,13 +486,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject
id: v.id, id: v.id,
})) }))
} }
data.sort((a, b) => { data.sort((a, b) => (moment(a.time).isBefore(b.time) ? 1 : -1))
if (moment(a.time).isBefore(b.time)) {
return 1
} else {
return -1
}
})
querydata.current = data querydata.current = data
setQueryData1(data) setQueryData1(data)
} }

11
web/client/src/sections/install/components/systemModal.jsx

@ -20,7 +20,8 @@ function adminModal (props) {
anxincloudArr,// anxincloudArr,//
anxinDelete,//, anxinDelete,//,
appArr,// appArr,//
bindId bindId,
mapping //
} = props; } = props;
const { install } = actions; const { install } = actions;
const form = useRef();// const form = useRef();//
@ -236,16 +237,14 @@ function adminModal (props) {
} }
</Form.Select> </Form.Select>
<Form.Select <Form.Select
label="添加映射分类:" label="映射分类:"
field="mappingClass" field="mappingClass"
multiple
filter filter
placeholder="请选择映射类型" placeholder="请选择映射类型"
style={{ width: 425 }} style={{ width: 425 }}
initValue={appArr || []} initValue={mapping}
showClear showClear
renderSelectedItem={renderMultipleWithCustomTag} >
>
{ {
[ [
{ name: '智慧类', value: 'wisdom' }, { name: '智慧类', value: 'wisdom' },

895
web/client/src/sections/install/containers/system.jsx

@ -8,472 +8,477 @@ import '../style.less'
import { set } from 'nprogress'; import { set } from 'nprogress';
const Example = (props) => { const Example = (props) => {
const { dispatch, actions, user, loading, socket } = props const { dispatch, actions, user, loading, socket } = props
const { install } = actions; const { install } = actions;
const [query, setQuery] = useState({ limit: 10, page: 0 }); // const [query, setQuery] = useState({ limit: 10, page: 0 }); //
const [limits, setLimits] = useState()// const [limits, setLimits] = useState()//
const mylimits = useRef(); // const mylimits = useRef(); //
const [selected, setSelected] = useState([]) // const [selected, setSelected] = useState([]) //
const [systemModal, setSystemModal] = useState(false) // const [systemModal, setSystemModal] = useState(false) //
const [systemEdit, setSystemEdit] = useState(false) // const [systemEdit, setSystemEdit] = useState(false) //
const [anxincloudList, setAnxincloudList] = useState([]) // const [anxincloudList, setAnxincloudList] = useState([]) //
const [peplist, setPeplist] = useState([]) //PEP const [peplist, setPeplist] = useState([]) //PEP
const [appList, setAppList] = useState([]) // const [appList, setAppList] = useState([]) //
const [pepProjectId, setPepProjectId] = useState() //id const [pepProjectId, setPepProjectId] = useState() //id
const [anxincloudArr, setAnxincloudArr] = useState([]) // const [anxincloudArr, setAnxincloudArr] = useState([]) //
const [pepname, setPepname] = useState() // const [pepname, setPepname] = useState() //
const [anxinDelete, setAnxinDelete] = useState([]) //, const [anxinDelete, setAnxinDelete] = useState([]) //,
const [appArr, setAppArr] = useState([]) // const [appArr, setAppArr] = useState([]) //
const [bindId, setBindId] = useState() //id const [bindId, setBindId] = useState() //id
const [tableKey, setTableKey] = useState([]) //id const [tableKey, setTableKey] = useState([]) //id
const page = useRef(query.page);// const page = useRef(query.page);//
const [mapping, setMapping] = useState() //
function handleRow (record, index) {// function handleRow (record, index) {//
// //
if (index % 2 === 0) { if (index % 2 === 0) {
return { return {
style: { style: {
background: '#FAFCFF', background: '#FAFCFF',
} }
}; };
} else { } else {
return {}; return {};
} }
} }
const [tableData, setTableData] = useState([]) // const [tableData, setTableData] = useState([]) //
const getPepProject = ()=>{ const getPepProject = () => {
dispatch(install.getProjectPmanage(query)).then((res) => {//PEP dispatch(install.getProjectPmanage(query)).then((res) => {//PEP
setPeplist(res.payload.data) setPeplist(res.payload.data)
}) })
} }
useEffect(() => { useEffect(() => {
dispatch(install.getProjectAnxincloud(query)).then((res) => {// dispatch(install.getProjectAnxincloud(query)).then((res) => {//
setAnxincloudList(res.payload.data) setAnxincloudList(res.payload.data)
}) })
getPepProject() getPepProject()
dispatch(install.getProjectAppList(query)).then((res) => {// dispatch(install.getProjectAppList(query)).then((res) => {//
setAppList(res.payload.data) setAppList(res.payload.data)
}) })
console.log('user',user); console.log('user', user);
}, []) }, [])
useEffect(() => { useEffect(() => {
getProjectPomsList(); getProjectPomsList();
}, [query]); }, [query]);
function getProjectPomsList () { function getProjectPomsList () {
dispatch(install.getProjectPoms(query)).then((res) => {// dispatch(install.getProjectPoms(query)).then((res) => {//
if (res.success) { if (res.success) {
let mytableData = JSON.parse(JSON.stringify(res.payload.data.rows)); let mytableData = JSON.parse(JSON.stringify(res.payload.data.rows));
let mytableKey = [] let mytableKey = []
for (let index = 0; index < mytableData.length; index++) { for (let index = 0; index < mytableData.length; index++) {
mytableData[index].key = mytableData[index].id mytableData[index].key = mytableData[index].id
mytableKey.push(mytableData[index].id) mytableKey.push(mytableData[index].id)
}
setTableKey(mytableKey)
setTableData(mytableData)
setLimits(res.payload.data.count)
mylimits.current = res.payload.data.rows.length
} }
}) setTableKey(mytableKey)
} setTableData(mytableData)
const [columns, setColumns] = useState([// setLimits(res.payload.data.count)
{ mylimits.current = res.payload.data.rows.length
title: "序号", }
dataIndex: "index", })
key: 'index', }
render: (text, r, index) => { const [columns, setColumns] = useState([//
return index + 1; {
}, title: "序号",
}, dataIndex: "index",
{ key: 'index',
title: 'PEP项企项目名称', render: (text, r, index) => {
dataIndex: "pepProjectName", return index + 1;
key: 'pepProjectName', },
render: (_, row) => { },
return ( {
<div style={{ display: 'flex', alignItems: 'center' }}> title: 'PEP项企项目名称',
{ dataIndex: "pepProjectName",
row.pepProjectIsDelete == 1 ? ( key: 'pepProjectName',
<Tooltip content={'失效,项目已在【项企PEP】中被删除!'}> render: (_, row) => {
<div style={{ marginRight: 5 }}> return (
<img src="/assets/images/install/risk.png" alt="" style={{ height: 24, width: 24, }} /> <div style={{ display: 'flex', alignItems: 'center' }}>
</div> {
</Tooltip>) : ('') row.pepProjectIsDelete == 1 ? (
} <Tooltip content={'失效,项目已在【项企PEP】中被删除!'}>
<Tooltip content={row.pepProjectName || row.name}> <div style={{ marginRight: 5 }}>
<div style={{ color: row.pepProjectIsDelete == 1 ? 'rgb(249, 57, 32)' : '', width: row?.pepProjectName?.length > 7 || row?.name?.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}> <img src="/assets/images/install/risk.png" alt="" style={{ height: 24, width: 24, }} />
{row.pepProjectName || row.name} </div>
</div> </Tooltip>) : ('')
}
<Tooltip content={row.pepProjectName || row.name}>
<div style={{ color: row.pepProjectIsDelete == 1 ? 'rgb(249, 57, 32)' : '', width: row?.pepProjectName?.length > 7 || row?.name?.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
{row.pepProjectName || row.name}
</div>
</Tooltip>
{
row.pepProjectName ? (
<div style={{
height: 18, marginLeft: 4,
background: 'linear-gradient(180deg, #EBF5FF 0%, #EBF5FF 0%, #D3E8FF 100%)',
borderRadius: 2, display: 'flex', alignItems: 'center'
}}>
<div>
<img src="/assets/images/install/icon_zhengque.png" alt="" style={{ height: 10, width: 10, marginLeft: 4, marginRight: 9 }} />
</div>
<div style={{ color: '#0F7EFB', fontSize: 11, marginRight: 12 }}>
{row.constructionStatus}
</div>
</div>
) : (
<div style={{
height: 18, marginLeft: 4,
background: 'linear-gradient(180deg, #99C7DD 0%, #3048FC 100%)',
borderRadius: 2, display: 'flex', alignItems: 'center'
}}>
<div>
<img src="/assets/images/install/icon_POMS.png" alt="" style={{ height: 10, width: 10, marginLeft: 4, marginRight: 9 }} />
</div>
<div style={{ color: '#FFFFFF', fontSize: 11, marginRight: 12 }}>
POMS
</div>
</div>
)
}
</div>
)
}
},
{
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 (
<div style={{ display: 'flex', alignItems: 'center' }}>
{
anxinerror ? (
<Tooltip content={anxinerrorArr.join(',') + ',项目已在【安心云】中被删除'}>
<div style={{ marginRight: 5 }}>
<img src="/assets/images/install/risk.png" alt="" style={{ height: 24, width: 24, }} />
</div>
</Tooltip>) : ('')
}
{
row.anxinProject.map((item, index) => {
return (
<div className='myseparator' key={index} style={{ display: 'flex', alignItems: 'center' }}>
{
row.anxinProject.length >= 3 ? (
<Tooltip content={item.name}>
<div style={{ width: item.name.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: index > 2 ? 'none' : '', color: item.projectState == -1 ? '#F93920' : '' }}>
{item.name}
</div>
</Tooltip>
) : row.anxinProject.length == 2 ? (
<Tooltip content={item.name}>
<div style={{ width: item.name.length > 12 ? '173.5px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.projectState == -1 ? '#F93920' : '' }}>
{item.name}
</div>
</Tooltip>
) : (
<Tooltip content={item.name}>
<div style={{ width: item.name.length > 25 ? '358px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.projectState == -1 ? '#F93920' : '' }}>
{item.name}
</div>
</Tooltip>
)
}
<div className='separator' style={{ width: 1, height: 12, border: '1px solid #DCDEE0', margin: '0px 10px', display: index > 1 ? 'none' : '' }}></div>
</div>
)
})
}
{
row.anxinProject.length > 3 ? (
<Tooltip content={
<div style={{ display: 'flex', flexWrap: 'wrap' }}>
{
row.anxinProject.map((item, index) => {
return (
<div key={index} style={{ color: item.projectState == -1 ? '#F93920' : '' }}>
{item.name}<span style={{ color: '#FFFFFF' }}>,</span>
</div>
)
})
}
</div>
} trigger="click" style={{ lineHeight: 2 }}>
<div style={{ fontSize: 14, color: '#005ABD', marginLeft: 8, cursor: "pointer", }}>
+{row.anxinProject.length - 3}
</div>
</Tooltip> </Tooltip>
{ ) : ('')
row.pepProjectName ? ( }
<div style={{ </div>
height: 18, marginLeft: 4, )
background: 'linear-gradient(180deg, #EBF5FF 0%, #EBF5FF 0%, #D3E8FF 100%)', }
borderRadius: 2, display: 'flex', alignItems: 'center' },
}}> {
<div> title: '关联时间',
<img src="/assets/images/install/icon_zhengque.png" alt="" style={{ height: 10, width: 10, marginLeft: 4, marginRight: 9 }} /> dataIndex: "createTime",
</div> key: 'time',
<div style={{ color: '#0F7EFB', fontSize: 11, marginRight: 12 }}> render: (_, row) => {
{row.constructionStatus} return moment(row.createTime).format("YYYY-MM-DD HH:mm:ss")||'无';
</div> }
</div> },
) : ( {
<div style={{ title: '修改时间',
height: 18, marginLeft: 4, dataIndex: "updateTime",
background: 'linear-gradient(180deg, #99C7DD 0%, #3048FC 100%)', key: 'updateTime',
borderRadius: 2, display: 'flex', alignItems: 'center' 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"));
<div> }
<img src="/assets/images/install/icon_POMS.png" alt="" style={{ height: 10, width: 10, marginLeft: 4, marginRight: 9 }} /> },
</div> {
<div style={{ color: '#FFFFFF', fontSize: 11, marginRight: 12 }}> title: '添加人员',
POMS dataIndex: "pepUserName",
</div> key: 'pepUserName',
</div> render: (_, row) => {
) return row.pepUserName||'无'
}
},
{
title: "管理",
width: "20%",
dataIndex: "text",
key: 'text',
render: (_, row) => {
return (
<div style={{ display: "flex" }}>
<Button
theme="borderless"
disabled={row.pepProjectIsDelete == 1}
onClick={() => {
setSystemModal(true);
setPepname(row.name)
if (!row.name) {
setPepProjectId(row.pepProjectId)
} }
</div> else {
) setPepProjectId()
}
},
{
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 (
<div style={{ display: 'flex', alignItems: 'center' }}>
{
anxinerror ? (
<Tooltip content={anxinerrorArr.join(',') + ',项目已在【安心云】中被删除'}>
<div style={{ marginRight: 5 }}>
<img src="/assets/images/install/risk.png" alt="" style={{ height: 24, width: 24, }} />
</div>
</Tooltip>) : ('')
} }
{ let myanxinArr = []
row.anxinProject.map((item, index) => { let anxinErrorList = []
return ( for (let i = 0; i < row.anxinProject.length; i++) {
<div className='myseparator' key={index} style={{ display: 'flex', alignItems: 'center' }}> if (row.anxinProject[i].projectState !== -1) {
{ myanxinArr.push(row.anxinProject[i].id)
row.anxinProject.length >= 3 ? ( }
<Tooltip content={item.name}> else {
<div style={{ width: item.name.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: index > 2 ? 'none' : '', color: item.projectState == -1 ? '#F93920' : '' }}> anxinErrorList.push(row.anxinProject[i].name)
{item.name} }
</div>
</Tooltip>
) : row.anxinProject.length == 2 ? (
<Tooltip content={item.name}>
<div style={{ width: item.name.length > 12 ? '173.5px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.projectState == -1 ? '#F93920' : '' }}>
{item.name}
</div>
</Tooltip>
) : (
<Tooltip content={item.name}>
<div style={{ width: item.name.length > 25 ? '358px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.projectState == -1 ? '#F93920' : '' }}>
{item.name}
</div>
</Tooltip>
)
}
<div className='separator' style={{ width: 1, height: 12, border: '1px solid #DCDEE0', margin: '0px 10px', display: index > 1 ? 'none' : '' }}></div>
</div>
)
})
} }
{ setAnxinDelete(anxinErrorList)
row.anxinProject.length > 3 ? ( let myapparr = []
<Tooltip content={ let myarrarrList = JSON.parse(JSON.stringify(row.apps))
<div style={{ display: 'flex', flexWrap: 'wrap' }}> for (let j = 0; j < row.apps.length; j++) {
{ delete myarrarrList[j].projectApp
row.anxinProject.map((item, index) => { myapparr.push(JSON.stringify(myarrarrList[j]))
return (
<div key={index} style={{ color: item.projectState == -1 ? '#F93920' : '' }}>
{item.name}<span style={{ color: '#FFFFFF' }}>,</span>
</div>
)
})
}
</div>
} trigger="click" style={{ lineHeight: 2 }}>
<div style={{ fontSize: 14, color: '#005ABD', marginLeft: 8, cursor: "pointer", }}>
+{row.anxinProject.length - 3}
</div>
</Tooltip>
) : ('')
} }
</div>
) setAppArr(myapparr)
} setAnxincloudArr(myanxinArr)
}, setBindId(row.id)
{ setMapping(row?.mappingClass)
title: '关联时间', setSystemEdit(true)
dataIndex: "createTime", }}
key: 'time', >
render: (_, row) => { 修改
return moment(row.createTime).format("YYYY-MM-DD HH:mm:ss"); </Button>
} <Popconfirm
}, title="删除后对应的项目全局将无法进入和显示,对应的信鸽服务也会被删除"
{ arrowPointAtCenter={false}
title: '修改时间', showArrow={true}
dataIndex: "updateTime", position="topRight"
key: 'updateTime', onConfirm={() => {
render: (_, row) => { dispatch(install.deleteProjectBind({ bindId: row?.id, msg: '删除安心云、项目管理项目绑定关系' })).then(() => {
return moment(row.updateTime).format("YYYY-MM-DD HH:mm:ss"); getPepProject()
} if (page.current > 0 && mylimits.current < 2) {
}, setQuery({ limit: 10, page: page.current - 1 })
{ } else {
title: '添加人员', setQuery({ limit: 10, page: page.current })
dataIndex: "pepUserName", }
key: 'pepUserName', })
render: (_, row) => { }}
return row.pepUserName >
} <Button theme="borderless">删除</Button>
}, </Popconfirm>
{ </div >
title: "管理", );
width: "20%", },
dataIndex: "text", },
key: 'text', ])
render: (_, row) => { const rowSelection = {
return ( selectedRowKeys: selected,
<div style={{ display: "flex" }}> // onSelect: (record, selected) => {
<Button // // console.log(`select row: ${selected}`, record);
theme="borderless" // },
disabled={row.pepProjectIsDelete == 1} // onSelectAll: (selected, selectedRows) => {
onClick={() => { // // console.log(`select all rows: ${selected}`, selectedRows);
setSystemModal(true); // },
setPepname(row.name) onChange: (selectedRowKeys, selectedRows) => {
if (!row.name) { setSelected(selectedRows.map(v => v.key))
setPepProjectId(row.pepProjectId) },
} }
else { return (
setPepProjectId() <>
} <div style={{ background: '#FFFFFF', margin: '8px 12px', padding: '20px 20px 0px 20px' }}>
let myanxinArr = [] <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
let anxinErrorList = [] <div style={{ display: 'flex', alignItems: 'center' }}>
for (let i = 0; i < row.anxinProject.length; i++) { <div style={{ width: 0, height: 20, borderLeft: '3px solid #005ABD', borderTop: '3px solid transparent', borderBottom: '3px solid transparent' }}></div>
if (row.anxinProject[i].projectState !== -1) { <div style={{ fontFamily: "YouSheBiaoTiHei", fontSize: 24, color: '#101531', marginLeft: 8 }}>系统映射</div>
myanxinArr.push(row.anxinProject[i].id) <div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>ASSOCIATION & MAPPING</div>
} </div>
else { <div style={{ marginRight: 20 }}>
anxinErrorList.push(row.anxinProject[i].name) <Button
} theme="solid"
} type="primary"
setAnxinDelete(anxinErrorList) style={{
let myapparr = [] width: 108,
let myarrarrList = JSON.parse(JSON.stringify(row.apps)) height: 32,
for (let j = 0; j < row.apps.length; j++) { borderRadius: 2,
delete myarrarrList[j].projectApp marginLeft: 40
myapparr.push(JSON.stringify(myarrarrList[j])) }}
} onClick={() => {
setAppArr(myapparr) setSystemModal(true);
setAnxincloudArr(myanxinArr) setSystemEdit(false)
setBindId(row.id) setPepProjectId()
setSystemEdit(true) setPepname()
}} setAnxinDelete([])
> setAppArr([])
修改 setAnxincloudArr()
</Button> setBindId()
<Popconfirm setMapping('')
title="删除后对应的项目全局将无法进入和显示,对应的信鸽服务也会被删除" }}
arrowPointAtCenter={false} >
showArrow={true} 添加映射关系
position="topRight" </Button>
onConfirm={() => { </div>
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 })
}
})
}}
>
<Button theme="borderless">删除</Button>
</Popconfirm>
</div>
);
},
},
])
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 (
<>
<div style={{ background: '#FFFFFF', margin: '8px 12px', padding: '20px 20px 0px 20px' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ width: 0, height: 20, borderLeft: '3px solid #005ABD', borderTop: '3px solid transparent', borderBottom: '3px solid transparent' }}></div>
<div style={{ fontFamily: "YouSheBiaoTiHei", fontSize: 24, color: '#101531', marginLeft: 8 }}>系统映射</div>
<div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>ASSOCIATION & MAPPING</div>
</div>
<div style={{ marginRight: 20 }}>
<Button
theme="solid"
type="primary"
style={{
width: 108,
height: 32,
borderRadius: 2,
marginLeft: 40
}}
onClick={() => {
setSystemModal(true);
setSystemEdit(false)
setPepProjectId()
setPepname()
setAnxinDelete([])
setAppArr([])
setAnxincloudArr()
setBindId()
}}
>
添加映射关系
</Button>
</div>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 20, marginTop: 5 }}>
<div style={{ fontSize: 12, color: '#8B8B8B' }}>平台通过映射能力将多个系统的结构化非结构化半结构化数据按照平台算法进行分类关联形成整体项目信息结构以项企PEP的项目名称进行规范</div>
</div>
<div style={{ marginTop: 20 }}>
<Skeleton
loading={loading}
active={true}
placeholder={SkeletonScreen()}
>
<Table
columns={columns}
dataSource={tableData}
bordered={false}
empty="暂无数据"
pagination={false}
onRow={handleRow}
rowSelection={rowSelection}
/>
</Skeleton>
<div
style={{
display: "flex",
justifyContent: "space-between",
padding: "20px 20px",
}}
>
<div>
<div style={{ display: 'inline-block', lineHeight: '30px', fontSize: 13, color: 'gray' }}>勾选<span style={{ fontWeight: 400, color: '#0F7EFB', }}> {selected.length} </span>信息</div>
<Button onClick={() => {
if (selected.length == tableKey.length) {
setSelected([])
}
else {
setSelected(tableKey)
}
}} style={{ fontSize: 13, width: 93, height: 24, borderRadius: '1px', background: '#FFFFFF', border: '1px solid #0F7EFB', color: '#0F7EFB', fontWeight: 400, margin: '0 10px' }}>
{mylimits.current == selected.length ? '取消全选' : '全选'}
</Button>
<Popconfirm
title="删除后对应的项目全局将无法进入和显示,对应的信鸽服务也会被禁用"
arrowPointAtCenter={false}
showArrow={true}
position="topRight"
onConfirm={() => {
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([])
})
}}
>
<Button type='primary' theme='solid' style={{ fontSize: 13, width: 93, height: 24, borderRadius: '1px', border: '1px solid #0F7EFB', color: '#FFFFFF', fontWeight: 400, }}>批量删除</Button>
</Popconfirm>
</div>
<div style={{ display: 'flex', }}>
<span style={{ lineHeight: "30px", fontSize: 13, color: 'rgba(0,90,189,0.8)' }}>
{limits}条信息
</span>
<Pagination
className="22"
total={limits}
showSizeChanger
currentPage={query.page + 1}
pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => {
setQuery({ limit: pageSize, page: currentPage - 1 });
page.current = currentPage - 1
setSelected([])
}}
/>
</div>
</div>
</div>
</div> </div>
{// <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 20, marginTop: 5 }}>
systemModal ? <div style={{ fontSize: 12, color: '#8B8B8B' }}>平台通过映射能力将多个系统的结构化非结构化半结构化数据按照平台算法进行分类关联形成整体项目信息结构以项企PEP的项目名称进行规范</div>
<SystemModal </div>
visible={true} <div style={{ marginTop: 20 }}>
anxincloudList={anxincloudList} <Skeleton
systemEdit={systemEdit} loading={loading}
peplist={peplist} active={true}
appList={appList} placeholder={SkeletonScreen()}
pepname={pepname} >
anxincloudArr={anxincloudArr} <Table
pepProjectId={pepProjectId} columns={columns}
anxinDelete={anxinDelete} dataSource={tableData}
appArr={appArr} bordered={false}
bindId={bindId} empty="暂无数据"
cancel={() => { pagination={false}
setSystemModal(false); onRow={handleRow}
rowSelection={rowSelection}
/>
</Skeleton>
<div
style={{
display: "flex",
justifyContent: "space-between",
padding: "20px 20px",
}}
>
<div>
<div style={{ display: 'inline-block', lineHeight: '30px', fontSize: 13, color: 'gray' }}>勾选<span style={{ fontWeight: 400, color: '#0F7EFB', }}> {selected.length} </span>信息</div>
<Button onClick={() => {
if (selected.length == tableKey.length) {
setSelected([])
}
else {
setSelected(tableKey)
}
}} style={{ fontSize: 13, width: 93, height: 24, borderRadius: '1px', background: '#FFFFFF', border: '1px solid #0F7EFB', color: '#0F7EFB', fontWeight: 400, margin: '0 10px' }}>
{mylimits.current == selected.length ? '取消全选' : '全选'}
</Button>
<Popconfirm
title="删除后对应的项目全局将无法进入和显示,对应的信鸽服务也会被禁用"
arrowPointAtCenter={false}
showArrow={true}
position="topRight"
onConfirm={() => {
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); <Button type='primary' theme='solid' style={{ fontSize: 13, width: 93, height: 24, borderRadius: '1px', border: '1px solid #0F7EFB', color: '#FFFFFF', fontWeight: 400, }}>批量删除</Button>
getProjectPomsList() </Popconfirm>
getPepProject() </div>
}} > <div style={{ display: 'flex', }}>
</SystemModal> : '' <span style={{ lineHeight: "30px", fontSize: 13, color: 'rgba(0,90,189,0.8)' }}>
} {limits}条信息
</> </span>
) <Pagination
className="22"
total={limits}
showSizeChanger
currentPage={query.page + 1}
pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => {
setQuery({ limit: pageSize, page: currentPage - 1 });
page.current = currentPage - 1
setSelected([])
}}
/>
</div>
</div>
</div>
</div>
{//
systemModal ?
<SystemModal
visible={true}
anxincloudList={anxincloudList}
systemEdit={systemEdit}
peplist={peplist}
appList={appList}
pepname={pepname}
anxincloudArr={anxincloudArr}
pepProjectId={pepProjectId}
anxinDelete={anxinDelete}
mapping={mapping}
appArr={appArr}
bindId={bindId}
cancel={() => {
setSystemModal(false);
}}
close={() => {
setSystemModal(false);
getProjectPomsList()
getPepProject()
}} >
</SystemModal> : ''
}
</>
)
} }
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth, global, ProjectPoms } = state; const { auth, global, ProjectPoms } = state;
return { return {
loading: ProjectPoms.isRequesting, loading: ProjectPoms.isRequesting,
user: auth.user, user: auth.user,
actions: global.actions, actions: global.actions,
// members: members.data, // members: members.data,
}; };
} }
export default connect(mapStateToProps)(Example); export default connect(mapStateToProps)(Example);

11
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) { // export function putAlarmVideoConfirm (data) { //
return dispatch => basicAction({ return dispatch => basicAction({
type: 'put', type: 'put',

8
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) => { dispatch(problem.getAlarmDataDetailAgg({ alarmId: alarmId })).then((res) => {
if (res?.success) { if (res?.success) {
let dataSort = res.payload.data || [] let dataSort = res.payload.data || []
dataSort.sort((a, b) => { dataSort.sort((a, b) => (moment(a.hours).isBefore(b.hours) ? -1 : 1))
if (moment(a.hours).isBefore(b.hours)) {
return -1
} else {
return 1
}
})
let data = { let data = {
grid: { grid: {
left: '5%', left: '5%',

11
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, 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 { problem } = actions
const [count, setCount] = useState(0) // const [count, setCount] = useState(0) //
const [checkAll, setCheckAll] = useState(true) // const [checkAll, setCheckAll] = useState(true) //
const api = useRef(); const api = useRef();
const search = useRef({ const search = useRef({
state: '', keywordTarget: '', keyword: '', kindId: '', groupUnitId: '', state: '', keywordTarget: '', keyword: '', kindId: '', groupUnitId: '', statusId: '',
errType: '', confirmState: '', onlineState: '', sustainTimeStart: '', sustainTimeEnd: '' errType: '', confirmState: '', onlineState: '', sustainTimeStart: '', sustainTimeEnd: ''
}) })
const kindName = useRef() 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 }))) 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, keywordTarget: v.keywordTarget,
keyword: v.keyword, keyword: v.keyword,
kindId: v.kindId, kindId: v.kindId,
statusId: v.statusId,
groupUnitId: v.groupUnitId, groupUnitId: v.groupUnitId,
errType: v.errType, errType: v.errType,
confirmState: v.confirmState, confirmState: v.confirmState,
@ -349,6 +355,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
keywordTarget: v.keywordTarget, keywordTarget: v.keywordTarget,
keyword: v.keyword, keyword: v.keyword,
kindId: v.kindId, kindId: v.kindId,
statusId: v.statusId,
groupUnitId: v.groupUnitId, groupUnitId: v.groupUnitId,
errType: v.errType, errType: v.errType,
confirmState: v.confirmState, confirmState: v.confirmState,

7
web/client/src/sections/problem/containers/dataAlarm.jsx

@ -31,6 +31,7 @@ const DataAlarm = (props) => {
const [content, setContent] = useState(false); // const [content, setContent] = useState(false); //
const [selected, setSelected] = useState([]) // const [selected, setSelected] = useState([]) //
const [genre, setGenre] = useState([]) // const [genre, setGenre] = useState([]) //
const [statusId, setStatusId] = useState([]) //
const [checkPop, setCheckPop] = useState(false) // const [checkPop, setCheckPop] = useState(false) //
const [alarmId, setAlarmId] = useState(false) //alarmId const [alarmId, setAlarmId] = useState(false) //alarmId
const [query, setQuery] = useState({ limit: 10, page: 0 }) // const [query, setQuery] = useState({ limit: 10, page: 0 }) //
@ -112,6 +113,10 @@ const DataAlarm = (props) => {
name: '设备类型', field: 'kindId', name: '设备类型', field: 'kindId',
data: genre, data: genre,
}, },
{
name: '异常类型', field: 'statusId',
data: statusId,
},
{ {
name: '异常状态', field: 'state', name: '异常状态', field: 'state',
data: [ data: [
@ -424,11 +429,13 @@ const DataAlarm = (props) => {
selected={selected} selected={selected}
setSelected={setSelected} setSelected={setSelected}
setGenre={setGenre} setGenre={setGenre}
setStatusId={setStatusId}
query={query} query={query}
setQuery={setQuery} setQuery={setQuery}
tableData={tableData} tableData={tableData}
setTableData={setTableData} setTableData={setTableData}
genre={genre} genre={genre}
statusId={statusId}
location={props.location?.query} location={props.location?.query}
/> />
{setup ? ( {setup ? (

1
web/client/src/utils/webapi.js

@ -47,6 +47,7 @@ export const ApiTable = {
getAlarmVideoDeviceKind: 'alarm/video/device_kind', //查询视频设备类型 getAlarmVideoDeviceKind: 'alarm/video/device_kind', //查询视频设备类型
putAlarmVideoConfirm: 'alarm/video/confirm', //确认视频告警信息 putAlarmVideoConfirm: 'alarm/video/confirm', //确认视频告警信息
getVcmpAuth: 'vcmp/auth', // 获取视频平台应用鉴权token getVcmpAuth: 'vcmp/auth', // 获取视频平台应用鉴权token
getAlarmVideoExceptionStatusId: 'alarm/video/exception_statusId', //查询视频设备类型
//服务-信鸽服务 //服务-信鸽服务
getPush: "push", //获取推送配置列表 getPush: "push", //获取推送配置列表

Loading…
Cancel
Save