巴林闲侠 2 years ago
parent
commit
48fb0503f5
  1. 4
      api/app/lib/controllers/alarm/app.js
  2. 8
      api/app/lib/controllers/project/index.js
  3. 11
      web/client/src/layout/actions/global.js
  4. 108
      web/client/src/layout/components/header/index.jsx
  5. 6
      web/client/src/layout/reducers/global.js
  6. 16
      web/client/src/sections/problem/components/inspection.jsx
  7. 4
      web/client/src/sections/problem/components/sideSheet.jsx
  8. 21
      web/client/src/sections/problem/components/tableData.jsx
  9. 6
      web/client/src/sections/problem/containers/dataAlarm.jsx

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

@ -36,12 +36,12 @@ async function inspectionList (ctx) {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { clickHouse } = ctx.app.fs const { clickHouse } = ctx.app.fs
const { utils: { anxinStrucIdRange, pomsProjectRange } } = ctx.app.fs const { utils: { anxinStrucIdRange, pomsProjectRange } } = ctx.app.fs
const { timeStart, timeEnd, projectId, appId, noted } = ctx.query const { pepProjectId, timeStart, timeEnd, projectId, appId, noted } = ctx.query
let pomsProjectIds = null let pomsProjectIds = null
if (!projectId && !appId) { if (!projectId && !appId) {
let pomsProject = await pomsProjectRange({ let pomsProject = await pomsProjectRange({
ctx, ctx, pepProjectId
}) })
pomsProjectIds = pomsProject.map(p => p.id) pomsProjectIds = pomsProject.map(p => p.id)
} }

8
api/app/lib/controllers/project/index.js

@ -22,8 +22,8 @@ async function pomsProject (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { clickHouse } = ctx.app.fs const { clickHouse } = ctx.app.fs
const { userId, pepUserId } = ctx.fs.api const { userId, pepUserId, userInfo, pepUserInfo } = ctx.fs.api
const { limit, page } = ctx.query const { limit, page, global } = ctx.query
let findOption = { let findOption = {
where: { where: {
@ -35,7 +35,9 @@ async function pomsProject (ctx) {
model: models.App, model: models.App,
} }
} }
if (global && !userInfo.role.includes('SuperAdmin') && !userInfo.role.includes('admin')) {
findOption.where = { id: { $in: userInfo.correlationProject } }
}
if (limit) { if (limit) {
findOption.limit = limit findOption.limit = limit
} }

11
web/client/src/layout/actions/global.js

@ -44,3 +44,14 @@ export function initApiRoot () {
}); });
} }
} }
export const PEPPROJECTID = 'PEPPROJECTID';
export function pepProject (pepProjectId) {
return {
type: PEPPROJECTID,
payload: {
pepProjectId: pepProjectId,
}
}
}

108
web/client/src/layout/components/header/index.jsx

@ -1,12 +1,22 @@
"use strict"; "use strict";
import React from "react"; import React, { useEffect, useState } from 'react'
import { connect } from "react-redux"; import { connect, createStore } from "react-redux";
import { SplitButtonGroup, Dropdown, Button, Nav, Avatar } from '@douyinfe/semi-ui'; import Immutable from 'immutable';
import { IconTreeTriangleDown } from '@douyinfe/semi-icons'; import { pepProject } from '../../actions/global';
import { SplitButtonGroup, Dropdown, Button, Nav, Avatar, Input, Tooltip, Tabs, TabPane } from '@douyinfe/semi-ui';
import { IconTreeTriangleDown, IconSearch } from '@douyinfe/semi-icons';
import PerfectScrollbar from "perfect-scrollbar";
import "./index.less"; import "./index.less";
let newScrollbar;
const Header = (props) => { const Header = (props) => {
const { dispatch, history, user, actions, socket, headerItems, tochange } = props; const { dispatch, history, user, actions, socket, headerItems, tochange } = props;
const { install } = actions
const [pomsList, setPomsList] = useState([])
const [pomsName, setPomsName] = useState('全局')
const [pepProjectId, setPepProjectId] = useState()
const [keyword, setKeyword] = useState('')
const [Scrollbar, setScrollbar] = useState(false)
let userRole = user?.pomsUserInfo?.role let userRole = user?.pomsUserInfo?.role
let modalRole = [] let modalRole = []
if (userRole) { if (userRole) {
@ -21,8 +31,36 @@ const Header = (props) => {
modal = [...new Set(modal)] modal = [...new Set(modal)]
modalRole = headerItems?.filter(v => modal.includes(v.itemKey)) modalRole = headerItems?.filter(v => modal.includes(v.itemKey))
if (userRole?.includes('SuperAdmin') || userRole?.includes('admin')) modalRole = headerItems if (userRole?.includes('SuperAdmin') || userRole?.includes('admin')) modalRole = headerItems
}
useEffect(() => {
dispatch(install.getProjectPoms({ global: 1 })).then((res) => { //
if (res.success) {
setPomsList(res.payload.data?.rows?.filter(v => v.pepProjectIsDelete == 0))
}
})
}, [])
useEffect(() => {
const domProject = document.getElementById("overall");
if (domProject) {
newScrollbar = new PerfectScrollbar("#overall", {
suppressScrollX: true,
});
if (domProject && newScrollbar) {
newScrollbar.update();
} }
}
}, [Scrollbar])
useEffect(() => {
dispatch(pepProject(pepProjectId))
console.log();
}, [pepProjectId])
return ( return (
<> <>
<div id="top-slider"> <div id="top-slider">
@ -53,13 +91,65 @@ const Header = (props) => {
), ),
text: ( text: (
<> <>
<SplitButtonGroup style={{ marginLeft: 10 }} aria-label="项目操作按钮组">
<Dropdown
onVisibleChange={(v) => {
setScrollbar(!Scrollbar)
}}
render={
<Dropdown.Menu style={{ minWidth: 270, maxWidth: 714, padding: 20, fontSize: 12 }}>
<Tabs type="button">
<TabPane tab="项目" itemKey="项目">
<div style={{ width: '100%', height: 1, background: "#d5cfcf8c", margin: "8px 0" }}></div>
<Input suffix={<IconSearch />} onChange={(v) => setKeyword(v)} showClear></Input>
<div id='overall' style={{ width: '100%', height: 480, position: "relative", }}>
{pomsList?.length > 0 ?
pomsList.filter(u => u.pepProjectName?.includes(keyword))?.map(v => {
return <Dropdown.Item
key={'pomsList' + v.id}
style={{ width: 224, overflow: 'hidden', borderBottom: '', display: "inline-block", whiteSpace: 'nowrap', color: 'rgb(0, 90, 189)' }}>
{/* <SplitButtonGroup style={{ marginLeft: 10 }} aria-label="项目操作按钮组"> */} {
<Button theme="solid" type="primary" style={{ width: 52, height: 24, background: '#005ABD' }}>全局</Button> v.pepProjectName?.length > 15 ? <Tooltip content={<div>{v.pepProjectName}</div>}>
{/* <Dropdown onVisibleChange={(v) => { }} menu={{}} trigger="click" position="bottomRight"> */} <div style={{}} >
<div onClick={() => {
console.log(v.pepProjectId);
setPomsName(v.pepProjectName)
setPepProjectId(v.pepProjectId)
}}>
{v.pepProjectName?.length > 15 ? `${v.pepProjectName?.substr(0, 15)}` : v.pepProjectName}
</div>
</div>
</Tooltip>
: <div onClick={() => {
console.log(v.pepProjectId);
setPomsName(v.pepProjectName)
setPepProjectId(v.pepProjectId)
}}>{v.pepProjectName}</div>
}
</Dropdown.Item>
}) : ""
}
</div>
</TabPane>
<TabPane tab={<div onClick={() => {
setPomsName('全局')
setPepProjectId('')
}}>全局</div>} itemKey="全局">
</TabPane>
</Tabs>
</Dropdown.Menu>
} trigger="click" position="bottomRight">
<Button theme="solid" type="primary" style={{ height: 24, background: '#005ABD' }}>{
pomsName.length > 15 ? <Tooltip content={<div>{pomsName}</div>}>
<div style={{}}>
{pomsName.length > 15 ? `${pomsName.substr(0, 15)}...` : pomsName}
</div>
</Tooltip> : pomsName
}</Button>
<Button style={{ width: 16, height: 24, background: '#005ABD' }} theme="solid" type="primary" icon={<IconTreeTriangleDown />}></Button> <Button style={{ width: 16, height: 24, background: '#005ABD' }} theme="solid" type="primary" icon={<IconTreeTriangleDown />}></Button>
{/* </Dropdown> */} </Dropdown>
{/* </SplitButtonGroup> */} </SplitButtonGroup>
</> </>
), ),
}} }}

6
web/client/src/layout/reducers/global.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
import Immutable from 'immutable'; import Immutable from 'immutable';
import { INIT_LAYOUT, RESIZE, INIT_API_ROOT } from '../actions/global'; import { INIT_LAYOUT, RESIZE, INIT_API_ROOT,PEPPROJECTID } from '../actions/global';
function global (state = { function global (state = {
title: '', title: '',
@ -33,6 +33,10 @@ function global (state = {
apiRoot: payload.apiRoot, apiRoot: payload.apiRoot,
iotVcmpWeb: payload.iotVcmpWeb iotVcmpWeb: payload.iotVcmpWeb
}).toJS(); }).toJS();
case PEPPROJECTID:
return Immutable.fromJS(state).merge({
pepProjectId: payload.pepProjectId,
}).toJS();
default: default:
return state; return state;
} }

16
web/client/src/sections/problem/components/inspection.jsx

@ -11,7 +11,7 @@ import { log } from "ezuikit-js";
let projectScrollbar; let projectScrollbar;
let timer let timer
const Inspection = ({ dispatch, actions, user, route, statistic }) => { const Inspection = ({ dispatch, actions, user, route, statistic, pepProjectId }) => {
const { problem } = actions const { problem } = actions
const [selectProject, setSelectProject] = useState([]) // const [selectProject, setSelectProject] = useState([]) //
const [applyFilter, setApplyFilter] = useState([]) // const [applyFilter, setApplyFilter] = useState([]) //
@ -26,22 +26,24 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
const api = useRef(); const api = useRef();
const unfoldApi = useRef(false); const unfoldApi = useRef(false);
console.log(pepProjectId);
useEffect(() => { useEffect(() => {
dispatch(problem.getProjectPoms()).then((res) => { dispatch(problem.getProjectPoms({ global: 1 })).then((res) => {
if (res.success) { if (res.success) {
let project = [] let project = []
let apply = [] let apply = []
res.payload.data?.rows?.map(v => { res.payload.data?.rows?.map(v => {
if (!pepProjectId || v.pepProjectId == pepProjectId) {
project.push({ name: v.pepProjectName || v.name || v.id, value: v.id }) project.push({ name: v.pepProjectName || v.name || v.id, value: v.id })
v.apps.map(app => apply.push({ name: app.name, value: app.id })) v.apps.map(app => apply.push({ name: app.name, value: app.id }))
}
}) })
setSelectProject(project) setSelectProject(project)
setApplyFilter(apply) setApplyFilter(apply)
} }
}) })
}, []) }, [pepProjectId])
useEffect(() => { useEffect(() => {
if (projectScrollbar) projectScrollbar.destroy() if (projectScrollbar) projectScrollbar.destroy()
@ -66,14 +68,14 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
dispatch(problem.getAlarmLnspection({ dispatch(problem.getAlarmLnspection({
timeStart: moment().day(moment().day() - 1).startOf('day').format('YYYY-MM-DD HH:mm:ss'), timeStart: moment().day(moment().day() - 1).startOf('day').format('YYYY-MM-DD HH:mm:ss'),
timeEnd: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss') timeEnd: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')
, ...checkPatrol , ...checkPatrol, pepProjectId: pepProjectId
})).then((res) => { })).then((res) => {
if (res.success) { if (res.success) {
setPatrolAbnormal(res.payload.data) setPatrolAbnormal(res.payload.data)
setNotRead(res.payload.data.filter(v => !v.notedTime).length) setNotRead(res.payload.data.filter(v => !v.notedTime).length)
} }
}) })
}, [checkPatrol]) }, [checkPatrol, pepProjectId])
useEffect(() => { useEffect(() => {
@ -334,7 +336,7 @@ function mapStateToProps (state) {
return { return {
user: auth.user, user: auth.user,
actions: global.actions, actions: global.actions,
// global: global, pepProjectId: global.pepProjectId,
// members: members.data, // members: members.data,
}; };
} }

4
web/client/src/sections/problem/components/sideSheet.jsx

@ -13,7 +13,7 @@ function SideSheets ({ dispatch, actions, close, alarmId }) {
const { problem } = actions; const { problem } = actions;
const [clickStyle, setclickStyle] = useState(); const [clickStyle, setclickStyle] = useState();
const [query, setQuery] = useState({ page: 0, pageSize: 10 }); const [query, setQuery] = useState({ page: 0, limit: 10 });
const [dataSource, setdataSource] = useState([]); const [dataSource, setdataSource] = useState([]);
const [option, setOption] = useState({}); const [option, setOption] = useState({});
@ -187,7 +187,7 @@ function SideSheets ({ dispatch, actions, close, alarmId }) {
currentPage={query.page + 1} currentPage={query.page + 1}
pageSizeOpts={[10, 20, 30, 40]} pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => { onChange={(currentPage, pageSize) => {
setQuery({ pageSize: pageSize, page: currentPage - 1 }); setQuery({ limit: pageSize, page: currentPage - 1 });
}} }}
/> />
</div> : ""} </div> : ""}

21
web/client/src/sections/problem/components/tableData.jsx

@ -8,7 +8,7 @@ import { emit } from "superagent";
const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition, const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition, pepProjectId,
selected, setSelected, setIfBulk, setConfirm, setGenre, query, setQuery, tableData, setTableData }) => { selected, setSelected, setIfBulk, setConfirm, setGenre, query, setQuery, tableData, setTableData }) => {
const { problem } = actions const { problem } = actions
@ -21,7 +21,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
useEffect(() => { useEffect(() => {
switch (route) { switch (route) {
case 'useAbnormal': case 'useAbnormal':
dispatch(problem.getAlarmLnspectionApi({ ...search, pepProjectId: '' })).then((res) => { dispatch(problem.getAlarmLnspectionApi({ ...search, pepProjectId: pepProjectId })).then((res) => {
if (res.success) { if (res.success) {
let typeData = { element: "元素异常", apiError: "接口报错 ", timeout: "加载超时" } let typeData = { element: "元素异常", apiError: "接口报错 ", timeout: "加载超时" }
let tableDatas = res.payload.data?.rows.map(v => ({ let tableDatas = res.payload.data?.rows.map(v => ({
@ -34,7 +34,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
createTime: v.createTime ? moment(v.createTime).format("YYYY-MM-DD HH:mm:ss") : "", createTime: v.createTime ? moment(v.createTime).format("YYYY-MM-DD HH:mm:ss") : "",
updateTime: v.updateTime ? moment(v.updateTime).format("YYYY-MM-DD HH:mm:ss") : "", updateTime: v.updateTime ? moment(v.updateTime).format("YYYY-MM-DD HH:mm:ss") : "",
confirmTime: v.confirmTime ? moment(v.confirmTime).format("YYYY-MM-DD HH:mm:ss") : "", confirmTime: v.confirmTime ? moment(v.confirmTime).format("YYYY-MM-DD HH:mm:ss") : "",
alarmContent: v.alarmContent, alarmContent: v.alarmContent || '无',
screenshot: v.screenshot, screenshot: v.screenshot,
type: v.type ? typeData[v.type] : "", type: v.type ? typeData[v.type] : "",
confirm: v.confirm, confirm: v.confirm,
@ -54,7 +54,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
} }
}) })
dispatch(problem.getAlarmVideoList({ ...search, pepProjectId: '' })).then((res) => { dispatch(problem.getAlarmVideoList({ ...search, pepProjectId: pepProjectId })).then((res) => {
if (res.success) { if (res.success) {
let tableDatas = res.payload.data?.map(v => ({ let tableDatas = res.payload.data?.map(v => ({
key: v.alarmId, key: v.alarmId,
@ -72,7 +72,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
resolve: v.resolve || [], resolve: v.resolve || [],
cameraChannelNo: v.cameraChannelNo, cameraChannelNo: v.cameraChannelNo,
cameraSerialNo: v.cameraSerialNo, cameraSerialNo: v.cameraSerialNo,
cameraKindId: v.cameraKindId ? cameraKind?.find(v => v.value == v.cameraKindId)?.name : "", cameraKindId: v.cameraKindId ? cameraKind?.find(u => u.value == v.cameraKindId)?.name : "",
venderName: v.venderName, venderName: v.venderName,
platform: v.platform, platform: v.platform,
confirm: v.confirmContent, confirm: v.confirmContent,
@ -101,7 +101,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
}) })
setGenre(genreData) setGenre(genreData)
if (data && data[0]?.id) { if (data && data[0]?.id) {
dispatch(problem.getAlarmDataList({ ...query, ...search, groupId: data.map(v => v.id).join(), pepProjectId: '' })).then((res) => { dispatch(problem.getAlarmDataList({ ...query, ...search, groupId: data.map(v => v.id).join(), pepProjectId: pepProjectId })).then((res) => {
if (res.success) { if (res.success) {
setCount(res.payload.data?.count || 0) setCount(res.payload.data?.count || 0)
let tableDatas = res.payload.data?.rows?.map(v => ({ let tableDatas = res.payload.data?.rows?.map(v => ({
@ -111,10 +111,10 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
name: r.pepProject?.projectName, state: r.pepProject?.constructionStatus name: r.pepProject?.projectName, state: r.pepProject?.constructionStatus
}))?.filter(c => c), }))?.filter(c => c),
createTime: v.StartTime ? moment(v.StartTime).format("YYYY-MM-DD HH:mm:ss") : "", createTime: v.StartTime ? moment(v.StartTime).format("YYYY-MM-DD HH:mm:ss") : "",
updateTime: v.EndTime ? moment(v.EndTime).format("YYYY-MM-DD HH:mm:ss") : "", updateTime: v.EndTime ? moment(v.EndTime).format("YYYY-MM-DD HH:mm:ss") : "",
confirmTime: v.confirmedTime ? moment(v.confirmedTime).format("YYYY-MM-DD HH:mm:ss") : "", confirmTime: v.confirmedTime ? moment(v.confirmedTime).format("YYYY-MM-DD HH:mm:ss") : "",
SourceName: v.SourceName, SourceName: v.SourceName,
AlarmGroupUnit: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "", AlarmGroupUnit: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "",
Strategy: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "", Strategy: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "",
type: route == 'deviceAbnormal' ? v.DeviceStatus == 0 ? "离线" : '' : v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "", type: route == 'deviceAbnormal' ? v.DeviceStatus == 0 ? "离线" : '' : v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "",
cameraKindId: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "", cameraKindId: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "",
@ -137,7 +137,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
break; break;
} }
}, [query, search]) }, [query, search, pepProjectId])
return ( return (
@ -348,11 +348,12 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth, global, members } = state; const { auth, global, members } = state;
// console.log(auth.user); // console.log(global);
return { return {
user: auth.user, user: auth.user,
actions: global.actions, actions: global.actions,
global: global, global: global,
pepProjectId: global.pepProjectId,
// members: members, // members: members,
}; };
} }

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

@ -161,7 +161,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
// //
const tableList = { const tableList = {
dataLnterrupt: ['index', 'projectName', 'StructureName', 'SourceName', 'AlarmGroupUnit', 'AlarmCodeName', 'sustainTime', 'createTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime',], dataLnterrupt: ['index', 'projectName', 'StructureName', 'SourceName', 'AlarmGroupUnit', 'AlarmCodeName', 'sustainTime', 'createTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime',],
dataAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'type', 'alarmType', 'createTime', 'sustainTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'], dataAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'type', 'createTime', 'sustainTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'],
strategyHit: ['index', 'projectName', 'StructureName', 'SourceName', 'Strategy', 'State', 'createTime', 'sustainTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'], strategyHit: ['index', 'projectName', 'StructureName', 'SourceName', 'Strategy', 'State', 'createTime', 'sustainTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'],
videoAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'station', 'cameraKindId', 'sustainTime', 'venderName', 'point', 'cameraSerialNo', 'cameraChannelNo', 'platform', 'AlarmContent', 'resolve', 'createTime', 'updateTime', 'confirm', 'confirmTime', 'camerOnline'], videoAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'station', 'cameraKindId', 'sustainTime', 'venderName', 'point', 'cameraSerialNo', 'cameraChannelNo', 'platform', 'AlarmContent', 'resolve', 'createTime', 'updateTime', 'confirm', 'confirmTime', 'camerOnline'],
useAbnormal: ['index', 'projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'sustainTime', 'updateTime', 'confirm', 'confirmTime'], useAbnormal: ['index', 'projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'sustainTime', 'updateTime', 'confirm', 'confirmTime'],
@ -228,7 +228,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
return r.SourceName ? <div style={{ width: data ? 136 : 84, display: 'flex', justifyContent: 'space-between' }}> return r.SourceName ? <div style={{ width: data ? 136 : 84, display: 'flex', justifyContent: 'space-between' }}>
<div style={{ display: "inline-block", width: 84, lineHeight: "20px" }}>{r.SourceName}</div> <div style={{ display: "inline-block", width: 84, lineHeight: "20px" }}>{r.SourceName}</div>
{data ? <div style={{ display: "inline-block", width: 44, height: 18, lineHeight: '18px', textAlign: "center", border: '1px solid #0F7EFB', fontWeight: 400, color: '#0F7EFB', fontSize: 12 }}>{data}</div> : ""} {data ? <div style={{ display: "inline-block", width: 44, height: 18, lineHeight: '18px', textAlign: "center", border: '1px solid #0F7EFB', fontWeight: 400, color: '#0F7EFB', fontSize: 12 }}>{data}</div> : ""}
</div> : "" </div> : ""
} }
}, },
{ name: '测点', sort: 4.1, value: 'point', render: (_, r, index) => r.station?.length > 0 ? r.station?.map(v => <div key={v.resolve + v.id} style={{ lineHeight: "22px" }}>{v.name}</div>) : "无" }, { name: '测点', sort: 4.1, value: 'point', render: (_, r, index) => r.station?.length > 0 ? r.station?.map(v => <div key={v.resolve + v.id} style={{ lineHeight: "22px" }}>{v.name}</div>) : "无" },
@ -250,7 +250,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
{ name: '产生次数', sort: 19, value: 'detailCount', render: (_, r, index) => r.detailCount + '次' }, { name: '产生次数', sort: 19, value: 'detailCount', render: (_, r, index) => r.detailCount + '次' },
{ {
name: '确认信息', sort: 20, value: 'confirm', render: (_, r, index) => { name: '确认信息', sort: 20, value: 'confirm', render: (_, r, index) => {
return r.State == 3 || r.autoRestore || r.confirmAuto ? '无' : r.State == 4 ? r.confirm || '无' : r.confirmTime ? r.confirm : '未确认' return r.State == 3 || r.autoRestore || r.confirmAuto ? '无' : r.State == 4 ? r.confirm || '无' : r.confirmTime ? r.confirm || '无' : '未确认'
} }
}, },
{ name: '确认/恢复时间', sort: 21, value: 'confirmTime', render: (_, r, index) => <div style={{ width: 130 }}>{r.confirmTime ? r.confirmTime : "无"}</div> }, { name: '确认/恢复时间', sort: 21, value: 'confirmTime', render: (_, r, index) => <div style={{ width: 130 }}>{r.confirmTime ? r.confirmTime : "无"}</div> },

Loading…
Cancel
Save